Revert "Reworked Database stuff to be Datastore stuff"
This reverts commit ebd0018473
.
This commit is contained in:
parent
ebd0018473
commit
d25b042d8e
12 changed files with 180 additions and 170 deletions
|
@ -9,7 +9,7 @@
|
|||
* Redistribution of these files must retain the above copyright notice.
|
||||
*
|
||||
* @author Josh Sherman <pickles@joshtronic.com>
|
||||
* @copyright Copyright 2007-2013, Josh Sherman
|
||||
* @copyright Copyright 2007-2012, Josh Sherman
|
||||
* @license http://www.opensource.org/licenses/mit-license.html
|
||||
* @package PICKLES
|
||||
* @link https://github.com/joshtronic/pickles
|
||||
|
@ -18,13 +18,12 @@
|
|||
/**
|
||||
* Module Class
|
||||
*
|
||||
* This is a parent class that all PICKLES modules should be extending.
|
||||
* Each module can specify it's own meta data and whether or not a user
|
||||
* must be properly authenticated to view the page. Currently any pages
|
||||
* without a template are treated as pages being requested via AJAX and the
|
||||
* return will be JSON encoded. In the future this may need to be changed
|
||||
* out for logic that allows the requested module to specify what display
|
||||
* type(s) it can use.
|
||||
* This is a parent class that all PICKLES modules should be extending. Each
|
||||
* module can specify it's own meta data and whether or not a user must be
|
||||
* properly authenticated to view the page. Currently any pages without a
|
||||
* template are treated as pages being requested via AJAX and the return will
|
||||
* be JSON encoded. In the future this may need to be changed out for logic
|
||||
* that allows the requested module to specify what display type(s) it can use.
|
||||
*/
|
||||
class Module extends Object
|
||||
{
|
||||
|
@ -127,9 +126,9 @@ class Module extends Object
|
|||
/**
|
||||
* Hash
|
||||
*
|
||||
* Whether or not to validate the security hash. Boolean true will
|
||||
* indicate using the name of the module as the hash, a string value
|
||||
* will use the value instead.
|
||||
* Whether or not to validate the security hash. Boolean true will indicate
|
||||
* using the name of the module as the hash, a string value will use the
|
||||
* value instead.
|
||||
*
|
||||
* @access protected
|
||||
* @var string or boolean, null by default
|
||||
|
@ -150,10 +149,9 @@ class Module extends Object
|
|||
/**
|
||||
* Default Template
|
||||
*
|
||||
* Defaults to null but could be set to any valid template basename.
|
||||
* The value is overwritten by the config value if not set by the
|
||||
* module. The display engine determines what the file extension should
|
||||
* be.
|
||||
* Defaults to null but could be set to any valid template basename. The
|
||||
* value is overwritten by the config value if not set by the module. The
|
||||
* display engine determines what the file extension should be.
|
||||
*
|
||||
* @access protected
|
||||
* @var string, 'index' by default
|
||||
|
@ -165,8 +163,8 @@ class Module extends Object
|
|||
*
|
||||
* Array that is returned to the template in the case of the module not
|
||||
* returning anything itself. This is somewhat of a one way trip as you
|
||||
* cannot get the variable unless you reference the return array
|
||||
* explicitly $this->return['variable']
|
||||
* cannot get the variable unless you reference the return array explicitly
|
||||
* $this->return['variable']
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
|
@ -177,10 +175,9 @@ class Module extends Object
|
|||
* Constructor
|
||||
*
|
||||
* The constructor does nothing by default but can be passed a boolean
|
||||
* variable to tell it to automatically run the __default() method.
|
||||
* This is typically used when a module is called outside of the scope
|
||||
* of the controller (the registration page calls the login page in
|
||||
* this manner).
|
||||
* variable to tell it to automatically run the __default() method. This is
|
||||
* typically used when a module is called outside of the scope of the
|
||||
* controller (the registration page calls the login page in this manner.
|
||||
*
|
||||
* @param boolean $autorun optional flag to autorun __default()
|
||||
*/
|
||||
|
@ -189,7 +186,7 @@ class Module extends Object
|
|||
parent::__construct();
|
||||
|
||||
$this->cache = Cache::getInstance();
|
||||
$this->db = Datastore::getInstance();
|
||||
$this->db = Database::getInstance();
|
||||
|
||||
if ($autorun === true)
|
||||
{
|
||||
|
@ -201,10 +198,10 @@ class Module extends Object
|
|||
* Default "Magic" Method
|
||||
*
|
||||
* This function is overloaded by the module. The __default() method is
|
||||
* where you want to place any code that needs to be executed at
|
||||
* runtime. The reason the code isn't in the constructor is because the
|
||||
* module must be instantiated before the code is executed so that the
|
||||
* controller script is aware of the authentication requirements.
|
||||
* where you want to place any code that needs to be executed at runtime.
|
||||
* The reason the code isn't in the constructor is because the module must
|
||||
* be instantiated before the code is executed so that the controller
|
||||
* script is aware of the authentication requirements.
|
||||
*/
|
||||
public function __default()
|
||||
{
|
||||
|
@ -214,10 +211,9 @@ class Module extends Object
|
|||
/**
|
||||
* Magic Setter Method
|
||||
*
|
||||
* Places the variables that are being modified in the return array
|
||||
* that is returned if nothing is returned by the module itself. This
|
||||
* also prohibits the direct modification of module variables which
|
||||
* could cause issues.
|
||||
* Places the variables that are being modified in the return array that is
|
||||
* returned if nothing is returned by the module itself. This also prohibits
|
||||
* the direct modification of module variables which could cause issues.
|
||||
*
|
||||
* @param string $name name of the variable to be set
|
||||
* @param mixed $value value of the variable to be set
|
||||
|
@ -230,8 +226,8 @@ class Module extends Object
|
|||
/**
|
||||
* Magic Getter Method
|
||||
*
|
||||
* Attempts to load the module variable. If it's not set, will attempt
|
||||
* to load from the config.
|
||||
* Attempts to load the module variable. If it's not set, will attempt to
|
||||
* load from the config.
|
||||
*
|
||||
* @param string $name name of the variable requested
|
||||
* @return mixed value of the variable or boolean false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue