本文整理汇总了PHP中Slim\Slim::getDefaultSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP Slim::getDefaultSettings方法的具体用法?PHP Slim::getDefaultSettings怎么用?PHP Slim::getDefaultSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slim\Slim
的用法示例。
在下文中一共展示了Slim::getDefaultSettings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultSettings
/**
* Get default application settings with Nius addings
* @return array
*/
public static function getDefaultSettings()
{
$config = parent::getDefaultSettings();
//Nius additions
$config['view'] = '\Nius\Core\View';
$config['log.dir'] = './log';
$config['log.file'] = 'debug.log';
$config['log.dateformat'] = "Y-m-d H:i:s";
$config['log.writer'] = new \Nius\Core\LogWriter(
$config['log.dir'],
$config['log.file'],
$config['log.dateformat']
);
return $config;
}
示例2: getDefaultSettings
/**
* Override default settings
*
* @return array
*/
public static function getDefaultSettings()
{
$settings = parent::getDefaultSettings();
$settings['templates.path'] = '';
$settings['bono.base.path'] = '..';
$settings['bono.theme'] = 'Bono\\Theme\\DefaultTheme';
$settings['config.path'] = '../config';
// slim settings debug MUST BE set true to propagate exception/error to middleware
// commonhandlermiddleware will handle this later
$settings['debug'] = true;
$settings['autorun'] = true;
$settings['bono.cli'] = PHP_SAPI === 'cli';
if (!isset($settings['bono.debug'])) {
$settings['bono.debug'] = $settings['mode'] == 'development' ? true : false;
}
$settings['view'] = 'Bono\\View\\LayoutedView';
$settings['bono.partial.view'] = 'Slim\\View';
return $settings;
}
示例3: getDefaultSettings
public static function getDefaultSettings()
{
return array_merge(array("late-static-binding" => true), parent::getDefaultSettings());
}
示例4: getDefaultSettings
public static function getDefaultSettings()
{
$original = parent::getDefaultSettings();
return array_merge($original, ['container' => new Container()]);
}
示例5: getDefaultSettings
/**
* Combine the default Slim configuration with
* the default Spore configuration
*
* @return array
*/
static function getDefaultSettings()
{
$default = parent::getDefaultSettings();
$extended = array("debug" => "true", "content-type" => "application/json", "gzip" => true, "services" => array(), "pass-params" => true, "templates.path" => realpath(dirname(__DIR__) . "/examples/templates"), "include-examples" => true, "deserializers" => array("application/json" => "\\Spore\\ReST\\Data\\Deserializer\\JSONDeserializer", "application/xml" => "\\Spore\\ReST\\Data\\Deserializer\\XMLDeserializer", "text/xml" => "\\Spore\\ReST\\Data\\Deserializer\\XMLDeserializer", "text/csv" => "\\Spore\\ReST\\Data\\Deserializer\\CSVDeserializer", "application/x-www-form-urlencoded" => "\\Spore\\ReST\\Data\\Deserializer\\FormDeserializer", "multipart/form-data" => "\\Spore\\ReST\\Data\\Deserializer\\FormDeserializer"), "serializers" => array("application/json" => "\\Spore\\ReST\\Data\\Serializer\\JSONSerializer", "application/xml" => "\\Spore\\ReST\\Data\\Serializer\\XMLSerializer", "text/xml" => "\\Spore\\ReST\\Data\\Serializer\\XMLSerializer"), "xml-top-node" => "data", "xml-node" => "element");
return array_merge($default, $extended);
}
示例6: getDefaultSettings
public static function getDefaultSettings()
{
$defaults = parent::getDefaultSettings();
$controllers = '\\App\\Controller';
$models = '\\App\\Model';
return $defaults + array('api.classes.output' => '\\Deal\\Middleware\\Output\\Json', 'api.classes.auth' => '\\Deal\\Middleware\\Auth', 'api.classes.error' => '\\Deal\\Middleware\\Error', 'api.classes.auth.adapter' => '\\Deal\\Middleware\\Auth\\None', 'api.classes.auth.storage' => '\\Deal\\Middleware\\Auth\\Storage\\None', 'app.controllers.paths' => array($controllers), 'app.models.paths' => array($models));
}