當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Config::write方法代碼示例

本文整理匯總了PHP中Config::write方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::write方法的具體用法?PHP Config::write怎麽用?PHP Config::write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Config的用法示例。


在下文中一共展示了Config::write方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testWrite

 /**
  * @covers Config::write
  * @todo   Implement testWrite().
  */
 public function testWrite()
 {
     $config = array('app_key' => 'appkeyvalue', 'user_key' => 'userkeyvalue');
     $this->object->setConfig($config);
     echo getcwd();
     $this->object->setFileName('data/testOutputFile.ini');
     $this->object->write();
     $this->assertEquals($config, $this->object->read());
     unlink($this->object->getFileName());
 }
開發者ID:danielzen,項目名稱:eventbrite-ics,代碼行數:14,代碼來源:ConfigTest.php

示例2: testEmpty

 public function testEmpty()
 {
     file_put_contents($this->file, '');
     $this->assertEquals($this->object->get('test.trees.oak.fairies', 'default'), 'default');
     $this->object->set('test.trees.oak.second_fairy', 'Trixie');
     $this->assertEquals($this->object->get('test.trees.oak.second_fairy'), 'Trixie');
     $this->object->write('test');
     $group = $this->object->get('test');
     $this->assertArrayHasKey('trees', $group);
     $this->assertArrayHasKey('oak', $group['trees']);
     $this->assertArrayHasKey('second_fairy', $group['trees']['oak']);
     $this->assertEquals($group['trees']['oak']['second_fairy'], 'Trixie');
 }
開發者ID:PermeAgility,項目名稱:FrameworkBenchmarks,代碼行數:13,代碼來源:configTest.php

示例3: destruct

	/**
	 * Shuts the bot down
	 *
	 * @return	void
	 */
	public static function destruct() {
		// break in child
		if (self::$bot !== null) {
			if (!self::$bot->isParent()) return;
		}
		self::$log->info = 'Shutting down';
		
		// send leave message
		self::$bot->getConnection()->leave();
		if (VERBOSE > 0) self::$log->info = 'Left chat';
		// write the configs
		self::$config->write();
		if (VERBOSE > 0) self::$log->info = 'Written config';
		
		// call destructors of modules
		foreach (self::$modules as $module) {
			$module->destruct();
		}
		if (VERBOSE > 0) self::$log->info = 'Unloading modules';
		
		// clear class cache
		$files = glob(DIR.'cache/*');
		foreach ($files as $file) {
			unlink($file);
		}
		if (VERBOSE > 0) self::$log->info = 'Cleaned cache';
		unlink(DIR.'bot.pid');
	}
開發者ID:0xLeon,項目名稱:Chatbot,代碼行數:33,代碼來源:Core.class.php

示例4: stage1

 public function stage1()
 {
     if (Input::method() == 'POST') {
         // run patch containing the changes
         require PATH . 'upgrade/patch.php';
         Migrations::apply();
         Config::write(PATH . 'config.php', Config::get());
         return redirect('complete');
     }
     render('stage1');
 }
開發者ID:nathggns,項目名稱:anchor-cms,代碼行數:11,代碼來源:controller.php

示例5: __construct

 public function __construct($file)
 {
     // Define path to application directory
     Config::write('BASE_PATH', $file);
     Config::write('APP_PATH', $file . '/../app');
     Config::write('SITE_NAME', 'Marketing Evolution');
     Config::write('SITE_URL', 'http://marketingevolution.com');
     //invoke the rest object.
     $rest = new \kiss\Rest();
     //Return response to context
     $this->response = $rest->response();
 }
開發者ID:ghargrove,項目名稱:kiss-cm,代碼行數:12,代碼來源:App.php

示例6: get_generic_access_token

