博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Config
阅读量:6681 次
发布时间:2019-06-25

本文共 7701 字,大约阅读时间需要 25 分钟。

Config

Config

Settings for the framework setup in app/Config.php

Set the timezone to your local

date_default_timezone_set('Europe/London');

Next, set the application web URL, Once the SITEURL is set it can be used to get the application address.

define('SITEURL', 'http://example.com/');

Set the base URL? if on the root of a domain it's a single '/' otherwise it's /foldername/

define('DIR', '/');

If using a database the database credentials will need adding:

define('DB_TYPE', 'mysql'); define('DB_HOST', 'localhost'); define('DB_NAME', 'database name'); define('DB_USER', 'root'); define('DB_PASS', 'root'); define('PREFIX', 'nova_');

The prefix is optional but highly recommended, it's very useful when sharing databases with other applications, to avoid conflicts. The prefix should be the starting pattern of all table names likenova_users

Nova provides a session helper class, in order to avoid session conflicts a prefix is used.

define('SESSION_PREFIX', 'nova_');

The following tells the framework what theme folder to use for views

define('TEMPLATE','default');

Set the default language

define('LANGUAGE_CODE', 'en');

set the application name:

define('SITETITLE', 'Nova');

Set encryption key - used for encrypting cookies

define('ENCRYPT_KEY', '');

By default errors are logged but not displayed, to display them set this to true

Config::set('logger', array( 'displayErrors' => false, ));

The default theme comes with a profiler, similar to browsers inspector to turn on:

Config::set('profiler', array( 'useForensics' => false, 'withDatabase' => false, ));

App

Turn debugging on by setting to true

'debug' => false

Assign the defined site url

'url'  => SITEURL

Assign the site name

'name' => SITETITLE

Turn on multilingual support

'multilingual' => false, 'locale' => LANGUAGE_CODE

Assign encryption key

key' => ENCRYPT_KEY

Turn on csrf

'csrf' => true

Service providers

'providers' => array( 'Auth\AuthServiceProvider', 'Cache\CacheServiceProvider', 'Routing\RoutingServiceProvider', 'Cookie\CookieServiceProvider', 'Database\DatabaseServiceProvider', 'Encryption\EncryptionServiceProvider', 'Hashing\HashServiceProvider', 'Log\LogServiceProvider', 'Mail\MailServiceProvider', 'Pagination\PaginationServiceProvider', 'Auth\Reminders\ReminderServiceProvider', 'Session\SessionServiceProvider', 'Validation\ValidationServiceProvider', )

Set manifest path

'manifest' => STORAGE_PATH

Set alias paths

