From bd9896aac86425ae29de1dcf95aa2a0785663586 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Tue, 2 Apr 2013 07:37:38 +1100 Subject: [PATCH] Included config files in repos --- .gitignore | 1 - app/config/core.php | 271 ++++++++++++++++++++++++++++++++++++++++ app/config/database.php | 104 +++++++++++++++ 3 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 app/config/core.php create mode 100644 app/config/database.php diff --git a/.gitignore b/.gitignore index 33a5ed7b..706e6f17 100755 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,5 @@ app/nbproject/* app/processed_vaultmsgs/* app/vaultmsgs/* app/cake_eclipse_helper.php -app/config/* app/webroot/pdf/* app/webroot/attachments_files/* diff --git a/app/config/core.php b/app/config/core.php new file mode 100644 index 00000000..f7ae3adc --- /dev/null +++ b/app/config/core.php @@ -0,0 +1,271 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 7296 $ + * @modifiedby $LastChangedBy: gwoo $ + * @lastmodified $Date: 2008-06-27 02:09:03 -0700 (Fri, 27 Jun 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * CakePHP Debug Level: + * + * Production Mode: + * 0: No error messages, errors, or warnings shown. Flash messages redirect. + * + * Development Mode: + * 1: Errors and warnings shown, model caches refreshed, flash messages halted. + * 2: As in 1, but also with full debug messages and SQL output. + * 3: As in 2, but also with full controller dump. + * + * In production mode, flash messages redirect after a time interval. + * In development mode, you need to click the flash message to continue. + */ +Configure::write('debug', 0); + + +$host = $_SERVER['HTTP_HOST']; + +//Production Config +if($host == 'cmc.lan') { + $basedir = '/var/www/cakephp/app'; + Configure::write('email_directory', '/var/www/cakephp/app/emails'); + + Configure::write('pdf_directory', $basedir.'/webroot/pdf/'); + Configure::write('attachments_directory', $basedir.'/webroot/attachments_files/'); + + Configure::write('smtp_settings', array( + 'port' => '25', + 'timeout' => '30', + 'host' => '192.168.0.8', + 'username' => 'sales', + 'password' => '2seng33+02')); +} +else { //Staging config + $basedir = '/home/karlcordes/CMC-Sales/app/'; + + + Configure::write('smtp_settings', array( + 'port' => '1025', + 'timeout' => '30', + 'host' => 'localhost')); + +} + + + +// $output_dir = '/var/www/cakephp/app/webroot/pdf/'; + +/** + * Application wide charset encoding + */ +Configure::write('App.encoding', 'UTF-8'); +/** + * To configure CakePHP *not* to use mod_rewrite and to + * use CakePHP pretty URLs, remove these .htaccess + * files: + * + * /.htaccess + * /app/.htaccess + * /app/webroot/.htaccess + * + * And uncomment the App.baseUrl below: + */ +//Configure::write('App.baseUrl', env('SCRIPT_NAME')); +/** + * Uncomment the define below to use CakePHP admin routes. + * + * The value of the define determines the name of the route + * and its associated controller actions: + * + * 'admin' -> admin_index() and /admin/controller/index + * 'superuser' -> superuser_index() and /superuser/controller/index + */ +//Configure::write('Routing.admin', 'admin'); + + +/** + * Turn off all caching application-wide. + * + */ +Configure::write('Cache.disable', true); +/** + * Enable cache checking. + * + * If set to true, for view caching you must still use the controller + * var $cacheAction inside your controllers to define caching settings. + * You can either set it controller-wide by setting var $cacheAction = true, + * or in each action using $this->cacheAction = true. + * + */ +//Configure::write('Cache.check', true); +/** + * Defines the default error type when using the log() function. Used for + * differentiating error logging and debugging. Currently PHP supports LOG_DEBUG. + */ +define('LOG_ERROR', 2); +/** + * The preferred session handling method. Valid values: + * + * 'php' Uses settings defined in your php.ini. + * 'cake' Saves session files in CakePHP's /tmp directory. + * 'database' Uses CakePHP's database sessions. + * + * To define a custom session handler, save it at /app/config/.php. + * Set the value of 'Session.save' to to utilize it in CakePHP. + * + * To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql. + * + */ +Configure::write('Session.save', 'database'); +/** + * The name of the table used to store CakePHP database sessions. + * + * 'Session.save' must be set to 'database' in order to utilize this constant. + * + * The table name set here should *not* include any table prefix defined elsewhere. + */ +Configure::write('Session.table', 'cake_sessions'); +/** + * The DATABASE_CONFIG::$var to use for database session handling. + * + * 'Session.save' must be set to 'database' in order to utilize this constant. + */ +Configure::write('Session.database', 'default'); +/** + * The name of CakePHP's session cookie. + */ +Configure::write('Session.cookie', 'QUOTENIK'); +/** + * Session time out time (in seconds). + * Actual value depends on 'Security.level' setting. + */ +Configure::write('Session.timeout', '324'); +/** + * If set to false, sessions are not automatically started. + */ +Configure::write('Session.start', true); +/** + * When set to false, HTTP_USER_AGENT will not be checked + * in the session + */ +Configure::write('Session.checkAgent', true); +/** + * The level of CakePHP security. The session timeout time defined + * in 'Session.timeout' is multiplied according to the settings here. + * Valid values: + * + * 'high' Session timeout in 'Session.timeout' x 10 + * 'medium' Session timeout in 'Session.timeout' x 100 + * 'low' Session timeout in 'Session.timeout' x 300 + * + * CakePHP session IDs are also regenerated between requests if + * 'Security.level' is set to 'high'. + */ +Configure::write('Security.level', 'medium'); +/** + * A random string used in security hashing methods. + */ +Configure::write('Security.salt', 'uiPxR3MzVXAID5zucbxLdxP4TX33buPoCWZr4JfroGoaE57UQC'); +/** + * Compress CSS output by removing comments, whitespace, repeating tags, etc. + * This requires a/var/cache directory to be writable by the web server for caching. + * and /vendors/csspp/csspp.php + * + * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css(). + */ +//Configure::write('Asset.filter.css', 'css.php'); +/** + * Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the + * output, and setting the config below to the name of the script. + * + * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link(). + */ +//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php'); +/** + * The classname and database used in CakePHP's + * access control lists. + */ +Configure::write('Acl.classname', 'DbAcl'); +Configure::write('Acl.database', 'default'); +/** + * + * Cache Engine Configuration + * Default settings provided below + * + * File storage engine. + */ +Cache::config('default', array( + 'engine' => 'File', //[required] + 'duration'=> 3600, //[optional] + 'probability'=> 100, //[optional] + 'path' => '/Users/karlcordes/CMC-Sales/app/tmp/', //[optional] use system tmp directory - remember to use absolute path + 'prefix' => 'cake_', //[optional] prefix every cache file with this string + 'lock' => false, //[optional] use file locking + 'serialize' => true, + )); + + +/* + * + * + * + * +*/ +//APC (http://pecl.php.net/package/APC) + +/*Cache::config('default', array( + 'engine' => 'Apc', //[required] + 'duration'=> 3600, //[optional] + 'probability'=> 100, //[optional] + 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string +)); */ +/* + * + * + // Xcache (http://xcache.lighttpd.net/) +*/ +/* Cache::config('default', array( + 'engine' => 'Xcache', //[required] + 'duration'=> 3600, //[optional] + 'probability'=> 100, //[optional] + 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string + 'user' => 'user', //user from xcache.admin.user settings + 'password' => 'password', //plaintext password (xcache.admin.pass) + )); */ +/* + * + * Memcache (http://www.danga.com/memcached/) + * + * Cache::config('default', array( + * 'engine' => 'Memcache', //[required] + * 'duration'=> 3600, //[optional] + * 'probability'=> 100, //[optional] + * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string + * 'servers' => array( + * '127.0.0.1:11211' // localhost, default port 11211 + * ), //[optional] + * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory) + * )); + * +*/ +?> diff --git a/app/config/database.php b/app/config/database.php new file mode 100644 index 00000000..70fc5911 --- /dev/null +++ b/app/config/database.php @@ -0,0 +1,104 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake vv + * @subpackage cake.app.config + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 7118 $ + * @modifiedby $LastChangedBy: gwoo $ + * @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * In this file you set up your database connection details. + * + * @package cake + * @subpackage cake.config + */ +/** + * Database configuration class. + * You can specify multiple configurations for production, development and testing. + * + * driver => The name of a supported driver; valid options are as follows: + * mysql - MySQL 4 & 5, + * mysqli - MySQL 4 & 5 Improved Interface (PHP5 only), + * sqlite - SQLite (PHP5 only), + * postgres - PostgreSQL 7 and higher, + * mssql - Microsoft SQL Server 2000 and higher, + * db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2) + * oracle - Oracle 8 and higher + * firebird - Firebird/Interbase + * sybase - Sybase ASE + * adodb-[drivername] - ADOdb interface wrapper (see below), + * pear-[drivername] - PEAR::DB wrapper + * + * You can add custom database drivers (or override existing drivers) by adding the + * appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php', + * where 'x' is the name of the database. + * + * persistent => true / false + * Determines whether or not the database should use a persistent connection + * + * connect => + * ADOdb set the connect to one of these + * (http://phplens.com/adodb/supported.databases.html) and + * append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent) + * For all other databases, this setting is deprecated. + * + * host => + * the host you connect to the database. To add a socket or port number, use 'port' => # + * + * prefix => + * Uses the given prefix for all the tables in this database. This setting can be overridden + * on a per-table basis with the Model::$tablePrefix property. + * + * schema => + * For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to + * 'public', DB2 defaults to empty. + * + * encoding => + * For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the + * database. Defaults to 'UTF-8' for DB2. Uses database default for all others. + * + */ +class DATABASE_CONFIG { + + var $default = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'quotenik', + 'password' => 'quotenik', + 'database' => 'quotenik', + 'prefix' => '', + ); + + var $test = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'test_database_name', + 'prefix' => '', + ); +} +?> +