本文整理汇总了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;
}
}
}
}
示例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;
}
示例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!";
}
示例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!";
}
示例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;
}
示例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");
}
示例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");
}
示例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());
}
示例9: clearConfig
public function clearConfig($cfKey)
{
$co = new Config();
$co->setPackageObject($this);
return $co->clear($cfKey);
}
示例10: clearOverrideCache
public function clearOverrideCache()
{
Config::clear("ENVIRONMENT_CACHE");
$this->overridesScanned = false;
}
示例11: check_for_updates
public function check_for_updates()
{
Config::clear('APP_VERSION_LATEST', false);
Update::getLatestAvailableVersionNumber();
$this->redirect('/dashboard/system/backup_restore/update');
}
示例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);
}
示例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');
}
示例14: reload_config
static function reload_config()
{
Config::clear();
foreach (array_reverse(Core::$PATHS) as $p => $n) {
Config::load($p);
}
}
示例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';