'aliases' => array( // The Core Tools. 'Errors' => '\Core\Error', // The Helpers. 'Mail' => '\Helpers\Mailer', 'Assets' => '\Helpers\Assets', 'Csrf' => '\Helpers\Csrf', 'Date' => '\Helpers\Date', 'Document' => '\Helpers\Document', 'Encrypter' => '\Helpers\Encrypter', 'FastCache' => '\Helpers\FastCache', 'Form' => '\Helpers\Form', 'Ftp' => '\Helpers\Ftp', 'GeoCode' => '\Helpers\GeoCode', 'Hooks' => '\Helpers\Hooks', 'Inflector' => '\Helpers\Inflector', 'Number' => '\Helpers\Number', 'RainCaptcha' => '\Helpers\RainCaptcha', 'ReservedWords' => '\Helpers\ReservedWords', 'SimpleCurl' => '\Helpers\SimpleCurl', 'TableBuilder' => '\Helpers\TableBuilder', 'Tags' => '\Helpers\Tags', 'Url' => '\Helpers\Url', // The Forensics Console. 'Console' => '\Forensics\Console', // The Support Classes. 'Arr' => '\Support\Arr', 'Str' => '\Support\Str', // The Support Facades. 'App' => '\Support\Facades\App', 'Auth' => '\Support\Facades\Auth', 'Cache' => '\Support\Facades\Cache', 'Config' => '\Support\Facades\Config', 'Cookie' => '\Support\Facades\Cookie', 'Crypt' => '\Support\Facades\Crypt', 'DB' => '\Support\Facades\Database', 'Event' => '\Support\Facades\Event', 'Hash' => '\Support\Facades\Hash', 'Input' => '\Support\Facades\Input', 'Language' => '\Support\Facades\Language', 'Mailer' => '\Support\Facades\Mailer', 'Paginator' => '\Support\Facades\Paginator', 'Password' => '\Support\Facades\Password', 'Redirect' => '\Support\Facades\Redirect', 'Request' => '\Support\Facades\Request', 'Response' => '\Support\Facades\Response', 'Session' => '\Support\Facades\Session', 'Validator' => '\Support\Facades\Validator', 'Log' => '\Support\Facades\Log' )

Auth

Configuration options for use within the Auth system.

Set default authentication driver, can be database or extended

'driver' => 'extended'

Set authentication model

'model' => 'App\Models\User'

Set authentication table

'table' => 'users'

Password Reminder Settings

/*| Here you may set the settings for password reminders, including a view| that should be used as your password reminder e-mail. You will also| be able to set the name of the table that holds the reset tokens.|| The "expire" time is the number of minutes that the reminder should be| considered valid. This security feature keeps tokens short-lived so| they have less time to be guessed. You may change this as needed.|*/'reminder' => array( 'email' => 'Emails/Auth/Reminder', 'table' => 'password_reminders', 'expire' => 60, )

Cache

Set Default storage, options: . ssdb . predis . redis . mongodb . files . sqlite . auto . apc . wincache . xcache . memcache . memcached

'storage'   =>  'files'

Default Path for Cache on HDD. Use full PATH like /home/username/cache. Keep it blank '', it will automatic setup for you.

Set path

'path' =>  STORAGE_PATH .'Cache' , // default path for files 'securityKey' => '',

FallBack Driver Example, in your code, you use memcached, apc..etc, but when you moved your web hosting until you setup your new server caching, use 'overwrite' => 'files'

'overwrite' => 'files', // whatever caching will change to 'files' and you don't need to change ur code

Default Memcache Server for all $cache

'server'    =>  array( array('127.0.0.1',11211,1), )

Cache settings:

'memcache' => array( array('127.0.0.1', 11211, 1), //array('new.host.ip',11211,1), ), 'redis' => array( 'host' => '127.0.0.1', 'port' => '', 'password' => '', 'database' => '', 'timeout' => '', ), 'ssdb' => array( 'host' => '127.0.0.1', 'port' => 8888, 'password' => '', 'timeout' => '', ), // use 1 as normal traditional, 2 = phpfastcache fastest as default, 3 = phpfastcache memory stable 'caching_method' => 2,

Database

Config options:

Set PDO fetch style

'fetch' => PDO::FETCH_CLASS

The Default Database Connection Name

'default' => 'mysql'

Set connections, additional databases can be used by adding additional arrays:

'connections' => array( 'sqlite' => array( 'driver' => 'sqlite', 'database' => APPDIR .'Storage' .DS .'database.sqlite', 'prefix' => '', ), 'mysql' => array( 'driver' => DB_TYPE, 'hostname' => DB_HOST, 'database' => DB_NAME, 'username' => DB_USER, 'password' => DB_PASS, 'prefix' => PREFIX, 'charset' => 'utf8', 'collation' => 'utf8_general_ci', ), 'pgsql' => array( 'driver' => 'pgsql', 'host' => 'localhost', 'database' => 'database', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', ), )

Languages

Array of all supported languages

Config::set('languages', array( 'cz' => array('info' => 'Czech', 'name' => '?eština', 'locale' => 'cz_CZ', 'dir' => 'ltr'), 'da' => array('info' => 'Danish', 'name' => 'Dansk', 'locale' => 'da_DK', 'dir' => 'ltr'), 'de' => array('info' => 'German', 'name' => 'Deutsch', 'locale' => 'de_DE', 'dir' => 'ltr'), 'en' => array('info' => 'English', 'name' => 'English', 'locale' => 'en_US', 'dir' => 'ltr'), 'es' => array('info' => 'Spanish', 'name' => 'Español', 'locale' => 'es_ES', 'dir' => 'ltr'), 'fa' => array('info' => 'Persian', 'name' => '?????', 'locale' => 'fa_IR', 'dir' => 'rtl'), 'fr' => array('info' => 'French', 'name' => 'Français', 'locale' => 'fr_FR', 'dir' => 'ltr'), 'it' => array('info' => 'Italian', 'name' => 'italiano', 'locale' => 'it_IT', 'dir' => 'ltr'), 'ja' => array('info' => 'Japanesse', 'name' => '???', 'locale' => 'ja_JA', 'dir' => 'ltr'), 'nl'

转载地址:http://oziao.baihongyu.com/

你可能感兴趣的文章
1.9-selinux介绍
查看>>
1.5-nagios监控客户端-1
查看>>
1.8-virsh常用操作
查看>>
Linux下高并发socket最大连接数所受的各种限制【转】
查看>>
Red Hat 6.2 64如何使用Centos的YUM源更新两种方法
查看>>
vim多行复制
查看>>
HIVE创建HBASE表
查看>>
k3cloud单据插件
查看>>
MaridDB主从复制,双主模型,半同步的配置
查看>>
麒麟开源堡垒机功能版本说明及升级方式说明
查看>>
交换机SPAN功能配置
查看>>
关于ssh的问题
查看>>
作业 rh124
查看>>
Docker创建tomcat镜像
查看>>
Restful学习随笔
查看>>
2018区块链学习路线及大纲附Java,Python,初级高级,深入浅出视频教程
查看>>
[Algorithms] Longest Common Subsequence
查看>>
常见排序算法总结(含C/C++代码)
查看>>
CurrentRowColor 选中行 颜色改变
查看>>
内容溢出显示省略号
查看>>