From 4d8be8e6d8000a96cad98e176cfe64053413b779 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 27 Apr 2012 16:28:25 -0400 Subject: [PATCH] Reorganize class hierarchy --- docs/classes.svg | 685 +++--- docs/classes/DB.html | 2 +- docs/classes/DB_PDO.html | 2 +- docs/classes/DB_Reg.html | 2 +- docs/classes/DB_SQL.html | 2 +- docs/classes/DB_Util.html | 2 +- docs/classes/Firebird.html | 2 +- docs/classes/Firebird_Result.html | 2 +- docs/classes/Firebird_SQL.html | 2 +- docs/classes/Firebird_Util.html | 2 +- docs/classes/JSCompilerContext.html | 107 +- docs/classes/JSMinPlus.html | 138 +- docs/classes/JSNode.html | 150 +- docs/classes/JSParser.html | 275 +-- docs/classes/JSToken.html | 59 +- docs/classes/JSTokenizer.html | 271 +-- docs/classes/MM.html | 440 ++++ docs/classes/MM_Controller.html | 162 +- docs/classes/MM_Model.html | 143 +- docs/classes/MM_Output.html | 470 ++++- docs/classes/MM_Page.html | 480 ++++- docs/classes/MySQL.html | 2 +- docs/classes/MySQL_SQL.html | 2 +- docs/classes/MySQL_Util.html | 2 +- docs/classes/ODBC.html | 2 +- docs/classes/ODBC_SQL.html | 2 +- docs/classes/ODBC_Util.html | 2 +- docs/classes/PgSQL.html | 2 +- docs/classes/PgSQL_SQL.html | 2 +- docs/classes/PgSQL_Util.html | 2 +- docs/classes/Query_Builder.html | 2 +- docs/classes/R.html | 2 +- docs/classes/SQLite.html | 2 +- docs/classes/SQLite_SQL.html | 2 +- docs/classes/SQLite_Util.html | 2 +- docs/classes/Settings.html | 2 +- docs/classes/Welcome.html | 193 +- docs/classes/Welcome_Model.html | 163 +- docs/classes/miniMVC.html | 335 +-- docs/deprecated.html | 2 +- docs/errors.html | 3 +- docs/graph_class.html | 2 +- docs/index.html | 2 +- docs/markers.html | 2 +- docs/namespaces/default.html | 58 +- docs/packages/.html | 2 +- docs/packages/Default.html | 2 +- docs/packages/Query.Drivers.html | 2 +- docs/packages/Query.Helper Classes.html | 2 +- docs/packages/Query.Query.html | 2 +- docs/packages/Query.html | 2 +- docs/packages/miniMVC.App.html | 2 +- docs/packages/miniMVC.Assets.html | 73 + docs/packages/miniMVC.System.html | 24 +- docs/packages/miniMVC.html | 61 +- docs/structure.xml | 997 +++++---- src/assets/config/JSMinPlus.php | 2086 ------------------- src/assets/config/config.php | 20 + src/assets/config/css_groups.php | 31 +- src/assets/config/js_groups.php | 37 +- src/assets/css.php | 35 +- src/assets/js.php | 38 +- src/modules/welcome/controllers/welcome.php | 14 - src/sys/Query | 2 +- src/sys/common.php | 39 +- src/sys/controller.php | 142 ++ src/sys/miniMVC.php | 389 ++-- src/sys/model.php | 48 + src/sys/output.php | 15 +- src/sys/page.php | 9 +- src/sys/r.php | 70 - tests/{JSObjectTest.php => MMTest.php} | 10 +- tests/commonTest.php | 4 +- tests/index.php | 11 +- tests/miniMVCTest.php | 2 +- 75 files changed, 3504 insertions(+), 4855 deletions(-) create mode 100644 docs/classes/MM.html create mode 100644 docs/packages/miniMVC.Assets.html delete mode 100755 src/assets/config/JSMinPlus.php create mode 100644 src/sys/controller.php create mode 100644 src/sys/model.php delete mode 100644 src/sys/r.php rename tests/{JSObjectTest.php => MMTest.php} (53%) diff --git a/docs/classes.svg b/docs/classes.svg index 8ec4a22..fb8c55b 100644 --- a/docs/classes.svg +++ b/docs/classes.svg @@ -4,380 +4,385 @@ - - + + G - + cluster_default - - - - - - - - - - -\\DB_Reg - - -DB_Reg - - - -\\Settings - - -Settings - - - -\\DB_SQL - - -«abstract» -DB_SQL - - - -\\DB_PDO - - -«abstract» -DB_PDO - - - -\\PDO - -\PDO - - -\\DB_PDO->\\PDO - - - - -\\Query_Builder - - -Query_Builder - - - -\\DB_Util - - -«abstract» -DB_Util - - - -\\PgSQL_SQL - - -PgSQL_SQL - - - -\\PgSQL_SQL->\\DB_SQL - - - - -\\PgSQL_Util - - -PgSQL_Util - - - -\\PgSQL_Util->\\DB_Util - - - - -\\PgSQL - - -PgSQL - - - -\\PgSQL->\\DB_PDO - - - - -\\ODBC_Util - - -ODBC_Util - - - -\\ODBC_Util->\\DB_Util - - - - -\\ODBC_SQL - - -ODBC_SQL - - - -\\ODBC_SQL->\\DB_SQL - - - - -\\ODBC - - -ODBC - - - -\\ODBC->\\DB_PDO - - - - -\\MySQL_Util - - -MySQL_Util - - - -\\MySQL_Util->\\DB_Util - - - - -\\MySQL - - -MySQL - - - -\\MySQL->\\DB_PDO - - - - -\\MySQL_SQL - - -MySQL_SQL - - - -\\MySQL_SQL->\\DB_SQL - - - - -\\SQLite_Util - - -SQLite_Util - - - -\\SQLite_Util->\\DB_Util - - - - -\\SQLite - - -SQLite - - - -\\SQLite->\\DB_PDO - - - - -\\SQLite_SQL - - -SQLite_SQL - - - -\\SQLite_SQL->\\DB_SQL - - - - -\\Firebird_SQL - - -Firebird_SQL - - - -\\Firebird_SQL->\\DB_SQL - - - - -\\Firebird_Result - - -Firebird_Result - - - -\\PDOStatement - -\PDOStatement - - -\\Firebird_Result->\\PDOStatement - - - - -\\Firebird - - -Firebird - - - -\\Firebird->\\DB_PDO - - - - -\\Firebird_Util - - -Firebird_Util - - - -\\Firebird_Util->\\DB_Util - - - - -\\DB - - -DB - - - -\\DB->\\Query_Builder - - - - -\\miniMVC - - -miniMVC - - - -\\ArrayObject - -\ArrayObject - - -\\miniMVC->\\ArrayObject - - - - -\\MM_Controller - - -MM_Controller - - - -\\MM_Controller->\\miniMVC - - + + + + + + + + -\\MM_Model - - -MM_Model +\\MM_Model + + +MM_Model + + + +\\miniMVC + + +miniMVC -\\MM_Model->\\miniMVC - - +\\MM_Model->\\miniMVC + + - -\\R - - -R + +\\DB_Reg + + +DB_Reg - -\\ReflectionClass - -\ReflectionClass + +\\Settings + + +Settings + - -\\R->\\ReflectionClass - - + +\\DB_SQL + + +«abstract» +DB_SQL + + + +\\DB_PDO + + +«abstract» +DB_PDO + + + +\\PDO + +\PDO + + +\\DB_PDO->\\PDO + + + + +\\Query_Builder + + +Query_Builder + + + +\\DB_Util + + +«abstract» +DB_Util + + + +\\PgSQL_SQL + + +PgSQL_SQL + + + +\\PgSQL_SQL->\\DB_SQL + + + + +\\PgSQL_Util + + +PgSQL_Util + + + +\\PgSQL_Util->\\DB_Util + + + + +\\PgSQL + + +PgSQL + + + +\\PgSQL->\\DB_PDO + + + + +\\ODBC_Util + + +ODBC_Util + + + +\\ODBC_Util->\\DB_Util + + + + +\\ODBC_SQL + + +ODBC_SQL + + + +\\ODBC_SQL->\\DB_SQL + + + + +\\ODBC + + +ODBC + + + +\\ODBC->\\DB_PDO + + + + +\\MySQL_Util + + +MySQL_Util + + + +\\MySQL_Util->\\DB_Util + + + + +\\MySQL + + +MySQL + + + +\\MySQL->\\DB_PDO + + + + +\\MySQL_SQL + + +MySQL_SQL + + + +\\MySQL_SQL->\\DB_SQL + + + + +\\SQLite_Util + + +SQLite_Util + + + +\\SQLite_Util->\\DB_Util + + + + +\\SQLite + + +SQLite + + + +\\SQLite->\\DB_PDO + + + + +\\SQLite_SQL + + +SQLite_SQL + + + +\\SQLite_SQL->\\DB_SQL + + + + +\\Firebird_SQL + + +Firebird_SQL + + + +\\Firebird_SQL->\\DB_SQL + + + + +\\Firebird_Result + + +Firebird_Result + + + +\\PDOStatement + +\PDOStatement + + +\\Firebird_Result->\\PDOStatement + + + + +\\Firebird + + +Firebird + + + +\\Firebird->\\DB_PDO + + + + +\\Firebird_Util + + +Firebird_Util + + + +\\Firebird_Util->\\DB_Util + + + + +\\DB + + +DB + + + +\\DB->\\Query_Builder + + + + +\\MM + + +MM + + + +\\ArrayObject + +\ArrayObject + + +\\MM->\\ArrayObject + + + + +\\miniMVC->\\MM + + -\\MM_Page +\\MM_Page - -MM_Page + +MM_Page + +\\MM_Page->\\MM + + + + +\\MM_Controller + + +MM_Controller + + + +\\MM_Controller->\\miniMVC + + + \\MM_Output - -MM_Output + +MM_Output + +\\MM_Output->\\MM + + + \\Welcome_Model - -Welcome_Model + +Welcome_Model -\\Welcome_Model->\\MM_Model - - +\\Welcome_Model->\\MM_Model + + \\Welcome - -Welcome + +Welcome -\\Welcome->\\MM_Controller - - +\\Welcome->\\MM_Controller + + diff --git a/docs/classes/DB.html b/docs/classes/DB.html index b1996af..199e428 100644 --- a/docs/classes/DB.html +++ b/docs/classes/DB.html @@ -1447,7 +1447,7 @@ for complex select queries
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/DB_PDO.html b/docs/classes/DB_PDO.html index 03623d5..811f524 100644 --- a/docs/classes/DB_PDO.html +++ b/docs/classes/DB_PDO.html @@ -663,7 +663,7 @@ the connection/database
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/DB_Reg.html b/docs/classes/DB_Reg.html index 545e787..cb1c2a5 100644 --- a/docs/classes/DB_Reg.html +++ b/docs/classes/DB_Reg.html @@ -152,7 +152,7 @@ and organizes database connections

+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/DB_SQL.html b/docs/classes/DB_SQL.html index 208c9ac..15824ff 100644 --- a/docs/classes/DB_SQL.html +++ b/docs/classes/DB_SQL.html @@ -269,7 +269,7 @@
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/DB_Util.html b/docs/classes/DB_Util.html index 1eaee68..a7e184c 100644 --- a/docs/classes/DB_Util.html +++ b/docs/classes/DB_Util.html @@ -209,7 +209,7 @@
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/Firebird.html b/docs/classes/Firebird.html index ead640f..6f997e5 100644 --- a/docs/classes/Firebird.html +++ b/docs/classes/Firebird.html @@ -813,7 +813,7 @@ the last query executed
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/Firebird_Result.html b/docs/classes/Firebird_Result.html index 278c4e7..4f10f09 100644 --- a/docs/classes/Firebird_Result.html +++ b/docs/classes/Firebird_Result.html @@ -504,7 +504,7 @@ the query
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/Firebird_SQL.html b/docs/classes/Firebird_SQL.html index 04d6888..3b47f7b 100644 --- a/docs/classes/Firebird_SQL.html +++ b/docs/classes/Firebird_SQL.html @@ -297,7 +297,7 @@
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/Firebird_Util.html b/docs/classes/Firebird_Util.html index 3a364bb..d4003e5 100644 --- a/docs/classes/Firebird_Util.html +++ b/docs/classes/Firebird_Util.html @@ -212,7 +212,7 @@
+ generated on 2012-04-27T16:26:37-04:00.
diff --git a/docs/classes/JSCompilerContext.html b/docs/classes/JSCompilerContext.html index d5eab25..2312c74 100644 --- a/docs/classes/JSCompilerContext.html +++ b/docs/classes/JSCompilerContext.html @@ -33,10 +33,10 @@ Reports -
- -
-
@@ -177,92 +156,12 @@

-
-

- Methods

-
-

__construct() -

-
__construct($inFunction) 
-
-
-

-

Parameters

-
-

$inFunction

- -
-
-
-

- Properties

- 
-

$bracketLevel

-
$bracketLevel 
-
-

-
- 
-

$curlyLevel

-
$curlyLevel 
-
-

-
- 
-

$ecmaStrictMode

-
$ecmaStrictMode 
-
-

-
- 
-

$funDecls

-
$funDecls 
-
-

-
- 
-

$hookLevel

-
$hookLevel 
-
-

-
- 
-

$inForLoopInit

-
$inForLoopInit 
-
-

-
- 
-

$inFunction

-
$inFunction 
-
-

-
- 
-

$parenLevel

-
$parenLevel 
-
-

-
- 
-

$stmtStack

-
$stmtStack 
-
-

-
- 
-

$varDecls

-
$varDecls 
-
-

-
-
+ generated on 2012-04-27T13:02:13-04:00.
diff --git a/docs/classes/JSMinPlus.html b/docs/classes/JSMinPlus.html index 9bea8c5..df174f4 100644 --- a/docs/classes/JSMinPlus.html +++ b/docs/classes/JSMinPlus.html @@ -33,10 +33,10 @@ Reports -
- -
-
@@ -212,119 +187,12 @@

-
-

- Methods

-
-

minify() -

-
minify($js, $filename) 
-
-
-

-

Parameters

-
-

$js

- -
-
-

$filename

- -
-
-
-
-

parseTree() -

-
parseTree($n, $noBlockGrouping) 
-
-
-

-

Parameters

-
-

$n

- -
-
-

$noBlockGrouping

- -
-
-
-
-

__construct() -

-
__construct() 
-
-

-
-
-

isValidIdentifier() -

-
isValidIdentifier($string) 
-
-
-

-

Parameters

-
-

$string

- -
-
-
-
-

isWordChar() -

-
isWordChar($char) 
-
-
-

-

Parameters

-
-

$char

- -
-
-
-
-

min() -

-
min($js, $filename) 
-
-
-

-

Parameters

-
-

$js

- -
-
-

$filename

- -
-
-
-

- Properties

- 
-

$parser

-
$parser 
-
-

-
- 
-

$reserved

-
$reserved 
-
-

-
-
+ generated on 2012-04-27T13:02:13-04:00.
diff --git a/docs/classes/JSNode.html b/docs/classes/JSNode.html index 83f7323..f21d763 100644 --- a/docs/classes/JSNode.html +++ b/docs/classes/JSNode.html @@ -33,10 +33,10 @@ Reports -
- -
-
@@ -225,130 +199,12 @@

-
-

- Methods

-
-

__construct() -

-
__construct($t, $type) 
-
-
-

-

Parameters

-
-

$t

- -
-
-

$type

- -
-
-
-
-

__get() -

-
__get($name) 
-
-
-

-

Parameters

-
-

$name

- -
-
-
-
-

__set() -

-
__set($name, $value) 
-
-
-

-

Parameters

-
-

$name

- -
-
-

$value

- -
-
-
-
-

addNode() -

-
addNode($node) 
-
-
-

-

Parameters

-
-

$node

- -
-
-
-

- Properties

- 
-

$funDecls

-
$funDecls 
-
-

-
- 
-

$treeNodes

-
$treeNodes 
-
-

-
- 
-

$varDecls

-
$varDecls 
-
-

-
- 
-

$end

-
$end 
-
-

-
- 
-

$lineno

-
$lineno 
-
-

-
- 
-

$start

-
$start 
-
-

-
- 
-

$type

-
$type 
-
-

-
- 
-

$value

-
$value 
-
-

-
-
+ generated on 2012-04-27T13:02:13-04:00.
diff --git a/docs/classes/JSParser.html b/docs/classes/JSParser.html index 1b9783a..6589f0d 100644 --- a/docs/classes/JSParser.html +++ b/docs/classes/JSParser.html @@ -33,10 +33,10 @@ Reports -
- -
-
@@ -363,242 +324,12 @@

-
-

- Methods

-
-

__construct() -

-
__construct($minifier) 
-
-
-

-

Parameters

-
-

$minifier

- -
-
-
-
-

parse() -

-
parse($s, $f, $l) 
-
-
-

-

Parameters

-
-

$s

- -
-
-

$f

- -
-
-

$l

- -
-
-
-
-

Block() -

-
Block($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Expression() -

-
Expression($x, $stop) 
-
-
-

-

Parameters

-
-

$x

- -
-
-

$stop

- -
-
-
-
-

FunctionDefinition() -

-
FunctionDefinition($x, $requireName, $functionForm) 
-
-
-

-

Parameters

-
-

$x

- -
-
-

$requireName

- -
-
-

$functionForm

- -
-
-
-
-

ParenExpression() -

-
ParenExpression($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Script() -

-
Script($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Statement() -

-
Statement($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Statements() -

-
Statements($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

Variables() -

-
Variables($x) 
-
-
-

-

Parameters

-
-

$x

- -
-
-
-
-

nest() -

-
nest($x, $node, $end) 
-
-
-

-

Parameters

-
-

$x

- -
-
-

$node

- -
-
-

$end

- -
-
-
-
-

reduce() -

-
reduce($operators, $operands) 
-
-
-

-

Parameters

-
-

$operators

- -
-
-

$operands

- -
-
-
-

- Properties

- 
-

$minifier

-
$minifier 
-
-

-
- 
-

$opArity

-
$opArity 
-
-

-
- 
-

$opPrecedence

-
$opPrecedence 
-
-

-
- 
-

$t

-
$t 
-
-

-
-
+ generated on 2012-04-27T13:02:13-04:00.
diff --git a/docs/classes/JSToken.html b/docs/classes/JSToken.html index c672bf0..a643b5b 100644 --- a/docs/classes/JSToken.html +++ b/docs/classes/JSToken.html @@ -33,10 +33,10 @@ Reports -
- -
-
@@ -121,52 +108,12 @@

-
-

- Properties

- 
-

$assignOp

-
$assignOp 
-
-

-
- 
-

$end

-
$end 
-
-

-
- 
-

$lineno

-
$lineno 
-
-

-
- 
-

$start

-
$start 
-
-

-
- 
-

$type

-
$type 
-
-

-
- 
-

$value

-
$value 
-
-

-
-
+ generated on 2012-04-27T13:02:13-04:00.
diff --git a/docs/classes/JSTokenizer.html b/docs/classes/JSTokenizer.html index b2d1a3f..5b269fa 100644 --- a/docs/classes/JSTokenizer.html +++ b/docs/classes/JSTokenizer.html @@ -33,10 +33,10 @@ Reports -
- -
-
@@ -367,230 +320,12 @@

-
-

- Methods

-
-

__construct() -

-
__construct() 
-
-

-
-
-

currentToken() -

-
currentToken() 
-
-

-
-
-

get() -

-
get($chunksize) 
-
-
-

-

Parameters

-
-

$chunksize

- -
-
-
-
-

getInput() -

-
getInput($chunksize) 
-
-
-

-

Parameters

-
-

$chunksize

- -
-
-
-
-

init() -

-
init($source, $filename, $lineno) 
-
-
-

-

Parameters

-
-

$source

- -
-
-

$filename

- -
-
-

$lineno

- -
-
-
-
-

isDone() -

-
isDone() 
-
-

-
-
-

match() -

-
match($tt) 
-
-
-

-

Parameters

-
-

$tt

- -
-
-
-
-

mustMatch() -

-
mustMatch($tt) 
-
-
-

-

Parameters

-
-

$tt

- -
-
-
-
-

newSyntaxError() -

-
newSyntaxError($m) 
-
-
-

-

Parameters

-
-

$m

- -
-
-
-
-

peek() -

-
peek() 
-
-

-
-
-

peekOnSameLine() -

-
peekOnSameLine() 
-
-

-
-
-

unget() -

-
unget() 
-
-

-
-

- Properties

- 
-

$filename

-
$filename 
-
-

-
- 
-

$lineno

-
$lineno 
-
-

-
- 
-

$lookahead

-
$lookahead 
-
-

-
- 
-

$scanNewlines

-
$scanNewlines 
-
-

-
- 
-

$scanOperand

-
$scanOperand 
-
-

-
- 
-

$tokenIndex

-
$tokenIndex 
-
-

-
- 
-

$tokens

-
$tokens 
-
-

-
- 
-

$assignOps

-
$assignOps 
-
-

-
- 
-

$cursor

-
$cursor 
-
-

-
- 
-

$keywords

-
$keywords 
-
-

-
- 
-

$opRegExp

-
$opRegExp 
-
-

-
- 
-

$opTypeNames

-
$opTypeNames 
-
-

-
- 
-

$source

-
$source 
-
-

-
-
+ generated on 2012-04-27T13:02:13-04:00.
diff --git a/docs/classes/MM.html b/docs/classes/MM.html new file mode 100644 index 0000000..5cefb6c --- /dev/null +++ b/docs/classes/MM.html @@ -0,0 +1,440 @@ + + + + + +miniMVC » \MM + + + + + + + + + + +
+ +
+ +
+
+

Class for standalone JSObject objects

+
+

+ + + + + + + + + +
packageminiMVC
subpackageSystem
+

+ Methods

+
+

Allow calling of array methods on the object and +dynamic methods

+
__call(string $name, array $params) : mixed
+
+
+

+

Parameters

+
+

$name

+string +
+
+

$params

+array +
+

Returns

+
mixed
+
+
+
+

Create the ArrayObject/JSObject hybrid object

+
__construct($members) 
+
+
+

+

Parameters

+
+

$members

+

array

+
+
+
+

append() +

+
append() 
+
+
+

+ + + +
inherited_fromArrayObject::append()
+
+
+
+

asort() +

+
asort() 
+
+
+

+ + + +
inherited_fromArrayObject::asort()
+
+
+
+

count() +

+
count() 
+
+
+

+ + + +
inherited_fromArrayObject::count()
+
+
+
+

exchangeArray() +

+
exchangeArray() 
+
+
+

+ + + +
inherited_fromArrayObject::exchangeArray()
+
+
+
+

getArrayCopy() +

+
getArrayCopy() 
+
+
+

+ + + +
inherited_fromArrayObject::getArrayCopy()
+
+
+
+

getFlags() +

+
getFlags() 
+
+
+

+ + + +
inherited_fromArrayObject::getFlags()
+
+
+
+

getIterator() +

+
getIterator() 
+
+
+

+ + + +
inherited_fromArrayObject::getIterator()
+
+
+
+

getIteratorClass() +

+
getIteratorClass() 
+
+
+

+ + + +
inherited_fromArrayObject::getIteratorClass()
+
+
+
+

ksort() +

+
ksort() 
+
+
+

+ + + +
inherited_fromArrayObject::ksort()
+
+
+
+

natcasesort() +

+
natcasesort() 
+
+
+

+ + + +
inherited_fromArrayObject::natcasesort()
+
+
+
+

natsort() +

+
natsort() 
+
+
+

+ + + +
inherited_fromArrayObject::natsort()
+
+
+
+

offsetExists() +

+
offsetExists() 
+
+
+

+ + + +
inherited_fromArrayObject::offsetExists()
+
+
+
+

offsetGet() +

+
offsetGet() 
+
+
+

+ + + +
inherited_fromArrayObject::offsetGet()
+
+
+
+

offsetSet() +

+
offsetSet() 
+
+
+

+ + + +
inherited_fromArrayObject::offsetSet()
+
+
+
+

offsetUnset() +

+
offsetUnset() 
+
+
+

+ + + +
inherited_fromArrayObject::offsetUnset()
+
+
+
+

serialize() +

+
serialize() 
+
+
+

+ + + +
inherited_fromArrayObject::serialize()
+
+
+
+

setFlags() +

+
setFlags() 
+
+
+

+ + + +
inherited_fromArrayObject::setFlags()
+
+
+
+

setIteratorClass() +

+
setIteratorClass() 
+
+
+

+ + + +
inherited_fromArrayObject::setIteratorClass()
+
+
+
+

uasort() +

+
uasort() 
+
+
+

+ + + +
inherited_fromArrayObject::uasort()
+
+
+
+

uksort() +

+
uksort() 
+
+
+

+ + + +
inherited_fromArrayObject::uksort()
+
+
+
+

unserialize() +

+
unserialize() 
+
+
+

+ + + +
inherited_fromArrayObject::unserialize()
+
+
+
+
+
+
+
+
+ + diff --git a/docs/classes/MM_Controller.html b/docs/classes/MM_Controller.html index 959ebd2..f0d7f21 100644 --- a/docs/classes/MM_Controller.html +++ b/docs/classes/MM_Controller.html @@ -58,9 +58,7 @@
  • PHP magic method to facilitate dynamic methods
    __call()
  • -
  • Magic function called when cloning an object
    __clone()
  • Create the controller object
    __construct()
  • -
  • PHP magic method that is called when an object is treated as a function
    __invoke()
  • append()
    append()
  • asort() @@ -77,7 +75,6 @@
    getIterator()
  • getIteratorClass()
    getIteratorClass()
  • -
  • Singleton getter function
    get_instance()
  • ksort()
    ksort()
  • Method to load classes into the singleton
    load_class()
  • @@ -111,10 +108,8 @@
    unserialize()
    -
  • Instance of Output class
    $output
  • +
  • Reference to output class
    $output
  • Instance of Page class
    $page
  • - -
  • Singleton object
    $instance
  • @@ -136,7 +131,7 @@  Methods

    PHP magic method to facilitate dynamic methods

    -
    __call(string $name, array $args) 
    +
    __call(string $name, array $args) : mixed
    Inherited

    @@ -153,18 +148,8 @@

    $args

    array
    -
    -
    -
    -

    Magic function called when cloning an object

    -
    __clone() 
    -
    Inherited
    -
    -

    - - - -
    inherited_from\miniMVC::__clone()
    +

    Returns

    +
    mixed
    @@ -173,18 +158,6 @@

    -
    -

    PHP magic method that is called when an object is treated as a function

    -
    __invoke() 
    -
    Inherited
    -
    -

    - - - -
    inherited_from\miniMVC::__invoke()
    -
    -

    append()

    @@ -199,6 +172,10 @@ inherited_from +\MM::append() + + +inherited_from \miniMVC::append() @@ -218,6 +195,10 @@ inherited_from +\MM::asort() + + +inherited_from \miniMVC::asort() @@ -237,6 +218,10 @@ inherited_from +\MM::count() + + +inherited_from \miniMVC::count() @@ -256,6 +241,10 @@ inherited_from +\MM::exchangeArray() + + +inherited_from \miniMVC::exchangeArray() @@ -275,6 +264,10 @@ inherited_from +\MM::getArrayCopy() + + +inherited_from \miniMVC::getArrayCopy() @@ -294,6 +287,10 @@ inherited_from +\MM::getFlags() + + +inherited_from \miniMVC::getFlags() @@ -313,6 +310,10 @@ inherited_from +\MM::getIterator() + + +inherited_from \miniMVC::getIterator() @@ -332,26 +333,15 @@ inherited_from +\MM::getIteratorClass() + + +inherited_from \miniMVC::getIteratorClass()
    -
    -

    Singleton getter function

    -
    get_instance() : \miniMVC
    -
    Inherited
    -
    -

    - - - -
    inherited_from\miniMVC::get_instance()
    -

    Returns

    -
    -\miniMVCobject
    -
    -

    ksort()

    @@ -366,6 +356,10 @@ inherited_from +\MM::ksort() + + +inherited_from \miniMVC::ksort() @@ -463,6 +457,10 @@ inherited_from +\MM::natcasesort() + + +inherited_from \miniMVC::natcasesort() @@ -482,6 +480,10 @@ inherited_from +\MM::natsort() + + +inherited_from \miniMVC::natsort() @@ -501,6 +503,10 @@ inherited_from +\MM::offsetExists() + + +inherited_from \miniMVC::offsetExists() @@ -520,6 +526,10 @@ inherited_from +\MM::offsetGet() + + +inherited_from \miniMVC::offsetGet() @@ -539,6 +549,10 @@ inherited_from +\MM::offsetSet() + + +inherited_from \miniMVC::offsetSet() @@ -558,6 +572,10 @@ inherited_from +\MM::offsetUnset() + + +inherited_from \miniMVC::offsetUnset() @@ -577,6 +595,10 @@ inherited_from +\MM::serialize() + + +inherited_from \miniMVC::serialize() @@ -596,6 +618,10 @@ inherited_from +\MM::setFlags() + + +inherited_from \miniMVC::setFlags() @@ -615,6 +641,10 @@ inherited_from +\MM::setIteratorClass() + + +inherited_from \miniMVC::setIteratorClass() @@ -634,6 +664,10 @@ inherited_from +\MM::uasort() + + +inherited_from \miniMVC::uasort() @@ -653,6 +687,10 @@ inherited_from +\MM::uksort() + + +inherited_from \miniMVC::uksort() @@ -689,6 +727,10 @@ inherited_from +\MM::unserialize() + + +inherited_from \miniMVC::unserialize() @@ -697,10 +739,16 @@

     Properties

     
    -

    Instance of Output class

    -
    $output : \Output
    -
    -

    +

    Reference to output class

    +
    $output : \MM_Output
    +
    Inherited
    +
    +

    + + + +
    inherited_from\miniMVC::$$output
    +
     

    Instance of Page class

    @@ -708,18 +756,6 @@

    - 
    -

    Singleton object

    -
    $instance : \miniMVC
    -
    Inherited
    -
    -

    - - - -
    inherited_from\miniMVC::$$instance
    -
    -
    @@ -727,7 +763,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/classes/MM_Model.html b/docs/classes/MM_Model.html index 2e3eeb0..6167103 100644 --- a/docs/classes/MM_Model.html +++ b/docs/classes/MM_Model.html @@ -58,9 +58,7 @@
  • PHP magic method to facilitate dynamic methods
    __call()
  • -
  • Magic function called when cloning an object
    __clone()
  • Initialize the model class
    __construct()
  • -
  • PHP magic method that is called when an object is treated as a function
    __invoke()
  • append()
    append()
  • asort() @@ -77,7 +75,6 @@
    getIterator()
  • getIteratorClass()
    getIteratorClass()
  • -
  • Singleton getter function
    get_instance()
  • ksort()
    ksort()
  • Method to load classes into the singleton
    load_class()
  • @@ -110,8 +107,7 @@
    unserialize()
    - -
  • Singleton object
    $instance
  • +
  • Reference to output class
    $output
  • @@ -133,7 +129,7 @@  Methods

    PHP magic method to facilitate dynamic methods

    -
    __call(string $name, array $args) 
    +
    __call(string $name, array $args) : mixed
    Inherited

    @@ -150,18 +146,8 @@

    $args

    array
    -
    -
    -
    -

    Magic function called when cloning an object

    -
    __clone() 
    -
    Inherited
    -
    -

    - - - -
    inherited_from\miniMVC::__clone()
    +

    Returns

    +
    mixed
    @@ -170,18 +156,6 @@

    -
    -

    PHP magic method that is called when an object is treated as a function

    -
    __invoke() 
    -
    Inherited
    -
    -

    - - - -
    inherited_from\miniMVC::__invoke()
    -
    -

    append()

    @@ -196,6 +170,10 @@ inherited_from +\MM::append() + + +inherited_from \miniMVC::append() @@ -215,6 +193,10 @@ inherited_from +\MM::asort() + + +inherited_from \miniMVC::asort() @@ -234,6 +216,10 @@ inherited_from +\MM::count() + + +inherited_from \miniMVC::count() @@ -253,6 +239,10 @@ inherited_from +\MM::exchangeArray() + + +inherited_from \miniMVC::exchangeArray() @@ -272,6 +262,10 @@ inherited_from +\MM::getArrayCopy() + + +inherited_from \miniMVC::getArrayCopy() @@ -291,6 +285,10 @@ inherited_from +\MM::getFlags() + + +inherited_from \miniMVC::getFlags() @@ -310,6 +308,10 @@ inherited_from +\MM::getIterator() + + +inherited_from \miniMVC::getIterator() @@ -329,26 +331,15 @@ inherited_from +\MM::getIteratorClass() + + +inherited_from \miniMVC::getIteratorClass()
    -
    -

    Singleton getter function

    -
    get_instance() : \miniMVC
    -
    Inherited
    -
    -

    - - - -
    inherited_from\miniMVC::get_instance()
    -

    Returns

    -
    -\miniMVCobject
    -
    -

    ksort()

    @@ -363,6 +354,10 @@ inherited_from +\MM::ksort() + + +inherited_from \miniMVC::ksort() @@ -433,6 +428,10 @@ inherited_from +\MM::natcasesort() + + +inherited_from \miniMVC::natcasesort() @@ -452,6 +451,10 @@ inherited_from +\MM::natsort() + + +inherited_from \miniMVC::natsort() @@ -471,6 +474,10 @@ inherited_from +\MM::offsetExists() + + +inherited_from \miniMVC::offsetExists() @@ -490,6 +497,10 @@ inherited_from +\MM::offsetGet() + + +inherited_from \miniMVC::offsetGet() @@ -509,6 +520,10 @@ inherited_from +\MM::offsetSet() + + +inherited_from \miniMVC::offsetSet() @@ -528,6 +543,10 @@ inherited_from +\MM::offsetUnset() + + +inherited_from \miniMVC::offsetUnset() @@ -547,6 +566,10 @@ inherited_from +\MM::serialize() + + +inherited_from \miniMVC::serialize() @@ -566,6 +589,10 @@ inherited_from +\MM::setFlags() + + +inherited_from \miniMVC::setFlags() @@ -585,6 +612,10 @@ inherited_from +\MM::setIteratorClass() + + +inherited_from \miniMVC::setIteratorClass() @@ -604,6 +635,10 @@ inherited_from +\MM::uasort() + + +inherited_from \miniMVC::uasort() @@ -623,6 +658,10 @@ inherited_from +\MM::uksort() + + +inherited_from \miniMVC::uksort() @@ -659,6 +698,10 @@ inherited_from +\MM::unserialize() + + +inherited_from \miniMVC::unserialize() @@ -666,15 +709,15 @@

     Properties

    - 
    -

    Singleton object

    -
    $instance : \miniMVC
    + 
    +

    Reference to output class

    +
    $output : \MM_Output
    Inherited

    - +
    inherited_from\miniMVC::$$instance\miniMVC::$$output
    @@ -685,7 +728,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/classes/MM_Output.html b/docs/classes/MM_Output.html index 2d1de28..ffd5fbe 100644 --- a/docs/classes/MM_Output.html +++ b/docs/classes/MM_Output.html @@ -57,14 +57,59 @@
    @@ -133,7 +129,7 @@  Methods

    PHP magic method to facilitate dynamic methods

    -
    __call(string $name, array $args) 
    +
    __call(string $name, array $args) : mixed
    Inherited

    @@ -156,24 +152,8 @@

    $args

    array
    -
    -
    -
    -

    Magic function called when cloning an object

    -
    __clone() 
    -
    Inherited
    -
    -

    - - - - - - - - - -
    inherited_from\miniMVC::__clone()
    inherited_from\MM_Model::__clone()
    +

    Returns

    +
    mixed
    @@ -182,24 +162,6 @@

    -
    -

    PHP magic method that is called when an object is treated as a function

    -
    __invoke() 
    -
    Inherited
    -
    -

    - - - - - - - - - -
    inherited_from\miniMVC::__invoke()
    inherited_from\MM_Model::__invoke()
    -
    -

    append()

    @@ -214,6 +176,10 @@ inherited_from +\MM::append() + + +inherited_from \miniMVC::append() @@ -237,6 +203,10 @@ inherited_from +\MM::asort() + + +inherited_from \miniMVC::asort() @@ -260,6 +230,10 @@ inherited_from +\MM::count() + + +inherited_from \miniMVC::count() @@ -283,6 +257,10 @@ inherited_from +\MM::exchangeArray() + + +inherited_from \miniMVC::exchangeArray() @@ -306,6 +284,10 @@ inherited_from +\MM::getArrayCopy() + + +inherited_from \miniMVC::getArrayCopy() @@ -329,6 +311,10 @@ inherited_from +\MM::getFlags() + + +inherited_from \miniMVC::getFlags() @@ -352,6 +338,10 @@ inherited_from +\MM::getIterator() + + +inherited_from \miniMVC::getIterator() @@ -375,6 +365,10 @@ inherited_from +\MM::getIteratorClass() + + +inherited_from \miniMVC::getIteratorClass() @@ -384,27 +378,6 @@
    -
    -

    Singleton getter function

    -
    get_instance() : \miniMVC
    -
    Inherited
    -
    -

    - - - - - - - - - -
    inherited_from\miniMVC::get_instance()
    inherited_from\MM_Model::get_instance()
    -

    Returns

    -
    -\miniMVCobject
    -
    -

    ksort()

    @@ -419,6 +392,10 @@ inherited_from +\MM::ksort() + + +inherited_from \miniMVC::ksort() @@ -509,6 +486,10 @@ inherited_from +\MM::natcasesort() + + +inherited_from \miniMVC::natcasesort() @@ -532,6 +513,10 @@ inherited_from +\MM::natsort() + + +inherited_from \miniMVC::natsort() @@ -555,6 +540,10 @@ inherited_from +\MM::offsetExists() + + +inherited_from \miniMVC::offsetExists() @@ -578,6 +567,10 @@ inherited_from +\MM::offsetGet() + + +inherited_from \miniMVC::offsetGet() @@ -601,6 +594,10 @@ inherited_from +\MM::offsetSet() + + +inherited_from \miniMVC::offsetSet() @@ -624,6 +621,10 @@ inherited_from +\MM::offsetUnset() + + +inherited_from \miniMVC::offsetUnset() @@ -647,6 +648,10 @@ inherited_from +\MM::serialize() + + +inherited_from \miniMVC::serialize() @@ -670,6 +675,10 @@ inherited_from +\MM::setFlags() + + +inherited_from \miniMVC::setFlags() @@ -693,6 +702,10 @@ inherited_from +\MM::setIteratorClass() + + +inherited_from \miniMVC::setIteratorClass() @@ -716,6 +729,10 @@ inherited_from +\MM::uasort() + + +inherited_from \miniMVC::uasort() @@ -739,6 +756,10 @@ inherited_from +\MM::uksort() + + +inherited_from \miniMVC::uksort() @@ -785,6 +806,10 @@ inherited_from +\MM::unserialize() + + +inherited_from \miniMVC::unserialize() @@ -796,20 +821,20 @@

     Properties

    - 
    -

    Singleton object

    -
    $instance : \miniMVC
    + 
    +

    Reference to output class

    +
    $output : \MM_Output
    Inherited

    - + - +
    inherited_from\miniMVC::$$instance\miniMVC::$$output
    inherited_from\MM_Model::$$instance\MM_Model::$$output
    @@ -821,7 +846,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/classes/miniMVC.html b/docs/classes/miniMVC.html index 5f0fc69..720f80b 100644 --- a/docs/classes/miniMVC.html +++ b/docs/classes/miniMVC.html @@ -58,59 +58,55 @@
  • PHP magic method to facilitate dynamic methods
    __call()
  • -
  • Magic function called when cloning an object
    __clone()
  • Constructor - Any classes loaded here become subclasses of miniMVC
    __construct()
  • -
  • PHP magic method that is called when an object is treated as a function
    __invoke()
  • -
  • append() +
  • append()
    append()
  • -
  • asort() +
  • asort()
    asort()
  • -
  • count() +
  • count()
    count()
  • -
  • exchangeArray() +
  • exchangeArray()
    exchangeArray()
  • -
  • getArrayCopy() +
  • getArrayCopy()
    getArrayCopy()
  • -
  • getFlags() +
  • getFlags()
    getFlags()
  • -
  • getIterator() +
  • getIterator()
    getIterator()
  • -
  • getIteratorClass() +
  • getIteratorClass()
    getIteratorClass()
  • -
  • Singleton getter function
    get_instance()
  • -
  • ksort() +
  • ksort()
    ksort()
  • Method to load classes into the singleton
    load_class()
  • Convenience function to load config files
    load_config()
  • -
  • natcasesort() +
  • natcasesort()
    natcasesort()
  • -
  • natsort() +
  • natsort()
    natsort()
  • -
  • offsetExists() +
  • offsetExists()
    offsetExists()
  • -
  • offsetGet() +
  • offsetGet()
    offsetGet()
  • -
  • offsetSet() +
  • offsetSet()
    offsetSet()
  • -
  • offsetUnset() +
  • offsetUnset()
    offsetUnset()
  • -
  • serialize() +
  • serialize()
    serialize()
  • -
  • setFlags() +
  • setFlags()
    setFlags()
  • -
  • setIteratorClass() +
  • setIteratorClass()
    setIteratorClass()
  • -
  • uasort() +
  • uasort()
    uasort()
  • -
  • uksort() +
  • uksort()
    uksort()
  • Convenience function to remove an object from the singleton
    unload()
  • -
  • unserialize() +
  • unserialize()
    unserialize()
  • - -
  • Singleton object
    $instance
  • +
  • Reference to output class
    $output
  • @@ -132,7 +128,7 @@  Methods

    PHP magic method to facilitate dynamic methods

    -
    __call(string $name, array $args) 
    +
    __call(string $name, array $args) : mixed

    @@ -145,14 +141,10 @@

    $args

    array
    +

    Returns

    +
    mixed
    -
    -

    Magic function called when cloning an object

    -
    __clone() 
    -
    -

    -

    Constructor - Any classes loaded here become subclasses of miniMVC

    __construct(array $members) 
    @@ -166,138 +158,175 @@
    -
    -

    PHP magic method that is called when an object is treated as a function

    -
    __invoke() 
    -
    -

    -

    append()

    append() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::append()
    + + +inherited_from +\MM::append() + +

    asort()

    asort() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::asort()
    + + +inherited_from +\MM::asort() + +

    count()

    count() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::count()
    + + +inherited_from +\MM::count() + +

    exchangeArray()

    exchangeArray() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::exchangeArray()
    + + +inherited_from +\MM::exchangeArray() + +

    getArrayCopy()

    getArrayCopy() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::getArrayCopy()
    + + +inherited_from +\MM::getArrayCopy() + +

    getFlags()

    getFlags() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::getFlags()
    + + +inherited_from +\MM::getFlags() + +

    getIterator()

    getIterator() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::getIterator()
    + + +inherited_from +\MM::getIterator() + +

    getIteratorClass()

    getIteratorClass() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::getIteratorClass()
    -
    -
    -
    -

    Singleton getter function

    -
    get_instance() : \miniMVC
    -
    -
    -

    -

    Returns

    -
    -\miniMVCobject
    + + +inherited_from +\MM::getIteratorClass() + +

    ksort()

    ksort() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::ksort()
    + + +inherited_from +\MM::ksort() + +
    @@ -334,143 +363,209 @@

    natcasesort()

    natcasesort() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::natcasesort()
    + + +inherited_from +\MM::natcasesort() + +

    natsort()

    natsort() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::natsort()
    + + +inherited_from +\MM::natsort() + +

    offsetExists()

    offsetExists() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::offsetExists()
    + + +inherited_from +\MM::offsetExists() + +

    offsetGet()

    offsetGet() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::offsetGet()
    + + +inherited_from +\MM::offsetGet() + +

    offsetSet()

    offsetSet() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::offsetSet()
    + + +inherited_from +\MM::offsetSet() + +

    offsetUnset()

    offsetUnset() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::offsetUnset()
    + + +inherited_from +\MM::offsetUnset() + +

    serialize()

    serialize() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::serialize()
    + + +inherited_from +\MM::serialize() + +

    setFlags()

    setFlags() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::setFlags()
    + + +inherited_from +\MM::setFlags() + +

    setIteratorClass()

    setIteratorClass() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::setIteratorClass()
    + + +inherited_from +\MM::setIteratorClass() + +

    uasort()

    uasort() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::uasort()
    + + +inherited_from +\MM::uasort() + +

    uksort()

    uksort() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::uksort()
    + + +inherited_from +\MM::uksort() + +
    @@ -490,20 +585,26 @@

    unserialize()

    unserialize() 
    -
    +
    Inherited

    - +
    + -
    inherited_from ArrayObject::unserialize()
    + + +inherited_from +\MM::unserialize() + +

     Properties

    - 
    -

    Singleton object

    -
    $instance : \miniMVC
    + 
    +

    Reference to output class

    +
    $output : \MM_Output

    @@ -514,7 +615,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/deprecated.html b/docs/deprecated.html index c1db6b2..d29bea5 100644 --- a/docs/deprecated.html +++ b/docs/deprecated.html @@ -67,7 +67,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/errors.html b/docs/errors.html index 3eee697..9a94424 100644 --- a/docs/errors.html +++ b/docs/errors.html @@ -100,12 +100,13 @@
    +
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/graph_class.html b/docs/graph_class.html index e52557e..d5fdfae 100644 --- a/docs/graph_class.html +++ b/docs/graph_class.html @@ -64,7 +64,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/index.html b/docs/index.html index cbf3944..7a2e0ca 100644 --- a/docs/index.html +++ b/docs/index.html @@ -80,7 +80,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/markers.html b/docs/markers.html index ea39c2d..7224e15 100644 --- a/docs/markers.html +++ b/docs/markers.html @@ -69,7 +69,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index dd906a2..aad0cbb 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -106,6 +106,12 @@ +
    +

    Magic function called when cloning an object

    +
    __clone() 
    +
    +

    +

    Constructor for creating the objects

    __construct(array $members) : void
    @@ -119,25 +125,21 @@
    -
    -

    PHP magic method to facilitate dynamic class loading

    -
    __get(string $name) 
    +
    +

    PHP magic method that is called when an object is treated as a function

    +
    __invoke(array $params) : \self

    Parameters

    -

    $name

    -string +

    $params

    +array
    +

    Returns

    +
    \self
    -
    -

    PHP magic method that is called when an object is treated as a function

    -
    __invoke() 
    -
    -

    -

    Prints out the contents of the object when used as a string

    __toString() : string
    @@ -209,6 +211,16 @@ with array_map and glob
    +
    +

    Singleton getter function

    +
    get_instance() : \self
    +
    +
    +

    +

    Returns

    +
    \self
    +
    +

    Utility function to check if a variable is set, and is an array or object

    is_like_array(mixed $var) : bool
    @@ -243,7 +255,7 @@ with array_map and glob

    Custom error handler

    -
    on_error(int $severity, string $message, string $filepath, int $line, mixed $context) : void
    +
    on_error(int $severity, string $message, string $filepath, int $line) : \ErrorException

    @@ -264,10 +276,8 @@ with array_map and glob

    $line

    int
    -
    -

    $context

    -mixed -
    +

    Returns

    +
    @@ -420,6 +430,13 @@ data-fetching methods

    « More »
    +
    +

    MM +

    +

    Class for standalone JSObject objects

    +
    +« More » +

    MM_Controller

    @@ -519,13 +536,6 @@ instantiates the specific db driver

    « More »
    -
    -

    R -

    -

    Class for examining other classes

    -
    -« More » -

    SQLite

    @@ -709,7 +719,7 @@ instantiates the specific db driver

    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/.html b/docs/packages/.html index c6cf46c..6112ef3 100644 --- a/docs/packages/.html +++ b/docs/packages/.html @@ -67,7 +67,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/Default.html b/docs/packages/Default.html index 565b63c..95bae27 100644 --- a/docs/packages/Default.html +++ b/docs/packages/Default.html @@ -185,7 +185,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/Query.Drivers.html b/docs/packages/Query.Drivers.html index 067b3a8..474829f 100644 --- a/docs/packages/Query.Drivers.html +++ b/docs/packages/Query.Drivers.html @@ -211,7 +211,7 @@ data-fetching methods

    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/Query.Helper Classes.html b/docs/packages/Query.Helper Classes.html index b4bb3c9..4feef35 100644 --- a/docs/packages/Query.Helper Classes.html +++ b/docs/packages/Query.Helper Classes.html @@ -97,7 +97,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/Query.Query.html b/docs/packages/Query.Query.html index 25ced54..0029f85 100644 --- a/docs/packages/Query.Query.html +++ b/docs/packages/Query.Query.html @@ -115,7 +115,7 @@ instantiates the specific db driver

    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/Query.html b/docs/packages/Query.html index 53fa6c7..5289835 100644 --- a/docs/packages/Query.html +++ b/docs/packages/Query.html @@ -316,7 +316,7 @@ instantiates the specific db driver

    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/miniMVC.App.html b/docs/packages/miniMVC.App.html index 384c01d..108a569 100644 --- a/docs/packages/miniMVC.App.html +++ b/docs/packages/miniMVC.App.html @@ -139,7 +139,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/miniMVC.Assets.html b/docs/packages/miniMVC.Assets.html new file mode 100644 index 0000000..055759c --- /dev/null +++ b/docs/packages/miniMVC.Assets.html @@ -0,0 +1,73 @@ + + + + + +miniMVC » miniMVC\Assets + + + + + + + + + + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + diff --git a/docs/packages/miniMVC.System.html b/docs/packages/miniMVC.System.html index 26da918..529cc1f 100644 --- a/docs/packages/miniMVC.System.html +++ b/docs/packages/miniMVC.System.html @@ -62,12 +62,12 @@ -
  • DB
  • -
  • miniMVC
  • -
  • MM_Controller
  • MM_Model
  • -
  • R
  • +
  • DB
  • +
  • MM
  • +
  • miniMVC
  • MM_Page
  • +
  • MM_Controller
  • MM_Output
  • @@ -89,6 +89,13 @@
    « More » +
    +

    MM +

    +

    Class for standalone JSObject objects

    +
    +« More » +

    MM_Controller

    @@ -117,13 +124,6 @@
    « More »
    -
    -

    R -

    -

    Class for examining other classes

    -
    -« More » -

    miniMVC

    @@ -137,7 +137,7 @@
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/packages/miniMVC.html b/docs/packages/miniMVC.html index ba589b3..85ffd02 100644 --- a/docs/packages/miniMVC.html +++ b/docs/packages/miniMVC.html @@ -71,12 +71,13 @@ Functions
  • PHP magic method to facilitate dynamic methods
    __call
  • PHP magic method to facilitate dynamically set static methods
    __callStatic
  • +
  • Magic function called when cloning an object
    __clone
  • Constructor for creating the objects
    __construct
  • -
  • PHP magic method to facilitate dynamic class loading
    __get
  • PHP magic method that is called when an object is treated as a function
    __invoke
  • Prints out the contents of the object when used as a string
    __toString
  • Returns routable methods for the specified controller class
    controller_methods
  • Array_map callback to load a folder of classes at once
    do_include
  • +
  • Singleton getter function
    get_instance
  • Utility function to check if a variable is set, and is an array or object
    is_like_array
  • Function to search through the tree to find the necessary file
    load_file
  • Custom error handler
    on_error
  • @@ -137,6 +138,12 @@ display them cleanly
    shutdown
    +
    +

    Magic function called when cloning an object

    +
    __clone() 
    +
    +

    +

    Constructor for creating the objects

    __construct(array $members) : void
    @@ -150,25 +157,21 @@ display them cleanly
    shutdown
    -
    -

    PHP magic method to facilitate dynamic class loading

    -
    __get(string $name) 
    +
    +

    PHP magic method that is called when an object is treated as a function

    +
    __invoke(array $params) : \self

    Parameters

    -

    $name

    -string +

    $params

    +array
    +

    Returns

    +
    \self
    -
    -

    PHP magic method that is called when an object is treated as a function

    -
    __invoke() 
    -
    -

    -

    Prints out the contents of the object when used as a string

    __toString() : string
    @@ -207,6 +210,16 @@ display them cleanly
    shutdown
    +
    +

    Singleton getter function

    +
    get_instance() : \self
    +
    +
    +

    +

    Returns

    +
    \self
    +
    +

    Utility function to check if a variable is set, and is an array or object

    is_like_array(mixed $var) : bool
    @@ -241,7 +254,7 @@ display them cleanly
    shutdown

    Custom error handler

    -
    on_error(int $severity, string $message, string $filepath, int $line, mixed $context) : void
    +
    on_error(int $severity, string $message, string $filepath, int $line) : \ErrorException

    @@ -262,10 +275,8 @@ display them cleanly
    shutdown

    $line

    int
    -
    -

    $context

    -mixed -
    +

    Returns

    +
    @@ -432,6 +443,13 @@ display them cleanly
    « More »
    +
    +

    MM +

    +

    Class for standalone JSObject objects

    +
    +« More » +

    MM_Controller

    @@ -460,13 +478,6 @@ display them cleanly
    « More »
    -
    -

    R -

    -

    Class for examining other classes

    -
    -« More » -

    miniMVC

    @@ -481,7 +492,7 @@ display them cleanly
    + generated on 2012-04-27T16:26:37-04:00.
    diff --git a/docs/structure.xml b/docs/structure.xml index 28f47a0..5a2538d 100644 --- a/docs/structure.xml +++ b/docs/structure.xml @@ -1,5 +1,57 @@ + + + + Convention-based micro-framework for PHP

    ]]>
    + + + + + +
    + + MM_Model + \MM_Model + \miniMVC + + + + + + + + __construct + function + + + + + void + + + + + load_db + function + + + + + string + + + void + + + + $name + + + + + +
    @@ -5009,7 +5061,7 @@ the last query executed]]> - + Convention-based micro-framework for PHP

    ]]>
    @@ -5019,10 +5071,10 @@ the last query executed]]>
    - + Query/autoload.php - + miniMVC.php @@ -5062,7 +5114,7 @@ display them cleanly]]> - + on_error function @@ -5080,196 +5132,188 @@ display them cleanly]]> int - - mixed - - - void + + \ErrorException - + $severity - + $message - + $filepath - + $line - - $context - - - - + on_exception function - + - + \Exception - + void - + $exception - + is_like_array function - + - + mixed - + bool - + $var - + show_404 function - + - + show_error function - + - + string - + int - + $message - + $status_code - + controller_methods function - + - + string - + array - + $controller - + route function - + - + site_url function - + - + string - + string - + $segment - + to_string function - + - + \object/array - + string - + string - + $data - + $method - + do_include function - + - + string - + void - + $path @@ -5415,7 +5459,7 @@ the parent constructor unless the arguments match.]]>
    - + Convention-based micro-framework for PHP

    ]]>
    @@ -5441,7 +5485,7 @@ the parent constructor unless the arguments match.]]> $members - array + @@ -5489,7 +5533,7 @@ the parent constructor unless the arguments match.]]> $args - array + @@ -5503,400 +5547,220 @@ the parent constructor unless the arguments match.]]>
    - - __get + + __invoke function - - + + - - string + + array + + + \self - - $name - + + $params + - - __invoke + + get_instance function - - + + + + + \self + + + + + __clone + function + + - + + MM + \MM + \ArrayObject + + + + + + + + __construct + function + + + + + + + $members + + + + + + __call + function + + + + + string + + + array + + + mixed + + + + $name + + + + + $params + + + + + + miniMVC \miniMVC - \ArrayObject - + \MM + - - + + - - $instance + + $output - - + + - - \miniMVC + + \MM_Output - + __construct function - + - + array - + $members - array + - + __call function - + - + string - + array - + $name - + $args - + - - __clone - function - - - - - - - __invoke - function - - - - - - - get_instance - function - - - - - \miniMVC - - - - + load_class function - + - + string - + string - + void - + $name - + $type - + unload function - + - + string - + $name - + load_config function - + - + string - + $name - - MM_Controller - \MM_Controller - \miniMVC - - - - - - - - $output - - - - - - \Output - - - - - $page - - - - - - \Page - - - - - __construct - function - - - - - void - - - - - load_model - function - - - - - string - - - array - - - void - - - - $file - - - - - $args - - - - - - load_view - function - - - - - string - - - array - - - bool - - - mixed - - - - $file - - - - - $data - - array - - - $return - - - - - - - MM_Model - \MM_Model - \miniMVC - - - - - - - - __construct - function - - - - - void - - - - - load_db - function - - - - - string - - - void - - - - $name - - - - -
    - - - - Convention-based micro-framework for PHP

    ]]>
    - - - - - -
    - - R - \R - \ReflectionClass - - - - - - - - __construct - function - - - - - mixed - - - - $var - - - - - - __call - function - - - - - string - - - array - - - mixed - - - - $name - - - - - $args - - - - - - get_all - function - - - - - - -
    - + Convention-based micro-framework for PHP

    ]]>
    @@ -5909,7 +5773,7 @@ the parent constructor unless the arguments match.]]> MM_Page \MM_Page - + \MM All methods are chainable, with the exception of the constructor, @@ -6016,440 +5880,446 @@ build_header(), build_footer(), and _headers() methods.

    ]]>
    - + __construct function + void + + $controller + + + - + _headers function - + Also sets page mime type, based on if sent as html or xhtml, and what the target browser supports

    ]]>
    - + bool - + \Page
    - + $html5
    - + set_meta function - + Sets meta tags, with codeigniter native meta tag helper

    ]]>
    - + array - + \Page
    - + $meta
    - + set_head_js_group function - + - + string - + bool - + \Page - + $group - + $debug - + set_css_group function - + - + string - + \Page - + $group - + set_foot_js_group function - + - + string - + bool - + \Page - + $group - + $debug - + set_title function - + - + string - + \Page - + $title - + set_body_class function - + - + string - + \Page - + $class - + set_body_id function - + - + string - + \Page - + $id - + set_base function - + - + string - + \Page - + $href - + set_css_tag function - + - + string - + bool - + string - + \Page - + $name - + $domain - + $media - + set_head_tag function - + - + string - + \Page - + $tag - + build_header function - + - + bool - + \Page - + $html5 - + build_footer function - + - + script_tag function - + Helper function for making script tags

    ]]>
    - + string - + bool - + string
    - + $js - + $domain
    - + set_message function - + Adds a message to the page

    ]]>
    - + string - + string - + bool - + void
    - + $type - + $message - + $return
    - + redirect_303 function - + Shortcut function for 303 redirect

    ]]>
    - + string
    - + $url
    - + render function - + Shortcut function for building a page

    ]]>
    - + string - + array
    - + $view - + $data
    - + output_string function - + Similar to render(), this is a shortcut to output a string in the body of the page.

    ]]>
    - + string
    - + $string
    - + _meta function - + - + array - + string - + $params - + _link_tag function - + - + array - + string - + $params @@ -6457,7 +6327,113 @@ page.

    ]]>
    - + + + + Convention-based micro-framework for PHP

    ]]>
    + + + + + +
    + + MM_Controller + \MM_Controller + \miniMVC + + + + + + + + $page + + + + + + \Page + + + + + __construct + function + + + + + void + + + + + load_model + function + + + + + string + + + array + + + void + + + + $file + + + + + $args + + + + + + load_view + function + + + + + string + + + array + + + bool + + + mixed + + + + $file + + + + + $data + + array + + + $return + + + + + +
    + Convention-based micro-framework for PHP

    ]]>
    @@ -6469,118 +6445,118 @@ page.

    ]]> MM_Output \MM_Output - + \MM - + $buffer - + - + string - + $headers - + - + array - + __construct function - + - + void - + __destruct function - + - + void - + set_header function - + - + string - + string - + $key - + $val - + append_output function - + - + string - + $string - + set_output function - + - + string - + $string - + flush_headers function - + @@ -6742,7 +6718,7 @@ Used for outputing HTML]]>
    - + Convention-based micro-framework for PHP

    ]]>
    @@ -6795,17 +6771,6 @@ Used for outputing HTML]]>
    - - reflect - function - - - - - void - - -
    diff --git a/src/assets/config/JSMinPlus.php b/src/assets/config/JSMinPlus.php deleted file mode 100755 index 6bd9e8c..0000000 --- a/src/assets/config/JSMinPlus.php +++ /dev/null @@ -1,2086 +0,0 @@ - - * - * Usage: $minified = JSMinPlus::minify($script [, $filename]) - * - * Versionlog (see also changelog.txt): - * 23-07-2011 - remove dynamic creation of OP_* and KEYWORD_* defines and declare them on top - * reduce memory footprint by minifying by block-scope - * some small byte-saving and performance improvements - * 12-05-2009 - fixed hook:colon precedence, fixed empty body in loop and if-constructs - * 18-04-2009 - fixed crashbug in PHP 5.2.9 and several other bugfixes - * 12-04-2009 - some small bugfixes and performance improvements - * 09-04-2009 - initial open sourced version 1.0 - * - * Latest version of this script: http://files.tweakers.net/jsminplus/jsminplus.zip - * - */ - -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Narcissus JavaScript engine. - * - * The Initial Developer of the Original Code is - * Brendan Eich . - * Portions created by the Initial Developer are Copyright © 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Tino Zijdel - * PHP port, modifications and minifier routine are © 2009-2011 - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -define('TOKEN_END', 1); -define('TOKEN_NUMBER', 2); -define('TOKEN_IDENTIFIER', 3); -define('TOKEN_STRING', 4); -define('TOKEN_REGEXP', 5); -define('TOKEN_NEWLINE', 6); -define('TOKEN_CONDCOMMENT_START', 7); -define('TOKEN_CONDCOMMENT_END', 8); - -define('JS_SCRIPT', 100); -define('JS_BLOCK', 101); -define('JS_LABEL', 102); -define('JS_FOR_IN', 103); -define('JS_CALL', 104); -define('JS_NEW_WITH_ARGS', 105); -define('JS_INDEX', 106); -define('JS_ARRAY_INIT', 107); -define('JS_OBJECT_INIT', 108); -define('JS_PROPERTY_INIT', 109); -define('JS_GETTER', 110); -define('JS_SETTER', 111); -define('JS_GROUP', 112); -define('JS_LIST', 113); - -define('JS_MINIFIED', 999); - -define('DECLARED_FORM', 0); -define('EXPRESSED_FORM', 1); -define('STATEMENT_FORM', 2); - -/* Operators */ -define('OP_SEMICOLON', ';'); -define('OP_COMMA', ','); -define('OP_HOOK', '?'); -define('OP_COLON', ':'); -define('OP_OR', '||'); -define('OP_AND', '&&'); -define('OP_BITWISE_OR', '|'); -define('OP_BITWISE_XOR', '^'); -define('OP_BITWISE_AND', '&'); -define('OP_STRICT_EQ', '==='); -define('OP_EQ', '=='); -define('OP_ASSIGN', '='); -define('OP_STRICT_NE', '!=='); -define('OP_NE', '!='); -define('OP_LSH', '<<'); -define('OP_LE', '<='); -define('OP_LT', '<'); -define('OP_URSH', '>>>'); -define('OP_RSH', '>>'); -define('OP_GE', '>='); -define('OP_GT', '>'); -define('OP_INCREMENT', '++'); -define('OP_DECREMENT', '--'); -define('OP_PLUS', '+'); -define('OP_MINUS', '-'); -define('OP_MUL', '*'); -define('OP_DIV', '/'); -define('OP_MOD', '%'); -define('OP_NOT', '!'); -define('OP_BITWISE_NOT', '~'); -define('OP_DOT', '.'); -define('OP_LEFT_BRACKET', '['); -define('OP_RIGHT_BRACKET', ']'); -define('OP_LEFT_CURLY', '{'); -define('OP_RIGHT_CURLY', '}'); -define('OP_LEFT_PAREN', '('); -define('OP_RIGHT_PAREN', ')'); -define('OP_CONDCOMMENT_END', '@*/'); - -define('OP_UNARY_PLUS', 'U+'); -define('OP_UNARY_MINUS', 'U-'); - -/* Keywords */ -define('KEYWORD_BREAK', 'break'); -define('KEYWORD_CASE', 'case'); -define('KEYWORD_CATCH', 'catch'); -define('KEYWORD_CONST', 'const'); -define('KEYWORD_CONTINUE', 'continue'); -define('KEYWORD_DEBUGGER', 'debugger'); -define('KEYWORD_DEFAULT', 'default'); -define('KEYWORD_DELETE', 'delete'); -define('KEYWORD_DO', 'do'); -define('KEYWORD_ELSE', 'else'); -define('KEYWORD_ENUM', 'enum'); -define('KEYWORD_FALSE', 'false'); -define('KEYWORD_FINALLY', 'finally'); -define('KEYWORD_FOR', 'for'); -define('KEYWORD_FUNCTION', 'function'); -define('KEYWORD_IF', 'if'); -define('KEYWORD_IN', 'in'); -define('KEYWORD_INSTANCEOF', 'instanceof'); -define('KEYWORD_NEW', 'new'); -define('KEYWORD_NULL', 'null'); -define('KEYWORD_RETURN', 'return'); -define('KEYWORD_SWITCH', 'switch'); -define('KEYWORD_THIS', 'this'); -define('KEYWORD_THROW', 'throw'); -define('KEYWORD_TRUE', 'true'); -define('KEYWORD_TRY', 'try'); -define('KEYWORD_TYPEOF', 'typeof'); -define('KEYWORD_VAR', 'var'); -define('KEYWORD_VOID', 'void'); -define('KEYWORD_WHILE', 'while'); -define('KEYWORD_WITH', 'with'); - - -class JSMinPlus -{ - private $parser; - private $reserved = array( - 'break', 'case', 'catch', 'continue', 'default', 'delete', 'do', - 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof', - 'new', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var', - 'void', 'while', 'with', - // Words reserved for future use - 'abstract', 'boolean', 'byte', 'char', 'class', 'const', 'debugger', - 'double', 'enum', 'export', 'extends', 'final', 'float', 'goto', - 'implements', 'import', 'int', 'interface', 'long', 'native', - 'package', 'private', 'protected', 'public', 'short', 'static', - 'super', 'synchronized', 'throws', 'transient', 'volatile', - // These are not reserved, but should be taken into account - // in isValidIdentifier (See jslint source code) - 'arguments', 'eval', 'true', 'false', 'Infinity', 'NaN', 'null', 'undefined' - ); - - private function __construct() - { - $this->parser = new JSParser($this); - } - - public static function minify($js, $filename='') - { - static $instance; - - // this is a singleton - if(!$instance) - $instance = new JSMinPlus(); - - return $instance->min($js, $filename); - } - - private function min($js, $filename) - { - try - { - $n = $this->parser->parse($js, $filename, 1); - return $this->parseTree($n); - } - catch(Exception $e) - { - echo $e->getMessage() . "\n"; - } - - return false; - } - - public function parseTree($n, $noBlockGrouping = false) - { - $s = ''; - - switch ($n->type) - { - case JS_MINIFIED: - $s = $n->value; - break; - - case JS_SCRIPT: - // we do nothing yet with funDecls or varDecls - $noBlockGrouping = true; - // FALL THROUGH - - case JS_BLOCK: - $childs = $n->treeNodes; - $lastType = 0; - for ($c = 0, $i = 0, $j = count($childs); $i < $j; $i++) - { - $type = $childs[$i]->type; - $t = $this->parseTree($childs[$i]); - if (strlen($t)) - { - if ($c) - { - $s = rtrim($s, ';'); - - if ($type == KEYWORD_FUNCTION && $childs[$i]->functionForm == DECLARED_FORM) - { - // put declared functions on a new line - $s .= "\n"; - } - elseif ($type == KEYWORD_VAR && $type == $lastType) - { - // mutiple var-statements can go into one - $t = ',' . substr($t, 4); - } - else - { - // add terminator - $s .= ';'; - } - } - - $s .= $t; - - $c++; - $lastType = $type; - } - } - - if ($c > 1 && !$noBlockGrouping) - { - $s = '{' . $s . '}'; - } - break; - - case KEYWORD_FUNCTION: - $s .= 'function' . ($n->name ? ' ' . $n->name : '') . '('; - $params = $n->params; - for ($i = 0, $j = count($params); $i < $j; $i++) - $s .= ($i ? ',' : '') . $params[$i]; - $s .= '){' . $this->parseTree($n->body, true) . '}'; - break; - - case KEYWORD_IF: - $s = 'if(' . $this->parseTree($n->condition) . ')'; - $thenPart = $this->parseTree($n->thenPart); - $elsePart = $n->elsePart ? $this->parseTree($n->elsePart) : null; - - // empty if-statement - if ($thenPart == '') - $thenPart = ';'; - - if ($elsePart) - { - // be carefull and always make a block out of the thenPart; could be more optimized but is a lot of trouble - if ($thenPart != ';' && $thenPart[0] != '{') - $thenPart = '{' . $thenPart . '}'; - - $s .= $thenPart . 'else'; - - // we could check for more, but that hardly ever applies so go for performance - if ($elsePart[0] != '{') - $s .= ' '; - - $s .= $elsePart; - } - else - { - $s .= $thenPart; - } - break; - - case KEYWORD_SWITCH: - $s = 'switch(' . $this->parseTree($n->discriminant) . '){'; - $cases = $n->cases; - for ($i = 0, $j = count($cases); $i < $j; $i++) - { - $case = $cases[$i]; - if ($case->type == KEYWORD_CASE) - $s .= 'case' . ($case->caseLabel->type != TOKEN_STRING ? ' ' : '') . $this->parseTree($case->caseLabel) . ':'; - else - $s .= 'default:'; - - $statement = $this->parseTree($case->statements, true); - if ($statement) - { - $s .= $statement; - // no terminator for last statement - if ($i + 1 < $j) - $s .= ';'; - } - } - $s .= '}'; - break; - - case KEYWORD_FOR: - $s = 'for(' . ($n->setup ? $this->parseTree($n->setup) : '') - . ';' . ($n->condition ? $this->parseTree($n->condition) : '') - . ';' . ($n->update ? $this->parseTree($n->update) : '') . ')'; - - $body = $this->parseTree($n->body); - if ($body == '') - $body = ';'; - - $s .= $body; - break; - - case KEYWORD_WHILE: - $s = 'while(' . $this->parseTree($n->condition) . ')'; - - $body = $this->parseTree($n->body); - if ($body == '') - $body = ';'; - - $s .= $body; - break; - - case JS_FOR_IN: - $s = 'for(' . ($n->varDecl ? $this->parseTree($n->varDecl) : $this->parseTree($n->iterator)) . ' in ' . $this->parseTree($n->object) . ')'; - - $body = $this->parseTree($n->body); - if ($body == '') - $body = ';'; - - $s .= $body; - break; - - case KEYWORD_DO: - $s = 'do{' . $this->parseTree($n->body, true) . '}while(' . $this->parseTree($n->condition) . ')'; - break; - - case KEYWORD_BREAK: - case KEYWORD_CONTINUE: - $s = $n->value . ($n->label ? ' ' . $n->label : ''); - break; - - case KEYWORD_TRY: - $s = 'try{' . $this->parseTree($n->tryBlock, true) . '}'; - $catchClauses = $n->catchClauses; - for ($i = 0, $j = count($catchClauses); $i < $j; $i++) - { - $t = $catchClauses[$i]; - $s .= 'catch(' . $t->varName . ($t->guard ? ' if ' . $this->parseTree($t->guard) : '') . '){' . $this->parseTree($t->block, true) . '}'; - } - if ($n->finallyBlock) - $s .= 'finally{' . $this->parseTree($n->finallyBlock, true) . '}'; - break; - - case KEYWORD_THROW: - case KEYWORD_RETURN: - $s = $n->type; - if ($n->value) - { - $t = $this->parseTree($n->value); - if (strlen($t)) - { - if ($this->isWordChar($t[0]) || $t[0] == '\\') - $s .= ' '; - - $s .= $t; - } - } - break; - - case KEYWORD_WITH: - $s = 'with(' . $this->parseTree($n->object) . ')' . $this->parseTree($n->body); - break; - - case KEYWORD_VAR: - case KEYWORD_CONST: - $s = $n->value . ' '; - $childs = $n->treeNodes; - for ($i = 0, $j = count($childs); $i < $j; $i++) - { - $t = $childs[$i]; - $s .= ($i ? ',' : '') . $t->name; - $u = $t->initializer; - if ($u) - $s .= '=' . $this->parseTree($u); - } - break; - - case KEYWORD_IN: - case KEYWORD_INSTANCEOF: - $left = $this->parseTree($n->treeNodes[0]); - $right = $this->parseTree($n->treeNodes[1]); - - $s = $left; - - if ($this->isWordChar(substr($left, -1))) - $s .= ' '; - - $s .= $n->type; - - if ($this->isWordChar($right[0]) || $right[0] == '\\') - $s .= ' '; - - $s .= $right; - break; - - case KEYWORD_DELETE: - case KEYWORD_TYPEOF: - $right = $this->parseTree($n->treeNodes[0]); - - $s = $n->type; - - if ($this->isWordChar($right[0]) || $right[0] == '\\') - $s .= ' '; - - $s .= $right; - break; - - case KEYWORD_VOID: - $s = 'void(' . $this->parseTree($n->treeNodes[0]) . ')'; - break; - - case KEYWORD_DEBUGGER: - throw new Exception('NOT IMPLEMENTED: DEBUGGER'); - break; - - case TOKEN_CONDCOMMENT_START: - case TOKEN_CONDCOMMENT_END: - $s = $n->value . ($n->type == TOKEN_CONDCOMMENT_START ? ' ' : ''); - $childs = $n->treeNodes; - for ($i = 0, $j = count($childs); $i < $j; $i++) - $s .= $this->parseTree($childs[$i]); - break; - - case OP_SEMICOLON: - if ($expression = $n->expression) - $s = $this->parseTree($expression); - break; - - case JS_LABEL: - $s = $n->label . ':' . $this->parseTree($n->statement); - break; - - case OP_COMMA: - $childs = $n->treeNodes; - for ($i = 0, $j = count($childs); $i < $j; $i++) - $s .= ($i ? ',' : '') . $this->parseTree($childs[$i]); - break; - - case OP_ASSIGN: - $s = $this->parseTree($n->treeNodes[0]) . $n->value . $this->parseTree($n->treeNodes[1]); - break; - - case OP_HOOK: - $s = $this->parseTree($n->treeNodes[0]) . '?' . $this->parseTree($n->treeNodes[1]) . ':' . $this->parseTree($n->treeNodes[2]); - break; - - case OP_OR: case OP_AND: - case OP_BITWISE_OR: case OP_BITWISE_XOR: case OP_BITWISE_AND: - case OP_EQ: case OP_NE: case OP_STRICT_EQ: case OP_STRICT_NE: - case OP_LT: case OP_LE: case OP_GE: case OP_GT: - case OP_LSH: case OP_RSH: case OP_URSH: - case OP_MUL: case OP_DIV: case OP_MOD: - $s = $this->parseTree($n->treeNodes[0]) . $n->type . $this->parseTree($n->treeNodes[1]); - break; - - case OP_PLUS: - case OP_MINUS: - $left = $this->parseTree($n->treeNodes[0]); - $right = $this->parseTree($n->treeNodes[1]); - - switch ($n->treeNodes[1]->type) - { - case OP_PLUS: - case OP_MINUS: - case OP_INCREMENT: - case OP_DECREMENT: - case OP_UNARY_PLUS: - case OP_UNARY_MINUS: - $s = $left . $n->type . ' ' . $right; - break; - - case TOKEN_STRING: - //combine concatted strings with same quotestyle - if ($n->type == OP_PLUS && substr($left, -1) == $right[0]) - { - $s = substr($left, 0, -1) . substr($right, 1); - break; - } - // FALL THROUGH - - default: - $s = $left . $n->type . $right; - } - break; - - case OP_NOT: - case OP_BITWISE_NOT: - case OP_UNARY_PLUS: - case OP_UNARY_MINUS: - $s = $n->value . $this->parseTree($n->treeNodes[0]); - break; - - case OP_INCREMENT: - case OP_DECREMENT: - if ($n->postfix) - $s = $this->parseTree($n->treeNodes[0]) . $n->value; - else - $s = $n->value . $this->parseTree($n->treeNodes[0]); - break; - - case OP_DOT: - $s = $this->parseTree($n->treeNodes[0]) . '.' . $this->parseTree($n->treeNodes[1]); - break; - - case JS_INDEX: - $s = $this->parseTree($n->treeNodes[0]); - // See if we can replace named index with a dot saving 3 bytes - if ( $n->treeNodes[0]->type == TOKEN_IDENTIFIER && - $n->treeNodes[1]->type == TOKEN_STRING && - $this->isValidIdentifier(substr($n->treeNodes[1]->value, 1, -1)) - ) - $s .= '.' . substr($n->treeNodes[1]->value, 1, -1); - else - $s .= '[' . $this->parseTree($n->treeNodes[1]) . ']'; - break; - - case JS_LIST: - $childs = $n->treeNodes; - for ($i = 0, $j = count($childs); $i < $j; $i++) - $s .= ($i ? ',' : '') . $this->parseTree($childs[$i]); - break; - - case JS_CALL: - $s = $this->parseTree($n->treeNodes[0]) . '(' . $this->parseTree($n->treeNodes[1]) . ')'; - break; - - case KEYWORD_NEW: - case JS_NEW_WITH_ARGS: - $s = 'new ' . $this->parseTree($n->treeNodes[0]) . '(' . ($n->type == JS_NEW_WITH_ARGS ? $this->parseTree($n->treeNodes[1]) : '') . ')'; - break; - - case JS_ARRAY_INIT: - $s = '['; - $childs = $n->treeNodes; - for ($i = 0, $j = count($childs); $i < $j; $i++) - { - $s .= ($i ? ',' : '') . $this->parseTree($childs[$i]); - } - $s .= ']'; - break; - - case JS_OBJECT_INIT: - $s = '{'; - $childs = $n->treeNodes; - for ($i = 0, $j = count($childs); $i < $j; $i++) - { - $t = $childs[$i]; - if ($i) - $s .= ','; - if ($t->type == JS_PROPERTY_INIT) - { - // Ditch the quotes when the index is a valid identifier - if ( $t->treeNodes[0]->type == TOKEN_STRING && - $this->isValidIdentifier(substr($t->treeNodes[0]->value, 1, -1)) - ) - $s .= substr($t->treeNodes[0]->value, 1, -1); - else - $s .= $t->treeNodes[0]->value; - - $s .= ':' . $this->parseTree($t->treeNodes[1]); - } - else - { - $s .= $t->type == JS_GETTER ? 'get' : 'set'; - $s .= ' ' . $t->name . '('; - $params = $t->params; - for ($i = 0, $j = count($params); $i < $j; $i++) - $s .= ($i ? ',' : '') . $params[$i]; - $s .= '){' . $this->parseTree($t->body, true) . '}'; - } - } - $s .= '}'; - break; - - case TOKEN_NUMBER: - $s = $n->value; - if (preg_match('/^([1-9]+)(0{3,})$/', $s, $m)) - $s = $m[1] . 'e' . strlen($m[2]); - break; - - case KEYWORD_NULL: case KEYWORD_THIS: case KEYWORD_TRUE: case KEYWORD_FALSE: - case TOKEN_IDENTIFIER: case TOKEN_STRING: case TOKEN_REGEXP: - $s = $n->value; - break; - - case JS_GROUP: - if (in_array( - $n->treeNodes[0]->type, - array( - JS_ARRAY_INIT, JS_OBJECT_INIT, JS_GROUP, - TOKEN_NUMBER, TOKEN_STRING, TOKEN_REGEXP, TOKEN_IDENTIFIER, - KEYWORD_NULL, KEYWORD_THIS, KEYWORD_TRUE, KEYWORD_FALSE - ) - )) - { - $s = $this->parseTree($n->treeNodes[0]); - } - else - { - $s = '(' . $this->parseTree($n->treeNodes[0]) . ')'; - } - break; - - default: - throw new Exception('UNKNOWN TOKEN TYPE: ' . $n->type); - } - - return $s; - } - - private function isValidIdentifier($string) - { - return preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $string) && !in_array($string, $this->reserved); - } - - private function isWordChar($char) - { - return $char == '_' || $char == '$' || ctype_alnum($char); - } -} - -class JSParser -{ - private $t; - private $minifier; - - private $opPrecedence = array( - ';' => 0, - ',' => 1, - '=' => 2, '?' => 2, ':' => 2, - // The above all have to have the same precedence, see bug 330975 - '||' => 4, - '&&' => 5, - '|' => 6, - '^' => 7, - '&' => 8, - '==' => 9, '!=' => 9, '===' => 9, '!==' => 9, - '<' => 10, '<=' => 10, '>=' => 10, '>' => 10, 'in' => 10, 'instanceof' => 10, - '<<' => 11, '>>' => 11, '>>>' => 11, - '+' => 12, '-' => 12, - '*' => 13, '/' => 13, '%' => 13, - 'delete' => 14, 'void' => 14, 'typeof' => 14, - '!' => 14, '~' => 14, 'U+' => 14, 'U-' => 14, - '++' => 15, '--' => 15, - 'new' => 16, - '.' => 17, - JS_NEW_WITH_ARGS => 0, JS_INDEX => 0, JS_CALL => 0, - JS_ARRAY_INIT => 0, JS_OBJECT_INIT => 0, JS_GROUP => 0 - ); - - private $opArity = array( - ',' => -2, - '=' => 2, - '?' => 3, - '||' => 2, - '&&' => 2, - '|' => 2, - '^' => 2, - '&' => 2, - '==' => 2, '!=' => 2, '===' => 2, '!==' => 2, - '<' => 2, '<=' => 2, '>=' => 2, '>' => 2, 'in' => 2, 'instanceof' => 2, - '<<' => 2, '>>' => 2, '>>>' => 2, - '+' => 2, '-' => 2, - '*' => 2, '/' => 2, '%' => 2, - 'delete' => 1, 'void' => 1, 'typeof' => 1, - '!' => 1, '~' => 1, 'U+' => 1, 'U-' => 1, - '++' => 1, '--' => 1, - 'new' => 1, - '.' => 2, - JS_NEW_WITH_ARGS => 2, JS_INDEX => 2, JS_CALL => 2, - JS_ARRAY_INIT => 1, JS_OBJECT_INIT => 1, JS_GROUP => 1, - TOKEN_CONDCOMMENT_START => 1, TOKEN_CONDCOMMENT_END => 1 - ); - - public function __construct($minifier=null) - { - $this->minifier = $minifier; - $this->t = new JSTokenizer(); - } - - public function parse($s, $f, $l) - { - // initialize tokenizer - $this->t->init($s, $f, $l); - - $x = new JSCompilerContext(false); - $n = $this->Script($x); - if (!$this->t->isDone()) - throw $this->t->newSyntaxError('Syntax error'); - - return $n; - } - - private function Script($x) - { - $n = $this->Statements($x); - $n->type = JS_SCRIPT; - $n->funDecls = $x->funDecls; - $n->varDecls = $x->varDecls; - - // minify by scope - if ($this->minifier) - { - $n->value = $this->minifier->parseTree($n); - - // clear tree from node to save memory - $n->treeNodes = null; - $n->funDecls = null; - $n->varDecls = null; - - $n->type = JS_MINIFIED; - } - - return $n; - } - - private function Statements($x) - { - $n = new JSNode($this->t, JS_BLOCK); - array_push($x->stmtStack, $n); - - while (!$this->t->isDone() && $this->t->peek() != OP_RIGHT_CURLY) - $n->addNode($this->Statement($x)); - - array_pop($x->stmtStack); - - return $n; - } - - private function Block($x) - { - $this->t->mustMatch(OP_LEFT_CURLY); - $n = $this->Statements($x); - $this->t->mustMatch(OP_RIGHT_CURLY); - - return $n; - } - - private function Statement($x) - { - $tt = $this->t->get(); - $n2 = null; - - // Cases for statements ending in a right curly return early, avoiding the - // common semicolon insertion magic after this switch. - switch ($tt) - { - case KEYWORD_FUNCTION: - return $this->FunctionDefinition( - $x, - true, - count($x->stmtStack) > 1 ? STATEMENT_FORM : DECLARED_FORM - ); - break; - - case OP_LEFT_CURLY: - $n = $this->Statements($x); - $this->t->mustMatch(OP_RIGHT_CURLY); - return $n; - - case KEYWORD_IF: - $n = new JSNode($this->t); - $n->condition = $this->ParenExpression($x); - array_push($x->stmtStack, $n); - $n->thenPart = $this->Statement($x); - $n->elsePart = $this->t->match(KEYWORD_ELSE) ? $this->Statement($x) : null; - array_pop($x->stmtStack); - return $n; - - case KEYWORD_SWITCH: - $n = new JSNode($this->t); - $this->t->mustMatch(OP_LEFT_PAREN); - $n->discriminant = $this->Expression($x); - $this->t->mustMatch(OP_RIGHT_PAREN); - $n->cases = array(); - $n->defaultIndex = -1; - - array_push($x->stmtStack, $n); - - $this->t->mustMatch(OP_LEFT_CURLY); - - while (($tt = $this->t->get()) != OP_RIGHT_CURLY) - { - switch ($tt) - { - case KEYWORD_DEFAULT: - if ($n->defaultIndex >= 0) - throw $this->t->newSyntaxError('More than one switch default'); - // FALL THROUGH - case KEYWORD_CASE: - $n2 = new JSNode($this->t); - if ($tt == KEYWORD_DEFAULT) - $n->defaultIndex = count($n->cases); - else - $n2->caseLabel = $this->Expression($x, OP_COLON); - break; - default: - throw $this->t->newSyntaxError('Invalid switch case'); - } - - $this->t->mustMatch(OP_COLON); - $n2->statements = new JSNode($this->t, JS_BLOCK); - while (($tt = $this->t->peek()) != KEYWORD_CASE && $tt != KEYWORD_DEFAULT && $tt != OP_RIGHT_CURLY) - $n2->statements->addNode($this->Statement($x)); - - array_push($n->cases, $n2); - } - - array_pop($x->stmtStack); - return $n; - - case KEYWORD_FOR: - $n = new JSNode($this->t); - $n->isLoop = true; - $this->t->mustMatch(OP_LEFT_PAREN); - - if (($tt = $this->t->peek()) != OP_SEMICOLON) - { - $x->inForLoopInit = true; - if ($tt == KEYWORD_VAR || $tt == KEYWORD_CONST) - { - $this->t->get(); - $n2 = $this->Variables($x); - } - else - { - $n2 = $this->Expression($x); - } - $x->inForLoopInit = false; - } - - if ($n2 && $this->t->match(KEYWORD_IN)) - { - $n->type = JS_FOR_IN; - if ($n2->type == KEYWORD_VAR) - { - if (count($n2->treeNodes) != 1) - { - throw $this->t->SyntaxError( - 'Invalid for..in left-hand side', - $this->t->filename, - $n2->lineno - ); - } - - // NB: n2[0].type == IDENTIFIER and n2[0].value == n2[0].name. - $n->iterator = $n2->treeNodes[0]; - $n->varDecl = $n2; - } - else - { - $n->iterator = $n2; - $n->varDecl = null; - } - - $n->object = $this->Expression($x); - } - else - { - $n->setup = $n2 ? $n2 : null; - $this->t->mustMatch(OP_SEMICOLON); - $n->condition = $this->t->peek() == OP_SEMICOLON ? null : $this->Expression($x); - $this->t->mustMatch(OP_SEMICOLON); - $n->update = $this->t->peek() == OP_RIGHT_PAREN ? null : $this->Expression($x); - } - - $this->t->mustMatch(OP_RIGHT_PAREN); - $n->body = $this->nest($x, $n); - return $n; - - case KEYWORD_WHILE: - $n = new JSNode($this->t); - $n->isLoop = true; - $n->condition = $this->ParenExpression($x); - $n->body = $this->nest($x, $n); - return $n; - - case KEYWORD_DO: - $n = new JSNode($this->t); - $n->isLoop = true; - $n->body = $this->nest($x, $n, KEYWORD_WHILE); - $n->condition = $this->ParenExpression($x); - if (!$x->ecmaStrictMode) - { - //