当前位置: 首页>>代码示例>>PHP>>正文


PHP DevblocksPlatform::getCacheService方法代码示例

本文整理汇总了PHP中DevblocksPlatform::getCacheService方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::getCacheService方法的具体用法?PHP DevblocksPlatform::getCacheService怎么用?PHP DevblocksPlatform::getCacheService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DevblocksPlatform的用法示例。


在下文中一共展示了DevblocksPlatform::getCacheService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

<?php

if (version_compare(PHP_VERSION, "5.1.2", "<")) {
    die("This application requires PHP 5.1.2 or later.");
}
@set_time_limit(3600);
require '../framework.config.php';
require_once DEVBLOCKS_PATH . 'Devblocks.class.php';
require_once APP_PATH . '/api/Application.class.php';
require_once APP_PATH . '/install/classes.php';
DevblocksPlatform::getCacheService()->clean();
// DevblocksPlatform::init() workaround
if (!defined('DEVBLOCKS_WEBPATH')) {
    $php_self = $_SERVER["PHP_SELF"];
    $php_self = str_replace('/install', '', $php_self);
    $pos = strrpos($php_self, '/');
    $php_self = substr($php_self, 0, $pos) . '/';
    @define('DEVBLOCKS_WEBPATH', $php_self);
}
define('STEP_ENVIRONMENT', 1);
define('STEP_DATABASE', 2);
define('STEP_SAVE_CONFIG_FILE', 3);
define('STEP_INIT_DB', 4);
define('STEP_FINISHED', 5);
define('TOTAL_STEPS', 5);
// Import GPC variables to determine our scope/step.
@($step = DevblocksPlatform::importGPC($_REQUEST['step'], 'integer'));
/*
 * [TODO] We can run some quick tests to bypass steps we've already passed
 * even when returning to the page with a NULL step.
 */
开发者ID:sluther,项目名称:portsensor,代码行数:31,代码来源:index.php

示例2: __construct

 private function __construct()
 {
     $cache = DevblocksPlatform::getCacheService();
     if (null !== ($map = $cache->load(self::CACHE_CLASS_MAP))) {
         $this->classMap = $map;
     } else {
         $this->_initLibs();
         $this->_initPlugins();
         $cache->save($this->classMap, self::CACHE_CLASS_MAP);
     }
 }
开发者ID:jstanden,项目名称:devblocks,代码行数:11,代码来源:Devblocks.class.php

示例3: set

 public function set($key, $value)
 {
     DAO_Setting::set($key, $value);
     $this->settings[$key] = $value;
     $cache = DevblocksPlatform::getCacheService();
     $cache->remove(CerberusApplication::CACHE_SETTINGS_DAO);
     // Nuke sender cache
     if ($key == self::DEFAULT_REPLY_FROM) {
         $cache->remove(CerberusApplication::CACHE_HELPDESK_FROMS);
     }
     return TRUE;
 }
开发者ID:Hildy,项目名称:cerb4,代码行数:12,代码来源:Application.class.php

示例4: set

 static function set($tool_code, $key, $value)
 {
     $db = DevblocksPlatform::getDatabaseService();
     $db->Replace('community_tool_property', array(self::TOOL_CODE => $db->qstr($tool_code), self::PROPERTY_KEY => $db->qstr($key), self::PROPERTY_VALUE => $db->qstr($value)), array(self::TOOL_CODE, self::PROPERTY_KEY), false);
     // Invalidate cache
     $cache = DevblocksPlatform::getCacheService();
     $cache->remove(self::_CACHE_PREFIX . $tool_code);
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:8,代码来源:DAO.php

示例5: getSettings

 static function getSettings()
 {
     $cache = DevblocksPlatform::getCacheService();
     if (false === ($settings = $cache->load(Application::CACHE_SETTINGS_DAO))) {
         $db = DevblocksPlatform::getDatabaseService();
         $settings = array();
         $sql = sprintf("SELECT setting,value FROM setting");
         $rs = $db->Execute($sql) or die(__CLASS__ . ':' . $db->ErrorMsg());
         /* @var $rs ADORecordSet */
         while (!$rs->EOF) {
             $settings[$rs->Fields('setting')] = $rs->Fields('value');
             $rs->MoveNext();
         }
         $cache->save($settings, Application::CACHE_SETTINGS_DAO);
     }
     return $settings;
 }
开发者ID:sluther,项目名称:portsensor,代码行数:17,代码来源:DAO.class.php

示例6: handleRequest

 function handleRequest(DevblocksHttpRequest $request)
 {
     @set_time_limit(0);
     // no timelimit (when possible)
     $translate = DevblocksPlatform::getTranslationService();
     $stack = $request->path;
     array_shift($stack);
     // update
     $cache = DevblocksPlatform::getCacheService();
     /* @var $cache _DevblocksCacheManager */
     $settings = DevblocksPlatform::getPluginSettingsService();
     switch (array_shift($stack)) {
         case 'locked':
             if (!DevblocksPlatform::versionConsistencyCheck()) {
                 $url = DevblocksPlatform::getUrlService();
                 echo "<h1>Cerberus Helpdesk 5.x</h1>";
                 echo "The helpdesk is currently waiting for an administrator to finish upgrading. " . "Please wait a few minutes and then " . sprintf("<a href='%s'>try again</a>.<br><br>", $url->write('c=update&a=locked'));
                 echo sprintf("If you're an admin you may <a href='%s'>finish the upgrade</a>.", $url->write('c=update'));
             } else {
                 DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login')));
             }
             break;
         default:
             $path = APP_TEMP_PATH . DIRECTORY_SEPARATOR;
             $file = $path . 'c4update_lock';
             $authorized_ips_str = $settings->get('cerberusweb.core', CerberusSettings::AUTHORIZED_IPS);
             $authorized_ips = DevblocksPlatform::parseCrlfString($authorized_ips_str);
             $authorized_ip_defaults = DevblocksPlatform::parseCsvString(AUTHORIZED_IPS_DEFAULTS);
             $authorized_ips = array_merge($authorized_ips, $authorized_ip_defaults);
             // Is this IP authorized?
             $pass = false;
             foreach ($authorized_ips as $ip) {
                 if (substr($ip, 0, strlen($ip)) == substr($_SERVER['REMOTE_ADDR'], 0, strlen($ip))) {
                     $pass = true;
                     break;
                 }
             }
             if (!$pass) {
                 echo vsprintf($translate->_('update.ip_unauthorized'), $_SERVER['REMOTE_ADDR']);
                 return;
             }
             // Check requirements
             $errors = CerberusApplication::checkRequirements();
             if (!empty($errors)) {
                 echo $translate->_('update.correct_errors');
                 echo "<ul style='color:red;'>";
                 foreach ($errors as $error) {
                     echo "<li>" . $error . "</li>";
                 }
                 echo "</ul>";
                 exit;
             }
             // If authorized, lock and attempt update
             if (!file_exists($file) || @filectime($file) + 600 < time()) {
                 // 10 min lock
                 touch($file);
                 //echo "Running plugin patches...<br>";
                 if (DevblocksPlatform::runPluginPatches('core.patches')) {
                     @unlink($file);
                     // [JAS]: Clear all caches
                     $cache->clean();
                     DevblocksPlatform::getClassLoaderService()->destroy();
                     // Clear compiled templates
                     $tpl = DevblocksPlatform::getTemplateService();
                     $tpl->clear_compiled_tpl();
                     // Reload plugin translations
                     DAO_Translation::reloadPluginStrings();
                     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login')));
                 } else {
                     @unlink($file);
                     echo "Failure!";
                     // [TODO] Needs elaboration
                 }
                 break;
             } else {
                 echo $translate->_('update.locked_another');
             }
     }
     exit;
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:80,代码来源:Update.php

示例7: set

 public function set($key, $value)
 {
     DAO_Setting::set($key, $value);
     $this->settings[$key] = $value;
     $cache = DevblocksPlatform::getCacheService();
     $cache->remove(Application::CACHE_SETTINGS_DAO);
     return TRUE;
 }
开发者ID:sluther,项目名称:portsensor,代码行数:8,代码来源:Application.class.php

示例8: handleRequest

 function handleRequest(DevblocksHttpRequest $request)
 {
     @set_time_limit(0);
     // no timelimit (when possible)
     $translate = DevblocksPlatform::getTranslationService();
     $stack = $request->path;
     array_shift($stack);
     // update
     $cache = DevblocksPlatform::getCacheService();
     /* @var $cache _DevblocksCacheManager */
     switch (array_shift($stack)) {
         case 'locked':
             if (!DevblocksPlatform::versionConsistencyCheck()) {
                 $url = DevblocksPlatform::getUrlService();
                 echo "<h1>Feg - Fax Email Gateway 1.x</h1>";
                 echo "The application is currently waiting for an administrator to finish upgrading. " . "Please wait a few minutes and then " . sprintf("<a href='%s'>try again</a>.<br><br>", $url->write('c=update&a=locked'));
                 echo sprintf("If you're an admin you may <a href='%s'>finish the upgrade</a>.", $url->write('c=update'));
             } else {
                 DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login')));
             }
             break;
         default:
             $path = APP_TEMP_PATH . DIRECTORY_SEPARATOR;
             $file = $path . 'feg_update_lock';
             $settings = DevblocksPlatform::getPluginSettingsService();
             $authorized_ips_str = $settings->get('feg.core', FegSettings::AUTHORIZED_IPS);
             $authorized_ips = DevblocksPlatform::parseCrlfString($authorized_ips_str);
             $authorized_ip_defaults = DevblocksPlatform::parseCsvString(AUTHORIZED_IPS_DEFAULTS);
             $authorized_ips = array_merge($authorized_ips, $authorized_ip_defaults);
             // Is this IP authorized?
             $pass = false;
             foreach ($authorized_ips as $ip) {
                 if (substr($ip, 0, strlen($ip)) == substr($_SERVER['REMOTE_ADDR'], 0, strlen($ip))) {
                     $pass = true;
                     break;
                 }
             }
             if (!$pass) {
                 echo vsprintf($translate->_('update.ip_unauthorized'), $_SERVER['REMOTE_ADDR']);
                 return;
             }
             // Check requirements
             $errors = FegApplication::checkRequirements();
             if (!empty($errors)) {
                 echo $translate->_('update.correct_errors');
                 echo "<ul style='color:red;'>";
                 foreach ($errors as $error) {
                     echo "<li>" . $error . "</li>";
                 }
                 echo "</ul>";
                 exit;
             }
             try {
                 // If authorized, lock and attempt update
                 if (!file_exists($file) || @filectime($file) + 600 < time()) {
                     // 10 min lock
                     // Log everybody out since we're touching the database
                     $session = DevblocksPlatform::getSessionService();
                     $session->clearAll();
                     // Lock file
                     touch($file);
                     // Recursive patch
                     FegApplication::update();
                     // Clean up
                     @unlink($file);
                     $cache = DevblocksPlatform::getCacheService();
                     $cache->save(APP_BUILD, "devblocks_app_build");
                     // Clear all caches
                     $cache->clean();
                     DevblocksPlatform::getClassLoaderService()->destroy();
                     // Clear compiled templates
                     $tpl = DevblocksPlatform::getTemplateService();
                     $tpl->utility->clearCompiledTemplate();
                     $tpl->cache->clearAll();
                     // Reload plugin translations
                     DAO_Translation::reloadPluginStrings();
                     // Redirect
                     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login')));
                 } else {
                     echo $translate->_('update.locked_another');
                 }
             } catch (Exception $e) {
                 unlink($file);
                 die($e->getMessage());
             }
     }
     exit;
 }
开发者ID:rmiddle,项目名称:feg,代码行数:88,代码来源:Update.php

示例9: versionConsistencyCheck

 /**
  * Checks to see if the application needs to patch
  *
  * @return boolean
  */
 static function versionConsistencyCheck()
 {
     $cache = DevblocksPlatform::getCacheService();
     /* @var Zend_Cache_Core $cache */
     if (null === ($build_cache = $cache->load("devblocks_app_build")) || $build_cache != APP_BUILD) {
         // If build changed, clear cache regardless of patch status
         // [TODO] We need to find a nicer way to not clear a shared memcached cluster when only one desk needs to
         $cache = DevblocksPlatform::getCacheService();
         /* @var $cache Zend_Cache_Core */
         $cache->clean('all');
         // Re-read manifests
         DevblocksPlatform::readPlugins();
         if (self::_needsToPatch()) {
             return false;
             // the update script will handle new caches
         } else {
             $cache->save(APP_BUILD, "devblocks_app_build");
             DAO_Translation::reloadPluginStrings();
             // reload strings even without DB changes
             return true;
         }
     }
     return true;
 }
开发者ID:Hildy,项目名称:devblocks,代码行数:29,代码来源:Devblocks.class.php

示例10: clearCache

 static function clearCache()
 {
     $cache = DevblocksPlatform::getCacheService();
     $cache->remove(self::_CACHE_ALL);
 }
开发者ID:rmiddle,项目名称:usermeet,代码行数:5,代码来源:DAO.class.php

示例11: clearCache

 static function clearCache()
 {
     $cache = DevblocksPlatform::getCacheService();
     $cache->remove(self::CACHE_MACRO_ACTIONS);
 }
开发者ID:sluther,项目名称:cerb5-macros,代码行数:5,代码来源:App.php

示例12: clearCountCache

 static function clearCountCache($worker_id)
 {
     $cache = DevblocksPlatform::getCacheService();
     $cache->remove(self::CACHE_COUNT_PREFIX . $worker_id);
 }
开发者ID:rmiddle,项目名称:feg,代码行数:5,代码来源:worker_event.php

示例13: _clearCache

 private function _clearCache()
 {
     // Reload
     $cache = DevblocksPlatform::getCacheService();
     $langs = DAO_Translation::getDefinedLangCodes();
     if (is_array($langs) && !empty($langs)) {
         foreach ($langs as $lang_code => $lang_name) {
             $cache->remove(DevblocksPlatform::CACHE_TAG_TRANSLATIONS . '_' . $lang_code);
         }
     }
 }
开发者ID:jstanden,项目名称:portsensor,代码行数:11,代码来源:App.php

示例14: versionConsistencyCheck

 /**
  * Checks to see if the application needs to patch
  *
  * @return boolean
  */
 static function versionConsistencyCheck()
 {
     $cache = self::getCacheService();
     /* @var Zend_Cache_Core $cache */
     if (null == ($build_cache = $cache->load("devblocks_app_build")) || $build_cache != APP_BUILD) {
         // If build changed, clear cache regardless of patch status
         $cache = DevblocksPlatform::getCacheService();
         /* @var $cache Zend_Cache_Core */
         $cache->clean('all');
         if (self::_needsToPatch()) {
             return false;
         } else {
             $cache->save(APP_BUILD, "devblocks_app_build");
             return true;
         }
     }
     return true;
 }
开发者ID:sluther,项目名称:portsensor,代码行数:23,代码来源:Devblocks.class.php

示例15: _clearCache

 private static function _clearCache()
 {
     $cache = DevblocksPlatform::getCacheService();
     $cache->remove(DevblocksPlatform::CACHE_STORAGE_PROFILES);
 }
开发者ID:jstanden,项目名称:devblocks,代码行数:5,代码来源:DAO.php


注:本文中的DevblocksPlatform::getCacheService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。