"; ?>
+
-
+
Paginator->sort('{$field}'); ?>"; ?> |
"; ?> |
+
+
\n";
+ echo "\n";
echo "\t\n";
foreach ($fields as $field) {
$isKey = false;
@@ -47,22 +47,22 @@
echo "\t\t\n";
echo "\t\t\tHtml->link(__('View'), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
- echo "\t\t\tHtml->link(__('Edit'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
- echo "\t\t\tForm->postLink(__('Delete'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
+ echo "\t\t\tHtml->link(__('Edit'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
+ echo "\t\t\tForm->postLink(__('Delete'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('confirm' => __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}']))); ?>\n";
echo "\t\t | \n";
echo "\t
\n";
echo "\n";
?>
+
Paginator->counter(array(
- 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
+ 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
));
?>"; ?>
-
-
"; ?>
+
"; ?>
Html->link(__('Edit " . $singularHumanName ."'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> \n";
- echo "\t\t
Form->postLink(__('Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> \n";
+ echo "\t\t
Form->postLink(__('Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('confirm' => __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}']))); ?> \n";
echo "\t\t
Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?> \n";
echo "\t\t
Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?> \n";
@@ -54,7 +52,7 @@ foreach ($fields as $field) {
foreach ($data as $alias => $details) {
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
echo "\t\t
Html->link(__('List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> \n";
- echo "\t\t
Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> \n";
+ echo "\t\t
Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> \n";
$done[] = $details['controller'];
}
}
@@ -93,7 +91,6 @@ if (empty($associations['hasAndBelongsToMany'])) {
$associations['hasAndBelongsToMany'] = array();
}
$relations = array_merge($associations['hasMany'], $associations['hasAndBelongsToMany']);
-$i = 0;
foreach ($relations as $alias => $details):
$otherSingularVar = Inflector::variable($alias);
$otherPluralHumanName = Inflector::humanize($details['controller']);
@@ -111,9 +108,7 @@ foreach ($relations as $alias => $details):
"; ?> |
\n";
+echo "\t\n";
echo "\t\t
\n";
foreach ($details['fields'] as $field) {
echo "\t\t\t | \n";
@@ -122,7 +117,7 @@ echo "\t\n";
echo "\t\t\t\tHtml->link(__('View'), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
echo "\t\t\t\tHtml->link(__('Edit'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
- echo "\t\t\t\tForm->postLink(__('Delete'), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), null, __('Are you sure you want to delete # %s?', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
+ echo "\t\t\t\tForm->postLink(__('Delete'), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), array('confirm' => __('Are you sure you want to delete # %s?', \${$otherSingularVar}['{$details['primaryKey']}']))); ?>\n";
echo "\t\t\t\n";
echo "\t\t
\n";
@@ -136,4 +131,6 @@ echo "\t\n";
-
+
diff --git a/lib/Cake/Console/Templates/skel/.htaccess b/lib/Cake/Console/Templates/skel/.htaccess
index fc3aac4..128e787 100644
--- a/lib/Cake/Console/Templates/skel/.htaccess
+++ b/lib/Cake/Console/Templates/skel/.htaccess
@@ -1,5 +1,5 @@
- RewriteEngine on
- RewriteRule ^$ webroot/ [L]
- RewriteRule (.*) webroot/$1 [L]
+ RewriteEngine on
+ RewriteRule ^$ webroot/ [L]
+ RewriteRule (.*) webroot/$1 [L]
\ No newline at end of file
diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
index de35962..9a4f543 100644
--- a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
+++ b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
@@ -1,74 +1,80 @@
array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
- 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'model' => array('type' => 'string', 'null' => true),
- 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'alias' => array('type' => 'string', 'null' => true),
- 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
- );
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
+ 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'model' => array('type' => 'string', 'null' => true),
+ 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'alias' => array('type' => 'string', 'null' => true),
+ 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
+ );
+/**
+ * ARO - Access Request Object - Something that wants something
+ */
public $aros = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
- 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'model' => array('type' => 'string', 'null' => true),
- 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'alias' => array('type' => 'string', 'null' => true),
- 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
- 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
- );
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
+ 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'model' => array('type' => 'string', 'null' => true),
+ 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'alias' => array('type' => 'string', 'null' => true),
+ 'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
+ 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
+ );
+/**
+ * Used by the Cake::Model:Permission class.
+ * Checks if the given $aro has access to action $action in $aco.
+ */
public $aros_acos = array(
- 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
- 'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
- 'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
- '_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
- '_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
- '_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
- '_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
- 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
- );
+ 'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
+ 'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
+ 'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
+ '_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
+ '_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
+ '_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
+ '_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
+ 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
+ );
}
diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql
index f50f392..0bf3f76 100644
--- a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql
+++ b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.sql
@@ -1,8 +1,9 @@
# $Id$
#
-# Copyright 2005-2012, Cake Software Foundation, Inc.
+# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
+# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
# MIT License (http://www.opensource.org/licenses/mit-license.php)
@@ -37,4 +38,15 @@ CREATE TABLE aros (
lft INTEGER(10) DEFAULT NULL,
rght INTEGER(10) DEFAULT NULL,
PRIMARY KEY (id)
-);
\ No newline at end of file
+);
+
+/* this indexes will improve acl perfomance */
+CREATE INDEX idx_acos_lft_rght ON `acos` (`lft`, `rght`);
+
+CREATE INDEX idx_acos_alias ON `acos` (`alias`);
+
+CREATE INDEX idx_aros_lft_rght ON `aros` (`lft`, `rght`);
+
+CREATE INDEX idx_aros_alias ON `aros` (`alias`);
+
+CREATE INDEX idx_aco_id ON `aros_acos` (`aco_id`);
diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
index 1b8b087..cd598b3 100644
--- a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
+++ b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
@@ -1,46 +1,63 @@
array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql
index 239e146..66a42bd 100644
--- a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql
+++ b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.sql
@@ -1,8 +1,9 @@
# $Id$
#
-# Copyright 2005-2012, Cake Software Foundation, Inc.
+# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
+# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
# MIT License (http://www.opensource.org/licenses/mit-license.php)
diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
index d83e096..bd7b1ef 100644
--- a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
+++ b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
@@ -1,43 +1,60 @@
array('type' => 'string', 'null' => false, 'key' => 'primary'),
'data' => array('type' => 'text', 'null' => true, 'default' => null),
diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql
index b8951b6..76845bd 100644
--- a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql
+++ b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.sql
@@ -1,10 +1,11 @@
# $Id$
#
-# Copyright 2005-2012, Cake Software Foundation, Inc.
+# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
+# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
# MIT License (http://www.opensource.org/licenses/mit-license.php)
diff --git a/lib/Cake/Console/Templates/skel/Config/acl.ini.php b/lib/Cake/Console/Templates/skel/Config/acl.ini.php
index 11ce65b..5f37e1c 100644
--- a/lib/Cake/Console/Templates/skel/Config/acl.ini.php
+++ b/lib/Cake/Console/Templates/skel/Config/acl.ini.php
@@ -2,23 +2,12 @@
;/**
; * ACL Configuration
; *
-; *
-; * PHP 5
-; *
-; * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
-; * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
-; *
-; * Licensed under The MIT License
-; * Redistributions of files must retain the above copyright notice.
-; *
-; * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
; * @link http://cakephp.org CakePHP(tm) Project
; * @package app.Config
; * @since CakePHP(tm) v 0.10.0.1076
-; * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
; */
-; acl.ini.php - Cake ACL Configuration
+; acl.ini.php - CakePHP ACL Configuration
; ---------------------------------------------------------------------
; Use this file to specify user permissions.
; aco = access control object (something in your application)
diff --git a/lib/Cake/Console/Templates/skel/Config/acl.php b/lib/Cake/Console/Templates/skel/Config/acl.php
new file mode 100644
index 0000000..d008979
--- /dev/null
+++ b/lib/Cake/Console/Templates/skel/Config/acl.php
@@ -0,0 +1,124 @@
+Auth->authorize = array('Actions' => array('actionPath' => 'controllers/'),...)
+ *
+ * Now, when a user (i.e. jeff) authenticates successfully and requests a controller action (i.e. /invoices/delete)
+ * that is not allowed by default (e.g. via $this->Auth->allow('edit') in the Invoices controller) then AuthComponent
+ * will ask the configured ACL interface if access is granted. Under the assumptions 1. and 2. this will be
+ * done via a call to Acl->check() with
+ *
+ * array('User' => array('username' => 'jeff', 'group_id' => 4, ...))
+ *
+ * as ARO and
+ *
+ * '/controllers/invoices/delete'
+ *
+ * as ACO.
+ *
+ * If the configured map looks like
+ *
+ * $config['map'] = array(
+ * 'User' => 'User/username',
+ * 'Role' => 'User/group_id',
+ * );
+ *
+ * then PhpAcl will lookup if we defined a role like User/jeff. If that role is not found, PhpAcl will try to
+ * find a definition for Role/4. If the definition isn't found then a default role (Role/default) will be used to
+ * check rules for the given ACO. The search can be expanded by defining aliases in the alias configuration.
+ * E.g. if you want to use a more readable name than Role/4 in your definitions you can define an alias like
+ *
+ * $config['alias'] = array(
+ * 'Role/4' => 'Role/editor',
+ * );
+ *
+ * In the roles configuration you can define roles on the lhs and inherited roles on the rhs:
+ *
+ * $config['roles'] = array(
+ * 'Role/admin' => null,
+ * 'Role/accountant' => null,
+ * 'Role/editor' => null,
+ * 'Role/manager' => 'Role/editor, Role/accountant',
+ * 'User/jeff' => 'Role/manager',
+ * );
+ *
+ * In this example manager inherits all rules from editor and accountant. Role/admin doesn't inherit from any role.
+ * Lets define some rules:
+ *
+ * $config['rules'] = array(
+ * 'allow' => array(
+ * '*' => 'Role/admin',
+ * 'controllers/users/(dashboard|profile)' => 'Role/default',
+ * 'controllers/invoices/*' => 'Role/accountant',
+ * 'controllers/articles/*' => 'Role/editor',
+ * 'controllers/users/*' => 'Role/manager',
+ * 'controllers/invoices/delete' => 'Role/manager',
+ * ),
+ * 'deny' => array(
+ * 'controllers/invoices/delete' => 'Role/accountant, User/jeff',
+ * 'controllers/articles/(delete|publish)' => 'Role/editor',
+ * ),
+ * );
+ *
+ * Ok, so as jeff inherits from Role/manager he's matched every rule that references User/jeff, Role/manager,
+ * Role/editor, Role/accountant and Role/default. However, for jeff, rules for User/jeff are more specific than
+ * rules for Role/manager, rules for Role/manager are more specific than rules for Role/editor and so on.
+ * This is important when allow and deny rules match for a role. E.g. Role/accountant is allowed
+ * controllers/invoices/* but at the same time controllers/invoices/delete is denied. But there is a more
+ * specific rule defined for Role/manager which is allowed controllers/invoices/delete. However, the most specific
+ * rule denies access to the delete action explicitly for User/jeff, so he'll be denied access to the resource.
+ *
+ * If we would remove the role definition for User/jeff, then jeff would be granted access as he would be resolved
+ * to Role/manager and Role/manager has an allow rule.
+ */
+
+/**
+ * The role map defines how to resolve the user record from your application
+ * to the roles you defined in the roles configuration.
+ */
+$config['map'] = array(
+ 'User' => 'User/username',
+ 'Role' => 'User/group_id',
+);
+
+/**
+ * define aliases to map your model information to
+ * the roles defined in your role configuration.
+ */
+$config['alias'] = array(
+ 'Role/4' => 'Role/editor',
+);
+
+/**
+ * role configuration
+ */
+$config['roles'] = array(
+ 'Role/admin' => null,
+);
+
+/**
+ * rule configuration
+ */
+$config['rules'] = array(
+ 'allow' => array(
+ '*' => 'Role/admin',
+ ),
+ 'deny' => array(),
+);
diff --git a/lib/Cake/Console/Templates/skel/Config/bootstrap.php b/lib/Cake/Console/Templates/skel/Config/bootstrap.php
index 580f351..0cf81be 100644
--- a/lib/Cake/Console/Templates/skel/Config/bootstrap.php
+++ b/lib/Cake/Console/Templates/skel/Config/bootstrap.php
@@ -8,19 +8,9 @@
* You should also use this file to include any files that provide global functions/constants
* that your application uses.
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 0.10.8.2117
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
// Setup a 'default' cache configuration for use in the application.
@@ -30,49 +20,46 @@ Cache::config('default', array('engine' => 'File'));
* The settings below can be used to set additional paths to models, views and controllers.
*
* App::build(array(
- * 'Model' => array('/path/to/models', '/next/path/to/models'),
- * 'Model/Behavior' => array('/path/to/behaviors', '/next/path/to/behaviors'),
- * 'Model/Datasource' => array('/path/to/datasources', '/next/path/to/datasources'),
- * 'Model/Datasource/Database' => array('/path/to/databases', '/next/path/to/database'),
- * 'Model/Datasource/Session' => array('/path/to/sessions', '/next/path/to/sessions'),
- * 'Controller' => array('/path/to/controllers', '/next/path/to/controllers'),
- * 'Controller/Component' => array('/path/to/components', '/next/path/to/components'),
- * 'Controller/Component/Auth' => array('/path/to/auths', '/next/path/to/auths'),
- * 'Controller/Component/Acl' => array('/path/to/acls', '/next/path/to/acls'),
- * 'View' => array('/path/to/views', '/next/path/to/views'),
- * 'View/Helper' => array('/path/to/helpers', '/next/path/to/helpers'),
- * 'Console' => array('/path/to/consoles', '/next/path/to/consoles'),
- * 'Console/Command' => array('/path/to/commands', '/next/path/to/commands'),
- * 'Console/Command/Task' => array('/path/to/tasks', '/next/path/to/tasks'),
- * 'Lib' => array('/path/to/libs', '/next/path/to/libs'),
- * 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
- * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
- * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
+ * 'Model' => array('/path/to/models/', '/next/path/to/models/'),
+ * 'Model/Behavior' => array('/path/to/behaviors/', '/next/path/to/behaviors/'),
+ * 'Model/Datasource' => array('/path/to/datasources/', '/next/path/to/datasources/'),
+ * 'Model/Datasource/Database' => array('/path/to/databases/', '/next/path/to/database/'),
+ * 'Model/Datasource/Session' => array('/path/to/sessions/', '/next/path/to/sessions/'),
+ * 'Controller' => array('/path/to/controllers/', '/next/path/to/controllers/'),
+ * 'Controller/Component' => array('/path/to/components/', '/next/path/to/components/'),
+ * 'Controller/Component/Auth' => array('/path/to/auths/', '/next/path/to/auths/'),
+ * 'Controller/Component/Acl' => array('/path/to/acls/', '/next/path/to/acls/'),
+ * 'View' => array('/path/to/views/', '/next/path/to/views/'),
+ * 'View/Helper' => array('/path/to/helpers/', '/next/path/to/helpers/'),
+ * 'Console' => array('/path/to/consoles/', '/next/path/to/consoles/'),
+ * 'Console/Command' => array('/path/to/commands/', '/next/path/to/commands/'),
+ * 'Console/Command/Task' => array('/path/to/tasks/', '/next/path/to/tasks/'),
+ * 'Lib' => array('/path/to/libs/', '/next/path/to/libs/'),
+ * 'Locale' => array('/path/to/locales/', '/next/path/to/locales/'),
+ * 'Vendor' => array('/path/to/vendors/', '/next/path/to/vendors/'),
+ * 'Plugin' => array('/path/to/plugins/', '/next/path/to/plugins/'),
* ));
- *
*/
/**
- * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
+ * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other
* string is passed to the inflection functions
*
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
- *
*/
/**
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
- * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
+ * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
- * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
- *
+ * CakePlugin::load('DebugKit'); // Loads a single plugin named DebugKit
*/
/**
- * You can attach event listeners to the request lifecyle as Dispatcher Filter . By Default CakePHP bundles two filters:
+ * You can attach event listeners to the request lifecycle as Dispatcher Filter . By default CakePHP bundles two filters:
*
* - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
* - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
@@ -82,8 +69,8 @@ Cache::config('default', array('engine' => 'File'));
* Configure::write('Dispatcher.filters', array(
* 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app.
* 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin.
- * array('callbale' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch
- * array('callbale' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch
+ * array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch
+ * array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch
*
* ));
*/
@@ -97,12 +84,12 @@ Configure::write('Dispatcher.filters', array(
*/
App::uses('CakeLog', 'Log');
CakeLog::config('debug', array(
- 'engine' => 'FileLog',
+ 'engine' => 'File',
'types' => array('notice', 'info', 'debug'),
'file' => 'debug',
));
CakeLog::config('error', array(
- 'engine' => 'FileLog',
+ 'engine' => 'File',
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
'file' => 'error',
));
diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php
index 14ad697..18d645a 100644
--- a/lib/Cake/Console/Templates/skel/Config/core.php
+++ b/lib/Cake/Console/Templates/skel/Config/core.php
@@ -4,19 +4,9 @@
*
* Use it to configure core behavior of Cake.
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
@@ -35,8 +25,8 @@
Configure::write('debug', 2);
/**
- * Configure the Error handler used to handle errors for your application. By default
- * ErrorHandler::handleError() is used. It will display errors using Debugger, when debug > 0
+ * Configure the Error handler used to handle errors for your application. By default
+ * ErrorHandler::handleError() is used. It will display errors using Debugger, when debug > 0
* and log errors with CakeLog when debug = 0.
*
* Options:
@@ -44,7 +34,7 @@
* - `handler` - callback - The callback to handle errors. You can set this to any callable type,
* including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
- * - `level` - int - The level of errors you are interested in capturing.
+ * - `level` - integer - The level of errors you are interested in capturing.
* - `trace` - boolean - Include stack traces for errors in log files.
*
* @see ErrorHandler for more information on error handling and configuration.
@@ -56,9 +46,9 @@
));
/**
- * Configure the Exception handler used for uncaught exceptions. By default,
+ * Configure the Exception handler used for uncaught exceptions. By default,
* ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
- * while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
+ * while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
* framework errors will be coerced into generic HTTP errors.
*
* Options:
@@ -66,9 +56,12 @@
* - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
* including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
- * - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you
+ * - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you
* should place the file for that class in app/Lib/Error. This class needs to implement a render method.
* - `log` - boolean - Should Exceptions be logged?
+ * - `skipLog` - array - list of exceptions to skip for logging. Exceptions that
+ * extend one of the listed exceptions will also be skipped for logging.
+ * Example: `'skipLog' => array('NotFoundException', 'UnauthorizedException')`
*
* @see ErrorHandler for more information on exception handling and configuration.
*/
@@ -92,10 +85,45 @@
* /app/.htaccess
* /app/webroot/.htaccess
*
- * And uncomment the App.baseUrl below:
+ * And uncomment the App.baseUrl below. But keep in mind
+ * that plugin assets such as images, CSS and JavaScript files
+ * will not work without URL rewriting!
+ * To work around this issue you should either symlink or copy
+ * the plugin assets into you app's webroot directory. This is
+ * recommended even when you are using mod_rewrite. Handling static
+ * assets through the Dispatcher is incredibly inefficient and
+ * included primarily as a development convenience - and
+ * thus not recommended for production applications.
*/
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
+/**
+ * To configure CakePHP to use a particular domain URL
+ * for any URL generation inside the application, set the following
+ * configuration variable to the http(s) address to your domain. This
+ * will override the automatic detection of full base URL and can be
+ * useful when generating links from the CLI (e.g. sending emails)
+ */
+ //Configure::write('App.fullBaseUrl', 'http://example.com');
+
+/**
+ * Web path to the public images directory under webroot.
+ * If not set defaults to 'img/'
+ */
+ //Configure::write('App.imageBaseUrl', 'img/');
+
+/**
+ * Web path to the CSS files directory under webroot.
+ * If not set defaults to 'css/'
+ */
+ //Configure::write('App.cssBaseUrl', 'css/');
+
+/**
+ * Web path to the js files directory under webroot.
+ * If not set defaults to 'js/'
+ */
+ //Configure::write('App.jsBaseUrl', 'js/');
+
/**
* Uncomment the define below to use CakePHP prefix routes.
*
@@ -110,13 +138,11 @@
* 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.
- *
*/
//Configure::write('Cache.disable', true);
@@ -127,15 +153,18 @@
* public $cacheAction inside your controllers to define caching settings.
* You can either set it controller-wide by setting public $cacheAction = true,
* or in each action using $this->cacheAction = true.
- *
*/
//Configure::write('Cache.check', true);
/**
- * Defines the default error type when using the log() function. Used for
- * differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
+ * Enable cache view prefixes.
+ *
+ * If set it will be prepended to the cache name for view file caching. This is
+ * helpful if you deploy the same application via multiple subdomains and languages,
+ * for instance. Each version can then have its own view cache namespace.
+ * Note: The final cache file name will then be `prefix_cachefilename`.
*/
- define('LOG_ERROR', LOG_ERR);
+ //Configure::write('Cache.viewPrefix', 'prefix');
/**
* Session configuration.
@@ -153,8 +182,8 @@
* value to false, when dealing with older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
* - `Session.defaults` - The default configuration set to use as a basis for your session.
* There are four builtins: php, cake, cache, database.
- * - `Session.handler` - Can be used to enable a custom session handler. Expects an array of of callables,
- * that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler`
+ * - `Session.handler` - Can be used to enable a custom session handler. Expects an array of callables,
+ * that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler`
* to the ini array.
* - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
* sessionids that change frequently. See CakeSession::$requestCountdown.
@@ -172,17 +201,11 @@
*
* To use database sessions, run the app/Config/Schema/sessions.php schema using
* the cake shell command: cake schema create Sessions
- *
*/
Configure::write('Session', array(
'defaults' => 'php'
));
-/**
- * The level of CakePHP security.
- */
- Configure::write('Security.level', 'medium');
-
/**
* A random string used in security hashing methods.
*/
@@ -195,7 +218,7 @@
/**
* 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
+ * Will append a query string parameter containing the time the file was modified. This is
* useful for invalidating browser caches.
*
* Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
@@ -216,12 +239,12 @@
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
* output, and setting the config below to the name of the script.
*
- * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
+ * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JsHelper::link().
*/
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
- * The classname and database used in CakePHP's
+ * The class name and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
@@ -234,7 +257,6 @@
//date_default_timezone_set('UTC');
/**
- *
* Cache Engine Configuration
* Default settings provided below
*
@@ -247,7 +269,8 @@
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
- * 'serialize' => true, [optional]
+ * 'serialize' => true, //[optional]
+ * 'mask' => 0664, //[optional]
* ));
*
* APC (http://pecl.php.net/package/APC)
@@ -295,18 +318,20 @@
*/
/**
- * Pick the caching engine to use. If APC is enabled use it.
- * If running via cli - apc is disabled by default. ensure it's available and enabled in this case
+ * Configure the cache handlers that CakePHP will use for internal
+ * metadata like class maps, and model schema.
*
+ * By default File is used, but for improved performance you should use APC.
+ *
+ * Note: 'default' and other application caches should be configured in app/Config/bootstrap.php.
+ * Please check the comments in bootstrap.php for more info on the cache engines available
+ * and their settings.
*/
$engine = 'File';
-if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) {
- $engine = 'Apc';
-}
// In development mode, caches should expire quickly.
$duration = '+999 days';
-if (Configure::read('debug') >= 1) {
+if (Configure::read('debug') > 0) {
$duration = '+10 seconds';
}
@@ -314,7 +339,7 @@ if (Configure::read('debug') >= 1) {
$prefix = 'myapp_';
/**
- * Configure the cache used for general framework caching. Path information,
+ * Configure the cache used for general framework caching. Path information,
* object listings, and translation cache files are stored with this configuration.
*/
Cache::config('_cake_core_', array(
@@ -326,7 +351,7 @@ Cache::config('_cake_core_', array(
));
/**
- * Configure the cache for model and datasource caches. This cache configuration
+ * Configure the cache for model and datasource caches. This cache configuration
* is used to store schema descriptions, and table listings in connections.
*/
Cache::config('_cake_model_', array(
diff --git a/lib/Cake/Console/Templates/skel/Config/database.php.default b/lib/Cake/Console/Templates/skel/Config/database.php.default
index 245c282..cc549a5 100644
--- a/lib/Cake/Console/Templates/skel/Config/database.php.default
+++ b/lib/Cake/Console/Templates/skel/Config/database.php.default
@@ -1,40 +1,22 @@
The name of a supported datasource; valid options are as follows:
- * Database/Mysql - MySQL 4 & 5,
- * Database/Sqlite - SQLite (PHP5 only),
- * Database/Postgres - PostgreSQL 7 and higher,
- * Database/Sqlserver - Microsoft SQL Server 2005 and higher
+ * Database/Mysql - MySQL 4 & 5,
+ * Database/Sqlite - SQLite (PHP5 only),
+ * Database/Postgres - PostgreSQL 7 and higher,
+ * Database/Sqlserver - Microsoft SQL Server 2005 and higher
*
* You can add custom database datasources (or override existing datasources) by adding the
- * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php',
+ * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php',
*
*
* persistent => true / false
@@ -44,11 +26,11 @@
* the host you connect to the database. To add a socket or port number, use 'port' => #
*
* prefix =>
- * Uses the given prefix for all the tables in this database. This setting can be overridden
+ * Uses the given prefix for all the tables in this database. This setting can be overridden
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
- * For Postgres/Sqlserver specifies which schema you would like to use the tables in. Postgres defaults to 'public'. For Sqlserver, it defaults to empty and use
+ * For Postgres/Sqlserver specifies which schema you would like to use the tables in. Postgres defaults to 'public'. For Sqlserver, it defaults to empty and use
* the connected user's default schema (typically 'dbo').
*
* encoding =>
@@ -57,6 +39,15 @@
*
* unix_socket =>
* For MySQL to connect via socket specify the `unix_socket` parameter instead of `host` and `port`
+ *
+ * settings =>
+ * Array of key/value pairs, on connection it executes SET statements for each pair
+ * For MySQL : http://dev.mysql.com/doc/refman/5.6/en/set-statement.html
+ * For Postgres : http://www.postgresql.org/docs/9.2/static/sql-set.html
+ * For Sql Server : http://msdn.microsoft.com/en-us/library/ms190356.aspx
+ *
+ * flags =>
+ * A key/value array of driver specific connection options.
*/
class DATABASE_CONFIG {
diff --git a/lib/Cake/Console/Templates/skel/Config/email.php.default b/lib/Cake/Console/Templates/skel/Config/email.php.default
index c423f78..0a01e38 100644
--- a/lib/Cake/Console/Templates/skel/Config/email.php.default
+++ b/lib/Cake/Console/Templates/skel/Config/email.php.default
@@ -4,41 +4,26 @@
*
* Use it to configure email transports of Cake.
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 2.0.0
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-/**
- * In this file you set up your send email details.
- *
- * @package cake.config
*/
+
/**
* Email configuration class.
* You can specify multiple configurations for production, development and testing.
*
* transport => The name of a supported transport; valid options are as follows:
- * Mail - Send using PHP mail function
+ * Mail - Send using PHP mail function
* Smtp - Send using SMTP
* Debug - Do not send the email, just return the result
*
* You can add custom transports (or override existing transports) by adding the
- * appropriate file to app/Network/Email. Transports should be named 'YourTransport.php',
+ * appropriate file to app/Network/Email. Transports should be named 'YourTransport.php',
* where 'Your' is the name of the transport.
*
* from =>
* The origin email. See CakeEmail::from() about the valid values
- *
*/
class EmailConfig {
@@ -58,7 +43,7 @@ class EmailConfig {
'username' => 'user',
'password' => 'secret',
'client' => null,
- 'log' => false
+ 'log' => false,
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);
diff --git a/lib/Cake/Console/Templates/skel/Config/routes.php b/lib/Cake/Console/Templates/skel/Config/routes.php
index c68cc3e..2562ebe 100644
--- a/lib/Cake/Console/Templates/skel/Config/routes.php
+++ b/lib/Cake/Console/Templates/skel/Config/routes.php
@@ -4,22 +4,13 @@
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
- * different urls to chosen controllers and their actions (functions).
+ * different URLs to chosen controllers and their actions (functions).
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Config
* @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
@@ -27,12 +18,12 @@
*/
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
/**
- * ...and connect the rest of 'Pages' controller's urls.
+ * ...and connect the rest of 'Pages' controller's URLs.
*/
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
/**
- * Load all plugin routes. See the CakePlugin documentation on
+ * Load all plugin routes. See the CakePlugin documentation on
* how to customize the loading of plugin routes.
*/
CakePlugin::routes();
diff --git a/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php b/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php
index 5cc915f..04a3430 100644
--- a/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php
+++ b/lib/Cake/Console/Templates/skel/Console/Command/AppShell.php
@@ -2,18 +2,8 @@
/**
* AppShell file
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since CakePHP(tm) v 2.0
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('Shell', 'Console');
diff --git a/lib/Cake/Console/Templates/skel/Console/cake b/lib/Cake/Console/Templates/skel/Console/cake
index 447743d..6745451 100644
--- a/lib/Cake/Console/Templates/skel/Console/cake
+++ b/lib/Cake/Console/Templates/skel/Console/cake
@@ -2,32 +2,40 @@
################################################################################
#
# Bake is a shell script for running CakePHP bake script
-# PHP 5
#
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
-# Copyright 2005-2012, Cake Software Foundation, Inc.
+# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
+# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
#
-# @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
-# @link http://cakephp.org CakePHP(tm) Project
-# @package app.Console
-# @since CakePHP(tm) v 2.0
-# @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+# @link http://cakephp.org CakePHP(tm) Project
+# @package app.Console
+# @since CakePHP(tm) v 1.2.0.5012
+# @license http://www.opensource.org/licenses/mit-license.php MIT License
#
################################################################################
-LIB=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && LIB=$LIB/$(basename -- "$0")
-while [ -h "$LIB" ]; do
- DIR=$(dirname -- "$LIB")
- SYM=$(readlink "$LIB")
- LIB=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
-done
+# Canonicalize by following every symlink of the given name recursively
+canonicalize() {
+ NAME="$1"
+ if [ -f "$NAME" ]
+ then
+ DIR=$(dirname -- "$NAME")
+ NAME=$(cd -P "$DIR" && pwd -P)/$(basename -- "$NAME")
+ fi
+ while [ -h "$NAME" ]; do
+ DIR=$(dirname -- "$NAME")
+ SYM=$(readlink "$NAME")
+ NAME=$(cd "$DIR" && cd $(dirname -- "$SYM") && pwd)/$(basename -- "$SYM")
+ done
+ echo "$NAME"
+}
-LIB=$(dirname -- "$LIB")/
-APP=`pwd`
+CONSOLE=$(dirname -- "$(canonicalize "$0")")
+APP=$(dirname "$CONSOLE")
-exec php -q "$LIB"cake.php -working "$APP" "$@"
-
-exit;
+exec php -q "$CONSOLE"/cake.php -working "$APP" "$@"
+exit
diff --git a/lib/Cake/Console/Templates/skel/Console/cake.bat b/lib/Cake/Console/Templates/skel/Console/cake.bat
index b28ec8d..e37d4a5 100644
--- a/lib/Cake/Console/Templates/skel/Console/cake.bat
+++ b/lib/Cake/Console/Templates/skel/Console/cake.bat
@@ -1,19 +1,17 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Bake is a shell script for running CakePHP bake script
-:: PHP 5
::
:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
-:: Copyright 2005-2012, Cake Software Foundation, Inc.
+:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
::
:: Licensed under The MIT License
:: Redistributions of files must retain the above copyright notice.
::
-:: @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
-:: @link http://cakephp.org CakePHP(tm) Project
-:: @package app.Console
-:: @since CakePHP(tm) v 2.0
-:: @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+:: @link http://cakephp.org CakePHP(tm) Project
+:: @package app.Console
+:: @since CakePHP(tm) v 2.0
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
diff --git a/lib/Cake/Console/Templates/skel/Console/cake.php b/lib/Cake/Console/Templates/skel/Console/cake.php
index d3c91b1..f5b262a 100644
--- a/lib/Cake/Console/Templates/skel/Console/cake.php
+++ b/lib/Cake/Console/Templates/skel/Console/cake.php
@@ -3,31 +3,46 @@
/**
* Command-line code generation utility to automate programmer chores.
*
- * PHP 5
- *
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc.
+ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
+ * For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Console
* @since CakePHP(tm) v 2.0
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-$ds = DIRECTORY_SEPARATOR;
-$dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php';
+
+if (!defined('DS')) {
+ define('DS', DIRECTORY_SEPARATOR);
+}
+
+$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
if (function_exists('ini_set')) {
$root = dirname(dirname(dirname(__FILE__)));
- ini_set('include_path', $root . PATH_SEPARATOR . __CAKE_PATH__ . PATH_SEPARATOR . ini_get('include_path'));
+ $appDir = basename(dirname(dirname(__FILE__)));
+ $install = $root . DS . 'lib';
+ $composerInstall = $root . DS . $appDir . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
+
+ // the following lines differ from its sibling
+ // /app/Console/cake.php
+ if (file_exists($composerInstall . DS . $dispatcher)) {
+ $install = $composerInstall;
+ } elseif (!file_exists($install . DS . $dispatcher)) {
+ $install = $root . PATH_SEPARATOR . __CAKE_PATH__;
+ }
+
+ ini_set('include_path', $install . PATH_SEPARATOR . ini_get('include_path'));
+ unset($root, $appDir, $install, $composerInstall);
}
if (!include $dispatcher) {
trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
}
-unset($paths, $path, $dispatcher, $root, $ds);
+unset($dispatcher);
return ShellDispatcher::run($argv);
diff --git a/lib/Cake/Console/Templates/skel/Controller/AppController.php b/lib/Cake/Console/Templates/skel/Controller/AppController.php
index 7aab7e9..db4b9e2 100644
--- a/lib/Cake/Console/Templates/skel/Controller/AppController.php
+++ b/lib/Cake/Console/Templates/skel/Controller/AppController.php
@@ -5,19 +5,9 @@
* This file is application-wide controller file. You can put all
* application-wide controller-related methods here.
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Controller
* @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('Controller', 'Controller');
@@ -28,8 +18,8 @@ App::uses('Controller', 'Controller');
* Add your application-wide methods in the class below, your controllers
* will inherit them.
*
- * @package app.Controller
- * @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
+ * @package app.Controller
+ * @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
*/
class AppController extends Controller {
}
diff --git a/lib/Cake/Console/Templates/skel/Controller/PagesController.php b/lib/Cake/Console/Templates/skel/Controller/PagesController.php
index 28edfb6..c97b9a2 100644
--- a/lib/Cake/Console/Templates/skel/Controller/PagesController.php
+++ b/lib/Cake/Console/Templates/skel/Controller/PagesController.php
@@ -4,21 +4,13 @@
*
* This file will render views from views/pages/
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Controller
* @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppController', 'Controller');
+
/**
* Static content controller
*
@@ -39,16 +31,22 @@ class PagesController extends AppController {
/**
* Displays a view
*
- * @param string What page to display
+ * @return void
+ * @throws ForbiddenException When a directory traversal attempt.
+ * @throws NotFoundException When the view file could not be found
+ * or MissingViewException in debug mode.
*/
public function display() {
$path = func_get_args();
$count = count($path);
if (!$count) {
- $this->redirect('/');
+ return $this->redirect('/');
}
- $page = $subpage = $title = null;
+ if (in_array('..', $path, true) || in_array('.', $path, true)) {
+ throw new ForbiddenException();
+ }
+ $page = $subpage = $title_for_layout = null;
if (!empty($path[0])) {
$page = $path[0];
@@ -57,11 +55,17 @@ class PagesController extends AppController {
$subpage = $path[1];
}
if (!empty($path[$count - 1])) {
- $title = Inflector::humanize($path[$count - 1]);
+ $title_for_layout = Inflector::humanize($path[$count - 1]);
}
- $this->set(compact('page', 'subpage'));
- $this->set('title_for_layout', $title);
- $this->render(implode('/', $path));
- }
+ $this->set(compact('page', 'subpage', 'title_for_layout'));
+ try {
+ $this->render(implode('/', $path));
+ } catch (MissingViewException $e) {
+ if (Configure::read('debug')) {
+ throw $e;
+ }
+ throw new NotFoundException();
+ }
+ }
}
diff --git a/lib/Cake/Console/Templates/skel/Model/AppModel.php b/lib/Cake/Console/Templates/skel/Model/AppModel.php
index 94e5e5f..eef7150 100644
--- a/lib/Cake/Console/Templates/skel/Model/AppModel.php
+++ b/lib/Cake/Console/Templates/skel/Model/AppModel.php
@@ -5,19 +5,9 @@
* This file is application-wide model file. You can put all
* application-wide model-related methods here.
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.Model
* @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('Model', 'Model');
diff --git a/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php b/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php
new file mode 100644
index 0000000..9929fa5
--- /dev/null
+++ b/lib/Cake/Console/Templates/skel/Test/Case/AllTestsTest.php
@@ -0,0 +1,31 @@
+addTestDirectoryRecursive(TESTS . 'Case');
+ return $suite;
+ }
+}
diff --git a/lib/Cake/Console/Templates/skel/View/Elements/Flash/default.ctp b/lib/Cake/Console/Templates/skel/View/Elements/Flash/default.ctp
new file mode 100644
index 0000000..ce0f613
--- /dev/null
+++ b/lib/Cake/Console/Templates/skel/View/Elements/Flash/default.ctp
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp
index 2d00c3d..a1333dc 100644
--- a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp
@@ -1,25 +1,22 @@
' . $line . '';
-endforeach;
-?>
\ No newline at end of file
+ echo '
' . $line . "
\n";
+endforeach;
\ No newline at end of file
diff --git a/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp b/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp
index 8b5e8c8..7f88324 100644
--- a/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp
@@ -1,19 +1,17 @@
\ No newline at end of file
diff --git a/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp b/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp
index 6d50860..6c84d88 100644
--- a/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Errors/error400.ctp
@@ -1,22 +1,11 @@
-
+
:
0 ):
+if (Configure::read('debug') > 0):
echo $this->element('exception_stack_trace');
endif;
-?>
diff --git a/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp b/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp
index 4e1f36e..339e140 100644
--- a/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Errors/error500.ctp
@@ -1,28 +1,16 @@
-
+
:
0 ):
+if (Configure::read('debug') > 0):
echo $this->element('exception_stack_trace');
endif;
-?>
diff --git a/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php b/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
index caceda8..f9cbd90 100644
--- a/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
+++ b/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
@@ -5,20 +5,11 @@
* This file is application-wide helper file. You can put all
* application-wide helper-related methods here.
*
- * PHP 5
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Helper
* @since CakePHP(tm) v 0.2.9
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
App::uses('Helper', 'View');
/**
diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp
index 12a9171..c984875 100644
--- a/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp
@@ -1,31 +1,18 @@
-
-
+
fetch('title'); ?>
-
fetch('content'); ?>
This email was sent using the CakePHP Framework
-
+