Merge commit 'upstream/1.3' into 1.3-email_component

This commit is contained in:
Phally 2010-01-21 00:05:03 +01:00
commit 984dc50f37
577 changed files with 21737 additions and 17239 deletions

8
.gitignore vendored
View file

@ -1,4 +1,4 @@
app/config
app/tmp
plugins
vendors
/app/config
/app/tmp
/plugins
/vendors

View file

@ -6,22 +6,18 @@
; *
; * 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)
; * CakePHP(tm) : Rapid Development Framework http://cakephp.org/
; * Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
; * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
; * @link http://cakephp.org CakePHP(tm) Project
; * @package cake
; * @subpackage cake.app.config
; * @since CakePHP(tm) v 0.10.0.1076
; * @version $Revision$
; * @modifiedby $LastChangedBy$
; * @lastmodified $Date$
; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
; * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
; */
; acl.ini.php - Cake ACL Configuration

View file

@ -8,17 +8,17 @@
* PHP versions 4 and 5
*
* 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
* 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
* @package cake
* @subpackage cake.app.config
* @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/'),
* 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
* '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/'),
* 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
* 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),

View file

@ -1,5 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* This is core configuration file.
*
@ -7,23 +6,20 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* CakePHP Debug Level:
*
@ -33,16 +29,32 @@
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
* 3: As in 2, but also with full controller dump.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 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
*/
Configure::write('App.encoding', 'UTF-8');
/**
* To configure CakePHP *not* to use mod_rewrite and to
* use CakePHP pretty URLs, remove these .htaccess
@ -55,22 +67,32 @@
* And uncomment the App.baseUrl below:
*/
//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
* and its associated controller actions:
* The value of the define determines the names of the routes
* and their associated controller actions:
*
* 'admin' -> admin_index() and /admin/controller/index
* 'superuser' -> superuser_index() and /superuser/controller/index
* 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`
*
* [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.
*
*/
//Configure::write('Cache.disable', true);
/**
* Enable cache checking.
*
@ -81,11 +103,13 @@
*
*/
//Configure::write('Cache.check', true);
/**
* Defines the default error type when using the log() function. Used for
* differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
*/
define('LOG_ERROR', 2);
/**
* The preferred session handling method. Valid values:
*
@ -101,6 +125,7 @@
*
*/
Configure::write('Session.save', 'php');
/**
* 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.
*/
//Configure::write('Session.model', 'Session');
/**
* 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]
*/
//Configure::write('Session.table', 'cake_sessions');
/**
* The DATABASE_CONFIG::$var to use for database session handling.
*
* 'Session.save' must be set to 'database' in order to utilize this constant.
*/
//Configure::write('Session.database', 'default');
/**
* The name of CakePHP's session cookie.
*/
Configure::write('Session.cookie', 'CAKEPHP');
/**
* Session time out time (in seconds).
* Actual value depends on 'Security.level' setting.
*/
Configure::write('Session.timeout', '120');
/**
* If set to false, sessions are not automatically started.
*/
Configure::write('Session.start', true);
/**
* When set to false, HTTP_USER_AGENT will not be checked
* in the session
*/
Configure::write('Session.checkAgent', true);
/**
* The level of CakePHP security. The session timeout time defined
* in 'Session.timeout' is multiplied according to the settings here.
@ -158,11 +190,27 @@
* CakePHP session IDs are also regenerated between requests if
* 'Security.level' is set to 'high'.
*/
Configure::write('Security.level', 'high');
Configure::write('Security.level', 'medium');
/**
* A random string used in security hashing methods.
*/
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.
* 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().
*/
//Configure::write('Asset.filter.css', 'css.php');
/**
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
* output, and setting the config below to the name of the script.
@ -178,17 +227,20 @@
* To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
*/
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
* The classname and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
* 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');
/**
*
* Cache Engine Configuration

View file

@ -1,5 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
@ -9,22 +8,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',

View file

@ -1,5 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
/**
* This is Acl Schema file
@ -8,22 +7,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/*
*

View file

@ -1,5 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
/**
* This is i18n Schema file
@ -8,22 +7,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/*
*

View file

@ -1,5 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
/**
* This is Sessions Schema file
@ -8,22 +7,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/*
*

View file

@ -1,24 +1,19 @@
<?php
/* SVN FILE: $Id$ */
/**
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
?>

0
app/views/pages/empty Normal file
View file

View file

@ -1,28 +1,21 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.webroot
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
header('HTTP/1.1 404 Not Found');

View file

@ -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)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.webroot.css
* @since CakePHP(tm)
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
* {
@ -26,7 +21,7 @@
padding:0;
}
/* General Style Info */
/** General Style Info **/
body {
background: #003d4c;
color: #fff;
@ -35,14 +30,12 @@ body {
margin: 0;
}
a {
background:#fff;
color: #003d4c;
text-decoration: underline;
font-weight: bold;
}
a:hover {
background:#fff;
color: #003d4c;
color: #367889;
text-decoration:none;
}
a img {
@ -50,37 +43,33 @@ a img {
}
h1, h2, h3, h4 {
font-weight: normal;
margin-bottom:0.5em;
}
h1 {
background:#fff;
color: #003d4c;
font-size: 100%;
margin: 0.1em 0;
}
h2 {
background:#fff;
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%;
margin: 0.3em 0;
padding-top: 0.8em;
}
h3 {
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%;
padding-top: 1.5em;
}
h4 {
color: #993;
font-weight: normal;
padding-top: 0.5em;
}
ul, li {
margin: 0 12px;
}
/* Layout */
/** Layout **/
#container {
text-align: left;
}
@ -89,7 +78,8 @@ ul, li {
padding: 10px 20px;
}
#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;
padding: 0px 30px;
}
@ -117,10 +107,29 @@ ul, li {
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 {
background: #fff;
border:1px solid #ccc;
border-right:0;
clear: both;
color: #333;
@ -128,39 +137,42 @@ table {
width: 100%;
}
th {
background: #f2f2f2;
border:1px solid #bbb;
border-top: 1px solid #fff;
border-left: 1px solid #fff;
text-align: center;
border:0;
border-bottom:2px solid #555;
text-align: left;
padding:4px;
}
th a {
background:#f2f2f2;
display: block;
padding: 2px 4px;
text-decoration: none;
}
th a:hover {
background: #ccc;
color: #333;
text-decoration: none;
th a.asc:after {
content: ' ⇣';
}
th a.desc:after {
content: ' ⇡';
}
table tr td {
background: #fff;
border-right: 1px solid #ccc;
padding: 4px;
text-align: center;
padding: 6px;
text-align: left;
vertical-align: top;
border-bottom:1px solid #ddd;
}
table tr.altrow td {
background: #f4f4f4;
table tr:nth-child(2n) td {
background: #f5f5f5;
}
table .altrow td {
background: #f5f5f5;
}
td.actions {
text-align: center;
white-space: nowrap;
}
td.actions a {
table td.actions a {
margin: 0px 6px;
padding:2px 5px;
}
.cake-sql-log table {
background: #f4f4f4;
@ -168,33 +180,36 @@ td.actions a {
.cake-sql-log td {
padding: 4px 8px;
text-align: left;
font-family: Monaco, Consolas, "Courier New", monospaced;
}
.cake-sql-log caption {
color:#fff;
}
/* Paging */
/** Paging **/
div.paging {
background:#fff;
color: #ccc;
margin-bottom: 2em;
margin-top: 1em;
clear:both;
}
div.paging div.disabled {
div.paging span.disabled {
color: #ddd;
display: inline;
}
div.paging span {
}
div.paging span.current {
color: #000;
color: #c73e14;
}
div.paging span a {
}
/* Scaffold View */
/** Scaffold View **/
dl {
line-height: 2em;
margin: 0em 0em;
width: 60%;
}
dl.altrow {
dl .altrow {
background: #f4f4f4;
}
dt {
@ -208,16 +223,16 @@ dd {
vertical-align: top;
}
/* Forms */
/** Forms **/
form {
clear: both;
margin-right: 20px;
padding: 0;
width: 80%;
width: 95%;
}
fieldset {
border: 1px solid #ccc;
margin-top: 30px;
margin-bottom: 1em;
padding: 16px 20px;
}
fieldset legend {
@ -245,30 +260,33 @@ form div {
padding: .5em;
vertical-align: text-top;
}
form div.input {
form .input {
color: #444;
}
form div.required {
color: #333;
form .required {
font-weight: bold;
}
form .required label:after {
color: #e32;
content: '*';
display:inline;
}
form div.submit {
border: 0;
clear: both;
margin-top: 10px;
margin-left: 140px;
}
label {
display: block;
font-size: 110%;
padding-right: 20px;
margin-bottom:3px;
}
input, textarea {
clear: both;
font-size: 140%;
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
padding: 2px;
width: 100%;
padding: 1%;
width:98%;
}
select {
clear: both;
@ -288,6 +306,9 @@ input[type=checkbox] {
margin: 0px 6px 7px 2px;
width: auto;
}
div.checkbox label {
display: inline;
}
input[type=radio] {
float:left;
width:auto;
@ -299,23 +320,37 @@ div.radio label {
input[type=submit] {
display: inline;
font-size: 110%;
padding: 2px 5px;
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 {
clear: both;
color: #900;
color: #fff;
font-size: 140%;
font-weight: bold;
margin: 1em 0;
margin: 0 0 1em 0;
background: #c73e14;
padding: 5px;
}
div.error-message {
clear: both;
color: #900;
color: #fff;
font-weight: bold;
background: #c73e14;
}
p.error {
background-color: #e32;
@ -346,35 +381,57 @@ p.error em {
color: #fff;
}
/* Actions */
/** Actions **/
div.actions ul {
margin: 0px 0;
margin: 0;
padding: 0;
}
div.actions li {
display: inline;
margin:0 0 0.5em 0;
list-style-type: none;
line-height: 2em;
margin: 0 2em 0 0;
white-space: nowrap;
padding: 0;
}
div.actions ul li a {
background:#fff;
color: #003d4c;
text-decoration: none;
font-weight: normal;
display: block;
clear: both;
}
div.actions ul li a:hover {
color: #333;
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 {
clear: both;
display: block;
}
/* Debugging */
/** Debugging **/
pre {
color: #000;
background: #f0f0f0;
@ -390,7 +447,6 @@ pre.cake-debug {
}
div.cake-stack-trace {
background: #fff;
border: 4px dotted #ffcc00;
color: #333;
margin: 0px;
padding: 6px;

0
app/webroot/files/empty Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

View file

@ -17,7 +17,7 @@
* @package cake
* @subpackage cake.app.webroot
* @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

0
app/webroot/js/empty Normal file
View file

View 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');
?>

View file

@ -1,39 +1,23 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
* Web Access Frontend for TestSuite
*
* PHP versions 4 and 5
*
* 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
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake
* @subpackage cake.cake.tests.libs
* @since CakePHP(tm) v 1.2.0.4433
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @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);
ini_set('memory_limit','128M');
ini_set('display_errors', 1);
/**
* 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);
}
require_once CAKE_TESTS_LIB . 'test_manager.php';
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
}
if (!isset($_SERVER['SERVER_NAME'])) {
$_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);
require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
if (isset($_GET['output']) && $_GET['output'] == 'html') {
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML);
} else {
Debugger::output('txt');
define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT);
}
$Dispatcher = new CakeTestSuiteDispatcher();
$Dispatcher->dispatch();
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;
?>

View file

@ -1,7 +1,7 @@
The MIT License
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
copy of this software and associated documentation files (the "Software"),

View file

@ -17,5 +17,4 @@
// @license MIT License (http://www.opensource.org/licenses/mit-license.php)
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
1.3.0.0
1.3.0-beta

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Basic Cake functionality.
*
@ -8,34 +6,30 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Basic defines for timing functions.
*/
define('SECOND', 1);
define('MINUTE', 60 * SECOND);
define('HOUR', 60 * MINUTE);
define('DAY', 24 * HOUR);
define('WEEK', 7 * DAY);
define('MONTH', 30 * DAY);
define('YEAR', 365 * DAY);
define('MINUTE', 60);
define('HOUR', 3600);
define('DAY', 86400);
define('WEEK', 604800);
define('MONTH', 2592000);
define('YEAR', 31536000);
/**
* Patch for PHP < 5.0
@ -54,9 +48,8 @@ if (!function_exists('clone')) {
* Loads configuration files. Receives a set of configuration files
* to load.
* Example:
* <code>
* config('config1', 'config2');
* </code>
*
* `config('config1', 'config2');`
*
* @return boolean Success
*/
@ -84,12 +77,11 @@ if (!function_exists('clone')) {
* Loads component/components from LIBS. Takes optional number of parameters.
*
* Example:
* <code>
* uses('flay', 'time');
* </code>
*
* `uses('flay', 'time');`
*
* @param string $name Filename without the .php part
* @deprecated
* @deprecated Will be removed in 2.0
*/
function uses() {
$args = func_get_args();
@ -177,6 +169,7 @@ if (!function_exists('array_combine')) {
* @param array $a1 Array to use for keys
* @param array $a2 Array to use for values
* @return mixed Outputs either combined array or false.
* @deprecated Will be removed in 2.0
*/
function array_combine($a1, $a2) {
$a1 = array_values($a1);
@ -211,30 +204,57 @@ if (!function_exists('array_combine')) {
if (is_array($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);
} else {
return htmlspecialchars($text, ENT_QUOTES, $defaultCharset);
}
return htmlspecialchars($text, ENT_QUOTES, $charset);
}
/**
* 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.
*
* Example:
* <code>
* a('a', 'b')
* </code>
*
* `a('a', 'b')`
*
* Would return:
* <code>
* array('a', 'b')
* </code>
*
* `array('a', 'b')`
*
* @return array Array of given parameters
* @link http://book.cakephp.org/view/694/a
* @deprecated Will be removed in 2.0
*/
function a() {
$args = func_get_args();
@ -245,17 +265,16 @@ if (!function_exists('array_combine')) {
* Constructs associative array from pairs of arguments.
*
* Example:
* <code>
* aa('a','b')
* </code>
*
* `aa('a','b')`
*
* Would return:
* <code>
* array('a'=>'b')
* </code>
*
* `array('a'=>'b')`
*
* @return array Associative array
* @link http://book.cakephp.org/view/695/aa
* @deprecated Will be removed in 2.0
*/
function aa() {
$args = func_get_args();
@ -276,6 +295,7 @@ if (!function_exists('array_combine')) {
*
* @param string $text String to echo
* @link http://book.cakephp.org/view/700/e
* @deprecated Will be removed in 2.0
*/
function e($text) {
echo $text;
@ -287,6 +307,7 @@ if (!function_exists('array_combine')) {
* @param string $str String to lowercase
* @return string Lowercased string
* @link http://book.cakephp.org/view/705/low
* @deprecated Will be removed in 2.0
*/
function low($str) {
return strtolower($str);
@ -298,6 +319,7 @@ if (!function_exists('array_combine')) {
* @param string $str String to uppercase
* @return string Uppercased string
* @link http://book.cakephp.org/view/710/up
* @deprecated Will be removed in 2.0
*/
function up($str) {
return strtoupper($str);
@ -311,6 +333,7 @@ if (!function_exists('array_combine')) {
* @param string $subject String to search
* @return string Replaced string
* @link http://book.cakephp.org/view/708/r
* @deprecated Will be removed in 2.0
*/
function r($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
* @return string
* @deprecated Will be removed in 2.0
*/
function params($p) {
if (!is_array($p) || count($p) == 0) {
@ -451,15 +475,16 @@ if (!function_exists('file_put_contents')) {
/**
* 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 mixed $data String or array.
* @return boolean Success
* @deprecated Will be removed in 2.0
*/
function file_put_contents($fileName, $data) {
if (is_array($data)) {
$data = join('', $data);
$data = implode('', $data);
}
$res = @fopen($fileName, 'w+b');
@ -496,7 +521,7 @@ if (!function_exists('file_put_contents')) {
$expires = strtotime($expires, $now);
}
switch (low($target)) {
switch (strtolower($target)) {
case 'cache':
$filename = CACHE . $path;
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
*
* @param mixed $params As String name to be searched for deletion, if name is a directory all files in directory will be deleted.
* If array, names to be searched for deletion.
* If clearCache() without params, all files in app/tmp/cache/views will be deleted
*
* @param mixed $params As String name to be searched for deletion, if name is a directory all files in
* directory will be deleted. If array, names to be searched for deletion. If clearCache() without params,
* all files in app/tmp/cache/views will be deleted
* @param string $type Directory in tmp/cache defaults to view directory
* @param string $ext The file extension you are deleting
* @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.
*
* 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_TIME 2
* LC_COLLATE 3
* LC_MONETARY 4
* LC_MESSAGES 5
* LC_ALL 6
*
* - LC_ALL 0
* - LC_COLLATE 1
* - LC_CTYPE 2
* - LC_MONETARY 3
* - LC_NUMERIC 4
* - LC_TIME 5
* - LC_MESSAGES 6
*
* @param string $domain Domain
* @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.
*
* 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_CTYPE 2
* LC_MONETARY 3
* LC_NUMERIC 4
* LC_TIME 5
* LC_MESSAGES 6
*
* - LC_ALL 0
* - LC_COLLATE 1
* - LC_CTYPE 2
* - LC_MONETARY 3
* - LC_NUMERIC 4
* - LC_TIME 5
* - LC_MESSAGES 6
*
* @param string $domain Domain
* @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.
*
* 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_TIME 2
* LC_COLLATE 3
* LC_MONETARY 4
* LC_MESSAGES 5
* LC_ALL 6
*
* - LC_ALL 0
* - LC_COLLATE 1
* - LC_CTYPE 2
* - LC_MONETARY 3
* - LC_NUMERIC 4
* - LC_TIME 5
* - LC_MESSAGES 6
*
* @param string $msg String to translate
* @param integer $category Category
@ -824,6 +851,7 @@ if (!function_exists('file_put_contents')) {
* @param array First array
* @param array Second array
* @return array Array with different keys
* @deprecated Will be removed in 2.0
*/
if (!function_exists('array_diff_key')) {
function array_diff_key() {
@ -859,6 +887,7 @@ if (!function_exists('file_put_contents')) {
* @param array First array
* @param array Second array
* @return array Array with interesected keys
* @deprecated Will be removed in 2.0
*/
if (!function_exists('array_intersect_key')) {
function array_intersect_key($arr1, $arr2) {
@ -930,6 +959,7 @@ if (!function_exists('file_put_contents')) {
* @param string $baseKey Base key
* @return string URL encoded query string
* @see http://php.net/http_build_query
* @deprecated Will be removed in 2.0
*/
if (!function_exists('http_build_query')) {
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.
* Don't use for isset() conditions, or wrap your variable with @ operator:
* Example:
* <code>
* ife(isset($variable), @$variable, 'default');
* </code>
*
* `ife(isset($variable), @$variable, 'default');`
*
* @param mixed $condition Conditional expression
* @param mixed $val1 Value to return in case condition matches
* @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.
* @link http://book.cakephp.org/view/704/ife
* @deprecated Will be removed in 2.0
*/
function ife($condition, $val1 = null, $val2 = null) {
if (!empty($condition)) {

View file

@ -19,5 +19,5 @@
* @since CakePHP(tm) v 1.1.11.4062
* @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';
?>

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
@ -8,22 +6,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.app.config
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
@ -71,6 +65,11 @@ if (!defined('APP')) {
*/
define('COMPONENTS', CONTROLLERS.'components'.DS);
/**
* Path to the application's libs directory.
*/
define('APPLIBS', APP.'libs'.DS);
/**
* Path to the application's views directory.
*/
@ -100,11 +99,6 @@ if (!defined('CONFIGS')) {
define('CONFIGS', APP.'config'.DS);
}
/**
* Path to the libs directory.
*/
define('INFLECTIONS', CAKE.'config'.DS.'inflections'.DS);
/**
* Path to the libs directory.
*/
@ -198,13 +192,6 @@ if (!defined('VENDORS')) {
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
*/

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.6833
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Case Folding Properties.
*
@ -12,22 +10,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -4,22 +4,18 @@
# Bake is a shell script for running CakePHP bake script
# PHP versions 4 and 5
#
# CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
# Copyright 2005-2007, Cake Software Foundation, Inc.
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
# Copyright 2005-2009, Cake Software Foundation, Inc.
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
#
# @filesource
# @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
# @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
# @copyright Copyright 2005-2009, Cake Software Foundation, Inc.
# @link http://cakephp.org CakePHP(tm) Project
# @package cake
# @subpackage cake.cake.console
# @since CakePHP(tm) v 1.2.0.5012
# @version $Revision$
# @modifiedby $LastChangedBy$
# @lastmodified $Date$
# @license http://www.opensource.org/licenses/mit-license.php The MIT License
# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
#
################################################################################
LIB=${0/%cake/}

View file

@ -3,22 +3,18 @@
:: Bake is a shell script for running CakePHP bake script
:: PHP versions 4 and 5
::
:: CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
:: Copyright 2005-2007, Cake Software Foundation, Inc.
:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
:: Copyright 2005-2009, Cake Software Foundation, Inc.
::
:: Licensed under The MIT License
:: Redistributions of files must retain the above copyright notice.
::
:: @filesource
:: @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
:: @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
:: @copyright Copyright 2005-2009, Cake Software Foundation, Inc.
:: @link http://cakephp.org CakePHP(tm) Project
:: @package cake
:: @subpackage cake.cake.console
:: @since CakePHP(tm) v 1.2.0.5012
:: @version $Revision$
:: @modifiedby $LastChangedBy$
:: @lastmodified $Date$
:: @license http://www.opensource.org/licenses/mit-license.php The MIT License
:: @license MIT License (http://www.opensource.org/licenses/mit-license.php)
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

View file

@ -7,22 +7,18 @@
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc.
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc.
*
* 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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console
* @since CakePHP(tm) v 1.2.0.5012
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
@ -123,15 +119,6 @@ class ShellDispatcher {
*/
var $shellName = null;
/**
* Constructs this ShellDispatcher instance.
*
* @param array $args the argv.
*/
function ShellDispatcher($args = array()) {
$this->__construct($args);
}
/**
* Constructor
*
@ -142,7 +129,7 @@ class ShellDispatcher {
* @return void
* @access public
*/
function __construct($args = array()) {
function ShellDispatcher($args = array()) {
set_time_limit(0);
$this->__initConstants();
@ -160,7 +147,7 @@ class ShellDispatcher {
function __initConstants() {
if (function_exists('ini_set')) {
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('implicit_flush', true);
ini_set('max_execution_time', 0);
@ -222,18 +209,15 @@ class ShellDispatcher {
*/
function __buildPaths() {
$paths = array();
$pluginPaths = App::path('plugins');
if (!class_exists('Folder')) {
require LIBS . 'folder.php';
}
foreach ($pluginPaths as $pluginPath) {
$Folder =& new Folder($pluginPath);
list($plugins,) = $Folder->read(false, true);
foreach ((array)$plugins as $plugin) {
$path = $pluginPath . Inflector::underscore($plugin) . DS . 'vendors' . DS . 'shells' . DS;
if (file_exists($path)) {
$paths[] = $path;
}
$plugins = App::objects('plugin', null, false);
foreach ((array)$plugins as $plugin) {
$pluginPath = App::pluginPath($plugin);
$path = $pluginPath . 'vendors' . DS . 'shells' . DS;
if (file_exists($path)) {
$paths[] = $path;
}
}
@ -324,13 +308,8 @@ class ShellDispatcher {
$this->help();
return true;
}
if (strpos($arg, '.') !== false) {
list($plugin, $shell) = explode('.', $arg);
} else {
$plugin = null;
$shell = $arg;
}
list($plugin, $shell) = pluginSplit($arg);
$this->shell = $shell;
$this->shellName = Inflector::camelize($shell);
$this->shellClass = $this->shellName . 'Shell';
@ -402,6 +381,7 @@ class ShellDispatcher {
$this->stderr($title . "\n" . $message . "\n");
return false;
}
/**
* Get shell to use, either plugin shell or application shell
*
@ -479,13 +459,14 @@ class ShellDispatcher {
*
* @param string $string String to output.
* @param boolean $newline If true, the outputs gets an added newline.
* @return integer Returns the number of bytes output to stdout.
* @access public
*/
function stdout($string, $newline = true) {
if ($newline) {
fwrite($this->stdout, $string . "\n");
return fwrite($this->stdout, $string . "\n");
} else {
fwrite($this->stdout, $string);
return fwrite($this->stdout, $string);
}
}
@ -606,28 +587,58 @@ class ShellDispatcher {
$this->stdout("Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp");
$this->stdout("\nAvailable Shells:");
$_shells = array();
$shellList = array();
foreach ($this->shellPaths as $path) {
if (is_dir($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)) {
$this->stdout("\t - none");
} else {
sort($shells);
foreach ($shells as $shell) {
if ($shell !== 'shell.php') {
$this->stdout("\t " . str_replace('.php', '', $shell));
}
}
if (!is_dir($path)) {
continue;
}
$shells = App::objects('file', $path);
if (empty($shells)) {
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 {
$type = 'app';
}
foreach ($shells as $shell) {
if ($shell !== 'shell.php') {
$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("To get help on a specific command, type 'cake shell_name help'");
}

View file

@ -1,29 +1,21 @@
<?php
/* SVN FILE: $Id$ */
/**
* ErrorHandler for Console Shells
*
* Long description for file
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console
* @since CakePHP(tm) v 1.2.0.5074
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,29 +1,21 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
* Acl Shell provides Acl access in the CLI environment
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @since CakePHP(tm) v 1.2.0.5012
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @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('Component', 'Acl');
App::import('Model', 'DbAcl');
@ -58,7 +50,7 @@ class AclShell extends Shell {
* @var string
* @access public
*/
var $dataSource = 'default';
var $connection = 'default';
/**
* Contains tasks to load and instantiate
@ -74,10 +66,8 @@ class AclShell extends Shell {
* @access public
*/
function startup() {
$this->dataSource = 'default';
if (isset($this->params['datasource'])) {
$this->dataSource = $this->params['datasource'];
if (isset($this->params['connection'])) {
$this->connection = $this->params['connection'];
}
if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) {
@ -102,7 +92,7 @@ class AclShell extends Shell {
require_once (CONFIGS.'database.php');
if (!in_array($this->command, array('initdb'))) {
$this->Acl = new AclComponent();
$this->Acl =& new AclComponent();
$controller = null;
$this->Acl->startup($controller);
}
@ -220,13 +210,40 @@ class AclShell extends Shell {
$this->_checkArgs(2, 'getPath');
$this->checkNodeType();
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);
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++) {
$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());
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 {
$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->checkNodeType();
extract($this->__dataVars());
if (isset($this->args[1]) && !is_null($this->args[1])) {
$key = ife(is_numeric($this->args[1]), $secondary_id, 'alias');
$conditions = array($class . '.' . $key => $this->args[1]);
if (isset($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 {
$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 (isset($this->args[1])) {
$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->hr();
$stack = array();
$last = null;
foreach ($nodes as $n) {
$stack[] = $n;
if (!empty($last)) {
@ -334,14 +365,10 @@ class AclShell extends Shell {
}
}
}
$last = $n[$class]['rght'];
$count = count($stack);
$indent = str_repeat(' ', $count);
if ($n[$class]['alias']) {
$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");
}
$last = $n[$class]['rght'];
$count = count($stack);
$this->_outputNode($class, $n, $count);
}
$this->hr();
}
@ -388,7 +415,7 @@ class AclShell extends Shell {
"\t" . __("For more detailed parameter usage info,", true) . "\n" .
"\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" . __("the parent ACL object specified by <parent>.", 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" . __("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" . __("For more detailed parameter usage info,", true) . "\n" .
"\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" . __("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" . __("For more detailed parameter usage info,", true) . "\n" .
"\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" . __("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" . __("For more detailed parameter usage info,", true) . "\n" .
"\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" . __("permissions settings from its parent.", 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" .
"\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" . __("see help for the 'create' command.", true),
@ -461,7 +489,7 @@ class AclShell extends Shell {
return false;
}
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
* @return mixed a string for aliases, and an array for model.foreignKey
**/
*/
function parseIdentifier($identifier) {
if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) {
return array(
@ -511,7 +539,7 @@ class AclShell extends Shell {
* @param string $class Class type you want (Aro/Aco)
* @param mixed $identifier A mixed identifier for finding the node.
* @return int Integer of NodeId. Will trigger an error if nothing is found.
**/
*/
function _getNodeId($class, $identifier) {
$node = $this->Acl->{$class}->node($identifier);
if (empty($node)) {
@ -530,23 +558,17 @@ class AclShell extends Shell {
* @access private
*/
function __getParams() {
$aro = ife(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]);
$aro = is_numeric($this->args[0]) ? intval($this->args[0]) : $this->args[0];
$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)) {
$aro = array(
'model' => $matches[1],
'foreign_key' => $matches[2],
);
if (is_string($aro)) {
$aro = $this->parseIdentifier($aro);
}
if (is_string($aco) && preg_match('/^([\w]+)\.(.*)$/', $aco, $matches)) {
$aco = array(
'model' => $matches[1],
'foreign_key' => $matches[2],
);
if (is_string($aco)) {
$aco = $this->parseIdentifier($aco);
}
$action = null;
if (isset($this->args[2])) {
$action = $this->args[2];
@ -554,7 +576,7 @@ class AclShell extends Shell {
$action = '*';
}
}
return compact('aro', 'aco', 'action');
return compact('aro', 'aco', 'action', 'aroName', 'acoName');
}
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* API shell to get CakePHP core method signatures.
*
@ -8,22 +6,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @since CakePHP(tm) v 1.2.0.5012
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
@ -121,7 +115,7 @@ class ApiShell extends Shell {
$this->out($list);
$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') {
$this->out(__('Done', true));
$this->_stop();
@ -173,8 +167,8 @@ class ApiShell extends Shell {
foreach ($commands as $cmd) {
$this->out("{$cmd}\n\n");
}
} elseif (isset($commands[low($this->args[1])])) {
$this->out($commands[low($this->args[1])] . "\n\n");
} elseif (isset($commands[strtolower($this->args[1])])) {
$this->out($commands[strtolower($this->args[1])] . "\n\n");
} else {
$this->out("Command '" . $this->args[1] . "' not found");
}

View file

@ -8,19 +8,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @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) {
if (strpos($arg, '.')) {
list($this->params['plugin'], $this->args[$i]) = explode('.', $arg);
list($this->params['plugin'], $this->args[$i]) = pluginSplit($arg);
break;
}
}
@ -81,6 +80,8 @@ class BakeShell extends Shell {
if (!is_dir($this->DbConfig->path)) {
if ($this->Project->execute()) {
$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('[P]roject');
$this->out('[F]ixture');
$this->out('[T]est case');
$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) {
case 'D':
$this->DbConfig->execute();
@ -119,11 +121,14 @@ class BakeShell extends Shell {
case 'F':
$this->Fixture->execute();
break;
case 'T':
$this->Test->execute();
break;
case 'Q':
exit(0);
break;
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->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 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("");
$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();
}
}

View file

@ -1,29 +1,21 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @since CakePHP(tm) v 1.2.0.5012
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
@ -68,7 +60,7 @@ class ConsoleShell extends Shell {
App::import('Model', $this->models);
foreach ($this->models as $model) {
$class = Inflector::camelize(r('.php', '', $model));
$class = Inflector::camelize(str_replace('.php', '', $model));
$this->models[$model] = $class;
$this->{$class} =& new $class();
}
@ -238,7 +230,7 @@ class ConsoleShell extends Shell {
$this->out("\t$field2: $value2");
}
$this->out("");
$this->out();
} else {
$this->out("\t$field: $value");
}
@ -253,7 +245,7 @@ class ConsoleShell extends Shell {
$this->out("\t$field2: $value2");
}
$this->out("");
$this->out();
} else {
$this->out("\t$field: $value");
}
@ -311,7 +303,7 @@ class ConsoleShell extends Shell {
break;
case (preg_match("/^routes\s+show/i", $command, $tmp) == true):
$router =& Router::getInstance();
$this->out(join("\n", Set::extract($router->routes, '{n}.0')));
$this->out(implode("\n", Set::extract($router->routes, '{n}.0')));
break;
case (preg_match("/^route\s+(\(.*\))$/i", $command, $tmp) == true):
if ($url = eval('return array' . $tmp[1] . ';')) {
@ -361,8 +353,8 @@ class ConsoleShell extends Shell {
foreach (array_keys($router->getNamedExpressions()) as $var) {
unset(${$var});
}
for ($i = 0; $i < count($router->routes); $i++) {
$router->compile($i);
for ($i = 0, $len = count($router->routes); $i < $len; $i++) {
$router->routes[$i]->compile();
}
return true;
}

View file

@ -1,29 +1,21 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
* Long description for file
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @since CakePHP(tm) v 1.2.0.5669
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
@ -82,18 +74,18 @@ class I18nShell extends Shell {
$this->out(__('[H]elp', 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) {
case 'E':
case 'e':
$this->Extract->execute();
break;
case 'I':
case 'i':
$this->initdb();
break;
case 'H':
case 'h':
$this->help();
break;
case 'Q':
case 'q':
exit(0);
break;
default:
@ -109,7 +101,7 @@ class I18nShell extends Shell {
* @access public
*/
function initdb() {
$this->Dispatch->args = array('schema', 'run', 'create', 'i18n');
$this->Dispatch->args = array('schema', 'create', 'i18n');
$this->Dispatch->dispatch();
}
@ -128,7 +120,7 @@ class I18nShell extends Shell {
$this->out(__('usage:', true));
$this->out(' cake i18n help');
$this->out(' cake i18n initdb [-datasource custom]');
$this->out('');
$this->out();
$this->hr();
$this->Extract->help();

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Command-line database management utility to automate programmer chores.
*
@ -9,24 +7,20 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @since CakePHP(tm) v 1.2.0.5550
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @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('File');
App::import('Core', 'File', false);
App::import('Model', 'CakeSchema', false);
/**
@ -63,18 +57,22 @@ class SchemaShell extends Shell {
* @access public
*/
function startup() {
$name = null;
$name = $file = $path = $connection = $plugin = null;
if (!empty($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);
}
$path = null;
if (!empty($this->params['path'])) {
$path = $this->params['path'];
}
$file = null;
if (empty($this->params['file'])) {
$this->params['file'] = 'schema.php';
}
@ -83,12 +81,17 @@ class SchemaShell extends Shell {
}
$file = $this->params['file'];
$connection = null;
if (!empty($this->params['path'])) {
$path = $this->params['path'];
}
if (!empty($this->params['connection'])) {
$connection = $this->params['connection'];
}
$this->Schema =& new CakeSchema(compact('name', 'path', 'file', 'connection'));
if (!empty($this->params['plugin'])) {
$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->_stop();
} 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();
}
}
@ -124,7 +128,7 @@ class SchemaShell extends Shell {
* @access public
*/
function generate() {
$this->out('Generating Schema...');
$this->out(__('Generating Schema...', true));
$options = array();
if (isset($this->params['f'])) {
$options = array('models' => false);
@ -137,9 +141,9 @@ class SchemaShell extends Shell {
if (!$snapshot && file_exists($this->Schema->path . DS . $this->params['file'])) {
$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') {
$this->_stop();
return $this->_stop();
}
if ($result === 'o') {
$snapshot = false;
@ -188,8 +192,10 @@ class SchemaShell extends Shell {
/**
* Dump Schema object to sql file
* if first arg == write, file will be written to sql file
* or it will output sql
* Use the `write` param to enable and control SQL file output location.
* 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
*/
@ -200,21 +206,27 @@ class SchemaShell extends Shell {
$this->err(__('Schema could not be loaded', true));
$this->_stop();
}
if (!empty($this->args[0])) {
if ($this->args[0] == 'write') {
if (isset($this->params['write'])) {
if ($this->params['write'] == 1) {
$write = Inflector::underscore($this->Schema->name);
} else {
$write = $this->args[0];
$write = $this->params['write'];
}
}
$db =& ConnectionManager::getDataSource($this->Schema->connection);
$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);
if ($write) {
if (strpos($write, '.sql') === false) {
$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)) {
$this->out(sprintf(__('SQL dump file created in %s', true), $File->pwd()));
$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() {
if (!isset($this->args[0])) {
$this->err('command not found');
$this->_stop();
}
function create() {
list($Schema, $table) = $this->_loadSchema();
$this->__create($Schema, $table);
}
$command = $this->args[0];
/**
* Run database create commands. Alias for run create.
*
* @return void
*/
function update() {
list($Schema, $table) = $this->_loadSchema();
$this->__update($Schema, $table);
}
$this->Dispatch->shiftArgs();
$name = null;
if (isset($this->args[0])) {
$name = $this->args[0];
}
/**
* Prepares the Schema objects for database operations.
*
* @return void
*/
function _loadSchema() {
$name = $plugin = null;
if (isset($this->params['name'])) {
$name = $this->params['name'];
}
if (isset($this->params['plugin'])) {
$plugin = $this->params['plugin'];
}
if (isset($this->params['dry'])) {
$this->__dry = true;
$this->out(__('Performing a dry run.', true));
}
$options = array('name' => $name);
$options = array('name' => $name, 'plugin' => $plugin);
if (isset($this->params['s'])) {
$fileName = rtrim($this->Schema->file, '.php');
$options['file'] = $fileName . '_' . $this->params['s'] . '.php';
}
$Schema = $this->Schema->load($options);
$Schema =& $this->Schema->load($options);
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();
}
$table = null;
if (isset($this->args[1])) {
$table = $this->args[1];
}
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();
}
return array(&$Schema, $table);
}
/**
@ -292,7 +303,7 @@ class SchemaShell extends Shell {
*
* @access private
*/
function __create($Schema, $table = null) {
function __create(&$Schema, $table = null) {
$db =& ConnectionManager::getDataSource($this->Schema->connection);
$drop = $create = array();
@ -315,7 +326,7 @@ class SchemaShell extends Shell {
$this->out(array_keys($drop));
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);
}
@ -323,10 +334,9 @@ class SchemaShell extends Shell {
$this->out(array_keys($create));
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->out(__('End create.', true));
}
@ -336,11 +346,15 @@ class SchemaShell extends Shell {
*
* @access private
*/
function __update($Schema, $table = null) {
function __update(&$Schema, $table = null) {
$db =& ConnectionManager::getDataSource($this->Schema->connection);
$this->out('Comparing Database to Schema...');
$Old = $this->Schema->read();
$this->out(__('Comparing Database to Schema...', true));
$options = array();
if (isset($this->params['f'])) {
$options['models'] = false;
}
$Old = $this->Schema->read($options);
$compare = $this->Schema->compare($Old, $Schema);
$contents = array();
@ -361,7 +375,7 @@ class SchemaShell extends Shell {
$this->out("\n" . __('The following statements will run.', true));
$this->out(array_map('trim', $contents));
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->__run($contents, 'update', $Schema);
}
@ -374,16 +388,14 @@ class SchemaShell extends Shell {
*
* @access private
*/
function __run($contents, $event, $Schema) {
function __run($contents, $event, &$Schema) {
if (empty($contents)) {
$this->err(__('Sql could not be run', true));
return;
}
Configure::write('debug', 2);
$db =& ConnectionManager::getDataSource($this->Schema->connection);
$db->fullDebug = true;
$errors = array();
foreach ($contents as $table => $sql) {
if (empty($sql)) {
$this->out(sprintf(__('%s is up to date.', true), $table));
@ -395,15 +407,16 @@ class SchemaShell extends Shell {
if (!$Schema->before(array($event => $table))) {
return false;
}
if (!$db->_execute($sql)) {
$error = null;
if (!$db->execute($sql)) {
$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);
} elseif ($this->__dry !== true) {
} else {
$this->out(sprintf(__('%s updated.', true), $table));
}
}
@ -417,26 +430,74 @@ class SchemaShell extends Shell {
* @access public
*/
function help() {
$this->out("The Schema Shell generates a schema object from \n\t\tthe database and updates the database from the schema.");
$this->hr();
$this->out("Usage: cake schema <command> <arg1> <arg2>...");
$this->hr();
$this->out('Params:');
$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);
$this->out("\n\t-name <name>\n\t\tclassname to use.");
$this->out("\n\t-file <name>\n\t\tfile <name> to read and write.\n\t\tdefault file: ". $this->Schema->file);
$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.");
$this->out("\n\t-f\n\t\tforce 'generate' to create a new schema.");
$this->out('Commands:');
$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");
$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.");
$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.");
$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");
$this->out("");
$help = <<<TEXT
The Schema Shell generates a schema object from
the database and updates the database from the schema.
---------------------------------------------------------------
Usage: cake schema <command> <arg1> <arg2>...
---------------------------------------------------------------
Params:
-connection <config>
set db config <config>. uses 'default' if none is specified
-path <dir>
path <dir> to read and write schema.php.
default path: {$this->Schema->path}
-name <name>
Classname to use. If <name> is Plugin.className, it will
set the plugin and name params.
-file <name>
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();
}
}

View file

@ -1,29 +1,21 @@
<?php
/* SVN FILE: $Id$ */
/**
* Base class for Shells
*
* Long description for file
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @since CakePHP(tm) v 1.2.0.5012
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @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 +137,7 @@ class Shell extends Object {
*/
function __construct(&$dispatch) {
$vars = array('params', 'args', 'shell', 'shellCommand' => 'command');
foreach ($vars as $key => $var) {
if (is_string($key)) {
$this->{$var} =& $dispatch->{$key};
@ -205,8 +198,9 @@ class Shell extends Object {
*/
function _welcome() {
$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('Path: '. $this->params['working']);
$this->hr();
@ -224,8 +218,8 @@ class Shell extends Object {
$this->DbConfig =& new DATABASE_CONFIG();
return true;
}
$this->err('Database config could not be loaded');
$this->out('Run \'bake\' to create the database configuration');
$this->err('Database config could not be loaded.');
$this->out('Run `bake` to create the database configuration.');
return false;
}
@ -258,11 +252,7 @@ class Shell extends Object {
$this->modelClass = $modelClassName;
foreach ($uses as $modelClass) {
$plugin = null;
if (strpos($modelClass, '.') !== false) {
list($plugin, $modelClass) = explode('.', $modelClass);
$plugin = $plugin . '.';
}
list($plugin, $modelClass) = pluginSplit($modelClass, true);
if (PHP5) {
$this->{$modelClass} = ClassRegistry::init($plugin . $modelClass);
} else {
@ -296,7 +286,7 @@ class Shell extends Object {
if (!class_exists($taskClass)) {
foreach ($this->Dispatch->shellPaths as $path) {
$taskPath = $path . 'tasks' . DS . $task.'.php';
$taskPath = $path . 'tasks' . DS . $task . '.php';
if (file_exists($taskPath)) {
require_once $taskPath;
break;
@ -320,7 +310,7 @@ class Shell extends Object {
}
if (!isset($this->{$taskName})) {
$this->err("Task '" . $taskName . "' could not be loaded");
$this->err("Task `{$taskName}` could not be loaded");
$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 $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
*/
function out($message, $after = true) {
function out($message = null, $newlines = 1) {
if (is_array($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 $after Appended to message, if true a newline is used
* @param integer $newlines Number of newlines to append
* @access public
*/
function err($message, $after = true) {
function err($message = null, $newlines = 1) {
if (is_array($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.
*
* @param mixed $format If true returns a linefeed sequence, if false null,
* if a string is given that is returned,
* if an integer is given it is used as a multiplier to return multiple linefeed sequences
* @param integer $multiplier Number of times the linefeed sequence should be repeated
* @access public
* @return string
*/
function nl($format = true) {
if (is_string($format)) {
return $format . "\n";
}
if (is_int($format)) {
return str_repeat("\n", $format);
}
return $format ? "\n" : null;
function nl($multiplier = 1) {
return str_repeat("\n", $multiplier);
}
/**
* 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
*/
function hr($surround = false) {
$this->out(null, $surround);
function hr($newlines = 0) {
$this->out(null, $newlines);
$this->out('---------------------------------------------------------------');
$this->out(null, $surround);
$this->out(null, $newlines);
}
/**
* Displays a formatted error message
* and exits the application with status code 1
@ -449,7 +435,11 @@ class Shell extends Object {
$command = $this->command;
}
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);
}
}
@ -461,16 +451,21 @@ class Shell extends Object {
* @return boolean Success
* @access public
*/
function createFile ($path, $contents) {
function createFile($path, $contents) {
$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) {
$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') {
$this->out(__("Quitting.", true) ."\n");
exit;
$this->out(__('Quitting.', true), 2);
$this->_stop();
} elseif (strtolower($key) != 'y') {
$this->out(__("Skip", true) ." {$path}\n");
$this->out(sprintf(__('Skip `%s`', true), $path), 2);
return false;
}
}
@ -481,10 +476,10 @@ class Shell extends Object {
if ($File = new File($path, true)) {
$data = $File->prepare($contents);
$File->write($data);
$this->out(__("Wrote", true) ." {$path}");
$this->out(sprintf(__('Wrote `%s`', true), $path));
return true;
} else {
$this->err(__("Error! Could not write to", true)." {$path}.\n");
$this->err(sprintf(__('Could not write to `%s`.', true), $path), 2);
return false;
}
}
@ -496,7 +491,8 @@ class Shell extends Object {
*/
function help() {
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 {
$this->Dispatch->help();
}
@ -512,11 +508,13 @@ class Shell extends Object {
if (App::import('vendor', 'simpletest' . DS . 'simpletest')) {
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';
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;
}
@ -575,7 +573,7 @@ class Shell extends Object {
* @access protected
*/
function _modelKey($name) {
return Inflector::underscore(Inflector::singularize($name)).'_id';
return Inflector::underscore(Inflector::singularize($name)) . '_id';
}
/**
@ -586,8 +584,7 @@ class Shell extends Object {
* @access protected
*/
function _modelNameFromKey($key) {
$name = str_replace('_id', '',$key);
return Inflector::camelize($name);
return Inflector::camelize(str_replace('_id', '', $key));
}
/**
@ -639,16 +636,9 @@ class Shell extends Object {
*
* @param string $pluginName Name of the plugin you want ie. DebugKit
* @return string $path path to the correct plugin.
**/
*/
function _pluginPath($pluginName) {
$pluginPaths = App::path('plugins');
$pluginDirName = Inflector::underscore($pluginName);
foreach ($pluginPaths as $path) {
if (is_dir($path . $pluginDirName)) {
return $path . $pluginDirName . DS ;
}
}
return $pluginPaths[0] . $pluginDirName . DS;
return App::pluginPath($pluginName);
}
}
?>

View file

@ -2,23 +2,20 @@
/**
* The ControllerTask handles creating and updating controller files.
*
* Long description for file
*
* 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.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @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);
$actions = $this->bakeActions($controller);
} elseif (!empty($this->args[1]) && $this->args[1] == 'admin') {
$admin = $this->Project->getAdmin();
$admin = $this->Project->getPrefix();
if ($admin) {
$this->out('Adding ' . Configure::read('Routing.admin') .' methods');
$actions= $this->bakeActions($controller, $admin);
$this->out(sprintf(__('Adding %s methods', true), $admin));
$actions = $this->bakeActions($controller, $admin);
}
}
if (!empty($this->args[2]) && $this->args[2] == 'admin') {
$admin = $this->Project->getAdmin();
$admin = $this->Project->getPrefix();
if ($admin) {
$this->out('Adding ' . Configure::read('Routing.admin') .' methods');
$this->out(sprintf(__('Adding %s methods', true), $admin));
$actions .= "\n" . $this->bakeActions($controller, $admin);
}
}
@ -114,7 +111,7 @@ class ControllerTask extends Shell {
*
* @access public
* @return void
**/
*/
function all() {
$this->interactive = false;
$this->listAll($this->connection, false);
@ -165,7 +162,7 @@ class ControllerTask extends Shell {
if (file_exists($this->path . $controllerFile .'_controller.php')) {
$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') {
$this->interactive = true;
@ -194,7 +191,7 @@ class ControllerTask extends Shell {
$actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) == 'y');
}
if (strtolower($wannaBakeAdminCrud) == 'y') {
$admin = $this->Project->getAdmin();
$admin = $this->Project->getPrefix();
$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
*
* @return void
**/
*/
function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
$this->out('');
$this->out();
$this->hr();
$this->out(__('The following controller will be created:', true));
$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)
*
* @return array Array containing (bakeRegular, bakeAdmin) answers
**/
*/
function _askAboutMethods() {
$wannaBakeCrud = $this->in(
__("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);
$pluralName = $this->_pluralName($currentModelName);
$singularName = Inflector::variable($currentModelName);
$singularHumanName = Inflector::humanize($currentModelName);
$pluralHumanName = Inflector::humanize($controllerName);
$singularHumanName = $this->_singularHumanName($currentModelName);
$pluralHumanName = $this->_pluralName($controllerName);
$this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName'));
@ -349,7 +346,7 @@ class ControllerTask extends Shell {
* Interact with the user and get a list of additional helpers
*
* @return array Helpers that the user wants to use.
**/
*/
function doHelpers() {
return $this->_doPropertyChoices(
__("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
*
* @return array Components the user wants to use.
**/
*/
function doComponents() {
return $this->_doPropertyChoices(
__("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 sting $example A question for a comma separated list, with examples.
* @return array Array of values for property.
**/
*/
function _doPropertyChoices($prompt, $example) {
$proceed = $this->in($prompt, array('y','n'), 'n');
$property = array();
@ -456,28 +453,34 @@ class ControllerTask extends Shell {
$this->hr();
$this->out("Usage: cake bake controller <arg1> <arg2>...");
$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('');
$this->out();
$this->out("controller <name>");
$this->out("\tbakes controller with var \$scaffold");
$this->out('');
$this->out();
$this->out("controller <name> public");
$this->out("\tbakes controller with basic crud actions");
$this->out("\t(index, view, add, edit, delete)");
$this->out('');
$this->out();
$this->out("controller <name> admin");
$this->out("\tbakes a controller with basic crud actions for");
$this->out("\tConfigure::read('Routing.admin') methods.");
$this->out('');
$this->out("\tbakes a controller with basic crud actions for one of the");
$this->out("\tConfigure::read('Routing.prefixes') methods.");
$this->out();
$this->out("controller <name> public admin");
$this->out("\tbakes a controller with basic crud actions for");
$this->out("\tConfigure::read('Routing.admin') and non admin methods.");
$this->out("\tbakes a controller with basic crud actions for one");
$this->out("\tConfigure::read('Routing.prefixes') and non admin methods.");
$this->out("\t(index, view, add, edit, delete,");
$this->out("\tadmin_index, admin_view, admin_edit, admin_add, admin_delete)");
$this->out('');
$this->out();
$this->out("controller all");
$this->out("\tbakes all controllers with CRUD methods.");
$this->out("");
$this->out();
$this->_stop();
}
}

View file

@ -2,23 +2,20 @@
/**
* The DbConfig Task handles creating and updating the database.php
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @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.
*
* @var string
**/
*/
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');
$persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n');
if (low($persistent) == 'n') {
if (strtolower($persistent) == 'n') {
$persistent = 'false';
} else {
$persistent = 'true';
@ -124,7 +121,7 @@ class DbConfigTask extends Shell {
$port = $this->in('Port?', null, 'n');
}
if (low($port) == 'n') {
if (strtolower($port) == 'n') {
$port = null;
}
@ -155,7 +152,7 @@ class DbConfigTask extends Shell {
while ($prefix == '') {
$prefix = $this->in('Table Prefix?', null, 'n');
}
if (low($prefix) == 'n') {
if (strtolower($prefix) == 'n') {
$prefix = null;
}
@ -163,7 +160,7 @@ class DbConfigTask extends Shell {
while ($encoding == '') {
$encoding = $this->in('Table encoding?', null, 'n');
}
if (low($encoding) == 'n') {
if (strtolower($encoding) == 'n') {
$encoding = null;
}
@ -173,7 +170,7 @@ class DbConfigTask extends Shell {
$schema = $this->in('Table schema?', null, 'n');
}
}
if (low($schema) == 'n') {
if (strtolower($schema) == 'n') {
$schema = null;
}
@ -185,7 +182,7 @@ class DbConfigTask extends Shell {
$dbConfigs[] = $config;
$doneYet = $this->in('Do you wish to add another database configuration?', null, 'n');
if (low($doneYet == 'n')) {
if (strtolower($doneYet == 'n')) {
$done = true;
}
}
@ -204,7 +201,7 @@ class DbConfigTask extends Shell {
function __verify($config) {
$config = array_merge($this->__defaultConfig, $config);
extract($config);
$this->out('');
$this->out();
$this->hr();
$this->out('The following database configuration will be created:');
$this->hr();
@ -259,6 +256,7 @@ class DbConfigTask extends Shell {
$oldConfigs = array();
if (file_exists($filename)) {
config('database');
$db = new $this->databaseClassName;
$temp = get_class_vars(get_class($db));
@ -351,11 +349,12 @@ class DbConfigTask extends Shell {
* Get a user specified Connection name
*
* @return void
**/
*/
function getConfig() {
App::import('Model', 'ConnectionManager', false);
$useDbConfig = 'default';
$configs = get_class_vars($this->databaseClassName);
if (!is_array($configs)) {
return $this->execute();
}

View file

@ -1,93 +1,54 @@
<?php
/**
* Short description for file.
*
* Long description for file
* Language string extractor
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @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
*
* @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
* @access public
* @access private
*/
var $path = null;
var $__paths = array();
/**
* Files from where to extract
*
* @var array
* @access public
*/
var $files = array();
/**
* Filename where to deposit translations
*
* @var string
* @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
* @access private
*/
var $__oneFile = true;
var $__merge = false;
/**
* Current file being processed
@ -97,6 +58,14 @@ class ExtractTask extends Shell{
*/
var $__file = null;
/**
* Contains all content waiting to be write
*
* @var string
* @access private
*/
var $__storage = array();
/**
* Extracted tokens
*
@ -113,14 +82,6 @@ class ExtractTask extends Shell{
*/
var $__strings = array();
/**
* History of file versions
*
* @var array
* @access private
*/
var $__fileVersions = array();
/**
* Destination path
*
@ -132,59 +93,65 @@ class ExtractTask extends Shell{
/**
* Execution method always used for tasks
*
* @access public
* @return void
* @access private
*/
function execute() {
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'])) {
$this->path = $this->params['path'];
if (isset($this->params['paths'])) {
$this->__paths = explode(',', $this->params['paths']);
} else {
$response = '';
while ($response == '') {
$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']);
$defaultPath = $this->params['working'];
$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');
while (true) {
$response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted');
$this->out(__('Extract Aborted', true));
$this->_stop();
} elseif (strtoupper($response) === 'D') {
$this->out();
break;
} elseif (is_dir($response)) {
$this->__paths[] = $response;
$defaultPath = 'D';
} else {
$this->err(__('The directory path you supplied was not found. Please try again.', true));
}
$this->out();
}
if (is_dir($response)) {
$this->path = $response;
} else {
$this->err('The directory path you supplied was not found. Please try again.');
$this->execute();
}
}
if (isset($this->params['debug'])) {
$this->path = ROOT;
$this->files = array(__FILE__);
}
if (isset($this->params['output'])) {
$this->__output = $this->params['output'];
} else {
$response = '';
while ($response == '') {
$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");
$message = sprintf(__("What is the full path you would like to output?\nExample: %s\n[Q]uit", true), $this->__paths[0] . DS . 'locale');
while (true) {
$response = $this->in($message, null, $this->__paths[0] . DS . 'locale');
if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted');
$this->out(__('Extract Aborted', true));
$this->_stop();
} elseif (is_dir($response)) {
$this->__output = $response . DS;
break;
} else {
$this->err(__('The directory path you supplied was not found. Please try again.', true));
}
}
if (is_dir($response)) {
$this->__output = $response . DS;
} else {
$this->err('The directory path you supplied was not found. Please try again.');
$this->execute();
$this->out();
}
}
if (empty($this->files)) {
$this->files = $this->__searchDirectory();
if (isset($this->params['merge'])) {
$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();
}
@ -192,39 +159,27 @@ class ExtractTask extends Shell{
/**
* Extract text
*
* @return void
* @access private
*/
function __extract() {
$this->out('');
$this->out('');
$this->out();
$this->out();
$this->out(__('Extracting...', true));
$this->hr();
$this->out(__('Path: ', true). $this->path);
$this->out(__('Output Directory: ', true). $this->__output);
$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->out(__('Paths:', true));
foreach ($this->__paths as $path) {
$this->out(' ' . $path);
}
$this->out(__('Output Directory: ', true) . $this->__output);
$this->hr();
$this->__extractTokens();
}
/**
* Show help options
*
* @return void
* @access public
*/
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 -app is ROOT/app', true));
$this->hr();
$this->out(__('usage: cake i18n extract [command] [path...]', true));
$this->out('');
$this->out(__('commands:', true));
$this->out(__('Usage: cake i18n extract <command> <param1> <param2>...', true));
$this->out();
$this->out(__('Params:', true));
$this->out(__(' -app [path...]: directory where your application is located', true));
$this->out(__(' -root [path...]: path to install', 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(__(' -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(__(' -debug: Perform self test.', true));
$this->out('');
$this->out();
}
/**
* Extract tokens out of all files to be processed
*
* @return void
* @access private
*/
function __extractTokens() {
foreach ($this->files as $file) {
foreach ($this->__files as $file) {
$this->__file = $file;
$this->out(sprintf(__('Processing %s...', true), $file));
$code = file_get_contents($file);
$this->__findVersion($code, $file);
$allTokens = token_get_all($code);
$this->__tokens = array();
$lineNumber = 1;
@ -274,70 +230,35 @@ class ExtractTask extends Shell{
}
if (is_array($token)) {
$lineNumber += count(split("\n", $token[1])) - 1;
$lineNumber += count(explode("\n", $token[1])) - 1;
} else {
$lineNumber += count(split("\n", $token)) - 1;
$lineNumber += count(explode("\n", $token)) - 1;
}
}
unset($allTokens);
$this->basic();
$this->basic('__c');
$this->extended();
$this->extended('__dc', 2);
$this->extended('__n', 0, true);
$this->extended('__dn', 2, true);
$this->extended('__dcn', 4, true);
$this->__parse('__', array('singular'));
$this->__parse('__n', array('singular', 'plural'));
$this->__parse('__d', array('domain', 'singular'));
$this->__parse('__c', array('singular'));
$this->__parse('__dc', array('domain', 'singular'));
$this->__parse('__dn', array('domain', 'singular', 'plural'));
$this->__parse('__dcn', array('domain', 'singular', 'plural'));
}
$this->__buildFiles();
$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: '__')
* @access public
* @param array $map Array containing what variables it will find (e.g: domain, singular, plural)
* @return void
* @access private
*/
function basic($functionName = '__') {
$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) {
function __parse($functionName, $map) {
$count = 0;
$tokenCount = count($this->__tokens);
@ -362,52 +283,25 @@ class ExtractTask extends Shell{
$position++;
}
if ($plural) {
$end = $position + $shift + 7;
if ($this->__tokens[$position + $shift + 5] === ')') {
$end = $position + $shift + 5;
$mapCount = count($map);
$strings = array();
while (count($strings) < $mapCount && ($this->__tokens[$position] == ',' || $this->__tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING)) {
if ($this->__tokens[$position][0] == T_CONSTANT_ENCAPSED_STRING) {
$strings[] = $this->__tokens[$position][1];
}
if (empty($shift)) {
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]);
$condition = ($seoncdComma == ',');
} else {
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));
$position++;
}
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;
}
if ($mapCount == count($strings)) {
extract(array_combine($map, $strings));
if (!isset($domain)) {
$domain = '\'default\'';
}
$string = $this->__formatString($singular);
if (isset($plural)) {
$string .= "\0" . $this->__formatString($plural);
}
$this->__strings[$this->__formatString($domain)][$string][$this->__file][] = $line;
} else {
$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
*
* @return void
* @access private
*/
function __buildFiles() {
foreach ($this->__strings as $str => $fileInfo) {
$output = '';
$occured = $fileList = array();
if ($this->__oneFile === true) {
foreach ($fileInfo as $file => $lines) {
$occured[] = "$file:" . join(';', $lines);
if (isset($this->__fileVersions[$file])) {
$fileList[] = $this->__fileVersions[$file];
}
foreach ($this->__strings as $domain => $strings) {
foreach ($strings as $string => $files) {
$occurances = array();
foreach ($files as $file => $lines) {
$occurances[] = $file . ':' . implode(';', $lines);
}
$occurances = join("\n#: ", $occured);
$occurances = str_replace($this->path, '', $occurances);
$output = "#: $occurances\n";
$filename = $this->__filename;
$occurances = implode("\n#: ", $occurances);
$header = '#: ' . str_replace($this->__paths, '', $occurances) . "\n";
if (strpos($str, "\0") === false) {
$output .= "msgid \"$str\"\n";
$output .= "msgstr \"\"\n";
if (strpos($string, "\0") === false) {
$sentence = "msgid \"{$string}\"\n";
$sentence .= "msgstr \"\"\n\n";
} else {
list($singular, $plural) = explode("\0", $str);
$output .= "msgid \"$singular\"\n";
$output .= "msgid_plural \"$plural\"\n";
$output .= "msgstr[0] \"\"\n";
$output .= "msgstr[1] \"\"\n";
list($singular, $plural) = explode("\0", $string);
$sentence = "msgid \"{$singular}\"\n";
$sentence .= "msgid_plural \"{$plural}\"\n";
$sentence .= "msgstr[0] \"\"\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])) {
$fileList[] = $this->__fileVersions[$str];
}
$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($domain, $header, $sentence);
if ($domain != 'default' && $this->__merge) {
$this->__store('default', $header, $sentence);
}
}
$this->__store($filename, $output, $fileList);
}
}
/**
* Prepare a file to be stored
*
* @param string $file Filename
* @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
* @return void
* @access private
*/
function __store($file = 0, $input = 0, $fileList = array(), $get = 0) {
static $storage = 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;
}
function __store($domain, $header, $sentence) {
if (!isset($this->__storage[$domain])) {
$this->__storage[$domain] = array();
}
if (!isset($this->__storage[$domain][$sentence])) {
$this->__storage[$domain][$sentence] = $header;
} else {
return $storage;
$this->__storage[$domain][$sentence] .= $header;
}
}
/**
* Write the files that need to be stored
*
* @return void
* @access private
*/
function __writeFiles() {
$output = $this->__store(0, 0, array(), 1);
$output = $this->__mergeFiles($output);
foreach ($output as $file => $content) {
$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.';
foreach ($this->__storage as $domain => $sentences) {
$output = $this->__writeHeader();
foreach ($sentences as $sentence => $header) {
$output .= $header . $sentence;
}
if (is_file($this->__output . $file)) {
$filename = $domain . '.pot';
$File = new File($this->__output . $filename);
if ($File->exists()) {
$response = '';
while ($response == '') {
$response = $this->in("\n\nError: ".$file . ' already exists in this location. Overwrite?', array('y','n', 'q'), 'n');
if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted');
$this->_stop();
} elseif (strtoupper($response) === 'N') {
$this->out();
$response = $this->in(sprintf(__('Error: %s already exists in this location. Overwrite?', true), $filename), array('y', 'n'), 'y');
if (strtoupper($response) === 'N') {
$response = '';
while ($response == '') {
$response = $this->in("What would you like to name this file?\nExample: new_" . $file, null, "new_" . $file);
$file = $response;
$response = $this->in(sprintf(__("What would you like to name this file?\nExample: %s", true), 'new_' . $filename), null, 'new_' . $filename);
$File = new File($this->__output . $response);
}
}
}
}
$fp = fopen($this->__output . $file, 'w');
fwrite($fp, str_replace('--VERSIONS--', $fileList, join('', $content)));
fclose($fp);
$File->write($output);
$File->close();
}
}
/**
* 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
*
@ -592,7 +405,6 @@ class ExtractTask extends Shell{
function __writeHeader() {
$output = "# LANGUAGE translation of CakePHP Application\n";
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
$output .= "# --VERSIONS--\n";
$output .= "#\n";
$output .= "#, fuzzy\n";
$output .= "msgid \"\"\n";
@ -609,21 +421,6 @@ class ExtractTask extends Shell{
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
*
@ -650,10 +447,11 @@ class ExtractTask extends Shell{
* @param integer $line Line number
* @param string $marker Marker found
* @param integer $count Count
* @return void
* @access private
*/
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;
$tokenCount = count($this->__tokens);
$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 array Files
* @return void
* @access private
*/
function __searchDirectory($path = null) {
if ($path === null) {
$path = $this->path .DS;
function __searchFiles() {
foreach ($this->__paths as $path) {
$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;
}
}
?>

View file

@ -4,19 +4,18 @@
*
* 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.
*
* 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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @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
*
* @var string
**/
* @access public
*/
var $connection = null;
/**
* Schema instance
*
* @var object
**/
* @access protected
*/
var $_Schema = null;
/**
@ -73,9 +74,6 @@ class FixtureTask extends Shell {
function __construct(&$dispatch) {
parent::__construct($dispatch);
$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])) {
$this->interactive = false;
if (!isset($this->connection)) {
$this->connection = 'default';
}
@ -106,9 +105,10 @@ class FixtureTask extends Shell {
*
* @access public
* @return void
**/
*/
function all() {
$this->interactive = false;
$this->Model->interactive = false;
$tables = $this->Model->listAll($this->connection, false);
foreach ($tables as $table) {
$model = $this->_modelName($table);
@ -142,7 +142,8 @@ class FixtureTask extends Shell {
*
* @param string $modelName Name of model you are dealing with.
* @return array Array of import options.
**/
* @access public
*/
function importOptions($modelName) {
$options = array();
$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 $useTable Name of table to use.
* @param array $importOptions Options for var $import
* @return string Baked fixture
* @access private
* @return string Baked fixture content
* @access public
*/
function bake($model, $useTable = false, $importOptions = array()) {
if (!class_exists('CakeSchema')) {
App::import('Model', 'CakeSchema', false);
}
$table = $schema = $records = $import = $modelImport = $recordImport = null;
if (!$useTable) {
$useTable = Inflector::tableize($model);
@ -215,7 +219,7 @@ class FixtureTask extends Shell {
}
$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));
}
$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 $fixture Contents of the fixture file.
* @return string Content saved into fixture file.
* @access public
* @return void
**/
*/
function generateFixtureFile($model, $otherVars) {
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
$vars = array_merge($defaults, $otherVars);
@ -254,30 +258,11 @@ class FixtureTask extends Shell {
*
* @param array $table Table schema array
* @return string fields definitions
**/
* @access protected
*/
function _generateSchema($tableInfo) {
$cols = array();
$out = "array(\n";
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;
$schema = $this->_Schema->generateTable('f', $tableInfo);
return substr($schema, 10, -2);
}
/**
@ -285,7 +270,8 @@ class FixtureTask extends Shell {
*
* @param array $table Table schema array
* @return array Array of records to use in the fixture.
**/
* @access protected
*/
function _generateRecords($tableInfo, $recordCount = 1) {
$records = array();
for ($i = 0; $i < $recordCount; $i++) {
@ -296,9 +282,11 @@ class FixtureTask extends Shell {
}
switch ($fieldInfo['type']) {
case 'integer':
case 'float':
$insert = $i + 1;
break;
case 'string';
case 'string':
case 'binary':
$isPrimaryUuid = (
isset($fieldInfo['key']) && strtolower($fieldInfo['key']) == 'primary' &&
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
* @return string A string value of the $records array.
**/
* @access protected
*/
function _makeRecordString($records) {
$out = "array(\n";
foreach ($records as $record) {
@ -377,12 +366,17 @@ class FixtureTask extends Shell {
* @param string $modelName name of the model to take records from.
* @param string $useTable Name of table to use.
* @return array Array of records.
**/
* @access protected
*/
function _getRecordsFromTable($modelName, $useTable = null) {
$condition = null;
$prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10", true);
while (!$condition) {
$condition = $this->in($prompt, null, 'WHERE 1=1 LIMIT 10');
if ($this->interactive) {
$condition = null;
$prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10", true);
while (!$condition) {
$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);
$modelObject =& new Model(array('name' => $modelName, 'table' => $useTable, 'ds' => $this->connection));
@ -391,7 +385,7 @@ class FixtureTask extends Shell {
'recursive' => -1
));
$db =& ConnectionManager::getDataSource($modelObject->useDbConfig);
$schema = $modelObject->schema();
$schema = $modelObject->schema(true);
$out = array();
foreach ($records as $record) {
$row = array();
@ -412,15 +406,23 @@ class FixtureTask extends Shell {
$this->hr();
$this->out("Usage: cake bake fixture <arg1> <params>");
$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("\nfixture <name>\n\tbakes fixture with specified name.");
$this->out("\nfixture all\n\tbakes all fixtures.");
$this->out("");
$this->out();
$this->out('Parameters:');
$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-plugin lowercased_underscored name of plugin to bake fixtures for.");
$this->out("");
$this->out("\t-plugin CamelCased name of plugin to bake fixtures for.");
$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();
}
}

View file

@ -2,23 +2,20 @@
/**
* The ModelTask handles creating and updating models files.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @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.
*
* @var array
**/
*/
var $__tables = array();
/**
* Holds validation method map.
*
* @var array
**/
*/
var $__validations = array();
/**
* startup method
*
* @return void
**/
function startup() {
App::import('Model', 'Model', false);
parent::startup();
}
/**
* Execution method always used for tasks
*
* @access public
*/
function execute() {
App::import('Model', 'Model', false);
if (empty($this->args)) {
$this->__interactive();
}
@ -118,7 +107,7 @@ class ModelTask extends Shell {
* Bake all models at once.
*
* @return void
**/
*/
function all() {
$this->listAll($this->connection, false);
$unitTestExists = $this->_checkUnitTest();
@ -138,9 +127,12 @@ class ModelTask extends Shell {
*
* @param string $className Name of class you want model to be.
* @return object Model instance
**/
function &_getModelObject($className) {
$object = new Model(array('name' => $className, 'ds' => $this->connection));
*/
function &_getModelObject($className, $table = null) {
if (!$table) {
$table = Inflector::tableize($className);
}
$object =& new Model(array('name' => $className, 'table' => $table, 'ds' => $this->connection));
return $object;
}
@ -151,7 +143,7 @@ class ModelTask extends Shell {
* @param string $prompt Prompt to use for options list.
* @param integer $default The default option for the given prompt.
* @return result of user choice.
**/
*/
function inOptions($options, $prompt = null, $default = null) {
$valid = false;
$max = count($options);
@ -194,7 +186,7 @@ class ModelTask extends Shell {
if (in_array($useTable, $this->__tables)) {
$tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection));
$fields = $tempModel->schema();
$fields = $tempModel->schema(true);
if (!array_key_exists('id', $fields)) {
$primaryKey = $this->findPrimaryKey($fields);
}
@ -220,7 +212,7 @@ class ModelTask extends Shell {
$associations = $this->doAssociations($tempModel);
}
$this->out('');
$this->out();
$this->hr();
$this->out(__('The following Model will be created:', true));
$this->hr();
@ -271,7 +263,7 @@ class ModelTask extends Shell {
* @param string $associations Collection of associations.
* @access protected
* @return void
**/
*/
function _printAssociation($modelName, $type, $associations) {
if (!empty($associations[$type])) {
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.
* @return string Name of field that is a primary key.
* @access public
**/
*/
function findPrimaryKey($fields) {
foreach ($fields as $name => $field) {
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
* @return mixed Name of field to use for displayField or false if the user declines to choose
**/
*/
function findDisplayField($fields) {
$fieldNames = array_keys($fields);
$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
*
* @return void
**/
*/
function initValidations() {
$options = $choices = array();
if (class_exists('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);
$default = 1;
@ -371,7 +364,7 @@ class ModelTask extends Shell {
* @param string $fieldName Name of field to be validated.
* @param array $metaData metadata for field
* @return array Array of validation for the field.
**/
*/
function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
$defaultChoice = count($this->__validations);
$validate = $alreadyChosen = array();
@ -379,7 +372,7 @@ class ModelTask extends Shell {
$anotherValidator = 'y';
while ($anotherValidator == 'y') {
if ($this->interactive) {
$this->out('');
$this->out();
$this->out(sprintf(__('Field: %s', true), $fieldName));
$this->out(sprintf(__('Type: %s', true), $metaData['type']));
$this->hr();
@ -405,7 +398,7 @@ class ModelTask extends Shell {
$guess = $methods['numeric'];
} elseif ($metaData['type'] == 'boolean') {
$guess = $methods['boolean'];
} elseif ($metaData['type'] == 'datetime' || $metaData['type'] == 'date') {
} elseif ($metaData['type'] == 'date') {
$guess = $methods['date'];
} elseif ($metaData['type'] == 'time') {
$guess = $methods['time'];
@ -454,7 +447,7 @@ class ModelTask extends Shell {
$this->out(__('One moment while the associations are detected.', true));
}
$fields = $model->schema();
$fields = $model->schema(true);
if (empty($fields)) {
return false;
}
@ -492,9 +485,9 @@ class ModelTask extends Shell {
* @param object $model Model instance of model being generated.
* @param array $associations Array of inprogress associations
* @return array $associations with belongsTo added in.
**/
*/
function findBelongsTo(&$model, $associations) {
$fields = $model->schema();
$fields = $model->schema(true);
foreach ($fields as $fieldName => $field) {
$offset = strpos($fieldName, '_id');
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 array $associations Array of inprogress associations
* @return array $associations with hasOne and hasMany added in.
**/
*/
function findHasOneAndMany(&$model, $associations) {
$foreignKey = $this->_modelKey($model->name);
foreach ($this->__tables as $otherTable) {
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable));
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable);
$modelFieldsTemp = $tempOtherModel->schema();
$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 array $associations Array of inprogress associations
* @return array $associations with hasAndBelongsToMany added in.
**/
*/
function findHasAndBelongsToMany(&$model, $associations) {
$foreignKey = $this->_modelKey($model->name);
foreach ($this->__tables as $otherTable) {
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable));
$modelFieldsTemp = $tempOtherModel->schema();
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable);
$modelFieldsTemp = $tempOtherModel->schema(true);
$offset = 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 $associations Array of associations to be confirmed.
* @return array Array of confirmed associations
**/
*/
function confirmAssociations(&$model, $associations) {
foreach ($associations as $type => $settings) {
if (!empty($associations[$type])) {
$count = count($associations[$type]);
$response = 'y';
for ($i = 0; $i < $count; $i++) {
$prompt = "{$model->name} {$type} {$associations[$type][$i]['alias']}";
$response = $this->in("{$prompt}?", array('y','n'), 'y');
foreach ($associations[$type] as $i => $assoc) {
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
$response = $this->in($prompt, array('y','n'), 'y');
if ('n' == low($response)) {
if ('n' == strtolower($response)) {
unset($associations[$type][$i]);
} elseif ($type == 'hasMany') {
unset($associations['hasOne'][$i]);
@ -632,12 +625,12 @@ class ModelTask extends Shell {
* @param object $model Temporary model instance
* @param array $associations Array of associations.
* @return array Array of associations.
**/
*/
function doMoreAssociations($model, $associations) {
$prompt = __('Would you like to define some additional model associations?', true);
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
$possibleKeys = $this->_generatePossibleKeys();
while (low($wannaDoMoreAssoc) == 'y') {
while (strtolower($wannaDoMoreAssoc) == 'y') {
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
$this->out(__('What is the association type?', 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.
*
* @return array array of tables and possible keys
**/
*/
function _generatePossibleKeys() {
$possible = array();
foreach ($this->__tables as $otherTable) {
$tempOtherModel = & new Model(array('table' => $otherTable, 'ds' => $this->connection));
$modelFieldsTemp = $tempOtherModel->schema();
$modelFieldsTemp = $tempOtherModel->schema(true);
foreach ($modelFieldsTemp as $fieldName => $field) {
if ($field['type'] == 'integer' || $field['type'] == 'string') {
$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 $useDbConfig Name of the database config you want to get tables from.
* @return void
**/
*/
function getTable($modelName, $useDbConfig = null) {
if (!isset($useDbConfig)) {
$useDbConfig = $this->connection;
}
App::import('Model', 'ConnectionManager', false);
$db =& ConnectionManager::getDataSource($useDbConfig);
$useTable = Inflector::tableize($modelName);
$fullTableName = $db->fullTableName($useTable, false);
$tableIsGood = 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));
$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.
* @return array Array of tables in the database.
**/
*/
function getAllTables($useDbConfig = null) {
if (!isset($useDbConfig)) {
$useDbConfig = $this->connection;
}
App::import('Model', 'ConnectionManager', false);
$tables = array();
$db =& ConnectionManager::getDataSource($useDbConfig);
$db->cacheSources = false;
$usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix'];
if ($usePrefix) {
foreach ($db->listSources() as $table) {
@ -882,17 +880,23 @@ class ModelTask extends Shell {
$this->hr();
$this->out("Usage: cake bake model <arg1>");
$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('');
$this->out();
$this->out("model");
$this->out("\tbakes model in interactive mode.");
$this->out('');
$this->out();
$this->out("model <name>");
$this->out("\tbakes model file with no associations or validation");
$this->out('');
$this->out();
$this->out("model all");
$this->out("\tbakes all model files with associations and validation");
$this->out("");
$this->out();
$this->_stop();
}
@ -904,11 +908,11 @@ class ModelTask extends Shell {
* @access public
* @return void
* @see FixtureTask::bake
**/
*/
function bakeFixture($className, $useTable = null) {
$this->Fixture->connection = $this->connection;
$this->Fixture->plugin = $this->plugin;
$this->Fixture->bake($className, $useTable);
}
}
?>
?>

View file

@ -2,23 +2,20 @@
/**
* The Plugin Task handles creating an empty plugin, ready to be used
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @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 . 'datasources',
'controllers' . DS . 'components',
'libs',
'views' . DS . 'helpers',
'tests' . DS . 'cases' . DS . 'components',
'tests' . DS . 'cases' . DS . 'helpers',
@ -153,10 +151,9 @@ class PluginTask extends Shell {
'tests' . DS . 'cases' . DS . 'models',
'tests' . DS . 'groups',
'tests' . DS . 'fixtures',
'vendors' . DS . 'img',
'vendors' . DS . 'js',
'vendors' . DS . 'css',
'vendors' . DS . 'shells' . DS . 'tasks'
'vendors',
'vendors' . DS . 'shells' . DS . 'tasks',
'webroot'
);
foreach ($directories as $directory) {
@ -204,7 +201,7 @@ class PluginTask extends Shell {
* find and change $this->path to the user selection
*
* @return void
**/
*/
function findPath($pathOptions) {
$valid = false;
$max = count($pathOptions);
@ -232,19 +229,19 @@ class PluginTask extends Shell {
$this->out("Usage: cake bake plugin <arg1> <arg2>...");
$this->hr();
$this->out('Commands:');
$this->out('');
$this->out();
$this->out("plugin <name>");
$this->out("\tbakes plugin directory structure");
$this->out('');
$this->out();
$this->out("plugin <name> model");
$this->out("\tbakes model. Run 'cake bake model help' for more info.");
$this->out('');
$this->out();
$this->out("plugin <name> controller");
$this->out("\tbakes controller. Run 'cake bake controller help' for more info.");
$this->out('');
$this->out();
$this->out("plugin <name> view");
$this->out("\tbakes view. Run 'cake bake view help' for more info.");
$this->out("");
$this->out();
$this->_stop();
}
}

View file

@ -5,21 +5,19 @@
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.bake
* @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
*
@ -32,7 +30,7 @@ class ProjectTask extends Shell {
* configs path (used in testing).
*
* @var string
**/
*/
var $configPath = null;
/**
@ -46,7 +44,6 @@ class ProjectTask extends Shell {
if ($project === null) {
if (isset($this->args[0])) {
$project = $this->args[0];
$this->Dispatch->shiftArgs();
}
}
@ -57,19 +54,22 @@ class ProjectTask extends Shell {
if (empty($this->params['skel'])) {
$this->params['skel'] = '';
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
if (is_dir(CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
$this->params['skel'] = CAKE . 'console' . DS . 'templates' . DS . 'skel';
}
}
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) {
$response = false;
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') {
$response = $project = false;
}
@ -138,23 +138,26 @@ class ProjectTask extends Shell {
$app = basename($path);
$this->out('Bake Project');
$this->out("Skel Directory: $skel");
$this->out("Will be copied to: {$path}");
$this->out(__('Bake Project', true));
$this->out(__("Skel Directory: ", true) . $skel);
$this->out(__("Will be copied to: ", true) . $path);
$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') {
$verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n');
$Folder = new Folder($skel);
if (!empty($this->params['empty'])) {
$skip = array();
}
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
$this->hr();
$this->out(sprintf(__("Created: %s in %s", true), $app, $path));
$this->hr();
} else {
$this->err(" '" . $app . "' could not be created properly");
$this->err(sprintf(__(" '%s' could not be created properly", true), $app));
return false;
}
@ -166,7 +169,7 @@ class ProjectTask extends Shell {
return true;
} elseif (strtolower($looksGood) == 'q') {
$this->out('Bake Aborted.');
$this->out(__('Bake Aborted.', true));
} else {
$this->execute(false);
return false;
@ -183,7 +186,7 @@ class ProjectTask extends Shell {
function createHome($dir) {
$app = basename($dir);
$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);
return $this->createFile($path.'home.ctp', $output);
}
@ -224,7 +227,8 @@ class ProjectTask extends Shell {
$File =& new File($path . 'webroot' . DS . 'index.php');
$contents = $File->read();
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)) {
return false;
}
@ -235,7 +239,7 @@ class ProjectTask extends Shell {
$File =& new File($path . 'webroot' . DS . 'test.php');
$contents = $File->read();
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)) {
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
* @return boolean Success
@ -257,10 +261,10 @@ class ProjectTask extends Shell {
$path = (empty($this->configPath)) ? CONFIGS : $this->configPath;
$File =& new File($path . 'core.php');
$contents = $File->read();
if (preg_match('%([/\\t\\x20]*Configure::write\(\'Routing.admin\',[\\t\\x20\'a-z]*\\);)%', $contents, $match)) {
$result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.admin\', \''.$name.'\');', $contents);
if (preg_match('%([/\\t\\x20]*Configure::write\(\'Routing.prefixes\',[\\t\\x20\'a-z,\)\(]*\\);)%', $contents, $match)) {
$result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.prefixes\', array(\''.$name.'\'));', $contents);
if ($File->write($result)) {
Configure::write('Routing.admin', $name);
Configure::write('Routing.prefixes', array($name));
return true;
} else {
return false;
@ -271,30 +275,48 @@ 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
* @access public
*/
function getAdmin() {
function getPrefix() {
$admin = '';
$cakeAdmin = null;
$adminRoute = Configure::read('Routing.admin');
if (!empty($adminRoute)) {
return $adminRoute . '_';
$prefixes = Configure::read('Routing.prefixes');
if (!empty($prefixes)) {
if ($this->interactive) {
$this->out();
$this->out(__('You have more than one routing prefix configured', true));
}
if (count($prefixes) == 1) {
return $prefixes[0] . '_';
}
$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] . '_';
}
$this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.');
$this->out('What would you like the admin route to be?');
$this->out('Example: www.example.com/admin/controller');
while ($admin == '') {
$admin = $this->in("What would you like the admin route to be?", null, 'admin');
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 == '') {
$admin = $this->in(__("Enter a routing prefix:", true), null, 'admin');
}
if ($this->cakeAdmin($admin) !== true) {
$this->out(__('Unable to write to /app/config/core.php.', true));
$this->out('You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/config/core.php to use prefix routing.');
$this->_stop();
}
return $admin . '_';
}
if ($this->cakeAdmin($admin) !== true) {
$this->out('Unable to write to /app/config/core.php.');
$this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.');
$this->_stop();
}
return $admin . '_';
return '';
}
/**
@ -308,11 +330,11 @@ class ProjectTask extends Shell {
$this->out("Usage: cake bake project <arg1>");
$this->hr();
$this->out('Commands:');
$this->out('');
$this->out();
$this->out("project <name>");
$this->out("\tbakes app directory structure.");
$this->out("\tif <name> begins with '/' path is absolute.");
$this->out("");
$this->out();
$this->_stop();
}

View file

@ -23,7 +23,7 @@ class TemplateTask extends Shell {
* variables to add to template scope
*
* @var array
**/
*/
var $templateVars = array();
/**
@ -31,7 +31,7 @@ class TemplateTask extends Shell {
* Contains a list of $theme => $path
*
* @var array
**/
*/
var $templatePaths = array();
/**
@ -39,7 +39,7 @@ class TemplateTask extends Shell {
*
* @access public
* @return void
**/
*/
function initialize() {
$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.
*
* @return array Array of bake themes that are installed.
**/
*/
function _findThemes() {
$paths = App::path('shells');
$core = array_pop($paths);
@ -128,7 +128,7 @@ class TemplateTask extends Shell {
* @param string $vars Additional vars to set to template scope.
* @access public
* @return contents of generated code template
**/
*/
function generate($directory, $filename, $vars = null) {
if ($vars !== null) {
$this->set($vars);
@ -156,7 +156,7 @@ class TemplateTask extends Shell {
* If there is more than one installed theme user interaction will happen
*
* @return string returns the path to the selected theme.
**/
*/
function getThemePath() {
if (count($this->templatePaths) == 1) {
$paths = array_values($this->templatePaths);
@ -193,7 +193,7 @@ class TemplateTask extends Shell {
* @param string $filename lower_case_underscored filename you want.
* @access public
* @return string filename will exit program if template is not found.
**/
*/
function _findTemplate($path, $directory, $filename) {
$themeFile = $path . $directory . DS . $filename . '.ctp';
if (file_exists($themeFile)) {

View file

@ -4,19 +4,18 @@
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @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.
*
* @var array
**/
* @access public
*/
var $tasks = array('Template');
/**
* class types that methods can be generated for
*
* @var array
**/
* @access public
*/
var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper');
/**
* Internal list of fixtures that have been added so far.
*
* @var string
**/
* @access protected
*/
var $_fixtures = array();
/**
* Flag for interactive mode
*
* @var boolean
**/
*/
var $interactive = false;
/**
@ -165,7 +167,8 @@ class TestTask extends Shell {
* Interact with the user and get their chosen type. Can exit the script.
*
* @return string Users chosen type.
**/
* @access public
*/
function getObjectType() {
$this->hr();
$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.
* @return string Class name the user chose.
**/
* @access public
*/
function getClassName($objectType) {
$options = Configure::listObjects(strtolower($objectType));
$options = App::objects(strtolower($objectType));
$this->out(sprintf(__('Choose a %s class', true), $objectType));
$keys = array();
foreach ($options as $key => $option) {
@ -208,9 +212,12 @@ class TestTask extends Shell {
/**
* Checks whether the chosen type can find its own fixtures.
* 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
**/
* @access public
*/
function typeCanDetectFixtures($type) {
$type = strtolower($type);
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.
*
* @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
**/
* @access public
*/
function isLoadableClass($type, $class) {
return App::import($type, $class);
}
@ -229,8 +239,11 @@ class TestTask extends Shell {
* Construct an instance of the class to be tested.
* 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) {
ClassRegistry::flush();
App::import($type, $class);
@ -246,8 +259,11 @@ class TestTask extends Shell {
/**
* 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
**/
* @access public
*/
function getRealClassName($type, $class) {
if (strtolower($type) == 'model') {
return $class;
@ -261,7 +277,8 @@ class TestTask extends Shell {
*
* @param string $className Name of class to look at.
* @return array Array of method names.
**/
* @access public
*/
function getTestableMethods($className) {
$classMethods = get_class_methods($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
* 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.
**/
* @access public
*/
function generateFixtureList(&$subject) {
$this->_fixtures = array();
if (is_a($subject, 'Model')) {
@ -296,9 +314,10 @@ class TestTask extends Shell {
* Process a model recursively and pull out all the
* model names converting them to fixture names.
*
* @param Model $subject A Model class to scan for associations and pull fixtures off of.
* @return void
* @access protected
**/
*/
function _processModel(&$subject) {
$this->_addFixture($subject->name);
$associated = $subject->getAssociated();
@ -320,9 +339,10 @@ class TestTask extends Shell {
* Process all the models attached to a controller
* and generate a fixture list.
*
* @param Controller $subject A controller to pull model names off of.
* @return void
* @access protected
**/
*/
function _processController(&$subject) {
$subject->constructClasses();
$models = array(Inflector::classify($subject->name));
@ -338,9 +358,10 @@ class TestTask extends Shell {
* Add classname to the fixture list.
* 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
* @access protected
**/
*/
function _addFixture($name) {
$parent = get_parent_class($name);
$prefix = 'app.';
@ -355,8 +376,9 @@ class TestTask extends Shell {
/**
* 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() {
$proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n');
$fixtures = array();
@ -373,8 +395,10 @@ class TestTask extends Shell {
* Is a mock class required for this type of test?
* Controllers require a mock class.
*
* @param string $type The type of object tests are being generated for eg. controller.
* @return boolean
**/
* @access public
*/
function hasMockClass($type) {
$type = strtolower($type);
return $type == 'controller';
@ -383,25 +407,32 @@ class TestTask extends Shell {
/**
* 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.
**/
* @access public
*/
function generateConstructor($type, $fullClassName) {
$type = strtolower($type);
if ($type == 'model') {
return "ClassRegistry::init('$fullClassName');\n";
}
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";
}
/**
* 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.
*
* @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) {
$path = $this->path;
if (isset($this->plugin)) {
@ -413,5 +444,31 @@ class TestTask extends Shell {
}
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();
}
}
?>

View file

@ -2,23 +2,20 @@
/**
* The View Tasks handles creating and updating view files.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @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);
@ -113,6 +110,7 @@ class ViewTask extends Shell {
$this->controllerName = Inflector::camelize($this->args[0]);
$this->controllerPath = Inflector::underscore($this->controllerName);
$this->Project->interactive = false;
if (strtolower($this->args[0]) == '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.
*
* @return array Array of action names that should be baked
**/
*/
function _methodsToBake() {
$methods = array_diff(
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
@ -156,13 +154,13 @@ class ViewTask extends Shell {
$scaffoldActions = true;
$methods = $this->scaffoldActions;
}
$adminRoute = Configure::read('Routing.admin');
$adminRoute = $this->Project->getPrefix();
foreach ($methods as $i => $method) {
if ($adminRoute && isset($this->params['admin'])) {
if ($scaffoldActions) {
$methods[$i] = $adminRoute . '_' . $method;
$methods[$i] = $adminRoute . $method;
continue;
} elseif (strpos($method, $adminRoute . '_') === false) {
} elseif (strpos($method, $adminRoute) === false) {
unset($methods[$i]);
}
}
@ -177,7 +175,7 @@ class ViewTask extends Shell {
* Bake All views for All controllers.
*
* @return void
**/
*/
function all() {
$this->Controller->interactive = false;
$tables = $this->Controller->listAll($this->connection, false);
@ -233,7 +231,7 @@ class ViewTask extends Shell {
$this->bakeActions($actions, $vars);
}
if (strtolower($wannaDoAdmin) == 'y') {
$admin = $this->Project->getAdmin();
$admin = $this->Project->getPrefix();
$regularActions = $this->scaffoldActions;
$adminActions = array();
foreach ($regularActions as $action) {
@ -242,7 +240,7 @@ class ViewTask extends Shell {
$this->bakeActions($adminActions, $vars);
}
$this->hr();
$this->out('');
$this->out();
$this->out(__("View Scaffolding Complete.\n", true));
} else {
$this->customAction();
@ -284,23 +282,21 @@ class ViewTask extends Shell {
$primaryKey = $modelObj->primaryKey;
$displayField = $modelObj->displayField;
$singularVar = Inflector::variable($modelClass);
$pluralVar = Inflector::variable($this->controllerName);
$singularHumanName = Inflector::humanize($modelClass);
$pluralHumanName = Inflector::humanize($this->controllerName);
$schema = $modelObj->schema();
$singularHumanName = $this->_singularHumanName($modelClass);
$schema = $modelObj->schema(true);
$fields = array_keys($schema);
$associations = $this->__associations($modelObj);
} else {
$primaryKey = null;
$displayField = null;
$singularVar = Inflector::variable(Inflector::singularize($this->controllerName));
$pluralVar = Inflector::variable($this->controllerName);
$singularHumanName = Inflector::humanize(Inflector::singularize($this->controllerName));
$pluralHumanName = Inflector::humanize($this->controllerName);
$singularHumanName = $this->_singularHumanName($this->controllerName);
$fields = array();
$schema = array();
$associations = array();
}
$pluralVar = Inflector::variable($this->controllerName);
$pluralHumanName = $this->_pluralHumanName($this->controllerName);
return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
'singularHumanName', 'pluralHumanName', 'fields','associations');
@ -311,7 +307,7 @@ class ViewTask extends Shell {
*
* @param array $actions Array of actions to make files for.
* @return void
**/
*/
function bakeActions($actions, $vars) {
foreach ($actions as $action) {
$content = $this->getContent($action, $vars);
@ -323,7 +319,7 @@ class ViewTask extends Shell {
* handle creation of baking a custom action view file
*
* @return void
**/
*/
function customAction() {
$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('');
$this->out();
$this->hr();
$this->out(__('The following view will be created:', true));
$this->hr();
@ -372,28 +368,12 @@ class ViewTask extends Shell {
/**
* 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
* @return string content from template
* @access public
*/
function getContent($template = null, $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);
}
function getContent($action, $vars = null) {
if (!$vars) {
$vars = $this->__loadController();
}
@ -401,7 +381,7 @@ class ViewTask extends Shell {
$this->Template->set('action', $action);
$this->Template->set('plugin', $this->plugin);
$this->Template->set($vars);
$output = $this->Template->generate('views', $template);
$output = $this->Template->generate('views', $this->getTemplate($action));
if (!empty($output)) {
return $output;
@ -409,6 +389,32 @@ class ViewTask extends Shell {
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
*
@ -418,8 +424,14 @@ class ViewTask extends Shell {
$this->hr();
$this->out("Usage: cake bake view <arg1> <arg2>...");
$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('');
$this->out();
$this->out("view <controller>");
$this->out("\tWill read the given controller for methods");
$this->out("\tand bake corresponding views.");
@ -427,14 +439,14 @@ class ViewTask extends Shell {
$this->out("\tthat begin with Routing.admin.");
$this->out("\tIf var scaffold is found it will bake the CRUD actions");
$this->out("\t(index,view,add,edit)");
$this->out('');
$this->out();
$this->out("view <controller> <action>");
$this->out("\tWill bake a template. core templates: (index, add, edit, view)");
$this->out('');
$this->out();
$this->out("view <controller> <template> <alias>");
$this->out("\tWill use the template specified");
$this->out("\tbut name the file based on the alias");
$this->out('');
$this->out();
$this->out("view all");
$this->out("\tBake all CRUD action views for all controllers.");
$this->out("\tRequires that models and controllers exist.");
@ -447,7 +459,7 @@ class ViewTask extends Shell {
* @return array $associations
* @access private
*/
function __associations($model) {
function __associations(&$model) {
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
$associations = array();
@ -457,7 +469,7 @@ class ViewTask extends Shell {
$associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField;
$associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey'];
$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;

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Test Suite Shell
*
@ -9,20 +7,16 @@
* PHP versions 4 and 5
*
* 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
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake
* @subpackage cake.cake.console.libs
* @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
*/
class TestSuiteShell extends Shell {
@ -75,14 +69,6 @@ class TestSuiteShell extends Shell {
*/
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
*
@ -100,12 +86,60 @@ class TestSuiteShell extends Shell {
$this->__installSimpleTest();
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');
foreach ($plugins as $p) {
$this->plugins[] = Inflector::underscore($p);
}
$this->parseArgs();
$this->getManager();
}
/**
* Parse the arguments given into the Shell object properties.
*
* @return void
* @access public
*/
function parseArgs() {
if (empty($this->args)) {
return;
}
$this->category = $this->args[0];
if (!in_array($this->category, array('app', 'core'))) {
$this->isPluginTest = true;
}
if (isset($this->args[1])) {
$this->type = $this->args[1];
}
if (isset($this->args[2])) {
if ($this->args[2] == 'cov') {
$this->doCoverage = true;
} else {
$this->file = Inflector::underscore($this->args[2]);
}
}
if (isset($this->args[3]) && $this->args[3] == 'cov') {
$this->doCoverage = true;
}
}
/**
* 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;
}
}
/**
@ -115,46 +149,24 @@ class TestSuiteShell extends Shell {
* @access public
*/
function main() {
$this->out($this->headline);
$this->out(__('CakePHP Test Shell', true));
$this->hr();
if (count($this->args) > 0) {
$this->category = $this->args[0];
if (!in_array($this->category, array('app', 'core'))) {
$this->isPluginTest = true;
}
if (isset($this->args[1])) {
$this->type = $this->args[1];
}
if (isset($this->args[2])) {
if ($this->args[2] == 'cov') {
$this->doCoverage = true;
} else {
$this->file = Inflector::underscore($this->args[2]);
}
}
if (isset($this->args[3]) && $this->args[3] == 'cov') {
$this->doCoverage = true;
}
} else {
$this->err('Sorry, you did not pass any arguments!');
if (count($this->args) == 0) {
$this->error(__('Sorry, you did not pass any arguments!', true));
}
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;
if (!$this->__run()) {
$exitCode = 1;
}
exit($exitCode);
$this->_stop($exitCode);
} else {
$this->err('Sorry, the tests could not be found.');
exit(1);
$this->error(__('Sorry, the tests could not be found.', true));
}
}
@ -170,28 +182,28 @@ class TestSuiteShell extends Shell {
$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_file - file name with folder prefix and without the (test|group).php suffix");
$this->out('');
$this->out();
$this->out('Examples: ');
$this->out("\t\tcake testsuite app 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 models/my_model");
$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 router");
$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 core group acl");
$this->out("\t\tcake testsuite core group socket");
$this->out('');
$this->out();
$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\tcake testsuite bugs 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("\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);
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;
}
$folder = $this->__findFolderByCategory($this->category);
if (!file_exists($folder)) {
$this->err($folder . ' not found');
$this->err(sprintf(__('%s not found', true), $folder));
return false;
}
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;
}
switch ($this->type) {
case 'all':
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;
}
if ($isPlugin && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) {
return true;
}
break;
$fileName = $this->__getFileName($folder, $this->isPluginTest);
if ($fileName === true || file_exists($folder . $fileName)) {
return true;
}
$this->err($this->category.' '.$this->type.' '.$this->file.' is an invalid test identifier');
$message = sprintf(
__('%s %s %s is an invalid test identifier', true),
$this->category, $this->type, $this->file
);
$this->err($message);
return false;
}
/**
* Executes the tests depending on our settings
*
@ -258,69 +257,82 @@ class TestSuiteShell extends Shell {
* @access private
*/
function __run() {
$reporter = new CLIReporter();
$this->__setGetVars();
$Reporter = new CakeCliReporter('utf-8', array(
'app' => $this->Manager->appTest,
'plugin' => $this->Manager->pluginTest,
'group' => ($this->type === 'group'),
'codeCoverage' => $this->doCoverage
));
if ($this->type == 'all') {
return TestManager::runAllTests($reporter);
return $this->Manager->runAllTests($Reporter);
}
if ($this->doCoverage) {
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');
exit(0);
$this->out(__('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install', true));
$this->_stop(0);
}
}
if ($this->type == 'group') {
$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) {
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
CodeCoverageManager::start($ucFirstGroup, $reporter);
}
$result = TestManager::runGroupTest($ucFirstGroup, $reporter);
if ($this->doCoverage) {
CodeCoverageManager::report();
CodeCoverageManager::init($ucFirstGroup, $Reporter);
CodeCoverageManager::start();
}
$result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter);
return $result;
}
if ($this->category === 'core') {
$coreCaseExists = file_exists(CORE_TEST_CASES.DS.$this->file.'.test.php');
if ($coreCaseExists) {
$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';
}
$folder = $folder = $this->__findFolderByCategory($this->category);
$case = $this->__getFileName($folder, $this->isPluginTest);
if ($this->doCoverage) {
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
CodeCoverageManager::start($case, $reporter);
CodeCoverageManager::init($case, $Reporter);
CodeCoverageManager::start();
}
$result = TestManager::runTestCase($case, $reporter);
if ($this->doCoverage) {
CodeCoverageManager::report();
}
$result = $this->Manager->runTestCase($case, $Reporter);
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
* @access private
*/
@ -328,44 +340,21 @@ class TestSuiteShell extends Shell {
$folder = '';
$paths = array(
'core' => CAKE,
'app' => APP
'app' => APP
);
$typeDir = $this->type === 'group' ? 'groups' : 'cases';
if (array_key_exists($category, $paths)) {
$folder = $paths[$category] . 'tests';
$folder = $paths[$category] . 'tests' . DS . $typeDir . DS;
} else {
$scoredCategory = Inflector::underscore($category);
$folder = APP . 'plugins' . DS . $scoredCategory . DS;
$pluginPaths = App::path('plugins');
foreach ($pluginPaths as $path) {
if (file_exists($path . $scoredCategory . DS . 'tests')) {
$folder = $path . $scoredCategory . DS . 'tests';
break;
}
$pluginPath = App::pluginPath($category);
if (is_dir($pluginPath . 'tests')) {
$folder = $pluginPath . 'tests' . DS . $typeDir . DS;
}
}
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
*
@ -374,7 +363,7 @@ class TestSuiteShell extends Shell {
*/
function __installSimpleTest() {
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;
}
}

View file

@ -2,8 +2,6 @@
/**
* Bake Template for Controller action generation.
*
*
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
@ -29,10 +27,10 @@
function <?php echo $admin ?>view($id = null) {
if (!$id) {
<?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'));
<?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; ?>
}
$this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id));
@ -44,14 +42,14 @@
$this-><?php echo $currentModelName; ?>->create();
if ($this-><?php echo $currentModelName; ?>->save($this->data)) {
<?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'));
<?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; ?>
} else {
<?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; ?>
}
}
@ -76,23 +74,23 @@
function <?php echo $admin; ?>edit($id = null) {
if (!$id && empty($this->data)) {
<?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'));
<?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; ?>
}
if (!empty($this->data)) {
if ($this-><?php echo $currentModelName; ?>->save($this->data)) {
<?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'));
<?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; ?>
} else {
<?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; ?>
}
}
@ -119,24 +117,24 @@
function <?php echo $admin; ?>delete($id = null) {
if (!$id) {
<?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'));
<?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; ?>
}
if ($this-><?php echo $currentModelName; ?>->del($id)) {
if ($this-><?php echo $currentModelName; ?>->delete($id)) {
<?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'));
<?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 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: ?>
$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; ?>
$this->redirect(array('action' => 'index'));
}

View file

@ -29,14 +29,17 @@ class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>App
var $scaffold;
<?php else: ?>
<?php
echo "\tvar \$helpers = array('Html', 'Form'";
if (count($helpers)):
foreach ($helpers as $help):
echo ", '" . Inflector::camelize($help) . "'";
endforeach;
echo "\tvar \$helpers = array(";
for ($i = 0, $len = count($helpers); $i < $len; $i++):
if ($i != $len - 1):
echo "'" . Inflector::camelize($helpers[$i]) . "', ";
else:
echo "'" . Inflector::camelize($helpers[$i]) . "'";
endif;
endfor;
echo ");\n";
endif;
echo ");\n";
if (count($components)):
echo "\tvar \$components = array(";

View file

@ -42,7 +42,14 @@ if (!empty($validate)):
foreach ($validate as $field => $validations):
echo "\t\t'$field' => array(\n";
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;
echo "\t\t),\n";
endforeach;
@ -52,7 +59,6 @@ endif;
?>
//The Associations below have been created with all possible keys, those that are not needed can be removed
<?php
foreach (array('hasOne', 'belongsTo') as $assocType):
if (!empty($associations[$assocType])):
$typeCount = count($associations[$assocType]);

View file

@ -1,66 +1,61 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.views
* @since CakePHP(tm) v 1.2.0.5234
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> form">
<?php echo "<?php echo \$form->create('{$modelClass}');?>\n";?>
<?php echo "<?php echo \$this->Form->create('{$modelClass}');?>\n";?>
<fieldset>
<legend><?php echo "<?php __('" . Inflector::humanize($action) . " {$singularHumanName}');?>";?></legend>
<legend><?php echo "<?php printf(__('" . Inflector::humanize($action) . " %s', true), __('{$singularHumanName}', true)); ?>";?></legend>
<?php
echo "\t<?php\n";
foreach ($fields as $field) {
if ($action == 'add' && $field == $primaryKey) {
if (strpos($action, 'add') !== false && $field == $primaryKey) {
continue;
} 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'])) {
foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
echo "\t\techo \$form->input('{$assocName}');\n";
echo "\t\techo \$this->Form->input('{$assocName}');\n";
}
}
echo "\t?>\n";
?>
</fieldset>
<?php
echo "<?php echo \$form->end('Submit');?>\n";
echo "<?php echo \$this->Form->end(__('Submit', true));?>\n";
?>
</div>
<div class="actions">
<h3><?php echo "<?php __('Actions'); ?>"; ?></h3>
<ul>
<?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;?>
<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
$done = array();
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
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 \$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(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </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'];
}
}

View file

@ -3,7 +3,7 @@ $output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP
$output .="
<?php
if (Configure::read() > 0):
Debugger::checkSessionKey();
Debugger::checkSecurityKeys();
endif;
?>
<p>
@ -24,7 +24,7 @@ endif;
\$settings = Cache::settings();
if (!empty(\$settings)):
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>';
else:
echo '<span class=\"notice\">';
@ -75,7 +75,7 @@ $output .= "<?php endif;?>\n";
$output .= "<h3><?php __('Editing this Page') ?></h3>\n";
$output .= "<p>\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\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";

View file

@ -1,53 +1,40 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.views
* @since CakePHP(tm) v 1.2.0.5234
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> index">
<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">
<tr>
<?php foreach ($fields as $field):?>
<th><?php echo "<?php echo \$paginator->sort('{$field}');?>";?></th>
<?php endforeach;?>
<th class="actions"><?php echo "<?php __('Actions');?>";?></th>
</tr>
<?php
echo "<?php
\$i = 0;
foreach (\${$pluralVar} as \${$singularVar}):
\$class = null;
if (\$i++ % 2 == 0) {
\$class = ' class=\"altrow\"';
}
?>\n";
<h2><?php echo "<?php __('{$pluralHumanName}');?>";?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<?php foreach ($fields as $field):?>
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}');?>";?></th>
<?php endforeach;?>
<th class="actions"><?php echo "<?php __('Actions');?>";?></th>
</tr>
<?php
echo "<?php
\$i = 0;
foreach (\${$pluralVar} as \${$singularVar}):
\$class = null;
if (\$i++ % 2 == 0) {
\$class = ' class=\"altrow\"';
}
?>\n";
echo "\t<tr<?php echo \$class;?>>\n";
foreach ($fields as $field) {
$isKey = false;
@ -55,42 +42,51 @@ foreach (\${$pluralVar} as \${$singularVar}):
foreach ($associations['belongsTo'] as $alias => $details) {
if ($field === $details['foreignKey']) {
$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;
}
}
}
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}']; ?>&nbsp;</td>\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 \$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(__('View', true), array('action' => 'view', \${$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 \$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</tr>\n";
echo "<?php endforeach; ?>\n";
?>
</table>
</div>
<div class="paging">
<?php echo "\t<?php echo \$paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?>
| <?php echo "\t<?php echo \$paginator->numbers();?>\n"?>
<?php echo "\t<?php echo \$paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>\n";?>
echo "<?php endforeach; ?>\n";
?>
</table>
<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">
<?php echo "\t<?php echo \$this->Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?>
| <?php echo "\t<?php echo \$this->Paginator->numbers();?>\n"?> |
<?php echo "\t<?php echo \$this->Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>\n";?>
</div>
</div>
<div class="actions">
<h3><?php echo "<?php __('Actions'); ?>"; ?></h3>
<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
$done = array();
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
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 \$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(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </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'];
}
}

View file

@ -1,26 +1,20 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.views
* @since CakePHP(tm) v 1.2.0.5234
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<div class="<?php echo $pluralVar;?> view">
@ -34,7 +28,7 @@ foreach ($fields as $field) {
if ($field === $details['foreignKey']) {
$isKey = true;
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&nbsp;\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&nbsp;\n\t\t</dd>\n";
break;
}
}
@ -48,19 +42,20 @@ foreach ($fields as $field) {
</dl>
</div>
<div class="actions">
<h3><?php echo "<?php __('Actions'); ?>"; ?></h3>
<ul>
<?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 \$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 \$html->link(__('List {$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(__('Edit %s', true), __('{$singularHumanName}', true)), array('action' => 'edit', \${$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 \$this->Html->link(sprintf(__('List %s', true), __('{$pluralHumanName}', true)), array('action' => 'index')); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('{$singularHumanName}', true)), array('action' => 'add')); ?> </li>\n";
$done = array();
foreach ($associations as $type => $data) {
foreach ($data as $alias => $details) {
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 \$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(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </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'];
}
}
@ -72,7 +67,7 @@ foreach ($fields as $field) {
if (!empty($associations['hasOne'])) :
foreach ($associations['hasOne'] as $alias => $details): ?>
<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";?>
<dl><?php echo "\t<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?>
<?php
@ -85,7 +80,7 @@ if (!empty($associations['hasOne'])) :
<?php echo "<?php endif; ?>\n";?>
<div class="actions">
<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>
</div>
</div>
@ -105,7 +100,7 @@ foreach ($relations as $alias => $details):
$otherPluralHumanName = Inflector::humanize($details['controller']);
?>
<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";?>
<table cellpadding = "0" cellspacing = "0">
<tr>
@ -132,9 +127,9 @@ echo "\t<?php
}
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 \$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(__('View', true), array('controller' => '{$details['controller']}', 'action' => 'view', \${$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 \$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</tr>\n";
@ -144,7 +139,7 @@ echo "\t<?php endforeach; ?>\n";
<?php echo "<?php endif; ?>\n\n";?>
<div class="actions">
<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>
</div>
</div>

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
@ -9,22 +7,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
@ -9,22 +7,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Helper', 'Helper', false);

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Application model for Cake.
*
@ -9,22 +7,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,4 +1,4 @@
;<?php die() ?>
;<?php exit() ?>
; SVN FILE: $Id$
;/**
; * Short description for file.
@ -6,22 +6,18 @@
; *
; * 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)
; * CakePHP(tm) : Rapid Development Framework http://cakephp.org/
; * Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
; * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
; * @link http://cakephp.org CakePHP(tm) Project
; * @package cake
; * @subpackage cake.app.config
; * @since CakePHP(tm) v 0.10.0.1076
; * @version $Revision$
; * @modifiedby $LastChangedBy$
; * @lastmodified $Date$
; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
; * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
; */
; acl.ini.php - Cake ACL Configuration

View file

@ -8,17 +8,17 @@
* PHP versions 4 and 5
*
* 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
* 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
* @package cake
* @subpackage cake.app.config
* @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)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* This is core configuration file.
*
@ -8,22 +6,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
@ -42,6 +36,21 @@
*/
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
*/
@ -66,11 +75,27 @@
* The value of the define determines the name of the route
* and its associated controller actions:
*
* 'admin' -> admin_index() and /admin/controller/index
* 'admin' -> admin_index() and /admin/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');
/**
* 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.
*
@ -104,17 +129,32 @@
* 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.
*
* 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');
/**
* 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.
*
* '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.
*
* 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');
@ -159,13 +199,18 @@
* CakePHP session IDs are also regenerated between requests if
* 'Security.level' is set to 'high'.
*/
Configure::write('Security.level', 'high');
Configure::write('Security.level', 'medium');
/**
* A random string used in security hashing methods.
*/
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.
* 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.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
* to fix the date & time related errors.

View file

@ -1,5 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* This is core configuration file.
*
@ -7,22 +6,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* In this file you set up your database connection details.

View file

@ -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);
?>

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Short description for file.
*
@ -10,22 +8,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
/**
@ -10,22 +8,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/*

View file

@ -1,10 +1,10 @@
# $Id$
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# Copyright 2005-2009, Cake Software Foundation, Inc.
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
# MIT License (http://www.opensource.org/licenses/mit-license.php)
CREATE TABLE acos (
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
/**
@ -10,22 +8,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/*

View file

@ -1,10 +1,10 @@
# $Id$
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# Copyright 2005-2009, Cake Software Foundation, Inc.
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
# MIT License (http://www.opensource.org/licenses/mit-license.php)
CREATE TABLE i18n (
id int(10) NOT NULL auto_increment,

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
/**
@ -10,22 +8,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/*

View file

@ -1,12 +1,12 @@
# $Id$
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# Copyright 2005-2009, Cake Software Foundation, Inc.
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
# MIT License (http://www.opensource.org/licenses/mit-license.php)
CREATE TABLE cake_sessions (
id varchar(255) NOT NULL default '',

View file

@ -1,6 +1,4 @@
<?php
/* SVN FILE: $Id$ */
/**
* Static content controller.
*
@ -8,22 +6,18 @@
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.controller
* @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
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
@ -85,7 +79,7 @@ class PagesController extends AppController {
$title = Inflector::humanize($path[$count - 1]);
}
$this->set(compact('page', 'subpage', 'title'));
$this->render(join('/', $path));
$this->render(implode('/', $path));
}
}

View file

@ -1,25 +1,19 @@
<?php
/* SVN FILE: $Id$ */
/**
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
?>

View file

View file

@ -1,26 +1,20 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.elements.email.html
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php

View file

@ -1,26 +1,20 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.elements.email.text
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php echo $content; ?>

View file

@ -1,26 +1,20 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php echo $content_for_layout; ?>

View file

@ -1,40 +1,34 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.templates.skel.views.layouts
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $html->charset(); ?>
<?php echo $this->Html->charset(); ?>
<title>
<?php __('CakePHP: the rapid development php framework:'); ?>
<?php echo $title_for_layout; ?>
</title>
<?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;
?>
@ -42,24 +36,24 @@
<body>
<div id="container">
<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 id="content">
<?php $session->flash(); ?>
<?php echo $this->Session->flash(); ?>
<?php echo $content_for_layout; ?>
</div>
<div id="footer">
<?php echo $html->link(
$html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework", true), 'border'=>"0")),
<?php echo $this->Html->link(
$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
'http://www.cakephp.org/',
array('target'=>'_blank'), null, false
array('target' => '_blank', 'escape' => false)
);
?>
</div>
</div>
<?php echo $cakeDebug; ?>
<?php echo $this->element('sql_dump'); ?>
</body>
</html>

View file

@ -1,26 +1,20 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts.email.html
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

View file

@ -1,26 +1,20 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts.email.text
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>

View file

@ -1,32 +1,26 @@
<?php
/* SVN FILE: $Id$ */
/**
*
* 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)
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://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
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $html->charset(); ?>
<?php echo $this->Html->charset(); ?>
<title><?php echo $page_title; ?></title>
<?php if (Configure::read() == 0) { ?>

View file

@ -1,2 +1,2 @@
<?php e($xml->header()); ?>
<?php echo $xml->header(); ?>
<?php echo $content_for_layout; ?>

Some files were not shown because too many files have changed in this diff Show more