mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Merge commit 'upstream/1.3' into 1.3-email_component
This commit is contained in:
commit
984dc50f37
577 changed files with 21737 additions and 17239 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
app/config
|
/app/config
|
||||||
app/tmp
|
/app/tmp
|
||||||
plugins
|
/plugins
|
||||||
vendors
|
/vendors
|
|
@ -6,22 +6,18 @@
|
||||||
; *
|
; *
|
||||||
; * PHP versions 4 and 5
|
; * PHP versions 4 and 5
|
||||||
; *
|
; *
|
||||||
; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/
|
; * CakePHP(tm) : Rapid Development Framework http://cakephp.org/
|
||||||
; * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
; * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
; *
|
; *
|
||||||
; * Licensed under The MIT License
|
; * Licensed under The MIT License
|
||||||
; * Redistributions of files must retain the above copyright notice.
|
; * Redistributions of files must retain the above copyright notice.
|
||||||
; *
|
; *
|
||||||
; * @filesource
|
; * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
; * @link http://cakephp.org CakePHP(tm) Project
|
||||||
; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
; * @package cake
|
; * @package cake
|
||||||
; * @subpackage cake.app.config
|
; * @subpackage cake.app.config
|
||||||
; * @since CakePHP(tm) v 0.10.0.1076
|
; * @since CakePHP(tm) v 0.10.0.1076
|
||||||
; * @version $Revision$
|
; * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
; * @modifiedby $LastChangedBy$
|
|
||||||
; * @lastmodified $Date$
|
|
||||||
; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
; */
|
; */
|
||||||
|
|
||||||
; acl.ini.php - Cake ACL Configuration
|
; acl.ini.php - Cake ACL Configuration
|
||||||
|
|
|
@ -8,17 +8,17 @@
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config
|
* @subpackage cake.app.config
|
||||||
* @since CakePHP(tm) v 0.10.8.2117
|
* @since CakePHP(tm) v 0.10.8.2117
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
* 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
|
* 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
|
||||||
* 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
|
* 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
|
||||||
* 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
|
* 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
|
||||||
* 'controllers' => array(/full/path/to/controllers/', '/next/full/path/to/controllers/'),
|
* 'controllers' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
|
||||||
* 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
|
* 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
|
||||||
* 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
|
* 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
|
||||||
* 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
|
* 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
/**
|
||||||
* This is core configuration file.
|
* This is core configuration file.
|
||||||
*
|
*
|
||||||
|
@ -7,23 +6,20 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config
|
* @subpackage cake.app.config
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CakePHP Debug Level:
|
* CakePHP Debug Level:
|
||||||
*
|
*
|
||||||
|
@ -33,16 +29,32 @@
|
||||||
* Development Mode:
|
* Development Mode:
|
||||||
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
|
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
|
||||||
* 2: As in 1, but also with full debug messages and SQL output.
|
* 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 production mode, flash messages redirect after a time interval.
|
||||||
* In development mode, you need to click the flash message to continue.
|
* In development mode, you need to click the flash message to continue.
|
||||||
*/
|
*/
|
||||||
Configure::write('debug', 2);
|
Configure::write('debug', 2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CakePHP Log Level:
|
||||||
|
*
|
||||||
|
* In case of Production Mode CakePHP gives you the possibility to continue logging errors.
|
||||||
|
*
|
||||||
|
* The following parameters can be used:
|
||||||
|
* Boolean: Set true/false to activate/deactivate logging
|
||||||
|
* Configure::write('log', true);
|
||||||
|
*
|
||||||
|
* Integer: Use built-in PHP constants to set the error level (see error_reporting)
|
||||||
|
* Configure::write('log', E_ERROR | E_WARNING);
|
||||||
|
* Configure::write('log', E_ALL ^ E_NOTICE);
|
||||||
|
*/
|
||||||
|
Configure::write('log', true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application wide charset encoding
|
* Application wide charset encoding
|
||||||
*/
|
*/
|
||||||
Configure::write('App.encoding', 'UTF-8');
|
Configure::write('App.encoding', 'UTF-8');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To configure CakePHP *not* to use mod_rewrite and to
|
* To configure CakePHP *not* to use mod_rewrite and to
|
||||||
* use CakePHP pretty URLs, remove these .htaccess
|
* use CakePHP pretty URLs, remove these .htaccess
|
||||||
|
@ -55,22 +67,32 @@
|
||||||
* And uncomment the App.baseUrl below:
|
* And uncomment the App.baseUrl below:
|
||||||
*/
|
*/
|
||||||
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
|
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uncomment the define below to use CakePHP admin routes.
|
* Uncomment the define below to use CakePHP prefix routes.
|
||||||
*
|
*
|
||||||
* The value of the define determines the name of the route
|
* The value of the define determines the names of the routes
|
||||||
* and its associated controller actions:
|
* and their associated controller actions:
|
||||||
*
|
*
|
||||||
* 'admin' -> admin_index() and /admin/controller/index
|
* Set to an array of prefixes you want to use in your application. Use for
|
||||||
* 'superuser' -> superuser_index() and /superuser/controller/index
|
* admin or other prefixed routes.
|
||||||
|
*
|
||||||
|
* Routing.prefixes = array('admin', 'manager');
|
||||||
|
*
|
||||||
|
* Enables:
|
||||||
|
* `admin_index()` and `/admin/controller/index`
|
||||||
|
* `manager_index()` and `/manager/controller/index`
|
||||||
|
*
|
||||||
|
* [Note Routing.admin is deprecated in 1.3. Use Routing.prefixes instead]
|
||||||
*/
|
*/
|
||||||
//Configure::write('Routing.admin', 'admin');
|
//Configure::write('Routing.prefixes', array('admin'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turn off all caching application-wide.
|
* Turn off all caching application-wide.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//Configure::write('Cache.disable', true);
|
//Configure::write('Cache.disable', true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable cache checking.
|
* Enable cache checking.
|
||||||
*
|
*
|
||||||
|
@ -81,11 +103,13 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//Configure::write('Cache.check', true);
|
//Configure::write('Cache.check', true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the default error type when using the log() function. Used for
|
* Defines the default error type when using the log() function. Used for
|
||||||
* differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
|
* differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
|
||||||
*/
|
*/
|
||||||
define('LOG_ERROR', 2);
|
define('LOG_ERROR', 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The preferred session handling method. Valid values:
|
* The preferred session handling method. Valid values:
|
||||||
*
|
*
|
||||||
|
@ -101,6 +125,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Configure::write('Session.save', 'php');
|
Configure::write('Session.save', 'php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The model name to be used for the session model.
|
* The model name to be used for the session model.
|
||||||
*
|
*
|
||||||
|
@ -109,6 +134,7 @@
|
||||||
* The model name set here should *not* be used elsewhere in your application.
|
* The model name set here should *not* be used elsewhere in your application.
|
||||||
*/
|
*/
|
||||||
//Configure::write('Session.model', 'Session');
|
//Configure::write('Session.model', 'Session');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the table used to store CakePHP database sessions.
|
* The name of the table used to store CakePHP database sessions.
|
||||||
*
|
*
|
||||||
|
@ -122,30 +148,36 @@
|
||||||
* [Note: Session.table is deprecated as of CakePHP 1.3]
|
* [Note: Session.table is deprecated as of CakePHP 1.3]
|
||||||
*/
|
*/
|
||||||
//Configure::write('Session.table', 'cake_sessions');
|
//Configure::write('Session.table', 'cake_sessions');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DATABASE_CONFIG::$var to use for database session handling.
|
* The DATABASE_CONFIG::$var to use for database session handling.
|
||||||
*
|
*
|
||||||
* 'Session.save' must be set to 'database' in order to utilize this constant.
|
* 'Session.save' must be set to 'database' in order to utilize this constant.
|
||||||
*/
|
*/
|
||||||
//Configure::write('Session.database', 'default');
|
//Configure::write('Session.database', 'default');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of CakePHP's session cookie.
|
* The name of CakePHP's session cookie.
|
||||||
*/
|
*/
|
||||||
Configure::write('Session.cookie', 'CAKEPHP');
|
Configure::write('Session.cookie', 'CAKEPHP');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Session time out time (in seconds).
|
* Session time out time (in seconds).
|
||||||
* Actual value depends on 'Security.level' setting.
|
* Actual value depends on 'Security.level' setting.
|
||||||
*/
|
*/
|
||||||
Configure::write('Session.timeout', '120');
|
Configure::write('Session.timeout', '120');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to false, sessions are not automatically started.
|
* If set to false, sessions are not automatically started.
|
||||||
*/
|
*/
|
||||||
Configure::write('Session.start', true);
|
Configure::write('Session.start', true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When set to false, HTTP_USER_AGENT will not be checked
|
* When set to false, HTTP_USER_AGENT will not be checked
|
||||||
* in the session
|
* in the session
|
||||||
*/
|
*/
|
||||||
Configure::write('Session.checkAgent', true);
|
Configure::write('Session.checkAgent', true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The level of CakePHP security. The session timeout time defined
|
* The level of CakePHP security. The session timeout time defined
|
||||||
* in 'Session.timeout' is multiplied according to the settings here.
|
* in 'Session.timeout' is multiplied according to the settings here.
|
||||||
|
@ -158,11 +190,27 @@
|
||||||
* CakePHP session IDs are also regenerated between requests if
|
* CakePHP session IDs are also regenerated between requests if
|
||||||
* 'Security.level' is set to 'high'.
|
* 'Security.level' is set to 'high'.
|
||||||
*/
|
*/
|
||||||
Configure::write('Security.level', 'high');
|
Configure::write('Security.level', 'medium');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A random string used in security hashing methods.
|
* A random string used in security hashing methods.
|
||||||
*/
|
*/
|
||||||
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
|
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A random numeric string (digits only) used to encrypt/decrypt strings.
|
||||||
|
*/
|
||||||
|
Configure::write('Security.cipherSeed', '76859309657453542496749683645');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply timestamps with the last modified time to static assets (js, css, images).
|
||||||
|
* Will append a querystring parameter containing the time the file was modified. This is
|
||||||
|
* useful for invalidating browser caches.
|
||||||
|
*
|
||||||
|
* Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable
|
||||||
|
* timestamping.
|
||||||
|
*/
|
||||||
|
//Configure::write('Asset.timestamp', true);
|
||||||
/**
|
/**
|
||||||
* Compress CSS output by removing comments, whitespace, repeating tags, etc.
|
* 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.
|
* This requires a/var/cache directory to be writable by the web server for caching.
|
||||||
|
@ -171,6 +219,7 @@
|
||||||
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
|
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
|
||||||
*/
|
*/
|
||||||
//Configure::write('Asset.filter.css', 'css.php');
|
//Configure::write('Asset.filter.css', 'css.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
|
* 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.
|
* output, and setting the config below to the name of the script.
|
||||||
|
@ -178,17 +227,20 @@
|
||||||
* To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
|
* 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');
|
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The classname and database used in CakePHP's
|
* The classname and database used in CakePHP's
|
||||||
* access control lists.
|
* access control lists.
|
||||||
*/
|
*/
|
||||||
Configure::write('Acl.classname', 'DbAcl');
|
Configure::write('Acl.classname', 'DbAcl');
|
||||||
Configure::write('Acl.database', 'default');
|
Configure::write('Acl.database', 'default');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you are on PHP 5.3 uncomment this line and correct your server timezone
|
* If you are on PHP 5.3 uncomment this line and correct your server timezone
|
||||||
* to fix the date & time related errors.
|
* to fix the date & time related errors.
|
||||||
*/
|
*/
|
||||||
//date_default_timezone_set('UTC');
|
//date_default_timezone_set('UTC');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Cache Engine Configuration
|
* Cache Engine Configuration
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
|
@ -9,22 +8,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config
|
* @subpackage cake.app.config
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Here, we are connecting '/' (base path) to controller called 'Pages',
|
* Here, we are connecting '/' (base path) to controller called 'Pages',
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
|
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
|
||||||
/**
|
/**
|
||||||
* This is Acl Schema file
|
* This is Acl Schema file
|
||||||
|
@ -8,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config.sql
|
* @subpackage cake.app.config.sql
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
|
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
|
||||||
/**
|
/**
|
||||||
* This is i18n Schema file
|
* This is i18n Schema file
|
||||||
|
@ -8,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config.sql
|
* @subpackage cake.app.config.sql
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
|
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
|
||||||
/**
|
/**
|
||||||
* This is Sessions Schema file
|
* This is Sessions Schema file
|
||||||
|
@ -8,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config.sql
|
* @subpackage cake.app.config.sql
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,24 +1,19 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
/**
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app
|
* @subpackage cake.app
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
|
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
|
||||||
?>
|
?>
|
0
app/views/pages/empty
Normal file
0
app/views/pages/empty
Normal file
|
@ -1,28 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.webroot
|
* @subpackage cake.app.webroot
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
||||||
header('HTTP/1.1 404 Not Found');
|
header('HTTP/1.1 404 Not Found');
|
||||||
|
|
|
@ -1,24 +1,19 @@
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* Generic CSS for CakePHP
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.webroot.css
|
* @subpackage cake.app.webroot.css
|
||||||
* @since CakePHP(tm)
|
* @since CakePHP(tm)
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
@ -26,7 +21,7 @@
|
||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* General Style Info */
|
/** General Style Info **/
|
||||||
body {
|
body {
|
||||||
background: #003d4c;
|
background: #003d4c;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -35,14 +30,12 @@ body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
background:#fff;
|
|
||||||
color: #003d4c;
|
color: #003d4c;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
background:#fff;
|
color: #367889;
|
||||||
color: #003d4c;
|
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
a img {
|
a img {
|
||||||
|
@ -50,37 +43,33 @@ a img {
|
||||||
}
|
}
|
||||||
h1, h2, h3, h4 {
|
h1, h2, h3, h4 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
margin-bottom:0.5em;
|
||||||
}
|
}
|
||||||
h1 {
|
h1 {
|
||||||
background:#fff;
|
background:#fff;
|
||||||
color: #003d4c;
|
color: #003d4c;
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
margin: 0.1em 0;
|
|
||||||
}
|
}
|
||||||
h2 {
|
h2 {
|
||||||
background:#fff;
|
background:#fff;
|
||||||
color: #e32;
|
color: #e32;
|
||||||
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
|
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
|
||||||
font-size: 190%;
|
font-size: 190%;
|
||||||
margin: 0.3em 0;
|
|
||||||
padding-top: 0.8em;
|
|
||||||
}
|
}
|
||||||
h3 {
|
h3 {
|
||||||
color: #993;
|
color: #993;
|
||||||
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
|
font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
|
||||||
font-size: 165%;
|
font-size: 165%;
|
||||||
padding-top: 1.5em;
|
|
||||||
}
|
}
|
||||||
h4 {
|
h4 {
|
||||||
color: #993;
|
color: #993;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
padding-top: 0.5em;
|
|
||||||
}
|
}
|
||||||
ul, li {
|
ul, li {
|
||||||
margin: 0 12px;
|
margin: 0 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Layout */
|
/** Layout **/
|
||||||
#container {
|
#container {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +78,8 @@ ul, li {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
}
|
}
|
||||||
#header h1 {
|
#header h1 {
|
||||||
background: #003d4c url('../img/cake.icon.gif') no-repeat left;
|
line-height:20px;
|
||||||
|
background: #003d4c url('../img/cake.icon.png') no-repeat left;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 0px 30px;
|
padding: 0px 30px;
|
||||||
}
|
}
|
||||||
|
@ -117,10 +107,29 @@ ul, li {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tables */
|
/** containers **/
|
||||||
|
div.form,
|
||||||
|
div.index,
|
||||||
|
div.view {
|
||||||
|
float:right;
|
||||||
|
width:76%;
|
||||||
|
border-left:1px solid #666;
|
||||||
|
padding:10px 2%;
|
||||||
|
}
|
||||||
|
div.actions {
|
||||||
|
float:left;
|
||||||
|
width:16%;
|
||||||
|
padding:10px 1.5%;
|
||||||
|
}
|
||||||
|
div.actions h3 {
|
||||||
|
padding-top:0;
|
||||||
|
color:#777;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Tables **/
|
||||||
table {
|
table {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border:1px solid #ccc;
|
|
||||||
border-right:0;
|
border-right:0;
|
||||||
clear: both;
|
clear: both;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
@ -128,39 +137,42 @@ table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
th {
|
th {
|
||||||
background: #f2f2f2;
|
border:0;
|
||||||
border:1px solid #bbb;
|
border-bottom:2px solid #555;
|
||||||
border-top: 1px solid #fff;
|
text-align: left;
|
||||||
border-left: 1px solid #fff;
|
padding:4px;
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
th a {
|
th a {
|
||||||
background:#f2f2f2;
|
|
||||||
display: block;
|
display: block;
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
th a:hover {
|
th a.asc:after {
|
||||||
background: #ccc;
|
content: ' ⇣';
|
||||||
color: #333;
|
}
|
||||||
text-decoration: none;
|
th a.desc:after {
|
||||||
|
content: ' ⇡';
|
||||||
}
|
}
|
||||||
table tr td {
|
table tr td {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-right: 1px solid #ccc;
|
padding: 6px;
|
||||||
padding: 4px;
|
text-align: left;
|
||||||
text-align: center;
|
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
border-bottom:1px solid #ddd;
|
||||||
}
|
}
|
||||||
table tr.altrow td {
|
table tr:nth-child(2n) td {
|
||||||
background: #f4f4f4;
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
table .altrow td {
|
||||||
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
td.actions {
|
td.actions {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
td.actions a {
|
table td.actions a {
|
||||||
margin: 0px 6px;
|
margin: 0px 6px;
|
||||||
|
padding:2px 5px;
|
||||||
}
|
}
|
||||||
.cake-sql-log table {
|
.cake-sql-log table {
|
||||||
background: #f4f4f4;
|
background: #f4f4f4;
|
||||||
|
@ -168,27 +180,30 @@ td.actions a {
|
||||||
.cake-sql-log td {
|
.cake-sql-log td {
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
font-family: Monaco, Consolas, "Courier New", monospaced;
|
||||||
|
}
|
||||||
|
.cake-sql-log caption {
|
||||||
|
color:#fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Paging */
|
/** Paging **/
|
||||||
div.paging {
|
div.paging {
|
||||||
background:#fff;
|
background:#fff;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
margin-bottom: 2em;
|
margin-top: 1em;
|
||||||
|
clear:both;
|
||||||
}
|
}
|
||||||
div.paging div.disabled {
|
div.paging span.disabled {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
div.paging span {
|
|
||||||
}
|
|
||||||
div.paging span.current {
|
div.paging span.current {
|
||||||
color: #000;
|
color: #c73e14;
|
||||||
}
|
}
|
||||||
div.paging span a {
|
div.paging span a {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scaffold View */
|
/** Scaffold View **/
|
||||||
dl {
|
dl {
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
margin: 0em 0em;
|
margin: 0em 0em;
|
||||||
|
@ -208,16 +223,16 @@ dd {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Forms */
|
/** Forms **/
|
||||||
form {
|
form {
|
||||||
clear: both;
|
clear: both;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 80%;
|
width: 95%;
|
||||||
}
|
}
|
||||||
fieldset {
|
fieldset {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
margin-top: 30px;
|
margin-bottom: 1em;
|
||||||
padding: 16px 20px;
|
padding: 16px 20px;
|
||||||
}
|
}
|
||||||
fieldset legend {
|
fieldset legend {
|
||||||
|
@ -245,30 +260,33 @@ form div {
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
vertical-align: text-top;
|
vertical-align: text-top;
|
||||||
}
|
}
|
||||||
form div.input {
|
form .input {
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
form div.required {
|
form .required {
|
||||||
color: #333;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
form .required label:after {
|
||||||
|
color: #e32;
|
||||||
|
content: '*';
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
form div.submit {
|
form div.submit {
|
||||||
border: 0;
|
border: 0;
|
||||||
clear: both;
|
clear: both;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-left: 140px;
|
|
||||||
}
|
}
|
||||||
label {
|
label {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
padding-right: 20px;
|
margin-bottom:3px;
|
||||||
}
|
}
|
||||||
input, textarea {
|
input, textarea {
|
||||||
clear: both;
|
clear: both;
|
||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
|
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
|
||||||
padding: 2px;
|
padding: 1%;
|
||||||
width: 100%;
|
width:98%;
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
clear: both;
|
clear: both;
|
||||||
|
@ -288,6 +306,9 @@ input[type=checkbox] {
|
||||||
margin: 0px 6px 7px 2px;
|
margin: 0px 6px 7px 2px;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
div.checkbox label {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
input[type=radio] {
|
input[type=radio] {
|
||||||
float:left;
|
float:left;
|
||||||
width:auto;
|
width:auto;
|
||||||
|
@ -299,23 +320,37 @@ div.radio label {
|
||||||
input[type=submit] {
|
input[type=submit] {
|
||||||
display: inline;
|
display: inline;
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
padding: 2px 5px;
|
|
||||||
width: auto;
|
width: auto;
|
||||||
vertical-align: bottom;
|
}
|
||||||
|
form .submit input[type=submit] {
|
||||||
|
background:#62af56;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, from(#a8ea9c), to(#62af56));
|
||||||
|
background-image: -moz-linear-gradient(top, #a8ea9c, #62af56);
|
||||||
|
border-color: #2d6324;
|
||||||
|
color: #000;
|
||||||
|
text-shadow: #8cee7c 0px 1px 0px;
|
||||||
|
}
|
||||||
|
form .submit input[type=submit]:hover {
|
||||||
|
background:#4ca83d;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, from(#85e573), to(#4ca83d));
|
||||||
|
background-image: -moz-linear-gradient(top, #85e573, #4ca83d);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Notices and Errors */
|
/** Notices and Errors **/
|
||||||
div.message {
|
div.message {
|
||||||
clear: both;
|
clear: both;
|
||||||
color: #900;
|
color: #fff;
|
||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 1em 0;
|
margin: 0 0 1em 0;
|
||||||
|
background: #c73e14;
|
||||||
|
padding: 5px;
|
||||||
}
|
}
|
||||||
div.error-message {
|
div.error-message {
|
||||||
clear: both;
|
clear: both;
|
||||||
color: #900;
|
color: #fff;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
background: #c73e14;
|
||||||
}
|
}
|
||||||
p.error {
|
p.error {
|
||||||
background-color: #e32;
|
background-color: #e32;
|
||||||
|
@ -346,35 +381,57 @@ p.error em {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Actions */
|
/** Actions **/
|
||||||
div.actions ul {
|
div.actions ul {
|
||||||
margin: 0px 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
div.actions li {
|
div.actions li {
|
||||||
display: inline;
|
margin:0 0 0.5em 0;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
line-height: 2em;
|
|
||||||
margin: 0 2em 0 0;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
div.actions ul li a {
|
div.actions ul li a {
|
||||||
background:#fff;
|
font-weight: normal;
|
||||||
color: #003d4c;
|
display: block;
|
||||||
text-decoration: none;
|
clear: both;
|
||||||
}
|
}
|
||||||
div.actions ul li a:hover {
|
div.actions ul li a:hover {
|
||||||
color: #333;
|
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Related */
|
input[type=submit],
|
||||||
|
div.actions ul li a,
|
||||||
|
td.actions a {
|
||||||
|
font-weight:normal;
|
||||||
|
padding: 4px 8px;
|
||||||
|
background:#e6e49f;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, from(#f1f1d4), to(#e6e49f));
|
||||||
|
background-image: -moz-linear-gradient(top, #f1f1d4, #e6e49f);
|
||||||
|
color:#333;
|
||||||
|
border:1px solid #aaac62;
|
||||||
|
-webkit-border-radius:8px;
|
||||||
|
-moz-border-radius:8px;
|
||||||
|
border-radius:8px;
|
||||||
|
text-decoration:none;
|
||||||
|
text-shadow: #fff 0px 1px 0px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
input[type=submit]:hover,
|
||||||
|
div.actions ul li a:hover,
|
||||||
|
td.actions a:hover {
|
||||||
|
background: #f0f09a;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, from(#f7f7e1), to(#eeeca9));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Related **/
|
||||||
div.related {
|
div.related {
|
||||||
clear: both;
|
clear: both;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Debugging */
|
/** Debugging **/
|
||||||
pre {
|
pre {
|
||||||
color: #000;
|
color: #000;
|
||||||
background: #f0f0f0;
|
background: #f0f0f0;
|
||||||
|
@ -390,7 +447,6 @@ pre.cake-debug {
|
||||||
}
|
}
|
||||||
div.cake-stack-trace {
|
div.cake-stack-trace {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 4px dotted #ffcc00;
|
|
||||||
color: #333;
|
color: #333;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
|
|
0
app/webroot/files/empty
Normal file
0
app/webroot/files/empty
Normal file
BIN
app/webroot/img/cake.icon.png
Normal file
BIN
app/webroot/img/cake.icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 943 B |
|
@ -17,7 +17,7 @@
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.webroot
|
* @subpackage cake.app.webroot
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Use the DS to separate the directories in other defines
|
* Use the DS to separate the directories in other defines
|
||||||
|
|
0
app/webroot/js/empty
Normal file
0
app/webroot/js/empty
Normal file
|
@ -1,42 +0,0 @@
|
||||||
<?php
|
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
|
||||||
* 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-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
||||||
*
|
|
||||||
* Licensed under The MIT License
|
|
||||||
* Redistributions of files must retain the above copyright notice.
|
|
||||||
*
|
|
||||||
* @filesource
|
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
||||||
* @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$
|
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Enter description here...
|
|
||||||
*/
|
|
||||||
if (isset($_GET['file'])) {
|
|
||||||
$file = $_GET['file'];
|
|
||||||
$pos = strpos($file, '..');
|
|
||||||
if ($pos === false) {
|
|
||||||
if (is_file('../../vendors/javascript/'.$file) && (preg_match('/(\/.+)\\.js/', $file))) {
|
|
||||||
readfile('../../vendors/javascript/'.$file);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
header('HTTP/1.1 404 Not Found');
|
|
||||||
?>
|
|
|
@ -1,39 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Web Access Frontend for TestSuite
|
||||||
*
|
|
||||||
* Long description for file
|
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
||||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.tests.libs
|
* @subpackage cake.cake.tests.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4433
|
* @since CakePHP(tm) v 1.2.0.4433
|
||||||
* @version $Revision$
|
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
*/
|
*/
|
||||||
/**
|
|
||||||
* PHP 5.3 raises many notices in bootstrap.
|
|
||||||
*/
|
|
||||||
if (!defined('E_DEPRECATED')) {
|
|
||||||
define('E_DEPRECATED', 8192);
|
|
||||||
}
|
|
||||||
error_reporting(E_ALL & ~E_DEPRECATED);
|
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
ini_set('memory_limit','128M');
|
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
/**
|
/**
|
||||||
* Use the DS to separate the directories in other defines
|
* Use the DS to separate the directories in other defines
|
||||||
|
@ -100,89 +84,13 @@ if (isset($corePath[0])) {
|
||||||
define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
|
define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once CAKE_TESTS_LIB . 'test_manager.php';
|
|
||||||
|
|
||||||
if (Configure::read('debug') < 1) {
|
if (Configure::read('debug') < 1) {
|
||||||
die(__('Debug setting does not allow access to this url.', true));
|
die(__('Debug setting does not allow access to this url.', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($_SERVER['SERVER_NAME'])) {
|
require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
|
||||||
$_SERVER['SERVER_NAME'] = '';
|
|
||||||
}
|
|
||||||
if (empty( $_GET['output'])) {
|
|
||||||
$_GET['output'] = 'html';
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 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') {
|
$Dispatcher = new CakeTestSuiteDispatcher();
|
||||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML);
|
$Dispatcher->dispatch();
|
||||||
} else {
|
|
||||||
Debugger::output('txt');
|
|
||||||
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
|
|
||||||
CakePHPTestHeader();
|
|
||||||
include CAKE_TESTS_LIB . 'simpletest.php';
|
|
||||||
CakePHPTestSuiteFooter();
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$analyzeCodeCoverage = false;
|
|
||||||
if (isset($_GET['code_coverage'])) {
|
|
||||||
$analyzeCodeCoverage = true;
|
|
||||||
require_once CAKE_TESTS_LIB . 'code_coverage_manager.php';
|
|
||||||
if (!extension_loaded('xdebug')) {
|
|
||||||
CakePHPTestHeader();
|
|
||||||
include CAKE_TESTS_LIB . 'xdebug.php';
|
|
||||||
CakePHPTestSuiteFooter();
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CakePHPTestHeader();
|
|
||||||
CakePHPTestSuiteHeader();
|
|
||||||
define('RUN_TEST_LINK', $_SERVER['PHP_SELF']);
|
|
||||||
|
|
||||||
if (isset($_GET['group'])) {
|
|
||||||
if ('all' == $_GET['group']) {
|
|
||||||
TestManager::runAllTests(CakeTestsGetReporter());
|
|
||||||
} else {
|
|
||||||
if ($analyzeCodeCoverage) {
|
|
||||||
CodeCoverageManager::start($_GET['group'], CakeTestsGetReporter());
|
|
||||||
}
|
|
||||||
TestManager::runGroupTest(ucfirst($_GET['group']), CakeTestsGetReporter());
|
|
||||||
if ($analyzeCodeCoverage) {
|
|
||||||
CodeCoverageManager::report();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CakePHPTestRunMore();
|
|
||||||
CakePHPTestAnalyzeCodeCoverage();
|
|
||||||
} elseif (isset($_GET['case'])) {
|
|
||||||
if ($analyzeCodeCoverage) {
|
|
||||||
CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
|
|
||||||
}
|
|
||||||
|
|
||||||
TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
|
|
||||||
|
|
||||||
if ($analyzeCodeCoverage) {
|
|
||||||
CodeCoverageManager::report();
|
|
||||||
}
|
|
||||||
|
|
||||||
CakePHPTestRunMore();
|
|
||||||
CakePHPTestAnalyzeCodeCoverage();
|
|
||||||
} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') {
|
|
||||||
CakePHPTestCaseList();
|
|
||||||
} else {
|
|
||||||
CakePHPTestGroupTestList();
|
|
||||||
}
|
|
||||||
CakePHPTestSuiteFooter();
|
|
||||||
$output = ob_get_clean();
|
|
||||||
echo $output;
|
|
||||||
?>
|
?>
|
|
@ -1,7 +1,7 @@
|
||||||
The MIT License
|
The MIT License
|
||||||
|
|
||||||
CakePHP(tm) : The Rapid Development PHP Framework (http://www.cakephp.org)
|
CakePHP(tm) : The Rapid Development PHP Framework (http://www.cakephp.org)
|
||||||
Copyright 2005-2007, Cake Software Foundation, Inc.
|
Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
|
@ -17,5 +17,4 @@
|
||||||
// @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
// @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
// +--------------------------------------------------------------------------------------------+ //
|
// +--------------------------------------------------------------------------------------------+ //
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
1.3.0-beta
|
||||||
1.3.0.0
|
|
172
cake/basics.php
172
cake/basics.php
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic Cake functionality.
|
* Basic Cake functionality.
|
||||||
*
|
*
|
||||||
|
@ -8,34 +6,30 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake
|
* @subpackage cake.cake
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic defines for timing functions.
|
* Basic defines for timing functions.
|
||||||
*/
|
*/
|
||||||
define('SECOND', 1);
|
define('SECOND', 1);
|
||||||
define('MINUTE', 60 * SECOND);
|
define('MINUTE', 60);
|
||||||
define('HOUR', 60 * MINUTE);
|
define('HOUR', 3600);
|
||||||
define('DAY', 24 * HOUR);
|
define('DAY', 86400);
|
||||||
define('WEEK', 7 * DAY);
|
define('WEEK', 604800);
|
||||||
define('MONTH', 30 * DAY);
|
define('MONTH', 2592000);
|
||||||
define('YEAR', 365 * DAY);
|
define('YEAR', 31536000);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch for PHP < 5.0
|
* Patch for PHP < 5.0
|
||||||
|
@ -54,9 +48,8 @@ if (!function_exists('clone')) {
|
||||||
* Loads configuration files. Receives a set of configuration files
|
* Loads configuration files. Receives a set of configuration files
|
||||||
* to load.
|
* to load.
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
*
|
||||||
* config('config1', 'config2');
|
* `config('config1', 'config2');`
|
||||||
* </code>
|
|
||||||
*
|
*
|
||||||
* @return boolean Success
|
* @return boolean Success
|
||||||
*/
|
*/
|
||||||
|
@ -84,12 +77,11 @@ if (!function_exists('clone')) {
|
||||||
* Loads component/components from LIBS. Takes optional number of parameters.
|
* Loads component/components from LIBS. Takes optional number of parameters.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
*
|
||||||
* uses('flay', 'time');
|
* `uses('flay', 'time');`
|
||||||
* </code>
|
|
||||||
*
|
*
|
||||||
* @param string $name Filename without the .php part
|
* @param string $name Filename without the .php part
|
||||||
* @deprecated
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function uses() {
|
function uses() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
@ -177,6 +169,7 @@ if (!function_exists('array_combine')) {
|
||||||
* @param array $a1 Array to use for keys
|
* @param array $a1 Array to use for keys
|
||||||
* @param array $a2 Array to use for values
|
* @param array $a2 Array to use for values
|
||||||
* @return mixed Outputs either combined array or false.
|
* @return mixed Outputs either combined array or false.
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function array_combine($a1, $a2) {
|
function array_combine($a1, $a2) {
|
||||||
$a1 = array_values($a1);
|
$a1 = array_values($a1);
|
||||||
|
@ -211,30 +204,57 @@ if (!function_exists('array_combine')) {
|
||||||
if (is_array($text)) {
|
if (is_array($text)) {
|
||||||
return array_map('h', $text);
|
return array_map('h', $text);
|
||||||
}
|
}
|
||||||
if (empty($charset)) {
|
|
||||||
$charset = Configure::read('App.encoding');
|
static $defaultCharset = false;
|
||||||
|
if ($defaultCharset === false) {
|
||||||
|
$defaultCharset = Configure::read('App.encoding');
|
||||||
|
if ($defaultCharset === null) {
|
||||||
|
$defaultCharset = 'UTF-8';
|
||||||
}
|
}
|
||||||
if (empty($charset)) {
|
|
||||||
$charset = 'UTF-8';
|
|
||||||
}
|
}
|
||||||
|
if ($charset) {
|
||||||
return htmlspecialchars($text, ENT_QUOTES, $charset);
|
return htmlspecialchars($text, ENT_QUOTES, $charset);
|
||||||
|
} else {
|
||||||
|
return htmlspecialchars($text, ENT_QUOTES, $defaultCharset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Splits a dot syntax plugin name into its plugin and classname.
|
||||||
|
* If $name does not have a dot, then index 0 will be null.
|
||||||
|
*
|
||||||
|
* Commonly used like `list($plugin, $name) = pluginSplit($name);`
|
||||||
|
*
|
||||||
|
* @param string $name The name you want to plugin split.
|
||||||
|
* @param boolean $dotAppend Set to true if you want the plugin to have a '.' appended to it.
|
||||||
|
* @param string $plugin Optional default plugin to use if no plugin is found. Defaults to null.
|
||||||
|
* @return array Array with 2 indexes. 0 => plugin name, 1 => classname
|
||||||
|
*/
|
||||||
|
function pluginSplit($name, $dotAppend = false, $plugin = null) {
|
||||||
|
if (strpos($name, '.') !== false) {
|
||||||
|
$parts = explode('.', $name, 2);
|
||||||
|
if ($dotAppend) {
|
||||||
|
$parts[0] .= '.';
|
||||||
|
}
|
||||||
|
return $parts;
|
||||||
|
}
|
||||||
|
return array($plugin, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of all the given parameters.
|
* Returns an array of all the given parameters.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
*
|
||||||
* a('a', 'b')
|
* `a('a', 'b')`
|
||||||
* </code>
|
|
||||||
*
|
*
|
||||||
* Would return:
|
* Would return:
|
||||||
* <code>
|
*
|
||||||
* array('a', 'b')
|
* `array('a', 'b')`
|
||||||
* </code>
|
|
||||||
*
|
*
|
||||||
* @return array Array of given parameters
|
* @return array Array of given parameters
|
||||||
* @link http://book.cakephp.org/view/694/a
|
* @link http://book.cakephp.org/view/694/a
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function a() {
|
function a() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
@ -245,17 +265,16 @@ if (!function_exists('array_combine')) {
|
||||||
* Constructs associative array from pairs of arguments.
|
* Constructs associative array from pairs of arguments.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
*
|
||||||
* aa('a','b')
|
* `aa('a','b')`
|
||||||
* </code>
|
|
||||||
*
|
*
|
||||||
* Would return:
|
* Would return:
|
||||||
* <code>
|
*
|
||||||
* array('a'=>'b')
|
* `array('a'=>'b')`
|
||||||
* </code>
|
|
||||||
*
|
*
|
||||||
* @return array Associative array
|
* @return array Associative array
|
||||||
* @link http://book.cakephp.org/view/695/aa
|
* @link http://book.cakephp.org/view/695/aa
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function aa() {
|
function aa() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
@ -276,6 +295,7 @@ if (!function_exists('array_combine')) {
|
||||||
*
|
*
|
||||||
* @param string $text String to echo
|
* @param string $text String to echo
|
||||||
* @link http://book.cakephp.org/view/700/e
|
* @link http://book.cakephp.org/view/700/e
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function e($text) {
|
function e($text) {
|
||||||
echo $text;
|
echo $text;
|
||||||
|
@ -287,6 +307,7 @@ if (!function_exists('array_combine')) {
|
||||||
* @param string $str String to lowercase
|
* @param string $str String to lowercase
|
||||||
* @return string Lowercased string
|
* @return string Lowercased string
|
||||||
* @link http://book.cakephp.org/view/705/low
|
* @link http://book.cakephp.org/view/705/low
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function low($str) {
|
function low($str) {
|
||||||
return strtolower($str);
|
return strtolower($str);
|
||||||
|
@ -298,6 +319,7 @@ if (!function_exists('array_combine')) {
|
||||||
* @param string $str String to uppercase
|
* @param string $str String to uppercase
|
||||||
* @return string Uppercased string
|
* @return string Uppercased string
|
||||||
* @link http://book.cakephp.org/view/710/up
|
* @link http://book.cakephp.org/view/710/up
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function up($str) {
|
function up($str) {
|
||||||
return strtoupper($str);
|
return strtoupper($str);
|
||||||
|
@ -311,6 +333,7 @@ if (!function_exists('array_combine')) {
|
||||||
* @param string $subject String to search
|
* @param string $subject String to search
|
||||||
* @return string Replaced string
|
* @return string Replaced string
|
||||||
* @link http://book.cakephp.org/view/708/r
|
* @link http://book.cakephp.org/view/708/r
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function r($search, $replace, $subject) {
|
function r($search, $replace, $subject) {
|
||||||
return str_replace($search, $replace, $subject);
|
return str_replace($search, $replace, $subject);
|
||||||
|
@ -338,6 +361,7 @@ if (!function_exists('array_combine')) {
|
||||||
*
|
*
|
||||||
* @param mixed $p Parameter as string or array
|
* @param mixed $p Parameter as string or array
|
||||||
* @return string
|
* @return string
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function params($p) {
|
function params($p) {
|
||||||
if (!is_array($p) || count($p) == 0) {
|
if (!is_array($p) || count($p) == 0) {
|
||||||
|
@ -451,15 +475,16 @@ if (!function_exists('file_put_contents')) {
|
||||||
/**
|
/**
|
||||||
* Writes data into file.
|
* Writes data into file.
|
||||||
*
|
*
|
||||||
* If file exists, it will be overwritten. If data is an array, it will be join()ed with an empty string.
|
* If file exists, it will be overwritten. If data is an array, it will be implode()ed with an empty string.
|
||||||
*
|
*
|
||||||
* @param string $fileName File name.
|
* @param string $fileName File name.
|
||||||
* @param mixed $data String or array.
|
* @param mixed $data String or array.
|
||||||
* @return boolean Success
|
* @return boolean Success
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function file_put_contents($fileName, $data) {
|
function file_put_contents($fileName, $data) {
|
||||||
if (is_array($data)) {
|
if (is_array($data)) {
|
||||||
$data = join('', $data);
|
$data = implode('', $data);
|
||||||
}
|
}
|
||||||
$res = @fopen($fileName, 'w+b');
|
$res = @fopen($fileName, 'w+b');
|
||||||
|
|
||||||
|
@ -496,7 +521,7 @@ if (!function_exists('file_put_contents')) {
|
||||||
$expires = strtotime($expires, $now);
|
$expires = strtotime($expires, $now);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (low($target)) {
|
switch (strtolower($target)) {
|
||||||
case 'cache':
|
case 'cache':
|
||||||
$filename = CACHE . $path;
|
$filename = CACHE . $path;
|
||||||
break;
|
break;
|
||||||
|
@ -531,10 +556,9 @@ if (!function_exists('file_put_contents')) {
|
||||||
/**
|
/**
|
||||||
* Used to delete files in the cache directories, or clear contents of cache directories
|
* Used to delete files in the cache directories, or clear contents of cache directories
|
||||||
*
|
*
|
||||||
* @param mixed $params As String name to be searched for deletion, if name is a directory all files in directory will be deleted.
|
* @param mixed $params As String name to be searched for deletion, if name is a directory all files in
|
||||||
* If array, names to be searched for deletion.
|
* directory will be deleted. If array, names to be searched for deletion. If clearCache() without params,
|
||||||
* If clearCache() without params, all files in app/tmp/cache/views will be deleted
|
* all files in app/tmp/cache/views will be deleted
|
||||||
*
|
|
||||||
* @param string $type Directory in tmp/cache defaults to view directory
|
* @param string $type Directory in tmp/cache defaults to view directory
|
||||||
* @param string $ext The file extension you are deleting
|
* @param string $ext The file extension you are deleting
|
||||||
* @return true if files found and deleted false otherwise
|
* @return true if files found and deleted false otherwise
|
||||||
|
@ -715,13 +739,14 @@ if (!function_exists('file_put_contents')) {
|
||||||
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
||||||
*
|
*
|
||||||
* Note that the category must be specified with a numeric value, instead of the constant name. The values are:
|
* Note that the category must be specified with a numeric value, instead of the constant name. The values are:
|
||||||
* LC_CTYPE 0
|
*
|
||||||
* LC_NUMERIC 1
|
* - LC_ALL 0
|
||||||
* LC_TIME 2
|
* - LC_COLLATE 1
|
||||||
* LC_COLLATE 3
|
* - LC_CTYPE 2
|
||||||
* LC_MONETARY 4
|
* - LC_MONETARY 3
|
||||||
* LC_MESSAGES 5
|
* - LC_NUMERIC 4
|
||||||
* LC_ALL 6
|
* - LC_TIME 5
|
||||||
|
* - LC_MESSAGES 6
|
||||||
*
|
*
|
||||||
* @param string $domain Domain
|
* @param string $domain Domain
|
||||||
* @param string $msg Message to translate
|
* @param string $msg Message to translate
|
||||||
|
@ -754,13 +779,14 @@ if (!function_exists('file_put_contents')) {
|
||||||
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
||||||
*
|
*
|
||||||
* Note that the category must be specified with a numeric value, instead of the constant name. The values are:
|
* Note that the category must be specified with a numeric value, instead of the constant name. The values are:
|
||||||
* LC_ALL 0
|
*
|
||||||
* LC_COLLATE 1
|
* - LC_ALL 0
|
||||||
* LC_CTYPE 2
|
* - LC_COLLATE 1
|
||||||
* LC_MONETARY 3
|
* - LC_CTYPE 2
|
||||||
* LC_NUMERIC 4
|
* - LC_MONETARY 3
|
||||||
* LC_TIME 5
|
* - LC_NUMERIC 4
|
||||||
* LC_MESSAGES 6
|
* - LC_TIME 5
|
||||||
|
* - LC_MESSAGES 6
|
||||||
*
|
*
|
||||||
* @param string $domain Domain
|
* @param string $domain Domain
|
||||||
* @param string $singular Singular string to translate
|
* @param string $singular Singular string to translate
|
||||||
|
@ -790,13 +816,14 @@ if (!function_exists('file_put_contents')) {
|
||||||
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
|
||||||
*
|
*
|
||||||
* Note that the category must be specified with a numeric value, instead of the constant name. The values are:
|
* Note that the category must be specified with a numeric value, instead of the constant name. The values are:
|
||||||
* LC_CTYPE 0
|
*
|
||||||
* LC_NUMERIC 1
|
* - LC_ALL 0
|
||||||
* LC_TIME 2
|
* - LC_COLLATE 1
|
||||||
* LC_COLLATE 3
|
* - LC_CTYPE 2
|
||||||
* LC_MONETARY 4
|
* - LC_MONETARY 3
|
||||||
* LC_MESSAGES 5
|
* - LC_NUMERIC 4
|
||||||
* LC_ALL 6
|
* - LC_TIME 5
|
||||||
|
* - LC_MESSAGES 6
|
||||||
*
|
*
|
||||||
* @param string $msg String to translate
|
* @param string $msg String to translate
|
||||||
* @param integer $category Category
|
* @param integer $category Category
|
||||||
|
@ -824,6 +851,7 @@ if (!function_exists('file_put_contents')) {
|
||||||
* @param array First array
|
* @param array First array
|
||||||
* @param array Second array
|
* @param array Second array
|
||||||
* @return array Array with different keys
|
* @return array Array with different keys
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
if (!function_exists('array_diff_key')) {
|
if (!function_exists('array_diff_key')) {
|
||||||
function array_diff_key() {
|
function array_diff_key() {
|
||||||
|
@ -859,6 +887,7 @@ if (!function_exists('file_put_contents')) {
|
||||||
* @param array First array
|
* @param array First array
|
||||||
* @param array Second array
|
* @param array Second array
|
||||||
* @return array Array with interesected keys
|
* @return array Array with interesected keys
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
if (!function_exists('array_intersect_key')) {
|
if (!function_exists('array_intersect_key')) {
|
||||||
function array_intersect_key($arr1, $arr2) {
|
function array_intersect_key($arr1, $arr2) {
|
||||||
|
@ -930,6 +959,7 @@ if (!function_exists('file_put_contents')) {
|
||||||
* @param string $baseKey Base key
|
* @param string $baseKey Base key
|
||||||
* @return string URL encoded query string
|
* @return string URL encoded query string
|
||||||
* @see http://php.net/http_build_query
|
* @see http://php.net/http_build_query
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
if (!function_exists('http_build_query')) {
|
if (!function_exists('http_build_query')) {
|
||||||
function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null) {
|
function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null) {
|
||||||
|
@ -965,15 +995,15 @@ if (!function_exists('file_put_contents')) {
|
||||||
* Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2.
|
* Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2.
|
||||||
* Don't use for isset() conditions, or wrap your variable with @ operator:
|
* Don't use for isset() conditions, or wrap your variable with @ operator:
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
*
|
||||||
* ife(isset($variable), @$variable, 'default');
|
* `ife(isset($variable), @$variable, 'default');`
|
||||||
* </code>
|
|
||||||
*
|
*
|
||||||
* @param mixed $condition Conditional expression
|
* @param mixed $condition Conditional expression
|
||||||
* @param mixed $val1 Value to return in case condition matches
|
* @param mixed $val1 Value to return in case condition matches
|
||||||
* @param mixed $val2 Value to return if condition doesn't match
|
* @param mixed $val2 Value to return if condition doesn't match
|
||||||
* @return mixed $val1 or $val2, depending on whether $condition evaluates to a non-empty expression.
|
* @return mixed $val1 or $val2, depending on whether $condition evaluates to a non-empty expression.
|
||||||
* @link http://book.cakephp.org/view/704/ife
|
* @link http://book.cakephp.org/view/704/ife
|
||||||
|
* @deprecated Will be removed in 2.0
|
||||||
*/
|
*/
|
||||||
function ife($condition, $val1 = null, $val2 = null) {
|
function ife($condition, $val1 = null, $val2 = null) {
|
||||||
if (!empty($condition)) {
|
if (!empty($condition)) {
|
||||||
|
|
|
@ -19,5 +19,5 @@
|
||||||
* @since CakePHP(tm) v 1.1.11.4062
|
* @since CakePHP(tm) v 1.1.11.4062
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
return $config['Cake.version'] = '1.3.0.0';
|
return $config['Cake.version'] = '1.3.0-beta';
|
||||||
?>
|
?>
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
|
@ -8,22 +6,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.app.config
|
* @subpackage cake.cake.app.config
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,6 +65,11 @@ if (!defined('APP')) {
|
||||||
*/
|
*/
|
||||||
define('COMPONENTS', CONTROLLERS.'components'.DS);
|
define('COMPONENTS', CONTROLLERS.'components'.DS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the application's libs directory.
|
||||||
|
*/
|
||||||
|
define('APPLIBS', APP.'libs'.DS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to the application's views directory.
|
* Path to the application's views directory.
|
||||||
*/
|
*/
|
||||||
|
@ -100,11 +99,6 @@ if (!defined('CONFIGS')) {
|
||||||
define('CONFIGS', APP.'config'.DS);
|
define('CONFIGS', APP.'config'.DS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Path to the libs directory.
|
|
||||||
*/
|
|
||||||
define('INFLECTIONS', CAKE.'config'.DS.'inflections'.DS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to the libs directory.
|
* Path to the libs directory.
|
||||||
*/
|
*/
|
||||||
|
@ -198,13 +192,6 @@ if (!defined('VENDORS')) {
|
||||||
define('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS);
|
define('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Path to the Pear directory
|
|
||||||
* The purporse is to make it easy porting Pear libs into Cake
|
|
||||||
* without setting the include_path PHP variable.
|
|
||||||
*/
|
|
||||||
define('PEAR', VENDORS.'Pear'.DS);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Full url prefix
|
* Full url prefix
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.6833
|
* @since CakePHP(tm) v 1.2.0.6833
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Case Folding Properties.
|
* Case Folding Properties.
|
||||||
*
|
*
|
||||||
|
@ -12,22 +10,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.config.unicode.casefolding
|
* @subpackage cake.cake.config.unicode.casefolding
|
||||||
* @since CakePHP(tm) v 1.2.0.5691
|
* @since CakePHP(tm) v 1.2.0.5691
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,22 +4,18 @@
|
||||||
# Bake is a shell script for running CakePHP bake script
|
# Bake is a shell script for running CakePHP bake script
|
||||||
# PHP versions 4 and 5
|
# PHP versions 4 and 5
|
||||||
#
|
#
|
||||||
# CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
# Copyright 2005-2007, Cake Software Foundation, Inc.
|
# Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# Licensed under The MIT License
|
# Licensed under The MIT License
|
||||||
# Redistributions of files must retain the above copyright notice.
|
# Redistributions of files must retain the above copyright notice.
|
||||||
#
|
#
|
||||||
# @filesource
|
# @copyright Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
# @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
|
# @link http://cakephp.org CakePHP(tm) Project
|
||||||
# @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
# @package cake
|
# @package cake
|
||||||
# @subpackage cake.cake.console
|
# @subpackage cake.cake.console
|
||||||
# @since CakePHP(tm) v 1.2.0.5012
|
# @since CakePHP(tm) v 1.2.0.5012
|
||||||
# @version $Revision$
|
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
# @modifiedby $LastChangedBy$
|
|
||||||
# @lastmodified $Date$
|
|
||||||
# @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
LIB=${0/%cake/}
|
LIB=${0/%cake/}
|
||||||
|
|
|
@ -3,22 +3,18 @@
|
||||||
:: Bake is a shell script for running CakePHP bake script
|
:: Bake is a shell script for running CakePHP bake script
|
||||||
:: PHP versions 4 and 5
|
:: PHP versions 4 and 5
|
||||||
::
|
::
|
||||||
:: CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
:: Copyright 2005-2007, Cake Software Foundation, Inc.
|
:: Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
::
|
::
|
||||||
:: Licensed under The MIT License
|
:: Licensed under The MIT License
|
||||||
:: Redistributions of files must retain the above copyright notice.
|
:: Redistributions of files must retain the above copyright notice.
|
||||||
::
|
::
|
||||||
:: @filesource
|
:: @copyright Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
:: @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
|
:: @link http://cakephp.org CakePHP(tm) Project
|
||||||
:: @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
:: @package cake
|
:: @package cake
|
||||||
:: @subpackage cake.cake.console
|
:: @subpackage cake.cake.console
|
||||||
:: @since CakePHP(tm) v 1.2.0.5012
|
:: @since CakePHP(tm) v 1.2.0.5012
|
||||||
:: @version $Revision$
|
:: @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
:: @modifiedby $LastChangedBy$
|
|
||||||
:: @lastmodified $Date$
|
|
||||||
:: @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
::
|
::
|
||||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
|
|
@ -7,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
* Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console
|
* @subpackage cake.cake.console
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
if (!defined('E_DEPRECATED')) {
|
if (!defined('E_DEPRECATED')) {
|
||||||
define('E_DEPRECATED', 8192);
|
define('E_DEPRECATED', 8192);
|
||||||
|
@ -123,15 +119,6 @@ class ShellDispatcher {
|
||||||
*/
|
*/
|
||||||
var $shellName = null;
|
var $shellName = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs this ShellDispatcher instance.
|
|
||||||
*
|
|
||||||
* @param array $args the argv.
|
|
||||||
*/
|
|
||||||
function ShellDispatcher($args = array()) {
|
|
||||||
$this->__construct($args);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
@ -142,7 +129,7 @@ class ShellDispatcher {
|
||||||
* @return void
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function __construct($args = array()) {
|
function ShellDispatcher($args = array()) {
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
$this->__initConstants();
|
$this->__initConstants();
|
||||||
|
@ -160,7 +147,7 @@ class ShellDispatcher {
|
||||||
function __initConstants() {
|
function __initConstants() {
|
||||||
if (function_exists('ini_set')) {
|
if (function_exists('ini_set')) {
|
||||||
ini_set('display_errors', '1');
|
ini_set('display_errors', '1');
|
||||||
ini_set('error_reporting', E_ALL);
|
ini_set('error_reporting', E_ALL & ~E_DEPRECATED);
|
||||||
ini_set('html_errors', false);
|
ini_set('html_errors', false);
|
||||||
ini_set('implicit_flush', true);
|
ini_set('implicit_flush', true);
|
||||||
ini_set('max_execution_time', 0);
|
ini_set('max_execution_time', 0);
|
||||||
|
@ -222,20 +209,17 @@ class ShellDispatcher {
|
||||||
*/
|
*/
|
||||||
function __buildPaths() {
|
function __buildPaths() {
|
||||||
$paths = array();
|
$paths = array();
|
||||||
$pluginPaths = App::path('plugins');
|
|
||||||
if (!class_exists('Folder')) {
|
if (!class_exists('Folder')) {
|
||||||
require LIBS . 'folder.php';
|
require LIBS . 'folder.php';
|
||||||
}
|
}
|
||||||
foreach ($pluginPaths as $pluginPath) {
|
$plugins = App::objects('plugin', null, false);
|
||||||
$Folder =& new Folder($pluginPath);
|
|
||||||
list($plugins,) = $Folder->read(false, true);
|
|
||||||
foreach ((array)$plugins as $plugin) {
|
foreach ((array)$plugins as $plugin) {
|
||||||
$path = $pluginPath . Inflector::underscore($plugin) . DS . 'vendors' . DS . 'shells' . DS;
|
$pluginPath = App::pluginPath($plugin);
|
||||||
|
$path = $pluginPath . 'vendors' . DS . 'shells' . DS;
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
$paths[] = $path;
|
$paths[] = $path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$vendorPaths = array_values(App::path('vendors'));
|
$vendorPaths = array_values(App::path('vendors'));
|
||||||
foreach ($vendorPaths as $vendorPath) {
|
foreach ($vendorPaths as $vendorPath) {
|
||||||
|
@ -325,12 +309,7 @@ class ShellDispatcher {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($arg, '.') !== false) {
|
list($plugin, $shell) = pluginSplit($arg);
|
||||||
list($plugin, $shell) = explode('.', $arg);
|
|
||||||
} else {
|
|
||||||
$plugin = null;
|
|
||||||
$shell = $arg;
|
|
||||||
}
|
|
||||||
$this->shell = $shell;
|
$this->shell = $shell;
|
||||||
$this->shellName = Inflector::camelize($shell);
|
$this->shellName = Inflector::camelize($shell);
|
||||||
$this->shellClass = $this->shellName . 'Shell';
|
$this->shellClass = $this->shellName . 'Shell';
|
||||||
|
@ -402,6 +381,7 @@ class ShellDispatcher {
|
||||||
$this->stderr($title . "\n" . $message . "\n");
|
$this->stderr($title . "\n" . $message . "\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get shell to use, either plugin shell or application shell
|
* Get shell to use, either plugin shell or application shell
|
||||||
*
|
*
|
||||||
|
@ -479,13 +459,14 @@ class ShellDispatcher {
|
||||||
*
|
*
|
||||||
* @param string $string String to output.
|
* @param string $string String to output.
|
||||||
* @param boolean $newline If true, the outputs gets an added newline.
|
* @param boolean $newline If true, the outputs gets an added newline.
|
||||||
|
* @return integer Returns the number of bytes output to stdout.
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function stdout($string, $newline = true) {
|
function stdout($string, $newline = true) {
|
||||||
if ($newline) {
|
if ($newline) {
|
||||||
fwrite($this->stdout, $string . "\n");
|
return fwrite($this->stdout, $string . "\n");
|
||||||
} else {
|
} else {
|
||||||
fwrite($this->stdout, $string);
|
return fwrite($this->stdout, $string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,26 +587,56 @@ class ShellDispatcher {
|
||||||
$this->stdout("Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp");
|
$this->stdout("Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp");
|
||||||
|
|
||||||
$this->stdout("\nAvailable Shells:");
|
$this->stdout("\nAvailable Shells:");
|
||||||
$_shells = array();
|
$shellList = array();
|
||||||
foreach ($this->shellPaths as $path) {
|
foreach ($this->shellPaths as $path) {
|
||||||
if (is_dir($path)) {
|
if (!is_dir($path)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$shells = App::objects('file', $path);
|
$shells = App::objects('file', $path);
|
||||||
$path = str_replace(CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS, 'CORE' . DS, $path);
|
|
||||||
$path = str_replace(APP, 'APP' . DS, $path);
|
|
||||||
$path = str_replace(ROOT, 'ROOT', $path);
|
|
||||||
$path = rtrim($path, DS);
|
|
||||||
$this->stdout("\n " . $path . ":");
|
|
||||||
if (empty($shells)) {
|
if (empty($shells)) {
|
||||||
$this->stdout("\t - none");
|
continue;
|
||||||
|
}
|
||||||
|
if (preg_match('@plugins[\\\/]([^\\\/]*)@', $path, $matches)) {
|
||||||
|
$type = Inflector::camelize($matches[1]);
|
||||||
|
} elseif (preg_match('@([^\\\/]*)[\\\/]vendors[\\\/]@', $path, $matches)) {
|
||||||
|
$type = $matches[1];
|
||||||
|
} elseif (strpos($path, CAKE_CORE_INCLUDE_PATH . DS . 'cake') === 0) {
|
||||||
|
$type = 'CORE';
|
||||||
} else {
|
} else {
|
||||||
sort($shells);
|
$type = 'app';
|
||||||
|
}
|
||||||
foreach ($shells as $shell) {
|
foreach ($shells as $shell) {
|
||||||
|
|
||||||
if ($shell !== 'shell.php') {
|
if ($shell !== 'shell.php') {
|
||||||
$this->stdout("\t " . str_replace('.php', '', $shell));
|
$shell = str_replace('.php', '', $shell);
|
||||||
|
$shellList[$shell][$type] = $type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($shellList) {
|
||||||
|
ksort($shellList);
|
||||||
|
if (DS === '/') {
|
||||||
|
$width = exec('tput cols') - 2;
|
||||||
|
}
|
||||||
|
if (empty($width)) {
|
||||||
|
$width = 80;
|
||||||
|
}
|
||||||
|
$columns = max(1, floor($width / 30));
|
||||||
|
$rows = ceil(count($shellList) / $columns);
|
||||||
|
|
||||||
|
foreach($shellList as $shell => $types) {
|
||||||
|
sort($types);
|
||||||
|
$shellList[$shell] = str_pad($shell . ' [' . implode ($types, ', ') . ']', $width / $columns);
|
||||||
|
}
|
||||||
|
$out = array_chunk($shellList, $rows);
|
||||||
|
for($i = 0; $i < $rows; $i++) {
|
||||||
|
$row = '';
|
||||||
|
for($j = 0; $j < $columns; $j++) {
|
||||||
|
if (!isset($out[$j][$i])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$row .= $out[$j][$i];
|
||||||
|
}
|
||||||
|
$this->stdout(" " . $row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->stdout("\nTo run a command, type 'cake shell_name [args]'");
|
$this->stdout("\nTo run a command, type 'cake shell_name [args]'");
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ErrorHandler for Console Shells
|
* ErrorHandler for Console Shells
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console
|
* @subpackage cake.cake.console
|
||||||
* @since CakePHP(tm) v 1.2.0.5074
|
* @since CakePHP(tm) v 1.2.0.5074
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Acl Shell provides Acl access in the CLI environment
|
||||||
*
|
|
||||||
* Long description for file
|
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
App::import('Component', 'Acl');
|
App::import('Component', 'Acl');
|
||||||
App::import('Model', 'DbAcl');
|
App::import('Model', 'DbAcl');
|
||||||
|
@ -58,7 +50,7 @@ class AclShell extends Shell {
|
||||||
* @var string
|
* @var string
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $dataSource = 'default';
|
var $connection = 'default';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains tasks to load and instantiate
|
* Contains tasks to load and instantiate
|
||||||
|
@ -74,10 +66,8 @@ class AclShell extends Shell {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function startup() {
|
function startup() {
|
||||||
$this->dataSource = 'default';
|
if (isset($this->params['connection'])) {
|
||||||
|
$this->connection = $this->params['connection'];
|
||||||
if (isset($this->params['datasource'])) {
|
|
||||||
$this->dataSource = $this->params['datasource'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) {
|
if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) {
|
||||||
|
@ -102,7 +92,7 @@ class AclShell extends Shell {
|
||||||
require_once (CONFIGS.'database.php');
|
require_once (CONFIGS.'database.php');
|
||||||
|
|
||||||
if (!in_array($this->command, array('initdb'))) {
|
if (!in_array($this->command, array('initdb'))) {
|
||||||
$this->Acl = new AclComponent();
|
$this->Acl =& new AclComponent();
|
||||||
$controller = null;
|
$controller = null;
|
||||||
$this->Acl->startup($controller);
|
$this->Acl->startup($controller);
|
||||||
}
|
}
|
||||||
|
@ -220,13 +210,40 @@ class AclShell extends Shell {
|
||||||
$this->_checkArgs(2, 'getPath');
|
$this->_checkArgs(2, 'getPath');
|
||||||
$this->checkNodeType();
|
$this->checkNodeType();
|
||||||
extract($this->__dataVars());
|
extract($this->__dataVars());
|
||||||
$id = ife(is_numeric($this->args[1]), intval($this->args[1]), $this->args[1]);
|
$identifier = $this->parseIdentifier($this->args[1]);
|
||||||
|
|
||||||
|
$id = $this->_getNodeId($class, $identifier);
|
||||||
$nodes = $this->Acl->{$class}->getPath($id);
|
$nodes = $this->Acl->{$class}->getPath($id);
|
||||||
|
|
||||||
if (empty($nodes)) {
|
if (empty($nodes)) {
|
||||||
$this->error(sprintf(__("Supplied Node '%s' not found", true), $this->args[1]), __("No tree returned.", true));
|
$this->error(
|
||||||
|
sprintf(__("Supplied Node '%s' not found", true), $this->args[1]),
|
||||||
|
__("No tree returned.", true)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
$this->out(__('Path:', true));
|
||||||
|
$this->hr();
|
||||||
for ($i = 0; $i < count($nodes); $i++) {
|
for ($i = 0; $i < count($nodes); $i++) {
|
||||||
$this->out(str_repeat(' ', $i) . "[" . $nodes[$i][$class]['id'] . "]" . $nodes[$i][$class]['alias'] . "\n");
|
$this->_outputNode($class, $nodes[$i], $i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs a single node, Either using the alias or Model.key
|
||||||
|
*
|
||||||
|
* @param string $class Class name that is being used.
|
||||||
|
* @param array $node Array of node information.
|
||||||
|
* @param integer $indent indent level.
|
||||||
|
* @return void
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
|
function _outputNode($class, $node, $indent) {
|
||||||
|
$indent = str_repeat(' ', $indent);
|
||||||
|
$data = $node[$class];
|
||||||
|
if ($data['alias']) {
|
||||||
|
$this->out($indent . "[" . $data['id'] . "] " . $data['alias']);
|
||||||
|
} else {
|
||||||
|
$this->out($indent . "[" . $data['id'] . "] " . $data['model'] . '.' . $data['foreign_key']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,9 +257,9 @@ class AclShell extends Shell {
|
||||||
extract($this->__getParams());
|
extract($this->__getParams());
|
||||||
|
|
||||||
if ($this->Acl->check($aro, $aco, $action)) {
|
if ($this->Acl->check($aro, $aco, $action)) {
|
||||||
$this->out(sprintf(__("%s is allowed.", true), $aro), true);
|
$this->out(sprintf(__("%s is allowed.", true), $aroName), true);
|
||||||
} else {
|
} else {
|
||||||
$this->out(sprintf(__("%s is not allowed.", true), $aro), true);
|
$this->out(sprintf(__("%s is not allowed.", true), $aroName), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,13 +320,25 @@ class AclShell extends Shell {
|
||||||
$this->_checkArgs(1, 'view');
|
$this->_checkArgs(1, 'view');
|
||||||
$this->checkNodeType();
|
$this->checkNodeType();
|
||||||
extract($this->__dataVars());
|
extract($this->__dataVars());
|
||||||
if (isset($this->args[1]) && !is_null($this->args[1])) {
|
|
||||||
$key = ife(is_numeric($this->args[1]), $secondary_id, 'alias');
|
if (isset($this->args[1])) {
|
||||||
$conditions = array($class . '.' . $key => $this->args[1]);
|
$identity = $this->parseIdentifier($this->args[1]);
|
||||||
|
|
||||||
|
$topNode = $this->Acl->{$class}->find('first', array(
|
||||||
|
'conditions' => array($class . '.id' => $this->_getNodeId($class, $identity))
|
||||||
|
));
|
||||||
|
|
||||||
|
$nodes = $this->Acl->{$class}->find('all', array(
|
||||||
|
'conditions' => array(
|
||||||
|
$class . '.lft >=' => $topNode[$class]['lft'],
|
||||||
|
$class . '.lft <=' => $topNode[$class]['rght']
|
||||||
|
),
|
||||||
|
'order' => $class . '.lft ASC'
|
||||||
|
));
|
||||||
} else {
|
} else {
|
||||||
$conditions = null;
|
$nodes = $this->Acl->{$class}->find('all', array('order' => $class . '.lft ASC'));
|
||||||
}
|
}
|
||||||
$nodes = $this->Acl->{$class}->find('all', array('conditions' => $conditions, 'order' => 'lft ASC'));
|
|
||||||
if (empty($nodes)) {
|
if (empty($nodes)) {
|
||||||
if (isset($this->args[1])) {
|
if (isset($this->args[1])) {
|
||||||
$this->error(sprintf(__("%s not found", true), $this->args[1]), __("No tree returned.", true));
|
$this->error(sprintf(__("%s not found", true), $this->args[1]), __("No tree returned.", true));
|
||||||
|
@ -319,8 +348,10 @@ class AclShell extends Shell {
|
||||||
}
|
}
|
||||||
$this->out($class . " tree:");
|
$this->out($class . " tree:");
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
|
||||||
$stack = array();
|
$stack = array();
|
||||||
$last = null;
|
$last = null;
|
||||||
|
|
||||||
foreach ($nodes as $n) {
|
foreach ($nodes as $n) {
|
||||||
$stack[] = $n;
|
$stack[] = $n;
|
||||||
if (!empty($last)) {
|
if (!empty($last)) {
|
||||||
|
@ -336,12 +367,8 @@ class AclShell extends Shell {
|
||||||
}
|
}
|
||||||
$last = $n[$class]['rght'];
|
$last = $n[$class]['rght'];
|
||||||
$count = count($stack);
|
$count = count($stack);
|
||||||
$indent = str_repeat(' ', $count);
|
|
||||||
if ($n[$class]['alias']) {
|
$this->_outputNode($class, $n, $count);
|
||||||
$this->out($indent . "[" . $n[$class]['id'] . "]" . $n[$class]['alias']."\n");
|
|
||||||
} else {
|
|
||||||
$this->out($indent . "[" . $n[$class]['id'] . "]" . $n[$class]['model'] . '.' . $n[$class]['foreign_key'] . "\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$this->hr();
|
$this->hr();
|
||||||
}
|
}
|
||||||
|
@ -388,7 +415,7 @@ class AclShell extends Shell {
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
"\t" . __("see help for the 'create' command.", true),
|
"\t" . __("see help for the 'create' command.", true),
|
||||||
|
|
||||||
'setparent' => "setParent aro|aco <node> <parent>\n" .
|
'setparent' => "setParent aro|aco <node> <parent node>\n" .
|
||||||
"\t" . __("Moves the ACL object specified by <node> beneath", true) . "\n" .
|
"\t" . __("Moves the ACL object specified by <node> beneath", true) . "\n" .
|
||||||
"\t" . __("the parent ACL object specified by <parent>.", true) . "\n" .
|
"\t" . __("the parent ACL object specified by <parent>.", true) . "\n" .
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
|
@ -401,26 +428,26 @@ class AclShell extends Shell {
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
"\t" . __("see help for the 'create' command.", true),
|
"\t" . __("see help for the 'create' command.", true),
|
||||||
|
|
||||||
'check' => "check <aro_id> <aco_id> [<aco_action>] " . __("or", true) . " all\n" .
|
'check' => "check <node> <node> [<aco_action>] " . __("or", true) . " all\n" .
|
||||||
"\t" . __("Use this command to check ACL permissions.", true) . "\n" .
|
"\t" . __("Use this command to check ACL permissions.", true) . "\n" .
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
"\t" . __("see help for the 'create' command.", true),
|
"\t" . __("see help for the 'create' command.", true),
|
||||||
|
|
||||||
'grant' => "grant <aro_id> <aco_id> [<aco_action>] " . __("or", true) . " all\n" .
|
'grant' => "grant <node> <node> [<aco_action>] " . __("or", true) . " all\n" .
|
||||||
"\t" . __("Use this command to grant ACL permissions. Once executed, the ARO", true) . "\n" .
|
"\t" . __("Use this command to grant ACL permissions. Once executed, the ARO", true) . "\n" .
|
||||||
"\t" . __("specified (and its children, if any) will have ALLOW access to the", true) . "\n" .
|
"\t" . __("specified (and its children, if any) will have ALLOW access to the", true) . "\n" .
|
||||||
"\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" .
|
"\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" .
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
"\t" . __("see help for the 'create' command.", true),
|
"\t" . __("see help for the 'create' command.", true),
|
||||||
|
|
||||||
'deny' => "deny <aro_id> <aco_id> [<aco_action>]" . __("or", true) . " all\n" .
|
'deny' => "deny <node> <node> [<aco_action>]" . __("or", true) . " all\n" .
|
||||||
"\t" . __("Use this command to deny ACL permissions. Once executed, the ARO", true) . "\n" .
|
"\t" . __("Use this command to deny ACL permissions. Once executed, the ARO", true) . "\n" .
|
||||||
"\t" . __("specified (and its children, if any) will have DENY access to the", true) . "\n" .
|
"\t" . __("specified (and its children, if any) will have DENY access to the", true) . "\n" .
|
||||||
"\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" .
|
"\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" .
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
"\t" . __("see help for the 'create' command.", true),
|
"\t" . __("see help for the 'create' command.", true),
|
||||||
|
|
||||||
'inherit' => "inherit <aro_id> <aco_id> [<aco_action>]" . __("or", true) . " all\n" .
|
'inherit' => "inherit <node> <node> [<aco_action>]" . __("or", true) . " all\n" .
|
||||||
"\t" . __("Use this command to force a child ARO object to inherit its", true) . "\n" .
|
"\t" . __("Use this command to force a child ARO object to inherit its", true) . "\n" .
|
||||||
"\t" . __("permissions settings from its parent.", true) . "\n" .
|
"\t" . __("permissions settings from its parent.", true) . "\n" .
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
|
@ -428,7 +455,8 @@ class AclShell extends Shell {
|
||||||
|
|
||||||
'view' => "view aro|aco [<node>]\n" .
|
'view' => "view aro|aco [<node>]\n" .
|
||||||
"\t" . __("The view command will return the ARO or ACO tree.", true) . "\n" .
|
"\t" . __("The view command will return the ARO or ACO tree.", true) . "\n" .
|
||||||
"\t" . __("The optional id/alias parameter allows you to return\n\tonly a portion of the requested tree.", true) . "\n" .
|
"\t" . __("The optional node parameter allows you to return", true) . "\n" .
|
||||||
|
"\t" . __("only a portion of the requested tree.", true) . "\n" .
|
||||||
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
|
||||||
"\t" . __("see help for the 'create' command.", true),
|
"\t" . __("see help for the 'create' command.", true),
|
||||||
|
|
||||||
|
@ -461,7 +489,7 @@ class AclShell extends Shell {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($this->args[0] != 'aco' && $this->args[0] != 'aro') {
|
if ($this->args[0] != 'aco' && $this->args[0] != 'aro') {
|
||||||
$this->error(sprintf(__("Missing/Unknown node type: '%s'", true), $this->args[1]), __('Please specify which ACL object type you wish to create.', true));
|
$this->error(sprintf(__("Missing/Unknown node type: '%s'", true), $this->args[0]), __('Please specify which ACL object type you wish to create. Either "aro" or "aco"', true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,7 +521,7 @@ class AclShell extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $identifier Identifier to parse
|
* @param string $identifier Identifier to parse
|
||||||
* @return mixed a string for aliases, and an array for model.foreignKey
|
* @return mixed a string for aliases, and an array for model.foreignKey
|
||||||
**/
|
*/
|
||||||
function parseIdentifier($identifier) {
|
function parseIdentifier($identifier) {
|
||||||
if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) {
|
if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) {
|
||||||
return array(
|
return array(
|
||||||
|
@ -511,7 +539,7 @@ class AclShell extends Shell {
|
||||||
* @param string $class Class type you want (Aro/Aco)
|
* @param string $class Class type you want (Aro/Aco)
|
||||||
* @param mixed $identifier A mixed identifier for finding the node.
|
* @param mixed $identifier A mixed identifier for finding the node.
|
||||||
* @return int Integer of NodeId. Will trigger an error if nothing is found.
|
* @return int Integer of NodeId. Will trigger an error if nothing is found.
|
||||||
**/
|
*/
|
||||||
function _getNodeId($class, $identifier) {
|
function _getNodeId($class, $identifier) {
|
||||||
$node = $this->Acl->{$class}->node($identifier);
|
$node = $this->Acl->{$class}->node($identifier);
|
||||||
if (empty($node)) {
|
if (empty($node)) {
|
||||||
|
@ -530,23 +558,17 @@ class AclShell extends Shell {
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __getParams() {
|
function __getParams() {
|
||||||
$aro = ife(is_numeric($this->args[0]), intval($this->args[0]), $this->args[0]);
|
$aro = is_numeric($this->args[0]) ? intval($this->args[0]) : $this->args[0];
|
||||||
$aco = ife(is_numeric($this->args[1]), intval($this->args[1]), $this->args[1]);
|
$aco = is_numeric($this->args[1]) ? intval($this->args[1]) : $this->args[1];
|
||||||
|
$aroName = $aro;
|
||||||
|
$acoName = $aco;
|
||||||
|
|
||||||
if (is_string($aro) && preg_match('/^([\w]+)\.(.*)$/', $aro, $matches)) {
|
if (is_string($aro)) {
|
||||||
$aro = array(
|
$aro = $this->parseIdentifier($aro);
|
||||||
'model' => $matches[1],
|
|
||||||
'foreign_key' => $matches[2],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
if (is_string($aco)) {
|
||||||
if (is_string($aco) && preg_match('/^([\w]+)\.(.*)$/', $aco, $matches)) {
|
$aco = $this->parseIdentifier($aco);
|
||||||
$aco = array(
|
|
||||||
'model' => $matches[1],
|
|
||||||
'foreign_key' => $matches[2],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = null;
|
$action = null;
|
||||||
if (isset($this->args[2])) {
|
if (isset($this->args[2])) {
|
||||||
$action = $this->args[2];
|
$action = $this->args[2];
|
||||||
|
@ -554,7 +576,7 @@ class AclShell extends Shell {
|
||||||
$action = '*';
|
$action = '*';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return compact('aro', 'aco', 'action');
|
return compact('aro', 'aco', 'action', 'aroName', 'acoName');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API shell to get CakePHP core method signatures.
|
* API shell to get CakePHP core method signatures.
|
||||||
*
|
*
|
||||||
|
@ -8,22 +6,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,7 +115,7 @@ class ApiShell extends Shell {
|
||||||
$this->out($list);
|
$this->out($list);
|
||||||
|
|
||||||
$methods = array_keys($parsed);
|
$methods = array_keys($parsed);
|
||||||
while ($number = $this->in(__('Select a number to see the more information about a specific method. q to quit. l to list.', true), null, 'q')) {
|
while ($number = strtolower($this->in(__('Select a number to see the more information about a specific method. q to quit. l to list.', true), null, 'q'))) {
|
||||||
if ($number === 'q') {
|
if ($number === 'q') {
|
||||||
$this->out(__('Done', true));
|
$this->out(__('Done', true));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
|
@ -173,8 +167,8 @@ class ApiShell extends Shell {
|
||||||
foreach ($commands as $cmd) {
|
foreach ($commands as $cmd) {
|
||||||
$this->out("{$cmd}\n\n");
|
$this->out("{$cmd}\n\n");
|
||||||
}
|
}
|
||||||
} elseif (isset($commands[low($this->args[1])])) {
|
} elseif (isset($commands[strtolower($this->args[1])])) {
|
||||||
$this->out($commands[low($this->args[1])] . "\n\n");
|
$this->out($commands[strtolower($this->args[1])] . "\n\n");
|
||||||
} else {
|
} else {
|
||||||
$this->out("Command '" . $this->args[1] . "' not found");
|
$this->out("Command '" . $this->args[1] . "' not found");
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,19 +8,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +57,7 @@ class BakeShell extends Shell {
|
||||||
}
|
}
|
||||||
foreach($this->args as $i => $arg) {
|
foreach($this->args as $i => $arg) {
|
||||||
if (strpos($arg, '.')) {
|
if (strpos($arg, '.')) {
|
||||||
list($this->params['plugin'], $this->args[$i]) = explode('.', $arg);
|
list($this->params['plugin'], $this->args[$i]) = pluginSplit($arg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,6 +80,8 @@ class BakeShell extends Shell {
|
||||||
if (!is_dir($this->DbConfig->path)) {
|
if (!is_dir($this->DbConfig->path)) {
|
||||||
if ($this->Project->execute()) {
|
if ($this->Project->execute()) {
|
||||||
$this->DbConfig->path = $this->params['working'] . DS . 'config' . DS;
|
$this->DbConfig->path = $this->params['working'] . DS . 'config' . DS;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,9 +98,10 @@ class BakeShell extends Shell {
|
||||||
$this->out('[C]ontroller');
|
$this->out('[C]ontroller');
|
||||||
$this->out('[P]roject');
|
$this->out('[P]roject');
|
||||||
$this->out('[F]ixture');
|
$this->out('[F]ixture');
|
||||||
|
$this->out('[T]est case');
|
||||||
$this->out('[Q]uit');
|
$this->out('[Q]uit');
|
||||||
|
|
||||||
$classToBake = strtoupper($this->in(__('What would you like to Bake?', true), array('D', 'M', 'V', 'C', 'P', 'Q')));
|
$classToBake = strtoupper($this->in(__('What would you like to Bake?', true), array('D', 'M', 'V', 'C', 'P', 'F', 'T', 'Q')));
|
||||||
switch ($classToBake) {
|
switch ($classToBake) {
|
||||||
case 'D':
|
case 'D':
|
||||||
$this->DbConfig->execute();
|
$this->DbConfig->execute();
|
||||||
|
@ -119,11 +121,14 @@ class BakeShell extends Shell {
|
||||||
case 'F':
|
case 'F':
|
||||||
$this->Fixture->execute();
|
$this->Fixture->execute();
|
||||||
break;
|
break;
|
||||||
|
case 'T':
|
||||||
|
$this->Test->execute();
|
||||||
|
break;
|
||||||
case 'Q':
|
case 'Q':
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->out(__('You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, or C.', true));
|
$this->out(__('You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, F, T, or C.', true));
|
||||||
}
|
}
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->main();
|
$this->main();
|
||||||
|
@ -225,7 +230,9 @@ class BakeShell extends Shell {
|
||||||
$this->out("\n\tbake model\n\t\tbakes a model. run 'bake model help' for more info");
|
$this->out("\n\tbake model\n\t\tbakes a model. run 'bake model help' for more info");
|
||||||
$this->out("\n\tbake view\n\t\tbakes views. run 'bake view help' for more info");
|
$this->out("\n\tbake view\n\t\tbakes views. run 'bake view help' for more info");
|
||||||
$this->out("\n\tbake controller\n\t\tbakes a controller. run 'bake controller help' for more info");
|
$this->out("\n\tbake controller\n\t\tbakes a controller. run 'bake controller help' for more info");
|
||||||
$this->out("");
|
$this->out("\n\tbake fixture\n\t\tbakes fixtures. run 'bake fixture help' for more info.");
|
||||||
|
$this->out("\n\tbake test\n\t\tbakes unit tests. run 'bake test help' for more info.");
|
||||||
|
$this->out();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,7 +60,7 @@ class ConsoleShell extends Shell {
|
||||||
App::import('Model', $this->models);
|
App::import('Model', $this->models);
|
||||||
|
|
||||||
foreach ($this->models as $model) {
|
foreach ($this->models as $model) {
|
||||||
$class = Inflector::camelize(r('.php', '', $model));
|
$class = Inflector::camelize(str_replace('.php', '', $model));
|
||||||
$this->models[$model] = $class;
|
$this->models[$model] = $class;
|
||||||
$this->{$class} =& new $class();
|
$this->{$class} =& new $class();
|
||||||
}
|
}
|
||||||
|
@ -238,7 +230,7 @@ class ConsoleShell extends Shell {
|
||||||
$this->out("\t$field2: $value2");
|
$this->out("\t$field2: $value2");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out("");
|
$this->out();
|
||||||
} else {
|
} else {
|
||||||
$this->out("\t$field: $value");
|
$this->out("\t$field: $value");
|
||||||
}
|
}
|
||||||
|
@ -253,7 +245,7 @@ class ConsoleShell extends Shell {
|
||||||
$this->out("\t$field2: $value2");
|
$this->out("\t$field2: $value2");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out("");
|
$this->out();
|
||||||
} else {
|
} else {
|
||||||
$this->out("\t$field: $value");
|
$this->out("\t$field: $value");
|
||||||
}
|
}
|
||||||
|
@ -311,7 +303,7 @@ class ConsoleShell extends Shell {
|
||||||
break;
|
break;
|
||||||
case (preg_match("/^routes\s+show/i", $command, $tmp) == true):
|
case (preg_match("/^routes\s+show/i", $command, $tmp) == true):
|
||||||
$router =& Router::getInstance();
|
$router =& Router::getInstance();
|
||||||
$this->out(join("\n", Set::extract($router->routes, '{n}.0')));
|
$this->out(implode("\n", Set::extract($router->routes, '{n}.0')));
|
||||||
break;
|
break;
|
||||||
case (preg_match("/^route\s+(\(.*\))$/i", $command, $tmp) == true):
|
case (preg_match("/^route\s+(\(.*\))$/i", $command, $tmp) == true):
|
||||||
if ($url = eval('return array' . $tmp[1] . ';')) {
|
if ($url = eval('return array' . $tmp[1] . ';')) {
|
||||||
|
@ -361,8 +353,8 @@ class ConsoleShell extends Shell {
|
||||||
foreach (array_keys($router->getNamedExpressions()) as $var) {
|
foreach (array_keys($router->getNamedExpressions()) as $var) {
|
||||||
unset(${$var});
|
unset(${$var});
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < count($router->routes); $i++) {
|
for ($i = 0, $len = count($router->routes); $i < $len; $i++) {
|
||||||
$router->compile($i);
|
$router->routes[$i]->compile();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5669
|
* @since CakePHP(tm) v 1.2.0.5669
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,18 +74,18 @@ class I18nShell extends Shell {
|
||||||
$this->out(__('[H]elp', true));
|
$this->out(__('[H]elp', true));
|
||||||
$this->out(__('[Q]uit', true));
|
$this->out(__('[Q]uit', true));
|
||||||
|
|
||||||
$choice = strtoupper($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q')));
|
$choice = strtolower($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q')));
|
||||||
switch ($choice) {
|
switch ($choice) {
|
||||||
case 'E':
|
case 'e':
|
||||||
$this->Extract->execute();
|
$this->Extract->execute();
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'i':
|
||||||
$this->initdb();
|
$this->initdb();
|
||||||
break;
|
break;
|
||||||
case 'H':
|
case 'h':
|
||||||
$this->help();
|
$this->help();
|
||||||
break;
|
break;
|
||||||
case 'Q':
|
case 'q':
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -109,7 +101,7 @@ class I18nShell extends Shell {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function initdb() {
|
function initdb() {
|
||||||
$this->Dispatch->args = array('schema', 'run', 'create', 'i18n');
|
$this->Dispatch->args = array('schema', 'create', 'i18n');
|
||||||
$this->Dispatch->dispatch();
|
$this->Dispatch->dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +120,7 @@ class I18nShell extends Shell {
|
||||||
$this->out(__('usage:', true));
|
$this->out(__('usage:', true));
|
||||||
$this->out(' cake i18n help');
|
$this->out(' cake i18n help');
|
||||||
$this->out(' cake i18n initdb [-datasource custom]');
|
$this->out(' cake i18n initdb [-datasource custom]');
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
|
||||||
$this->Extract->help();
|
$this->Extract->help();
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command-line database management utility to automate programmer chores.
|
* Command-line database management utility to automate programmer chores.
|
||||||
*
|
*
|
||||||
|
@ -9,24 +7,20 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5550
|
* @since CakePHP(tm) v 1.2.0.5550
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
App::import('File');
|
App::import('Core', 'File', false);
|
||||||
App::import('Model', 'CakeSchema', false);
|
App::import('Model', 'CakeSchema', false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,18 +57,22 @@ class SchemaShell extends Shell {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function startup() {
|
function startup() {
|
||||||
$name = null;
|
$name = $file = $path = $connection = $plugin = null;
|
||||||
if (!empty($this->params['name'])) {
|
if (!empty($this->params['name'])) {
|
||||||
$name = $this->params['name'];
|
$name = $this->params['name'];
|
||||||
|
} elseif (!empty($this->args[0])) {
|
||||||
|
$name = $this->params['name'] = $this->args[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos($name, '.')) {
|
||||||
|
list($this->params['plugin'], $splitName) = pluginSplit($name);
|
||||||
|
$name = $this->params['name'] = $splitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($name) {
|
||||||
$this->params['file'] = Inflector::underscore($name);
|
$this->params['file'] = Inflector::underscore($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = null;
|
|
||||||
if (!empty($this->params['path'])) {
|
|
||||||
$path = $this->params['path'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$file = null;
|
|
||||||
if (empty($this->params['file'])) {
|
if (empty($this->params['file'])) {
|
||||||
$this->params['file'] = 'schema.php';
|
$this->params['file'] = 'schema.php';
|
||||||
}
|
}
|
||||||
|
@ -83,12 +81,17 @@ class SchemaShell extends Shell {
|
||||||
}
|
}
|
||||||
$file = $this->params['file'];
|
$file = $this->params['file'];
|
||||||
|
|
||||||
$connection = null;
|
if (!empty($this->params['path'])) {
|
||||||
|
$path = $this->params['path'];
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($this->params['connection'])) {
|
if (!empty($this->params['connection'])) {
|
||||||
$connection = $this->params['connection'];
|
$connection = $this->params['connection'];
|
||||||
}
|
}
|
||||||
|
if (!empty($this->params['plugin'])) {
|
||||||
$this->Schema =& new CakeSchema(compact('name', 'path', 'file', 'connection'));
|
$plugin = $this->params['plugin'];
|
||||||
|
}
|
||||||
|
$this->Schema =& new CakeSchema(compact('name', 'path', 'file', 'connection', 'plugin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,7 +115,8 @@ class SchemaShell extends Shell {
|
||||||
$this->out($File->read());
|
$this->out($File->read());
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
} else {
|
} else {
|
||||||
$this->err(__('Schema could not be found', true));
|
$file = $this->Schema->path . DS . $this->params['file'];
|
||||||
|
$this->err(sprintf(__('Schema file (%s) could not be found.', true), $file));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,7 +128,7 @@ class SchemaShell extends Shell {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function generate() {
|
function generate() {
|
||||||
$this->out('Generating Schema...');
|
$this->out(__('Generating Schema...', true));
|
||||||
$options = array();
|
$options = array();
|
||||||
if (isset($this->params['f'])) {
|
if (isset($this->params['f'])) {
|
||||||
$options = array('models' => false);
|
$options = array('models' => false);
|
||||||
|
@ -137,9 +141,9 @@ class SchemaShell extends Shell {
|
||||||
|
|
||||||
if (!$snapshot && file_exists($this->Schema->path . DS . $this->params['file'])) {
|
if (!$snapshot && file_exists($this->Schema->path . DS . $this->params['file'])) {
|
||||||
$snapshot = true;
|
$snapshot = true;
|
||||||
$result = $this->in("Schema file exists.\n [O]verwrite\n [S]napshot\n [Q]uit\nWould you like to do?", array('o', 's', 'q'), 's');
|
$result = strtolower($this->in("Schema file exists.\n [O]verwrite\n [S]napshot\n [Q]uit\nWould you like to do?", array('o', 's', 'q'), 's'));
|
||||||
if ($result === 'q') {
|
if ($result === 'q') {
|
||||||
$this->_stop();
|
return $this->_stop();
|
||||||
}
|
}
|
||||||
if ($result === 'o') {
|
if ($result === 'o') {
|
||||||
$snapshot = false;
|
$snapshot = false;
|
||||||
|
@ -188,8 +192,10 @@ class SchemaShell extends Shell {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dump Schema object to sql file
|
* Dump Schema object to sql file
|
||||||
* if first arg == write, file will be written to sql file
|
* Use the `write` param to enable and control SQL file output location.
|
||||||
* or it will output sql
|
* Simply using -write will write the sql file to the same dir as the schema file.
|
||||||
|
* If -write contains a full path name the file will be saved there. If -write only
|
||||||
|
* contains no DS, that will be used as the file name, in the same dir as the schema file.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
@ -200,21 +206,27 @@ class SchemaShell extends Shell {
|
||||||
$this->err(__('Schema could not be loaded', true));
|
$this->err(__('Schema could not be loaded', true));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
if (!empty($this->args[0])) {
|
if (isset($this->params['write'])) {
|
||||||
if ($this->args[0] == 'write') {
|
if ($this->params['write'] == 1) {
|
||||||
$write = Inflector::underscore($this->Schema->name);
|
$write = Inflector::underscore($this->Schema->name);
|
||||||
} else {
|
} else {
|
||||||
$write = $this->args[0];
|
$write = $this->params['write'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
||||||
$contents = "#" . $Schema->name . " sql generated on: " . date('Y-m-d H:i:s') . " : " . time() . "\n\n";
|
$contents = "#" . $Schema->name . " sql generated on: " . date('Y-m-d H:i:s') . " : " . time() . "\n\n";
|
||||||
$contents .= $db->dropSchema($Schema) . "\n\n". $db->createSchema($Schema);
|
$contents .= $db->dropSchema($Schema) . "\n\n". $db->createSchema($Schema);
|
||||||
|
|
||||||
if ($write) {
|
if ($write) {
|
||||||
if (strpos($write, '.sql') === false) {
|
if (strpos($write, '.sql') === false) {
|
||||||
$write .= '.sql';
|
$write .= '.sql';
|
||||||
}
|
}
|
||||||
$File = new File($this->Schema->path . DS . $write, true);
|
if (strpos($write, DS) !== false) {
|
||||||
|
$File =& new File($write, true);
|
||||||
|
} else {
|
||||||
|
$File =& new File($this->Schema->path . DS . $write, true);
|
||||||
|
}
|
||||||
|
|
||||||
if ($File->write($contents)) {
|
if ($File->write($contents)) {
|
||||||
$this->out(sprintf(__('SQL dump file created in %s', true), $File->pwd()));
|
$this->out(sprintf(__('SQL dump file created in %s', true), $File->pwd()));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
|
@ -228,62 +240,61 @@ class SchemaShell extends Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run database commands: create, update
|
* Run database create commands. Alias for run create.
|
||||||
*
|
*
|
||||||
* @access public
|
* @return void
|
||||||
*/
|
*/
|
||||||
function run() {
|
function create() {
|
||||||
if (!isset($this->args[0])) {
|
list($Schema, $table) = $this->_loadSchema();
|
||||||
$this->err('command not found');
|
$this->__create($Schema, $table);
|
||||||
$this->_stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$command = $this->args[0];
|
/**
|
||||||
|
* Run database create commands. Alias for run create.
|
||||||
$this->Dispatch->shiftArgs();
|
*
|
||||||
|
* @return void
|
||||||
$name = null;
|
*/
|
||||||
if (isset($this->args[0])) {
|
function update() {
|
||||||
$name = $this->args[0];
|
list($Schema, $table) = $this->_loadSchema();
|
||||||
|
$this->__update($Schema, $table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares the Schema objects for database operations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function _loadSchema() {
|
||||||
|
$name = $plugin = null;
|
||||||
if (isset($this->params['name'])) {
|
if (isset($this->params['name'])) {
|
||||||
$name = $this->params['name'];
|
$name = $this->params['name'];
|
||||||
}
|
}
|
||||||
|
if (isset($this->params['plugin'])) {
|
||||||
|
$plugin = $this->params['plugin'];
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($this->params['dry'])) {
|
if (isset($this->params['dry'])) {
|
||||||
$this->__dry = true;
|
$this->__dry = true;
|
||||||
$this->out(__('Performing a dry run.', true));
|
$this->out(__('Performing a dry run.', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array('name' => $name);
|
$options = array('name' => $name, 'plugin' => $plugin);
|
||||||
if (isset($this->params['s'])) {
|
if (isset($this->params['s'])) {
|
||||||
$fileName = rtrim($this->Schema->file, '.php');
|
$fileName = rtrim($this->Schema->file, '.php');
|
||||||
$options['file'] = $fileName . '_' . $this->params['s'] . '.php';
|
$options['file'] = $fileName . '_' . $this->params['s'] . '.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
$Schema = $this->Schema->load($options);
|
$Schema =& $this->Schema->load($options);
|
||||||
|
|
||||||
if (!$Schema) {
|
if (!$Schema) {
|
||||||
$this->err(sprintf(__('%s could not be loaded', true), $this->Schema->file));
|
$this->err(sprintf(__('%s could not be loaded', true), $this->Schema->path . DS . $this->Schema->file));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
$table = null;
|
$table = null;
|
||||||
if (isset($this->args[1])) {
|
if (isset($this->args[1])) {
|
||||||
$table = $this->args[1];
|
$table = $this->args[1];
|
||||||
}
|
}
|
||||||
|
return array(&$Schema, $table);
|
||||||
switch ($command) {
|
|
||||||
case 'create':
|
|
||||||
$this->__create($Schema, $table);
|
|
||||||
break;
|
|
||||||
case 'update':
|
|
||||||
$this->__update($Schema, $table);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$this->err(__('command not found', true));
|
|
||||||
$this->_stop();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -292,7 +303,7 @@ class SchemaShell extends Shell {
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __create($Schema, $table = null) {
|
function __create(&$Schema, $table = null) {
|
||||||
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
||||||
|
|
||||||
$drop = $create = array();
|
$drop = $create = array();
|
||||||
|
@ -315,7 +326,7 @@ class SchemaShell extends Shell {
|
||||||
$this->out(array_keys($drop));
|
$this->out(array_keys($drop));
|
||||||
|
|
||||||
if ('y' == $this->in(__('Are you sure you want to drop the table(s)?', true), array('y', 'n'), 'n')) {
|
if ('y' == $this->in(__('Are you sure you want to drop the table(s)?', true), array('y', 'n'), 'n')) {
|
||||||
$this->out('Dropping table(s).');
|
$this->out(__('Dropping table(s).', true));
|
||||||
$this->__run($drop, 'drop', $Schema);
|
$this->__run($drop, 'drop', $Schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,10 +334,9 @@ class SchemaShell extends Shell {
|
||||||
$this->out(array_keys($create));
|
$this->out(array_keys($create));
|
||||||
|
|
||||||
if ('y' == $this->in(__('Are you sure you want to create the table(s)?', true), array('y', 'n'), 'y')) {
|
if ('y' == $this->in(__('Are you sure you want to create the table(s)?', true), array('y', 'n'), 'y')) {
|
||||||
$this->out('Creating table(s).');
|
$this->out(__('Creating table(s).', true));
|
||||||
$this->__run($create, 'create', $Schema);
|
$this->__run($create, 'create', $Schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out(__('End create.', true));
|
$this->out(__('End create.', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,11 +346,15 @@ class SchemaShell extends Shell {
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __update($Schema, $table = null) {
|
function __update(&$Schema, $table = null) {
|
||||||
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
||||||
|
|
||||||
$this->out('Comparing Database to Schema...');
|
$this->out(__('Comparing Database to Schema...', true));
|
||||||
$Old = $this->Schema->read();
|
$options = array();
|
||||||
|
if (isset($this->params['f'])) {
|
||||||
|
$options['models'] = false;
|
||||||
|
}
|
||||||
|
$Old = $this->Schema->read($options);
|
||||||
$compare = $this->Schema->compare($Old, $Schema);
|
$compare = $this->Schema->compare($Old, $Schema);
|
||||||
|
|
||||||
$contents = array();
|
$contents = array();
|
||||||
|
@ -361,7 +375,7 @@ class SchemaShell extends Shell {
|
||||||
$this->out("\n" . __('The following statements will run.', true));
|
$this->out("\n" . __('The following statements will run.', true));
|
||||||
$this->out(array_map('trim', $contents));
|
$this->out(array_map('trim', $contents));
|
||||||
if ('y' == $this->in(__('Are you sure you want to alter the tables?', true), array('y', 'n'), 'n')) {
|
if ('y' == $this->in(__('Are you sure you want to alter the tables?', true), array('y', 'n'), 'n')) {
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out(__('Updating Database...', true));
|
$this->out(__('Updating Database...', true));
|
||||||
$this->__run($contents, 'update', $Schema);
|
$this->__run($contents, 'update', $Schema);
|
||||||
}
|
}
|
||||||
|
@ -374,16 +388,14 @@ class SchemaShell extends Shell {
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __run($contents, $event, $Schema) {
|
function __run($contents, $event, &$Schema) {
|
||||||
if (empty($contents)) {
|
if (empty($contents)) {
|
||||||
$this->err(__('Sql could not be run', true));
|
$this->err(__('Sql could not be run', true));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Configure::write('debug', 2);
|
Configure::write('debug', 2);
|
||||||
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
$db =& ConnectionManager::getDataSource($this->Schema->connection);
|
||||||
$db->fullDebug = true;
|
|
||||||
|
|
||||||
$errors = array();
|
|
||||||
foreach ($contents as $table => $sql) {
|
foreach ($contents as $table => $sql) {
|
||||||
if (empty($sql)) {
|
if (empty($sql)) {
|
||||||
$this->out(sprintf(__('%s is up to date.', true), $table));
|
$this->out(sprintf(__('%s is up to date.', true), $table));
|
||||||
|
@ -395,15 +407,16 @@ class SchemaShell extends Shell {
|
||||||
if (!$Schema->before(array($event => $table))) {
|
if (!$Schema->before(array($event => $table))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$db->_execute($sql)) {
|
$error = null;
|
||||||
|
if (!$db->execute($sql)) {
|
||||||
$error = $table . ': ' . $db->lastError();
|
$error = $table . ': ' . $db->lastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
$Schema->after(array($event => $table, 'errors'=> $errors));
|
$Schema->after(array($event => $table, 'errors' => $error));
|
||||||
|
|
||||||
if (isset($error)) {
|
if (!empty($error)) {
|
||||||
$this->out($error);
|
$this->out($error);
|
||||||
} elseif ($this->__dry !== true) {
|
} else {
|
||||||
$this->out(sprintf(__('%s updated.', true), $table));
|
$this->out(sprintf(__('%s updated.', true), $table));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -417,26 +430,74 @@ class SchemaShell extends Shell {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function help() {
|
function help() {
|
||||||
$this->out("The Schema Shell generates a schema object from \n\t\tthe database and updates the database from the schema.");
|
$help = <<<TEXT
|
||||||
$this->hr();
|
The Schema Shell generates a schema object from
|
||||||
$this->out("Usage: cake schema <command> <arg1> <arg2>...");
|
the database and updates the database from the schema.
|
||||||
$this->hr();
|
---------------------------------------------------------------
|
||||||
$this->out('Params:');
|
Usage: cake schema <command> <arg1> <arg2>...
|
||||||
$this->out("\n\t-connection <config>\n\t\tset db config <config>. uses 'default' if none is specified");
|
---------------------------------------------------------------
|
||||||
$this->out("\n\t-path <dir>\n\t\tpath <dir> to read and write schema.php.\n\t\tdefault path: ". $this->Schema->path);
|
Params:
|
||||||
$this->out("\n\t-name <name>\n\t\tclassname to use.");
|
-connection <config>
|
||||||
$this->out("\n\t-file <name>\n\t\tfile <name> to read and write.\n\t\tdefault file: ". $this->Schema->file);
|
set db config <config>. uses 'default' if none is specified
|
||||||
$this->out("\n\t-s <number>\n\t\tsnapshot <number> to use for run.");
|
|
||||||
$this->out("\n\t-dry\n\t\tPerform a dry run on 'run' commands.\n\t\tQueries will be output to window instead of executed.");
|
-path <dir>
|
||||||
$this->out("\n\t-f\n\t\tforce 'generate' to create a new schema.");
|
path <dir> to read and write schema.php.
|
||||||
$this->out('Commands:');
|
default path: {$this->Schema->path}
|
||||||
$this->out("\n\tschema help\n\t\tshows this help message.");
|
|
||||||
$this->out("\n\tschema view\n\t\tread and output contents of schema file");
|
-name <name>
|
||||||
$this->out("\n\tschema generate\n\t\treads from 'connection' writes to 'path'\n\t\tTo force generation of all tables into the schema, use the -f param.\n\t\tUse 'schema generate snapshot <number>' to generate snapshots\n\t\twhich you can use with the -s parameter in the other operations.");
|
Classname to use. If <name> is Plugin.className, it will
|
||||||
$this->out("\n\tschema dump <filename>\n\t\tDump database sql based on schema file to <filename>. \n\t\tIf <filename> is write, schema dump will be written to a file\n\t\tthat has the same name as the app directory.");
|
set the plugin and name params.
|
||||||
$this->out("\n\tschema run create <schema> <table>\n\t\tDrop and create tables based on schema file\n\t\toptional <schema> arg for selecting schema name\n\t\toptional <table> arg for creating only one table\n\t\tpass the -s param with a number to use a snapshot\n\t\tTo see the changes, perform a dry run with the -dry param");
|
|
||||||
$this->out("\n\tschema run update <schema> <table>\n\t\talter tables based on schema file\n\t\toptional <schema> arg for selecting schema name.\n\t\toptional <table> arg for altering only one table.\n\t\tTo use a snapshot, pass the -s param with the snapshot number\n\t\tTo see the changes, perform a dry run with the -dry param");
|
-file <name>
|
||||||
$this->out("");
|
file <name> to read and write.
|
||||||
|
default file: {$this->Schema->file}
|
||||||
|
|
||||||
|
-s <number>
|
||||||
|
snapshot <number> to use for run.
|
||||||
|
|
||||||
|
-dry
|
||||||
|
Perform a dry run on create + update commands.
|
||||||
|
Queries will be output to window instead of executed.
|
||||||
|
|
||||||
|
-f
|
||||||
|
force 'generate' to create a new schema.
|
||||||
|
|
||||||
|
-plugin
|
||||||
|
Indicate the plugin to use.
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
|
||||||
|
schema help
|
||||||
|
shows this help message.
|
||||||
|
|
||||||
|
schema view <name>
|
||||||
|
read and output contents of schema file.
|
||||||
|
|
||||||
|
schema generate
|
||||||
|
reads from 'connection' writes to 'path'
|
||||||
|
To force generation of all tables into the schema, use the -f param.
|
||||||
|
Use 'schema generate snapshot <number>' to generate snapshots
|
||||||
|
which you can use with the -s parameter in the other operations.
|
||||||
|
|
||||||
|
schema dump <name>
|
||||||
|
Dump database sql based on schema file to stdout.
|
||||||
|
If you use the `-write` param is used a .sql will be generated.
|
||||||
|
If `-write` is a filename, then that file name will be generate.
|
||||||
|
If `-write` is a full path, the schema will be written there.
|
||||||
|
|
||||||
|
schema create <name> <table>
|
||||||
|
Drop and create tables based on schema file
|
||||||
|
optional <table> argument can be used to create only a single
|
||||||
|
table in the schema. Pass the -s param with a number to use a snapshot.
|
||||||
|
Use the `-dry` param to preview the changes.
|
||||||
|
|
||||||
|
schema update <name> <table>
|
||||||
|
Alter the tables based on schema file. Optional <table>
|
||||||
|
parameter will only update one table.
|
||||||
|
To use a snapshot pass the `-s` param with the snapshot number.
|
||||||
|
To preview the changes that will be done use `-dry`.
|
||||||
|
TEXT;
|
||||||
|
$this->out($help);
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for Shells
|
* Base class for Shells
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,6 +137,7 @@ class Shell extends Object {
|
||||||
*/
|
*/
|
||||||
function __construct(&$dispatch) {
|
function __construct(&$dispatch) {
|
||||||
$vars = array('params', 'args', 'shell', 'shellCommand' => 'command');
|
$vars = array('params', 'args', 'shell', 'shellCommand' => 'command');
|
||||||
|
|
||||||
foreach ($vars as $key => $var) {
|
foreach ($vars as $key => $var) {
|
||||||
if (is_string($key)) {
|
if (is_string($key)) {
|
||||||
$this->{$var} =& $dispatch->{$key};
|
$this->{$var} =& $dispatch->{$key};
|
||||||
|
@ -205,8 +198,9 @@ class Shell extends Object {
|
||||||
*/
|
*/
|
||||||
function _welcome() {
|
function _welcome() {
|
||||||
$this->Dispatch->clear();
|
$this->Dispatch->clear();
|
||||||
$this->out("\nWelcome to CakePHP v" . Configure::version() . " Console");
|
$this->out();
|
||||||
$this->out("---------------------------------------------------------------");
|
$this->out('Welcome to CakePHP v' . Configure::version() . ' Console');
|
||||||
|
$this->hr();
|
||||||
$this->out('App : '. $this->params['app']);
|
$this->out('App : '. $this->params['app']);
|
||||||
$this->out('Path: '. $this->params['working']);
|
$this->out('Path: '. $this->params['working']);
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
@ -224,8 +218,8 @@ class Shell extends Object {
|
||||||
$this->DbConfig =& new DATABASE_CONFIG();
|
$this->DbConfig =& new DATABASE_CONFIG();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$this->err('Database config could not be loaded');
|
$this->err('Database config could not be loaded.');
|
||||||
$this->out('Run \'bake\' to create the database configuration');
|
$this->out('Run `bake` to create the database configuration.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,11 +252,7 @@ class Shell extends Object {
|
||||||
$this->modelClass = $modelClassName;
|
$this->modelClass = $modelClassName;
|
||||||
|
|
||||||
foreach ($uses as $modelClass) {
|
foreach ($uses as $modelClass) {
|
||||||
$plugin = null;
|
list($plugin, $modelClass) = pluginSplit($modelClass, true);
|
||||||
if (strpos($modelClass, '.') !== false) {
|
|
||||||
list($plugin, $modelClass) = explode('.', $modelClass);
|
|
||||||
$plugin = $plugin . '.';
|
|
||||||
}
|
|
||||||
if (PHP5) {
|
if (PHP5) {
|
||||||
$this->{$modelClass} = ClassRegistry::init($plugin . $modelClass);
|
$this->{$modelClass} = ClassRegistry::init($plugin . $modelClass);
|
||||||
} else {
|
} else {
|
||||||
|
@ -320,7 +310,7 @@ class Shell extends Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($this->{$taskName})) {
|
if (!isset($this->{$taskName})) {
|
||||||
$this->err("Task '" . $taskName . "' could not be loaded");
|
$this->err("Task `{$taskName}` could not be loaded");
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -363,63 +353,59 @@ class Shell extends Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Outputs a single or multiple messages to stdout.
|
* Outputs a single or multiple messages to stdout. If no parameters
|
||||||
|
* are passed outputs just a newline.
|
||||||
*
|
*
|
||||||
* @param mixed $message A string or a an array of strings to output
|
* @param mixed $message A string or a an array of strings to output
|
||||||
* @param mixed $after Appended to message, if true a newline is used
|
* @param integer $newlines Number of newlines to append
|
||||||
|
* @return integer Returns the number of bytes returned from writing to stdout.
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function out($message, $after = true) {
|
function out($message = null, $newlines = 1) {
|
||||||
if (is_array($message)) {
|
if (is_array($message)) {
|
||||||
$message = implode($this->nl(), $message);
|
$message = implode($this->nl(), $message);
|
||||||
}
|
}
|
||||||
$this->Dispatch->stdout($message . $this->nl($after), false);
|
return $this->Dispatch->stdout($message . $this->nl($newlines), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Outputs a single or multiple error messages to stderr.
|
* Outputs a single or multiple error messages to stderr. If no parameters
|
||||||
|
* are passed outputs just a newline.
|
||||||
*
|
*
|
||||||
* @param mixed $message A string or a an array of strings to output
|
* @param mixed $message A string or a an array of strings to output
|
||||||
* @param mixed $after Appended to message, if true a newline is used
|
* @param integer $newlines Number of newlines to append
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function err($message, $after = true) {
|
function err($message = null, $newlines = 1) {
|
||||||
if (is_array($message)) {
|
if (is_array($message)) {
|
||||||
$message = implode($this->nl(), $message);
|
$message = implode($this->nl(), $message);
|
||||||
}
|
}
|
||||||
$this->Dispatch->stderr($message . $this->nl($after));
|
$this->Dispatch->stderr($message . $this->nl($newlines));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a single or multiple linefeeds sequences.
|
* Returns a single or multiple linefeeds sequences.
|
||||||
*
|
*
|
||||||
* @param mixed $format If true returns a linefeed sequence, if false null,
|
* @param integer $multiplier Number of times the linefeed sequence should be repeated
|
||||||
* if a string is given that is returned,
|
|
||||||
* if an integer is given it is used as a multiplier to return multiple linefeed sequences
|
|
||||||
* @access public
|
* @access public
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function nl($format = true) {
|
function nl($multiplier = 1) {
|
||||||
if (is_string($format)) {
|
return str_repeat("\n", $multiplier);
|
||||||
return $format . "\n";
|
|
||||||
}
|
|
||||||
if (is_int($format)) {
|
|
||||||
return str_repeat("\n", $format);
|
|
||||||
}
|
|
||||||
return $format ? "\n" : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Outputs a series of minus characters to the standard output, acts as a visual separator.
|
* Outputs a series of minus characters to the standard output, acts as a visual separator.
|
||||||
*
|
*
|
||||||
* @param mixed $surround If true, the outputs gets surrounded by newlines.
|
* @param integer $newlines Number of newlines to pre- and append
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function hr($surround = false) {
|
function hr($newlines = 0) {
|
||||||
$this->out(null, $surround);
|
$this->out(null, $newlines);
|
||||||
$this->out('---------------------------------------------------------------');
|
$this->out('---------------------------------------------------------------');
|
||||||
$this->out(null, $surround);
|
$this->out(null, $newlines);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a formatted error message
|
* Displays a formatted error message
|
||||||
* and exits the application with status code 1
|
* and exits the application with status code 1
|
||||||
|
@ -449,7 +435,11 @@ class Shell extends Object {
|
||||||
$command = $this->command;
|
$command = $this->command;
|
||||||
}
|
}
|
||||||
if (count($this->args) < $expectedNum) {
|
if (count($this->args) < $expectedNum) {
|
||||||
$this->error("Wrong number of parameters: ".count($this->args), "Expected: {$expectedNum}\nPlease type 'cake {$this->shell} help' for help on usage of the {$this->name} {$command}");
|
$message[] = "Got: " . count($this->args);
|
||||||
|
$message[] = "Expected: {$expectedNum}";
|
||||||
|
$message[] = "Please type `cake {$this->shell} help` for help";
|
||||||
|
$message[] = "on usage of the {$this->name} {$command}.";
|
||||||
|
$this->error('Wrong number of parameters', $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,14 +453,19 @@ class Shell extends Object {
|
||||||
*/
|
*/
|
||||||
function createFile($path, $contents) {
|
function createFile($path, $contents) {
|
||||||
$path = str_replace(DS . DS, DS, $path);
|
$path = str_replace(DS . DS, DS, $path);
|
||||||
$this->out("\n" . sprintf(__("Creating file %s", true), $path));
|
|
||||||
|
$this->out();
|
||||||
|
$this->out(sprintf(__("Creating file %s", true), $path));
|
||||||
|
|
||||||
if (is_file($path) && $this->interactive === true) {
|
if (is_file($path) && $this->interactive === true) {
|
||||||
$key = $this->in(__("File exists, overwrite?", true). " {$path}", array('y', 'n', 'q'), 'n');
|
$prompt = sprintf(__('File `%s` exists, overwrite?', true), $path);
|
||||||
|
$key = $this->in($prompt, array('y', 'n', 'q'), 'n');
|
||||||
|
|
||||||
if (strtolower($key) == 'q') {
|
if (strtolower($key) == 'q') {
|
||||||
$this->out(__("Quitting.", true) ."\n");
|
$this->out(__('Quitting.', true), 2);
|
||||||
exit;
|
$this->_stop();
|
||||||
} elseif (strtolower($key) != 'y') {
|
} elseif (strtolower($key) != 'y') {
|
||||||
$this->out(__("Skip", true) ." {$path}\n");
|
$this->out(sprintf(__('Skip `%s`', true), $path), 2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -481,10 +476,10 @@ class Shell extends Object {
|
||||||
if ($File = new File($path, true)) {
|
if ($File = new File($path, true)) {
|
||||||
$data = $File->prepare($contents);
|
$data = $File->prepare($contents);
|
||||||
$File->write($data);
|
$File->write($data);
|
||||||
$this->out(__("Wrote", true) ." {$path}");
|
$this->out(sprintf(__('Wrote `%s`', true), $path));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$this->err(__("Error! Could not write to", true)." {$path}.\n");
|
$this->err(sprintf(__('Could not write to `%s`.', true), $path), 2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -496,7 +491,8 @@ class Shell extends Object {
|
||||||
*/
|
*/
|
||||||
function help() {
|
function help() {
|
||||||
if ($this->command != null) {
|
if ($this->command != null) {
|
||||||
$this->err("Unknown {$this->name} command '$this->command'.\nFor usage, try 'cake {$this->shell} help'.\n\n");
|
$this->err("Unknown {$this->name} command `{$this->command}`.");
|
||||||
|
$this->err("For usage, try `cake {$this->shell} help`.", 2);
|
||||||
} else {
|
} else {
|
||||||
$this->Dispatch->help();
|
$this->Dispatch->help();
|
||||||
}
|
}
|
||||||
|
@ -512,11 +508,13 @@ class Shell extends Object {
|
||||||
if (App::import('vendor', 'simpletest' . DS . 'simpletest')) {
|
if (App::import('vendor', 'simpletest' . DS . 'simpletest')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$unitTest = $this->in('SimpleTest is not installed. Do you want to bake unit test files anyway?', array('y','n'), 'y');
|
$prompt = 'SimpleTest is not installed. Do you want to bake unit test files anyway?';
|
||||||
|
$unitTest = $this->in($prompt, array('y','n'), 'y');
|
||||||
$result = strtolower($unitTest) == 'y' || strtolower($unitTest) == 'yes';
|
$result = strtolower($unitTest) == 'y' || strtolower($unitTest) == 'yes';
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->out("\nYou can download SimpleTest from http://simpletest.org", true);
|
$this->out();
|
||||||
|
$this->out('You can download SimpleTest from http://simpletest.org');
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@ -586,8 +584,7 @@ class Shell extends Object {
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _modelNameFromKey($key) {
|
function _modelNameFromKey($key) {
|
||||||
$name = str_replace('_id', '',$key);
|
return Inflector::camelize(str_replace('_id', '', $key));
|
||||||
return Inflector::camelize($name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -639,16 +636,9 @@ class Shell extends Object {
|
||||||
*
|
*
|
||||||
* @param string $pluginName Name of the plugin you want ie. DebugKit
|
* @param string $pluginName Name of the plugin you want ie. DebugKit
|
||||||
* @return string $path path to the correct plugin.
|
* @return string $path path to the correct plugin.
|
||||||
**/
|
*/
|
||||||
function _pluginPath($pluginName) {
|
function _pluginPath($pluginName) {
|
||||||
$pluginPaths = App::path('plugins');
|
return App::pluginPath($pluginName);
|
||||||
$pluginDirName = Inflector::underscore($pluginName);
|
|
||||||
foreach ($pluginPaths as $path) {
|
|
||||||
if (is_dir($path . $pluginDirName)) {
|
|
||||||
return $path . $pluginDirName . DS ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $pluginPaths[0] . $pluginDirName . DS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -2,23 +2,20 @@
|
||||||
/**
|
/**
|
||||||
* The ControllerTask handles creating and updating controller files.
|
* The ControllerTask handles creating and updating controller files.
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc.
|
* Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.tasks
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
* @since CakePHP(tm) v 1.2
|
* @since CakePHP(tm) v 1.2
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,17 +83,17 @@ class ControllerTask extends Shell {
|
||||||
$this->out(__('Baking basic crud methods for ', true) . $controller);
|
$this->out(__('Baking basic crud methods for ', true) . $controller);
|
||||||
$actions = $this->bakeActions($controller);
|
$actions = $this->bakeActions($controller);
|
||||||
} elseif (!empty($this->args[1]) && $this->args[1] == 'admin') {
|
} elseif (!empty($this->args[1]) && $this->args[1] == 'admin') {
|
||||||
$admin = $this->Project->getAdmin();
|
$admin = $this->Project->getPrefix();
|
||||||
if ($admin) {
|
if ($admin) {
|
||||||
$this->out('Adding ' . Configure::read('Routing.admin') .' methods');
|
$this->out(sprintf(__('Adding %s methods', true), $admin));
|
||||||
$actions = $this->bakeActions($controller, $admin);
|
$actions = $this->bakeActions($controller, $admin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->args[2]) && $this->args[2] == 'admin') {
|
if (!empty($this->args[2]) && $this->args[2] == 'admin') {
|
||||||
$admin = $this->Project->getAdmin();
|
$admin = $this->Project->getPrefix();
|
||||||
if ($admin) {
|
if ($admin) {
|
||||||
$this->out('Adding ' . Configure::read('Routing.admin') .' methods');
|
$this->out(sprintf(__('Adding %s methods', true), $admin));
|
||||||
$actions .= "\n" . $this->bakeActions($controller, $admin);
|
$actions .= "\n" . $this->bakeActions($controller, $admin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +111,7 @@ class ControllerTask extends Shell {
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function all() {
|
function all() {
|
||||||
$this->interactive = false;
|
$this->interactive = false;
|
||||||
$this->listAll($this->connection, false);
|
$this->listAll($this->connection, false);
|
||||||
|
@ -165,7 +162,7 @@ class ControllerTask extends Shell {
|
||||||
if (file_exists($this->path . $controllerFile .'_controller.php')) {
|
if (file_exists($this->path . $controllerFile .'_controller.php')) {
|
||||||
$question[] = sprintf(__("Warning: Choosing no will overwrite the %sController.", true), $controllerName);
|
$question[] = sprintf(__("Warning: Choosing no will overwrite the %sController.", true), $controllerName);
|
||||||
}
|
}
|
||||||
$doItInteractive = $this->in(join("\n", $question), array('y', 'n'), 'y');
|
$doItInteractive = $this->in(implode("\n", $question), array('y','n'), 'y');
|
||||||
|
|
||||||
if (strtolower($doItInteractive) == 'y') {
|
if (strtolower($doItInteractive) == 'y') {
|
||||||
$this->interactive = true;
|
$this->interactive = true;
|
||||||
|
@ -194,7 +191,7 @@ class ControllerTask extends Shell {
|
||||||
$actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) == 'y');
|
$actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) == 'y');
|
||||||
}
|
}
|
||||||
if (strtolower($wannaBakeAdminCrud) == 'y') {
|
if (strtolower($wannaBakeAdminCrud) == 'y') {
|
||||||
$admin = $this->Project->getAdmin();
|
$admin = $this->Project->getPrefix();
|
||||||
$actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y');
|
$actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,9 +217,9 @@ class ControllerTask extends Shell {
|
||||||
* Confirm a to be baked controller with the user
|
* Confirm a to be baked controller with the user
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
|
function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__('The following controller will be created:', true));
|
$this->out(__('The following controller will be created:', true));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
@ -258,7 +255,7 @@ class ControllerTask extends Shell {
|
||||||
* Interact with the user and ask about which methods (admin or regular they want to bake)
|
* Interact with the user and ask about which methods (admin or regular they want to bake)
|
||||||
*
|
*
|
||||||
* @return array Array containing (bakeRegular, bakeAdmin) answers
|
* @return array Array containing (bakeRegular, bakeAdmin) answers
|
||||||
**/
|
*/
|
||||||
function _askAboutMethods() {
|
function _askAboutMethods() {
|
||||||
$wannaBakeCrud = $this->in(
|
$wannaBakeCrud = $this->in(
|
||||||
__("Would you like to create some basic class methods \n(index(), add(), view(), edit())?", true),
|
__("Would you like to create some basic class methods \n(index(), add(), view(), edit())?", true),
|
||||||
|
@ -294,8 +291,8 @@ class ControllerTask extends Shell {
|
||||||
$controllerPath = $this->_controllerPath($controllerName);
|
$controllerPath = $this->_controllerPath($controllerName);
|
||||||
$pluralName = $this->_pluralName($currentModelName);
|
$pluralName = $this->_pluralName($currentModelName);
|
||||||
$singularName = Inflector::variable($currentModelName);
|
$singularName = Inflector::variable($currentModelName);
|
||||||
$singularHumanName = Inflector::humanize($currentModelName);
|
$singularHumanName = $this->_singularHumanName($currentModelName);
|
||||||
$pluralHumanName = Inflector::humanize($controllerName);
|
$pluralHumanName = $this->_pluralName($controllerName);
|
||||||
|
|
||||||
$this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
|
$this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
|
||||||
'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName'));
|
'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName'));
|
||||||
|
@ -349,7 +346,7 @@ class ControllerTask extends Shell {
|
||||||
* Interact with the user and get a list of additional helpers
|
* Interact with the user and get a list of additional helpers
|
||||||
*
|
*
|
||||||
* @return array Helpers that the user wants to use.
|
* @return array Helpers that the user wants to use.
|
||||||
**/
|
*/
|
||||||
function doHelpers() {
|
function doHelpers() {
|
||||||
return $this->_doPropertyChoices(
|
return $this->_doPropertyChoices(
|
||||||
__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true),
|
__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true),
|
||||||
|
@ -361,7 +358,7 @@ class ControllerTask extends Shell {
|
||||||
* Interact with the user and get a list of additional components
|
* Interact with the user and get a list of additional components
|
||||||
*
|
*
|
||||||
* @return array Components the user wants to use.
|
* @return array Components the user wants to use.
|
||||||
**/
|
*/
|
||||||
function doComponents() {
|
function doComponents() {
|
||||||
return $this->_doPropertyChoices(
|
return $this->_doPropertyChoices(
|
||||||
__("Would you like this controller to use any components?", true),
|
__("Would you like this controller to use any components?", true),
|
||||||
|
@ -375,7 +372,7 @@ class ControllerTask extends Shell {
|
||||||
* @param string $prompt A yes/no question to precede the list
|
* @param string $prompt A yes/no question to precede the list
|
||||||
* @param sting $example A question for a comma separated list, with examples.
|
* @param sting $example A question for a comma separated list, with examples.
|
||||||
* @return array Array of values for property.
|
* @return array Array of values for property.
|
||||||
**/
|
*/
|
||||||
function _doPropertyChoices($prompt, $example) {
|
function _doPropertyChoices($prompt, $example) {
|
||||||
$proceed = $this->in($prompt, array('y','n'), 'n');
|
$proceed = $this->in($prompt, array('y','n'), 'n');
|
||||||
$property = array();
|
$property = array();
|
||||||
|
@ -456,28 +453,34 @@ class ControllerTask extends Shell {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out("Usage: cake bake controller <arg1> <arg2>...");
|
$this->out("Usage: cake bake controller <arg1> <arg2>...");
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
$this->out('Arguments:');
|
||||||
|
$this->out();
|
||||||
|
$this->out("<name>");
|
||||||
|
$this->out("\tName of the controller to bake. Can use Plugin.name");
|
||||||
|
$this->out("\tas a shortcut for plugin baking.");
|
||||||
|
$this->out();
|
||||||
$this->out('Commands:');
|
$this->out('Commands:');
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("controller <name>");
|
$this->out("controller <name>");
|
||||||
$this->out("\tbakes controller with var \$scaffold");
|
$this->out("\tbakes controller with var \$scaffold");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("controller <name> public");
|
$this->out("controller <name> public");
|
||||||
$this->out("\tbakes controller with basic crud actions");
|
$this->out("\tbakes controller with basic crud actions");
|
||||||
$this->out("\t(index, view, add, edit, delete)");
|
$this->out("\t(index, view, add, edit, delete)");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("controller <name> admin");
|
$this->out("controller <name> admin");
|
||||||
$this->out("\tbakes a controller with basic crud actions for");
|
$this->out("\tbakes a controller with basic crud actions for one of the");
|
||||||
$this->out("\tConfigure::read('Routing.admin') methods.");
|
$this->out("\tConfigure::read('Routing.prefixes') methods.");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("controller <name> public admin");
|
$this->out("controller <name> public admin");
|
||||||
$this->out("\tbakes a controller with basic crud actions for");
|
$this->out("\tbakes a controller with basic crud actions for one");
|
||||||
$this->out("\tConfigure::read('Routing.admin') and non admin methods.");
|
$this->out("\tConfigure::read('Routing.prefixes') and non admin methods.");
|
||||||
$this->out("\t(index, view, add, edit, delete,");
|
$this->out("\t(index, view, add, edit, delete,");
|
||||||
$this->out("\tadmin_index, admin_view, admin_edit, admin_add, admin_delete)");
|
$this->out("\tadmin_index, admin_view, admin_edit, admin_add, admin_delete)");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("controller all");
|
$this->out("controller all");
|
||||||
$this->out("\tbakes all controllers with CRUD methods.");
|
$this->out("\tbakes all controllers with CRUD methods.");
|
||||||
$this->out("");
|
$this->out();
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,23 +2,20 @@
|
||||||
/**
|
/**
|
||||||
* The DbConfig Task handles creating and updating the database.php
|
* The DbConfig Task handles creating and updating the database.php
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.tasks
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
* @since CakePHP(tm) v 1.2
|
* @since CakePHP(tm) v 1.2
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +51,7 @@ class DbConfigTask extends Shell {
|
||||||
* Used for testing.
|
* Used for testing.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
**/
|
*/
|
||||||
var $databaseClassName = 'DATABASE_CONFIG';
|
var $databaseClassName = 'DATABASE_CONFIG';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,7 +105,7 @@ class DbConfigTask extends Shell {
|
||||||
$driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql');
|
$driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql');
|
||||||
|
|
||||||
$persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n');
|
$persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n');
|
||||||
if (low($persistent) == 'n') {
|
if (strtolower($persistent) == 'n') {
|
||||||
$persistent = 'false';
|
$persistent = 'false';
|
||||||
} else {
|
} else {
|
||||||
$persistent = 'true';
|
$persistent = 'true';
|
||||||
|
@ -124,7 +121,7 @@ class DbConfigTask extends Shell {
|
||||||
$port = $this->in('Port?', null, 'n');
|
$port = $this->in('Port?', null, 'n');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (low($port) == 'n') {
|
if (strtolower($port) == 'n') {
|
||||||
$port = null;
|
$port = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +152,7 @@ class DbConfigTask extends Shell {
|
||||||
while ($prefix == '') {
|
while ($prefix == '') {
|
||||||
$prefix = $this->in('Table Prefix?', null, 'n');
|
$prefix = $this->in('Table Prefix?', null, 'n');
|
||||||
}
|
}
|
||||||
if (low($prefix) == 'n') {
|
if (strtolower($prefix) == 'n') {
|
||||||
$prefix = null;
|
$prefix = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +160,7 @@ class DbConfigTask extends Shell {
|
||||||
while ($encoding == '') {
|
while ($encoding == '') {
|
||||||
$encoding = $this->in('Table encoding?', null, 'n');
|
$encoding = $this->in('Table encoding?', null, 'n');
|
||||||
}
|
}
|
||||||
if (low($encoding) == 'n') {
|
if (strtolower($encoding) == 'n') {
|
||||||
$encoding = null;
|
$encoding = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +170,7 @@ class DbConfigTask extends Shell {
|
||||||
$schema = $this->in('Table schema?', null, 'n');
|
$schema = $this->in('Table schema?', null, 'n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (low($schema) == 'n') {
|
if (strtolower($schema) == 'n') {
|
||||||
$schema = null;
|
$schema = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +182,7 @@ class DbConfigTask extends Shell {
|
||||||
$dbConfigs[] = $config;
|
$dbConfigs[] = $config;
|
||||||
$doneYet = $this->in('Do you wish to add another database configuration?', null, 'n');
|
$doneYet = $this->in('Do you wish to add another database configuration?', null, 'n');
|
||||||
|
|
||||||
if (low($doneYet == 'n')) {
|
if (strtolower($doneYet == 'n')) {
|
||||||
$done = true;
|
$done = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,7 +201,7 @@ class DbConfigTask extends Shell {
|
||||||
function __verify($config) {
|
function __verify($config) {
|
||||||
$config = array_merge($this->__defaultConfig, $config);
|
$config = array_merge($this->__defaultConfig, $config);
|
||||||
extract($config);
|
extract($config);
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out('The following database configuration will be created:');
|
$this->out('The following database configuration will be created:');
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
@ -259,6 +256,7 @@ class DbConfigTask extends Shell {
|
||||||
$oldConfigs = array();
|
$oldConfigs = array();
|
||||||
|
|
||||||
if (file_exists($filename)) {
|
if (file_exists($filename)) {
|
||||||
|
config('database');
|
||||||
$db = new $this->databaseClassName;
|
$db = new $this->databaseClassName;
|
||||||
$temp = get_class_vars(get_class($db));
|
$temp = get_class_vars(get_class($db));
|
||||||
|
|
||||||
|
@ -351,11 +349,12 @@ class DbConfigTask extends Shell {
|
||||||
* Get a user specified Connection name
|
* Get a user specified Connection name
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function getConfig() {
|
function getConfig() {
|
||||||
|
App::import('Model', 'ConnectionManager', false);
|
||||||
|
|
||||||
$useDbConfig = 'default';
|
$useDbConfig = 'default';
|
||||||
$configs = get_class_vars($this->databaseClassName);
|
$configs = get_class_vars($this->databaseClassName);
|
||||||
|
|
||||||
if (!is_array($configs)) {
|
if (!is_array($configs)) {
|
||||||
return $this->execute();
|
return $this->execute();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,93 +1,54 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Language string extractor
|
||||||
*
|
|
||||||
* Long description for file
|
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Only used when -debug option
|
|
||||||
*/
|
|
||||||
ob_start();
|
|
||||||
|
|
||||||
$singularReturn = __('Singular string return __()', true);
|
|
||||||
$singularEcho = __('Singular string echo __()');
|
|
||||||
|
|
||||||
$pluralReturn = __n('% apple in the bowl (plural string return __n())', '% apples in the blowl (plural string 2 return __n())', 3, true);
|
|
||||||
$pluralEcho = __n('% apple in the bowl (plural string 2 echo __n())', '% apples in the blowl (plural string 2 echo __n()', 3);
|
|
||||||
|
|
||||||
$singularDomainReturn = __d('controllers', 'Singular string domain lookup return __d()', true);
|
|
||||||
$singularDomainEcho = __d('controllers', 'Singular string domain lookup echo __d()');
|
|
||||||
|
|
||||||
$pluralDomainReturn = __dn('controllers', '% pears in the bowl (plural string domain lookup return __dn())', '% pears in the blowl (plural string domain lookup return __dn())', 3, true);
|
|
||||||
$pluralDomainEcho = __dn('controllers', '% pears in the bowl (plural string domain lookup echo __dn())', '% pears in the blowl (plural string domain lookup echo __dn())', 3);
|
|
||||||
|
|
||||||
$singularDomainCategoryReturn = __dc('controllers', 'Singular string domain and category lookup return __dc()', 5, true);
|
|
||||||
$singularDomainCategoryEcho = __dc('controllers', 'Singular string domain and category lookup echo __dc()', 5);
|
|
||||||
|
|
||||||
$pluralDomainCategoryReturn = __dcn('controllers', '% apple in the bowl (plural string 1 domain and category lookup return __dcn())', '% apples in the blowl (plural string 2 domain and category lookup return __dcn())', 3, 5, true);
|
|
||||||
$pluralDomainCategoryEcho = __dcn('controllers', '% apple in the bowl (plural string 1 domain and category lookup echo __dcn())', '% apples in the blowl (plural string 2 domain and category lookup echo __dcn())', 3, 5);
|
|
||||||
|
|
||||||
$categoryReturn = __c('Category string lookup line return __c()', 5, true);
|
|
||||||
$categoryEcho = __c('Category string lookup line echo __c()', 5);
|
|
||||||
|
|
||||||
ob_end_clean();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Language string extractor
|
* Language string extractor
|
||||||
*
|
*
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
*/
|
*/
|
||||||
class ExtractTask extends Shell {
|
class ExtractTask extends Shell {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Path to use when looking for strings
|
* Paths to use when looking for strings
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @access public
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $path = null;
|
var $__paths = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Files from where to extract
|
* Files from where to extract
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
var $files = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Filename where to deposit translations
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $__filename = 'default';
|
var $__files = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if all strings should be merged into one file
|
* Merge all domains string into the default.pot file
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $__oneFile = true;
|
var $__merge = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current file being processed
|
* Current file being processed
|
||||||
|
@ -97,6 +58,14 @@ class ExtractTask extends Shell{
|
||||||
*/
|
*/
|
||||||
var $__file = null;
|
var $__file = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains all content waiting to be write
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
var $__storage = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracted tokens
|
* Extracted tokens
|
||||||
*
|
*
|
||||||
|
@ -113,14 +82,6 @@ class ExtractTask extends Shell{
|
||||||
*/
|
*/
|
||||||
var $__strings = array();
|
var $__strings = array();
|
||||||
|
|
||||||
/**
|
|
||||||
* History of file versions
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
var $__fileVersions = array();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destination path
|
* Destination path
|
||||||
*
|
*
|
||||||
|
@ -132,59 +93,65 @@ class ExtractTask extends Shell{
|
||||||
/**
|
/**
|
||||||
* Execution method always used for tasks
|
* Execution method always used for tasks
|
||||||
*
|
*
|
||||||
* @access public
|
* @return void
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function execute() {
|
function execute() {
|
||||||
if (isset($this->params['files']) && !is_array($this->params['files'])) {
|
if (isset($this->params['files']) && !is_array($this->params['files'])) {
|
||||||
$this->files = explode(',', $this->params['files']);
|
$this->__files = explode(',', $this->params['files']);
|
||||||
}
|
}
|
||||||
if (isset($this->params['path'])) {
|
if (isset($this->params['paths'])) {
|
||||||
$this->path = $this->params['path'];
|
$this->__paths = explode(',', $this->params['paths']);
|
||||||
} else {
|
} else {
|
||||||
$response = '';
|
$defaultPath = $this->params['working'];
|
||||||
while ($response == '') {
|
$message = sprintf(__("What is the full path you would like to extract?\nExample: %s\n[Q]uit [D]one", true), $this->params['root'] . DS . 'myapp');
|
||||||
$response = $this->in("What is the full path you would like to extract?\nExample: " . $this->params['root'] . DS . "myapp\n[Q]uit", null, $this->params['working']);
|
while (true) {
|
||||||
|
$response = $this->in($message, null, $defaultPath);
|
||||||
if (strtoupper($response) === 'Q') {
|
if (strtoupper($response) === 'Q') {
|
||||||
$this->out('Extract Aborted');
|
$this->out(__('Extract Aborted', true));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
} elseif (strtoupper($response) === 'D') {
|
||||||
}
|
$this->out();
|
||||||
|
break;
|
||||||
if (is_dir($response)) {
|
} elseif (is_dir($response)) {
|
||||||
$this->path = $response;
|
$this->__paths[] = $response;
|
||||||
|
$defaultPath = 'D';
|
||||||
} else {
|
} else {
|
||||||
$this->err('The directory path you supplied was not found. Please try again.');
|
$this->err(__('The directory path you supplied was not found. Please try again.', true));
|
||||||
$this->execute();
|
|
||||||
}
|
}
|
||||||
|
$this->out();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->params['debug'])) {
|
|
||||||
$this->path = ROOT;
|
|
||||||
$this->files = array(__FILE__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->params['output'])) {
|
if (isset($this->params['output'])) {
|
||||||
$this->__output = $this->params['output'];
|
$this->__output = $this->params['output'];
|
||||||
} else {
|
} else {
|
||||||
$response = '';
|
$message = sprintf(__("What is the full path you would like to output?\nExample: %s\n[Q]uit", true), $this->__paths[0] . DS . 'locale');
|
||||||
while ($response == '') {
|
while (true) {
|
||||||
$response = $this->in("What is the full path you would like to output?\nExample: " . $this->path . DS . "locale\n[Q]uit", null, $this->path . DS . "locale");
|
$response = $this->in($message, null, $this->__paths[0] . DS . 'locale');
|
||||||
if (strtoupper($response) === 'Q') {
|
if (strtoupper($response) === 'Q') {
|
||||||
$this->out('Extract Aborted');
|
$this->out(__('Extract Aborted', true));
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
} elseif (is_dir($response)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (is_dir($response)) {
|
|
||||||
$this->__output = $response . DS;
|
$this->__output = $response . DS;
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
$this->err('The directory path you supplied was not found. Please try again.');
|
$this->err(__('The directory path you supplied was not found. Please try again.', true));
|
||||||
$this->execute();
|
}
|
||||||
|
$this->out();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->files)) {
|
if (isset($this->params['merge'])) {
|
||||||
$this->files = $this->__searchDirectory();
|
$this->__merge = !(strtolower($this->params['merge']) === 'no');
|
||||||
|
} else {
|
||||||
|
$this->out();
|
||||||
|
$response = $this->in(sprintf(__('Would you like to merge all domains strings into the default.pot file?', true)), array('y', 'n'), 'n');
|
||||||
|
$this->__merge = strtolower($response) === 'y';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($this->__files)) {
|
||||||
|
$this->__searchFiles();
|
||||||
}
|
}
|
||||||
$this->__extract();
|
$this->__extract();
|
||||||
}
|
}
|
||||||
|
@ -192,39 +159,27 @@ class ExtractTask extends Shell{
|
||||||
/**
|
/**
|
||||||
* Extract text
|
* Extract text
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __extract() {
|
function __extract() {
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out(__('Extracting...', true));
|
$this->out(__('Extracting...', true));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__('Path: ', true). $this->path);
|
$this->out(__('Paths:', true));
|
||||||
|
foreach ($this->__paths as $path) {
|
||||||
|
$this->out(' ' . $path);
|
||||||
|
}
|
||||||
$this->out(__('Output Directory: ', true) . $this->__output);
|
$this->out(__('Output Directory: ', true) . $this->__output);
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
|
||||||
$response = '';
|
|
||||||
$filename = '';
|
|
||||||
while ($response == '') {
|
|
||||||
$response = $this->in(__('Would you like to merge all translations into one file?', true), array('y','n'), 'y');
|
|
||||||
if (strtolower($response) == 'n') {
|
|
||||||
$this->__oneFile = false;
|
|
||||||
} else {
|
|
||||||
while ($filename == '') {
|
|
||||||
$filename = $this->in(__('What should we name this file?', true), null, $this->__filename);
|
|
||||||
if ($filename == '') {
|
|
||||||
$this->out(__('The filesname you supplied was empty. Please try again.', true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->__filename = $filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->__extractTokens();
|
$this->__extractTokens();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show help options
|
* Show help options
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function help() {
|
function help() {
|
||||||
|
@ -234,33 +189,34 @@ class ExtractTask extends Shell{
|
||||||
$this->out(__('By default the .pot file(s) will be place in the locale directory of -app', true));
|
$this->out(__('By default the .pot file(s) will be place in the locale directory of -app', true));
|
||||||
$this->out(__('By default -app is ROOT/app', true));
|
$this->out(__('By default -app is ROOT/app', true));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__('usage: cake i18n extract [command] [path...]', true));
|
$this->out(__('Usage: cake i18n extract <command> <param1> <param2>...', true));
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out(__('commands:', true));
|
$this->out(__('Params:', true));
|
||||||
$this->out(__(' -app [path...]: directory where your application is located', true));
|
$this->out(__(' -app [path...]: directory where your application is located', true));
|
||||||
$this->out(__(' -root [path...]: path to install', true));
|
$this->out(__(' -root [path...]: path to install', true));
|
||||||
$this->out(__(' -core [path...]: path to cake directory', true));
|
$this->out(__(' -core [path...]: path to cake directory', true));
|
||||||
$this->out(__(' -path [path...]: Full path to directory to extract strings', true));
|
$this->out(__(' -paths [comma separated list of paths, full path is needed]', true));
|
||||||
|
$this->out(__(' -merge [yes|no]: Merge all domains strings into the default.pot file', true));
|
||||||
$this->out(__(' -output [path...]: Full path to output directory', true));
|
$this->out(__(' -output [path...]: Full path to output directory', true));
|
||||||
$this->out(__(' -files: [comma separated list of files, full path to file is needed]', true));
|
$this->out(__(' -files: [comma separated list of files, full path to file is needed]', true));
|
||||||
|
$this->out();
|
||||||
|
$this->out(__('Commands:', true));
|
||||||
$this->out(__(' cake i18n extract help: Shows this help message.', true));
|
$this->out(__(' cake i18n extract help: Shows this help message.', true));
|
||||||
$this->out(__(' -debug: Perform self test.', true));
|
$this->out();
|
||||||
$this->out('');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract tokens out of all files to be processed
|
* Extract tokens out of all files to be processed
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __extractTokens() {
|
function __extractTokens() {
|
||||||
foreach ($this->files as $file) {
|
foreach ($this->__files as $file) {
|
||||||
$this->__file = $file;
|
$this->__file = $file;
|
||||||
$this->out(sprintf(__('Processing %s...', true), $file));
|
$this->out(sprintf(__('Processing %s...', true), $file));
|
||||||
|
|
||||||
$code = file_get_contents($file);
|
$code = file_get_contents($file);
|
||||||
|
|
||||||
$this->__findVersion($code, $file);
|
|
||||||
$allTokens = token_get_all($code);
|
$allTokens = token_get_all($code);
|
||||||
$this->__tokens = array();
|
$this->__tokens = array();
|
||||||
$lineNumber = 1;
|
$lineNumber = 1;
|
||||||
|
@ -274,70 +230,35 @@ class ExtractTask extends Shell{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($token)) {
|
if (is_array($token)) {
|
||||||
$lineNumber += count(split("\n", $token[1])) - 1;
|
$lineNumber += count(explode("\n", $token[1])) - 1;
|
||||||
} else {
|
} else {
|
||||||
$lineNumber += count(split("\n", $token)) - 1;
|
$lineNumber += count(explode("\n", $token)) - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($allTokens);
|
unset($allTokens);
|
||||||
$this->basic();
|
$this->__parse('__', array('singular'));
|
||||||
$this->basic('__c');
|
$this->__parse('__n', array('singular', 'plural'));
|
||||||
$this->extended();
|
$this->__parse('__d', array('domain', 'singular'));
|
||||||
$this->extended('__dc', 2);
|
$this->__parse('__c', array('singular'));
|
||||||
$this->extended('__n', 0, true);
|
$this->__parse('__dc', array('domain', 'singular'));
|
||||||
$this->extended('__dn', 2, true);
|
$this->__parse('__dn', array('domain', 'singular', 'plural'));
|
||||||
$this->extended('__dcn', 4, true);
|
$this->__parse('__dcn', array('domain', 'singular', 'plural'));
|
||||||
}
|
}
|
||||||
$this->__buildFiles();
|
$this->__buildFiles();
|
||||||
$this->__writeFiles();
|
$this->__writeFiles();
|
||||||
$this->out('Done.');
|
$this->out();
|
||||||
|
$this->out(__('Done.', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will parse __(), __c() functions
|
* Parse tokens
|
||||||
*
|
*
|
||||||
* @param string $functionName Function name that indicates translatable string (e.g: '__')
|
* @param string $functionName Function name that indicates translatable string (e.g: '__')
|
||||||
* @access public
|
* @param array $map Array containing what variables it will find (e.g: domain, singular, plural)
|
||||||
|
* @return void
|
||||||
|
* @access private
|
||||||
*/
|
*/
|
||||||
function basic($functionName = '__') {
|
function __parse($functionName, $map) {
|
||||||
$count = 0;
|
|
||||||
$tokenCount = count($this->__tokens);
|
|
||||||
|
|
||||||
while (($tokenCount - $count) > 3) {
|
|
||||||
list($countToken, $parenthesis, $middle, $right) = array($this->__tokens[$count], $this->__tokens[$count + 1], $this->__tokens[$count + 2], $this->__tokens[$count + 3]);
|
|
||||||
if (!is_array($countToken)) {
|
|
||||||
$count++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
list($type, $string, $line) = $countToken;
|
|
||||||
if (($type == T_STRING) && ($string == $functionName) && ($parenthesis == '(')) {
|
|
||||||
|
|
||||||
if (in_array($right, array(')', ','))
|
|
||||||
&& (is_array($middle) && ($middle[0] == T_CONSTANT_ENCAPSED_STRING))) {
|
|
||||||
|
|
||||||
if ($this->__oneFile === true) {
|
|
||||||
$this->__strings[$this->__formatString($middle[1])][$this->__file][] = $line;
|
|
||||||
} else {
|
|
||||||
$this->__strings[$this->__file][$this->__formatString($middle[1])][] = $line;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->__markerError($this->__file, $line, $functionName, $count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will parse __d(), __dc(), __n(), __dn(), __dcn()
|
|
||||||
*
|
|
||||||
* @param string $functionName Function name that indicates translatable string (e.g: '__')
|
|
||||||
* @param integer $shift Number of parameters to shift to find translateable string
|
|
||||||
* @param boolean $plural Set to true if function supports plural format, false otherwise
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
function extended($functionName = '__d', $shift = 0, $plural = false) {
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$tokenCount = count($this->__tokens);
|
$tokenCount = count($this->__tokens);
|
||||||
|
|
||||||
|
@ -362,52 +283,25 @@ class ExtractTask extends Shell{
|
||||||
$position++;
|
$position++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($plural) {
|
$mapCount = count($map);
|
||||||
$end = $position + $shift + 7;
|
$strings = array();
|
||||||
|
while (count($strings) < $mapCount && ($this->__tokens[$position] == ',' || $this->__tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING)) {
|
||||||
if ($this->__tokens[$position + $shift + 5] === ')') {
|
if ($this->__tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING) {
|
||||||
$end = $position + $shift + 5;
|
$strings[] = $this->__tokens[$position][1];
|
||||||
|
}
|
||||||
|
$position++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($shift)) {
|
if ($mapCount == count($strings)) {
|
||||||
list($singular, $firstComma, $plural, $seoncdComma, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $this->__tokens[$position + 3], $this->__tokens[$end]);
|
extract(array_combine($map, $strings));
|
||||||
$condition = ($seoncdComma == ',');
|
if (!isset($domain)) {
|
||||||
} else {
|
$domain = '\'default\'';
|
||||||
list($domain, $firstComma, $singular, $seoncdComma, $plural, $comma3, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $this->__tokens[$position + 3], $this->__tokens[$position + 4], $this->__tokens[$position + 5], $this->__tokens[$end]);
|
|
||||||
$condition = ($comma3 == ',');
|
|
||||||
}
|
|
||||||
$condition = $condition &&
|
|
||||||
(is_array($singular) && ($singular[0] == T_CONSTANT_ENCAPSED_STRING)) &&
|
|
||||||
(is_array($plural) && ($plural[0] == T_CONSTANT_ENCAPSED_STRING));
|
|
||||||
} else {
|
|
||||||
if ($this->__tokens[$position + $shift + 5] === ')') {
|
|
||||||
$comma = $this->__tokens[$position + $shift + 3];
|
|
||||||
$end = $position + $shift + 5;
|
|
||||||
} else {
|
|
||||||
$comma = null;
|
|
||||||
$end = $position + $shift + 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
list($domain, $firstComma, $text, $seoncdComma, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $comma, $this->__tokens[$end]);
|
|
||||||
$condition = ($seoncdComma == ',' || $seoncdComma === null) &&
|
|
||||||
(is_array($domain) && ($domain[0] == T_CONSTANT_ENCAPSED_STRING)) &&
|
|
||||||
(is_array($text) && ($text[0] == T_CONSTANT_ENCAPSED_STRING));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($endParenthesis == ')') && $condition) {
|
|
||||||
if ($this->__oneFile === true) {
|
|
||||||
if ($plural) {
|
|
||||||
$this->__strings[$this->__formatString($singular[1]) . "\0" . $this->__formatString($plural[1])][$this->__file][] = $line;
|
|
||||||
} else {
|
|
||||||
$this->__strings[$this->__formatString($text[1])][$this->__file][] = $line;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($plural) {
|
|
||||||
$this->__strings[$this->__file][$this->__formatString($singular[1]) . "\0" . $this->__formatString($plural[1])][] = $line;
|
|
||||||
} else {
|
|
||||||
$this->__strings[$this->__file][$this->__formatString($text[1])][] = $line;
|
|
||||||
}
|
}
|
||||||
|
$string = $this->__formatString($singular);
|
||||||
|
if (isset($plural)) {
|
||||||
|
$string .= "\0" . $this->__formatString($plural);
|
||||||
}
|
}
|
||||||
|
$this->__strings[$this->__formatString($domain)][$string][$this->__file][] = $line;
|
||||||
} else {
|
} else {
|
||||||
$this->__markerError($this->__file, $line, $functionName, $count);
|
$this->__markerError($this->__file, $line, $functionName, $count);
|
||||||
}
|
}
|
||||||
|
@ -419,170 +313,89 @@ class ExtractTask extends Shell{
|
||||||
/**
|
/**
|
||||||
* Build the translate template file contents out of obtained strings
|
* Build the translate template file contents out of obtained strings
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __buildFiles() {
|
function __buildFiles() {
|
||||||
foreach ($this->__strings as $str => $fileInfo) {
|
foreach ($this->__strings as $domain => $strings) {
|
||||||
$output = '';
|
foreach ($strings as $string => $files) {
|
||||||
$occured = $fileList = array();
|
$occurances = array();
|
||||||
|
foreach ($files as $file => $lines) {
|
||||||
if ($this->__oneFile === true) {
|
$occurances[] = $file . ':' . implode(';', $lines);
|
||||||
foreach ($fileInfo as $file => $lines) {
|
|
||||||
$occured[] = "$file:" . join(';', $lines);
|
|
||||||
|
|
||||||
if (isset($this->__fileVersions[$file])) {
|
|
||||||
$fileList[] = $this->__fileVersions[$file];
|
|
||||||
}
|
}
|
||||||
}
|
$occurances = implode("\n#: ", $occurances);
|
||||||
$occurances = join("\n#: ", $occured);
|
$header = '#: ' . str_replace($this->__paths, '', $occurances) . "\n";
|
||||||
$occurances = str_replace($this->path, '', $occurances);
|
|
||||||
$output = "#: $occurances\n";
|
|
||||||
$filename = $this->__filename;
|
|
||||||
|
|
||||||
if (strpos($str, "\0") === false) {
|
if (strpos($string, "\0") === false) {
|
||||||
$output .= "msgid \"$str\"\n";
|
$sentence = "msgid \"{$string}\"\n";
|
||||||
$output .= "msgstr \"\"\n";
|
$sentence .= "msgstr \"\"\n\n";
|
||||||
} else {
|
} else {
|
||||||
list($singular, $plural) = explode("\0", $str);
|
list($singular, $plural) = explode("\0", $string);
|
||||||
$output .= "msgid \"$singular\"\n";
|
$sentence = "msgid \"{$singular}\"\n";
|
||||||
$output .= "msgid_plural \"$plural\"\n";
|
$sentence .= "msgid_plural \"{$plural}\"\n";
|
||||||
$output .= "msgstr[0] \"\"\n";
|
$sentence .= "msgstr[0] \"\"\n";
|
||||||
$output .= "msgstr[1] \"\"\n";
|
$sentence .= "msgstr[1] \"\"\n\n";
|
||||||
}
|
}
|
||||||
$output .= "\n";
|
|
||||||
} else {
|
|
||||||
foreach ($fileInfo as $file => $lines) {
|
|
||||||
$filename = $str;
|
|
||||||
$occured = array("$str:" . join(';', $lines));
|
|
||||||
|
|
||||||
if (isset($this->__fileVersions[$str])) {
|
$this->__store($domain, $header, $sentence);
|
||||||
$fileList[] = $this->__fileVersions[$str];
|
if ($domain != 'default' && $this->__merge) {
|
||||||
}
|
$this->__store('default', $header, $sentence);
|
||||||
$occurances = join("\n#: ", $occured);
|
|
||||||
$occurances = str_replace($this->path, '', $occurances);
|
|
||||||
$output .= "#: $occurances\n";
|
|
||||||
|
|
||||||
if (strpos($file, "\0") === false) {
|
|
||||||
$output .= "msgid \"$file\"\n";
|
|
||||||
$output .= "msgstr \"\"\n";
|
|
||||||
} else {
|
|
||||||
list($singular, $plural) = explode("\0", $file);
|
|
||||||
$output .= "msgid \"$singular\"\n";
|
|
||||||
$output .= "msgid_plural \"$plural\"\n";
|
|
||||||
$output .= "msgstr[0] \"\"\n";
|
|
||||||
$output .= "msgstr[1] \"\"\n";
|
|
||||||
}
|
|
||||||
$output .= "\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->__store($filename, $output, $fileList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare a file to be stored
|
* Prepare a file to be stored
|
||||||
*
|
*
|
||||||
* @param string $file Filename
|
* @return void
|
||||||
* @param string $input What to store
|
|
||||||
* @param array $fileList File list
|
|
||||||
* @param integer $get Set to 1 to get files to store, false to set
|
|
||||||
* @return mixed If $get == 1, files to store, otherwise void
|
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __store($file = 0, $input = 0, $fileList = array(), $get = 0) {
|
function __store($domain, $header, $sentence) {
|
||||||
static $storage = array();
|
if (!isset($this->__storage[$domain])) {
|
||||||
|
$this->__storage[$domain] = array();
|
||||||
if (!$get) {
|
|
||||||
if (isset($storage[$file])) {
|
|
||||||
$storage[$file][1] = array_unique(array_merge($storage[$file][1], $fileList));
|
|
||||||
$storage[$file][] = $input;
|
|
||||||
} else {
|
|
||||||
$storage[$file] = array();
|
|
||||||
$storage[$file][0] = $this->__writeHeader();
|
|
||||||
$storage[$file][1] = $fileList;
|
|
||||||
$storage[$file][2] = $input;
|
|
||||||
}
|
}
|
||||||
|
if (!isset($this->__storage[$domain][$sentence])) {
|
||||||
|
$this->__storage[$domain][$sentence] = $header;
|
||||||
} else {
|
} else {
|
||||||
return $storage;
|
$this->__storage[$domain][$sentence] .= $header;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the files that need to be stored
|
* Write the files that need to be stored
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __writeFiles() {
|
function __writeFiles() {
|
||||||
$output = $this->__store(0, 0, array(), 1);
|
foreach ($this->__storage as $domain => $sentences) {
|
||||||
$output = $this->__mergeFiles($output);
|
$output = $this->__writeHeader();
|
||||||
|
foreach ($sentences as $sentence => $header) {
|
||||||
foreach ($output as $file => $content) {
|
$output .= $header . $sentence;
|
||||||
$tmp = str_replace(array($this->path, '.php','.ctp','.thtml', '.inc','.tpl' ), '', $file);
|
|
||||||
$tmp = str_replace(DS, '.', $tmp);
|
|
||||||
$file = str_replace('.', '-', $tmp) .'.pot';
|
|
||||||
$fileList = $content[1];
|
|
||||||
|
|
||||||
unset($content[1]);
|
|
||||||
|
|
||||||
$fileList = str_replace(array($this->path), '', $fileList);
|
|
||||||
|
|
||||||
if (count($fileList) > 1) {
|
|
||||||
$fileList = "Generated from files:\n# " . join("\n# ", $fileList);
|
|
||||||
} elseif (count($fileList) == 1) {
|
|
||||||
$fileList = 'Generated from file: ' . join('', $fileList);
|
|
||||||
} else {
|
|
||||||
$fileList = 'No version information was available in the source files.';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_file($this->__output . $file)) {
|
$filename = $domain . '.pot';
|
||||||
|
$File = new File($this->__output . $filename);
|
||||||
|
if ($File->exists()) {
|
||||||
$response = '';
|
$response = '';
|
||||||
while ($response == '') {
|
while ($response == '') {
|
||||||
$response = $this->in("\n\nError: ".$file . ' already exists in this location. Overwrite?', array('y','n', 'q'), 'n');
|
$this->out();
|
||||||
if (strtoupper($response) === 'Q') {
|
$response = $this->in(sprintf(__('Error: %s already exists in this location. Overwrite?', true), $filename), array('y', 'n'), 'y');
|
||||||
$this->out('Extract Aborted');
|
if (strtoupper($response) === 'N') {
|
||||||
$this->_stop();
|
|
||||||
} elseif (strtoupper($response) === 'N') {
|
|
||||||
$response = '';
|
$response = '';
|
||||||
while ($response == '') {
|
while ($response == '') {
|
||||||
$response = $this->in("What would you like to name this file?\nExample: new_" . $file, null, "new_" . $file);
|
$response = $this->in(sprintf(__("What would you like to name this file?\nExample: %s", true), 'new_' . $filename), null, 'new_' . $filename);
|
||||||
$file = $response;
|
$File = new File($this->__output . $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fp = fopen($this->__output . $file, 'w');
|
$File->write($output);
|
||||||
fwrite($fp, str_replace('--VERSIONS--', $fileList, join('', $content)));
|
$File->close();
|
||||||
fclose($fp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Merge output files
|
|
||||||
*
|
|
||||||
* @param array $output Output to merge
|
|
||||||
* @return array Merged output
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function __mergeFiles($output) {
|
|
||||||
foreach ($output as $file => $content) {
|
|
||||||
if (count($content) <= 1 && $file != $this->__filename) {
|
|
||||||
@$output[$this->__filename][1] = array_unique(array_merge($output[$this->__filename][1], $content[1]));
|
|
||||||
|
|
||||||
if (!isset($output[$this->__filename][0])) {
|
|
||||||
$output[$this->__filename][0] = $content[0];
|
|
||||||
}
|
|
||||||
unset($content[0]);
|
|
||||||
unset($content[1]);
|
|
||||||
|
|
||||||
foreach ($content as $msgid) {
|
|
||||||
$output[$this->__filename][] = $msgid;
|
|
||||||
}
|
|
||||||
unset($output[$file]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the translation template header
|
* Build the translation template header
|
||||||
*
|
*
|
||||||
|
@ -592,7 +405,6 @@ class ExtractTask extends Shell{
|
||||||
function __writeHeader() {
|
function __writeHeader() {
|
||||||
$output = "# LANGUAGE translation of CakePHP Application\n";
|
$output = "# LANGUAGE translation of CakePHP Application\n";
|
||||||
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
|
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
|
||||||
$output .= "# --VERSIONS--\n";
|
|
||||||
$output .= "#\n";
|
$output .= "#\n";
|
||||||
$output .= "#, fuzzy\n";
|
$output .= "#, fuzzy\n";
|
||||||
$output .= "msgid \"\"\n";
|
$output .= "msgid \"\"\n";
|
||||||
|
@ -609,21 +421,6 @@ class ExtractTask extends Shell{
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Find the version number of a file looking for SVN commands
|
|
||||||
*
|
|
||||||
* @param string $code Source code of file
|
|
||||||
* @param string $file File
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function __findVersion($code, $file) {
|
|
||||||
$header = '$Id' . ':';
|
|
||||||
if (preg_match('/\\' . $header . ' [\\w.]* ([\\d]*)/', $code, $versionInfo)) {
|
|
||||||
$version = str_replace(ROOT, '', 'Revision: ' . $versionInfo[1] . ' ' .$file);
|
|
||||||
$this->__fileVersions[$file] = $version;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format a string to be added as a translateable string
|
* Format a string to be added as a translateable string
|
||||||
*
|
*
|
||||||
|
@ -650,10 +447,11 @@ class ExtractTask extends Shell{
|
||||||
* @param integer $line Line number
|
* @param integer $line Line number
|
||||||
* @param string $marker Marker found
|
* @param string $marker Marker found
|
||||||
* @param integer $count Count
|
* @param integer $count Count
|
||||||
|
* @return void
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __markerError($file, $line, $marker, $count) {
|
function __markerError($file, $line, $marker, $count) {
|
||||||
$this->out("Invalid marker content in $file:$line\n* $marker(", true);
|
$this->out(sprintf(__("Invalid marker content in %s:%s\n* %s(", true), $file, $line, $marker), true);
|
||||||
$count += 2;
|
$count += 2;
|
||||||
$tokenCount = count($this->__tokens);
|
$tokenCount = count($this->__tokens);
|
||||||
$parenthesis = 1;
|
$parenthesis = 1;
|
||||||
|
@ -677,31 +475,17 @@ class ExtractTask extends Shell{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search the specified path for files that may contain translateable strings
|
* Search files that may contain translateable strings
|
||||||
*
|
*
|
||||||
* @param string $path Path (or set to null to use current)
|
* @return void
|
||||||
* @return array Files
|
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __searchDirectory($path = null) {
|
function __searchFiles() {
|
||||||
if ($path === null) {
|
foreach ($this->__paths as $path) {
|
||||||
$path = $this->path .DS;
|
$Folder = new Folder($path);
|
||||||
|
$files = $Folder->findRecursive('.*\.(php|ctp|thtml|inc|tpl)', true);
|
||||||
|
$this->__files += $files;
|
||||||
}
|
}
|
||||||
$files = glob("$path*.{php,ctp,thtml,inc,tpl}", GLOB_BRACE);
|
|
||||||
$dirs = glob("$path*", GLOB_ONLYDIR);
|
|
||||||
|
|
||||||
$files = $files ? $files : array();
|
|
||||||
$dirs = $dirs ? $dirs : array();
|
|
||||||
|
|
||||||
foreach ($dirs as $dir) {
|
|
||||||
if (!preg_match("!(^|.+/)(CVS|.svn)$!", $dir)) {
|
|
||||||
$files = array_merge($files, $this->__searchDirectory("$dir" . DS));
|
|
||||||
if (($id = array_search($dir . DS . 'extract.php', $files)) !== FALSE) {
|
|
||||||
unset($files[$id]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $files;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -4,19 +4,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc.
|
* Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.tasks
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
* @since CakePHP(tm) v 1.3
|
* @since CakePHP(tm) v 1.3
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,14 +54,16 @@ class FixtureTask extends Shell {
|
||||||
* The db connection being used for baking
|
* The db connection being used for baking
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
var $connection = null;
|
var $connection = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schema instance
|
* Schema instance
|
||||||
*
|
*
|
||||||
* @var object
|
* @var object
|
||||||
**/
|
* @access protected
|
||||||
|
*/
|
||||||
var $_Schema = null;
|
var $_Schema = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,9 +74,6 @@ class FixtureTask extends Shell {
|
||||||
function __construct(&$dispatch) {
|
function __construct(&$dispatch) {
|
||||||
parent::__construct($dispatch);
|
parent::__construct($dispatch);
|
||||||
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
|
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
|
||||||
if (!class_exists('CakeSchema')) {
|
|
||||||
App::import('Model', 'CakeSchema', false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,6 +88,7 @@ class FixtureTask extends Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->args[0])) {
|
if (isset($this->args[0])) {
|
||||||
|
$this->interactive = false;
|
||||||
if (!isset($this->connection)) {
|
if (!isset($this->connection)) {
|
||||||
$this->connection = 'default';
|
$this->connection = 'default';
|
||||||
}
|
}
|
||||||
|
@ -106,9 +105,10 @@ class FixtureTask extends Shell {
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function all() {
|
function all() {
|
||||||
$this->interactive = false;
|
$this->interactive = false;
|
||||||
|
$this->Model->interactive = false;
|
||||||
$tables = $this->Model->listAll($this->connection, false);
|
$tables = $this->Model->listAll($this->connection, false);
|
||||||
foreach ($tables as $table) {
|
foreach ($tables as $table) {
|
||||||
$model = $this->_modelName($table);
|
$model = $this->_modelName($table);
|
||||||
|
@ -142,7 +142,8 @@ class FixtureTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $modelName Name of model you are dealing with.
|
* @param string $modelName Name of model you are dealing with.
|
||||||
* @return array Array of import options.
|
* @return array Array of import options.
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function importOptions($modelName) {
|
function importOptions($modelName) {
|
||||||
$options = array();
|
$options = array();
|
||||||
$doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n');
|
$doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n');
|
||||||
|
@ -169,10 +170,13 @@ class FixtureTask extends Shell {
|
||||||
* @param string $model Name of model to bake.
|
* @param string $model Name of model to bake.
|
||||||
* @param string $useTable Name of table to use.
|
* @param string $useTable Name of table to use.
|
||||||
* @param array $importOptions Options for var $import
|
* @param array $importOptions Options for var $import
|
||||||
* @return string Baked fixture
|
* @return string Baked fixture content
|
||||||
* @access private
|
* @access public
|
||||||
*/
|
*/
|
||||||
function bake($model, $useTable = false, $importOptions = array()) {
|
function bake($model, $useTable = false, $importOptions = array()) {
|
||||||
|
if (!class_exists('CakeSchema')) {
|
||||||
|
App::import('Model', 'CakeSchema', false);
|
||||||
|
}
|
||||||
$table = $schema = $records = $import = $modelImport = $recordImport = null;
|
$table = $schema = $records = $import = $modelImport = $recordImport = null;
|
||||||
if (!$useTable) {
|
if (!$useTable) {
|
||||||
$useTable = Inflector::tableize($model);
|
$useTable = Inflector::tableize($model);
|
||||||
|
@ -215,7 +219,7 @@ class FixtureTask extends Shell {
|
||||||
}
|
}
|
||||||
$records = $this->_makeRecordString($this->_generateRecords($tableInfo, $recordCount));
|
$records = $this->_makeRecordString($this->_generateRecords($tableInfo, $recordCount));
|
||||||
}
|
}
|
||||||
if (isset($importOptions['fromTable'])) {
|
if (isset($this->params['records']) || isset($importOptions['fromTable'])) {
|
||||||
$records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable));
|
$records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable));
|
||||||
}
|
}
|
||||||
$out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields'));
|
$out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields'));
|
||||||
|
@ -227,9 +231,9 @@ class FixtureTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $model name of the model being generated
|
* @param string $model name of the model being generated
|
||||||
* @param string $fixture Contents of the fixture file.
|
* @param string $fixture Contents of the fixture file.
|
||||||
|
* @return string Content saved into fixture file.
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
*/
|
||||||
**/
|
|
||||||
function generateFixtureFile($model, $otherVars) {
|
function generateFixtureFile($model, $otherVars) {
|
||||||
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
|
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
|
||||||
$vars = array_merge($defaults, $otherVars);
|
$vars = array_merge($defaults, $otherVars);
|
||||||
|
@ -254,30 +258,11 @@ class FixtureTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param array $table Table schema array
|
* @param array $table Table schema array
|
||||||
* @return string fields definitions
|
* @return string fields definitions
|
||||||
**/
|
* @access protected
|
||||||
|
*/
|
||||||
function _generateSchema($tableInfo) {
|
function _generateSchema($tableInfo) {
|
||||||
$cols = array();
|
$schema = $this->_Schema->generateTable('f', $tableInfo);
|
||||||
$out = "array(\n";
|
return substr($schema, 10, -2);
|
||||||
foreach ($tableInfo as $field => $fieldInfo) {
|
|
||||||
if (is_array($fieldInfo)) {
|
|
||||||
if ($field != 'indexes') {
|
|
||||||
$col = "\t\t'{$field}' => array('type'=>'" . $fieldInfo['type'] . "', ";
|
|
||||||
$col .= join(', ', $this->_Schema->__values($fieldInfo));
|
|
||||||
} else {
|
|
||||||
$col = "\t\t'indexes' => array(";
|
|
||||||
$props = array();
|
|
||||||
foreach ((array)$fieldInfo as $key => $index) {
|
|
||||||
$props[] = "'{$key}' => array(".join(', ', $this->_Schema->__values($index)).")";
|
|
||||||
}
|
|
||||||
$col .= join(', ', $props);
|
|
||||||
}
|
|
||||||
$col .= ")";
|
|
||||||
$cols[] = $col;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$out .= join(",\n", $cols);
|
|
||||||
$out .= "\n\t)";
|
|
||||||
return $out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -285,7 +270,8 @@ class FixtureTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param array $table Table schema array
|
* @param array $table Table schema array
|
||||||
* @return array Array of records to use in the fixture.
|
* @return array Array of records to use in the fixture.
|
||||||
**/
|
* @access protected
|
||||||
|
*/
|
||||||
function _generateRecords($tableInfo, $recordCount = 1) {
|
function _generateRecords($tableInfo, $recordCount = 1) {
|
||||||
$records = array();
|
$records = array();
|
||||||
for ($i = 0; $i < $recordCount; $i++) {
|
for ($i = 0; $i < $recordCount; $i++) {
|
||||||
|
@ -296,9 +282,11 @@ class FixtureTask extends Shell {
|
||||||
}
|
}
|
||||||
switch ($fieldInfo['type']) {
|
switch ($fieldInfo['type']) {
|
||||||
case 'integer':
|
case 'integer':
|
||||||
|
case 'float':
|
||||||
$insert = $i + 1;
|
$insert = $i + 1;
|
||||||
break;
|
break;
|
||||||
case 'string';
|
case 'string':
|
||||||
|
case 'binary':
|
||||||
$isPrimaryUuid = (
|
$isPrimaryUuid = (
|
||||||
isset($fieldInfo['key']) && strtolower($fieldInfo['key']) == 'primary' &&
|
isset($fieldInfo['key']) && strtolower($fieldInfo['key']) == 'primary' &&
|
||||||
isset($fieldInfo['length']) && $fieldInfo['length'] == 36
|
isset($fieldInfo['length']) && $fieldInfo['length'] == 36
|
||||||
|
@ -354,7 +342,8 @@ class FixtureTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param array $records Array of records to be converted to string
|
* @param array $records Array of records to be converted to string
|
||||||
* @return string A string value of the $records array.
|
* @return string A string value of the $records array.
|
||||||
**/
|
* @access protected
|
||||||
|
*/
|
||||||
function _makeRecordString($records) {
|
function _makeRecordString($records) {
|
||||||
$out = "array(\n";
|
$out = "array(\n";
|
||||||
foreach ($records as $record) {
|
foreach ($records as $record) {
|
||||||
|
@ -377,13 +366,18 @@ class FixtureTask extends Shell {
|
||||||
* @param string $modelName name of the model to take records from.
|
* @param string $modelName name of the model to take records from.
|
||||||
* @param string $useTable Name of table to use.
|
* @param string $useTable Name of table to use.
|
||||||
* @return array Array of records.
|
* @return array Array of records.
|
||||||
**/
|
* @access protected
|
||||||
|
*/
|
||||||
function _getRecordsFromTable($modelName, $useTable = null) {
|
function _getRecordsFromTable($modelName, $useTable = null) {
|
||||||
|
if ($this->interactive) {
|
||||||
$condition = null;
|
$condition = null;
|
||||||
$prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10", true);
|
$prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10", true);
|
||||||
while (!$condition) {
|
while (!$condition) {
|
||||||
$condition = $this->in($prompt, null, 'WHERE 1=1 LIMIT 10');
|
$condition = $this->in($prompt, null, 'WHERE 1=1 LIMIT 10');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$condition = 'WHERE 1=1 ' . isset($this->params['count']) ? $this->params['count'] : 10;
|
||||||
|
}
|
||||||
App::import('Model', 'Model', false);
|
App::import('Model', 'Model', false);
|
||||||
$modelObject =& new Model(array('name' => $modelName, 'table' => $useTable, 'ds' => $this->connection));
|
$modelObject =& new Model(array('name' => $modelName, 'table' => $useTable, 'ds' => $this->connection));
|
||||||
$records = $modelObject->find('all', array(
|
$records = $modelObject->find('all', array(
|
||||||
|
@ -391,7 +385,7 @@ class FixtureTask extends Shell {
|
||||||
'recursive' => -1
|
'recursive' => -1
|
||||||
));
|
));
|
||||||
$db =& ConnectionManager::getDataSource($modelObject->useDbConfig);
|
$db =& ConnectionManager::getDataSource($modelObject->useDbConfig);
|
||||||
$schema = $modelObject->schema();
|
$schema = $modelObject->schema(true);
|
||||||
$out = array();
|
$out = array();
|
||||||
foreach ($records as $record) {
|
foreach ($records as $record) {
|
||||||
$row = array();
|
$row = array();
|
||||||
|
@ -412,15 +406,23 @@ class FixtureTask extends Shell {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out("Usage: cake bake fixture <arg1> <params>");
|
$this->out("Usage: cake bake fixture <arg1> <params>");
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
$this->out('Arguments:');
|
||||||
|
$this->out();
|
||||||
|
$this->out("<name>");
|
||||||
|
$this->out("\tName of the fixture to bake. Can use Plugin.name");
|
||||||
|
$this->out("\tas a shortcut for plugin baking.");
|
||||||
|
$this->out();
|
||||||
$this->out('Commands:');
|
$this->out('Commands:');
|
||||||
$this->out("\nfixture <name>\n\tbakes fixture with specified name.");
|
$this->out("\nfixture <name>\n\tbakes fixture with specified name.");
|
||||||
$this->out("\nfixture all\n\tbakes all fixtures.");
|
$this->out("\nfixture all\n\tbakes all fixtures.");
|
||||||
$this->out("");
|
$this->out();
|
||||||
$this->out('Parameters:');
|
$this->out('Parameters:');
|
||||||
$this->out("\t-count When using generated data, the number of records to include in the fixture(s).");
|
$this->out("\t-count When using generated data, the number of records to include in the fixture(s).");
|
||||||
$this->out("\t-connection Which database configuration to use for baking.");
|
$this->out("\t-connection Which database configuration to use for baking.");
|
||||||
$this->out("\t-plugin lowercased_underscored name of plugin to bake fixtures for.");
|
$this->out("\t-plugin CamelCased name of plugin to bake fixtures for.");
|
||||||
$this->out("");
|
$this->out("\t-records Used with -count and <name>/all commands to pull [n] records from the live tables");
|
||||||
|
$this->out("\t Where [n] is either -count or the default of 10.");
|
||||||
|
$this->out();
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,23 +2,20 @@
|
||||||
/**
|
/**
|
||||||
* The ModelTask handles creating and updating models files.
|
* The ModelTask handles creating and updating models files.
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.tasks
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
* @since CakePHP(tm) v 1.2
|
* @since CakePHP(tm) v 1.2
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,32 +62,24 @@ class ModelTask extends Shell {
|
||||||
* Holds tables found on connection.
|
* Holds tables found on connection.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
**/
|
*/
|
||||||
var $__tables = array();
|
var $__tables = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds validation method map.
|
* Holds validation method map.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
**/
|
*/
|
||||||
var $__validations = array();
|
var $__validations = array();
|
||||||
|
|
||||||
/**
|
|
||||||
* startup method
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
**/
|
|
||||||
function startup() {
|
|
||||||
App::import('Model', 'Model', false);
|
|
||||||
parent::startup();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execution method always used for tasks
|
* Execution method always used for tasks
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function execute() {
|
function execute() {
|
||||||
|
App::import('Model', 'Model', false);
|
||||||
|
|
||||||
if (empty($this->args)) {
|
if (empty($this->args)) {
|
||||||
$this->__interactive();
|
$this->__interactive();
|
||||||
}
|
}
|
||||||
|
@ -118,7 +107,7 @@ class ModelTask extends Shell {
|
||||||
* Bake all models at once.
|
* Bake all models at once.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function all() {
|
function all() {
|
||||||
$this->listAll($this->connection, false);
|
$this->listAll($this->connection, false);
|
||||||
$unitTestExists = $this->_checkUnitTest();
|
$unitTestExists = $this->_checkUnitTest();
|
||||||
|
@ -138,9 +127,12 @@ class ModelTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $className Name of class you want model to be.
|
* @param string $className Name of class you want model to be.
|
||||||
* @return object Model instance
|
* @return object Model instance
|
||||||
**/
|
*/
|
||||||
function &_getModelObject($className) {
|
function &_getModelObject($className, $table = null) {
|
||||||
$object = new Model(array('name' => $className, 'ds' => $this->connection));
|
if (!$table) {
|
||||||
|
$table = Inflector::tableize($className);
|
||||||
|
}
|
||||||
|
$object =& new Model(array('name' => $className, 'table' => $table, 'ds' => $this->connection));
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +143,7 @@ class ModelTask extends Shell {
|
||||||
* @param string $prompt Prompt to use for options list.
|
* @param string $prompt Prompt to use for options list.
|
||||||
* @param integer $default The default option for the given prompt.
|
* @param integer $default The default option for the given prompt.
|
||||||
* @return result of user choice.
|
* @return result of user choice.
|
||||||
**/
|
*/
|
||||||
function inOptions($options, $prompt = null, $default = null) {
|
function inOptions($options, $prompt = null, $default = null) {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
$max = count($options);
|
$max = count($options);
|
||||||
|
@ -194,7 +186,7 @@ class ModelTask extends Shell {
|
||||||
|
|
||||||
if (in_array($useTable, $this->__tables)) {
|
if (in_array($useTable, $this->__tables)) {
|
||||||
$tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection));
|
$tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection));
|
||||||
$fields = $tempModel->schema();
|
$fields = $tempModel->schema(true);
|
||||||
if (!array_key_exists('id', $fields)) {
|
if (!array_key_exists('id', $fields)) {
|
||||||
$primaryKey = $this->findPrimaryKey($fields);
|
$primaryKey = $this->findPrimaryKey($fields);
|
||||||
}
|
}
|
||||||
|
@ -220,7 +212,7 @@ class ModelTask extends Shell {
|
||||||
$associations = $this->doAssociations($tempModel);
|
$associations = $this->doAssociations($tempModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__('The following Model will be created:', true));
|
$this->out(__('The following Model will be created:', true));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
@ -271,7 +263,7 @@ class ModelTask extends Shell {
|
||||||
* @param string $associations Collection of associations.
|
* @param string $associations Collection of associations.
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function _printAssociation($modelName, $type, $associations) {
|
function _printAssociation($modelName, $type, $associations) {
|
||||||
if (!empty($associations[$type])) {
|
if (!empty($associations[$type])) {
|
||||||
for ($i = 0; $i < count($associations[$type]); $i++) {
|
for ($i = 0; $i < count($associations[$type]); $i++) {
|
||||||
|
@ -287,7 +279,7 @@ class ModelTask extends Shell {
|
||||||
* @param array $fields Array of fields that might have a primary key.
|
* @param array $fields Array of fields that might have a primary key.
|
||||||
* @return string Name of field that is a primary key.
|
* @return string Name of field that is a primary key.
|
||||||
* @access public
|
* @access public
|
||||||
**/
|
*/
|
||||||
function findPrimaryKey($fields) {
|
function findPrimaryKey($fields) {
|
||||||
foreach ($fields as $name => $field) {
|
foreach ($fields as $name => $field) {
|
||||||
if (isset($field['key']) && $field['key'] == 'primary') {
|
if (isset($field['key']) && $field['key'] == 'primary') {
|
||||||
|
@ -302,7 +294,7 @@ class ModelTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param array $fields Array of fields to look for and choose as a displayField
|
* @param array $fields Array of fields to look for and choose as a displayField
|
||||||
* @return mixed Name of field to use for displayField or false if the user declines to choose
|
* @return mixed Name of field to use for displayField or false if the user declines to choose
|
||||||
**/
|
*/
|
||||||
function findDisplayField($fields) {
|
function findDisplayField($fields) {
|
||||||
$fieldNames = array_keys($fields);
|
$fieldNames = array_keys($fields);
|
||||||
$prompt = __("A displayField could not be automatically detected\nwould you like to choose one?", true);
|
$prompt = __("A displayField could not be automatically detected\nwould you like to choose one?", true);
|
||||||
|
@ -346,12 +338,13 @@ class ModelTask extends Shell {
|
||||||
* Populate the __validations array
|
* Populate the __validations array
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function initValidations() {
|
function initValidations() {
|
||||||
$options = $choices = array();
|
$options = $choices = array();
|
||||||
if (class_exists('Validation')) {
|
if (class_exists('Validation')) {
|
||||||
$parent = get_class_methods(get_parent_class('Validation'));
|
$parent = get_class_methods(get_parent_class('Validation'));
|
||||||
$options = array_diff(get_class_methods('Validation'), $parent);
|
$options = get_class_methods('Validation');
|
||||||
|
$options = array_diff($options, $parent);
|
||||||
}
|
}
|
||||||
sort($options);
|
sort($options);
|
||||||
$default = 1;
|
$default = 1;
|
||||||
|
@ -371,7 +364,7 @@ class ModelTask extends Shell {
|
||||||
* @param string $fieldName Name of field to be validated.
|
* @param string $fieldName Name of field to be validated.
|
||||||
* @param array $metaData metadata for field
|
* @param array $metaData metadata for field
|
||||||
* @return array Array of validation for the field.
|
* @return array Array of validation for the field.
|
||||||
**/
|
*/
|
||||||
function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
|
function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
|
||||||
$defaultChoice = count($this->__validations);
|
$defaultChoice = count($this->__validations);
|
||||||
$validate = $alreadyChosen = array();
|
$validate = $alreadyChosen = array();
|
||||||
|
@ -379,7 +372,7 @@ class ModelTask extends Shell {
|
||||||
$anotherValidator = 'y';
|
$anotherValidator = 'y';
|
||||||
while ($anotherValidator == 'y') {
|
while ($anotherValidator == 'y') {
|
||||||
if ($this->interactive) {
|
if ($this->interactive) {
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out(sprintf(__('Field: %s', true), $fieldName));
|
$this->out(sprintf(__('Field: %s', true), $fieldName));
|
||||||
$this->out(sprintf(__('Type: %s', true), $metaData['type']));
|
$this->out(sprintf(__('Type: %s', true), $metaData['type']));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
@ -405,7 +398,7 @@ class ModelTask extends Shell {
|
||||||
$guess = $methods['numeric'];
|
$guess = $methods['numeric'];
|
||||||
} elseif ($metaData['type'] == 'boolean') {
|
} elseif ($metaData['type'] == 'boolean') {
|
||||||
$guess = $methods['boolean'];
|
$guess = $methods['boolean'];
|
||||||
} elseif ($metaData['type'] == 'datetime' || $metaData['type'] == 'date') {
|
} elseif ($metaData['type'] == 'date') {
|
||||||
$guess = $methods['date'];
|
$guess = $methods['date'];
|
||||||
} elseif ($metaData['type'] == 'time') {
|
} elseif ($metaData['type'] == 'time') {
|
||||||
$guess = $methods['time'];
|
$guess = $methods['time'];
|
||||||
|
@ -454,7 +447,7 @@ class ModelTask extends Shell {
|
||||||
$this->out(__('One moment while the associations are detected.', true));
|
$this->out(__('One moment while the associations are detected.', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = $model->schema();
|
$fields = $model->schema(true);
|
||||||
if (empty($fields)) {
|
if (empty($fields)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -492,9 +485,9 @@ class ModelTask extends Shell {
|
||||||
* @param object $model Model instance of model being generated.
|
* @param object $model Model instance of model being generated.
|
||||||
* @param array $associations Array of inprogress associations
|
* @param array $associations Array of inprogress associations
|
||||||
* @return array $associations with belongsTo added in.
|
* @return array $associations with belongsTo added in.
|
||||||
**/
|
*/
|
||||||
function findBelongsTo(&$model, $associations) {
|
function findBelongsTo(&$model, $associations) {
|
||||||
$fields = $model->schema();
|
$fields = $model->schema(true);
|
||||||
foreach ($fields as $fieldName => $field) {
|
foreach ($fields as $fieldName => $field) {
|
||||||
$offset = strpos($fieldName, '_id');
|
$offset = strpos($fieldName, '_id');
|
||||||
if ($fieldName != $model->primaryKey && $fieldName != 'parent_id' && $offset !== false) {
|
if ($fieldName != $model->primaryKey && $fieldName != 'parent_id' && $offset !== false) {
|
||||||
|
@ -521,11 +514,11 @@ class ModelTask extends Shell {
|
||||||
* @param object $model Model instance being generated
|
* @param object $model Model instance being generated
|
||||||
* @param array $associations Array of inprogress associations
|
* @param array $associations Array of inprogress associations
|
||||||
* @return array $associations with hasOne and hasMany added in.
|
* @return array $associations with hasOne and hasMany added in.
|
||||||
**/
|
*/
|
||||||
function findHasOneAndMany(&$model, $associations) {
|
function findHasOneAndMany(&$model, $associations) {
|
||||||
$foreignKey = $this->_modelKey($model->name);
|
$foreignKey = $this->_modelKey($model->name);
|
||||||
foreach ($this->__tables as $otherTable) {
|
foreach ($this->__tables as $otherTable) {
|
||||||
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable));
|
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable);
|
||||||
$modelFieldsTemp = $tempOtherModel->schema();
|
$modelFieldsTemp = $tempOtherModel->schema();
|
||||||
|
|
||||||
$pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/';
|
$pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/';
|
||||||
|
@ -564,12 +557,12 @@ class ModelTask extends Shell {
|
||||||
* @param object $model Model instance being generated
|
* @param object $model Model instance being generated
|
||||||
* @param array $associations Array of inprogress associations
|
* @param array $associations Array of inprogress associations
|
||||||
* @return array $associations with hasAndBelongsToMany added in.
|
* @return array $associations with hasAndBelongsToMany added in.
|
||||||
**/
|
*/
|
||||||
function findHasAndBelongsToMany(&$model, $associations) {
|
function findHasAndBelongsToMany(&$model, $associations) {
|
||||||
$foreignKey = $this->_modelKey($model->name);
|
$foreignKey = $this->_modelKey($model->name);
|
||||||
foreach ($this->__tables as $otherTable) {
|
foreach ($this->__tables as $otherTable) {
|
||||||
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable));
|
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable);
|
||||||
$modelFieldsTemp = $tempOtherModel->schema();
|
$modelFieldsTemp = $tempOtherModel->schema(true);
|
||||||
|
|
||||||
$offset = strpos($otherTable, $model->table . '_');
|
$offset = strpos($otherTable, $model->table . '_');
|
||||||
$otherOffset = strpos($otherTable, '_' . $model->table);
|
$otherOffset = strpos($otherTable, '_' . $model->table);
|
||||||
|
@ -604,17 +597,17 @@ class ModelTask extends Shell {
|
||||||
* @param array $model Temporary Model instance.
|
* @param array $model Temporary Model instance.
|
||||||
* @param array $associations Array of associations to be confirmed.
|
* @param array $associations Array of associations to be confirmed.
|
||||||
* @return array Array of confirmed associations
|
* @return array Array of confirmed associations
|
||||||
**/
|
*/
|
||||||
function confirmAssociations(&$model, $associations) {
|
function confirmAssociations(&$model, $associations) {
|
||||||
foreach ($associations as $type => $settings) {
|
foreach ($associations as $type => $settings) {
|
||||||
if (!empty($associations[$type])) {
|
if (!empty($associations[$type])) {
|
||||||
$count = count($associations[$type]);
|
$count = count($associations[$type]);
|
||||||
$response = 'y';
|
$response = 'y';
|
||||||
for ($i = 0; $i < $count; $i++) {
|
foreach ($associations[$type] as $i => $assoc) {
|
||||||
$prompt = "{$model->name} {$type} {$associations[$type][$i]['alias']}";
|
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
|
||||||
$response = $this->in("{$prompt}?", array('y','n'), 'y');
|
$response = $this->in($prompt, array('y','n'), 'y');
|
||||||
|
|
||||||
if ('n' == low($response)) {
|
if ('n' == strtolower($response)) {
|
||||||
unset($associations[$type][$i]);
|
unset($associations[$type][$i]);
|
||||||
} elseif ($type == 'hasMany') {
|
} elseif ($type == 'hasMany') {
|
||||||
unset($associations['hasOne'][$i]);
|
unset($associations['hasOne'][$i]);
|
||||||
|
@ -632,12 +625,12 @@ class ModelTask extends Shell {
|
||||||
* @param object $model Temporary model instance
|
* @param object $model Temporary model instance
|
||||||
* @param array $associations Array of associations.
|
* @param array $associations Array of associations.
|
||||||
* @return array Array of associations.
|
* @return array Array of associations.
|
||||||
**/
|
*/
|
||||||
function doMoreAssociations($model, $associations) {
|
function doMoreAssociations($model, $associations) {
|
||||||
$prompt = __('Would you like to define some additional model associations?', true);
|
$prompt = __('Would you like to define some additional model associations?', true);
|
||||||
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
|
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
|
||||||
$possibleKeys = $this->_generatePossibleKeys();
|
$possibleKeys = $this->_generatePossibleKeys();
|
||||||
while (low($wannaDoMoreAssoc) == 'y') {
|
while (strtolower($wannaDoMoreAssoc) == 'y') {
|
||||||
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
||||||
$this->out(__('What is the association type?', true));
|
$this->out(__('What is the association type?', true));
|
||||||
$assocType = intval($this->inOptions($assocs, __('Enter a number',true)));
|
$assocType = intval($this->inOptions($assocs, __('Enter a number',true)));
|
||||||
|
@ -697,12 +690,12 @@ class ModelTask extends Shell {
|
||||||
* Finds all possible keys to use on custom associations.
|
* Finds all possible keys to use on custom associations.
|
||||||
*
|
*
|
||||||
* @return array array of tables and possible keys
|
* @return array array of tables and possible keys
|
||||||
**/
|
*/
|
||||||
function _generatePossibleKeys() {
|
function _generatePossibleKeys() {
|
||||||
$possible = array();
|
$possible = array();
|
||||||
foreach ($this->__tables as $otherTable) {
|
foreach ($this->__tables as $otherTable) {
|
||||||
$tempOtherModel = & new Model(array('table' => $otherTable, 'ds' => $this->connection));
|
$tempOtherModel = & new Model(array('table' => $otherTable, 'ds' => $this->connection));
|
||||||
$modelFieldsTemp = $tempOtherModel->schema();
|
$modelFieldsTemp = $tempOtherModel->schema(true);
|
||||||
foreach ($modelFieldsTemp as $fieldName => $field) {
|
foreach ($modelFieldsTemp as $fieldName => $field) {
|
||||||
if ($field['type'] == 'integer' || $field['type'] == 'string') {
|
if ($field['type'] == 'integer' || $field['type'] == 'string') {
|
||||||
$possible[$otherTable][] = $fieldName;
|
$possible[$otherTable][] = $fieldName;
|
||||||
|
@ -790,18 +783,20 @@ class ModelTask extends Shell {
|
||||||
* @param string $modelName Name of the model you want a table for.
|
* @param string $modelName Name of the model you want a table for.
|
||||||
* @param string $useDbConfig Name of the database config you want to get tables from.
|
* @param string $useDbConfig Name of the database config you want to get tables from.
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function getTable($modelName, $useDbConfig = null) {
|
function getTable($modelName, $useDbConfig = null) {
|
||||||
if (!isset($useDbConfig)) {
|
if (!isset($useDbConfig)) {
|
||||||
$useDbConfig = $this->connection;
|
$useDbConfig = $this->connection;
|
||||||
}
|
}
|
||||||
|
App::import('Model', 'ConnectionManager', false);
|
||||||
|
|
||||||
$db =& ConnectionManager::getDataSource($useDbConfig);
|
$db =& ConnectionManager::getDataSource($useDbConfig);
|
||||||
$useTable = Inflector::tableize($modelName);
|
$useTable = Inflector::tableize($modelName);
|
||||||
$fullTableName = $db->fullTableName($useTable, false);
|
$fullTableName = $db->fullTableName($useTable, false);
|
||||||
$tableIsGood = false;
|
$tableIsGood = false;
|
||||||
|
|
||||||
if (array_search($useTable, $this->__tables) === false) {
|
if (array_search($useTable, $this->__tables) === false) {
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out(sprintf(__("Given your model named '%s',\nCake would expect a database table named '%s'", true), $modelName, $fullTableName));
|
$this->out(sprintf(__("Given your model named '%s',\nCake would expect a database table named '%s'", true), $modelName, $fullTableName));
|
||||||
$tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y');
|
$tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y');
|
||||||
}
|
}
|
||||||
|
@ -817,13 +812,16 @@ class ModelTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $useDbConfig Connection name to scan.
|
* @param string $useDbConfig Connection name to scan.
|
||||||
* @return array Array of tables in the database.
|
* @return array Array of tables in the database.
|
||||||
**/
|
*/
|
||||||
function getAllTables($useDbConfig = null) {
|
function getAllTables($useDbConfig = null) {
|
||||||
if (!isset($useDbConfig)) {
|
if (!isset($useDbConfig)) {
|
||||||
$useDbConfig = $this->connection;
|
$useDbConfig = $this->connection;
|
||||||
}
|
}
|
||||||
|
App::import('Model', 'ConnectionManager', false);
|
||||||
|
|
||||||
$tables = array();
|
$tables = array();
|
||||||
$db =& ConnectionManager::getDataSource($useDbConfig);
|
$db =& ConnectionManager::getDataSource($useDbConfig);
|
||||||
|
$db->cacheSources = false;
|
||||||
$usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix'];
|
$usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix'];
|
||||||
if ($usePrefix) {
|
if ($usePrefix) {
|
||||||
foreach ($db->listSources() as $table) {
|
foreach ($db->listSources() as $table) {
|
||||||
|
@ -882,17 +880,23 @@ class ModelTask extends Shell {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out("Usage: cake bake model <arg1>");
|
$this->out("Usage: cake bake model <arg1>");
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
$this->out('Arguments:');
|
||||||
|
$this->out();
|
||||||
|
$this->out("<name>");
|
||||||
|
$this->out("\tName of the model to bake. Can use Plugin.name");
|
||||||
|
$this->out("\tas a shortcut for plugin baking.");
|
||||||
|
$this->out();
|
||||||
$this->out('Commands:');
|
$this->out('Commands:');
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("model");
|
$this->out("model");
|
||||||
$this->out("\tbakes model in interactive mode.");
|
$this->out("\tbakes model in interactive mode.");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("model <name>");
|
$this->out("model <name>");
|
||||||
$this->out("\tbakes model file with no associations or validation");
|
$this->out("\tbakes model file with no associations or validation");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("model all");
|
$this->out("model all");
|
||||||
$this->out("\tbakes all model files with associations and validation");
|
$this->out("\tbakes all model files with associations and validation");
|
||||||
$this->out("");
|
$this->out();
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,7 +908,7 @@ class ModelTask extends Shell {
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
* @see FixtureTask::bake
|
* @see FixtureTask::bake
|
||||||
**/
|
*/
|
||||||
function bakeFixture($className, $useTable = null) {
|
function bakeFixture($className, $useTable = null) {
|
||||||
$this->Fixture->connection = $this->connection;
|
$this->Fixture->connection = $this->connection;
|
||||||
$this->Fixture->plugin = $this->plugin;
|
$this->Fixture->plugin = $this->plugin;
|
||||||
|
|
|
@ -2,23 +2,20 @@
|
||||||
/**
|
/**
|
||||||
* The Plugin Task handles creating an empty plugin, ready to be used
|
* The Plugin Task handles creating an empty plugin, ready to be used
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.tasks
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
* @since CakePHP(tm) v 1.2
|
* @since CakePHP(tm) v 1.2
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,6 +142,7 @@ class PluginTask extends Shell {
|
||||||
'models' . DS . 'behaviors',
|
'models' . DS . 'behaviors',
|
||||||
'models' . DS . 'datasources',
|
'models' . DS . 'datasources',
|
||||||
'controllers' . DS . 'components',
|
'controllers' . DS . 'components',
|
||||||
|
'libs',
|
||||||
'views' . DS . 'helpers',
|
'views' . DS . 'helpers',
|
||||||
'tests' . DS . 'cases' . DS . 'components',
|
'tests' . DS . 'cases' . DS . 'components',
|
||||||
'tests' . DS . 'cases' . DS . 'helpers',
|
'tests' . DS . 'cases' . DS . 'helpers',
|
||||||
|
@ -153,10 +151,9 @@ class PluginTask extends Shell {
|
||||||
'tests' . DS . 'cases' . DS . 'models',
|
'tests' . DS . 'cases' . DS . 'models',
|
||||||
'tests' . DS . 'groups',
|
'tests' . DS . 'groups',
|
||||||
'tests' . DS . 'fixtures',
|
'tests' . DS . 'fixtures',
|
||||||
'vendors' . DS . 'img',
|
'vendors',
|
||||||
'vendors' . DS . 'js',
|
'vendors' . DS . 'shells' . DS . 'tasks',
|
||||||
'vendors' . DS . 'css',
|
'webroot'
|
||||||
'vendors' . DS . 'shells' . DS . 'tasks'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($directories as $directory) {
|
foreach ($directories as $directory) {
|
||||||
|
@ -204,7 +201,7 @@ class PluginTask extends Shell {
|
||||||
* find and change $this->path to the user selection
|
* find and change $this->path to the user selection
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function findPath($pathOptions) {
|
function findPath($pathOptions) {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
$max = count($pathOptions);
|
$max = count($pathOptions);
|
||||||
|
@ -232,19 +229,19 @@ class PluginTask extends Shell {
|
||||||
$this->out("Usage: cake bake plugin <arg1> <arg2>...");
|
$this->out("Usage: cake bake plugin <arg1> <arg2>...");
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out('Commands:');
|
$this->out('Commands:');
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("plugin <name>");
|
$this->out("plugin <name>");
|
||||||
$this->out("\tbakes plugin directory structure");
|
$this->out("\tbakes plugin directory structure");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("plugin <name> model");
|
$this->out("plugin <name> model");
|
||||||
$this->out("\tbakes model. Run 'cake bake model help' for more info.");
|
$this->out("\tbakes model. Run 'cake bake model help' for more info.");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("plugin <name> controller");
|
$this->out("plugin <name> controller");
|
||||||
$this->out("\tbakes controller. Run 'cake bake controller help' for more info.");
|
$this->out("\tbakes controller. Run 'cake bake controller help' for more info.");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("plugin <name> view");
|
$this->out("plugin <name> view");
|
||||||
$this->out("\tbakes view. Run 'cake bake view help' for more info.");
|
$this->out("\tbakes view. Run 'cake bake view help' for more info.");
|
||||||
$this->out("");
|
$this->out();
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,21 +5,19 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.bake
|
* @subpackage cake.cake.console.bake
|
||||||
* @since CakePHP(tm) v 1.2
|
* @since CakePHP(tm) v 1.2
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Task class for creating new project apps and plugins
|
* Task class for creating new project apps and plugins
|
||||||
*
|
*
|
||||||
|
@ -32,7 +30,7 @@ class ProjectTask extends Shell {
|
||||||
* configs path (used in testing).
|
* configs path (used in testing).
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
**/
|
*/
|
||||||
var $configPath = null;
|
var $configPath = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +44,6 @@ class ProjectTask extends Shell {
|
||||||
if ($project === null) {
|
if ($project === null) {
|
||||||
if (isset($this->args[0])) {
|
if (isset($this->args[0])) {
|
||||||
$project = $this->args[0];
|
$project = $this->args[0];
|
||||||
$this->Dispatch->shiftArgs();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,19 +54,22 @@ class ProjectTask extends Shell {
|
||||||
|
|
||||||
if (empty($this->params['skel'])) {
|
if (empty($this->params['skel'])) {
|
||||||
$this->params['skel'] = '';
|
$this->params['skel'] = '';
|
||||||
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
|
if (is_dir(CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
|
||||||
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
|
$this->params['skel'] = CAKE . 'console' . DS . 'templates' . DS . 'skel';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!$project) {
|
while (!$project) {
|
||||||
$project = $this->in("What is the full path for this app including the app directory name?\nExample: ".$this->params['working'] . DS . "myapp", null, $this->params['working'] . DS . 'myapp');
|
$prompt = __("What is the full path for this app including the app directory name?\n Example:", true);
|
||||||
|
$default = $this->params['working'] . DS . 'myapp';
|
||||||
|
$project = $this->in($prompt . $default, null, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($project) {
|
if ($project) {
|
||||||
$response = false;
|
$response = false;
|
||||||
while ($response == false && is_dir($project) === true && file_exists($project . 'config' . 'core.php')) {
|
while ($response == false && is_dir($project) === true && file_exists($project . 'config' . 'core.php')) {
|
||||||
$response = $this->in('A project already exists in this location: ' . $project . ' Overwrite?', array('y','n'), 'n');
|
$prompt = sprintf(__('A project already exists in this location: %s Overwrite?', true), $project);
|
||||||
|
$response = $this->in($prompt, array('y','n'), 'n');
|
||||||
if (strtolower($response) === 'n') {
|
if (strtolower($response) === 'n') {
|
||||||
$response = $project = false;
|
$response = $project = false;
|
||||||
}
|
}
|
||||||
|
@ -138,23 +138,26 @@ class ProjectTask extends Shell {
|
||||||
|
|
||||||
$app = basename($path);
|
$app = basename($path);
|
||||||
|
|
||||||
$this->out('Bake Project');
|
$this->out(__('Bake Project', true));
|
||||||
$this->out("Skel Directory: $skel");
|
$this->out(__("Skel Directory: ", true) . $skel);
|
||||||
$this->out("Will be copied to: {$path}");
|
$this->out(__("Will be copied to: ", true) . $path);
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
|
||||||
$looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y');
|
$looksGood = $this->in(__('Look okay?', true), array('y', 'n', 'q'), 'y');
|
||||||
|
|
||||||
if (strtolower($looksGood) == 'y') {
|
if (strtolower($looksGood) == 'y') {
|
||||||
$verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n');
|
$verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n');
|
||||||
|
|
||||||
$Folder = new Folder($skel);
|
$Folder = new Folder($skel);
|
||||||
|
if (!empty($this->params['empty'])) {
|
||||||
|
$skip = array();
|
||||||
|
}
|
||||||
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
|
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(sprintf(__("Created: %s in %s", true), $app, $path));
|
$this->out(sprintf(__("Created: %s in %s", true), $app, $path));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
} else {
|
} else {
|
||||||
$this->err(" '" . $app . "' could not be created properly");
|
$this->err(sprintf(__(" '%s' could not be created properly", true), $app));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +169,7 @@ class ProjectTask extends Shell {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} elseif (strtolower($looksGood) == 'q') {
|
} elseif (strtolower($looksGood) == 'q') {
|
||||||
$this->out('Bake Aborted.');
|
$this->out(__('Bake Aborted.', true));
|
||||||
} else {
|
} else {
|
||||||
$this->execute(false);
|
$this->execute(false);
|
||||||
return false;
|
return false;
|
||||||
|
@ -183,7 +186,7 @@ class ProjectTask extends Shell {
|
||||||
function createHome($dir) {
|
function createHome($dir) {
|
||||||
$app = basename($dir);
|
$app = basename($dir);
|
||||||
$path = $dir . 'views' . DS . 'pages' . DS;
|
$path = $dir . 'views' . DS . 'pages' . DS;
|
||||||
$source = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
|
$source = CAKE . 'console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
|
||||||
include($source);
|
include($source);
|
||||||
return $this->createFile($path.'home.ctp', $output);
|
return $this->createFile($path.'home.ctp', $output);
|
||||||
}
|
}
|
||||||
|
@ -224,7 +227,8 @@ class ProjectTask extends Shell {
|
||||||
$File =& new File($path . 'webroot' . DS . 'index.php');
|
$File =& new File($path . 'webroot' . DS . 'index.php');
|
||||||
$contents = $File->read();
|
$contents = $File->read();
|
||||||
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
|
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
|
||||||
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
|
$root = strpos(CAKE_CORE_INCLUDE_PATH, '/') === 0 ? " DS . '" : "'";
|
||||||
|
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', " . $root . str_replace(DS, "' . DS . '", trim(CAKE_CORE_INCLUDE_PATH, DS)) . "');", $contents);
|
||||||
if (!$File->write($result)) {
|
if (!$File->write($result)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -235,7 +239,7 @@ class ProjectTask extends Shell {
|
||||||
$File =& new File($path . 'webroot' . DS . 'test.php');
|
$File =& new File($path . 'webroot' . DS . 'test.php');
|
||||||
$contents = $File->read();
|
$contents = $File->read();
|
||||||
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
|
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
|
||||||
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
|
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', " . $root . str_replace(DS, "' . DS . '", trim(CAKE_CORE_INCLUDE_PATH, DS)) . "');", $contents);
|
||||||
if (!$File->write($result)) {
|
if (!$File->write($result)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -247,7 +251,7 @@ class ProjectTask extends Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables Configure::read('Routing.admin') in /app/config/core.php
|
* Enables Configure::read('Routing.prefixes') in /app/config/core.php
|
||||||
*
|
*
|
||||||
* @param string $name Name to use as admin routing
|
* @param string $name Name to use as admin routing
|
||||||
* @return boolean Success
|
* @return boolean Success
|
||||||
|
@ -257,10 +261,10 @@ class ProjectTask extends Shell {
|
||||||
$path = (empty($this->configPath)) ? CONFIGS : $this->configPath;
|
$path = (empty($this->configPath)) ? CONFIGS : $this->configPath;
|
||||||
$File =& new File($path . 'core.php');
|
$File =& new File($path . 'core.php');
|
||||||
$contents = $File->read();
|
$contents = $File->read();
|
||||||
if (preg_match('%([/\\t\\x20]*Configure::write\(\'Routing.admin\',[\\t\\x20\'a-z]*\\);)%', $contents, $match)) {
|
if (preg_match('%([/\\t\\x20]*Configure::write\(\'Routing.prefixes\',[\\t\\x20\'a-z,\)\(]*\\);)%', $contents, $match)) {
|
||||||
$result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.admin\', \''.$name.'\');', $contents);
|
$result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.prefixes\', array(\''.$name.'\'));', $contents);
|
||||||
if ($File->write($result)) {
|
if ($File->write($result)) {
|
||||||
Configure::write('Routing.admin', $name);
|
Configure::write('Routing.prefixes', array($name));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -271,31 +275,49 @@ class ProjectTask extends Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks for Configure::read('Routing.admin') and forces user to input it if not enabled
|
* Checks for Configure::read('Routing.prefixes') and forces user to input it if not enabled
|
||||||
*
|
*
|
||||||
* @return string Admin route to use
|
* @return string Admin route to use
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function getAdmin() {
|
function getPrefix() {
|
||||||
$admin = '';
|
$admin = '';
|
||||||
$cakeAdmin = null;
|
$prefixes = Configure::read('Routing.prefixes');
|
||||||
$adminRoute = Configure::read('Routing.admin');
|
if (!empty($prefixes)) {
|
||||||
if (!empty($adminRoute)) {
|
if ($this->interactive) {
|
||||||
return $adminRoute . '_';
|
$this->out();
|
||||||
|
$this->out(__('You have more than one routing prefix configured', true));
|
||||||
}
|
}
|
||||||
$this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.');
|
if (count($prefixes) == 1) {
|
||||||
$this->out('What would you like the admin route to be?');
|
return $prefixes[0] . '_';
|
||||||
$this->out('Example: www.example.com/admin/controller');
|
}
|
||||||
|
$options = array();
|
||||||
|
foreach ($prefixes as $i => $prefix) {
|
||||||
|
$options[] = $i + 1;
|
||||||
|
if ($this->interactive) {
|
||||||
|
$this->out($i + 1 . '. ' . $prefix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$selection = $this->in(__('Please choose a prefix to bake with.', true), $options, 1);
|
||||||
|
return $prefixes[$selection - 1] . '_';
|
||||||
|
}
|
||||||
|
if ($this->interactive) {
|
||||||
|
$this->hr();
|
||||||
|
$this->out('You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/config/core.php to use prefix routing.');
|
||||||
|
$this->out(__('What would you like the prefix route to be?', true));
|
||||||
|
$this->out(__('Example: www.example.com/admin/controller', true));
|
||||||
while ($admin == '') {
|
while ($admin == '') {
|
||||||
$admin = $this->in("What would you like the admin route to be?", null, 'admin');
|
$admin = $this->in(__("Enter a routing prefix:", true), null, 'admin');
|
||||||
}
|
}
|
||||||
if ($this->cakeAdmin($admin) !== true) {
|
if ($this->cakeAdmin($admin) !== true) {
|
||||||
$this->out('Unable to write to /app/config/core.php.');
|
$this->out(__('Unable to write to /app/config/core.php.', true));
|
||||||
$this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.');
|
$this->out('You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/config/core.php to use prefix routing.');
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
return $admin . '_';
|
return $admin . '_';
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Help
|
* Help
|
||||||
|
@ -308,11 +330,11 @@ class ProjectTask extends Shell {
|
||||||
$this->out("Usage: cake bake project <arg1>");
|
$this->out("Usage: cake bake project <arg1>");
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out('Commands:');
|
$this->out('Commands:');
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("project <name>");
|
$this->out("project <name>");
|
||||||
$this->out("\tbakes app directory structure.");
|
$this->out("\tbakes app directory structure.");
|
||||||
$this->out("\tif <name> begins with '/' path is absolute.");
|
$this->out("\tif <name> begins with '/' path is absolute.");
|
||||||
$this->out("");
|
$this->out();
|
||||||
$this->_stop();
|
$this->_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ class TemplateTask extends Shell {
|
||||||
* variables to add to template scope
|
* variables to add to template scope
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
**/
|
*/
|
||||||
var $templateVars = array();
|
var $templateVars = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,7 @@ class TemplateTask extends Shell {
|
||||||
* Contains a list of $theme => $path
|
* Contains a list of $theme => $path
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
**/
|
*/
|
||||||
var $templatePaths = array();
|
var $templatePaths = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@ class TemplateTask extends Shell {
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function initialize() {
|
function initialize() {
|
||||||
$this->templatePaths = $this->_findThemes();
|
$this->templatePaths = $this->_findThemes();
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ class TemplateTask extends Shell {
|
||||||
* Bake themes are directories not named `skel` inside a `vendors/shells/templates` path.
|
* Bake themes are directories not named `skel` inside a `vendors/shells/templates` path.
|
||||||
*
|
*
|
||||||
* @return array Array of bake themes that are installed.
|
* @return array Array of bake themes that are installed.
|
||||||
**/
|
*/
|
||||||
function _findThemes() {
|
function _findThemes() {
|
||||||
$paths = App::path('shells');
|
$paths = App::path('shells');
|
||||||
$core = array_pop($paths);
|
$core = array_pop($paths);
|
||||||
|
@ -128,7 +128,7 @@ class TemplateTask extends Shell {
|
||||||
* @param string $vars Additional vars to set to template scope.
|
* @param string $vars Additional vars to set to template scope.
|
||||||
* @access public
|
* @access public
|
||||||
* @return contents of generated code template
|
* @return contents of generated code template
|
||||||
**/
|
*/
|
||||||
function generate($directory, $filename, $vars = null) {
|
function generate($directory, $filename, $vars = null) {
|
||||||
if ($vars !== null) {
|
if ($vars !== null) {
|
||||||
$this->set($vars);
|
$this->set($vars);
|
||||||
|
@ -156,7 +156,7 @@ class TemplateTask extends Shell {
|
||||||
* If there is more than one installed theme user interaction will happen
|
* If there is more than one installed theme user interaction will happen
|
||||||
*
|
*
|
||||||
* @return string returns the path to the selected theme.
|
* @return string returns the path to the selected theme.
|
||||||
**/
|
*/
|
||||||
function getThemePath() {
|
function getThemePath() {
|
||||||
if (count($this->templatePaths) == 1) {
|
if (count($this->templatePaths) == 1) {
|
||||||
$paths = array_values($this->templatePaths);
|
$paths = array_values($this->templatePaths);
|
||||||
|
@ -193,7 +193,7 @@ class TemplateTask extends Shell {
|
||||||
* @param string $filename lower_case_underscored filename you want.
|
* @param string $filename lower_case_underscored filename you want.
|
||||||
* @access public
|
* @access public
|
||||||
* @return string filename will exit program if template is not found.
|
* @return string filename will exit program if template is not found.
|
||||||
**/
|
*/
|
||||||
function _findTemplate($path, $directory, $filename) {
|
function _findTemplate($path, $directory, $filename) {
|
||||||
$themeFile = $path . $directory . DS . $filename . '.ctp';
|
$themeFile = $path . $directory . DS . $filename . '.ctp';
|
||||||
if (file_exists($themeFile)) {
|
if (file_exists($themeFile)) {
|
||||||
|
|
|
@ -4,19 +4,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.tasks
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
* @since CakePHP(tm) v 1.3
|
* @since CakePHP(tm) v 1.3
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,28 +46,31 @@ class TestTask extends Shell {
|
||||||
* Tasks used.
|
* Tasks used.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
var $tasks = array('Template');
|
var $tasks = array('Template');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class types that methods can be generated for
|
* class types that methods can be generated for
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper');
|
var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal list of fixtures that have been added so far.
|
* Internal list of fixtures that have been added so far.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
**/
|
* @access protected
|
||||||
|
*/
|
||||||
var $_fixtures = array();
|
var $_fixtures = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag for interactive mode
|
* Flag for interactive mode
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
**/
|
*/
|
||||||
var $interactive = false;
|
var $interactive = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,7 +167,8 @@ class TestTask extends Shell {
|
||||||
* Interact with the user and get their chosen type. Can exit the script.
|
* Interact with the user and get their chosen type. Can exit the script.
|
||||||
*
|
*
|
||||||
* @return string Users chosen type.
|
* @return string Users chosen type.
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function getObjectType() {
|
function getObjectType() {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__("Select an object type:", true));
|
$this->out(__("Select an object type:", true));
|
||||||
|
@ -189,9 +192,10 @@ class TestTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $objectType Type of object to list classes for i.e. Model, Controller.
|
* @param string $objectType Type of object to list classes for i.e. Model, Controller.
|
||||||
* @return string Class name the user chose.
|
* @return string Class name the user chose.
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function getClassName($objectType) {
|
function getClassName($objectType) {
|
||||||
$options = Configure::listObjects(strtolower($objectType));
|
$options = App::objects(strtolower($objectType));
|
||||||
$this->out(sprintf(__('Choose a %s class', true), $objectType));
|
$this->out(sprintf(__('Choose a %s class', true), $objectType));
|
||||||
$keys = array();
|
$keys = array();
|
||||||
foreach ($options as $key => $option) {
|
foreach ($options as $key => $option) {
|
||||||
|
@ -209,8 +213,11 @@ class TestTask extends Shell {
|
||||||
* Checks whether the chosen type can find its own fixtures.
|
* Checks whether the chosen type can find its own fixtures.
|
||||||
* Currently only model, and controller are supported
|
* Currently only model, and controller are supported
|
||||||
*
|
*
|
||||||
|
* @param string $type The Type of object you are generating tests for eg. controller
|
||||||
|
* @param string $className the Classname of the class the test is being generated for.
|
||||||
* @return boolean
|
* @return boolean
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function typeCanDetectFixtures($type) {
|
function typeCanDetectFixtures($type) {
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
return ($type == 'controller' || $type == 'model');
|
return ($type == 'controller' || $type == 'model');
|
||||||
|
@ -219,8 +226,11 @@ class TestTask extends Shell {
|
||||||
/**
|
/**
|
||||||
* Check if a class with the given type is loaded or can be loaded.
|
* Check if a class with the given type is loaded or can be loaded.
|
||||||
*
|
*
|
||||||
|
* @param string $type The Type of object you are generating tests for eg. controller
|
||||||
|
* @param string $className the Classname of the class the test is being generated for.
|
||||||
* @return boolean
|
* @return boolean
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function isLoadableClass($type, $class) {
|
function isLoadableClass($type, $class) {
|
||||||
return App::import($type, $class);
|
return App::import($type, $class);
|
||||||
}
|
}
|
||||||
|
@ -229,8 +239,11 @@ class TestTask extends Shell {
|
||||||
* Construct an instance of the class to be tested.
|
* Construct an instance of the class to be tested.
|
||||||
* So that fixtures can be detected
|
* So that fixtures can be detected
|
||||||
*
|
*
|
||||||
* @return object
|
* @param string $type The Type of object you are generating tests for eg. controller
|
||||||
**/
|
* @param string $class the Classname of the class the test is being generated for.
|
||||||
|
* @return object And instance of the class that is going to be tested.
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
function &buildTestSubject($type, $class) {
|
function &buildTestSubject($type, $class) {
|
||||||
ClassRegistry::flush();
|
ClassRegistry::flush();
|
||||||
App::import($type, $class);
|
App::import($type, $class);
|
||||||
|
@ -246,8 +259,11 @@ class TestTask extends Shell {
|
||||||
/**
|
/**
|
||||||
* Gets the real class name from the cake short form.
|
* Gets the real class name from the cake short form.
|
||||||
*
|
*
|
||||||
|
* @param string $type The Type of object you are generating tests for eg. controller
|
||||||
|
* @param string $class the Classname of the class the test is being generated for.
|
||||||
* @return string Real classname
|
* @return string Real classname
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function getRealClassName($type, $class) {
|
function getRealClassName($type, $class) {
|
||||||
if (strtolower($type) == 'model') {
|
if (strtolower($type) == 'model') {
|
||||||
return $class;
|
return $class;
|
||||||
|
@ -261,7 +277,8 @@ class TestTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param string $className Name of class to look at.
|
* @param string $className Name of class to look at.
|
||||||
* @return array Array of method names.
|
* @return array Array of method names.
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function getTestableMethods($className) {
|
function getTestableMethods($className) {
|
||||||
$classMethods = get_class_methods($className);
|
$classMethods = get_class_methods($className);
|
||||||
$parentMethods = get_class_methods(get_parent_class($className));
|
$parentMethods = get_class_methods(get_parent_class($className));
|
||||||
|
@ -279,9 +296,10 @@ class TestTask extends Shell {
|
||||||
* Generate the list of fixtures that will be required to run this test based on
|
* Generate the list of fixtures that will be required to run this test based on
|
||||||
* loaded models.
|
* loaded models.
|
||||||
*
|
*
|
||||||
* @param object The object you want to generate fixtures for.
|
* @param object $subject The object you want to generate fixtures for.
|
||||||
* @return array Array of fixtures to be included in the test.
|
* @return array Array of fixtures to be included in the test.
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function generateFixtureList(&$subject) {
|
function generateFixtureList(&$subject) {
|
||||||
$this->_fixtures = array();
|
$this->_fixtures = array();
|
||||||
if (is_a($subject, 'Model')) {
|
if (is_a($subject, 'Model')) {
|
||||||
|
@ -296,9 +314,10 @@ class TestTask extends Shell {
|
||||||
* Process a model recursively and pull out all the
|
* Process a model recursively and pull out all the
|
||||||
* model names converting them to fixture names.
|
* model names converting them to fixture names.
|
||||||
*
|
*
|
||||||
|
* @param Model $subject A Model class to scan for associations and pull fixtures off of.
|
||||||
* @return void
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
**/
|
*/
|
||||||
function _processModel(&$subject) {
|
function _processModel(&$subject) {
|
||||||
$this->_addFixture($subject->name);
|
$this->_addFixture($subject->name);
|
||||||
$associated = $subject->getAssociated();
|
$associated = $subject->getAssociated();
|
||||||
|
@ -320,9 +339,10 @@ class TestTask extends Shell {
|
||||||
* Process all the models attached to a controller
|
* Process all the models attached to a controller
|
||||||
* and generate a fixture list.
|
* and generate a fixture list.
|
||||||
*
|
*
|
||||||
|
* @param Controller $subject A controller to pull model names off of.
|
||||||
* @return void
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
**/
|
*/
|
||||||
function _processController(&$subject) {
|
function _processController(&$subject) {
|
||||||
$subject->constructClasses();
|
$subject->constructClasses();
|
||||||
$models = array(Inflector::classify($subject->name));
|
$models = array(Inflector::classify($subject->name));
|
||||||
|
@ -338,9 +358,10 @@ class TestTask extends Shell {
|
||||||
* Add classname to the fixture list.
|
* Add classname to the fixture list.
|
||||||
* Sets the app. or plugin.plugin_name. prefix.
|
* Sets the app. or plugin.plugin_name. prefix.
|
||||||
*
|
*
|
||||||
|
* @param string $name Name of the Model class that a fixture might be required for.
|
||||||
* @return void
|
* @return void
|
||||||
* @access protected
|
* @access protected
|
||||||
**/
|
*/
|
||||||
function _addFixture($name) {
|
function _addFixture($name) {
|
||||||
$parent = get_parent_class($name);
|
$parent = get_parent_class($name);
|
||||||
$prefix = 'app.';
|
$prefix = 'app.';
|
||||||
|
@ -355,8 +376,9 @@ class TestTask extends Shell {
|
||||||
/**
|
/**
|
||||||
* Interact with the user to get additional fixtures they want to use.
|
* Interact with the user to get additional fixtures they want to use.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return array Array of fixtures the user wants to add.
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function getUserFixtures() {
|
function getUserFixtures() {
|
||||||
$proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n');
|
$proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n');
|
||||||
$fixtures = array();
|
$fixtures = array();
|
||||||
|
@ -373,8 +395,10 @@ class TestTask extends Shell {
|
||||||
* Is a mock class required for this type of test?
|
* Is a mock class required for this type of test?
|
||||||
* Controllers require a mock class.
|
* Controllers require a mock class.
|
||||||
*
|
*
|
||||||
|
* @param string $type The type of object tests are being generated for eg. controller.
|
||||||
* @return boolean
|
* @return boolean
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function hasMockClass($type) {
|
function hasMockClass($type) {
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
return $type == 'controller';
|
return $type == 'controller';
|
||||||
|
@ -383,25 +407,32 @@ class TestTask extends Shell {
|
||||||
/**
|
/**
|
||||||
* Generate a constructor code snippet for the type and classname
|
* Generate a constructor code snippet for the type and classname
|
||||||
*
|
*
|
||||||
|
* @param string $type The Type of object you are generating tests for eg. controller
|
||||||
|
* @param string $className the Classname of the class the test is being generated for.
|
||||||
* @return string Constructor snippet for the thing you are building.
|
* @return string Constructor snippet for the thing you are building.
|
||||||
**/
|
* @access public
|
||||||
|
*/
|
||||||
function generateConstructor($type, $fullClassName) {
|
function generateConstructor($type, $fullClassName) {
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
if ($type == 'model') {
|
if ($type == 'model') {
|
||||||
return "ClassRegistry::init('$fullClassName');\n";
|
return "ClassRegistry::init('$fullClassName');\n";
|
||||||
}
|
}
|
||||||
if ($type == 'controller') {
|
if ($type == 'controller') {
|
||||||
return "new Test$fullClassName();\n\t\t\$this->{$fullClassName}->constructClasses();\n";
|
$className = substr($fullClassName, 0, strlen($fullClassName) - 10);
|
||||||
|
return "new Test$fullClassName();\n\t\t\$this->{$className}->constructClasses();\n";
|
||||||
}
|
}
|
||||||
return "new $fullClassName()\n";
|
return "new $fullClassName()\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* make the filename for the test case. resolve the suffixes for controllers
|
* Make the filename for the test case. resolve the suffixes for controllers
|
||||||
* and get the plugin path if needed.
|
* and get the plugin path if needed.
|
||||||
*
|
*
|
||||||
* @return string filename the test should be created on
|
* @param string $type The Type of object you are generating tests for eg. controller
|
||||||
**/
|
* @param string $className the Classname of the class the test is being generated for.
|
||||||
|
* @return string filename the test should be created on.
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
function testCaseFileName($type, $className) {
|
function testCaseFileName($type, $className) {
|
||||||
$path = $this->path;
|
$path = $this->path;
|
||||||
if (isset($this->plugin)) {
|
if (isset($this->plugin)) {
|
||||||
|
@ -413,5 +444,31 @@ class TestTask extends Shell {
|
||||||
}
|
}
|
||||||
return $path . Inflector::underscore($className) . '.test.php';
|
return $path . Inflector::underscore($className) . '.test.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show help file.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function help() {
|
||||||
|
$this->hr();
|
||||||
|
$this->out("Usage: cake bake test <type> <class>");
|
||||||
|
$this->hr();
|
||||||
|
$this->out('Commands:');
|
||||||
|
$this->out("");
|
||||||
|
$this->out("test model post\n\tbakes a test case for the post model.");
|
||||||
|
$this->out("");
|
||||||
|
$this->out("test controller comments\n\tbakes a test case for the comments controller.");
|
||||||
|
$this->out("");
|
||||||
|
$this->out('Arguments:');
|
||||||
|
$this->out("\t<type> Can be any of the following 'controller', 'model', 'helper',\n\t'component', 'behavior'.");
|
||||||
|
$this->out("\t<class> Any existing class for the chosen type.");
|
||||||
|
$this->out("");
|
||||||
|
$this->out("Parameters:");
|
||||||
|
$this->out("\t-plugin CamelCased name of plugin to bake tests for.");
|
||||||
|
$this->out("");
|
||||||
|
$this->_stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -2,23 +2,20 @@
|
||||||
/**
|
/**
|
||||||
* The View Tasks handles creating and updating view files.
|
* The View Tasks handles creating and updating view files.
|
||||||
*
|
*
|
||||||
* Long description for file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.tasks
|
* @subpackage cake.cake.console.libs.tasks
|
||||||
* @since CakePHP(tm) v 1.2
|
* @since CakePHP(tm) v 1.2
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
App::import('Controller', 'Controller', false);
|
App::import('Controller', 'Controller', false);
|
||||||
|
|
||||||
|
@ -113,6 +110,7 @@ class ViewTask extends Shell {
|
||||||
$this->controllerName = Inflector::camelize($this->args[0]);
|
$this->controllerName = Inflector::camelize($this->args[0]);
|
||||||
$this->controllerPath = Inflector::underscore($this->controllerName);
|
$this->controllerPath = Inflector::underscore($this->controllerName);
|
||||||
|
|
||||||
|
$this->Project->interactive = false;
|
||||||
if (strtolower($this->args[0]) == 'all') {
|
if (strtolower($this->args[0]) == 'all') {
|
||||||
return $this->all();
|
return $this->all();
|
||||||
}
|
}
|
||||||
|
@ -145,7 +143,7 @@ class ViewTask extends Shell {
|
||||||
* Get a list of actions that can / should have views baked for them.
|
* Get a list of actions that can / should have views baked for them.
|
||||||
*
|
*
|
||||||
* @return array Array of action names that should be baked
|
* @return array Array of action names that should be baked
|
||||||
**/
|
*/
|
||||||
function _methodsToBake() {
|
function _methodsToBake() {
|
||||||
$methods = array_diff(
|
$methods = array_diff(
|
||||||
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
|
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
|
||||||
|
@ -156,13 +154,13 @@ class ViewTask extends Shell {
|
||||||
$scaffoldActions = true;
|
$scaffoldActions = true;
|
||||||
$methods = $this->scaffoldActions;
|
$methods = $this->scaffoldActions;
|
||||||
}
|
}
|
||||||
$adminRoute = Configure::read('Routing.admin');
|
$adminRoute = $this->Project->getPrefix();
|
||||||
foreach ($methods as $i => $method) {
|
foreach ($methods as $i => $method) {
|
||||||
if ($adminRoute && isset($this->params['admin'])) {
|
if ($adminRoute && isset($this->params['admin'])) {
|
||||||
if ($scaffoldActions) {
|
if ($scaffoldActions) {
|
||||||
$methods[$i] = $adminRoute . '_' . $method;
|
$methods[$i] = $adminRoute . $method;
|
||||||
continue;
|
continue;
|
||||||
} elseif (strpos($method, $adminRoute . '_') === false) {
|
} elseif (strpos($method, $adminRoute) === false) {
|
||||||
unset($methods[$i]);
|
unset($methods[$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,7 +175,7 @@ class ViewTask extends Shell {
|
||||||
* Bake All views for All controllers.
|
* Bake All views for All controllers.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function all() {
|
function all() {
|
||||||
$this->Controller->interactive = false;
|
$this->Controller->interactive = false;
|
||||||
$tables = $this->Controller->listAll($this->connection, false);
|
$tables = $this->Controller->listAll($this->connection, false);
|
||||||
|
@ -233,7 +231,7 @@ class ViewTask extends Shell {
|
||||||
$this->bakeActions($actions, $vars);
|
$this->bakeActions($actions, $vars);
|
||||||
}
|
}
|
||||||
if (strtolower($wannaDoAdmin) == 'y') {
|
if (strtolower($wannaDoAdmin) == 'y') {
|
||||||
$admin = $this->Project->getAdmin();
|
$admin = $this->Project->getPrefix();
|
||||||
$regularActions = $this->scaffoldActions;
|
$regularActions = $this->scaffoldActions;
|
||||||
$adminActions = array();
|
$adminActions = array();
|
||||||
foreach ($regularActions as $action) {
|
foreach ($regularActions as $action) {
|
||||||
|
@ -242,7 +240,7 @@ class ViewTask extends Shell {
|
||||||
$this->bakeActions($adminActions, $vars);
|
$this->bakeActions($adminActions, $vars);
|
||||||
}
|
}
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out(__("View Scaffolding Complete.\n", true));
|
$this->out(__("View Scaffolding Complete.\n", true));
|
||||||
} else {
|
} else {
|
||||||
$this->customAction();
|
$this->customAction();
|
||||||
|
@ -284,23 +282,21 @@ class ViewTask extends Shell {
|
||||||
$primaryKey = $modelObj->primaryKey;
|
$primaryKey = $modelObj->primaryKey;
|
||||||
$displayField = $modelObj->displayField;
|
$displayField = $modelObj->displayField;
|
||||||
$singularVar = Inflector::variable($modelClass);
|
$singularVar = Inflector::variable($modelClass);
|
||||||
$pluralVar = Inflector::variable($this->controllerName);
|
$singularHumanName = $this->_singularHumanName($modelClass);
|
||||||
$singularHumanName = Inflector::humanize($modelClass);
|
$schema = $modelObj->schema(true);
|
||||||
$pluralHumanName = Inflector::humanize($this->controllerName);
|
|
||||||
$schema = $modelObj->schema();
|
|
||||||
$fields = array_keys($schema);
|
$fields = array_keys($schema);
|
||||||
$associations = $this->__associations($modelObj);
|
$associations = $this->__associations($modelObj);
|
||||||
} else {
|
} else {
|
||||||
$primaryKey = null;
|
$primaryKey = null;
|
||||||
$displayField = null;
|
$displayField = null;
|
||||||
$singularVar = Inflector::variable(Inflector::singularize($this->controllerName));
|
$singularVar = Inflector::variable(Inflector::singularize($this->controllerName));
|
||||||
$pluralVar = Inflector::variable($this->controllerName);
|
$singularHumanName = $this->_singularHumanName($this->controllerName);
|
||||||
$singularHumanName = Inflector::humanize(Inflector::singularize($this->controllerName));
|
|
||||||
$pluralHumanName = Inflector::humanize($this->controllerName);
|
|
||||||
$fields = array();
|
$fields = array();
|
||||||
$schema = array();
|
$schema = array();
|
||||||
$associations = array();
|
$associations = array();
|
||||||
}
|
}
|
||||||
|
$pluralVar = Inflector::variable($this->controllerName);
|
||||||
|
$pluralHumanName = $this->_pluralHumanName($this->controllerName);
|
||||||
|
|
||||||
return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
|
return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
|
||||||
'singularHumanName', 'pluralHumanName', 'fields','associations');
|
'singularHumanName', 'pluralHumanName', 'fields','associations');
|
||||||
|
@ -311,7 +307,7 @@ class ViewTask extends Shell {
|
||||||
*
|
*
|
||||||
* @param array $actions Array of actions to make files for.
|
* @param array $actions Array of actions to make files for.
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function bakeActions($actions, $vars) {
|
function bakeActions($actions, $vars) {
|
||||||
foreach ($actions as $action) {
|
foreach ($actions as $action) {
|
||||||
$content = $this->getContent($action, $vars);
|
$content = $this->getContent($action, $vars);
|
||||||
|
@ -323,7 +319,7 @@ class ViewTask extends Shell {
|
||||||
* handle creation of baking a custom action view file
|
* handle creation of baking a custom action view file
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
*/
|
||||||
function customAction() {
|
function customAction() {
|
||||||
$action = '';
|
$action = '';
|
||||||
while ($action == '') {
|
while ($action == '') {
|
||||||
|
@ -332,7 +328,7 @@ class ViewTask extends Shell {
|
||||||
$this->out(__('The action name you supplied was empty. Please try again.', true));
|
$this->out(__('The action name you supplied was empty. Please try again.', true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out(__('The following view will be created:', true));
|
$this->out(__('The following view will be created:', true));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
@ -372,28 +368,12 @@ class ViewTask extends Shell {
|
||||||
/**
|
/**
|
||||||
* Builds content from template and variables
|
* Builds content from template and variables
|
||||||
*
|
*
|
||||||
* @param string $template file to use
|
* @param string $action name to generate content to
|
||||||
* @param array $vars passed for use in templates
|
* @param array $vars passed for use in templates
|
||||||
* @return string content from template
|
* @return string content from template
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function getContent($template = null, $vars = null) {
|
function getContent($action, $vars = null) {
|
||||||
if (!$template) {
|
|
||||||
$template = $this->template;
|
|
||||||
}
|
|
||||||
$action = $template;
|
|
||||||
|
|
||||||
$adminRoute = Configure::read('Routing.admin');
|
|
||||||
if (!empty($adminRoute) && strpos($template, $adminRoute) !== false) {
|
|
||||||
$template = str_replace($adminRoute . '_', '', $template);
|
|
||||||
}
|
|
||||||
if (in_array($template, array('add', 'edit'))) {
|
|
||||||
$action = $template;
|
|
||||||
$template = 'form';
|
|
||||||
} elseif (preg_match('@(_add|_edit)$@', $template)) {
|
|
||||||
$action = $template;
|
|
||||||
$template = str_replace(array('_add', '_edit'), '_form', $template);
|
|
||||||
}
|
|
||||||
if (!$vars) {
|
if (!$vars) {
|
||||||
$vars = $this->__loadController();
|
$vars = $this->__loadController();
|
||||||
}
|
}
|
||||||
|
@ -401,7 +381,7 @@ class ViewTask extends Shell {
|
||||||
$this->Template->set('action', $action);
|
$this->Template->set('action', $action);
|
||||||
$this->Template->set('plugin', $this->plugin);
|
$this->Template->set('plugin', $this->plugin);
|
||||||
$this->Template->set($vars);
|
$this->Template->set($vars);
|
||||||
$output = $this->Template->generate('views', $template);
|
$output = $this->Template->generate('views', $this->getTemplate($action));
|
||||||
|
|
||||||
if (!empty($output)) {
|
if (!empty($output)) {
|
||||||
return $output;
|
return $output;
|
||||||
|
@ -409,6 +389,32 @@ class ViewTask extends Shell {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the template name based on the action name
|
||||||
|
*
|
||||||
|
* @param string $action name
|
||||||
|
* @return string template name
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function getTemplate($action) {
|
||||||
|
if (!empty($this->template) && $action != $this->template) {
|
||||||
|
return $this->template;
|
||||||
|
}
|
||||||
|
$template = $action;
|
||||||
|
$prefixes = Configure::read('Routing.prefixes');
|
||||||
|
foreach ((array)$prefixes as $prefix) {
|
||||||
|
if (strpos($template, $prefix) !== false) {
|
||||||
|
$template = str_replace($prefix . '_', '', $template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (in_array($template, array('add', 'edit'))) {
|
||||||
|
$template = 'form';
|
||||||
|
} elseif (preg_match('@(_add|_edit)$@', $template)) {
|
||||||
|
$template = str_replace(array('_add', '_edit'), '_form', $template);
|
||||||
|
}
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays help contents
|
* Displays help contents
|
||||||
*
|
*
|
||||||
|
@ -418,8 +424,14 @@ class ViewTask extends Shell {
|
||||||
$this->hr();
|
$this->hr();
|
||||||
$this->out("Usage: cake bake view <arg1> <arg2>...");
|
$this->out("Usage: cake bake view <arg1> <arg2>...");
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
$this->out('Arguments:');
|
||||||
|
$this->out();
|
||||||
|
$this->out("<controller>");
|
||||||
|
$this->out("\tName of the controller views to bake. Can use Plugin.name");
|
||||||
|
$this->out("\tas a shortcut for plugin baking.");
|
||||||
|
$this->out();
|
||||||
$this->out('Commands:');
|
$this->out('Commands:');
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("view <controller>");
|
$this->out("view <controller>");
|
||||||
$this->out("\tWill read the given controller for methods");
|
$this->out("\tWill read the given controller for methods");
|
||||||
$this->out("\tand bake corresponding views.");
|
$this->out("\tand bake corresponding views.");
|
||||||
|
@ -427,14 +439,14 @@ class ViewTask extends Shell {
|
||||||
$this->out("\tthat begin with Routing.admin.");
|
$this->out("\tthat begin with Routing.admin.");
|
||||||
$this->out("\tIf var scaffold is found it will bake the CRUD actions");
|
$this->out("\tIf var scaffold is found it will bake the CRUD actions");
|
||||||
$this->out("\t(index,view,add,edit)");
|
$this->out("\t(index,view,add,edit)");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("view <controller> <action>");
|
$this->out("view <controller> <action>");
|
||||||
$this->out("\tWill bake a template. core templates: (index, add, edit, view)");
|
$this->out("\tWill bake a template. core templates: (index, add, edit, view)");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("view <controller> <template> <alias>");
|
$this->out("view <controller> <template> <alias>");
|
||||||
$this->out("\tWill use the template specified");
|
$this->out("\tWill use the template specified");
|
||||||
$this->out("\tbut name the file based on the alias");
|
$this->out("\tbut name the file based on the alias");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("view all");
|
$this->out("view all");
|
||||||
$this->out("\tBake all CRUD action views for all controllers.");
|
$this->out("\tBake all CRUD action views for all controllers.");
|
||||||
$this->out("\tRequires that models and controllers exist.");
|
$this->out("\tRequires that models and controllers exist.");
|
||||||
|
@ -447,7 +459,7 @@ class ViewTask extends Shell {
|
||||||
* @return array $associations
|
* @return array $associations
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __associations($model) {
|
function __associations(&$model) {
|
||||||
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
|
||||||
$associations = array();
|
$associations = array();
|
||||||
|
|
||||||
|
@ -457,7 +469,7 @@ class ViewTask extends Shell {
|
||||||
$associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField;
|
$associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField;
|
||||||
$associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey'];
|
$associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey'];
|
||||||
$associations[$type][$assocKey]['controller'] = Inflector::pluralize(Inflector::underscore($assocData['className']));
|
$associations[$type][$assocKey]['controller'] = Inflector::pluralize(Inflector::underscore($assocData['className']));
|
||||||
$associations[$type][$assocKey]['fields'] = array_keys($model->{$assocKey}->schema());
|
$associations[$type][$assocKey]['fields'] = array_keys($model->{$assocKey}->schema(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $associations;
|
return $associations;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test Suite Shell
|
* Test Suite Shell
|
||||||
*
|
*
|
||||||
|
@ -9,20 +7,16 @@
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The Open Group Test Suite License
|
* Licensed under The Open Group Test Suite License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
||||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs
|
* @subpackage cake.cake.console.libs
|
||||||
* @since CakePHP(tm) v 1.2.0.4433
|
* @since CakePHP(tm) v 1.2.0.4433
|
||||||
* @version $Revision$
|
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||||
*/
|
*/
|
||||||
class TestSuiteShell extends Shell {
|
class TestSuiteShell extends Shell {
|
||||||
|
@ -75,14 +69,6 @@ class TestSuiteShell extends Shell {
|
||||||
*/
|
*/
|
||||||
var $doCoverage = false;
|
var $doCoverage = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* The headline for the test output
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
var $headline = 'CakePHP Test Shell';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization method installs Simpletest and loads all plugins
|
* Initialization method installs Simpletest and loads all plugins
|
||||||
*
|
*
|
||||||
|
@ -100,25 +86,26 @@ class TestSuiteShell extends Shell {
|
||||||
$this->__installSimpleTest();
|
$this->__installSimpleTest();
|
||||||
|
|
||||||
require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php';
|
require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php';
|
||||||
require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php';
|
require_once CAKE . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_cli_reporter.php';
|
||||||
|
|
||||||
$plugins = App::objects('plugin');
|
$plugins = App::objects('plugin');
|
||||||
foreach ($plugins as $p) {
|
foreach ($plugins as $p) {
|
||||||
$this->plugins[] = Inflector::underscore($p);
|
$this->plugins[] = Inflector::underscore($p);
|
||||||
}
|
}
|
||||||
|
$this->parseArgs();
|
||||||
|
$this->getManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main entry point to this shell
|
* Parse the arguments given into the Shell object properties.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function main() {
|
function parseArgs() {
|
||||||
$this->out($this->headline);
|
if (empty($this->args)) {
|
||||||
$this->hr();
|
return;
|
||||||
|
}
|
||||||
if (count($this->args) > 0) {
|
|
||||||
$this->category = $this->args[0];
|
$this->category = $this->args[0];
|
||||||
|
|
||||||
if (!in_array($this->category, array('app', 'core'))) {
|
if (!in_array($this->category, array('app', 'core'))) {
|
||||||
|
@ -140,21 +127,46 @@ class TestSuiteShell extends Shell {
|
||||||
if (isset($this->args[3]) && $this->args[3] == 'cov') {
|
if (isset($this->args[3]) && $this->args[3] == 'cov') {
|
||||||
$this->doCoverage = true;
|
$this->doCoverage = true;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
$this->err('Sorry, you did not pass any arguments!');
|
|
||||||
|
/**
|
||||||
|
* Gets a manager instance, and set the app/plugin properties.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function getManager() {
|
||||||
|
$this->Manager = new TestManager();
|
||||||
|
$this->Manager->appTest = ($this->category === 'app');
|
||||||
|
if ($this->isPluginTest) {
|
||||||
|
$this->Manager->pluginTest = $this->category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main entry point to this shell
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
function main() {
|
||||||
|
$this->out(__('CakePHP Test Shell', true));
|
||||||
|
$this->hr();
|
||||||
|
|
||||||
|
if (count($this->args) == 0) {
|
||||||
|
$this->error(__('Sorry, you did not pass any arguments!', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->__canRun()) {
|
if ($this->__canRun()) {
|
||||||
$this->out('Running '.$this->category.' '.$this->type.' '.$this->file);
|
$message = sprintf(__('Running %s %s %s', true), $this->category, $this->type, $this->file);
|
||||||
|
$this->out($message);
|
||||||
|
|
||||||
$exitCode = 0;
|
$exitCode = 0;
|
||||||
if (!$this->__run()) {
|
if (!$this->__run()) {
|
||||||
$exitCode = 1;
|
$exitCode = 1;
|
||||||
}
|
}
|
||||||
exit($exitCode);
|
$this->_stop($exitCode);
|
||||||
} else {
|
} else {
|
||||||
$this->err('Sorry, the tests could not be found.');
|
$this->error(__('Sorry, the tests could not be found.', true));
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,28 +182,28 @@ class TestSuiteShell extends Shell {
|
||||||
$this->out("\t\t- category - \"app\", \"core\" or name of a plugin");
|
$this->out("\t\t- category - \"app\", \"core\" or name of a plugin");
|
||||||
$this->out("\t\t- test_type - \"case\", \"group\" or \"all\"");
|
$this->out("\t\t- test_type - \"case\", \"group\" or \"all\"");
|
||||||
$this->out("\t\t- test_file - file name with folder prefix and without the (test|group).php suffix");
|
$this->out("\t\t- test_file - file name with folder prefix and without the (test|group).php suffix");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out('Examples: ');
|
$this->out('Examples: ');
|
||||||
$this->out("\t\tcake testsuite app all");
|
$this->out("\t\tcake testsuite app all");
|
||||||
$this->out("\t\tcake testsuite core all");
|
$this->out("\t\tcake testsuite core all");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("\t\tcake testsuite app case behaviors/debuggable");
|
$this->out("\t\tcake testsuite app case behaviors/debuggable");
|
||||||
$this->out("\t\tcake testsuite app case models/my_model");
|
$this->out("\t\tcake testsuite app case models/my_model");
|
||||||
$this->out("\t\tcake testsuite app case controllers/my_controller");
|
$this->out("\t\tcake testsuite app case controllers/my_controller");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("\t\tcake testsuite core case file");
|
$this->out("\t\tcake testsuite core case file");
|
||||||
$this->out("\t\tcake testsuite core case router");
|
$this->out("\t\tcake testsuite core case router");
|
||||||
$this->out("\t\tcake testsuite core case set");
|
$this->out("\t\tcake testsuite core case set");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("\t\tcake testsuite app group mygroup");
|
$this->out("\t\tcake testsuite app group mygroup");
|
||||||
$this->out("\t\tcake testsuite core group acl");
|
$this->out("\t\tcake testsuite core group acl");
|
||||||
$this->out("\t\tcake testsuite core group socket");
|
$this->out("\t\tcake testsuite core group socket");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out("\t\tcake testsuite bugs case models/bug");
|
$this->out("\t\tcake testsuite bugs case models/bug");
|
||||||
$this->out("\t\t // for the plugin 'bugs' and its test case 'models/bug'");
|
$this->out("\t\t // for the plugin 'bugs' and its test case 'models/bug'");
|
||||||
$this->out("\t\tcake testsuite bugs group bug");
|
$this->out("\t\tcake testsuite bugs group bug");
|
||||||
$this->out("\t\t // for the plugin bugs and its test group 'bug'");
|
$this->out("\t\t // for the plugin bugs and its test group 'bug'");
|
||||||
$this->out('');
|
$this->out();
|
||||||
$this->out('Code Coverage Analysis: ');
|
$this->out('Code Coverage Analysis: ');
|
||||||
$this->out("\n\nAppend 'cov' to any of the above in order to enable code coverage analysis");
|
$this->out("\n\nAppend 'cov' to any of the above in order to enable code coverage analysis");
|
||||||
}
|
}
|
||||||
|
@ -207,50 +219,37 @@ class TestSuiteShell extends Shell {
|
||||||
$isPlugin = in_array(Inflector::underscore($this->category), $this->plugins);
|
$isPlugin = in_array(Inflector::underscore($this->category), $this->plugins);
|
||||||
|
|
||||||
if ($isNeitherAppNorCore && !$isPlugin) {
|
if ($isNeitherAppNorCore && !$isPlugin) {
|
||||||
$this->err($this->category.' is an invalid test category (either "app", "core" or name of a plugin)');
|
$message = sprintf(
|
||||||
|
__('%s is an invalid test category (either "app", "core" or name of a plugin)', true),
|
||||||
|
$this->category
|
||||||
|
);
|
||||||
|
$this->error($message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$folder = $this->__findFolderByCategory($this->category);
|
$folder = $this->__findFolderByCategory($this->category);
|
||||||
if (!file_exists($folder)) {
|
if (!file_exists($folder)) {
|
||||||
$this->err($folder . ' not found');
|
$this->err(sprintf(__('%s not found', true), $folder));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($this->type, array('all', 'group', 'case'))) {
|
if (!in_array($this->type, array('all', 'group', 'case'))) {
|
||||||
$this->err($this->type.' is invalid. Should be case, group or all');
|
$this->err(sprintf(__('%s is invalid. Should be case, group or all', true), $this->type));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($this->type) {
|
$fileName = $this->__getFileName($folder, $this->isPluginTest);
|
||||||
case 'all':
|
if ($fileName === true || file_exists($folder . $fileName)) {
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
case 'group':
|
|
||||||
if (file_exists($folder.DS.'groups'.DS.$this->file.'.group.php')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'case':
|
|
||||||
if ($this->category == 'app' && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
$coreCaseExists = file_exists($folder.DS.'cases'.DS.$this->file.'.test.php');
|
|
||||||
$coreLibCaseExists = file_exists($folder.DS.'cases'.DS.'libs'.DS.$this->file.'.test.php');
|
|
||||||
if ($this->category == 'core' && ($coreCaseExists || $coreLibCaseExists)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isPlugin && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) {
|
$message = sprintf(
|
||||||
return true;
|
__('%s %s %s is an invalid test identifier', true),
|
||||||
}
|
$this->category, $this->type, $this->file
|
||||||
break;
|
);
|
||||||
}
|
$this->err($message);
|
||||||
|
|
||||||
$this->err($this->category.' '.$this->type.' '.$this->file.' is an invalid test identifier');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the tests depending on our settings
|
* Executes the tests depending on our settings
|
||||||
*
|
*
|
||||||
|
@ -258,69 +257,82 @@ class TestSuiteShell extends Shell {
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function __run() {
|
function __run() {
|
||||||
$reporter = new CLIReporter();
|
$Reporter = new CakeCliReporter('utf-8', array(
|
||||||
$this->__setGetVars();
|
'app' => $this->Manager->appTest,
|
||||||
|
'plugin' => $this->Manager->pluginTest,
|
||||||
|
'group' => ($this->type === 'group'),
|
||||||
|
'codeCoverage' => $this->doCoverage
|
||||||
|
));
|
||||||
|
|
||||||
if ($this->type == 'all') {
|
if ($this->type == 'all') {
|
||||||
return TestManager::runAllTests($reporter);
|
return $this->Manager->runAllTests($Reporter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->doCoverage) {
|
if ($this->doCoverage) {
|
||||||
if (!extension_loaded('xdebug')) {
|
if (!extension_loaded('xdebug')) {
|
||||||
$this->out('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install');
|
$this->out(__('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install', true));
|
||||||
exit(0);
|
$this->_stop(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->type == 'group') {
|
if ($this->type == 'group') {
|
||||||
$ucFirstGroup = ucfirst($this->file);
|
$ucFirstGroup = ucfirst($this->file);
|
||||||
|
|
||||||
$path = CORE_TEST_GROUPS;
|
|
||||||
if ($this->category == 'app') {
|
|
||||||
$path = APP_TEST_GROUPS;
|
|
||||||
} elseif ($this->isPluginTest) {
|
|
||||||
$path = APP.'plugins'.DS.$this->category.DS.'tests'.DS.'groups';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->doCoverage) {
|
if ($this->doCoverage) {
|
||||||
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
|
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
|
||||||
CodeCoverageManager::start($ucFirstGroup, $reporter);
|
CodeCoverageManager::init($ucFirstGroup, $Reporter);
|
||||||
}
|
CodeCoverageManager::start();
|
||||||
$result = TestManager::runGroupTest($ucFirstGroup, $reporter);
|
|
||||||
if ($this->doCoverage) {
|
|
||||||
CodeCoverageManager::report();
|
|
||||||
}
|
}
|
||||||
|
$result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
if ($this->category === 'core') {
|
|
||||||
$coreCaseExists = file_exists(CORE_TEST_CASES.DS.$this->file.'.test.php');
|
$folder = $folder = $this->__findFolderByCategory($this->category);
|
||||||
if ($coreCaseExists) {
|
$case = $this->__getFileName($folder, $this->isPluginTest);
|
||||||
$case = $this->file . '.test.php';
|
|
||||||
} else {
|
|
||||||
$case = 'libs' . DS . $this->file . '.test.php';
|
|
||||||
}
|
|
||||||
} elseif ($this->category === 'app') {
|
|
||||||
$case = $this->file.'.test.php';
|
|
||||||
} elseif ($this->isPluginTest) {
|
|
||||||
$case = $this->file.'.test.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->doCoverage) {
|
if ($this->doCoverage) {
|
||||||
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
|
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
|
||||||
CodeCoverageManager::start($case, $reporter);
|
CodeCoverageManager::init($case, $Reporter);
|
||||||
|
CodeCoverageManager::start();
|
||||||
}
|
}
|
||||||
|
$result = $this->Manager->runTestCase($case, $Reporter);
|
||||||
$result = TestManager::runTestCase($case, $reporter);
|
|
||||||
if ($this->doCoverage) {
|
|
||||||
CodeCoverageManager::report();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds the correct folder to look for tests for based on the input category
|
* Gets the concrete filename for the inputted test name and category/type
|
||||||
*
|
*
|
||||||
|
* @param string $folder Folder name to look for files in.
|
||||||
|
* @param boolean $isPlugin If the test case is a plugin.
|
||||||
|
* @return mixed Either string filename or boolean false on failure. Or true if the type is 'all'
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
function __getFileName($folder, $isPlugin) {
|
||||||
|
$ext = $this->Manager->getExtension($this->type);
|
||||||
|
switch ($this->type) {
|
||||||
|
case 'all':
|
||||||
|
return true;
|
||||||
|
case 'group':
|
||||||
|
return $this->file . $ext;
|
||||||
|
case 'case':
|
||||||
|
if ($this->category == 'app' || $isPlugin) {
|
||||||
|
return $this->file . $ext;
|
||||||
|
}
|
||||||
|
$coreCase = $this->file . $ext;
|
||||||
|
$coreLibCase = 'libs' . DS . $this->file . $ext;
|
||||||
|
|
||||||
|
if ($this->category == 'core' && file_exists($folder . DS . $coreCase)) {
|
||||||
|
return $coreCase;
|
||||||
|
} elseif ($this->category == 'core' && file_exists($folder . DS . $coreLibCase)) {
|
||||||
|
return $coreLibCase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the correct folder to look for tests for based on the input category and type.
|
||||||
|
*
|
||||||
|
* @param string $category The category of the test. Either 'app', 'core' or a plugin name.
|
||||||
* @return string the folder path
|
* @return string the folder path
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
|
@ -330,42 +342,19 @@ class TestSuiteShell extends Shell {
|
||||||
'core' => CAKE,
|
'core' => CAKE,
|
||||||
'app' => APP
|
'app' => APP
|
||||||
);
|
);
|
||||||
|
$typeDir = $this->type === 'group' ? 'groups' : 'cases';
|
||||||
|
|
||||||
if (array_key_exists($category, $paths)) {
|
if (array_key_exists($category, $paths)) {
|
||||||
$folder = $paths[$category] . 'tests';
|
$folder = $paths[$category] . 'tests' . DS . $typeDir . DS;
|
||||||
} else {
|
} else {
|
||||||
$scoredCategory = Inflector::underscore($category);
|
$pluginPath = App::pluginPath($category);
|
||||||
$folder = APP . 'plugins' . DS . $scoredCategory . DS;
|
if (is_dir($pluginPath . 'tests')) {
|
||||||
$pluginPaths = App::path('plugins');
|
$folder = $pluginPath . 'tests' . DS . $typeDir . DS;
|
||||||
foreach ($pluginPaths as $path) {
|
|
||||||
if (file_exists($path . $scoredCategory . DS . 'tests')) {
|
|
||||||
$folder = $path . $scoredCategory . DS . 'tests';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $folder;
|
return $folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets some get vars needed for TestManager
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function __setGetVars() {
|
|
||||||
if (in_array($this->category, $this->plugins)) {
|
|
||||||
$_GET['plugin'] = $this->category;
|
|
||||||
} elseif (in_array(Inflector::Humanize($this->category), $this->plugins)) {
|
|
||||||
$_GET['plugin'] = Inflector::Humanize($this->category);
|
|
||||||
} elseif ($this->category == 'app') {
|
|
||||||
$_GET['app'] = true;
|
|
||||||
}
|
|
||||||
if ($this->type == 'group') {
|
|
||||||
$_GET['group'] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tries to install simpletest and exits gracefully if it is not there
|
* tries to install simpletest and exits gracefully if it is not there
|
||||||
*
|
*
|
||||||
|
@ -374,7 +363,7 @@ class TestSuiteShell extends Shell {
|
||||||
*/
|
*/
|
||||||
function __installSimpleTest() {
|
function __installSimpleTest() {
|
||||||
if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
|
if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
|
||||||
$this->err('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.');
|
$this->err(__('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.', true));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
/**
|
/**
|
||||||
* Bake Template for Controller action generation.
|
* Bake Template for Controller action generation.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
|
@ -29,10 +27,10 @@
|
||||||
function <?php echo $admin ?>view($id = null) {
|
function <?php echo $admin ?>view($id = null) {
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('Invalid <?php echo $singularHumanName ?>', true));
|
$this->Session->setFlash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName) ?>'));
|
||||||
$this->redirect(array('action' => 'index'));
|
$this->redirect(array('action' => 'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index'));
|
$this->flash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
}
|
}
|
||||||
$this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id));
|
$this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id));
|
||||||
|
@ -44,14 +42,14 @@
|
||||||
$this-><?php echo $currentModelName; ?>->create();
|
$this-><?php echo $currentModelName; ?>->create();
|
||||||
if ($this-><?php echo $currentModelName; ?>->save($this->data)) {
|
if ($this-><?php echo $currentModelName; ?>->save($this->data)) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true));
|
$this->Session->setFlash(sprintf(__('The %s has been saved', true), '<?php echo strtolower($singularHumanName); ?>'));
|
||||||
$this->redirect(array('action' => 'index'));
|
$this->redirect(array('action' => 'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('<?php echo $currentModelName; ?> saved.', true), array('action' => 'index'));
|
$this->flash(sprintf(__('%s saved.', true), '<?php echo ucfirst(strtolower($currentModelName)); ?>'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
} else {
|
} else {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true));
|
$this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.', true), '<?php echo strtolower($singularHumanName); ?>'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,23 +74,23 @@
|
||||||
function <?php echo $admin; ?>edit($id = null) {
|
function <?php echo $admin; ?>edit($id = null) {
|
||||||
if (!$id && empty($this->data)) {
|
if (!$id && empty($this->data)) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('Invalid <?php echo $singularHumanName; ?>', true));
|
$this->Session->setFlash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>'));
|
||||||
$this->redirect(array('action' => 'index'));
|
$this->redirect(array('action' => 'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index'));
|
$this->flash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
}
|
}
|
||||||
if (!empty($this->data)) {
|
if (!empty($this->data)) {
|
||||||
if ($this-><?php echo $currentModelName; ?>->save($this->data)) {
|
if ($this-><?php echo $currentModelName; ?>->save($this->data)) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true));
|
$this->Session->setFlash(sprintf(__('The %s has been saved', true), '<?php echo strtolower($singularHumanName); ?>'));
|
||||||
$this->redirect(array('action' => 'index'));
|
$this->redirect(array('action' => 'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('The <?php echo $singularHumanName; ?> has been saved.', true), array('action' => 'index'));
|
$this->flash(sprintf(__('The %s has been saved.', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
} else {
|
} else {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true));
|
$this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.', true), '<?php echo strtolower($singularHumanName); ?>'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,24 +117,24 @@
|
||||||
function <?php echo $admin; ?>delete($id = null) {
|
function <?php echo $admin; ?>delete($id = null) {
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('Invalid id for <?php echo $singularHumanName; ?>', true));
|
$this->Session->setFlash(sprintf(__('Invalid id for %s', true), '<?php echo strtolower($singularHumanName); ?>'));
|
||||||
$this->redirect(array('action'=>'index'));
|
$this->redirect(array('action'=>'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index'));
|
$this->flash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
}
|
}
|
||||||
if ($this-><?php echo $currentModelName; ?>->del($id)) {
|
if ($this-><?php echo $currentModelName; ?>->delete($id)) {
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('<?php echo $singularHumanName; ?> deleted', true));
|
$this->Session->setFlash(sprintf(__('%s deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>'));
|
||||||
$this->redirect(array('action'=>'index'));
|
$this->redirect(array('action'=>'index'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('<?php echo $singularHumanName; ?> deleted', true), array('action' => 'index'));
|
$this->flash(sprintf(__('%s deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
}
|
}
|
||||||
<?php if ($wannaUseSession): ?>
|
<?php if ($wannaUseSession): ?>
|
||||||
$this->Session->setFlash(__('<?php echo $singularHumanName; ?> was not deleted', true));
|
$this->Session->setFlash(sprintf(__('%s was not deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>'));
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
$this->flash(__('<?php echo $singularHumanName; ?> was not deleted', true), array('action' => 'index'));
|
$this->flash(sprintf(__('%s was not deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>'), array('action' => 'index'));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
$this->redirect(array('action' => 'index'));
|
$this->redirect(array('action' => 'index'));
|
||||||
}
|
}
|
|
@ -29,14 +29,17 @@ class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>App
|
||||||
var $scaffold;
|
var $scaffold;
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo "\tvar \$helpers = array('Html', 'Form'";
|
|
||||||
if (count($helpers)):
|
if (count($helpers)):
|
||||||
foreach ($helpers as $help):
|
echo "\tvar \$helpers = array(";
|
||||||
echo ", '" . Inflector::camelize($help) . "'";
|
for ($i = 0, $len = count($helpers); $i < $len; $i++):
|
||||||
endforeach;
|
if ($i != $len - 1):
|
||||||
|
echo "'" . Inflector::camelize($helpers[$i]) . "', ";
|
||||||
|
else:
|
||||||
|
echo "'" . Inflector::camelize($helpers[$i]) . "'";
|
||||||
endif;
|
endif;
|
||||||
|
endfor;
|
||||||
echo ");\n";
|
echo ");\n";
|
||||||
|
endif;
|
||||||
|
|
||||||
if (count($components)):
|
if (count($components)):
|
||||||
echo "\tvar \$components = array(";
|
echo "\tvar \$components = array(";
|
||||||
|
|
|
@ -42,7 +42,14 @@ if (!empty($validate)):
|
||||||
foreach ($validate as $field => $validations):
|
foreach ($validate as $field => $validations):
|
||||||
echo "\t\t'$field' => array(\n";
|
echo "\t\t'$field' => array(\n";
|
||||||
foreach ($validations as $key => $validator):
|
foreach ($validations as $key => $validator):
|
||||||
echo "\t\t\t'$key' => array('rule' => array('$validator')),\n";
|
echo "\t\t\t'$key' => array(\n";
|
||||||
|
echo "\t\t\t\t'rule' => array('$validator'),\n";
|
||||||
|
echo "\t\t\t\t//'message' => 'Your custom message here',\n";
|
||||||
|
echo "\t\t\t\t//'allowEmpty' => false,\n";
|
||||||
|
echo "\t\t\t\t//'required' => false,\n";
|
||||||
|
echo "\t\t\t\t//'last' => false, // Stop validation after this rule\n";
|
||||||
|
echo "\t\t\t\t//'on' => 'create', // Limit validation to 'create' or 'update' operations\n";
|
||||||
|
echo "\t\t\t),\n";
|
||||||
endforeach;
|
endforeach;
|
||||||
echo "\t\t),\n";
|
echo "\t\t),\n";
|
||||||
endforeach;
|
endforeach;
|
||||||
|
@ -52,7 +59,6 @@ endif;
|
||||||
?>
|
?>
|
||||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
foreach (array('hasOne', 'belongsTo') as $assocType):
|
foreach (array('hasOne', 'belongsTo') as $assocType):
|
||||||
if (!empty($associations[$assocType])):
|
if (!empty($associations[$assocType])):
|
||||||
$typeCount = count($associations[$assocType]);
|
$typeCount = count($associations[$assocType]);
|
||||||
|
|
|
@ -1,66 +1,61 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.templates.views
|
* @subpackage cake.cake.console.libs.templates.views
|
||||||
* @since CakePHP(tm) v 1.2.0.5234
|
* @since CakePHP(tm) v 1.2.0.5234
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo $pluralVar;?> form">
|
<div class="<?php echo $pluralVar;?> form">
|
||||||
<?php echo "<?php echo \$form->create('{$modelClass}');?>\n";?>
|
<?php echo "<?php echo \$this->Form->create('{$modelClass}');?>\n";?>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><?php echo "<?php __('" . Inflector::humanize($action) . " {$singularHumanName}');?>";?></legend>
|
<legend><?php echo "<?php printf(__('" . Inflector::humanize($action) . " %s', true), __('{$singularHumanName}', true)); ?>";?></legend>
|
||||||
<?php
|
<?php
|
||||||
echo "\t<?php\n";
|
echo "\t<?php\n";
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
if ($action == 'add' && $field == $primaryKey) {
|
if (strpos($action, 'add') !== false && $field == $primaryKey) {
|
||||||
continue;
|
continue;
|
||||||
} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
|
} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
|
||||||
echo "\t\techo \$form->input('{$field}');\n";
|
echo "\t\techo \$this->Form->input('{$field}');\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!empty($associations['hasAndBelongsToMany'])) {
|
if (!empty($associations['hasAndBelongsToMany'])) {
|
||||||
foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
|
foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
|
||||||
echo "\t\techo \$form->input('{$assocName}');\n";
|
echo "\t\techo \$this->Form->input('{$assocName}');\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "\t?>\n";
|
echo "\t?>\n";
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
echo "<?php echo \$form->end('Submit');?>\n";
|
echo "<?php echo \$this->Form->end(__('Submit', true));?>\n";
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
<h3><?php echo "<?php __('Actions'); ?>"; ?></h3>
|
||||||
<ul>
|
<ul>
|
||||||
<?php if ($action != 'add'):?>
|
<?php if ($action != 'add'):?>
|
||||||
<li><?php echo "<?php echo \$html->link(__('Delete', true), array('action' => 'delete', \$form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li>
|
<li><?php echo "<?php echo \$this->Html->link(__('Delete', true), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<li><?php echo "<?php echo \$html->link(__('List {$pluralHumanName}', true), array('action' => 'index'));?>";?></li>
|
<li><?php echo "<?php echo \$this->Html->link(sprintf(__('List %s', true), __('{$pluralHumanName}', true)), array('action' => 'index'));?>";?></li>
|
||||||
<?php
|
<?php
|
||||||
$done = array();
|
$done = array();
|
||||||
foreach ($associations as $type => $data) {
|
foreach ($associations as $type => $data) {
|
||||||
foreach ($data as $alias => $details) {
|
foreach ($data as $alias => $details) {
|
||||||
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
|
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
|
||||||
echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
|
||||||
echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
|
||||||
$done[] = $details['controller'];
|
$done[] = $details['controller'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ $output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP
|
||||||
$output .="
|
$output .="
|
||||||
<?php
|
<?php
|
||||||
if (Configure::read() > 0):
|
if (Configure::read() > 0):
|
||||||
Debugger::checkSessionKey();
|
Debugger::checkSecurityKeys();
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
|
@ -24,7 +24,7 @@ endif;
|
||||||
\$settings = Cache::settings();
|
\$settings = Cache::settings();
|
||||||
if (!empty(\$settings)):
|
if (!empty(\$settings)):
|
||||||
echo '<span class=\"notice success\">';
|
echo '<span class=\"notice success\">';
|
||||||
echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. \$settings['engine'] . 'Engine</em>');
|
printf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. \$settings['engine'] . 'Engine</em>');
|
||||||
echo '</span>';
|
echo '</span>';
|
||||||
else:
|
else:
|
||||||
echo '<span class=\"notice\">';
|
echo '<span class=\"notice\">';
|
||||||
|
@ -75,7 +75,7 @@ $output .= "<?php endif;?>\n";
|
||||||
$output .= "<h3><?php __('Editing this Page') ?></h3>\n";
|
$output .= "<h3><?php __('Editing this Page') ?></h3>\n";
|
||||||
$output .= "<p>\n";
|
$output .= "<p>\n";
|
||||||
$output .= "<?php\n";
|
$output .= "<?php\n";
|
||||||
$output .= "\techo sprintf(__('To change the content of this page, edit: %s\n";
|
$output .= "\tprintf(__('To change the content of this page, edit: %s\n";
|
||||||
$output .= "\t\tTo change its layout, edit: %s\n";
|
$output .= "\t\tTo change its layout, edit: %s\n";
|
||||||
$output .= "\t\tYou can also add some CSS styles for your pages at: %s', true),\n";
|
$output .= "\t\tYou can also add some CSS styles for your pages at: %s', true),\n";
|
||||||
$output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n";
|
$output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n";
|
||||||
|
|
|
@ -1,41 +1,28 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.templates.views
|
* @subpackage cake.cake.console.libs.templates.views
|
||||||
* @since CakePHP(tm) v 1.2.0.5234
|
* @since CakePHP(tm) v 1.2.0.5234
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo $pluralVar;?> index">
|
<div class="<?php echo $pluralVar;?> index">
|
||||||
<h2><?php echo "<?php __('{$pluralHumanName}');?>";?></h2>
|
<h2><?php echo "<?php __('{$pluralHumanName}');?>";?></h2>
|
||||||
<p>
|
|
||||||
<?php echo "<?php
|
|
||||||
echo \$paginator->counter(array(
|
|
||||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
|
||||||
));
|
|
||||||
?>";?>
|
|
||||||
</p>
|
|
||||||
<table cellpadding="0" cellspacing="0">
|
<table cellpadding="0" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<?php foreach ($fields as $field):?>
|
<?php foreach ($fields as $field):?>
|
||||||
<th><?php echo "<?php echo \$paginator->sort('{$field}');?>";?></th>
|
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}');?>";?></th>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
<th class="actions"><?php echo "<?php __('Actions');?>";?></th>
|
<th class="actions"><?php echo "<?php __('Actions');?>";?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -55,42 +42,51 @@ foreach (\${$pluralVar} as \${$singularVar}):
|
||||||
foreach ($associations['belongsTo'] as $alias => $details) {
|
foreach ($associations['belongsTo'] as $alias => $details) {
|
||||||
if ($field === $details['foreignKey']) {
|
if ($field === $details['foreignKey']) {
|
||||||
$isKey = true;
|
$isKey = true;
|
||||||
echo "\t\t<td>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t</td>\n";
|
echo "\t\t<td>\n\t\t\t<?php echo \$this->Html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t</td>\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($isKey !== true) {
|
if ($isKey !== true) {
|
||||||
echo "\t\t<td>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?>\n\t\t</td>\n";
|
echo "\t\t<td><?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?> </td>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "\t\t<td class=\"actions\">\n";
|
echo "\t\t<td class=\"actions\">\n";
|
||||||
echo "\t\t\t<?php echo \$html->link(__('View', true), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
echo "\t\t\t<?php echo \$this->Html->link(__('View', true), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
||||||
echo "\t\t\t<?php echo \$html->link(__('Edit', true), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
echo "\t\t\t<?php echo \$this->Html->link(__('Edit', true), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
||||||
echo "\t\t\t<?php echo \$html->link(__('Delete', true), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
echo "\t\t\t<?php echo \$this->Html->link(__('Delete', true), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
||||||
echo "\t\t</td>\n";
|
echo "\t\t</td>\n";
|
||||||
echo "\t</tr>\n";
|
echo "\t</tr>\n";
|
||||||
|
|
||||||
echo "<?php endforeach; ?>\n";
|
echo "<?php endforeach; ?>\n";
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
<p>
|
||||||
|
<?php echo "<?php
|
||||||
|
echo \$this->Paginator->counter(array(
|
||||||
|
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||||
|
));
|
||||||
|
?>";?>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="paging">
|
<div class="paging">
|
||||||
<?php echo "\t<?php echo \$paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?>
|
<?php echo "\t<?php echo \$this->Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?>
|
||||||
| <?php echo "\t<?php echo \$paginator->numbers();?>\n"?>
|
| <?php echo "\t<?php echo \$this->Paginator->numbers();?>\n"?> |
|
||||||
<?php echo "\t<?php echo \$paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>\n";?>
|
<?php echo "\t<?php echo \$this->Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>\n";?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
<h3><?php echo "<?php __('Actions'); ?>"; ?></h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo "<?php echo \$html->link(__('New {$singularHumanName}', true), array('action' => 'add')); ?>";?></li>
|
<li><?php echo "<?php echo \$this->Html->link(sprintf(__('New %s', true), __('{$singularHumanName}', true)), array('action' => 'add')); ?>";?></li>
|
||||||
<?php
|
<?php
|
||||||
$done = array();
|
$done = array();
|
||||||
foreach ($associations as $type => $data) {
|
foreach ($associations as $type => $data) {
|
||||||
foreach ($data as $alias => $details) {
|
foreach ($data as $alias => $details) {
|
||||||
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
|
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
|
||||||
echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
|
||||||
echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
|
||||||
$done[] = $details['controller'];
|
$done[] = $details['controller'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.templates.views
|
* @subpackage cake.cake.console.libs.templates.views
|
||||||
* @since CakePHP(tm) v 1.2.0.5234
|
* @since CakePHP(tm) v 1.2.0.5234
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo $pluralVar;?> view">
|
<div class="<?php echo $pluralVar;?> view">
|
||||||
|
@ -34,7 +28,7 @@ foreach ($fields as $field) {
|
||||||
if ($field === $details['foreignKey']) {
|
if ($field === $details['foreignKey']) {
|
||||||
$isKey = true;
|
$isKey = true;
|
||||||
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize(Inflector::underscore($alias)) . "'); ?></dt>\n";
|
echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('" . Inflector::humanize(Inflector::underscore($alias)) . "'); ?></dt>\n";
|
||||||
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t \n\t\t</dd>\n";
|
echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \$this->Html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t \n\t\t</dd>\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,19 +42,20 @@ foreach ($fields as $field) {
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
<h3><?php echo "<?php __('Actions'); ?>"; ?></h3>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
echo "\t\t<li><?php echo \$html->link(__('Edit {$singularHumanName}', true), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('Edit %s', true), __('{$singularHumanName}', true)), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
|
||||||
echo "\t\t<li><?php echo \$html->link(__('Delete {$singularHumanName}', true), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('Delete %s', true), __('{$singularHumanName}', true)), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
|
||||||
echo "\t\t<li><?php echo \$html->link(__('List {$pluralHumanName}', true), array('action' => 'index')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('List %s', true), __('{$pluralHumanName}', true)), array('action' => 'index')); ?> </li>\n";
|
||||||
echo "\t\t<li><?php echo \$html->link(__('New {$singularHumanName}', true), array('action' => 'add')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('{$singularHumanName}', true)), array('action' => 'add')); ?> </li>\n";
|
||||||
|
|
||||||
$done = array();
|
$done = array();
|
||||||
foreach ($associations as $type => $data) {
|
foreach ($associations as $type => $data) {
|
||||||
foreach ($data as $alias => $details) {
|
foreach ($data as $alias => $details) {
|
||||||
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
|
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
|
||||||
echo "\t\t<li><?php echo \$html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
|
||||||
echo "\t\t<li><?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
|
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
|
||||||
$done[] = $details['controller'];
|
$done[] = $details['controller'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +67,7 @@ foreach ($fields as $field) {
|
||||||
if (!empty($associations['hasOne'])) :
|
if (!empty($associations['hasOne'])) :
|
||||||
foreach ($associations['hasOne'] as $alias => $details): ?>
|
foreach ($associations['hasOne'] as $alias => $details): ?>
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<h3><?php echo "<?php __('Related " . Inflector::humanize($details['controller']) . "');?>";?></h3>
|
<h3><?php echo "<?php printf(__('Related %s', true), __('" . Inflector::humanize($details['controller']) . "', true));?>";?></h3>
|
||||||
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
|
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
|
||||||
<dl><?php echo "\t<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?>
|
<dl><?php echo "\t<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?>
|
||||||
<?php
|
<?php
|
||||||
|
@ -85,7 +80,7 @@ if (!empty($associations['hasOne'])) :
|
||||||
<?php echo "<?php endif; ?>\n";?>
|
<?php echo "<?php endif; ?>\n";?>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo "<?php echo \$html->link(__('Edit " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?>
|
<li><?php echo "<?php echo \$this->Html->link(sprintf(__('Edit %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -105,7 +100,7 @@ foreach ($relations as $alias => $details):
|
||||||
$otherPluralHumanName = Inflector::humanize($details['controller']);
|
$otherPluralHumanName = Inflector::humanize($details['controller']);
|
||||||
?>
|
?>
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<h3><?php echo "<?php __('Related {$otherPluralHumanName}');?>";?></h3>
|
<h3><?php echo "<?php printf(__('Related %s', true), __('{$otherPluralHumanName}', true));?>";?></h3>
|
||||||
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
|
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?>
|
||||||
<table cellpadding = "0" cellspacing = "0">
|
<table cellpadding = "0" cellspacing = "0">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -132,9 +127,9 @@ echo "\t<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "\t\t\t<td class=\"actions\">\n";
|
echo "\t\t\t<td class=\"actions\">\n";
|
||||||
echo "\t\t\t\t<?php echo \$html->link(__('View', true), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
|
echo "\t\t\t\t<?php echo \$this->Html->link(__('View', true), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
|
||||||
echo "\t\t\t\t<?php echo \$html->link(__('Edit', true), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
|
echo "\t\t\t\t<?php echo \$this->Html->link(__('Edit', true), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
|
||||||
echo "\t\t\t\t<?php echo \$html->link(__('Delete', true), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
|
echo "\t\t\t\t<?php echo \$this->Html->link(__('Delete', true), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
|
||||||
echo "\t\t\t</td>\n";
|
echo "\t\t\t</td>\n";
|
||||||
echo "\t\t</tr>\n";
|
echo "\t\t</tr>\n";
|
||||||
|
|
||||||
|
@ -144,7 +139,7 @@ echo "\t<?php endforeach; ?>\n";
|
||||||
<?php echo "<?php endif; ?>\n\n";?>
|
<?php echo "<?php endif; ?>\n\n";?>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo "<?php echo \$html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?> </li>
|
<li><?php echo "<?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?> </li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
|
@ -9,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app
|
* @subpackage cake.app
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
|
@ -9,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake
|
* @subpackage cake.cake
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
App::import('Helper', 'Helper', false);
|
App::import('Helper', 'Helper', false);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application model for Cake.
|
* Application model for Cake.
|
||||||
*
|
*
|
||||||
|
@ -9,22 +7,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app
|
* @subpackage cake.app
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
;<?php die() ?>
|
;<?php exit() ?>
|
||||||
; SVN FILE: $Id$
|
; SVN FILE: $Id$
|
||||||
;/**
|
;/**
|
||||||
; * Short description for file.
|
; * Short description for file.
|
||||||
|
@ -6,22 +6,18 @@
|
||||||
; *
|
; *
|
||||||
; * PHP versions 4 and 5
|
; * PHP versions 4 and 5
|
||||||
; *
|
; *
|
||||||
; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/
|
; * CakePHP(tm) : Rapid Development Framework http://cakephp.org/
|
||||||
; * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
; * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
; *
|
; *
|
||||||
; * Licensed under The MIT License
|
; * Licensed under The MIT License
|
||||||
; * Redistributions of files must retain the above copyright notice.
|
; * Redistributions of files must retain the above copyright notice.
|
||||||
; *
|
; *
|
||||||
; * @filesource
|
; * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
; * @link http://cakephp.org CakePHP(tm) Project
|
||||||
; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
; * @package cake
|
; * @package cake
|
||||||
; * @subpackage cake.app.config
|
; * @subpackage cake.app.config
|
||||||
; * @since CakePHP(tm) v 0.10.0.1076
|
; * @since CakePHP(tm) v 0.10.0.1076
|
||||||
; * @version $Revision$
|
; * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
; * @modifiedby $LastChangedBy$
|
|
||||||
; * @lastmodified $Date$
|
|
||||||
; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
; */
|
; */
|
||||||
|
|
||||||
; acl.ini.php - Cake ACL Configuration
|
; acl.ini.php - Cake ACL Configuration
|
||||||
|
|
|
@ -8,17 +8,17 @@
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config
|
* @subpackage cake.app.config
|
||||||
* @since CakePHP(tm) v 0.10.8.2117
|
* @since CakePHP(tm) v 0.10.8.2117
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is core configuration file.
|
* This is core configuration file.
|
||||||
*
|
*
|
||||||
|
@ -8,22 +6,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config
|
* @subpackage cake.app.config
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,6 +36,21 @@
|
||||||
*/
|
*/
|
||||||
Configure::write('debug', 2);
|
Configure::write('debug', 2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CakePHP Log Level:
|
||||||
|
*
|
||||||
|
* In case of Production Mode CakePHP gives you the possibility to continue logging errors.
|
||||||
|
*
|
||||||
|
* The following parameters can be used:
|
||||||
|
* Boolean: Set true/false to activate/deactivate logging
|
||||||
|
* Configure::write('log', true);
|
||||||
|
*
|
||||||
|
* Integer: Use built-in PHP constants to set the error level (see error_reporting)
|
||||||
|
* Configure::write('log', E_ERROR | E_WARNING);
|
||||||
|
* Configure::write('log', E_ALL ^ E_NOTICE);
|
||||||
|
*/
|
||||||
|
Configure::write('log', true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application wide charset encoding
|
* Application wide charset encoding
|
||||||
*/
|
*/
|
||||||
|
@ -68,9 +77,25 @@
|
||||||
*
|
*
|
||||||
* 'admin' -> admin_index() and /admin/controller/index
|
* 'admin' -> admin_index() and /admin/controller/index
|
||||||
* 'superuser' -> superuser_index() and /superuser/controller/index
|
* 'superuser' -> superuser_index() and /superuser/controller/index
|
||||||
|
*
|
||||||
|
* [Note Routing.admin is deprecated in 1.3. Use Routing.prefixes instead]
|
||||||
*/
|
*/
|
||||||
//Configure::write('Routing.admin', 'admin');
|
//Configure::write('Routing.admin', 'admin');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uncomment the define below to use CakePHP prefix routes.
|
||||||
|
*
|
||||||
|
* Set to an array of prefixes you want to use in your application. Use for
|
||||||
|
* admin or other prefixed routes.
|
||||||
|
*
|
||||||
|
* Routing.prefixes = array('admin', 'manager');
|
||||||
|
*
|
||||||
|
* Enables:
|
||||||
|
* `admin_index()` and `/admin/controller/index`
|
||||||
|
* `manager_index()` and `/manager/controller/index`
|
||||||
|
*/
|
||||||
|
//Configure::write('Routing.prefixes', array('admin'));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turn off all caching application-wide.
|
* Turn off all caching application-wide.
|
||||||
*
|
*
|
||||||
|
@ -104,17 +129,32 @@
|
||||||
* To define a custom session handler, save it at /app/config/<name>.php.
|
* To define a custom session handler, save it at /app/config/<name>.php.
|
||||||
* Set the value of 'Session.save' to <name> to utilize it in CakePHP.
|
* Set the value of 'Session.save' to <name> to utilize it in CakePHP.
|
||||||
*
|
*
|
||||||
* To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql.
|
* To use database sessions, run the app/config/schema/sessions.php schema using
|
||||||
|
* the cake shell command: cake schema run create Sessions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Configure::write('Session.save', 'php');
|
Configure::write('Session.save', 'php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The model name to be used for the session model.
|
||||||
|
*
|
||||||
|
* 'Session.save' must be set to 'database' in order to utilize this constant.
|
||||||
|
*
|
||||||
|
* The model name set here should *not* be used elsewhere in your application.
|
||||||
|
*/
|
||||||
|
//Configure::write('Session.model', 'Session');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the table used to store CakePHP database sessions.
|
* The name of the table used to store CakePHP database sessions.
|
||||||
*
|
*
|
||||||
* 'Session.save' must be set to 'database' in order to utilize this constant.
|
* '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.
|
* The table name set here should *not* include any table prefix defined elsewhere.
|
||||||
|
*
|
||||||
|
* Please note that if you set a value for Session.model (above), any value set for
|
||||||
|
* Session.table will be ignored.
|
||||||
|
*
|
||||||
|
* [Note: Session.table is deprecated as of CakePHP 1.3]
|
||||||
*/
|
*/
|
||||||
//Configure::write('Session.table', 'cake_sessions');
|
//Configure::write('Session.table', 'cake_sessions');
|
||||||
|
|
||||||
|
@ -159,13 +199,18 @@
|
||||||
* CakePHP session IDs are also regenerated between requests if
|
* CakePHP session IDs are also regenerated between requests if
|
||||||
* 'Security.level' is set to 'high'.
|
* 'Security.level' is set to 'high'.
|
||||||
*/
|
*/
|
||||||
Configure::write('Security.level', 'high');
|
Configure::write('Security.level', 'medium');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A random string used in security hashing methods.
|
* A random string used in security hashing methods.
|
||||||
*/
|
*/
|
||||||
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
|
Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A random numeric string (digits only) used to encrypt/decrypt strings.
|
||||||
|
*/
|
||||||
|
Configure::write('Security.cipherSeed', '76859309657453542496749683645');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compress CSS output by removing comments, whitespace, repeating tags, etc.
|
* 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.
|
* This requires a/var/cache directory to be writable by the web server for caching.
|
||||||
|
@ -190,6 +235,12 @@
|
||||||
Configure::write('Acl.classname', 'DbAcl');
|
Configure::write('Acl.classname', 'DbAcl');
|
||||||
Configure::write('Acl.database', 'default');
|
Configure::write('Acl.database', 'default');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If you are on PHP 5.3 uncomment this line and correct your server timezone
|
||||||
|
* to fix the date & time related errors.
|
||||||
|
*/
|
||||||
|
//date_default_timezone_set('UTC');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you are on PHP 5.3 uncomment this line and correct your server timezone
|
* If you are on PHP 5.3 uncomment this line and correct your server timezone
|
||||||
* to fix the date & time related errors.
|
* to fix the date & time related errors.
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
/**
|
/**
|
||||||
* This is core configuration file.
|
* This is core configuration file.
|
||||||
*
|
*
|
||||||
|
@ -7,22 +6,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config
|
* @subpackage cake.app.config
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* In this file you set up your database connection details.
|
* In this file you set up your database connection details.
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
<?php
|
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
||||||
*
|
|
||||||
* Licensed under The MIT License
|
|
||||||
* Redistributions of files must retain the above copyright notice.
|
|
||||||
*
|
|
||||||
* @filesource
|
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
||||||
* @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$
|
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @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);
|
|
||||||
?>
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short description for file.
|
* Short description for file.
|
||||||
*
|
*
|
||||||
|
@ -10,22 +8,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config
|
* @subpackage cake.app.config
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
|
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,22 +8,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config.sql
|
* @subpackage cake.app.config.sql
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
|
@ -1,10 +1,10 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# Copyright 2005-2008, Cake Software Foundation, Inc.
|
# Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# Licensed under The MIT License
|
# Licensed under The MIT License
|
||||||
# Redistributions of files must retain the above copyright notice.
|
# Redistributions of files must retain the above copyright notice.
|
||||||
# http://www.opensource.org/licenses/mit-license.php The MIT License
|
# MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
|
||||||
CREATE TABLE acos (
|
CREATE TABLE acos (
|
||||||
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
|
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,22 +8,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config.sql
|
* @subpackage cake.app.config.sql
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
|
@ -1,10 +1,10 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# Copyright 2005-2008, Cake Software Foundation, Inc.
|
# Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# Licensed under The MIT License
|
# Licensed under The MIT License
|
||||||
# Redistributions of files must retain the above copyright notice.
|
# Redistributions of files must retain the above copyright notice.
|
||||||
# http://www.opensource.org/licenses/mit-license.php The MIT License
|
# MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
|
||||||
CREATE TABLE i18n (
|
CREATE TABLE i18n (
|
||||||
id int(10) NOT NULL auto_increment,
|
id int(10) NOT NULL auto_increment,
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
|
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,22 +8,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app.config.sql
|
* @subpackage cake.app.config.sql
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
|
@ -1,12 +1,12 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# Copyright 2005-2008, Cake Software Foundation, Inc.
|
# Copyright 2005-2009, Cake Software Foundation, Inc.
|
||||||
# 1785 E. Sahara Avenue, Suite 490-204
|
# 1785 E. Sahara Avenue, Suite 490-204
|
||||||
# Las Vegas, Nevada 89104
|
# Las Vegas, Nevada 89104
|
||||||
#
|
#
|
||||||
# Licensed under The MIT License
|
# Licensed under The MIT License
|
||||||
# Redistributions of files must retain the above copyright notice.
|
# Redistributions of files must retain the above copyright notice.
|
||||||
# http://www.opensource.org/licenses/mit-license.php The MIT License
|
# MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
|
||||||
CREATE TABLE cake_sessions (
|
CREATE TABLE cake_sessions (
|
||||||
id varchar(255) NOT NULL default '',
|
id varchar(255) NOT NULL default '',
|
|
@ -1,6 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static content controller.
|
* Static content controller.
|
||||||
*
|
*
|
||||||
|
@ -8,22 +6,18 @@
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.controller
|
* @subpackage cake.cake.libs.controller
|
||||||
* @since CakePHP(tm) v 0.2.9
|
* @since CakePHP(tm) v 0.2.9
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,7 +79,7 @@ class PagesController extends AppController {
|
||||||
$title = Inflector::humanize($path[$count - 1]);
|
$title = Inflector::humanize($path[$count - 1]);
|
||||||
}
|
}
|
||||||
$this->set(compact('page', 'subpage', 'title'));
|
$this->set(compact('page', 'subpage', 'title'));
|
||||||
$this->render(join('/', $path));
|
$this->render(implode('/', $path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,19 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.app
|
* @subpackage cake.app
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
|
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
|
||||||
?>
|
?>
|
0
cake/console/templates/skel/libs/empty
Normal file
0
cake/console/templates/skel/libs/empty
Normal file
|
@ -1,26 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.view.templates.elements.email.html
|
* @subpackage cake.cake.libs.view.templates.elements.email.html
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -1,26 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.view.templates.elements.email.text
|
* @subpackage cake.cake.libs.view.templates.elements.email.text
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<?php echo $content; ?>
|
<?php echo $content; ?>
|
|
@ -1,26 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.view.templates.layouts
|
* @subpackage cake.cake.libs.view.templates.layouts
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<?php echo $content_for_layout; ?>
|
<?php echo $content_for_layout; ?>
|
|
@ -1,40 +1,34 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.console.libs.templates.skel.views.layouts
|
* @subpackage cake.cake.console.libs.templates.skel.views.layouts
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @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">
|
<!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">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<?php echo $html->charset(); ?>
|
<?php echo $this->Html->charset(); ?>
|
||||||
<title>
|
<title>
|
||||||
<?php __('CakePHP: the rapid development php framework:'); ?>
|
<?php __('CakePHP: the rapid development php framework:'); ?>
|
||||||
<?php echo $title_for_layout; ?>
|
<?php echo $title_for_layout; ?>
|
||||||
</title>
|
</title>
|
||||||
<?php
|
<?php
|
||||||
echo $html->meta('icon');
|
echo $this->Html->meta('icon');
|
||||||
|
|
||||||
echo $html->css('cake.generic');
|
echo $this->Html->css('cake.generic');
|
||||||
|
|
||||||
echo $scripts_for_layout;
|
echo $scripts_for_layout;
|
||||||
?>
|
?>
|
||||||
|
@ -42,24 +36,24 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<h1><?php echo $html->link(__('CakePHP: the rapid development php framework', true), 'http://cakephp.org'); ?></h1>
|
<h1><?php echo $this->Html->link(__('CakePHP: the rapid development php framework', true), 'http://cakephp.org'); ?></h1>
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
|
||||||
<?php $session->flash(); ?>
|
<?php echo $this->Session->flash(); ?>
|
||||||
|
|
||||||
<?php echo $content_for_layout; ?>
|
<?php echo $content_for_layout; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<?php echo $html->link(
|
<?php echo $this->Html->link(
|
||||||
$html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework", true), 'border'=>"0")),
|
$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
|
||||||
'http://www.cakephp.org/',
|
'http://www.cakephp.org/',
|
||||||
array('target'=>'_blank'), null, false
|
array('target' => '_blank', 'escape' => false)
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo $cakeDebug; ?>
|
<?php echo $this->element('sql_dump'); ?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,26 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.view.templates.layouts.email.html
|
* @subpackage cake.cake.libs.view.templates.layouts.email.html
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||||
|
|
|
@ -1,26 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.view.templates.layouts.email.text
|
* @subpackage cake.cake.libs.view.templates.layouts.email.text
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,26 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||||
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
*
|
*
|
||||||
* Licensed under The MIT License
|
* Licensed under The MIT License
|
||||||
* Redistributions of files must retain the above copyright notice.
|
* Redistributions of files must retain the above copyright notice.
|
||||||
*
|
*
|
||||||
* @filesource
|
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||||
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
* @link http://cakephp.org CakePHP(tm) Project
|
||||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.cake.libs.view.templates.layouts
|
* @subpackage cake.cake.libs.view.templates.layouts
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @version $Revision$
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
* @modifiedby $LastChangedBy$
|
|
||||||
* @lastmodified $Date$
|
|
||||||
* @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">
|
<!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">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<?php echo $html->charset(); ?>
|
<?php echo $this->Html->charset(); ?>
|
||||||
<title><?php echo $page_title; ?></title>
|
<title><?php echo $page_title; ?></title>
|
||||||
|
|
||||||
<?php if (Configure::read() == 0) { ?>
|
<?php if (Configure::read() == 0) { ?>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
<?php e($xml->header()); ?>
|
<?php echo $xml->header(); ?>
|
||||||
<?php echo $content_for_layout; ?>
|
<?php echo $content_for_layout; ?>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue