From 30f8709bb40fb3033c081519f0a5da47ddaeddfd Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 27 Aug 2009 22:46:00 -0400 Subject: [PATCH] Removing use of low() in core classes and functions. Refs #6525 --- cake/basics.php | 2 +- cake/console/libs/api.php | 4 ++-- cake/console/libs/tasks/db_config.php | 12 ++++++------ cake/console/libs/tasks/model.php | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index 01133de7e..35bd8ba78 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -496,7 +496,7 @@ if (!function_exists('file_put_contents')) { $expires = strtotime($expires, $now); } - switch (low($target)) { + switch (strtolower($target)) { case 'cache': $filename = CACHE . $path; break; diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index 6513b7e91..e44f096b1 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -173,8 +173,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"); } diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index befedb4c1..aa15518ce 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -108,7 +108,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 +124,7 @@ class DbConfigTask extends Shell { $port = $this->in('Port?', null, 'n'); } - if (low($port) == 'n') { + if (strtolower($port) == 'n') { $port = null; } @@ -155,7 +155,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 +163,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 +173,7 @@ class DbConfigTask extends Shell { $schema = $this->in('Table schema?', null, 'n'); } } - if (low($schema) == 'n') { + if (strtolower($schema) == 'n') { $schema = null; } @@ -185,7 +185,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; } } diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 6dfb2c081..e21a5f91c 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -614,7 +614,7 @@ class ModelTask extends Shell { $prompt = "{$model->name} {$type} {$associations[$type][$i]['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]); @@ -637,7 +637,7 @@ class ModelTask extends Shell { $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)));