/**
  * 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']);
 }
 *
 * 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);
Example #3
0
    /**
     * 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);
    }
}