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


PHP Kwf_Config::deleteValueCache方法代码示例

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


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

示例1: testExceptions

 public function testExceptions()
 {
     // Ohne Mail
     $exception = new Kwf_Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertTrue($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Mit Mail
     Zend_Registry::get('config')->debug->error->log = true;
     Kwf_Config::deleteValueCache('debug.error.log');
     $exception = new Kwf_Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertFalse($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Nicht-Kwf_Exception mit Mail
     Zend_Registry::get('config')->debug->error->log = true;
     Kwf_Config::deleteValueCache('debug.error.log');
     $e = new Zend_Exception();
     $exception = new Kwf_Exception_Other($e);
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $e->getMessage());
     $this->assertFalse($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     Zend_Registry::get('config')->debug->error->log = false;
     Kwf_Config::deleteValueCache('debug.error.log');
     // Kwf_Exception_NoLog mit Debug
     Zend_Registry::get('config')->debug->error->log = true;
     Kwf_Config::deleteValueCache('debug.error.log');
     $exception = new Kwf_Exception_NoLog();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertFalse($view->debug);
     Zend_Registry::get('config')->debug->error->log = false;
     Kwf_Config::deleteValueCache('debug.error.log');
     $this->assertEquals($view->template, 'error.tpl');
     // Kwf_Exception_NoLog ohne Debug
     $exception = new Kwf_Exception_NoLog();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertTrue($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Kwf_Exception_NotFound
     $exception = new Kwf_Exception_NotFound();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error404.tpl');
     // Nicht-Kwf_Exception
     $exception = new Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error.tpl');
     // ClientException
     $exception = new Kwf_ClientException();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error-client.tpl');
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:59,代码来源:ExceptionTest.php

示例2: setUp

 public function setUp()
 {
     if (!Kwf_Config::getValue('aws.key') || !Kwf_Config::getValue('aws.secret')) {
         $this->markTestSkipped();
     }
     Kwf_Registry::get('config')->aws->uploadsBucket = 'kwf-test';
     Kwf_Config::deleteValueCache('aws.uploadsBucket');
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:S3Test.php

示例3: setUp

 public static function setUp($configClass = 'Kwf_Config_Web')
 {
     error_reporting(E_ALL & ~E_STRICT);
     define('APP_PATH', getcwd());
     Kwf_Setup::$configClass = $configClass;
     if (PHP_SAPI == 'cli') {
         //don't use cached setup on cli so clear-cache will always work even if eg. paths change
         require_once dirname(__FILE__) . '/../Kwf/Util/Setup.php';
         Kwf_Util_Setup::minimalBootstrap();
         eval(substr(Kwf_Util_Setup::generateCode(), 5));
     } else {
         if (!@(include APP_PATH . '/cache/setup' . self::CACHE_SETUP_VERSION . '.php')) {
             if (!file_exists(APP_PATH . '/cache/setup' . self::CACHE_SETUP_VERSION . '.php')) {
                 require_once dirname(__FILE__) . '/../Kwf/Util/Setup.php';
                 Kwf_Util_Setup::minimalBootstrapAndGenerateFile();
             }
             include APP_PATH . '/cache/setup' . self::CACHE_SETUP_VERSION . '.php';
         }
     }
     if (!defined('VKWF_PATH') && PHP_SAPI != 'cli' && self::getBaseUrl() === null) {
         //if server.baseUrl is not set try to auto detect it and generate config.local.ini accordingly
         //this code is not used if server.baseUrl is set to "" in vkwf
         if (!isset($_SERVER['PHP_SELF'])) {
             echo "Can't detect baseUrl, PHP_SELF is not set\n";
             exit(1);
         }
         $baseUrl = substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/'));
         if (substr($baseUrl, -16) == '/kwf/maintenance') {
             $baseUrl = substr($baseUrl, 0, -16);
         }
         $cfg = "[production]\n";
         $cfg .= "server.domain = \"{$_SERVER['HTTP_HOST']}\"\n";
         $cfg .= "server.baseUrl = \"{$baseUrl}\"\n";
         $cfg .= "setupFinished = false\n";
         if (file_exists('config.local.ini') && filesize('config.local.ini') > 0) {
             echo "config.local.ini already exists but server.baseUrl is not set\n";
             exit(1);
         }
         if (!is_writable('.')) {
             echo "'" . getcwd() . "' is not writable, can't create config.local.ini\n";
             exit(1);
         }
         file_put_contents('config.local.ini', $cfg);
         Kwf_Config_Web::reload();
         Kwf_Config::deleteValueCache('server.domain');
         Kwf_Config::deleteValueCache('server.baseUrl');
         unlink('cache/setup' . self::CACHE_SETUP_VERSION . '.php');
         echo "<h1>" . Kwf_Config::getValue('application.name') . "</h1>\n";
         echo "<a href=\"{$baseUrl}/kwf/maintenance/setup\">[start setup]</a>\n";
         exit;
     }
     if (isset($_SERVER['REQUEST_URI']) && substr($_SERVER['REQUEST_URI'], 0, 5) == '/kwf/') {
         if (substr($_SERVER['REQUEST_URI'], 0, 9) == '/kwf/pma/' || $_SERVER['REQUEST_URI'] == '/kwf/pma') {
             Kwf_Util_Pma::dispatch();
         } else {
             if ($_SERVER['REQUEST_URI'] == '/kwf/check') {
                 $ok = true;
                 $msg = '';
                 if (Kwf_Setup::hasDb()) {
                     $date = Kwf_Registry::get('db')->query("SELECT NOW()")->fetchColumn();
                     if (!$date) {
                         $ok = false;
                         $msg .= 'mysql connection failed';
                     }
                 }
                 if (file_exists('instance_startup')) {
                     //can be used while starting up autoscaling instances
                     $ok = false;
                     $msg .= 'instance startup in progress';
                 }
                 if (!$ok) {
                     header("HTTP/1.0 500 Error");
                     echo "<h1>Check failed</h1>";
                     echo $msg;
                 } else {
                     echo "ok";
                 }
                 exit;
             }
         }
     }
     Kwf_Benchmark::checkpoint('setUp');
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:83,代码来源:Setup.php

示例4: jsonInstallAction

 public function jsonInstallAction()
 {
     $cfg = "[production]\n";
     $cfg .= "database.web.username = " . $this->_getParam('db_username') . "\n";
     $cfg .= "database.web.password = " . $this->_getParam('db_password') . "\n";
     $cfg .= "database.web.dbname = " . $this->_getParam('db_dbname') . "\n";
     $cfg .= "database.web.host = " . $this->_getParam('db_host') . "\n";
     $cfg .= "\n";
     $cfg .= "server.domain = " . $this->getRequest()->getHttpHost() . "\n";
     $cfg .= "server.baseUrl = \"" . $this->getRequest()->getBaseUrl() . "\"\n";
     $cfg .= "\n";
     $cfg .= "debug.error.log = " . (!$this->_getParam('display_errors') ? 'true' : 'false') . "\n";
     file_put_contents('config.local.ini', $cfg);
     file_put_contents('config_section', $this->_getParam('config_section'));
     //re-create config to load changed config.local.ini
     Kwf_Config::deleteValueCache('database');
     Kwf_Config_Web::reload();
     Zend_Registry::getInstance()->offsetUnset('db');
     Zend_Registry::getInstance()->offsetSet('dao', new Kwf_Dao());
     $updates = array();
     foreach (Kwf_Util_Update_Helper::getUpdateTags() as $tag) {
         $file = KWF_PATH . '/setup/' . $tag . '.sql';
         if (file_exists($file)) {
             $update = new Kwf_Update_Sql(0, null);
             $update->sql = file_get_contents($file);
             $updates[] = $update;
         }
     }
     $updates = array_merge($updates, Kwf_Util_Update_Helper::getUpdates());
     $updates[] = new Kwf_Update_Setup_InitialDb('setup/setup.sql');
     $updates[] = new Kwf_Update_Setup_InitialUploads('setup/uploads');
     $update = new Kwf_Update_Sql(0, null);
     $db = Kwf_Registry::get('db');
     mt_srand((double) microtime() * 1000000);
     $passwordSalt = substr(md5(uniqid(mt_rand(), true)), 0, 10);
     $update->sql = "TRUNCATE TABLE kwf_users;\n";
     $update->sql .= "INSERT INTO kwf_users SET\n            role='admin',\n            email=" . $db->quote($this->_getParam('admin_email')) . ",\n            password=" . $db->quote(md5($this->_getParam('admin_password') . $passwordSalt)) . ",\n            password_salt=" . $db->quote($passwordSalt) . ";\n";
     $updates[] = $update;
     $c = new Kwf_Util_ProgressBar_Adapter_Cache($this->_getParam('progressNum'));
     $runner = new Kwf_Util_Update_Runner($updates);
     $progress = new Zend_ProgressBar($c, 0, $runner->getProgressSteps());
     $runner->setProgressBar($progress);
     if (!$runner->checkUpdatesSettings()) {
         throw new Kwf_Exception_Client("checkSettings failed, setup stopped");
     }
     $doneNames = $runner->executeUpdates(array('refreshCache' => false));
     $runner->writeExecutedUpdates($doneNames);
     $errors = $runner->getErrors();
     if ($errors) {
         $errMsg = count($errors) . " setup script(s) failed:\n";
         foreach ($errors as $error) {
             $errMsg .= $error['name'] . ": \n";
             $errMsg .= $error['message'] . "\n\n";
         }
         throw new Kwf_Exception_Client(nl2br($errMsg));
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:57,代码来源:SetupController.php


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