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


PHP Config::clear方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     if (defined('ENABLE_MARKETPLACE_SUPPORT') && ENABLE_MARKETPLACE_SUPPORT == false) {
         $this->connectionError = Marketplace::E_MARKETPLACE_SUPPORT_MANUALLY_DISABLED;
         return;
     }
     $csToken = Config::get('MARKETPLACE_SITE_TOKEN');
     if ($csToken != '') {
         $fh = Loader::helper('file');
         $csiURL = urlencode(BASE_URL . DIR_REL);
         $url = MARKETPLACE_URL_CONNECT_VALIDATE . "?csToken={$csToken}&csiURL=" . $csiURL . "&csiVersion=" . APP_VERSION;
         $vn = Loader::helper('validation/numbers');
         $r = $fh->getContents($url);
         if ($r == false) {
             $this->isConnected = true;
         } else {
             if ($vn->integer($r)) {
                 $this->isConnected = false;
                 $this->connectionError = $r;
                 if ($this->connectionError == Marketplace::E_DELETED_SITE_TOKEN) {
                     Config::clear('MARKETPLACE_SITE_TOKEN');
                     Config::clear('MARKETPLACE_SITE_URL_TOKEN');
                 }
             } else {
                 $this->isConnected = false;
                 $this->connectionError = self::E_GENERAL_CONNECTION_ERROR;
             }
         }
     }
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:30,代码来源:marketplace.php

示例2: setOptions

 /**
  * @param array $options
  * @param bool $override
  * @return $this
  */
 public function setOptions(array $options, $override = false)
 {
     if ($override) {
         $this->options->clear();
     }
     $this->options->loadArray($options);
     return $this;
 }
开发者ID:cyan-framework,项目名称:library,代码行数:13,代码来源:layout.php

示例3: uninstall

 /**
  * Works on destroying table data
  */
 public function uninstall()
 {
     die('serious?');
     // clears all tables !!!
     \Model\User::setdown();
     \Model\Payload::setdown();
     \Model\Webot::setdown();
     $cfg = new Config();
     $cfg->clear('ACTIVE_DB');
     $cfg->save();
     \Base::instance()->clear('SESSION');
     echo "Done Uninstalling Current Tables!";
 }
开发者ID:theralfbrown,项目名称:OWASP-mth3l3m3nt-framework,代码行数:16,代码来源:setup.php

示例4: uninstall

 public function uninstall()
 {
     die('serious?');
     // clears all tables !!!
     \Model\Post::setdown();
     \Model\Tag::setdown();
     \Model\Comment::setdown();
     \Model\User::setdown();
     $cfg = new Config();
     $cfg->clear('ACTIVE_DB');
     $cfg->save();
     \Base::instance()->clear('SESSION');
     echo "goodbye!";
 }
开发者ID:xfra35,项目名称:fabulog,代码行数:14,代码来源:setup.php

