本文整理汇总了PHP中AppCache::check方法的典型用法代码示例。如果您正苦于以下问题:PHP AppCache::check方法的具体用法?PHP AppCache::check怎么用?PHP AppCache::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppCache
的用法示例。
在下文中一共展示了AppCache::check方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCache
/**
* Returns cache
*
* @return AppCache The update cache
* @since 2.0
*/
protected function getCache()
{
if (empty($this->_cache)) {
$this->_cache = $this->app->cache->create($this->app->path->path('cache:') . '/zoo_update_cache');
if (!$this->_cache->check()) {
$this->app->system->application->enqueueMessage('Cache not writeable please update the file permissions!', 'warning');
}
}
return $this->_cache;
}
示例2: __construct
/**
* Class constructor
*
* @param string $app App instance.
* @since 2.0
*/
public function __construct($app)
{
parent::__construct($app);
if ($app->get('cache_routes', false)) {
// get route cache
// refreshes after one hour automatically
$this->_cache = $app->cache->create($app->path->path('cache:') . '/routes', true, 3600, 'apc');
if (!$this->_cache || !$this->_cache->check()) {
$this->_cache = null;
} else {
$this->_find(null, null);
$key = json_encode($this->_menu_items);
if (!$this->_cache->get($key)) {
$this->_cache->clear()->set($key, true)->save();
}
}
}
if ($app->request->getCmd('task') == 'category' || $app->request->getCmd('view') == 'category') {
$this->_category_id = (int) $app->request->getInt('category_id', method_exists($app->system->application, 'getParams') ? $app->system->application->getParams()->get('category') : null);
}
if ($menu_item = $app->menu->getActive()) {
$this->_active_menu_item_id = $menu_item->id;
}
}
示例3: __construct
/**
* Class constructor
*
* @param string $app App instance.
*/
public function __construct($app)
{
// set application
$this->app = $app;
// cache
if ($this->app->get('cache_routes', false)) {
// get route cache
// refreshes after one hour automatically
$this->_cache = $this->app->cache->create($this->app->path->path('cache:') . '/routes', true, 3600, 'apc');
if (!$this->_cache || !$this->_cache->check()) {
$this->_cache = null;
} else {
$this->_find(null, null);
$key = json_encode($this->_menu_items);
if (!$this->_cache->get($key)) {
$this->_cache->clear()->set($key, true)->save();
}
}
}
// save default menu
if ($menu_item = $this->app->menu->getActive()) {
$this->_active_menu_item_id = $menu_item->id;
}
}