本文整理汇总了PHP中Kohana::serverProtocol方法的典型用法代码示例。如果您正苦于以下问题:PHP Kohana::serverProtocol方法的具体用法?PHP Kohana::serverProtocol怎么用?PHP Kohana::serverProtocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kohana
的用法示例。
在下文中一共展示了Kohana::serverProtocol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: constant
Kohana::$environment = constant('Kohana::' . strtoupper($_SERVER['KOHANA_ENV']));
}
/**
* Initialize Kohana, setting the default options.
*
* The following options are available:
*
* - string base_url path, and optionally domain, of your application NULL
* - string index_file name of your index file, usually "index.php" index.php
* - string charset internal character set used for input and output utf-8
* - string cache_dir set the internal cache directory APPPATH/cache
* - boolean errors enable or disable error handling TRUE
* - boolean profile enable or disable internal profiling TRUE
* - boolean caching enable or disable internal caching FALSE
*/
Kohana::$serverProtocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';
Kohana::init(array('base_url' => Kohana::$serverProtocol . '://localhost', 'index_file' => FALSE));
/**
* Attach the file write to logging. Multiple writers are supported.
*/
Kohana::$log->attach(new Log_File(APPPATH . 'logs'));
/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config->attach(new Config_File());
/**
* Enable modules. Modules are referenced by a relative or absolute path.
*/
Kohana::modules(array('auth' => MODPATH . 'auth', 'database' => MODPATH . 'database', 'image' => MODPATH . 'image', 'orm' => MODPATH . 'orm'));
/**
* Set the routes. Each route must have a minimum of a name, a URI and a set of