コード例 #1
0
ファイル: OutputController.php プロジェクト: crlang44/frapi
 /**
  * Refresh the APC cache by deleting APC entries.
  *
  * @return void
  */
 public function refreshAPCCache()
 {
     $configModel = new Default_Model_Configuration();
     $server = $configModel->getKey('api_url');
     $hash = isset($server) ? hash('sha1', $server) : '';
     $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);
     $cache->delete($hash . '-Output.default-format');
 }
コード例 #2
0
ファイル: Error.php プロジェクト: helgi/frapi
 /**
  * Refresh the APC cache by deleting APC entry.
  *
  * @return void
  */
 public function refreshAPCCache()
 {
     $configModel = new Default_Model_Configuration();
     $server = $configModel->getKey('api_url');
     $hash = isset($server) ? hash('sha1', $server) : '';
     $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);
     $cache->delete($hash . '-Errors.user-defined');
     $cache->delete($hash . '-configFile-errors');
 }
コード例 #3
0
 /**
  * Initialize 
  *
  * This method does the pre-requisite for the Controller to work
  * and function correctly
  *
  * @return void
  */
 public function init($styles = array())
 {
     $actions = array('index', 'detail', 'unset', 'unsetall');
     $this->_helper->_acl->allow('admin', $actions);
     $configModel = new Default_Model_Configuration();
     $server = $configModel->getKey('api_url');
     $cache = $configModel->getKey('cache');
     $this->cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);
     $this->hash = isset($server) ? hash('sha1', $server) : '';
     $this->cache_keys = array("Output.default-format", "Errors.user-defined", "Router.routes-prepared", "Internal.database-dsn", "Output.formats-enabled", "Actions.enabled-private", "Actions.enabled-public", "Partners.emails-keys", "Cache.adapter", 'Database.configs');
     parent::init($styles);
 }
コード例 #4
0
ファイル: Action.php プロジェクト: rjack/frapi
 /**
  * Refresh the APC cache by deleting APC entries.
  *
  * @return void
  */
 public function refreshAPCCache()
 {
     $configModel = new Default_Model_Configuration();
     $server = $configModel->getKey('api_url');
     $hash = isset($server) ? hash('sha1', $server) : '';
     $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);
     $cache->delete($hash . '-Actions.enabled-public');
     $cache->delete($hash . '-Actions.enabled-private');
     $cache->delete($hash . '-Router.routes-prepared');
     $cache->delete($hash . '-configFile-actions');
 }
コード例 #5
0
ファイル: CacheTest.php プロジェクト: jeremykendall/frapi
 /**
  * Tests Frapi_Cache::getInstance() returns wincache adapter
  */
 public function testGetInstanceAdapterDoesNotExist()
 {
     $this->setExpectedException('Frapi_Cache_Adapter_Exception', 'Frapi_Cache_Adapter_Wtf does not exist');
     $adapter = Frapi_Cache::getInstance('wtf');
 }
コード例 #6
0
ファイル: Cache.php プロジェクト: jeremykendall/spaz-api
 /**
  * Constructor
  *
  * This is the constructor of the Frapi_Cache class.
  *
  * @param  string $adapter The adapter to load.
  * @param  array  $options Potentially a list of options per adapter.
  * @return void
  */
 public function __construct($adapter = 'apc', $options = array())
 {
     $this->cacheObject = Frapi_Cache::getInstance($adapter);
 }
コード例 #7
0
ファイル: Internal.php プロジェクト: jeremykendall/frapi
 /**
  * Delete key from cache(s).
  *
  * This method deletes a key from the cache instance.
  *
  * @param  string  The cached key to delete.
  * @return void
  */
 public static function deleteCached($key)
 {
     self::log('cache-delete', $key);
     $hash = self::getHash();
     if (!isset(self::$cache)) {
         self::$cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);
     }
     return self::$cache->delete($hash . '-' . $key);
 }
コード例 #8
0
ファイル: Internal.php プロジェクト: jeremykendall/spaz-api
 public static function getConfiguration($type)
 {
     if (!isset(self::$cache)) {
         self::$cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);
     }
     if (!isset(self::$conf[$type])) {
         self::initConfiguration($type);
     }
     return self::$conf[$type];
 }