本文整理汇总了PHP中Cake\Core\Configure::write方法的典型用法代码示例。如果您正苦于以下问题:PHP Configure::write方法的具体用法?PHP Configure::write怎么用?PHP Configure::write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Core\Configure
的用法示例。
在下文中一共展示了Configure::write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Setup
*
* @return void
*/
public function setUp()
{
parent::setUp();
Configure::write('App.namespace', 'TestApp');
Configure::write('Security.salt', 'not-the-default');
$this->object = $this->getObjectForTrait('Cake\\Routing\\RequestActionTrait');
}
示例2: setUp
/**
* @return void
*/
public function setUp()
{
parent::setUp();
Configure::write('App.namespace', 'TestApp');
$this->Comments = TableRegistry::get('BitmaskedComments');
$this->Comments->addBehavior('Tools.Bitmasked', ['mappedField' => 'statuses']);
}
示例3: setUp
public function setUp()
{
parent::setUp();
Configure::write('App.namespace', 'TestApp');
$this->Comments = TableRegistry::get('JsonableComments');
$this->Comments->addBehavior('Tools.Jsonable', ['fields' => ['details']]);
}
示例4: testBake
/**
* Test generating code.
*
* @return void
*/
public function testBake()
{
Configure::write('App.namespace', 'Bake\\Test\\App');
$this->Task->expects($this->once())->method('createFile')->with($this->_normalizePath(APP . 'Model/Behavior/ExampleBehavior.php'), $this->stringContains('class ExampleBehavior extends Behavior'));
$result = $this->Task->bake('Example');
$this->assertSameAsFile(__FUNCTION__ . '.php', $result);
}
示例5: setUp
/**
* setUp
*
* @return void
*/
public function setUp()
{
parent::setUp();
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'test');
$this->Task = $this->getMock('Acl\\AclExtras', ['in', 'out', 'hr', 'createFile', 'error', 'err', 'clear', 'getControllerList']);
}
示例6: setUp
/**
* @return void
*/
public function setUp()
{
parent::setUp();
$this->event = new Event('Controller.beforeFilter');
$this->Controller = new UrlComponentTestController(new Request());
Configure::write('App.fullBaseUrl', 'http://localhost');
}
示例7: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Configure::write('Acl.classname', __NAMESPACE__ . '\\CachedDbAclTwoTest');
$this->CachedDb = new CachedDbAclTwoTest();
Cache::config('tests', ['engine' => 'File', 'path' => TMP, 'prefix' => 'test_']);
}
示例8: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Configure::write('debug', true);
Log::drop('stderr');
Log::drop('stdout');
}
示例9: setUp
/**
* setup test
*
* @return void
*/
public function setUp()
{
parent::setUp();
$this->io = $this->getMock('Cake\\Console\\ConsoleIo', [], [], '', false);
$this->Shell = $this->getMock('Bake\\Shell\\BakeShell', ['in', 'out', 'hr', 'err', 'createFile', '_stop'], [$this->io]);
Configure::write('App.namespace', 'Bake\\Test\\App');
}
示例10: testIndexNotAuthorized
/**
* Test if the index request is authorized.
*
* @return void
*/
public function testIndexNotAuthorized()
{
Configure::write('CA.Models.articles', 'Articles');
$this->get('/admin/posttypes/articles/index');
$this->assertResponseSuccess();
$this->assertRedirect('/admin');
}
示例11: mergeConfig
/**
* Merge Configuration
*
* @param string $key Configure key
* @param array $config New configuration to merge
* @param return array Array of merged configurations
*/
public static function mergeConfig($key, $config)
{
$values = Configure::read($key);
$values = Hash::merge((array) $values, $config);
Configure::write($key, $values);
return $values;
}
示例12: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Configure::write('App.namespace', 'TestApp');
$this->View = new UIView();
$this->View->layout = 'default';
}
示例13: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
Configure::write('Captcha', ['debug' => false]);
$config = [];
$this->Math = new MathEngine($config);
}
示例14: initialize
public function initialize()
{
parent::initialize();
/**
* Define Content settings
*/
Configure::write('Content', ['defaultUsersTable' => 'Users', 'defaultRolesTable' => 'Roles', 'defaultSiteId' => 1]);
/**
* Manage site selector
*/
if ($this->request->is(['patch', 'post', 'put'])) {
if (isset($this->request->data['current_site_id'])) {
$this->request->session()->write('Content.currentSiteId', intval($this->request->data['current_site_id']));
}
}
$this->CmsSites = TableRegistry::get('Content.CmsSites');
$sites = $this->CmsSites->find('all')->toArray();
$site_selector = [];
foreach ($sites as $row) {
$site_selector[$row->id] = $row->name;
if (!$this->request->session()->check('Content.currentSiteId')) {
$this->request->session()->write('Content.currentSiteId', $row->id);
}
}
$this->set(compact('site_selector'));
}
示例15: setUp
public function setUp()
{
parent::setUp();
Configure::write('debug', false);
$this->Articles = TableRegistry::get('Articles');
$this->Authors = TableRegistry::get('Authors');
}
开发者ID:andrej-griniuk,项目名称:cakephp-fractal-transformer-view,代码行数:7,代码来源:FractalTransformerViewTest.php