Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Functions

  • cGenerateSetupStepsDisplay
  • checkImageResizer
  • logSetupFailure
  • setupInitializeCfgClient
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * This file contains various helper functions to deal with the setup process.
 4:  *
 5:  * @package    Setup
 6:  * @subpackage Helper
 7:  * @author     Unknown
 8:  * @copyright  four for business AG <www.4fb.de>
 9:  * @license    http://www.contenido.org/license/LIZENZ.txt
10:  * @link       http://www.4fb.de
11:  * @link       http://www.contenido.org
12:  */
13: 
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15: 
16: /**
17:  * Generates the step display.
18:  *
19:  * @param   int  $iCurrentStep  The current step to display active.
20:  * @return  string
21:  */
22: function cGenerateSetupStepsDisplay($iCurrentStep) {
23:     if (!defined('CON_SETUP_STEPS')) {
24:         return '';
25:     }
26:     $sStepsPath = '';
27:     for ($i = 1; $i < CON_SETUP_STEPS + 1; $i++) {
28:         $sCssActive = '';
29:         if ($iCurrentStep == $i) {
30:             $sCssActive = 'active';
31:         }
32:         $sStepsPath .= '<span class="' . $sCssActive . '">&nbsp;' . strval($i) . '&nbsp;</span>&nbsp;&nbsp;&nbsp;';
33:     }
34:     return $sStepsPath;
35: }
36: 
37: /**
38:  * Logs general setup failures into setuplog.txt in logs directory.
39:  *
40:  * @param   string  $sErrorMessage  Message to log in file
41:  */
42: function logSetupFailure($sErrorMessage) {
43:     global $cfg;
44:     cFileHandler::write($cfg['path']['contenido_logs'] . 'setuplog.txt', $sErrorMessage . PHP_EOL . PHP_EOL, true);
45: }
46: 
47: /**
48:  * Initializes clients configuration, if not done before
49:  * @global  array  $cfg
50:  * @global  array  $cfgClient
51:  * @param  bool  $reset  Flag to reset any existing client configuration
52:  */
53: function setupInitializeCfgClient($reset = false) {
54:     global $cfg, $cfgClient;
55: 
56:     if (true === $reset) {
57:         $cfgClient = array();
58:     }
59: 
60:     // Load client configuration
61:     if (empty($cfgClient) || !isset($cfgClient['set'])) {
62:         if (cFileHandler::exists($cfg['path']['contenido_config'] . 'config.clients.php')) {
63:             require($cfg['path']['contenido_config'] . 'config.clients.php');
64:         } else {
65:             $db = getSetupMySQLDBConnection();
66: 
67:             $db->query("SELECT * FROM " . $cfg["tab"]["clients"]);
68:             while ($db->nextRecord()) {
69:                 updateClientCache($db->f("idclient"), $db->f("htmlpath"), $db->f("frontendpath"));
70:             }
71:         }
72:     }
73: }
74: 
75: ?>
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0