当前位置: 首页>>代码示例>>PHP>>正文


PHP Kohana::serverProtocol方法代码示例

本文整理汇总了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
开发者ID:jeffreyes,项目名称:kohanablog,代码行数:31,代码来源:bootstrap.php


注:本文中的Kohana::serverProtocol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。