Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • 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:  * @version    SVN Revision $Rev:$
 8:  *
 9:  * @author     Unknown
10:  * @copyright  four for business AG <www.4fb.de>
11:  * @license    http://www.contenido.org/license/LIZENZ.txt
12:  * @link       http://www.4fb.de
13:  * @link       http://www.contenido.org
14:  */
15: 
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: /**
19:  * Generates the step display.
20:  *
21:  * @param   int  iCurrentStep  The current step to display active.
22:  * @return  string
23:  */
24: function cGenerateSetupStepsDisplay($iCurrentStep) {
25:     if (!defined('CON_SETUP_STEPS')) {
26:         return '';
27:     }
28:     $sStepsPath = '';
29:     for ($i = 1; $i < CON_SETUP_STEPS + 1; $i++) {
30:         $sCssActive = '';
31:         if ($iCurrentStep == $i) {
32:             $sCssActive = 'active';
33:         }
34:         $sStepsPath .= '<span class="' . $sCssActive . '">&nbsp;' . strval($i) . '&nbsp;</span>&nbsp;&nbsp;&nbsp;';
35:     }
36:     return $sStepsPath;
37: }
38: 
39: /**
40:  * Logs general setup failures into setuplog.txt in logs directory.
41:  *
42:  * @param   string  $sErrorMessage  Message to log in file
43:  * @return  void
44:  */
45: function logSetupFailure($sErrorMessage) {
46:     global $cfg;
47:     cFileHandler::write($cfg['path']['contenido_logs'] . 'setuplog.txt', $sErrorMessage . PHP_EOL . PHP_EOL, true);
48: }
49: 
50: /**
51:  * Initializes clients configuration, if not done before
52:  * @global  array  $cfg
53:  * @global  array  $cfgClient
54:  * @param  bool  $reset  Flag to reset any existing client configuration
55:  */
56: function setupInitializeCfgClient($reset = false) {
57:     global $cfg, $cfgClient;
58: 
59:     if (true === $reset) {
60:         $cfgClient = array();
61:     }
62: 
63:     // Load client configuration
64:     if (empty($cfgClient) || !isset($cfgClient['set'])) {
65:         if (cFileHandler::exists($cfg['path']['contenido_config'] . 'config.clients.php')) {
66:             require($cfg['path']['contenido_config'] . 'config.clients.php');
67:         } else {
68:             $db = getSetupMySQLDBConnection();
69: 
70:             $db->query("SELECT * FROM " . $cfg["tab"]["clients"]);
71:             while($db->nextRecord()) {
72:                 updateClientCache($db->f("idclient"), $db->f("htmlpath"), $db->f("frontendpath"));
73:             }
74:         }
75:     }
76: }
77: 
78: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0