function get_generic_access_token()
{
    $client = new \GuzzleHttp\Client();
    $response = $client->post(Config::get('motibu.API_URL') . 'oauth/client_cred_grant_token', ['body' => ['client_id' => Config::get('motibu.CLIENT_ID'), 'client_secret' => Config::get('motibu.CLIENT_SECRET'), 'grant_type' => 'client_credentials']]);
    $response = $response->json();
    Log::info($response);
    if (!array_key_exists('access_token', $response) && !strlen($response['access_token'])) {
        return false;
    } else {
        Config::write('access.client_token', $response['access_token']);
        Config::set('access.client_token', $response['access_token']);
        return true;
    }
}
開發者ID:nilove,項目名稱:motibufrontend,代碼行數:14,代碼來源:routes.php

示例7: postEdit

 public function postEdit()
 {
     $rules = ['phone' => 'required|min:4', 'email' => 'required|email', 'company' => 'required|min:3', 'title' => 'required|min:20', 'description' => 'required|min:50', 'author' => 'required|min:5', 'keywords' => 'required|min:20', 'address' => 'required|min:5', 'mode' => 'required|min:10', 'zoom' => 'required|min:1|max:40|integer', 'latitude' => 'required|min:1|max:90', 'longitude' => 'required|min:1|max:90'];
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to("admin/setting")->withErrors($validator)->withInput(Input::except(''));
     }
     //dd(Input::all());
     foreach ($rules as $key => $value) {
         Config::write('setting.' . $key, Input::get($key));
     }
     if (Input::get('parameters')) {
         $parameters = json_decode(Input::get('parameters'));
         $img = Image::make($parameters->name);
         $img->crop($parameters->w, $parameters->h, $parameters->x, $parameters->y);
         $img->resize(Config::get('setting.logo.w'), Config::get('setting.logo.h'));
         $img->save(Config::get('setting.logo.path'));
         File::delete($parameters->tmp);
         $img->destroy();
     }
     return Redirect::to("admin/setting")->with('success', trans("message.setting"));
 }
開發者ID:Rotron,項目名稱:shop,代碼行數:22,代碼來源:AdminSettingController.php

示例8: get_connection

<?php

// Site
Config::write('site.domain', $_SERVER['SERVER_NAME']);
Config::write('site.protocol', 'http');
// Database
Config::write('db.prefix', 'pgsql');
$Connection = get_connection();
$Connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Initialisation
Config::write('var.showsession', FALSE);
//Developent
Config::write('dev.noemail', TRUE);
開發者ID:amoschou,項目名稱:acet,代碼行數:13,代碼來源:definitions.php

示例9: array

<?php

abstract class Config
{
    private static $_config = array();
    public static function get($name)
    {
        return self::$_config[$name];
    }
    public static function write($name, $value)
    {
        self::$_config[$name] = $value;
    }
}
require __DIR__ . '/user/config.php';
foreach ($config as $name => $value) {
    Config::write($name, $value);
}
開發者ID:KasaiDot,項目名稱:SharkDev,代碼行數:18,代碼來源:config.php

示例10: testShouldReadAndWriteConfigValues

 /**
  * @testdox should read and write config values
  */
 public function testShouldReadAndWriteConfigValues()
 {
     Config::write('Test.status', $expected = 'success');
     $actual = Config::read('Test.status');
     $this->assertEquals($expected, $actual);
 }
開發者ID:klawdyo,項目名稱:spaghettiphp,代碼行數:9,代碼來源:ConfigTest.php

示例11: switchToPrimaryDomain

 /**
  * Switch config to use primary domain (for multi domain testing).
  *
  * Switch will happen only if a first switch to secondary domain was done first.
  */
 public function switchToPrimaryDomain()
 {
     // Switch needs to be done only if a switch to secondary domain was done first.
     if (Config::read('passbolt.url_primary')) {
         // Reset the config with the base url.
         Config::write('passbolt.url', Config::read('passbolt.url_primary'));
         PassboltServer::resetExtraConfig();
     }
 }
開發者ID:passbolt,項目名稱:passbolt_selenium,代碼行數:14,代碼來源:PassboltTestCase.php

示例12: array

<?php

