Zend Framework Tutorial configuration file Application.ini parsing _php instance

Source: Internet
Author: User
Tags datetime set time zend zend framework

This paper analyzes the usage of the Zend Framework configuration file Application.ini. Share to everyone for your reference, specific as follows:

The most convenient, common configuration uses the configuration file. The specific settings options for the configuration file are as follows:

PHP.ini related configuration options, the following format:

Phpsettings. Configuration options, such as

phpsettings.display_startup_errors = 1
phpsettings.display_errors = 1

Includepath Related Configuration

Includepaths.library = Application_path "/... /library "
includepaths.zend = Application_path"/... /.. /library "

Location of the Boot class

Bootstrap.path = Application_path "/bootstrap.php"

Boot class name

Bootstrap.class = "Bootstrap"

Default namespaces

Appnamespace = "Application"

Custom namespaces

Autoloadernamespaces.app = "App_" 

Whether to show exceptions

Resources.frontController.params.displayExceptions 

Configuration of resources

If the application uses a modular approach

Resources.frontController.moduleDirectory = Application_path "/modules"
resources.modules[] = 

Custom Layout Plug-ins

Resources.frontController.plugins.layout = Abc_controller_plugin_layout

Layout's file directory

Resources.layout.layoutPath = Application_path "/layouts/scripts"

The default Laytou

Resources.layout.layout = Default

customizing helper Paths

Copy Code code as follows:
Resources.view.helperPath.App_View_Helper = Application_path "/modules/default/views/helpers"

Set Sessiong

Session.lifetime = 3600

Set time

Datetime.timezone = "Asia/shanghai"
datetime.format.date = "M-d-y"
datetime.format.datetime = "M-d-y h:i:s"

Configuration of the database

Db.adapter = "Pdo_mysql"
db.prefix = "Pre_"
db.host = "localhost"
db.port = "3306"
db.dbname = "db" C13/>db.username = "root"
Db.password = ""
db.charset = "UTF8"

Configuration of logs

Log.adapter          = Pdo_mysql
log.params.host        = localhost
log.params.port        = 3306
Log.params.username      = root
log.params.password      = 
log.params.dbname       = Test
Log.params.charset       = UTF8
log.params.profiler.enabled  = True
log.params.profiler.class   = Zend_db_profiler_firebug

More interested in Zend related content readers can view the site topics: "The introduction of the Zend Framework frame", "PHP Excellent Development Framework Summary", "Yii framework Introduction and common skills Summary", "thinkphp Introductory Course", "PHP object-oriented Programming Program , "Php+mysql Database operation Introduction Tutorial" and "PHP common database Operation Skills Summary"

I hope this article will help you with the PHP program design.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.