本文整理汇总了PHP中Pi::environment方法的典型用法代码示例。如果您正苦于以下问题:PHP Pi::environment方法的具体用法?PHP Pi::environment怎么用?PHP Pi::environment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pi
的用法示例。
在下文中一共展示了Pi::environment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
// Log service configuration
/**
* Environments: production, debug, development
*/
$config = array();
// Development environment
$config['development'] = array('ip' => array(), 'logger' => array('active' => true, 'writer' => array('audit' => array('role' => array(), 'user' => array(), 'ip' => array(), 'method' => array('POST')))), 'debugger' => array('active' => true), 'error_handler' => array('active' => true, 'error_reporting' => -1, 'error_level' => 'development'), 'exception_handler' => array('active' => true), 'profiler' => array('active' => true), 'db_profiler' => array('active' => true));
// Debug environment
$config['debug'] = $config['development'];
$config['debug']['error_handler']['error_reporting'] = E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_NOTICE);
$config['debug']['error_handler']['error_level'] = 'debug';
// Close environment
$config['close'] = $config['development'];
$config['close']['error_handler']['error_reporting'] = E_ALL;
$config['close']['ip'] = array('127.0.0.1');
// Production evnvironment
$config['production'] = array('logger' => array('writer' => array('audit' => array('role' => array(), 'user' => array(), 'ip' => array(), 'method' => array('POST')))), 'error_handler' => array('active' => true, 'error_reporting' => E_USER_ERROR), 'exception_handler' => array('active' => true));
return $config[Pi::environment()] ?: $config['production'];