/**
 * ROUTES
 *
 * Configurações de redirecionamento de URL.
 *
 * Por padrão, o sistema procura por qualquer endereço escrito no índice de
 * array $routes e redireciona tudo.
 *
 *
 * Os Routes são lidos na ordem. O sistema vai usar o primeiro item que
 * coincidir com o padrão.
 *
 */
$routes = array("/:controller/:action/:arg" => array("controller" => ":controller", "action" => ":action", ":arg"), "/:controller/:action" => array("controller" => ":controller", "action" => ":action"), "/" => array("controller" => "site", "action" => "index"));
/**
 * Salva a configuração acima
 */
Config::write("routes", $routes);
開發者ID:kurko,項目名稱:acidphp,代碼行數:20,代碼來源:routes.php

示例13: array

<?php

/**
 * Liteframe PHP Framework
 * @author Nabeel Shahzad
 * @copyright Copyright (c) 2009 - 2010, Nabeel Shahzad
 * @link http://github.com/nshahzad/liteframe
 *
 */
namespace Liteframe;

# The default routing
Config::write('DEFAULT_CONTROLLER', 'default');
# Your default site title
Config::write('SITE_TITLE', 'liteframe');
# This is the default, used with the $this->url() function
Config::write('BASE_URL', $_SERVER['SERVER_NAME']);
# Use a mod-rewrite rule, or default will be ?q=
# Used with the $this->url() function to generate URLs
Config::write('USE_REWRITE', true);
Config::write('DATABASE_CONNECTIONS', array('example' => 'mysql://username:password@localhost/database_name'));
# If this is not blank, then a DB connection will be made
# Should be one of the indexes from above
Config::write('DATABASE_CONNECTOR', '');
開發者ID:nabeelio,項目名稱:liteframe,代碼行數:24,代碼來源:config.php

示例14: date_default_timezone_set

<?php

// Time zone
date_default_timezone_set('Australia/Adelaide');
// Site
Config::write('site.title', 'Australian Curriculum Engagement Tool');
Config::write('site.includenone', FALSE);
// Email
// (Uncomment only one of the following three
// Config::write('email.transporttype','Smtp');
Config::write('email.transporttype', 'Sendmail');
// Config::write('email.transporttype','Mail');
// SMTP
Config::write('smtp.host', 'smtp.gmail.com');
Config::write('smtp.port', '465');
Config::write('smtp.encr', 'ssl');
Config::write('smtp.user', 'andmos@gmail.com');
Config::write('smtp.pass', 'ttrezhjcrurgvlaq');
// Sendmail
Config::write('email.sendmail', '/usr/sbin/sendmail -bs');
// Database
Config::write('db.host', '127.0.0.1');
Config::write('db.user', 'amoschou');
Config::write('db.port', '5432');
Config::write('db.password', '');
Config::write('db.basename', 'acmathematicsweb');
// Password
Config::write('password.cost', 11);
開發者ID:amoschou,項目名稱:acet,代碼行數:28,代碼來源:settings.php

示例15:

<?php

// Models
include_once "models/class.UserModel.php";
include_once "models/class.RoleModel.php";
// Views
include_once "views/class.UserSearchView.php";
include_once "views/class.UserDetailView.php";
include_once "views/class.LoginView.php";
include_once "views/class.LoginTimeOutView.php";
// Controllers
include_once "controllers/class.User.php";
include_once "controllers/class.Login.php";
// Pages URL's
Config::write('page.url.user.search', Config::read('url.admin') . "/user/search");
Config::write('page.url.user.detail', Config::read('url.admin') . "/user/detail");
Config::write('page.url.user.remove', Config::read('url.admin') . "/user/remove");
Config::write('page.url.login', Config::read('url.admin'));
Config::write('page.url.login.inactive', Config::read('url.admin') . "/login/inactive");
Config::write('page.url.login.logoff', Config::read('url.admin') . "/login/logoff");
開發者ID:sohflp,項目名稱:Hooked,代碼行數:20,代碼來源:include.php


注:本文中的Config::write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。