GetConfigInstance() public static méthode

Returns a CampConfig instance.
public static GetConfigInstance ( ) : object
Résultat object A CampConfig instance
    /**
     * Class constructor
     */
    final public function __construct()
    {
        // gets the config object from the main class
        $config = CampSite::GetConfigInstance();

        // sets the new connection resource
        $this->m_db = ADONewConnection($config->getSetting('db.type'));
        $this->m_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $this->m_db->Connect($config->getSetting('db.host'),
                             $config->getSetting('db.user'),
                             $config->getSetting('db.pass'),
                             $config->getSetting('db.name'));
    } // fn __construct
    private function __construct()
    {
        parent::Smarty();

        $config = CampSite::GetConfigInstance();

        $this->debugging = $config->getSetting('smarty.debugging');
        $this->force_compile = $config->getSetting('smarty.force_compile');
        $this->compile_check = $config->getSetting('smarty.compile_check');
        $this->use_sub_dirs = $config->getSetting('smarty.use_subdirs');

        // cache settings
        $cacheHandler = SystemPref::Get('TemplateCacheHandler');
        if ($cacheHandler) {
            $this->caching = 1;
            $this->cache_handler_func = "TemplateCacheHandler_$cacheHandler::handler";
            require_once CS_PATH_SITE.DIR_SEP.'classes'.DIR_SEP.'cache'.DIR_SEP."TemplateCacheHandler_$cacheHandler.php";
        } else {
            $this->caching = 0;
        }

        // define dynamic uncached block
        require_once CS_PATH_SMARTY.DIR_SEP.'campsite_plugins/block.dynamic.php';
        $this->register_block('dynamic', 'smarty_block_dynamic', false);

        // define render function
        require_once CS_PATH_SMARTY.DIR_SEP.'campsite_plugins/function.render.php';
        $this->register_function('render', 'smarty_function_render', false);

        $this->left_delimiter = $config->getSetting('smarty.left_delimeter');
        $this->right_delimiter = $config->getSetting('smarty.right_delimeter');

        $this->cache_dir = CS_PATH_SITE.DIR_SEP.'cache';
        $this->config_dir = CS_PATH_SMARTY.DIR_SEP.'configs';

        $plugin_smarty_camp_plugin_paths = array();
        foreach (CampPlugin::GetEnabled() as $CampPlugin) {
            $plugin_smarty_camp_plugin_paths[] = CS_PATH_SITE.DIR_SEP.$CampPlugin->getBasePath().DIR_SEP.'smarty_camp_plugins';
        }

        $this->plugins_dir = array_merge(array(CS_PATH_SMARTY.DIR_SEP.'campsite_plugins',
                                               CS_PATH_SMARTY.DIR_SEP.'plugins'),
                                         $plugin_smarty_camp_plugin_paths);
        $this->template_dir = CS_PATH_TEMPLATES;
        $this->compile_dir = CS_PATH_SITE.DIR_SEP.'templates_cache';
    } // fn __constructor
 /**
  */
 public function __construct()
 {
     parent::__construct();
     $config = CampSite::GetConfigInstance();
     $this->debugging = $config->getSetting('smarty.debugging');
     $this->force_compile = $config->getSetting('smarty.force_compile');
     $this->compile_check = $config->getSetting('smarty.compile_check');
     $this->use_sub_dirs = $config->getSetting('smarty.use_subdirs');
     // cache settings
     $preferencesService = \Zend_Registry::get('container')->getService('system_preferences_service');
     $this->useprotocol = $preferencesService->get('SmartyUseProtocol') === 'Y' ? 'true' : 'false';
     $this->templateCacheHandler = $preferencesService->TemplateCacheHandler;
     if ($this->templateCacheHandler) {
         $this->caching = 1;
         $this->caching_type = 'newscoop';
         CampTemplateCache::factory();
     } else {
         $this->caching = 0;
     }
     if (defined('APPLICATION_ENV') && APPLICATION_ENV == 'development') {
         $this->force_compile = true;
     }
     // define dynamic uncached block
     require_once APPLICATION_PATH . self::PLUGINS . '/block.dynamic.php';
     $this->registerPlugin('block', 'dynamic', 'smarty_block_dynamic', false);
     // define render function
     require_once APPLICATION_PATH . self::PLUGINS . '/function.render.php';
     $this->registerPlugin('function', 'render', 'smarty_function_render', false);
     // define translate modifier
     require_once APPLICATION_PATH . self::PLUGINS . '/modifier.translate.php';
     $this->registerPlugin('modifier', 'translate', 'smarty_modifier_translate', false);
     $this->left_delimiter = '{{';
     $this->right_delimiter = '}}';
     $this->auto_literal = false;
     $this->cache_dir = APPLICATION_PATH . '/../cache';
     $this->compile_dir = APPLICATION_PATH . '/../cache';
     $this->plugins_dir = array_merge((array) $this->plugins_dir, array(APPLICATION_PATH . self::PLUGINS), self::getPluginsPluginsDir());
     $this->setTemplateDir(array(APPLICATION_PATH . '/../themes/', APPLICATION_PATH . '/../themes/system_templates/', APPLICATION_PATH . self::SCRIPTS));
     $this->assign('view', \Zend_Registry::get('container')->get('view'));
     $this->assign('userindex', false);
     $this->assign('user', new MetaUser());
     $this->assign('siteinfo', array('title' => $preferencesService->SiteTitle, 'keywords' => $preferencesService->SiteMetaKeywords, 'description' => $preferencesService->SiteMetaDescription));
     $this->getTemplateTranslationsFiles();
 }
