Permalink
Browse files

Revert "Merge branch '1.3-newlines' into 1.3"

This reverts commit c088131, reversing
changes made to 9341a2b.
  • Loading branch information...
1 parent ffe801b commit 15ed658a2738b7c0b36d3ef7b7c9c6cbaeb2173e gwoo committed Aug 2, 2009
@@ -47,7 +47,7 @@ class ApiShell extends Shell {
*
* @access public
*/
- function initialize() {
+ function initialize () {
$this->paths = array_merge($this->paths, array(
'behavior' => LIBS . 'model' . DS . 'behaviors' . DS,
'cache' => LIBS . 'cache' . DS,
@@ -29,6 +29,7 @@
<?php echo $html->charset(); ?>
<title><?php echo $page_title; ?></title>
+
<?php if (Configure::read() == 0) { ?>
<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/>
<?php } ?>
@@ -746,7 +746,7 @@ function __read($id) {
return false;
}
- return $row[$model->alias]['data'];
+ return $row[$model->alias]['data'];
}
/**
@@ -581,7 +581,7 @@ function prefers($type = null) {
} elseif (count($types) === 1) {
return ($types[0] === $accepts[0]);
} elseif (count($accepts) === 1) {
- return $accepts[0];
+ return $accepts[0];
}
$acceptedTypes = array();
View
@@ -165,6 +165,7 @@ function __construct() {
$this->_templates['js']['code'] = '<div id="{:id}-code" class="cake-code-dump" ';
$this->_templates['js']['code'] .= 'style="display: none;"><pre>{:code}</pre></div>';
+
$e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} ';
$e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>';
$this->_templates['html']['error'] = $e;
@@ -367,6 +367,7 @@ function write($object, $options = array()) {
}
$out .="}\n";
+
$File =& new File($path . DS . $file, true);
$header = '$Id';
$content = "<?php \n/* SVN FILE: {$header}$ */\n/* {$name} schema generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>";
@@ -204,11 +204,10 @@ function connect() {
}
return $this->connected;
}
-
-/**
- * Keeps track of the most recent Oracle error
- *
- */
+ /**
+ * Keeps track of the most recent Oracle error
+ *
+ */
function _setError($source = null, $clear = false) {
if ($source) {
$e = ocierror($source);
@@ -1073,6 +1072,7 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData,
$q = str_replace('= (', 'IN (', $q);
$q = str_replace(' WHERE 1 = 1', '', $q);
+
$q = $this->insertQueryData($q, null, $association, $assocData, $model, $linkModel, $stack);
if ($q != false) {
$res = $this->fetchAll($q, $model->cacheQueries, $model->alias);
@@ -1142,15 +1142,14 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData,
}
}
}
-
-/**
- * Generate a "drop table" statement for the given Schema object
- *
- * @param object $schema An instance of a subclass of CakeSchema
- * @param string $table Optional. If specified only the table name given will be generated.
- * Otherwise, all tables defined in the schema are generated.
- * @return string
- */
+ /**
+ * Generate a "drop table" statement for the given Schema object
+ *
+ * @param object $schema An instance of a subclass of CakeSchema
+ * @param string $table Optional. If specified only the table name given will be generated.
+ * Otherwise, all tables defined in the schema are generated.
+ * @return string
+ */
function dropSchema($schema, $table = null) {
if (!is_a($schema, 'CakeSchema')) {
trigger_error(__('Invalid schema object', true), E_USER_WARNING);
View
@@ -1063,7 +1063,7 @@ function mimeEncode($string, $charset = null, $newline = "\r\n") {
* @return string
* @access private
*/
- function __codepoint($decimal) {
+ function __codepoint ($decimal) {
if ($decimal > 128 && $decimal < 256) {
$return = '0080_00ff'; // Latin-1 Supplement
} elseif ($decimal < 384) {
View
@@ -45,12 +45,12 @@ class Security extends Object {
var $hashType = null;
/**
- * Singleton implementation to get object instance.
- *
- * @return object
- * @access public
- * @static
- */
+ * Singleton implementation to get object instance.
+ *
+ * @return object
+ * @access public
+ * @static
+ */
function &getInstance() {
static $instance = array();
if (!$instance) {
@@ -60,12 +60,12 @@ function &getInstance() {
}
/**
- * Get allowed minutes of inactivity based on security level.
- *
- * @return integer Allowed inactivity in minutes
- * @access public
- * @static
- */
+ * Get allowed minutes of inactivity based on security level.
+ *
+ * @return integer Allowed inactivity in minutes
+ * @access public
+ * @static
+ */
function inactiveMins() {
$_this =& Security::getInstance();
switch (Configure::read('Security.level')) {
@@ -83,12 +83,12 @@ function inactiveMins() {
}
/**
- * Generate authorization hash.
- *
- * @return string Hash
- * @access public
- * @static
- */
+ * Generate authorization hash.
+ *
+ * @return string Hash
+ * @access public
+ * @static
+ */
function generateAuthKey() {
if (!class_exists('String')) {
App::import('Core', 'String');
View
@@ -422,7 +422,7 @@ function extract($path, $data = null, $options = array()) {
$context['key'] = array_pop($context['trace']);
if (isset($context['trace'][1]) && $context['trace'][1] > 0) {
$context['item'] = $context['item'][0];
- } elseif (!empty($context['item'][$key])) {
+ } else if(!empty($context['item'][$key])){
$context['item'] = $context['item'][$key];
} else {
$context['item'] = array_shift($context['item']);
View
@@ -778,7 +778,7 @@ function postal($check, $regex = null, $country = null) {
* @return boolean Success
* @access public
*/
- function range($check, $lower = null, $upper = null) {
+ function range($check, $lower = null, $upper = null ) {
if (!is_numeric($check)) {
return false;
}
@@ -508,6 +508,7 @@ function autoComplete($field, $url = "", $options = array()) {
$options = $this->_optionsToString($options, array('paramName', 'indicator'));
$options = $this->_buildOptions($options, $this->autoCompleteOptions);
+
$text = $this->Form->text($field, $htmlOptions);
$div = $this->Html->div(null, '', $divOptions);
$script = "{$var}new Ajax.Autocompleter('{$htmlOptions['id']}', '{$divOptions['id']}', '";
@@ -902,7 +903,7 @@ function _buildObserver($klass, $name, $options = null) {
$callback = $this->remoteFunction($options);
$hasFrequency = !(!isset($options['frequency']) || intval($options['frequency']) == 0);
- $frequency = $hasFrequency ? $options['frequency'] . ', ' : '';
+ $frequency = $hasFrequency ? $options['frequency'] . ', ' : '';
return "new $klass('$name', {$frequency}function(element, value) {{$callback}})";
}
@@ -1017,4 +1018,5 @@ function afterRender() {
}
}
}
+
?>
@@ -168,4 +168,5 @@ function serialize($data, $options = array()) {
return $data->toString($options + array('header' => false));
}
}
+
?>
View
@@ -58,7 +58,7 @@ class ThemeView extends View {
*
* @param unknown_type $controller
*/
- function __construct(&$controller) {
+ function __construct (&$controller) {
parent::__construct($controller);
$this->theme =& $controller->theme;
@@ -125,7 +125,7 @@ function stdout($string, $newline = true) {
* @return void
*/
function clear() {
-
+
}
/**
@@ -225,6 +225,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array('cake.php');
$expected = array(
'app' => 'app',
@@ -236,6 +237,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'cake.php',
'-app',
@@ -251,6 +253,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'./cake.php',
'bake',
@@ -271,6 +274,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'./console/cake.php',
'bake',
@@ -289,6 +293,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'./console/cake.php',
'bake',
@@ -309,6 +314,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'./console/cake.php',
'-working',
@@ -334,9 +340,11 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$expected = array('./console/cake.php', 'schema', 'run', 'create');
$this->assertEqual($expected, $Dispatcher->args);
+
$params = array(
'/cake/1.2.x.x/cake/console/cake.php',
'-working',
@@ -360,6 +368,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$expected = array('/cake/1.2.x.x/cake/console/cake.php', 'schema', 'run', 'create');
$this->assertEqual($expected, $Dispatcher->args);
$params = array(
@@ -377,10 +386,12 @@ function testParseParams() {
'root' => 'C:\wamp\www\apps\cake'
);
+
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'cake.php',
'-working',
@@ -399,6 +410,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'cake.php',
'-working',
@@ -420,6 +432,7 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
$params = array(
'/home/amelo/dev/cake-common/cake/console/cake.php',
'-root',
@@ -33,6 +33,7 @@
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php';
//require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
+
Mock::generatePartial(
'ShellDispatcher', 'TestDbConfigTaskMockShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
@@ -53,7 +54,7 @@ class TEST_DATABASE_CONFIG {
'database' => 'database_name',
'prefix' => '',
);
-
+
var $otherOne = array(
'driver' => 'mysql',
'persistent' => false,
@@ -72,7 +73,6 @@ class TEST_DATABASE_CONFIG {
* @subpackage cake.tests.cases.console.libs.tasks
*/
class DbConfigTaskTest extends CakeTestCase {
-
/**
* startTest method
*
@@ -88,7 +88,6 @@ function startTest() {
$this->Task->params['working'] = rtrim(APP, '/');
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
}
-
/**
* endTest method
*
@@ -99,7 +98,6 @@ function endTest() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}
-
/**
* Test the getConfig method.
*
@@ -110,7 +108,6 @@ function testGetConfig() {
$result = $this->Task->getConfig();
$this->assertEqual($result, 'otherOne');
}
-
/**
* test that initialize sets the path up.
*
@@ -121,9 +118,8 @@ function testInitialize() {
$this->Task->initialize();
$this->assertFalse(empty($this->Task->path));
$this->assertEqual($this->Task->path, APP . 'config' . DS);
-
+
}
-
/**
* test execute and by extension __interactive
*
Oops, something went wrong.

0 comments on commit 15ed658

Please sign in to comment.