fdabfbcc4159e3aee29e85f06abe28bb1ba55ff3

Author: José Lorenzo Rodríguez

Date: 2007-09-05 18:22:41 +0000

Initial import.

diff --git a/.htaccess b/.htaccess new file mode 100755 index 0000000..00d12ab --- /dev/null +++ b/.htaccess @@ -0,0 +1,5 @@ +<IfModule mod_rewrite.c> + RewriteEngine on + RewriteRule ^$ webroot/ [L] + RewriteRule (.*) webroot/$1 [L] + </IfModule> \ No newline at end of file diff --git a/app_controller.php b/app_controller.php new file mode 100755 index 0000000..fa4f8e1 --- /dev/null +++ b/app_controller.php @@ -0,0 +1,41 @@ +<?php +/* SVN FILE: $Id: app_controller.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * Short description for file. + * + * This file is application-wide controller file. You can put all + * application-wide controller-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Short description for class. + * + * Add your application-wide methods in the class below, your controllers + * will inherit them. + * + * @package cake + * @subpackage cake.app + */ +class AppController extends Controller { +} +?> \ No newline at end of file diff --git a/app_helper.php b/app_helper.php new file mode 100755 index 0000000..c4b1381 --- /dev/null +++ b/app_helper.php @@ -0,0 +1,42 @@ +<?php +/* SVN FILE: $Id: app_helper.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * Short description for file. + * + * This file is application-wide helper file. You can put all + * application-wide helper-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * This is a placeholder class. + * Create the same file in app/app_helper.php + * + * Add your application-wide methods in the class below, your helpers + * will inherit them. + * + * @package cake + * @subpackage cake.cake + */ +class AppHelper extends Helper { +} +?> \ No newline at end of file diff --git a/app_model.php b/app_model.php new file mode 100755 index 0000000..2bee93d --- /dev/null +++ b/app_model.php @@ -0,0 +1,43 @@ +<?php +/* SVN FILE: $Id: app_model.php 5118 2007-05-18 17:19:53Z phpnut $ */ + +/** + * Application model for Cake. + * + * This file is application-wide model file. You can put all + * application-wide model-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Application model for Cake. + * + * Add your application-wide methods in the class below, your models + * will inherit them. + * + * @package cake + * @subpackage cake.app + */ +class AppModel extends Model{ +} +?> \ No newline at end of file diff --git a/config/acl.ini.php b/config/acl.ini.php new file mode 100755 index 0000000..9cb36e3 --- /dev/null +++ b/config/acl.ini.php @@ -0,0 +1,76 @@ +;<?php die() ?> +; SVN FILE: $Id: acl.ini.php 5118 2007-05-18 17:19:53Z phpnut $ +;/** +; * Short description for file. +; * +; * +; * PHP versions 4 and 5 +; * +; * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> +; * Copyright 2005-2007, 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-2007, 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.10.0.1076 +; * @version $Revision: 5118 $ +; * @modifiedby $LastChangedBy: phpnut $ +; * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ +; * @license http://www.opensource.org/licenses/mit-license.php The MIT License +; */ + +; acl.ini.php - Cake ACL Configuration +; --------------------------------------------------------------------- +; Use this file to specify user permissions. +; aco = access control object (something in your application) +; aro = access request object (something requesting access) +; +; User records are added as follows: +; +; [uid] +; groups = group1, group2, group3 +; allow = aco1, aco2, aco3 +; deny = aco4, aco5, aco6 +; +; Group records are added in a similar manner: +; +; [gid] +; allow = aco1, aco2, aco3 +; deny = aco4, aco5, aco6 +; +; The allow, deny, and groups sections are all optional. +; NOTE: groups names *cannot* ever be the same as usernames! +; +; ACL permissions are checked in the following order: +; 1. Check for user denies (and DENY if specified) +; 2. Check for user allows (and ALLOW if specified) +; 3. Gather user's groups +; 4. Check group denies (and DENY if specified) +; 5. Check group allows (and ALLOW if specified) +; 6. If no aro, aco, or group information is found, DENY +; +; --------------------------------------------------------------------- + +;------------------------------------- +;Users +;------------------------------------- + +[username-goes-here] +groups = group1, group2 +deny = aco1, aco2 +allow = aco3, aco4 + +;------------------------------------- +;Groups +;------------------------------------- + +[groupname-goes-here] +deny = aco5, aco6 +allow = aco7, aco8 \ No newline at end of file diff --git a/config/bootstrap.php b/config/bootstrap.php new file mode 100755 index 0000000..e25d4b7 --- /dev/null +++ b/config/bootstrap.php @@ -0,0 +1,46 @@ +<?php +/* SVN FILE: $Id: bootstrap.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, 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.10.8.2117 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * + * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded + * This is an application wide file to load any function that is not used within a class define. + * You can also use this to include or require any files in your application. + * + */ +/** + * The settings below can be used to set additional paths to models, views and controllers. + * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) + * + * $modelPaths = array('full path to models', 'second full path to models', 'etc...'); + * $viewPaths = array('this path to views', 'second full path to views', 'etc...'); + * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...'); + * + */ +//EOF +?> \ No newline at end of file diff --git a/config/core.php b/config/core.php new file mode 100755 index 0000000..1c19bc6 --- /dev/null +++ b/config/core.php @@ -0,0 +1,203 @@ +<?php +/* SVN FILE: $Id: core.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * This is core configuration file. + * + * Use it to configure core behaviour ofCake. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, 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: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * 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 define below: + */ + +// define ('BASE_URL', env('SCRIPT_NAME')); + +/** + * 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. + */ + define('DEBUG', 2); +/** + * Turn off or enable cache checking application-wide. + * + * If set to true, 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. + */ + define('CACHE_CHECK', false); +/** + * 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/<name>.php. + * Set the value of CAKE_SESSION_SAVE to <name> to utilize it in CakePHP. + * + * To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql. + * + */ + define('CAKE_SESSION_SAVE', 'php'); +/** + * The name of the table used to store CakePHP database sessions. + * + * CAKE_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. + */ + define('CAKE_SESSION_TABLE', 'cake_sessions'); +/** + * A random string used in session management. + */ +define('CAKE_SESSION_STRING', 'a8e2758b0d206c58f06f17cd9dfaea4727af5695'); +/** + * The name of CakePHP's session cookie. + */ + define('CAKE_SESSION_COOKIE', 'CAKEPHP'); +/** + * The level of CakePHP session security. The session timeout time defined + * in CAKE_SESSION_TIMEOUT is multiplied according to the settings here. + * Valid values: + * + * 'high' Session timeout in CAKE_SESSION_TIMEOUT x 10 + * 'medium' Session timeout in CAKE_SESSION_TIMEOUT x 100 + * 'low' Session timeout in CAKE_SESSION_TIMEOUT x 300 + * + * CakePHP session IDs are also regenerated between requests if + * CAKE_SECURITY is set to 'high'. + */ + define('CAKE_SECURITY', 'high'); +/** + * Session time out time (in seconds). + * Actual value depends on CAKE_SECURITY setting. + */ + define('CAKE_SESSION_TIMEOUT', '120'); +/** + * 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 + */ +// define('CAKE_ADMIN', 'admin'); +/** + * Enable or disable CakePHP webservices routing. Set to 'off' or 'on'. + */ + define('WEBSERVICES', 'off'); +/** + * 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. + * + * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use Controller::cssTag(). + */ + define('COMPRESS_CSS', false); +/** + * If set to false, sessions are not automatically started. + */ + define('AUTO_SESSION', true); +/** + * The max size of file allowed for MD5 hashes (in bytes). + */ + define('MAX_MD5SIZE', (5 * 1024) * 1024); +/** + * The classname, filename, (and database) used in CakePHP's + * access control lists. + */ + define('ACL_CLASSNAME', 'DB_ACL'); + define('ACL_FILENAME', 'db_acl'); + define('ACL_DATABASE', 'default'); +/** + * How long to cache data if not defined + * 3600 = 1 hour + */ + define('CACHE_DEFAULT_DURATION', 3600); +/** + * How often to do garbage collection + * about once in every hundred page loads + */ + define('CACHE_GC_PROBABILITY', 100); +/** + * Use the file storage engine with default parameters. + * Cached data is kept in app/tmp/cache/ + * + * File storage + * $cakeCache = array('File', [optional]array( + * 'dir' => '/tmp/', // use system tmp directory - remember to use absolute path + * 'prefix' => 'cakecache_', // prefix every cache file with this string + * 'lock' => true, // use file locking + * )); + * $cakeCache = array('File'); + * + * APC (Alternative PHP Cache) + * $cakeCache = array('APC'); + * + * Xcache (PHP opcode cacher) + * $cakeCache = array('Xcache', array( + * 'user' => 'admin', // user from xcache.admin.user settings + * 'password' => 'your_password', // plaintext password (xcache.admin.pass) + * )); + * + * Memcache + * $cakeCache = array('Memcache', [optional]array( + * 'servers' => array( + * '127.0.0.1', // localhost, default port + * '10.0.0.1:12345', // port 12345 + * ), + * 'compress' => true, // compress data in Memcache (slower, but uses less memory) + * )); + * + * Cake Model + * $cakeCache = array('Model', [optional]array( + * 'modelName' => 'DbModel', + * 'dataField' => 'value', + * 'expiryField' => 'expires')); + */ + $cakeCache = array('File'); +?> \ No newline at end of file diff --git a/config/database.php.default b/config/database.php.default new file mode 100755 index 0000000..70cc508 --- /dev/null +++ b/config/database.php.default @@ -0,0 +1,95 @@ +<?php +/* SVN FILE: $Id: database.php.default 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * This is core configuration file. + * + * Use it to configure core behaviour ofCake. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, 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: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @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 + * 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 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. + * + */ +class DATABASE_CONFIG { + + var $default = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'project_name', + 'prefix' => '' + ); + + var $test = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'project_name-test', + 'prefix' => '' + ); +} + +?> \ No newline at end of file diff --git a/config/inflections.php b/config/inflections.php new file mode 100755 index 0000000..e70527f --- /dev/null +++ b/config/inflections.php @@ -0,0 +1,72 @@ +<?php +/* SVN FILE: $Id: inflections.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * Custom Inflected Words. + * + * This file is used to hold words that are not matched in the normail Inflector::pluralize() and + * Inflector::singularize() + * + * PHP versions 4 and % + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, 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 1.0.0.2312 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * This is a key => value array of regex used to match words. + * If key matches then the value is returned. + * + * $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice'); + */ + $pluralRules = array(); +/** + * This is a key only array of plural words that should not be inflected. + * Notice the last comma + * + * $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox'); + */ + $uninflectedPlural = array(); +/** + * This is a key => value array of plural irregular words. + * If key matches then the value is returned. + * + * $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers') + */ + $irregularPlural = array(); +/** + * This is a key => value array of regex used to match words. + * If key matches then the value is returned. + * + * $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i') + */ + $singularRules = array(); +/** + * This is a key only array of singular words that should not be inflected. + * You should not have to change this value below if you do change it use same format + * as the $uninflectedPlural above. + */ + $uninflectedSingular = $uninflectedPlural; +/** + * This is a key => value array of singular irregular words. + * Most of the time this will be a reverse of the above $irregularPlural array + * You should not have to change this value below if you do change it use same format + * + * $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother') + */ + $irregularSingular = array_flip($irregularPlural); +?> \ No newline at end of file diff --git a/config/routes.php b/config/routes.php new file mode 100755 index 0000000..d1fa5b7 --- /dev/null +++ b/config/routes.php @@ -0,0 +1,46 @@ +<?php +/* SVN FILE: $Id: routes.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * Short description for file. + * + * In this file, you set up routes to your controllers and their actions. + * Routes are very important mechanism that allows you to freely connect + * different urls to chosen controllers and their actions (functions). + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, 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: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Here, we are connecting '/' (base path) to controller called 'Pages', + * its action called 'display', and we pass a param to select the view file + * to use (in this case, /app/views/pages/home.thtml)... + */ + Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); +/** + * ...and connect the rest of 'Pages' controller's urls. + */ + Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); +/** + * Then we connect url '/test' to our test controller. This is helpfull in + * developement. + */ + Router::connect('/tests', array('controller' => 'tests', 'action' => 'index')); +?> \ No newline at end of file diff --git a/config/sql/db_acl.sql b/config/sql/db_acl.sql new file mode 100755 index 0000000..b484f82 --- /dev/null +++ b/config/sql/db_acl.sql @@ -0,0 +1,42 @@ +# $Id: db_acl.sql 5118 2007-05-18 17:19:53Z phpnut $ +# +# Copyright 2005-2007, 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. +# http://www.opensource.org/licenses/mit-license.php The MIT License + +CREATE TABLE acos ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + parent_id INTEGER(10) DEFAULT NULL, + model VARCHAR(255) DEFAULT '', + foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, + alias VARCHAR(255) DEFAULT '', + lft INTEGER(10) DEFAULT NULL, + rght INTEGER(10) DEFAULT NULL, + PRIMARY KEY (id) +); + +CREATE TABLE aros_acos ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + aro_id INTEGER(10) UNSIGNED NOT NULL, + aco_id INTEGER(10) UNSIGNED NOT NULL, + _create CHAR(2) NOT NULL DEFAULT 0, + _read CHAR(2) NOT NULL DEFAULT 0, + _update CHAR(2) NOT NULL DEFAULT 0, + _delete CHAR(2) NOT NULL DEFAULT 0, + PRIMARY KEY(id) +); + +CREATE TABLE aros ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + parent_id INTEGER(10) DEFAULT NULL, + model VARCHAR(255) DEFAULT '', + foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, + alias VARCHAR(255) DEFAULT '', + lft INTEGER(10) DEFAULT NULL, + rght INTEGER(10) DEFAULT NULL, + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/config/sql/i18n.sql b/config/sql/i18n.sql new file mode 100755 index 0000000..0459b30 --- /dev/null +++ b/config/sql/i18n.sql @@ -0,0 +1,30 @@ +# $Id: i18n.sql 5118 2007-05-18 17:19:53Z phpnut $ +# +# Copyright 2005-2007, 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. +# http://www.opensource.org/licenses/mit-license.php The MIT License + +CREATE TABLE i18n ( + id int(10) NOT NULL auto_increment, + locale varchar(6) NOT NULL, + i18n_content_id int(10) NOT NULL, + model varchar(255) NOT NULL, + row_id int(10) NOT NULL, + field varchar(255) NOT NULL, + PRIMARY KEY (id), + KEY locale (locale), + KEY i18n_content_id (i18n_content_id), + KEY row_id (row_id), + KEY model (model), + KEY field (field) +); + +CREATE TABLE i18n_content ( + id int(10) NOT NULL auto_increment, + content text, + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/config/sql/osmosis.sql b/config/sql/osmosis.sql new file mode 100644 index 0000000..abc7a70 --- /dev/null +++ b/config/sql/osmosis.sql @@ -0,0 +1,73 @@ +-- phpMyAdmin SQL Dump +-- version 2.10.0.2 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Sep 05, 2007 at 02:10 PM +-- Server version: 5.0.37 +-- PHP Version: 5.2.1 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + +-- +-- Database: `osmosis` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `courses` +-- + +CREATE TABLE `courses` ( + `id` int(11) unsigned NOT NULL auto_increment, + `department_id` int(4) unsigned NOT NULL, + `owner_id` int(11) NOT NULL, + `code` varchar(10) collate utf8_unicode_ci NOT NULL, + `name` varchar(100) collate utf8_unicode_ci NOT NULL, + `description` text collate utf8_unicode_ci NOT NULL, + `created` date NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Dumping data for table `courses` +-- + + +-- -------------------------------------------------------- + +-- +-- Table structure for table `departments` +-- + +CREATE TABLE `departments` ( + `id` int(4) unsigned NOT NULL auto_increment, + `name` varchar(150) collate utf8_unicode_ci NOT NULL, + `description` text collate utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; + +-- +-- Dumping data for table `departments` +-- + +INSERT INTO `departments` VALUES (1, 'Departamento de Biología Celular', 'Todas las asignaturas cuyos códigos sean de la forma BC, EP, GP.'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `plugins` +-- + +CREATE TABLE `plugins` ( + `id` smallint(4) unsigned NOT NULL auto_increment, + `name` varchar(50) collate utf8_unicode_ci NOT NULL, + `active` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Holds installed plugin names and active status' AUTO_INCREMENT=1 ; + +-- +-- Dumping data for table `plugins` +-- + diff --git a/config/sql/sessions.sql b/config/sql/sessions.sql new file mode 100755 index 0000000..2c14e17 --- /dev/null +++ b/config/sql/sessions.sql @@ -0,0 +1,16 @@ +# $Id: sessions.sql 5118 2007-05-18 17:19:53Z phpnut $ +# +# Copyright 2005-2007, 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. +# http://www.opensource.org/licenses/mit-license.php The MIT License + +CREATE TABLE cake_sessions ( + id varchar(255) NOT NULL default '', + data text, + expires int(11) default NULL, + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/controllers/courses_controller.php b/controllers/courses_controller.php new file mode 100644 index 0000000..77027c9 --- /dev/null +++ b/controllers/courses_controller.php @@ -0,0 +1,7 @@ +<?php +class CoursesController extends AppController { + + var $name = 'Courses'; + var $scaffold; +} +?> \ No newline at end of file diff --git a/controllers/departments_controller.php b/controllers/departments_controller.php new file mode 100644 index 0000000..e3d2211 --- /dev/null +++ b/controllers/departments_controller.php @@ -0,0 +1,7 @@ +<?php +class DepartmentsController extends AppController { + + var $name = 'Departments'; + var $scaffold; +} +?> \ No newline at end of file diff --git a/controllers/pages_controller.php b/controllers/pages_controller.php new file mode 100755 index 0000000..e081737 --- /dev/null +++ b/controllers/pages_controller.php @@ -0,0 +1,105 @@ +<?php +/* SVN FILE: $Id: pages_controller.php 5118 2007-05-18 17:19:53Z phpnut $ */ + +/** + * Short description for file. + * + * This file is application-wide controller file. You can put all + * application-wide controller-related methods here. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.controllers + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * Short description for class. + * + * This file is application-wide controller file. You can put all + * application-wide controller-related methods here. + * + * Add your application-wide methods in the class below, your controllers + * will inherit them. + * + * @package cake + * @subpackage cake.app.controllers + */ +class PagesController extends AppController{ + +/** + * Enter description here... + * + * @var unknown_type + */ + var $name = 'Pages'; + +/** + * Enter description here... + * + * @var unknown_type + */ + var $helpers = array('Html'); + +/** + * This controller does not use a model + * + * @var $uses + */ + var $uses = null; + +/** + * Displays a view + * + */ + function display() { + if (!func_num_args()) { + $this->redirect('/'); + } + + $path=func_get_args(); + + if (!count($path)) { + $this->redirect('/'); + } + + $count =count($path); + $page =null; + $subpage=null; + $title =null; + + if (!empty($path[0])) { + $page = $path[0]; + } + + if (!empty($path[1])) { + $subpage = $path[1]; + } + + if (!empty($path[$count - 1])) { + $title = ucfirst($path[$count - 1]); + } + + $this->set('page', $page); + $this->set('subpage', $subpage); + $this->set('title', $title); + $this->render(join('/', $path)); + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000..d3901eb --- /dev/null +++ b/index.php @@ -0,0 +1,26 @@ +<?php +/* SVN FILE: $Id: index.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +require 'webroot' . DIRECTORY_SEPARATOR . 'index.php'; +?> \ No newline at end of file diff --git a/models/course.php b/models/course.php new file mode 100644 index 0000000..b469cfa --- /dev/null +++ b/models/course.php @@ -0,0 +1,30 @@ +<?php +class Course extends AppModel { + + var $name = 'Course'; + var $validate = array( + 'department_id' => VALID_NOT_EMPTY, + 'owner_id' => VALID_NOT_EMPTY, + 'code' => VALID_NOT_EMPTY, + 'name' => VALID_NOT_EMPTY, + 'description' => VALID_NOT_EMPTY, + ); + + //The Associations below have been created with all possible keys, those that are not needed can be removed + var $belongsTo = array( + 'Department' => array('className' => 'Department', + 'foreignKey' => 'department_id', + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'counterCache' => ''), + /*'Owner' => array('className' => 'Owner', + 'foreignKey' => 'owner_id', + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'counterCache' => ''),*/ + ); + +} +?> \ No newline at end of file diff --git a/models/department.php b/models/department.php new file mode 100644 index 0000000..5910f24 --- /dev/null +++ b/models/department.php @@ -0,0 +1,26 @@ +<?php +class Department extends AppModel { + + var $name = 'Department'; + var $validate = array( + 'name' => VALID_NOT_EMPTY, + 'description' => VALID_NOT_EMPTY, + ); + + //The Associations below have been created with all possible keys, those that are not needed can be removed + var $hasMany = array( + 'Course' => array('className' => 'Course', + 'foreignKey' => 'department_id', + 'conditions' => '', + 'fields' => '', + 'order' => '', + 'limit' => '', + 'offset' => '', + 'dependent' => '', + 'exclusive' => '', + 'finderQuery' => '', + 'counterQuery' => ''), + ); + +} +?> \ No newline at end of file diff --git a/models/plugin.php b/models/plugin.php new file mode 100644 index 0000000..adb301c --- /dev/null +++ b/models/plugin.php @@ -0,0 +1,15 @@ +<?php +class Plugin extends AppModel { + + var $name = 'Plugin'; + var $validate = array( + 'name' => VALID_NOT_EMPTY, + 'active' => VALID_NOT_EMPTY, + ); + + function actives($fields=null) { + return $this->findAll(array('active'=>1),$fields); + } + //The Associations below have been created with all possible keys, those that are not needed can be removed +} +?> \ No newline at end of file diff --git a/tests/cases/controllers/courses_controller.test.php b/tests/cases/controllers/courses_controller.test.php new file mode 100644 index 0000000..b092081 --- /dev/null +++ b/tests/cases/controllers/courses_controller.test.php @@ -0,0 +1,24 @@ +<?php + +loadController('Courses'); + +class CoursesControllerTestCase extends CakeTestCase { + var $TestObject = null; + + function setUp() { + $this->TestObject = new CoursesController(); + } + + function tearDown() { + unset($this->TestObject); + } + + /* + function testMe() { + $result = $this->TestObject->index(); + $expected = 1; + $this->assertEqual($result, $expected); + } + */ +} +?> \ No newline at end of file diff --git a/tests/cases/controllers/departments_controller.test.php b/tests/cases/controllers/departments_controller.test.php new file mode 100644 index 0000000..b3b6957 --- /dev/null +++ b/tests/cases/controllers/departments_controller.test.php @@ -0,0 +1,24 @@ +<?php + +loadController('Departments'); + +class DepartmentsControllerTestCase extends CakeTestCase { + var $TestObject = null; + + function setUp() { + $this->TestObject = new DepartmentsController(); + } + + function tearDown() { + unset($this->TestObject); + } + + /* + function testMe() { + $result = $this->TestObject->index(); + $expected = 1; + $this->assertEqual($result, $expected); + } + */ +} +?> \ No newline at end of file diff --git a/tests/cases/models/course.test.php b/tests/cases/models/course.test.php new file mode 100644 index 0000000..530aa3e --- /dev/null +++ b/tests/cases/models/course.test.php @@ -0,0 +1,24 @@ +<?php + +loadModel('Course'); + +class CourseTestCase extends CakeTestCase { + var $TestObject = null; + + function setUp() { + $this->TestObject = new Course(); + } + + function tearDown() { + unset($this->TestObject); + } + + /* + function testMe() { + $result = $this->TestObject->findAll(); + $expected = 1; + $this->assertEqual($result, $expected); + } + */ +} +?> \ No newline at end of file diff --git a/tests/cases/models/department.test.php b/tests/cases/models/department.test.php new file mode 100644 index 0000000..2c67c9a --- /dev/null +++ b/tests/cases/models/department.test.php @@ -0,0 +1,24 @@ +<?php + +loadModel('Department'); + +class DepartmentTestCase extends CakeTestCase { + var $TestObject = null; + + function setUp() { + $this->TestObject = new Department(); + } + + function tearDown() { + unset($this->TestObject); + } + + /* + function testMe() { + $result = $this->TestObject->findAll(); + $expected = 1; + $this->assertEqual($result, $expected); + } + */ +} +?> \ No newline at end of file diff --git a/tests/cases/models/plugin.test.php b/tests/cases/models/plugin.test.php new file mode 100644 index 0000000..78cefdf --- /dev/null +++ b/tests/cases/models/plugin.test.php @@ -0,0 +1,29 @@ +<?php + +loadModel('Plugin'); + +class PluginTestCase extends CakeTestCase { + var $TestObject = null; + var $fixtures = array('plugin'); + function setUp() { + $this->TestObject = new Plugin(); + $this->TestObject->useDbConfig = 'test_suite'; + $this->TestObject->tablePrefix = 'test_suite_'; + $this->TestObject->loadInfo(true); + } + + function tearDown() { + unset($this->TestObject); + } + + function testActives() { + $result = $this->TestObject->actives(); + $expect = array( + array('Plugin'=>array('id'=>1,'name'=>'plugin1','active'=>1)), + array('Plugin'=>array('id'=>3,'name'=>'plugin3','active'=>1)), + ); + $this->assertEqual($result,$expect); + } + +} +?> \ No newline at end of file diff --git a/tests/fixtures/plugin.php b/tests/fixtures/plugin.php new file mode 100644 index 0000000..b417d33 --- /dev/null +++ b/tests/fixtures/plugin.php @@ -0,0 +1,11 @@ +<?php +class PluginFixture extends CakeTestFixture { + var $name = 'Plugin'; + var $import = 'Plugin'; + var $records = array( + array('id'=>1,'name'=>'plugin1','active'=>1), + array('id'=>2,'name'=>'plugin2','active'=>0), + array('id'=>3,'name'=>'plugin3','active'=>1), + ); +} +?> \ No newline at end of file diff --git a/vendors/shells/templates/empty b/vendors/shells/templates/empty new file mode 100755 index 0000000..e69de29 diff --git a/views/layouts/ajax.ctp b/views/layouts/ajax.ctp new file mode 100755 index 0000000..993b5cb --- /dev/null +++ b/views/layouts/ajax.ctp @@ -0,0 +1,27 @@ +<?php +/* SVN FILE: $Id: ajax.ctp 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.layouts + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<?php echo $content_for_layout; ?> \ No newline at end of file diff --git a/views/layouts/default.ctp b/views/layouts/default.ctp new file mode 100755 index 0000000..d48ec68 --- /dev/null +++ b/views/layouts/default.ctp @@ -0,0 +1,67 @@ +<?php +/* SVN FILE: $Id: default.ctp 5318 2007-06-20 09:01:21Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.pages + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 5318 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-06-20 05:01:21 -0400 (Wed, 20 Jun 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title> + CakePHP: the rapid development php framework: + <?php echo $title_for_layout;?> + </title> + + <?php echo $html->charset();?> + + <link rel="icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" /> + <link rel="shortcut icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" /> + <?php echo $html->css('cake.generic');?> +</head> +<body> + <div id="container"> + <div id="header"> + <h1><?php echo $html->link('CakePHP: the rapid development php framework', 'http://cakephp.org');?></h1> + </div> + <div id="content"> + <?php + if ($session->check('Message.flash')): + $session->flash(); + endif; + ?> + + <?php echo $content_for_layout;?> + + </div> + <div id="footer"> + <?php echo $html->link( + $html->image('cake.power.png', array('alt'=>"CakePHP: the rapid development php framework", 'border'=>"0")), + 'http://www.cakephp.org/', + array('target'=>'_new'), null, false + ); + ?> + </div> + </div> + <?php echo $cakeDebug?> +</body> +</html> \ No newline at end of file diff --git a/views/layouts/flash.ctp b/views/layouts/flash.ctp new file mode 100755 index 0000000..9123b2f --- /dev/null +++ b/views/layouts/flash.ctp @@ -0,0 +1,45 @@ +<?php +/* SVN FILE: $Id: flash.ctp 5318 2007-06-20 09:01:21Z phpnut $ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.layouts + * @since CakePHP(tm) v 0.10.0.1076 + * @version $Revision: 5318 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-06-20 05:01:21 -0400 (Wed, 20 Jun 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title><?php echo $page_title?></title> +<?php echo $html->charset(); ?> + +<?php if (Configure::read() == 0) { ?> +<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/> +<?php } ?> +<style><!-- +P { text-align:center; font:bold 1.1em sans-serif } +A { color:#444; text-decoration:none } +A:HOVER { text-decoration: underline; color:#44E } +--></style> +</head> +<body> +<p><a href="<?php echo $url?>"><?php echo $message?></a></p> +</body> +</html> \ No newline at end of file diff --git a/views/layouts/js/default.ctp b/views/layouts/js/default.ctp new file mode 100755 index 0000000..d94dc90 --- /dev/null +++ b/views/layouts/js/default.ctp @@ -0,0 +1,2 @@ +<?php echo $scripts_for_layout; ?> +<script type="text/javascript"><?php echo $content_for_layout; ?></script> \ No newline at end of file diff --git a/views/layouts/rss/default.ctp b/views/layouts/rss/default.ctp new file mode 100755 index 0000000..94067f2 --- /dev/null +++ b/views/layouts/rss/default.ctp @@ -0,0 +1,17 @@ +<?php +echo $rss->header(); + +if (!isset($channel)) { + $channel = array(); +} +if (!isset($channel['title'])) { + $channel['title'] = $title_for_layout; +} + +echo $rss->document( + $rss->channel( + array(), $channel, $content_for_layout + ) +); + +?> \ No newline at end of file diff --git a/views/layouts/xml/default.ctp b/views/layouts/xml/default.ctp new file mode 100755 index 0000000..c688702 --- /dev/null +++ b/views/layouts/xml/default.ctp @@ -0,0 +1,2 @@ +<?php e($xml->header()); ?> +<?php echo $content_for_layout; ?> \ No newline at end of file diff --git a/views/pages/empty b/views/pages/empty new file mode 100755 index 0000000..e69de29 diff --git a/views/pages/home.ctp b/views/pages/home.ctp new file mode 100644 index 0000000..cbe069b --- /dev/null +++ b/views/pages/home.ctp @@ -0,0 +1,84 @@ +<h2>Sweet, "Osmosis" got Baked by CakePHP!</h2> + +<?php Debugger::checkSessionKey(); ?> +<p> + <span class="notice"> + <?php + __('Your tmp directory is '); + if (is_writable(TMP)): + __('writable.'); + else: + __('NOT writable.'); + endif; + ?> + </span> +</p> +<p> + <span class="notice"> + <?php + __('Your cache is '); + if (Cache::isInitialized()): + __('set up and initialized properly.'); + $settings = Cache::settings(); + echo '<p>' . $settings['class']; + __(' is being used to cache, to change this edit config/core.php '); + echo '</p>'; + + echo 'Settings: <ul>'; + foreach ($settings as $name => $value): + echo '<li>' . $name . ': ' . $value . '</li>'; + endforeach; + echo '</ul>'; + + else: + __('NOT working.'); + echo '<br />'; + if (is_writable(TMP)): + __('Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly'); + endif; + endif; + ?> + </span> +</p> +<p> + <span class="notice"> + <?php + __('Your database configuration file is '); + $filePresent = null; + if (file_exists(CONFIGS.'database.php')): + __('present.'); + $filePresent = true; + else: + __('NOT present.'); + echo '<br/>'; + __('Rename config/database.php.default to config/database.php'); + endif; + ?> + </span> +</p> +<?php +if (!empty($filePresent)): + uses('model' . DS . 'connection_manager'); + $db = ConnectionManager::getInstance(); + $connected = $db->getDataSource('default'); +?> +<p> + <span class="notice"> + <?php + __('Cake'); + if ($connected->isConnected()): + __(' is able to '); + else: + __(' is NOT able to '); + endif; + __('connect to the database.'); + ?> + </span> +</p> +<?php endif;?> +<h3>Editing this Page</h3> +<p> +To change the content of this page, edit: /Users/lorenzo/Documents/workspace/osmosis//views/pages/home.ctp.<br /> +To change its layout, edit: /Users/lorenzo/Documents/workspace/osmosis//views/layouts/default.ctp.<br /> +You can also add some CSS styles for your pages at: /Users/lorenzo/Documents/workspace/osmosis//webroot/css/. +</p> diff --git a/views/scaffolds/empty b/views/scaffolds/empty new file mode 100755 index 0000000..e69de29 diff --git a/webroot/.htaccess b/webroot/.htaccess new file mode 100755 index 0000000..8ca27c0 --- /dev/null +++ b/webroot/.htaccess @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] +</IfModule> \ No newline at end of file diff --git a/webroot/css.php b/webroot/css.php new file mode 100755 index 0000000..0342a60 --- /dev/null +++ b/webroot/css.php @@ -0,0 +1,99 @@ +<?php +/* SVN FILE: $Id: css.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.webroot + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Enter description here... + */ + require(CONFIGS . 'paths.php'); + require(CAKE . 'basics.php'); + require(LIBS . 'folder.php'); + require(LIBS . 'file.php'); +/** + * Enter description here... + * + * @param unknown_type $path + * @param unknown_type $name + * @return unknown + */ + function make_clean_css($path, $name) { + require(VENDORS . 'csspp' . DS . 'csspp.php'); + $data =file_get_contents($path); + $csspp =new csspp(); + $output=$csspp->compress($data); + $ratio =100 - (round(strlen($output) / strlen($data), 3) * 100); + $output=" /* file: $name, ratio: $ratio% */ " . $output; + return $output; + } +/** + * Enter description here... + * + * @param unknown_type $path + * @param unknown_type $content + * @return unknown + */ + function write_css_cache($path, $content) { + if (!is_dir(dirname($path))) { + mkdir(dirname($path)); + } + $cache=new File($path); + return $cache->write($content); + } + + if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) { + die(__('Wrong file name.')); + } + + $filename = 'css/' . $regs[1]; + $filepath = CSS . $regs[1]; + $cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]); + + if (!file_exists($filepath)) { + die(__('Wrong file name.')); + } + + if (file_exists($cachepath)) { + $templateModified=filemtime($filepath); + $cacheModified =filemtime($cachepath); + + if ($templateModified > $cacheModified) { + $output=make_clean_css($filepath, $filename); + write_css_cache($cachepath, $output); + } else { + $output = file_get_contents($cachepath); + } + } else { + $output=make_clean_css($filepath, $filename); + write_css_cache($cachepath, $output); + } + header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT'); + header("Content-Type: text/css"); + header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT"); + header("Cache-Control: cache"); // HTTP/1.1 + header("Pragma: cache"); // HTTP/1.0 + print $output; +?> \ No newline at end of file diff --git a/webroot/css/cake.generic.css b/webroot/css/cake.generic.css new file mode 100755 index 0000000..90fa238 --- /dev/null +++ b/webroot/css/cake.generic.css @@ -0,0 +1,395 @@ +* { +margin:0; +padding:0; +} + +/* General Style Info */ +body { + background-color: #2C6877; + color: #fff; + font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif; +} +a { + background-color: inherit; + color: #003d4c; + text-decoration: underline; + font-weight: bold; +} +a:hover { + background-color: inherit; + color: #003d4c; + text-decoration:none; +} +a img { + border:none; +} +h1, h2, h3, h4 { + background-color: inherit; + font-weight:normal; +} +h1 { + color: #003d4c; + font-size: 160%; + margin: 0.1em 0; +} +h2 { + color: #2C6877; + font-size: 160%; + margin: 0.3em 0; + padding-top: 1em; +} +h3 { + color: #c6c65b; + font-size: 120%; + padding-top: 2em; +} +h4 { + color: #c6c65b; + font-weight: normal; + padding-top: 0.5em; +} +ul, li { + margin: 0 12px; +} + +/* Layout */ +#container { + text-align: left; +} + +#header{ + background-color: #2C6877; + padding: 10px 20px 0 20px; + height: 5em; +} +#header h1 { + color: #ffffff; + background: url('../img/cake.icon.png') no-repeat; + padding: 5px 50px; + height: 5em; +} +#header h1 a { + color: #ffffff; + background: #2C6877; + text-decoration: none; +} +#header h1 a:hover { + color: #ffffff; + background: #003d4c; + text-decoration: none; +} +#content{ + background-color: #fff; + clear: both; + color: #333; + padding: 0px 40px 40px 40px; + overflow: auto; +} +#footer { + clear: both; + padding: 6px 10px; + text-align: right; +} + +/* Tables */ +table { + background-color: #fff; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-bottom: 1px solid #ccc; + clear: both; + color: #333; + margin-bottom: 10px; + width: 100%; +} +th { + background-color: #f2f2f2; + border-top: 1px solid #fff; + border-left: 1px solid #fff; + border-right: 1px solid #bbb; + border-bottom: 1px solid #bbb; + text-align: center; +} + +th a { + display: block; + padding: 2px 4px; + text-decoration: none; +} + +th a:hover { + background-color: #ccc; + color: #333; + text-decoration: none; +} + +table tr td { + background: #fff; + border-right: 1px solid #ccc; + padding: 4px; + text-align: center; + vertical-align: top; +} +table tr.altrow td { + background: #f4f4f4; +} +td.actions { + text-align: center; + white-space: nowrap; +} +td.actions a { + display: inline; + margin: 0px 6px; +} +.cakeSqlLog table { + background: #f4f4f4; +} +.cakeSqlLog td { + padding: 4px 8px; + text-align: left; +} + +/* Paging */ +div.paging { + color: #ccc; + margin-bottom: 2em; +} +div.paging div.disabled { + color: #ddd; + display: inline; +} + +/* Scaffold View */ +dl { + line-height: 2em; + margin: 0em 0em; + width: 50%; +} +dl .altrow { + background: #f4f4f4; +} +dt { + font-weight: bold; + padding-left: 4px; + vertical-align: top; +} +dd { + margin-left: 10em; + margin-top: -2em; + vertical-align: top; +} + +/* Forms */ +form { + clear: both; + margin-right: 20px; + padding: 0; + width: 60%; +} +fieldset { + border: 1px solid #ccc; + margin-top: 30px; + padding: 16px 20px; +} +fieldset legend { + color: #2C6877; + font-size: 160%; + font-weight: bold; +} +form div { + clear: both; + margin-bottom: 1em; + padding: .5em; + vertical-align: text-top; +} +form div.required { + color: #333; + font-weight: bold; +} +form div.optional, form div.input { + color: #444; +} +form div.submit { + border: 0; + clear: both; + margin-top: 10px; + margin-left: 140px; +} +label { + display: block; + font-size: 110%; + padding-right: 20px; +} +input, textarea { + clear: both; + display: block; + font-size: 140%; + font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif; + padding: 2px; + width: 100%; +} +select { + clear: both; + font-size: 120%; + vertical-align: text-bottom; +} +select[multiple=multiple] { + width: 100%; +} +option { + font-size: 120%; + padding: 0 3px; +} +input[type=checkbox] { + clear: left; + float: left; + margin: 0px 6px 7px 2px; + width: auto; +} +input[type=submit] { + display: inline; + padding: 2px 5px; + width: auto; + font-size: 110%; + vertical-align: bottom; +} + +/* Notices and Errors */ +div.message, p.error, div.error-message { + color: #900; + font-size: 140%; + font-weight: bold; + margin: 8px 0px; +} +div.error-message { + clear: both; +} +div.error em { + font-size: 140%; + color: #003d4c; +} +span.notice { + background-color: #c6c65b; + color: #fff; + display: block; + font-size: 140%; + padding: 0.5em; + margin: 1em 0; +} + +/* Nav & Actions */ +div.nav { + text-align: left; + position: absolute; + top: 9em; + left: 60%; +} +div.nav ul li a { + display: block; + background: #fff; + color: #003d4c; + padding: 3px 8px; + text-decoration: none; +} +div.nav ul { + background: #003d4c; + margin: 0; + padding: 0; + list-style-type: none; +} +div.nav li { + list-style-type: none; + margin: 0; + padding: 0; +} +div.nav ul li a { + background: #fff; + color: #003d4c; + padding: 3px 8px; + text-decoration: none; +} +div.nav ul li a:hover { + background: #003d4c; + color: #fff; +} + +/* Actions */ +div.actions { + clear: both; + margin-top: .2em; + text-align: left; +} +div.actions ul { + margin: 0; + padding: 0; +} +div.actions li { + display: inline; + list-style-type: none; + margin: 0 2em 0 0; + padding: 0; +} +div.actions ul li a { + background: #fff; + color: #003d4c; + text-decoration: none; +} +div.actions ul li a:hover { + background: #003d4c; + color: #fff; +} + +/* Related */ +div.related { + clear: both; + display: block; +} + +/* Debugging */ +pre { + color: #000; + background: #f0f0f0; + padding: 1em; +} + +pre.cake_debug { + background: #ffcc00; + font-size: 120%; + line-height: 18px; + margin: 4px 2px; + overflow: auto; + position: relative; +} +div.cake-stack-trace { + background: #fff; + color: #333; + margin: 4px 2px; + padding: 4px; + font-size: 120%; + line-height: 18px; + overflow: auto; + position: relative; +} +div.cake-code-dump pre { + position: relative; + overflow: auto; +} +div.cake-stack-trace pre, div.cake-code-dump pre { + color: #000000; + background-color: #F0F0F0; + border: 1px dotted #606060; + margin: 4px 2px; + padding: 4px; + overflow: auto; +} +div.cake-code-dump pre, div.cake-code-dump pre code { + clear: both; + font-size: 12px; + line-height: 5px; + margin: 4px 2px; + padding: 4px; + overflow: auto; +} +div.cake-code-dump span.code-highlight { + background-color: #FFFF00; +} \ No newline at end of file diff --git a/webroot/favicon.ico b/webroot/favicon.ico new file mode 100755 index 0000000..8c5c557 Binary files /dev/null and b/webroot/favicon.ico differ diff --git a/webroot/img/cake.icon.png b/webroot/img/cake.icon.png new file mode 100755 index 0000000..4f22ad0 Binary files /dev/null and b/webroot/img/cake.icon.png differ diff --git a/webroot/img/cake.power.png b/webroot/img/cake.power.png new file mode 100755 index 0000000..699ef80 Binary files /dev/null and b/webroot/img/cake.power.png differ diff --git a/webroot/index.php b/webroot/index.php new file mode 100755 index 0000000..92fae16 --- /dev/null +++ b/webroot/index.php @@ -0,0 +1,86 @@ +<?php +/* SVN FILE: $Id: index.php 5118 2007-05-18 17:19:53Z phpnut $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.webroot + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 5118 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-05-18 13:19:53 -0400 (Fri, 18 May 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Do not change + */ + if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); + } +/** + * These defines should only be edited if you have cake installed in + * a directory layout other than the way it is distributed. + * Each define has a commented line of code that explains what you would change. + */ + if (!defined('ROOT')) { + //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED. DO NOT ADD A TRAILING DIRECTORY SEPARATOR'); + //You should also use the DS define to separate your directories + define('ROOT', dirname(dirname(dirname(__FILE__)))); + } + if (!defined('APP_DIR')) { + //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION'); + define('APP_DIR', basename(dirname(dirname(__FILE__)))); + } +/** + * This only needs to be changed if the cake installed libs are located + * outside of the distributed directory structure. + */ + if (!defined('CAKE_CORE_INCLUDE_PATH')) { + //define ('CAKE_CORE_INCLUDE_PATH', 'FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED. DO NOT ADD A TRAILING DIRECTORY SEPARATOR'); + //You should also use the DS define to separate your directories + define('CAKE_CORE_INCLUDE_PATH', ROOT.DS.'cake1.2.x'); + } +/////////////////////////////// +//DO NOT EDIT BELOW THIS LINE// +/////////////////////////////// + if (!defined('WEBROOT_DIR')) { + define('WEBROOT_DIR', basename(dirname(__FILE__))); + } + if (!defined('WWW_ROOT')) { + define('WWW_ROOT', dirname(__FILE__) . DS); + } + if (!defined('CORE_PATH')) { + if (function_exists('ini_set')) { + ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path')); + define('APP_PATH', null); + define('CORE_PATH', null); + } else { + define('APP_PATH', ROOT . DS . APP_DIR . DS); + define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); + } + } + require CORE_PATH . 'cake' . DS . 'bootstrap.php'; + if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') { + } else { + $Dispatcher=new Dispatcher(); + $Dispatcher->dispatch($url); + } + if (Configure::read() > 0) { + echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->"; + } +?> \ No newline at end of file diff --git a/webroot/js/vendors.php b/webroot/js/vendors.php new file mode 100755 index 0000000..68c2cca --- /dev/null +++ b/webroot/js/vendors.php @@ -0,0 +1,43 @@ +<?php +/* SVN FILE: $Id: vendors.php 5318 2007-06-20 09:01:21Z phpnut $ */ +/** + * Short description for file. + * + * This file includes js vendor-files from /vendor/ directory if they need to + * be accessible to the public. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2007, 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-2007, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.webroot.js + * @since CakePHP(tm) v 0.2.9 + * @version $Revision: 5318 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-06-20 05:01:21 -0400 (Wed, 20 Jun 2007) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Enter description here... + */ +$file = $_GET['file']; +$pos = strpos($file, '..'); +if ($pos === false) { + if (is_file('../../vendors/javascript/'.$file) && (preg_match('/(\/.+)\\.js/', $file))) + { + readfile('../../vendors/javascript/'.$file); + } +} else { + header('HTTP/1.1 404 Not Found'); +} +?> \ No newline at end of file diff --git a/webroot/test.php b/webroot/test.php new file mode 100755 index 0000000..b57e1c2 --- /dev/null +++ b/webroot/test.php @@ -0,0 +1,243 @@ +<?php +/* SVN FILE: $Id: test.php 5318 2007-06-20 09:01:21Z phpnut $ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> + * Copyright 2005-2007, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. + * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @package cake + * @subpackage cake.cake.tests.libs + * @since CakePHP(tm) v 1.2.0.4433 + * @version $Revision: 5318 $ + * @modifiedby $LastChangedBy: phpnut $ + * @lastmodified $Date: 2007-06-20 05:01:21 -0400 (Wed, 20 Jun 2007) $ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ +error_reporting(E_ALL); +set_time_limit(600); +ini_set('memory_limit','128M'); +if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); +} +if (!defined('ROOT')) { + define('ROOT', dirname(dirname(dirname(__FILE__)))); +} +if (!defined('APP_DIR')) { + define('APP_DIR', basename(dirname(dirname(__FILE__)))); +} +if (!defined('CAKE_CORE_INCLUDE_PATH')) { + define('CAKE_CORE_INCLUDE_PATH', ROOT.DS.'cake1.2.x'); +} +if (!defined('WEBROOT_DIR')) { + define('WEBROOT_DIR', basename(dirname(__FILE__))); +} +if (!defined('WWW_ROOT')) { + define('WWW_ROOT', dirname(__FILE__) . DS); +} +if (!defined('CORE_PATH')) { + if (function_exists('ini_set')) { + ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path')); + define('APP_PATH', null); + define('CORE_PATH', null); + } else { + define('APP_PATH', ROOT . DS . APP_DIR . DS); + define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); + } +} + +ini_set('display_errors', 1); +require_once CORE_PATH . 'cake' . DS . 'bootstrap.php'; +require_once CAKE . 'basics.php'; +require_once CAKE . 'config' . DS . 'paths.php'; +require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php'; +if (DEBUG < 1) { + die('Invalid url.'); +} + +if (!isset($_SERVER['SERVER_NAME'])) { + $_SERVER['SERVER_NAME'] = ''; +} +if (empty( $_GET['output'])) { + $_GET['output'] = 'html'; +} + +if (!defined('BASE_URL')) { + $dispatch =& new Dispatcher(); + define('BASE_URL', $dispatch->baseUrl()); +} +/** + * + * Used to determine output to display + */ +define('CAKE_TEST_OUTPUT_HTML',1); +define('CAKE_TEST_OUTPUT_TEXT',2); + +if (isset($_GET['output']) && $_GET['output'] == 'html') { + define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML); +} else { + define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT); +} + +if (!vendor('simpletest' . DS . 'reporter')) { + CakePHPTestHeader(); + include CAKE . 'tests' . DS . 'lib' . DS . 'simpletest.php'; + CakePHPTestSuiteFooter(); + exit(); +} + + function &CakeTestsGetReporter() { + static $Reporter = NULL; + if (!$Reporter) { + switch (CAKE_TEST_OUTPUT) { + case CAKE_TEST_OUTPUT_HTML: + require_once LIB_TESTS . 'cake_reporter.php'; + $Reporter = new CakeHtmlReporter(); + break; + default: + $Reporter = new TextReporter(); + break; + } + } + return $Reporter; + } + + function CakePHPTestRunMore() { + switch (CAKE_TEST_OUTPUT) { + case CAKE_TEST_OUTPUT_HTML: + if (isset($_GET['group'])) { + if (isset($_GET['app'])) { + $show = '?show=groups&amp;app=true'; + } else { + $show = '?show=groups'; + } + } + if (isset($_GET['case'])) { + if (isset($_GET['app'])) { + $show = '??show=cases&amp;app=truee'; + } else { + $show = '?show=cases'; + } + } + echo "<p><a href='" . $_SERVER['PHP_SELF'] . $show . "'>Run more tests</a></p>\n"; + break; + } + } + + function CakePHPTestCaseList() { + switch (CAKE_TEST_OUTPUT) { + case CAKE_TEST_OUTPUT_HTML: + if (isset($_GET['app'])) { + echo HtmlTestManager::getTestCaseList(APP_TEST_CASES); + } else { + echo HtmlTestManager::getTestCaseList(CORE_TEST_CASES); + } + break; + case CAKE_TEST_OUTPUT_TEXT: + default: + if (isset($_GET['app'])) { + echo TextTestManager::getTestCaseList(APP_TEST_CASES); + } else { + echo TextTestManager::getTestCaseList(CORE_TEST_CASES); + } + break; + } + } + + function CakePHPTestGroupTestList() { + switch (CAKE_TEST_OUTPUT) { + case CAKE_TEST_OUTPUT_HTML: + if (isset($_GET['app'])) { + echo HtmlTestManager::getGroupTestList(APP_TEST_GROUPS); + } else { + echo HtmlTestManager::getGroupTestList(CORE_TEST_GROUPS); + } + break; + case CAKE_TEST_OUTPUT_TEXT: + default: + if (isset($_GET['app'])) { + echo TextTestManager::getGroupTestList(APP_TEST_GROUPS); + } else { + echo TextTestManager::getGroupTestList(CORE_TEST_GROUPS); + } + break; + } + } + + function CakePHPTestHeader() { + switch (CAKE_TEST_OUTPUT) { + case CAKE_TEST_OUTPUT_HTML: + $baseUrl = BASE_URL; + $characterSet = 'ISO-8859-1'; + include CAKE . 'tests' . DS . 'lib' . DS . 'header.php'; + break; + case CAKE_TEST_OUTPUT_TEXT: + default: + header(' content-type: text/plain'); + break; + } + } + + function CakePHPTestSuiteHeader() { + switch (CAKE_TEST_OUTPUT) { + case CAKE_TEST_OUTPUT_HTML: + $groups = $_SERVER['PHP_SELF'].'?show=groups'; + $cases = $_SERVER['PHP_SELF'].'?show=cases'; + include CAKE . 'tests' . DS . 'lib' . DS . 'content.php'; + break; + } + } + + function CakePHPTestSuiteFooter() { + switch ( CAKE_TEST_OUTPUT) { + case CAKE_TEST_OUTPUT_HTML: + $baseUrl = BASE_URL; + include CAKE . 'tests' . DS . 'lib' . DS . 'footer.php'; + break; + } + } + + CakePHPTestHeader(); + CakePHPTestSuiteHeader(); + + if (isset($_GET['group'])) { + if ('all' == $_GET['group']) { + TestManager::runAllTests(CakeTestsGetReporter()); + } else { + if (isset($_GET['app'])) { + TestManager::runGroupTest(ucfirst($_GET['group']), APP_TEST_GROUPS, CakeTestsGetReporter()); + } else { + TestManager::runGroupTest(ucfirst($_GET['group']), CORE_TEST_GROUPS, CakeTestsGetReporter()); + } + } + CakePHPTestRunMore(); + CakePHPTestSuiteFooter(); + exit(); + } + + if (isset($_GET['case'])) { + TestManager::runTestCase($_GET['case'], CakeTestsGetReporter()); + CakePHPTestRunMore(); + CakePHPTestSuiteFooter(); + exit(); + } + + if (isset($_GET['show']) && $_GET['show'] == 'cases') { + CakePHPTestCaseList(); + } else { + CakePHPTestGroupTestList(); + } + CakePHPTestSuiteFooter(); +?> \ No newline at end of file