本文整理汇总了PHP中Configure::bootstrap方法的典型用法代码示例。如果您正苦于以下问题:PHP Configure::bootstrap方法的具体用法?PHP Configure::bootstrap怎么用?PHP Configure::bootstrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configure
的用法示例。
在下文中一共展示了Configure::bootstrap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBootstrap
/**
* Test to ensure bootrapping doesn't overwrite prior configs set under 'App' key
*
* @return void
*/
public function testBootstrap()
{
$expected = array('foo' => 'bar');
Configure::write('App', $expected);
Configure::bootstrap(true);
$result = Configure::read('App');
$this->assertEquals($expected['foo'], $result['foo']);
$this->assertFalse($result['base']);
}
示例2: define
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL & ~E_DEPRECATED);
require CORE_PATH . 'cake' . DS . 'basics.php';
require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
require LIBS . 'error' . DS . 'exceptions.php';
require LIBS . 'object.php';
require LIBS . 'inflector.php';
require LIBS . 'app.php';
require LIBS . 'configure.php';
require LIBS . 'set.php';
require LIBS . 'cache.php';
require LIBS . 'error' . DS . 'error_handler.php';
Configure::bootstrap(isset($boot) ? $boot : true);
示例3: mb_encode_mimeheader
/**
* Encode string for MIME header
*
* @param string $str The string being encoded
* @param string $charset specifies the name of the character set in which str is represented in.
* The default value is determined by the current NLS setting (mbstring.language).
* @param string $transferEncoding specifies the scheme of MIME encoding.
* It should be either "B" (Base64) or "Q" (Quoted-Printable). Falls back to "B" if not given.
* @param string $linefeed specifies the EOL (end-of-line) marker with which
* mb_encode_mimeheader() performs line-folding
* (a » RFC term, the act of breaking a line longer than a certain length into multiple lines.
* The length is currently hard-coded to 74 characters). Falls back to "\r\n" (CRLF) if not given.
* @param int $indent [definition unknown and appears to have no affect]
*
* @return string A converted version of the string represented in ASCII.
*/
function mb_encode_mimeheader($str, $charset = 'UTF-8', $transferEncoding = 'B', $linefeed = "\r\n", $indent = 1)
{
return Multibyte::mimeEncode($str, $charset, $linefeed);
}
}
Configure::bootstrap(isset($boot) ? $boot : TRUE);
if (function_exists('mb_internal_encoding')) {
$encoding = Configure::read('App.encoding');
if (!empty($encoding)) {
mb_internal_encoding($encoding);
}
if (!empty($encoding) && function_exists('mb_regex_encoding')) {
mb_regex_encoding($encoding);
}
}