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


PHP Configure::bootstrap方法代碼示例

本文整理匯總了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']);
 }
開發者ID:angel-mendoza,項目名稱:proyecto-pasantia,代碼行數:14,代碼來源:ConfigureTest.php

示例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);
開發者ID:no2key,項目名稱:Web-Framework-Benchmark,代碼行數:30,代碼來源:bootstrap.php

示例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);
    }
}
開發者ID:mrbadao,項目名稱:api-official,代碼行數:31,代碼來源:bootstrap.php


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