summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgodzilla80@gmx.net <>2009-05-02 12:25:11 +0000
committergodzilla80@gmx.net <>2009-05-02 12:25:11 +0000
commit93ffd43c381e96cdf4af245abcec52b75fe00fee (patch)
tree2f8f4df36a67c26f0110c8ac9507188378c86b52
parent9f181be10fb44a768750c2d9fa4cb4d9f66bc836 (diff)
Enhancement: Updated clientscripts.php to JSMin 1.1.1 - According to author 15% faster with 94% less memory usage
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/Javascripts/clientscripts.php41
2 files changed, 19 insertions, 23 deletions
diff --git a/HISTORY b/HISTORY
index 3dd8c9ca..4da06061 100644
--- a/HISTORY
+++ b/HISTORY
@@ -26,6 +26,7 @@ ENH: Issue#146 - replace deprecated(php5.3>) split with explode in TPgsqlMetaDat
CHG: Issue#7 - Clients Scripts are not combined anymore in Debug application mode (Christophe)
ENH: Added caching of message files to TException (Michael)
ENH: Updated to scriptaculous 1.8.2 & Prototype 1.6.0.3
+ENH: clientscripts.php Updated to JSMin 1.1.1 - According to author 15% faster with 94% less memory usage (Yves)
ENH: replace is_null() function calls with native language constuct (Yves)
ENH: replace array_push() function calls with native language constuct if make sense (Yves)
ENH: TBrowserLogRoute: add table-layout:auto and explicit set column with to avoid bad render behavior in table-layout:fixed environment, explicit set text color to increase readability (Yves)
diff --git a/framework/Web/Javascripts/clientscripts.php b/framework/Web/Javascripts/clientscripts.php
index f3c797e8..1eed9e42 100644
--- a/framework/Web/Javascripts/clientscripts.php
+++ b/framework/Web/Javascripts/clientscripts.php
@@ -49,7 +49,7 @@
//run script for as long as needed
@set_time_limit(0);
-//set error_reporting directive
+//set error_reporting directive
@error_reporting(E_ERROR | E_WARNING | E_PARSE);
function get_client_script_files()
@@ -292,9 +292,9 @@ function supports_gzip_encoding()
* @package JSMin
* @author Ryan Grove <ryan@wonko.com>
* @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
- * @copyright 2007 Ryan Grove <ryan@wonko.com> (PHP port)
+ * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
* @license http://opensource.org/licenses/mit-license.php MIT License
- * @version 1.1.0 (2007-06-01)
+ * @version 1.1.1 (2008-03-02)
* @link http://code.google.com/p/jsmin-php/
*/
@@ -308,7 +308,7 @@ class JSMin {
protected $inputIndex = 0;
protected $inputLength = 0;
protected $lookAhead = null;
- protected $output = array();
+ protected $output = '';
// -- Public Static Methods --------------------------------------------------
@@ -329,15 +329,15 @@ class JSMin {
protected function action($d) {
switch($d) {
case 1:
- $this->output[] = $this->a;
+ $this->output .= $this->a;
case 2:
$this->a = $this->b;
if ($this->a === "'" || $this->a === '"') {
for (;;) {
- $this->output[] = $this->a;
- $this->a = $this->get();
+ $this->output .= $this->a;
+ $this->a = $this->get();
if ($this->a === $this->b) {
break;
@@ -348,8 +348,8 @@ class JSMin {
}
if ($this->a === '\\') {
- $this->output[] = $this->a;
- $this->a = $this->get();
+ $this->output .= $this->a;
+ $this->a = $this->get();
}
}
}
@@ -362,25 +362,22 @@ class JSMin {
$this->a === ':' || $this->a === '[' || $this->a === '!' ||
$this->a === '&' || $this->a === '|' || $this->a === '?')) {
- $this->output[] = $this->a;
- $this->output[] = $this->b;
+ $this->output .= $this->a . $this->b;
for (;;) {
$this->a = $this->get();
if ($this->a === '/') {
break;
- }
- elseif ($this->a === '\\') {
- $this->output[] = $this->a;
- $this->a = $this->get();
- }
- elseif (ord($this->a) <= self::ORD_LF) {
+ } elseif ($this->a === '\\') {
+ $this->output .= $this->a;
+ $this->a = $this->get();
+ } elseif (ord($this->a) <= self::ORD_LF) {
throw new JSMinException('Unterminated regular expression '.
'literal.');
}
- $this->output[] = $this->a;
+ $this->output .= $this->a;
}
$this->b = $this->next();
@@ -396,8 +393,7 @@ class JSMin {
if ($this->inputIndex < $this->inputLength) {
$c = $this->input[$this->inputIndex];
$this->inputIndex += 1;
- }
- else {
+ } else {
$c = null;
}
}
@@ -426,8 +422,7 @@ class JSMin {
case ' ':
if ($this->isAlphaNum($this->b)) {
$this->action(1);
- }
- else {
+ } else {
$this->action(2);
}
break;
@@ -496,7 +491,7 @@ class JSMin {
}
}
- return implode('', $this->output);
+ return $this->output;
}
protected function next() {