Exemplo n.º 1
0
 /**
  * testDefaults
  *
  * @dataProvider defaultsProvider
  * @return void
  */
 public function testDefaults($url, $expected)
 {
     $dsn = new CacheDsn($url);
     $return = $dsn->toArray();
     $this->assertSame($expected, $return, 'The url should parse as expected');
     $return = $dsn->__toString();
     $this->assertSame($url, $return, 'The dsn should parse back to the same url');
 }
/**
 * Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
 * output, and setting the config below to the name of the script.
 *
 * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
 */
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
 * The class name and database used in CakePHP's
 * access control lists.
 */
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
 * Uncomment this line and correct your server timezone to fix
 * any date & time related errors.
 */
date_default_timezone_set('UTC');
/**
 * Configure Cache from environment variables
 */
Cache::config('default', CacheDsn::parse(env('CACHE_URL')));
Cache::config('debug_kit', CacheDsn::parse(env('CACHE_DEBUG_KIT_URL')));
Cache::config('_cake_core_', CacheDsn::parse(env('CACHE_CAKE_CORE_URL')));
Cache::config('_cake_model_', CacheDsn::parse(env('CACHE_CAKE_MODEL_URL')));
/**
 * Configure logs from environment variables
 */
App::uses('CakeLog', 'Log');
CakeLog::config('default', LogDsn::parse(env('LOG_URL')));
CakeLog::config('error', LogDsn::parse(env('LOG_ERROR_URL')));
Exemplo n.º 3
0
 /**
  * parse a url as a cache dsn
  *
  * @param string $url
  * @param array $options
  * @return array
  */
 public static function parse($url, $options = [])
 {
     $inst = new CacheDsn($url, $options);
     return $inst->toArray();
 }
Exemplo n.º 4
0
 * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
 */
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
 * The class name and database used in CakePHP's
 * access control lists.
 */
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
 * Uncomment this line and correct your server timezone to fix
 * any date & time related errors.
 */
date_default_timezone_set('UTC');
/**
 * Configure Cache from environment variables
 */
Cache::config('default', CacheDsn::parse(env('CACHE_URL')));
Cache::config('debug_kit', CacheDsn::parse(env('CACHE_DEBUG_KIT_URL')));
Cache::config('_cake_core_', CacheDsn::parse(env('CACHE_CAKE_CORE_URL')));
Cache::config('_cake_model_', CacheDsn::parse(env('CACHE_CAKE_MODEL_URL')));
if (!empty(env('CACHE_SESSIONS'))) {
    Configure::write('Session.handler.cache', 'sessions');
    Cache::config('sessions', CacheDsn::parse(env('CACHE_SESSIONS')));
}
/**
 * Configure logs from environment variables
 */
App::uses('CakeLog', 'Log');
CakeLog::config('default', LogDsn::parse(env('LOG_URL')));
CakeLog::config('error', LogDsn::parse(env('LOG_ERROR_URL')));