Esempio n. 1
0
    /**
     * CampCache class constructor.
     *
     */
    private function __construct($p_cacheEngine)
    {
        global $Campsite;

        if (empty($p_cacheEngine)) {
            return;
        }

        $this->m_cacheEngine = CacheEngine::Factory($p_cacheEngine);
        if (is_null($this->m_cacheEngine) || !$this->m_cacheEngine->isSupported()) {
            self::$m_enabled = false;
            SystemPref::Set('DBCacheEngine', '');
            CampSession::singleton()->setData('system_preferences', null, 'default', true);
            return;
        } else {
            self::$m_enabled = true;
        }

        if (isset($Campsite['CAMP_SECRET'])) {
            $this->m_secret = $Campsite['CAMP_SECRET'];
        } else {
            $this->m_secret = $Campsite['DATABASE_USER']
                .$Campsite['DATABASE_NAME']
                .$Campsite['DATABASE_SERVER_ADDRESS']
                .$Campsite['WWW_DIR'];
        }
    } // fn __construct
Esempio n. 2
0
 /**
  * CampCache class constructor.
  * @deprecated from 4.3, removed in 4.4, use newscoop.cache service
  */
 private function __construct($p_cacheEngine)
 {
     return;
     global $Campsite;
     if (empty($p_cacheEngine)) {
         return;
     }
     $preferencesService = \Zend_Registry::get('container')->getService('system_preferences_service');
     $this->m_cacheEngine = CacheEngine::Factory($p_cacheEngine);
     if (is_null($this->m_cacheEngine) || !$this->m_cacheEngine->isSupported()) {
         self::$m_enabled = false;
         $preferencesService->DBCacheEngine = '';
         return;
     } else {
         self::$m_enabled = true;
     }
     if (isset($Campsite['CAMP_SECRET'])) {
         $this->m_secret = $Campsite['CAMP_SECRET'];
     } else {
         $this->m_secret = $Campsite['DATABASE_USER'] . $Campsite['DATABASE_NAME'] . $Campsite['DATABASE_SERVER_ADDRESS'] . $Campsite['WWW_DIR'];
     }
 }