summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
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 /framework/Web/Javascripts
parent9f181be10fb44a768750c2d9fa4cb4d9f66bc836 (diff)
Enhancement: Updated clientscripts.php to JSMin 1.1.1 - According to author 15% faster with 94% less memory usage
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/clientscripts.php41
1 files changed, 18 insertions, 23 deletions
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() {