示例5: apply

 /**
  * Writes the core pointer into config/update.php.
  * 
  * @return true|int Returns true if the configuration file was updated, otherwise it returns the error code (one of the ApplicationUpdate::E_... constants)
  */
 public function apply()
 {
     $updates = array();
     $update_file = DIR_CONFIG_SITE . '/update.php';
     if (file_exists($update_file)) {
         if (!is_writable($update_file)) {
             return self::E_UPDATE_WRITE_CONFIG;
         }
         $updates = (array) (include $update_file);
     }
     $updates['core'] = $this->getUpdateIdentifier();
     \Config::clear('concrete.version');
     $renderer = new Renderer($updates);
     file_put_contents($update_file, $renderer->render());
     return true;
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:21,代码来源:ApplicationUpdate.php

示例6: save_settings

	public function save_settings() {
		Config::save('MAIL_SEND_METHOD', $this->post('MAIL_SEND_METHOD'));
		if ($this->post('MAIL_SEND_METHOD')== 'SMTP') {
			Config::save('MAIL_SEND_METHOD_SMTP_SERVER', $this->post('MAIL_SEND_METHOD_SMTP_SERVER'));
			Config::save('MAIL_SEND_METHOD_SMTP_USERNAME', $this->post('MAIL_SEND_METHOD_SMTP_USERNAME'));
			Config::save('MAIL_SEND_METHOD_SMTP_PASSWORD', $this->post('MAIL_SEND_METHOD_SMTP_PASSWORD'));
			Config::save('MAIL_SEND_METHOD_SMTP_PORT', $this->post('MAIL_SEND_METHOD_SMTP_PORT'));
			Config::save('MAIL_SEND_METHOD_SMTP_ENCRYPTION', $this->post('MAIL_SEND_METHOD_SMTP_ENCRYPTION'));
		} else {
			Config::clear('MAIL_SEND_METHOD_SMTP_SERVER');
			Config::clear('MAIL_SEND_METHOD_SMTP_USERNAME');
			Config::clear('MAIL_SEND_METHOD_SMTP_PASSWORD');
			Config::clear('MAIL_SEND_METHOD_SMTP_PORT');
			Config::clear('MAIL_SEND_METHOD_SMTP_ENCRYPTION');
		}
		$this->redirect("/dashboard/settings/mail", "settings_updated");
	}
开发者ID:notzen,项目名称:concrete5,代码行数:17,代码来源:controller.php

示例7: save_settings

 public function save_settings()
 {
     if (!Loader::helper('validation/token')->validate('save_settings')) {
         $this->error->add(t('Invalid Token.'));
         return;
     }
     Config::save('MAIL_SEND_METHOD', $this->post('MAIL_SEND_METHOD'));
     if ($this->post('MAIL_SEND_METHOD') == 'SMTP') {
         Config::save('MAIL_SEND_METHOD_SMTP_SERVER', $this->post('MAIL_SEND_METHOD_SMTP_SERVER'));
         Config::save('MAIL_SEND_METHOD_SMTP_USERNAME', $this->post('MAIL_SEND_METHOD_SMTP_USERNAME'));
         Config::save('MAIL_SEND_METHOD_SMTP_PASSWORD', $this->post('MAIL_SEND_METHOD_SMTP_PASSWORD'));
         Config::save('MAIL_SEND_METHOD_SMTP_PORT', $this->post('MAIL_SEND_METHOD_SMTP_PORT'));
         Config::save('MAIL_SEND_METHOD_SMTP_ENCRYPTION', $this->post('MAIL_SEND_METHOD_SMTP_ENCRYPTION'));
     } else {
         Config::clear('MAIL_SEND_METHOD_SMTP_SERVER');
         Config::clear('MAIL_SEND_METHOD_SMTP_USERNAME');
         Config::clear('MAIL_SEND_METHOD_SMTP_PASSWORD');
         Config::clear('MAIL_SEND_METHOD_SMTP_PORT');
         Config::clear('MAIL_SEND_METHOD_SMTP_ENCRYPTION');
     }
     $this->redirect("/dashboard/system/mail/method", "settings_updated");
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:22,代码来源:method.php

示例8: testAddingBadgeToUser

 public function testAddingBadgeToUser()
 {
     \Cache::disableAll();
     \Config::set('concrete.email.enabled', false);
     \Config::set('concrete.log.emails', false);
     Action::add('won_badge', t('Won a Badge'), 5, false);
     $g = Group::add('Test Group', 'Gettin a Badge');
     $g->setBadgeOptions(0, 'test', 10);
     $g = Group::getByID(1);
     $user = \Concrete\Core\User\UserInfo::add(array('uName' => 'testuser', 'uEmail' => 'testuser@concrete5.org'));
     $uo = $user->getUserObject();
     $uo->enterGroup($g);
     \Config::clear('concrete.email.enabled');
     \Config::clear('concrete.log.emails');
     $list = new EntryList();
     $list->filterbyUserName('testuser');
     $results = $list->get();
     $this->assertEquals(1, count($results));
     $result = $results[0];
     $this->assertInstanceOf('\\Concrete\\Core\\User\\Point\\Entry', $result);
     /* @var $result \Concrete\Core\User\Point\Entry */
     $this->assertInstanceOf('\\Concrete\\Core\\User\\Point\\Action\\WonBadgeAction', $result->getUserPointEntryActionObject());
     $this->assertInstanceOf('\\Concrete\\Core\\User\\Point\\Action\\WonBadgeActionDescription', $result->getUserPointEntryDescriptionObject());
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:24,代码来源:UserPointTest.php

示例9: clearConfig

 public function clearConfig($cfKey)
 {
     $co = new Config();
     $co->setPackageObject($this);
     return $co->clear($cfKey);
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:6,代码来源:package.php

示例10: clearOverrideCache

 public function clearOverrideCache()
 {
     Config::clear("ENVIRONMENT_CACHE");
     $this->overridesScanned = false;
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:5,代码来源:environment.php

示例11: check_for_updates

 public function check_for_updates()
 {
     Config::clear('APP_VERSION_LATEST', false);
     Update::getLatestAvailableVersionNumber();
     $this->redirect('/dashboard/system/backup_restore/update');
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:6,代码来源:update.php

示例12: testClearWithPackage

 public function testClearWithPackage()
 {
     $store = $this->getStoreMock();
     $store->expects($this->once())->method('delete')->with($this->equalTo('test'), $this->equalTo(112));
     Config::setStore($store);
     $packagemock = $this->getMock('stdClass', array('getPackageID'));
     $packagemock->expects($this->once())->method('getPackageID')->will($this->returnValue(112));
     $config = new Config();
     $config->setPackageObject($packagemock);
     $config->clear('test', 112);
 }
开发者ID:notzen,项目名称:concrete5-tests,代码行数:11,代码来源:ConfigTest.php

示例13: testPublicProfileLink

 public function testPublicProfileLink()
 {
     \Config::set('concrete.user.profiles_enabled', false);
     $service = Core::make('user.registration');
     $ui = $service->create(array('uName' => 'andrew', 'uEmail' => 'andrew@concrete5.org'));
     $this->assertEquals(null, $ui->getUserPublicProfileUrl());
     \Config::set('concrete.user.profiles_enabled', true);
     $this->assertInstanceOf('Concrete\\Core\\Url\\UrlInterface', $ui->getUserPublicProfileUrl());
     $url = (string) $ui->getUserPublicProfileUrl();
     $this->assertEquals('http://www.dummyco.com/path/to/server/index.php/members/profile/view/1', $url);
     \Config::clear('concrete.user.profiles_enabled');
 }
开发者ID:digideskio,项目名称:concrete5,代码行数:12,代码来源:UserTest.php

示例14: reload_config

 static function reload_config()
 {
     Config::clear();
     foreach (array_reverse(Core::$PATHS) as $p => $n) {
         Config::load($p);
     }
 }
开发者ID:pihizi,项目名称:qf,代码行数:7,代码来源:core.php

示例15: foreach

        ?>
</p>
							<select name="importer" class="pct50">
								<?php 
        foreach ($import_names as $name) {
            echo "<option>{$name}</option>";
        }
        ?>
							</select>
							<p class="submit"><input type="submit" class="button" name="import" value="<?php 
        _e('Select');
        ?>
"></p>
						<?php 
    }
} else {
    echo Plugins::filter('import_stage', '', @$_POST['importer'], @$_POST['stage'], @$_POST['step']);
}
if (isset($_POST['importer'])) {
    echo '<input type="hidden" name="importer" value="' . $_POST['importer'] . '">';
}
?>
		</form>

	
</div>

<?php 
// unset db_connection, since we don't need it any more
Config::clear('db_connection');
include 'footer.php';
开发者ID:psaintlaurent,项目名称:Habari,代码行数:31,代码来源:import.php


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