Posts Tagged ‘configuration’
symfony connect database configuration
April 16th, 2008 Posted 2:33 pm
ดูที่นี่ http://www.symfony-project.org/book/1_0/08-Inside-the-Model-Layer นะครับ Copy มาให้ดูด้วยนะครับ
prod:
propel:
param:
hostspec: mydataserver
username: myusername
password: xxxxxxxxxxall:
propel:
class: sfPropelDatabase
param:
phptype: mysql # Database vendor
hostspec: localhost
database: blog
username: login
password: passwd
port: 80
encoding: utf8 # Default charset for table creation
persistent: true # Use persistent connections
phptype ที่สามารถใช้ได้คือ
mysqlsqlserverpgsqlsqliteoracle
หรือจะใช้การ connect แบบ ย่อก็ได้
all:
propel:
class: sfPropelDatabase
param:
dsn: mysql://login:passwd@localhost/blog
ใครจะใช้แบบใหนก็ได้ ตามสะดวกครับ
Tags: configuration, symfony
Posted in php, symfony
Symfony Main Application Configuration
April 11th, 2008 Posted 3:25 pm
Main Application Configuration
The main application configuration is stored in files located in the myproject/apps/myapp/config/ directory:
app.yml: This file should contain the application-specific configuration; that is, global variables defining business or applicative logic specific to an application, which don’t need to be stored in a database. Tax rates, shipping fares, and e-mail addresses are often stored in this file. It is empty by default.config.php: This file bootstraps the application, which means that it does all the very basic initializations to allow the application to start. This is where you can customize your directory structure or add application-specific constants (Chapter 19 provides more details). It starts by including the project’sconfig.php.factories.yml: Symfony defines its own class to handle the view, the request, the response, the session, and so on. If you want to use your own classes instead, this is where you can specify them. Chapter 17 provides more information.filters.yml: Filters are portions of code executed for every request. This file is where you define which filters are to be processed, and it can be overridden for each module. Chapter 6 discusses filters in more detail.logging.yml: This file defines which level of detail must be recorded in the logs, to help you manage and debug your application. The use of this configuration is explained in Chapter 16.routing.yml:เอาไว้ Set ทำ Smart URL ครับมีรูปแบบในการใส่แบบนี้ครับlist_of_[module_name]s:
url: /latest_[module_name]s
param: { module: [module_name], action: list }
[module_name]:
url: /รูปแบบ URL ที่จะรับ]/:name
param: { module: [module_name], action: permalink }ความหมายคือ เป็น list ของ module อะไร ถ้า URL ที่รับมาแบบใหนให้ทำ Method อะไรและ Action อะไร
ตัวอย่างlist_of_posts:
url: /latest_posts
param: { module: post, action: list }
post:
url: /weblog/:title
param: { module: post, action: permalink }settings.yml: The main settings of a symfony application are defined in this file. This is where you specify if your application has internationalization, its default language, the request timeout and whether caching is turned on. With a one-line change in this file, you can shut down the application so you can perform maintenance or upgrade one of its components. The common settings and their use are described in Chapter 19.view.yml: The structure of the default view (name of the layout, title, and meta tags; default style sheets and JavaScript files to be included; default content-type, and so on) is set in this file. It also defines the default value of the meta and title tags. Chapter 7 will tell you more about this file. These settings can be overridden for each module.
Tags: configuration, symfony
Posted in C Programming Language
Symfony Project Configuration
April 11th, 2008 Posted 3:09 pm
Project Configuration
There are a few project configuration files by default. Here are the files that can be found in the myproject/config/ directory:
config.php: This is the very first file executed by any request or command. It contains the path to the framework files, and you can change it to use a different installation. If you add somedefinestatements at the end of this file, the constants will be accessible from every application of the project. See Chapter 19 for advanced usage of this file.databases.yml: ไว้ใช้สำหรับปรับแต่งให้สามารถติดต่อกับ database ได้ เช่น (host, login, password, database name, and so on). เนื้อหาจะอยู่ในบทที่ 8properties.ini: This file holds a few parameters used by the command line tool, including the project name and the connection settings for distant servers. See Chapter 16 for an overview of the features using this file.rsync_exclude.txt: This file specifies which directories must be excluded from the synchronization between servers. It is discussed in Chapter 16.schema.ymlandpropel.ini: ไฟล์นี้จะเป้นการสร้าง schema ขึ้นมาหลังจากนั้นจะสร้าง sql จาก schema นี้
Tags: configuration, symfony
Posted in symfony
