ソースを参照

Merge pull request #632 from predominant/2.2

2.2 Coding Standards
José Lorenzo Rodríguez 14 年 前
コミット
21b24c94dd

+ 27 - 29
app/Config/Schema/db_acl.php

@@ -1,6 +1,4 @@
 <?php
-/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
-
 /**
  * This is Acl Schema file
  *
@@ -39,36 +37,36 @@ class DbAclSchema extends CakeSchema {
 	}
 
 	public $acos = 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))
+	);
 
 	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))
+	);
 
 	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))
+	);
 
 }

+ 8 - 10
app/Config/Schema/i18n.php

@@ -1,6 +1,4 @@
 <?php
-/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
-
 /**
  * This is i18n Schema file
  *
@@ -39,13 +37,13 @@ class i18nSchema extends CakeSchema {
 	}
 
 	public $i18n = array(
-			'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
-			'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
-			'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
-			'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
-			'field' => array('type'=>'string', 'null' => false, 'key' => 'index'),
-			'content' => array('type'=>'text', 'null' => true, 'default' => NULL),
-			'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
-		);
+		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
+		'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
+		'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
+		'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
+		'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
+		'content' => array('type' => 'text', 'null' => true, 'default' => null),
+		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
+	);
 
 }

+ 5 - 7
app/Config/Schema/sessions.php

@@ -1,6 +1,4 @@
 <?php
-/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
-
 /**
  * This is Sessions Schema file
  *
@@ -39,10 +37,10 @@ class SessionsSchema extends CakeSchema {
 	}
 
 	public $cake_sessions = array(
-			'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'),
-			'data' => array('type'=>'text', 'null' => true, 'default' => NULL),
-			'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL),
-			'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
-		);
+		'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
+		'data' => array('type' => 'text', 'null' => true, 'default' => null),
+		'expires' => array('type' => 'integer', 'null' => true, 'default' => null),
+		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
+	);
 
 }

+ 2 - 2
app/Console/cake.php

@@ -22,10 +22,10 @@ $dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php';
 
 if (function_exists('ini_set')) {
 	$root = dirname(dirname(dirname(__FILE__)));
-	ini_set('include_path', $root . $ds. 'lib' . PATH_SEPARATOR . ini_get('include_path'));
+	ini_set('include_path', $root . $ds . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
 }
 
-if (!include($dispatcher)) {
+if (!include ($dispatcher)) {
 	trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
 }
 unset($paths, $path, $dispatcher, $root, $ds);

+ 0 - 1
app/Controller/PagesController.php

@@ -38,7 +38,6 @@ class PagesController extends AppController {
  */
 	public $name = 'Pages';
 
-
 /**
  * This controller does not use a model
  *

+ 31 - 31
app/webroot/index.php

@@ -21,9 +21,9 @@
 /**
  * Use the DS to separate the directories in other defines
  */
-	if (!defined('DS')) {
-		define('DS', DIRECTORY_SEPARATOR);
-	}
+if (!defined('DS')) {
+	define('DS', DIRECTORY_SEPARATOR);
+}
 /**
  * These defines should only be edited if you have cake installed in
  * a directory layout other than the way it is distributed.
@@ -34,16 +34,16 @@
  * The full path to the directory which holds "app", WITHOUT a trailing DS.
  *
  */
-	if (!defined('ROOT')) {
-		define('ROOT', dirname(dirname(dirname(__FILE__))));
-	}
+if (!defined('ROOT')) {
+	define('ROOT', dirname(dirname(dirname(__FILE__))));
+}
 /**
  * The actual directory name for the "app".
  *
  */
-	if (!defined('APP_DIR')) {
-		define('APP_DIR', basename(dirname(dirname(__FILE__))));
-	}
+if (!defined('APP_DIR')) {
+	define('APP_DIR', basename(dirname(dirname(__FILE__))));
+}
 
 /**
  * The absolute path to the "cake" directory, WITHOUT a trailing DS.
@@ -63,30 +63,30 @@
  * Change at your own risk.
  *
  */
-	if (!defined('WEBROOT_DIR')) {
-		define('WEBROOT_DIR', basename(dirname(__FILE__)));
-	}
-	if (!defined('WWW_ROOT')) {
-		define('WWW_ROOT', dirname(__FILE__) . DS);
-	}
+if (!defined('WEBROOT_DIR')) {
+	define('WEBROOT_DIR', basename(dirname(__FILE__)));
+}
+if (!defined('WWW_ROOT')) {
+	define('WWW_ROOT', dirname(__FILE__) . DS);
+}
 
-	if (!defined('CAKE_CORE_INCLUDE_PATH')) {
-		if (function_exists('ini_set')) {
-			ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
-		}
-		if (!include('Cake' . DS . 'bootstrap.php')) {
-			$failed = true;
-		}
-	} else {
-		if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
-			$failed = true;
-		}
+if (!defined('CAKE_CORE_INCLUDE_PATH')) {
+	if (function_exists('ini_set')) {
+		ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
+	}
+	if (!include ('Cake' . DS . 'bootstrap.php')) {
+		$failed = true;
 	}
-	if (!empty($failed)) {
-		trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
+} else {
+	if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
+		$failed = true;
 	}
+}
+if (!empty($failed)) {
+	trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
+}
 
-	App::uses('Dispatcher', 'Routing');
+App::uses('Dispatcher', 'Routing');
 
-	$Dispatcher = new Dispatcher();
-	$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
+$Dispatcher = new Dispatcher();
+$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));

+ 11 - 11
app/webroot/test.php

@@ -21,9 +21,9 @@ ini_set('display_errors', 1);
 /**
  * Use the DS to separate the directories in other defines
  */
-	if (!defined('DS')) {
-		define('DS', DIRECTORY_SEPARATOR);
-	}
+if (!defined('DS')) {
+	define('DS', DIRECTORY_SEPARATOR);
+}
 /**
  * These defines should only be edited if you have cake installed in
  * a directory layout other than the way it is distributed.
@@ -34,16 +34,16 @@ ini_set('display_errors', 1);
  * The full path to the directory which holds "app", WITHOUT a trailing DS.
  *
  */
-	if (!defined('ROOT')) {
-		define('ROOT', dirname(dirname(dirname(__FILE__))));
-	}
+if (!defined('ROOT')) {
+	define('ROOT', dirname(dirname(dirname(__FILE__))));
+}
 /**
  * The actual directory name for the "app".
  *
  */
-	if (!defined('APP_DIR')) {
-		define('APP_DIR', basename(dirname(dirname(__FILE__))));
-	}
+if (!defined('APP_DIR')) {
+	define('APP_DIR', basename(dirname(dirname(__FILE__))));
+}
 
 /**
  * The absolute path to the "Cake" directory, WITHOUT a trailing DS.
@@ -71,11 +71,11 @@ if (!defined('CAKE_CORE_INCLUDE_PATH')) {
 	if (function_exists('ini_set')) {
 		ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
 	}
-	if (!include('Cake' . DS . 'bootstrap.php')) {
+	if (!include ('Cake' . DS . 'bootstrap.php')) {
 		$failed = true;
 	}
 } else {
-	if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
+	if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
 		$failed = true;
 	}
 }

+ 11 - 9
index.php

@@ -20,21 +20,23 @@
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
+
 /**
  *  Get Cake's root directory
  */
-	define('APP_DIR', 'app');
-	define('DS', DIRECTORY_SEPARATOR);
-	define('ROOT', dirname(__FILE__));
-	define('WEBROOT_DIR', 'webroot');
-	define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
+define('APP_DIR', 'app');
+define('DS', DIRECTORY_SEPARATOR);
+define('ROOT', dirname(__FILE__));
+define('WEBROOT_DIR', 'webroot');
+define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
+
 /**
  * This only needs to be changed if the "cake" directory is located
  * outside of the distributed structure.
  * Full path to the directory containing "cake". Do not add trailing directory separator
  */
-	if (!defined('CAKE_CORE_INCLUDE_PATH')) {
-		define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
-	}
+if (!defined('CAKE_CORE_INCLUDE_PATH')) {
+	define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
+}
 
-	require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
+require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';

+ 0 - 1
lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php

@@ -549,7 +549,6 @@ class TestTaskTest extends CakeTestCase {
 		$this->assertContains('unset($this->Example)', $result);
 	}
 
-
 /**
  * test Constructor generation ensure that constructClasses is called for controllers
  *