Scorpio like most frameworks uses a set of configuration files to hold various parameters so that they might be updated more easily. All the config files are XML based and very simple. They understand "sections" and "params" and can be marked to be overridden or not.
Config files are read by the systemConfig system. This is used for the system level config and is extended for the mvcSiteConfig. MVC config parameters can be used to override the global parameters IF this is permitted in the global config file.
The main configuration file is located in the /libraries folder and is named: config.xml. This is the system level configuration file that should contain your global settings, e.g. database connection details, default log level and log type etc.
The following table lists the most common sections and parameters that can be placed in this file.
| Section | Parameter | Description | Default |
|---|---|---|---|
| app | Holds application parameters that are used in the generators and as copyright information in the MVC system | ||
| author | The application author | ||
| copyright | Copyright information e.g. My Company @ My Domain (c) YEAR | ||
| version | The application version | ||
| database | Main database configuration options> | ||
| dsn |
Data Source Name, the connection string to use when connecting to the DB | %TYPE%://%USER%:%PASSWORD%@%HOST%/%DATABASE% | |
| user(Web|Script|Daemon) |
Scorpio DB users; each is used to identify where a query is running from (web, CLI or daemon process). If PHP is running in CGI mode, then all Web scripts appear as a CLI script. | scorpio | |
| userPassword |
The password for the user accounts (should set the same for all users) | ||
| system |
Main system database name | scorpio_system | |
| logging |
Main logging database name (only needed if using DB logging) | scorpio_logging | |
| wurfl |
Main WURFL database name | scorpio_wurfl | |
| MyDbName |
A generic name for your database (e.g. mydb => user_mysitedb) | ||
| type |
Database type, must be a supported PDO database type | mysql | |
| host |
Database server address | localhost | |
| port |
Database connection port | 3306 | |
| default |
The default database to connect to if none is specified | system | |
| datetime |
The format of the date time field | Y-m-d H:i:s | |
| date |
The format of a date | Y-m-d | |
| time |
The format of the time | H:i:s | |
| paths | Location of various system folders | ||
| base | Automatically set on startup to the location of system.inc | ||
| classes | Third party classes folder / folder for your generated classes | ||
| libraries | The main library folder | ||
| apps | Applications folder for CLI apps (not tools) | ||
| data | User data folder | ||
| daemons | Daemon processes (POSIX systems only) | ||
| logs | Main log location where log files will be written to | ||
| temp | Temporary files | ||
| tools | CLI tools | ||
| deprecated | |||
| websites | Public websites folder (also known as public_html or htdocs) | ||
| templateTemp |
Root template caching folder usually located in "temp", used by templateCompile and templateCache as the parent folder unless they are specified elsewhere. | ||
| templateCompile |
Template engine compile folder (if required) | ||
| templateCache |
Template engine cache folder (if required) | ||
| system | System level settings | ||
| isProduction | Places the system into a production state and attempts to suppress most error messages. | true | |
| registerErrorHandler | Default true, registers the Scorpio framework error handler as the system error handler. | true | |
| registerExceptionHandler | Default true, registers the Scorpio framework exception handler (which maps exceptions to the error handler) as the system exception handler. | true | |
| registerDefaultDatabaseDsn | Whether or not to register the DSN string as the default DB DSN | true | |
| checkFolderPermissions | Should the temp and log folder permissions be checked on every execution | true | |
| fromAddress | Default system email address e.g. webmaster@mydomain.com | ||
| hostname | The default server hostname e.g. www.mydomain.com | ||
| group | The group name to run daemons under (POSIX only) | ||
| groupGid | The POSIX group ID of group (calculated directly from group) | ||
| user | The user to run daemons under (POSIX only) | ||
| userId | The POSIX user ID of user (calculated directly from user) | ||
| uriSeparator | The default separator character for URI strings | _ | |
| logType | A valid systemLogWriter type class name | systemLogWriterFile | |
| logFolderPermissions | When folders are created by logging system, they are assigned this set of permissions | 0755 | |
| logFilePermissions | Same as above but for the files | 0644 | |
| logLevel | Any valid systemLogLevel integer | WARNING (8) | |
| logDateFormat | The date format that is prefixed to each line of a log message | d/m/Y H:i:s | |
| timezone | The timezone that should be set for the system e.g. Europe/London, UTC, America/Toronto etc. | UTC | |
| locale | The default system locale (since v.0.1.4) | en | |
| wurfl | Various WURFL system settings | ||
| uriLocation | The full web URI to the master WURFL.xml file from the WURFL project | http://wurfl.sourceforge.net/wurfl.xml | |
| maxImportSize | The maximum allowed file size in bytes for importing via the web interface. Importing data is intensive, so this should be kept low. | 512000 | |
| maxExportSize | The maximum number of devices that can be exported in one go via the web interface | 100 | |
| images | Image generation settings> | ||
| maxImageSizeForPreview | The maximum allowed file size for images that previews will be generated for in bytes | 512000 | |
| previewWidth | Preview width in pixels | 40 | |
| previewHeight | Preview height in pixels | 40 | |
| generator | Code generator settings | ||
| daoTemplate | The name of the default DAO template to be used when building data objects. Custom files should be stored in /data/templates/generator | default.tpl | |
| testCaseTemplate | The name of the default test case template used to build test cases in the generator. Custom files should be stored in /data/templates/generator | testCase.tpl | |
| userTemplates | The location of the user templates folder for storing custom generator templates | %DATA%/templates/generator | |
| mvcGenerator | MVC Code generator settings | ||
| userTemplates | The location of the user templates folder for storing custom generator templates | %DATA%/templates/mvcGenerator |
Posted by: Dave Redfern (Writer), in Documentation on 13 Apr 2008 @ 11:43
Tags: configuration, controller, controllermap, systemconfig,
Contents:
This
work is licenced under a
Creative Commons Licence.