Exemple #4
0
 /**
  */
 public function __construct()
 {
     parent::__construct();
     $config = CampSite::GetConfigInstance();
     $this->debugging = $config->getSetting('smarty.debugging');
     $this->force_compile = $config->getSetting('smarty.force_compile');
     $this->compile_check = $config->getSetting('smarty.compile_check');
     $this->use_sub_dirs = $config->getSetting('smarty.use_subdirs');
     $this->allow_php_tag = true;
     // cache settings
     $cacheHandler = SystemPref::Get('TemplateCacheHandler');
     $auth = Zend_Auth::getInstance();
     if ($cacheHandler) {
         $this->caching = 1;
         $this->caching_type = 'newscoop';
         CampTemplateCache::factory();
     } else {
         $this->caching = 0;
     }
     if (self::isDevelopment()) {
         $this->force_compile = true;
     }
     // define dynamic uncached block
     require_once APPLICATION_PATH . self::PLUGINS . '/block.dynamic.php';
     $this->registerPlugin('block', 'dynamic', 'smarty_block_dynamic', false);
     // define render function
     require_once APPLICATION_PATH . self::PLUGINS . '/function.render.php';
     $this->registerPlugin('function', 'render', 'smarty_function_render', false);
     $this->left_delimiter = '{{';
     $this->right_delimiter = '}}';
     $this->auto_literal = false;
     $this->cache_dir = APPLICATION_PATH . '/../cache';
     $this->config_dir = APPLICATION_PATH . '/../configs';
     $this->compile_dir = APPLICATION_PATH . '/../cache';
     $this->plugins_dir = array_merge((array) $this->plugins_dir, array(APPLICATION_PATH . self::PLUGINS), self::getPluginsPluginsDir());
     $this->template_dir = array(APPLICATION_PATH . '/../themes/', APPLICATION_PATH . '/../themes/unassigned/system_templates/', APPLICATION_PATH . self::SCRIPTS);
     if (isset($GLOBALS['controller'])) {
         $this->assign('view', $GLOBALS['controller']->view);
     }
 }
    /**
     * Sets the document title.
     *
     * @param string $p_title
     *
     * @return void
     */
    public function setTitle($p_title = null)
    {
        $config = CampSite::GetConfigInstance();

        if($config->getSetting('site.online') == 'N') {
            $p_title .= ' [ Offline ]';
        }

        $this->m_title = $p_title;
    } // fn setTitle
Exemple #6
0
 /**
  * Reads a configuration setting.
  *
  * @param string $p_varName
  *
  * @return mixed
  *      The value of the configuration variable
  */
 protected function getSetting($p_varName)
 {
     $config = CampSite::GetConfigInstance();
     return $config->getSetting($p_varName);
 }