------------------------------------------------------------
revno: 1179
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Wed 2012-04-25 21:42:08 +0200
message:
literals with __() functions
modified:
libs/AikiScript.php
libs/Archive.php*
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'libs/AikiScript.php'
--- libs/AikiScript.php 2012-04-20 11:15:52 +0000
+++ libs/AikiScript.php 2012-04-25 19:42:08 +0000
@@ -328,7 +328,7 @@
if (!isset($aiki->$class)) {
$aiki->load($class);
if (!isset($aiki->$class)) {
- return "Sorry, [$class] doesn't exist";
+ return __sprintf("Sorry, %s doesn't exist", $class);
}
}
@@ -467,7 +467,7 @@
$sql= preg_replace(array('/^"(.*)"$/', '/^\'(.*)\'$/'), '$1', $sql);
if (!$this->is_sql_select_statement($sql)) {
- return "invalid SQL SELECT";
+ return __("invalid SQL SELECT");
}
return $db->get_var($sql, 0, 0);
}
@@ -479,11 +479,11 @@
// remove, if exists initial and final ' "
$sql= preg_replace( array('/^"(.*)"$/', '/^\'(.*)\'$/'), '$1', $sql);
if (!$this->is_sql_select_statement($sql)) {
- return "invalid SQL SELECT";
+ return __("invalid SQL SELECT");
}
$rows = $db->get_results($sql);
if (is_null($rows)) {
- return "ERROR in SQL statements";
+ return __("ERROR in SQL statements");
}
$output="";
@@ -518,4 +518,3 @@
} // end of class
// need the close php tag in this class
-?>
=== modified file 'libs/Archive.php' (properties changed: +x to -x)
--- libs/Archive.php 2011-11-08 13:42:45 +0000
+++ libs/Archive.php 2012-04-25 19:42:08 +0000
@@ -71,11 +71,11 @@
$result = ( "$newSum" == "$oldSum" ? true : false );
}
else {
- throw new AikiException("Failed to get contents of " . $sum);
+ throw new AikiException( __sprintf("Failed to get contents of %s", $sum));
}
}
else {
- throw new AikiException("Extension hash is not loaded.");
+ throw new AikiException( __("Extension hash is not loaded."));
}
return $result;
}
@@ -87,7 +87,7 @@
public function __call($method, $arguments) {
$extender = $this->getExtender();
if ( false === method_exists($extender, $method) ) {
- throw new AikiException("Failed to find method: $method");
+ throw new AikiException( __sprintf("Failed to find method: %s", $method));
}
$result = call_user_func_array(array($extender, $method), $arguments);
return $result;
@@ -106,7 +106,7 @@
}
$this->_extender = new $extender($arguments);
if ( false === $this->_extender instanceof ArchiveInterface ) {
- throw new AikiException("This $extender must implement ArchiveInterface");
+ throw new AikiException( __sprintf("This %s must implement ArchiveInterface",$extender));
}
return $this->_extender;
}
@@ -120,7 +120,7 @@
return $this;
}
if ( false === is_string($extender) ) {
- throw new AikiException("Invalid type: $extender");
+ throw new AikiException( __sprintf("Invalid type: %s", $extender));
}
$this->_extender = $extender;
return $this;
@@ -138,4 +138,4 @@
public function setExtenderArguments(Array $arguments) {
$this->_extenderArguments = $arguments;
}
-}
\ No newline at end of file
+}
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp