Autoload traits

This commit is contained in:
Timothy Warren 2012-05-21 14:58:58 -04:00
parent 7b4c4afaad
commit 66f914c80f
27 changed files with 525 additions and 386 deletions

View File

@ -125,7 +125,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -199,7 +199,7 @@ of the singleton</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -433,7 +433,7 @@ dynamic methods</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -737,7 +737,7 @@ dynamic methods</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -690,7 +690,7 @@ dynamic methods</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -639,7 +639,7 @@ Used for outputing HTML</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -1165,7 +1165,7 @@ supports</p></p>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -143,7 +143,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -592,7 +592,7 @@ dynamic methods</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -66,7 +66,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -76,12 +76,14 @@
<div class="package-contents"></div>
<div class="package-contents"></div>
<div class="package-contents"></div>
<div class="package-contents"></div>
<div class="package-contents"></div>
</div>
</div>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -63,7 +63,7 @@
</script><div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -78,7 +78,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -68,7 +68,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -100,6 +100,19 @@
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
<a name="__construct" id="__construct"></a><div class="element clickable function __construct" data-toggle="collapse" data-target=".__construct .collapse">
<h2>Constructor for creating the objects</h2>
<pre>__construct(array $members) : void</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$members</h4>
<code>array</code>
</div>
</div></div>
</div>
<a name="__invoke" id="__invoke"></a><div class="element clickable function __invoke" data-toggle="collapse" data-target=".__invoke .collapse">
<h2>PHP magic method that is called when an object is treated as a function</h2>
<pre>__invoke(array $params) : \self</pre>
@ -115,6 +128,19 @@
<div class="subelement response"><code>\self</code></div>
</div></div>
</div>
<a name="__invoke" id="__invoke"></a><div class="element clickable function __invoke" data-toggle="collapse" data-target=".__invoke .collapse">
<h2>PHP magic method that is called when an object is treated as a function</h2>
<pre>__invoke(array $args) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$args</h4>
<code>array</code>
</div>
</div></div>
</div>
<a name="__toString" id="__toString"></a><div class="element clickable function __toString" data-toggle="collapse" data-target=".__toString .collapse">
<h2>Prints out the contents of the object when used as a string</h2>
<pre>__toString() : string</pre>
@ -434,7 +460,7 @@ display them cleanly</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -66,7 +66,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -107,7 +107,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -99,7 +99,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -96,7 +96,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -136,7 +136,7 @@
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -74,6 +74,8 @@
<li class="function "><a href="#__call" title="__call :: PHP magic method to facilitate dynamic methods"><span class="description">PHP magic method to facilitate dynamic methods</span><pre>__call</pre></a></li>
<li class="function "><a href="#__clone" title="__clone :: Magic function called when cloning an object"><span class="description">Magic function called when cloning an object</span><pre>__clone</pre></a></li>
<li class="function "><a href="#__construct" title="__construct :: Protected constructor for creating the one instance"><span class="description">Protected constructor for creating the one instance</span><pre>__construct</pre></a></li>
<li class="function "><a href="#__construct" title="__construct :: Constructor for creating the objects"><span class="description">Constructor for creating the objects</span><pre>__construct</pre></a></li>
<li class="function "><a href="#__invoke" title="__invoke :: PHP magic method that is called when an object is treated as a function"><span class="description">PHP magic method that is called when an object is treated as a function</span><pre>__invoke</pre></a></li>
<li class="function "><a href="#__invoke" title="__invoke :: PHP magic method that is called when an object is treated as a function"><span class="description">PHP magic method that is called when an object is treated as a function</span><pre>__invoke</pre></a></li>
<li class="function "><a href="#__toString" title="__toString :: Prints out the contents of the object when used as a string"><span class="description">Prints out the contents of the object when used as a string</span><pre>__toString</pre></a></li>
<li class="function "><a href="#autoload" title="autoload :: Function to autoload libraries/classes"><span class="description">Function to autoload libraries/classes</span><pre>autoload</pre></a></li>
@ -136,6 +138,19 @@ display them cleanly</span><pre>shutdown</pre></a></li>
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
<a name="__construct" id="__construct"></a><div class="element clickable function __construct" data-toggle="collapse" data-target=".__construct .collapse">
<h2>Constructor for creating the objects</h2>
<pre>__construct(array $members) : void</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$members</h4>
<code>array</code>
</div>
</div></div>
</div>
<a name="__invoke" id="__invoke"></a><div class="element clickable function __invoke" data-toggle="collapse" data-target=".__invoke .collapse">
<h2>PHP magic method that is called when an object is treated as a function</h2>
<pre>__invoke(array $params) : \self</pre>
@ -151,6 +166,19 @@ display them cleanly</span><pre>shutdown</pre></a></li>
<div class="subelement response"><code>\self</code></div>
</div></div>
</div>
<a name="__invoke" id="__invoke"></a><div class="element clickable function __invoke" data-toggle="collapse" data-target=".__invoke .collapse">
<h2>PHP magic method that is called when an object is treated as a function</h2>
<pre>__invoke(array $args) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$args</h4>
<code>array</code>
</div>
</div></div>
</div>
<a name="__toString" id="__toString"></a><div class="element clickable function __toString" data-toggle="collapse" data-target=".__toString .collapse">
<h2>Prints out the contents of the object when used as a string</h2>
<pre>__toString() : string</pre>
@ -475,7 +503,7 @@ display them cleanly</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-05-21T14:50:58-04:00.<br></footer></div>
generated on 2012-05-21T14:58:49-04:00.<br></footer></div>
</div>
</body>
</html>

View File

@ -705,6 +705,157 @@ Used for outputing HTML]]></description>
</method>
</class>
</file>
<file path="sys/core/traits/Singleton.php" hash="f918c0d3610dae789decf8d36446e006" package="miniMVC">
<docblock line="2">
<description><![CDATA[MiniMVC]]></description>
<long-description><![CDATA[<p>Convention-based micro-framework for PHP</p>]]></long-description>
<tag line="2" name="package" description="miniMVC"/>
<tag line="2" name="author" description="Timothy J. Warren"/>
<tag line="2" name="copyright" description="Copyright (c) 2011 - 2012"/>
<tag line="2" name="link" description="https://github.com/timw4mail/miniMVC" link="https://github.com/timw4mail/miniMVC"/>
<tag line="2" name="license" description="http://philsturgeon.co.uk/code/dbad-license"/>
</docblock>
<namespace-alias name="Generic">Generic</namespace-alias>
<function namespace="default" line="36" package="miniMVC">
<name>__construct</name>
<type>function</type>
<docblock line="33">
<description><![CDATA[Protected constructor for creating the one instance]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</function>
<function namespace="default" line="44" package="miniMVC">
<name>__invoke</name>
<type>function</type>
<docblock line="38">
<description><![CDATA[PHP magic method that is called when an object is treated as a function]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="38" name="param" description="" type="array" variable="$params">
<type by_reference="false">array</type>
</tag>
<tag line="38" name="return" description="" type="\self">
<type by_reference="false">\self</type>
</tag>
</docblock>
<argument line="44">
<name>$params</name>
<default><![CDATA[[]]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="56" package="miniMVC">
<name>get_instance</name>
<type>function</type>
<docblock line="51">
<description><![CDATA[Singleton getter function]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="51" name="return" description="" type="\self">
<type by_reference="false">\self</type>
</tag>
</docblock>
</function>
<function namespace="default" line="73" package="miniMVC">
<name>__clone</name>
<type>function</type>
<docblock line="70">
<description><![CDATA[Magic function called when cloning an object]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</function>
</file>
<file path="sys/core/traits/JSObject.php" hash="59936305b240a482a7893bacd6a7688d" package="miniMVC">
<docblock line="2">
<description><![CDATA[MiniMVC]]></description>
<long-description><![CDATA[<p>Convention-based micro-framework for PHP</p>]]></long-description>
<tag line="2" name="package" description="miniMVC"/>
<tag line="2" name="author" description="Timothy J. Warren"/>
<tag line="2" name="copyright" description="Copyright (c) 2011 - 2012"/>
<tag line="2" name="link" description="https://github.com/timw4mail/miniMVC" link="https://github.com/timw4mail/miniMVC"/>
<tag line="2" name="license" description="http://philsturgeon.co.uk/code/dbad-license"/>
</docblock>
<namespace-alias name="Generic">Generic</namespace-alias>
<function namespace="default" line="32" package="miniMVC">
<name>__construct</name>
<type>function</type>
<docblock line="26">
<description><![CDATA[Constructor for creating the objects]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="26" name="param" description="" type="array" variable="$members">
<type by_reference="false">array</type>
</tag>
<tag line="26" name="return" description="" type="void">
<type by_reference="false">void</type>
</tag>
</docblock>
<argument line="32">
<name>$members</name>
<default><![CDATA[[]]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="49" package="miniMVC">
<name>__call</name>
<type>function</type>
<docblock line="43">
<description><![CDATA[PHP magic method to facilitate dynamic methods]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="43" name="param" description="" type="string" variable="$name">
<type by_reference="false">string</type>
</tag>
<tag line="43" name="param" description="" type="array" variable="$params">
<type by_reference="false">array</type>
</tag>
</docblock>
<argument line="49">
<name>$name</name>
<default><![CDATA[]]></default>
<type/>
</argument>
<argument line="49">
<name>$params</name>
<default><![CDATA[[]]]></default>
<type/>
</argument>
</function>
</file>
<file path="sys/core/traits/Generic.php" hash="7938b5820dc4f793a1528615ffa3ece3" package="miniMVC">
<docblock line="2">
<description><![CDATA[MiniMVC]]></description>
<long-description><![CDATA[<p>Convention-based micro-framework for PHP</p>]]></long-description>
<tag line="2" name="package" description="miniMVC"/>
<tag line="2" name="author" description="Timothy J. Warren"/>
<tag line="2" name="copyright" description="Copyright (c) 2011 - 2012"/>
<tag line="2" name="link" description="https://github.com/timw4mail/miniMVC" link="https://github.com/timw4mail/miniMVC"/>
<tag line="2" name="license" description="http://philsturgeon.co.uk/code/dbad-license"/>
</docblock>
<function namespace="default" line="29" package="miniMVC">
<name>__toString</name>
<type>function</type>
<docblock line="24">
<description><![CDATA[Prints out the contents of the object when used as a string]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="24" name="return" description="" type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
</function>
<function namespace="default" line="78" package="miniMVC">
<name>__invoke</name>
<type>function</type>
<docblock line="73">
<description><![CDATA[PHP magic method that is called when an object is treated as a function]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="73" name="param" description="" type="array" variable="$args">
<type by_reference="false">array</type>
</tag>
</docblock>
<argument line="78">
<name>$args</name>
<default><![CDATA[[]]]></default>
<type/>
</argument>
</function>
</file>
<file path="sys/core/MM_Controller.php" hash="ee59441b55721d586c536f30372daa36" package="miniMVC">
<docblock line="2">
<description><![CDATA[MiniMVC]]></description>
@ -882,99 +1033,6 @@ Used for outputing HTML]]></description>
</method>
</class>
</file>
<file path="sys/core/traits.php" hash="54aa0589dea826a5a4db98f730f2392a" package="miniMVC">
<docblock line="2">
<description><![CDATA[MiniMVC]]></description>
<long-description><![CDATA[<p>Convention-based micro-framework for PHP</p>]]></long-description>
<tag line="2" name="package" description="miniMVC"/>
<tag line="2" name="author" description="Timothy J. Warren"/>
<tag line="2" name="copyright" description="Copyright (c) 2011 - 2012"/>
<tag line="2" name="link" description="https://github.com/timw4mail/miniMVC" link="https://github.com/timw4mail/miniMVC"/>
<tag line="2" name="license" description="http://philsturgeon.co.uk/code/dbad-license"/>
</docblock>
<namespace-alias name="Generic">Generic</namespace-alias>
<function namespace="default" line="31" package="miniMVC">
<name>__toString</name>
<type>function</type>
<docblock line="26">
<description><![CDATA[Prints out the contents of the object when used as a string]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="26" name="return" description="" type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
</function>
<function namespace="default" line="166" package="miniMVC">
<name>__invoke</name>
<type>function</type>
<docblock line="160">
<description><![CDATA[PHP magic method that is called when an object is treated as a function]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="160" name="param" description="" type="array" variable="$params">
<type by_reference="false">array</type>
</tag>
<tag line="160" name="return" description="" type="\self">
<type by_reference="false">\self</type>
</tag>
</docblock>
<argument line="166">
<name>$params</name>
<default><![CDATA[[]]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="158" package="miniMVC">
<name>__construct</name>
<type>function</type>
<docblock line="155">
<description><![CDATA[Protected constructor for creating the one instance]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</function>
<function namespace="default" line="124" package="miniMVC">
<name>__call</name>
<type>function</type>
<docblock line="118">
<description><![CDATA[PHP magic method to facilitate dynamic methods]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="118" name="param" description="" type="string" variable="$name">
<type by_reference="false">string</type>
</tag>
<tag line="118" name="param" description="" type="array" variable="$params">
<type by_reference="false">array</type>
</tag>
</docblock>
<argument line="124">
<name>$name</name>
<default><![CDATA[]]></default>
<type/>
</argument>
<argument line="124">
<name>$params</name>
<default><![CDATA[[]]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="178" package="miniMVC">
<name>get_instance</name>
<type>function</type>
<docblock line="173">
<description><![CDATA[Singleton getter function]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="173" name="return" description="" type="\self">
<type by_reference="false">\self</type>
</tag>
</docblock>
</function>
<function namespace="default" line="195" package="miniMVC">
<name>__clone</name>
<type>function</type>
<docblock line="192">
<description><![CDATA[Magic function called when cloning an object]]></description>
<long-description><![CDATA[]]></long-description>
</docblock>
</function>
</file>
<file path="sys/core/miniMVC.php" hash="0952b658ffbf7f7b39c41df1bdd38b3b" package="miniMVC">
<docblock line="2">
<description><![CDATA[MiniMVC]]></description>
@ -1393,7 +1451,7 @@ of the singleton]]></description>
</method>
</class>
</file>
<file path="sys/common.php" hash="91bd77f4ef88b10ac4ff9c2b8f32c926" package="miniMVC">
<file path="sys/common.php" hash="f99fe521580d225fb4a92e8d7df92294" package="miniMVC">
<docblock line="2">
<description><![CDATA[MiniMVC]]></description>
<long-description><![CDATA[<p>Convention-based micro-framework for PHP</p>]]></long-description>
@ -1417,251 +1475,251 @@ of the singleton]]></description>
<type/>
</argument>
</function>
<function namespace="default" line="50" package="miniMVC">
<function namespace="default" line="54" package="miniMVC">
<name>autoload</name>
<type>function</type>
<docblock line="45">
<docblock line="49">
<description><![CDATA[Function to autoload libraries/classes]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="45" name="param" description="string" type="" variable="$name"/>
<tag line="49" name="param" description="string" type="" variable="$name"/>
</docblock>
<argument line="50">
<argument line="54">
<name>$name</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="89" package="miniMVC">
<function namespace="default" line="93" package="miniMVC">
<name>shutdown</name>
<type>function</type>
<docblock line="82">
<docblock line="86">
<description><![CDATA[Function to run on script shutdown
-used to catch most fatal errors, and
display them cleanly]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="82" name="return" description="" type="void">
<tag line="86" name="return" description="" type="void">
<type by_reference="false">void</type>
</tag>
</docblock>
</function>
<function namespace="default" line="122" package="miniMVC">
<function namespace="default" line="126" package="miniMVC">
<name>on_error</name>
<type>function</type>
<docblock line="113">
<docblock line="117">
<description><![CDATA[Custom error handler]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="113" name="param" description="" type="int" variable="$severity">
<tag line="117" name="param" description="" type="int" variable="$severity">
<type by_reference="false">int</type>
</tag>
<tag line="113" name="param" description="" type="string" variable="$message">
<tag line="117" name="param" description="" type="string" variable="$message">
<type by_reference="false">string</type>
</tag>
<tag line="113" name="param" description="" type="string" variable="$filepath">
<tag line="117" name="param" description="" type="string" variable="$filepath">
<type by_reference="false">string</type>
</tag>
<tag line="113" name="param" description="" type="int" variable="$line">
<tag line="117" name="param" description="" type="int" variable="$line">
<type by_reference="false">int</type>
</tag>
<tag line="113" name="return" description="" type="\ErrorException">
<tag line="117" name="return" description="" type="\ErrorException">
<type by_reference="false">\ErrorException</type>
</tag>
</docblock>
<argument line="122">
<argument line="126">
<name>$severity</name>
<default><![CDATA[]]></default>
<type/>
</argument>
<argument line="122">
<argument line="126">
<name>$message</name>
<default><![CDATA[]]></default>
<type/>
</argument>
<argument line="122">
<argument line="126">
<name>$filepath</name>
<default><![CDATA[]]></default>
<type/>
</argument>
<argument line="122">
<argument line="126">
<name>$line</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="135" package="miniMVC">
<function namespace="default" line="139" package="miniMVC">
<name>on_exception</name>
<type>function</type>
<docblock line="129">
<docblock line="133">
<description><![CDATA[Custom exception handlererror_get_last]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="129" name="param" description="" type="\Exception" variable="$exception">
<tag line="133" name="param" description="" type="\Exception" variable="$exception">
<type by_reference="false">\Exception</type>
</tag>
<tag line="129" name="return" description="" type="void">
<tag line="133" name="return" description="" type="void">
<type by_reference="false">void</type>
</tag>
</docblock>
<argument line="135">
<argument line="139">
<name>$exception</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="157" package="miniMVC">
<function namespace="default" line="161" package="miniMVC">
<name>show_404</name>
<type>function</type>
<docblock line="152">
<docblock line="156">
<description><![CDATA[General 404 function]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="152" name="return" description="" type="void">
<tag line="156" name="return" description="" type="void">
<type by_reference="false">void</type>
</tag>
</docblock>
</function>
<function namespace="default" line="182" package="miniMVC">
<function namespace="default" line="186" package="miniMVC">
<name>show_error</name>
<type>function</type>
<docblock line="176">
<docblock line="180">
<description><![CDATA[Fatal Error page function]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="176" name="param" description="" type="string" variable="$message">
<tag line="180" name="param" description="" type="string" variable="$message">
<type by_reference="false">string</type>
</tag>
<tag line="176" name="param" description="" type="int" variable="$status_code">
<tag line="180" name="param" description="" type="int" variable="$status_code">
<type by_reference="false">int</type>
</tag>
</docblock>
<argument line="182">
<argument line="186">
<name>$message</name>
<default><![CDATA[]]></default>
<type/>
</argument>
<argument line="182">
<argument line="186">
<name>$status_code</name>
<default><![CDATA[null]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="209" package="miniMVC">
<function namespace="default" line="213" package="miniMVC">
<name>is_like_array</name>
<type>function</type>
<docblock line="203">
<docblock line="207">
<description><![CDATA[Utility function to check if a variable is set, and is an array or object]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="203" name="param" description="" type="mixed" variable="$var">
<tag line="207" name="param" description="" type="mixed" variable="$var">
<type by_reference="false">mixed</type>
</tag>
<tag line="203" name="return" description="" type="bool">
<tag line="207" name="return" description="" type="bool">
<type by_reference="false">bool</type>
</tag>
</docblock>
<argument line="209">
<argument line="213">
<name>$var</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="227" package="miniMVC">
<function namespace="default" line="231" package="miniMVC">
<name>controller_methods</name>
<type>function</type>
<docblock line="221">
<docblock line="225">
<description><![CDATA[Returns routable methods for the specified controller class]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="221" name="param" description="" type="string" variable="$controller">
<tag line="225" name="param" description="" type="string" variable="$controller">
<type by_reference="false">string</type>
</tag>
<tag line="221" name="return" description="" type="array">
<tag line="225" name="return" description="" type="array">
<type by_reference="false">array</type>
</tag>
</docblock>
<argument line="227">
<argument line="231">
<name>$controller</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="246" package="miniMVC">
<function namespace="default" line="250" package="miniMVC">
<name>site_url</name>
<type>function</type>
<docblock line="240">
<docblock line="244">
<description><![CDATA[Returns a full url from a url segment]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="240" name="param" description="" type="string" variable="$segment">
<tag line="244" name="param" description="" type="string" variable="$segment">
<type by_reference="false">string</type>
</tag>
<tag line="240" name="return" description="" type="string">
<tag line="244" name="return" description="" type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
<argument line="246">
<argument line="250">
<name>$segment</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="260" package="miniMVC">
<function namespace="default" line="264" package="miniMVC">
<name>to_string</name>
<type>function</type>
<docblock line="253">
<docblock line="257">
<description><![CDATA[Prints out the contents of the object]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="253" name="param" description="" type="\object/array" variable="$data">
<tag line="257" name="param" description="" type="\object/array" variable="$data">
<type by_reference="false">\object/array</type>
</tag>
<tag line="253" name="param" description="" type="string" variable="$method">
<tag line="257" name="param" description="" type="string" variable="$method">
<type by_reference="false">string</type>
</tag>
<tag line="253" name="return" description="" type="string">
<tag line="257" name="return" description="" type="string">
<type by_reference="false">string</type>
</tag>
</docblock>
<argument line="260">
<argument line="264">
<name>$data</name>
<default><![CDATA[]]></default>
<type/>
</argument>
<argument line="260">
<argument line="264">
<name>$method</name>
<default><![CDATA['print_r']]></default>
<type/>
</argument>
</function>
<function namespace="default" line="296" package="miniMVC">
<function namespace="default" line="300" package="miniMVC">
<name>do_include</name>
<type>function</type>
<docblock line="290">
<docblock line="294">
<description><![CDATA[Array_map callback to load a folder of classes at once]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="290" name="param" description="" type="string" variable="$path">
<tag line="294" name="param" description="" type="string" variable="$path">
<type by_reference="false">string</type>
</tag>
<tag line="290" name="return" description="" type="void">
<tag line="294" name="return" description="" type="void">
<type by_reference="false">void</type>
</tag>
</docblock>
<argument line="296">
<argument line="300">
<name>$path</name>
<default><![CDATA[]]></default>
<type/>
</argument>
</function>
<function namespace="default" line="311" package="miniMVC">
<function namespace="default" line="315" package="miniMVC">
<name>init</name>
<type>function</type>
<docblock line="306">
<docblock line="310">
<description><![CDATA[Load required classes for bootstraping]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="306" name="return" description="" type="void">
<tag line="310" name="return" description="" type="void">
<type by_reference="false">void</type>
</tag>
</docblock>
</function>
<function namespace="default" line="342" package="miniMVC">
<function namespace="default" line="345" package="miniMVC">
<name>route</name>
<type>function</type>
<docblock line="337">
<docblock line="340">
<description><![CDATA[Calls the appropriate module/controller/function based on the url]]></description>
<long-description><![CDATA[]]></long-description>
<tag line="337" name="return" description="" type="void">
<tag line="340" name="return" description="" type="void">
<type by_reference="false">void</type>
</tag>
</docblock>

View File

@ -30,14 +30,18 @@
* @param string
*/
function sys_autoload($name)
{
{
$path = MM_SYS_PATH . "/core/{$name}.php";
$trait_path = MM_SYS_PATH . "/core/traits/{$name}.php";
if (is_file($path))
{
require_once($path);
}
elseif (is_file($trait_path))
{
require_once($trait_path);
}
}
// --------------------------------------------------------------------------
@ -321,8 +325,7 @@ function init()
// Load Database classes
require_once(MM_SYS_PATH . 'db/autoload.php');
// Load system libraries
require_once(MM_SYS_PATH . 'core/traits.php');
// Load system libraries/traits
spl_autoload_register('sys_autoload');
// Start the library autoloader

View File

@ -1,201 +0,0 @@
<?php
/**
* MiniMVC
*
* Convention-based micro-framework for PHP
*
* @package miniMVC
* @author Timothy J. Warren
* @copyright Copyright (c) 2011 - 2012
* @link https://github.com/timw4mail/miniMVC
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
// ! Generic Trait
// --------------------------------------------------------------------------
/**
* Simple Trait to include the toString() magic method
*
* @package miniMVC
* @subpackage System
*/
trait Generic {
/**
* Prints out the contents of the object when used as a string
*
* @return string
*/
public function __toString()
{
if (ENVIRONMENT == 'DEVELOPMENT')
{
$args = func_get_args();
$method = ( ! empty($args)) ? $args[0] : "print_r";
$data = (isset($args[1])) ? $args[1] : [];
if (empty($data))
{
$data =& $this;
}
$output = '<pre>';
if ($method == "var_dump")
{
ob_start();
var_dump($data);
$output .= ob_get_contents();
ob_end_clean();
}
elseif ($method == "var_export")
{
ob_start();
var_export($data);
$output .= ob_get_contents();
ob_end_clean();
}
else
{
$output .= print_r($data, TRUE);
}
return $output . '</pre>';
}
else
{
return '';
}
}
// --------------------------------------------------------------------------
/**
* PHP magic method that is called when an object is treated as a function
*
* @param array $args
*/
public static function __invoke($args = [])
{
$class = __CLASS__;
return new $class($args);
}
}
// --------------------------------------------------------------------------
// ! JSObject Trait
// --------------------------------------------------------------------------
/**
* Parent trait of base class, contains much of the magic
*
* @package miniMVC
* @subpackage System
*/
trait JSObject {
use Generic;
/**
* Constructor for creating the objects
*
* @param array $members
* @return void
*/
public function __construct($members = [])
{
// Add the passed parameters to the object
foreach($members as $name => &$value)
{
$this->$name = $value;
}
}
// --------------------------------------------------------------------------
/**
* PHP magic method to facilitate dynamic methods
*
* @param string $name
* @param array $params
*/
public function __call($name, $params = [])
{
if (is_callable($this->$name))
{
//Call the dynamic function
return call_user_func_array($this->$name, $params);
}
}
}
// --------------------------------------------------------------------------
// ! Singleton Trait
// --------------------------------------------------------------------------
/**
* Singleton pattern
*
* @package miniMVC
* @subpackage System
*/
trait Singleton {
use Generic;
/**
* Singleton object
*
* @var self
*/
protected static $instance;
/**
* Protected constructor for creating the one instance
*/
abstract protected function __construct();
/**
* PHP magic method that is called when an object is treated as a function
*
* @param array $params
* @return self
*/
public static function __invoke($params = [])
{
return self::get_instance($params);
}
// --------------------------------------------------------------------------
/**
* Singleton getter function
*
* @return self
*/
public static function &get_instance()
{
if ( ! isset(self::$instance))
{
$class = __CLASS__;
self::$instance = new $class;
}
return self::$instance;
}
// --------------------------------------------------------------------------
/**
* Magic function called when cloning an object
*/
public function __clone()
{
trigger_error('Clone is not allowed.', E_USER_ERROR);
}
}
// End of traits.php

View File

@ -0,0 +1,85 @@
<?php
/**
* MiniMVC
*
* Convention-based micro-framework for PHP
*
* @package miniMVC
* @author Timothy J. Warren
* @copyright Copyright (c) 2011 - 2012
* @link https://github.com/timw4mail/miniMVC
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
/**
* Simple Trait to include most useful default methods
*
* @package miniMVC
* @subpackage System
*/
trait Generic {
/**
* Prints out the contents of the object when used as a string
*
* @return string
*/
public function __toString()
{
if (ENVIRONMENT == 'DEVELOPMENT')
{
$args = func_get_args();
$method = ( ! empty($args)) ? $args[0] : "print_r";
$data = (isset($args[1])) ? $args[1] : [];
if (empty($data))
{
$data =& $this;
}
$output = '<pre>';
if ($method == "var_dump")
{
ob_start();
var_dump($data);
$output .= ob_get_contents();
ob_end_clean();
}
elseif ($method == "var_export")
{
ob_start();
var_export($data);
$output .= ob_get_contents();
ob_end_clean();
}
else
{
$output .= print_r($data, TRUE);
}
return $output . '</pre>';
}
else
{
return '';
}
}
// --------------------------------------------------------------------------
/**
* PHP magic method that is called when an object is treated as a function
*
* @param array $args
*/
public static function __invoke($args = [])
{
$class = __CLASS__;
return new $class($args);
}
}
// End of Generic.php

View File

@ -0,0 +1,59 @@
<?php
/**
* MiniMVC
*
* Convention-based micro-framework for PHP
*
* @package miniMVC
* @author Timothy J. Warren
* @copyright Copyright (c) 2011 - 2012
* @link https://github.com/timw4mail/miniMVC
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
/**
* Parent trait of base class, contains much of the magic
*
* @package miniMVC
* @subpackage System
*/
trait JSObject {
use Generic;
/**
* Constructor for creating the objects
*
* @param array $members
* @return void
*/
public function __construct($members = [])
{
// Add the passed parameters to the object
foreach($members as $name => &$value)
{
$this->$name = $value;
}
}
// --------------------------------------------------------------------------
/**
* PHP magic method to facilitate dynamic methods
*
* @param string $name
* @param array $params
*/
public function __call($name, $params = [])
{
if (is_callable($this->$name))
{
//Call the dynamic function
return call_user_func_array($this->$name, $params);
}
}
}
// End of JSObject.php

View File

@ -0,0 +1,79 @@
<?php
/**
* MiniMVC
*
* Convention-based micro-framework for PHP
*
* @package miniMVC
* @author Timothy J. Warren
* @copyright Copyright (c) 2011 - 2012
* @link https://github.com/timw4mail/miniMVC
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
/**
* Singleton pattern
*
* @package miniMVC
* @subpackage System
*/
trait Singleton {
use Generic;
/**
* Singleton object
*
* @var self
*/
protected static $instance;
/**
* Protected constructor for creating the one instance
*/
abstract protected function __construct();
/**
* PHP magic method that is called when an object is treated as a function
*
* @param array $params
* @return self
*/
public static function __invoke($params = [])
{
return self::get_instance($params);
}
// --------------------------------------------------------------------------
/**
* Singleton getter function
*
* @return self
*/
public static function &get_instance()
{
if ( ! isset(self::$instance))
{
$class = __CLASS__;
self::$instance = new $class;
}
return self::$instance;
}
// --------------------------------------------------------------------------
/**
* Magic function called when cloning an object
*/
public function __clone()
{
trigger_error('Clone is not allowed.', E_USER_ERROR);
}
}
// End of Singleton.php