Skip to content
Permalink
Browse files

Convert models, datasources and file/folders to new version of transl…

…ation shortcut function.
  • Loading branch information...
predominant committed Apr 15, 2010
1 parent 2f8d30d commit 6bd9f0f05b26ca3e97fa7cb488d9ce74daa3d4c5
@@ -679,11 +679,11 @@ function _output($data = array()) {
*/
function checkSecurityKeys() {
if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') {
trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application', true), E_USER_NOTICE);
trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application'), E_USER_NOTICE);
}
if (Configure::read('Security.cipherSeed') === '76859309657453542496749683645') {
trigger_error(__('Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application', true), E_USER_NOTICE);
trigger_error(__('Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application'), E_USER_NOTICE);
}
}
@@ -156,7 +156,7 @@ public function error404($params) {
$this->controller->header("HTTP/1.0 404 Not Found");
$this->controller->set(array(
'code' => '404',
'name' => __('Not Found', true),
'name' => __('Not Found'),
'message' => h($url),
'base' => $this->controller->base
));
@@ -178,7 +178,7 @@ public function error500($params) {
$this->controller->header("HTTP/1.0 500 Internal Server Error");
$this->controller->set(array(
'code' => '500',
'name' => __('An Internal Error Has Occurred', true),
'name' => __('An Internal Error Has Occurred'),
'message' => h($url),
'base' => $this->controller->base
));
@@ -196,7 +196,7 @@ public function missingController($params) {
$this->controller->set(array(
'controller' => $className,
'controllerName' => $controllerName,
'title' => __('Missing Controller', true)
'title' => __('Missing Controller')
));
$this->_outputMessage('missingController');
}
@@ -214,7 +214,7 @@ public function missingAction($params) {
'controller' => $className,
'controllerName' => $controllerName,
'action' => $action,
'title' => __('Missing Method in Controller', true)
'title' => __('Missing Method in Controller')
));
$this->_outputMessage('missingAction');
}
@@ -230,7 +230,7 @@ public function privateAction($params) {
$this->controller->set(array(
'controller' => $className,
'action' => $action,
'title' => __('Trying to access private method in class', true)
'title' => __('Trying to access private method in class')
));
$this->_outputMessage('privateAction');
}
@@ -248,7 +248,7 @@ public function missingTable($params) {
'code' => '500',
'model' => $className,
'table' => $table,
'title' => __('Missing Database Table', true)
'title' => __('Missing Database Table')
));
$this->_outputMessage('missingTable');
}
@@ -262,7 +262,7 @@ public function missingDatabase($params = array()) {
$this->controller->header("HTTP/1.0 500 Internal Server Error");
$this->controller->set(array(
'code' => '500',
'title' => __('Scaffold Missing Database Connection', true)
'title' => __('Scaffold Missing Database Connection')
));
$this->_outputMessage('missingScaffolddb');
}
@@ -279,7 +279,7 @@ public function missingView($params) {
'controller' => $className,
'action' => $action,
'file' => $file,
'title' => __('Missing View', true)
'title' => __('Missing View')
));
$this->_outputMessage('missingView');
}
@@ -295,7 +295,7 @@ public function missingLayout($params) {
$this->controller->layout = 'default';
$this->controller->set(array(
'file' => $file,
'title' => __('Missing Layout', true)
'title' => __('Missing Layout')
));
$this->_outputMessage('missingLayout');
}
@@ -312,7 +312,7 @@ public function missingConnection($params) {
$this->controller->set(array(
'code' => '500',
'model' => $className,
'title' => __('Missing Database Connection', true)
'title' => __('Missing Database Connection')
));
$this->_outputMessage('missingConnection');
}
@@ -328,7 +328,7 @@ public function missingHelperFile($params) {
$this->controller->set(array(
'helperClass' => Inflector::camelize($helper) . "Helper",
'file' => $file,
'title' => __('Missing Helper File', true)
'title' => __('Missing Helper File')
));
$this->_outputMessage('missingHelperFile');
}
@@ -344,7 +344,7 @@ public function missingHelperClass($params) {
$this->controller->set(array(
'helperClass' => Inflector::camelize($helper) . "Helper",
'file' => $file,
'title' => __('Missing Helper Class', true)
'title' => __('Missing Helper Class')
));
$this->_outputMessage('missingHelperClass');
}
@@ -360,7 +360,7 @@ public function missingBehaviorFile($params) {
$this->controller->set(array(
'behaviorClass' => Inflector::camelize($behavior) . "Behavior",
'file' => $file,
'title' => __('Missing Behavior File', true)
'title' => __('Missing Behavior File')
));
$this->_outputMessage('missingBehaviorFile');
}
@@ -376,7 +376,7 @@ public function missingBehaviorClass($params) {
$this->controller->set(array(
'behaviorClass' => Inflector::camelize($behavior) . "Behavior",
'file' => $file,
'title' => __('Missing Behavior Class', true)
'title' => __('Missing Behavior Class')
));
$this->_outputMessage('missingBehaviorClass');
}
@@ -393,7 +393,7 @@ public function missingComponentFile($params) {
'controller' => $className,
'component' => $component,
'file' => $file,
'title' => __('Missing Component File', true)
'title' => __('Missing Component File')
));
$this->_outputMessage('missingComponentFile');
}
@@ -410,7 +410,7 @@ public function missingComponentClass($params) {
'controller' => $className,
'component' => $component,
'file' => $file,
'title' => __('Missing Component Class', true)
'title' => __('Missing Component Class')
));
$this->_outputMessage('missingComponentClass');
}
@@ -425,7 +425,7 @@ public function missingModel($params) {
$this->controller->set(array(
'model' => $className,
'title' => __('Missing Model', true)
'title' => __('Missing Model')
));
$this->_outputMessage('missingModel');
}
@@ -368,11 +368,11 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr
if ($recursive === false && is_dir($path)) {
if (@chmod($path, intval($mode, 8))) {
$this->__messages[] = sprintf(__('%s changed to %s', true), $path, $mode);
$this->__messages[] = sprintf(__('%s changed to %s'), $path, $mode);
return true;
}
$this->__errors[] = sprintf(__('%s NOT changed to %s', true), $path, $mode);
$this->__errors[] = sprintf(__('%s NOT changed to %s'), $path, $mode);
return false;
}
@@ -389,9 +389,9 @@ public function chmod($path, $mode = false, $recursive = true, $exceptions = arr
}
if (@chmod($fullpath, intval($mode, 8))) {
$this->__messages[] = sprintf(__('%s changed to %s', true), $fullpath, $mode);
$this->__messages[] = sprintf(__('%s changed to %s'), $fullpath, $mode);
} else {
$this->__errors[] = sprintf(__('%s NOT changed to %s', true), $fullpath, $mode);
$this->__errors[] = sprintf(__('%s NOT changed to %s'), $fullpath, $mode);
}
}
}
@@ -476,7 +476,7 @@ public function create($pathname, $mode = false) {
}
if (is_file($pathname)) {
$this->__errors[] = sprintf(__('%s is a file', true), $pathname);
$this->__errors[] = sprintf(__('%s is a file'), $pathname);
return false;
}
$nextPathname = substr($pathname, 0, strrpos($pathname, DS));
@@ -486,11 +486,11 @@ public function create($pathname, $mode = false) {
$old = umask(0);
if (mkdir($pathname, $mode)) {
umask($old);
$this->__messages[] = sprintf(__('%s created', true), $pathname);
$this->__messages[] = sprintf(__('%s created'), $pathname);
return true;
} else {
umask($old);
$this->__errors[] = sprintf(__('%s NOT created', true), $pathname);
$this->__errors[] = sprintf(__('%s NOT created'), $pathname);
return false;
}
}
@@ -563,9 +563,9 @@ public function delete($path = null) {
}
if (is_file($file) === true) {
if (@unlink($file)) {
$this->__messages[] = sprintf(__('%s removed', true), $file);
$this->__messages[] = sprintf(__('%s removed'), $file);
} else {
$this->__errors[] = sprintf(__('%s NOT removed', true), $file);
$this->__errors[] = sprintf(__('%s NOT removed'), $file);
}
} elseif (is_dir($file) === true && $this->delete($file) === false) {
return false;
@@ -574,10 +574,10 @@ public function delete($path = null) {
}
$path = substr($path, 0, strlen($path) - 1);
if (rmdir($path) === false) {
$this->__errors[] = sprintf(__('%s NOT removed', true), $path);
$this->__errors[] = sprintf(__('%s NOT removed'), $path);
return false;
} else {
$this->__messages[] = sprintf(__('%s removed', true), $path);
$this->__messages[] = sprintf(__('%s removed'), $path);
}
}
return true;
@@ -612,7 +612,7 @@ public function copy($options = array()) {
$mode = $options['mode'];
if (!$this->cd($fromDir)) {
$this->__errors[] = sprintf(__('%s not found', true), $fromDir);
$this->__errors[] = sprintf(__('%s not found'), $fromDir);
return false;
}
@@ -621,7 +621,7 @@ public function copy($options = array()) {
}
if (!is_writable($toDir)) {
$this->__errors[] = sprintf(__('%s not writable', true), $toDir);
$this->__errors[] = sprintf(__('%s not writable'), $toDir);
return false;
}
@@ -635,9 +635,9 @@ public function copy($options = array()) {
if (copy($from, $to)) {
chmod($to, intval($mode, 8));
touch($to, filemtime($from));
$this->__messages[] = sprintf(__('%s copied to %s', true), $from, $to);
$this->__messages[] = sprintf(__('%s copied to %s'), $from, $to);
} else {
$this->__errors[] = sprintf(__('%s NOT copied to %s', true), $from, $to);
$this->__errors[] = sprintf(__('%s NOT copied to %s'), $from, $to);
}
}
@@ -648,11 +648,11 @@ public function copy($options = array()) {
$old = umask(0);
chmod($to, $mode);
umask($old);
$this->__messages[] = sprintf(__('%s created', true), $to);
$this->__messages[] = sprintf(__('%s created'), $to);
$options = array_merge($options, array('to'=> $to, 'from'=> $from));
$this->copy($options);
} else {
$this->__errors[] = sprintf(__('%s not created', true), $to);
$this->__errors[] = sprintf(__('%s not created'), $to);
}
}
}
@@ -505,7 +505,7 @@ protected function _decodeBody($body, $encoding = 'chunked') {
if (!is_callable(array(&$this, $decodeMethod))) {
if (!$this->quirksMode) {
trigger_error(sprintf(__('HttpSocket::_decodeBody - Unknown encoding: %s. Activate quirks mode to surpress error.', true), h($encoding)), E_USER_WARNING);
trigger_error(sprintf(__('HttpSocket::_decodeBody - Unknown encoding: %s. Activate quirks mode to surpress error.'), h($encoding)), E_USER_WARNING);
}
return array('body' => $body, 'header' => false);
}
@@ -530,7 +530,7 @@ protected function _decodeChunkedBody($body) {
while ($chunkLength !== 0) {
if (!preg_match("/^([0-9a-f]+) *(?:;(.+)=(.+))?\r\n/iU", $body, $match)) {
if (!$this->quirksMode) {
trigger_error(__('HttpSocket::_decodeChunkedBody - Could not parse malformed chunk. Activate quirks mode to do this.', true), E_USER_WARNING);
trigger_error(__('HttpSocket::_decodeChunkedBody - Could not parse malformed chunk. Activate quirks mode to do this.'), E_USER_WARNING);
return false;
}
break;
@@ -788,7 +788,7 @@ protected function _buildRequestLine($request = array(), $versionToken = 'HTTP/1
if (is_string($request)) {
$isValid = preg_match("/(.+) (.+) (.+)\r\n/U", $request, $match);
if (!$this->quirksMode && (!$isValid || ($match[2] == '*' && !in_array($match[3], $asteriskMethods)))) {
trigger_error(__('HttpSocket::_buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.', true), E_USER_WARNING);
trigger_error(__('HttpSocket::_buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.'), E_USER_WARNING);
return false;
}
return $request;
@@ -803,7 +803,7 @@ protected function _buildRequestLine($request = array(), $versionToken = 'HTTP/1
$request['uri'] = $this->_buildUri($request['uri'], '/%path?%query');
if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) {
trigger_error(sprintf(__('HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', true), join(',', $asteriskMethods)), E_USER_WARNING);
trigger_error(sprintf(__('HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.'), join(',', $asteriskMethods)), E_USER_WARNING);
return false;
}
return $request['method'].' '.$request['uri'].' '.$versionToken.$this->lineBreak;
@@ -59,7 +59,7 @@ public function setup(&$model, $config = array()) {
$model->{$type} =& ClassRegistry::init($type);
}
if (!method_exists($model, 'parentNode')) {
trigger_error(sprintf(__('Callback parentNode() not defined in %s', true), $model->alias), E_USER_WARNING);
trigger_error(sprintf(__('Callback parentNode() not defined in %s'), $model->alias), E_USER_WARNING);
}
}
@@ -345,7 +345,7 @@ public function containments(&$Model, $contain, $containments = array(), $throwE
if (!isset($Model->{$name}) || !is_object($Model->{$name})) {
if ($throwErrors) {
trigger_error(sprintf(__('Model "%s" is not associated with model "%s"', true), $Model->alias, $name), E_USER_WARNING);
trigger_error(sprintf(__('Model "%s" is not associated with model "%s"'), $Model->alias, $name), E_USER_WARNING);
}
continue;
}
@@ -52,7 +52,7 @@ public function setup(&$model, $config = array()) {
$db =& ConnectionManager::getDataSource($model->useDbConfig);
if (!$db->connected) {
trigger_error(
sprintf(__('Datasource %s for TranslateBehavior of model %s is not connected', true), $model->useDbConfig, $model->alias),
sprintf(__('Datasource %s for TranslateBehavior of model %s is not connected'), $model->useDbConfig, $model->alias),
E_USER_ERROR
);
return false;
@@ -429,7 +429,7 @@ function bindTranslation(&$model, $fields, $reset = true) {
foreach (array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany') as $type) {
if (isset($model->{$type}[$association]) || isset($model->__backAssociation[$type][$association])) {
trigger_error(
sprintf(__('Association %s is already binded to model %s', true), $association, $model->alias),
sprintf(__('Association %s is already binded to model %s'), $association, $model->alias),
E_USER_ERROR
);
return false;
@@ -537,7 +537,7 @@ public function __columns(&$Obj) {
$value['key'] = 'primary';
}
if (!isset($db->columns[$value['type']])) {
trigger_error(sprintf(__('Schema generation error: invalid column type %s does not exist in DBO', true), $value['type']), E_USER_NOTICE);
trigger_error(sprintf(__('Schema generation error: invalid column type %s does not exist in DBO'), $value['type']), E_USER_NOTICE);
continue;
} else {
$defaultCol = $db->columns[$value['type']];
@@ -99,15 +99,15 @@ function &getDataSource($name) {
}
if (empty($_this->_connectionsEnum[$name])) {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Non-existent data source %s", true), $name), E_USER_ERROR);
trigger_error(sprintf(__("ConnectionManager::getDataSource - Non-existent data source %s"), $name), E_USER_ERROR);
$null = null;
return $null;
}
$conn = $_this->_connectionsEnum[$name];
$class = $conn['classname'];
if ($_this->loadDataSource($name) === null) {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Could not load class %s", true), $class), E_USER_ERROR);
trigger_error(sprintf(__("ConnectionManager::getDataSource - Could not load class %s"), $class), E_USER_ERROR);
$null = null;
return $null;
}
@@ -182,7 +182,7 @@ function loadDataSource($connName) {
$class = "{$conn['plugin']}.{$conn['classname']}";
if (!App::import('Datasource', $class, !is_null($conn['plugin']))) {
trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true), $class), E_USER_ERROR);
trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s'), $class), E_USER_ERROR);
return null;
}
return true;
Oops, something went wrong.

0 comments on commit 6bd9f0f

Please sign in to comment.
You can’t perform that action at this time.