public static function init()
 {
     self::$taskDbFolder = DFPath('plugins.taskmanager.taskDb');
     self::loadTaskDb();
     self::mkTaskList();
     self::execTaskList();
 }
 function __construct()
 {
     $this->setTemplateResource(DFPath('app.view.templates', 'test.html', false));
     //sets the template file to be used as template
     $this->model = new homeModel();
     //starts the model component that contains the template context
     $this->setTemplateAdapter($this->model->context);
 }
 static function loadList()
 {
     $mainFile = 'main.plugin';
     //i should force the developer to use main.plugin.php by default
     $includes = array();
     foreach (DSettings::$pluginList as $key => $val) {
         if ($val['active']) {
             $includes[] = DFPath('plugins.' . $key, $mainFile);
         }
     }
     foreach ($includes as $k) {
         include_once $k;
     }
 }
 /**
  * The connect() method is the one that actually processes the request and passes control to the 
  * requested app's view component
  */
 private function connect()
 {
     $get = new DArray($_GET);
     //just wana show off the DArray a bit <_<
     //if they dont ask for an action, show them the index page
     $page = $get->hasKey('action') ? $get->get($key) : DSettings::$defaultPages['index_action'];
     foreach (DSettings::$pages as $p) {
         if ($p['action'] == $page) {
             $page = $p['path'];
             break 1;
         } else {
             $page = '';
         }
     }
     include_once DFPath('app.view', !empty($page) ? $page : DSettings::$defaultPages['notFound_action'], false);
     //cos the choice of file type isnt limited to .php alone
 }
 /**
  * ----------------------
  * <b>This method autoloads the necessary scripts needed as directed</b><br/>
  *      the method recieves 5 different autoload constant directives in in its <i>$flag</i> parameter
  * <br/>
  *       <b>1. <tt>D_AUTOLOAD_APP</tt></b>
  *       <ul>
  *          <li>
  *              Passing this constant along with the hook causes a model and handler class of the hook to be created.
  *          </li>
  *          <li>
  *              The constant can only be used in the app's view class as it only loads the model and handler components
  *          </li>
  *      </ul>
  *      <tt>For example: <b> DAmmyCore::autoloadScripts(D_AUTOLOAD_APP, 'home'); </b><br/>
  *          if this statement is written in a view component script, <br/>
  *          - home.model.php is first loaded<br/>
  *          - then home.handler.php is loaded finally<br/>
  *      </tt>
  * <br/>
  *       <b>2. <tt>D_AUTOLOAD_HANDLER</tt></b>
  *       <ul>
  *          <li>
  *              Passing this constant along with the hook causes a handler class of the hook to be created.
  *          </li>
  *          <li>
  *              The constant may be used in any component where the handler component is needed.
  *          </li>
  *      </ul>
  *      <tt>For example: <b> DAmmyCore::autoloadScripts(D_AUTOLOAD_HANDLER, 'home'); </b><br/>
  *          if this statement is written in any component script, <br/>
  *          - home.handler.php is loaded<br/>
  *      </tt>
  * <br/>
  *       <b>3. <tt>D_AUTOLOAD_MODEL</tt></b>
  *       <ul>
  *          <li>
  *              Passing this constant along with the hook causes a model class of the hook to be created.
  *          </li>
  *          <li>
  *              The constant may be used in any component where the model component is needed.
  *          </li>
  *      </ul>
  *      <tt>For example: <b> DAmmyCore::autoloadScripts(D_AUTOLOAD_MODEL, 'home'); </b>
  *          if this statement is written in any component script, <br/>
  *          - home.model.php is loaded<br/>
  *      </tt>
  * 
  * @param constant $flag Can contain either of the D_AUTOLOAD_* variant constants
  * @param string $hook the name of the hook you wana use to create the component parts
  */
 public static function autoloadScripts($flag, $hook = NULL)
 {
     $scriptList = array();
     if ($flag == D_AUTOLOAD_DEFAULT) {
         $scriptList = array(DFPath('lib.util', 'DRequest'), DFPath('lib.util', 'DSecurity'), DFPath('lib.util.extras', 'DCoreExtras'));
         if (!empty(DSettings::$useFrameworkExtras)) {
             foreach (array_keys(DSettings::$useFrameworkExtras) as $key) {
                 if (DSettings::$useFrameworkExtras[$key] !== false) {
                     $scriptList[] = DFPath('lib.util.extras', $key);
                 }
             }
         }
         if (DSettings::$enablePlugins) {
             $scriptList[] = DFPath('plugins', 'DMainPlugin');
         }
         if (DSettings::$databaseConfig['active'] === true) {
             foreach (DSettings::$databaseConfig['dbDrivers'] as $k => $v) {
                 if ($v === true) {
                     $scriptList[] = DFPath('lib.io', $k);
                 }
             }
         }
     } elseif ($flag == D_AUTOLOAD_APP && $hook != NULL) {
         //can oly be used in the view class to load the handler and model of the view name
         $scriptList[] = DFPath('lib.abstract', 'DHandler');
         $scriptList[] = DFPath('app.handler', $hook . '.handler');
         $scriptList[] = DFPath('lib.util', 'DTemplate');
         $scriptList[] = DFPath('lib.abstract', 'DModel');
         $scriptList[] = DFPath('app.model', $hook . '.model');
         $scriptList[] = DFPath('lib.abstract', 'DView');
     } elseif ($flag == D_AUTOLOAD_HANDLER && $hook != NULL) {
         //loads the handler and its abstract
         $scriptList[] = DFPath('lib.abstract', 'DHandler');
         $scriptList[] = DFPath('app.handler', $hook . '.handler');
     } elseif ($flag == D_AUTOLOAD_MODEL && $hook != NULL) {
         //loads the model and its abstract
         $scriptList[] = DFPath('lib.util', 'DTemplate');
         $scriptList[] = DFPath('lib.abstract', 'DModel');
         $scriptList[] = DFPath('app.model', $hook . '.model');
     } elseif ($flag == D_AUTOLOAD_VIEW && $hook != NULL) {
         //load the view's abstract
         $scriptList[] = DFPath('lib.abstract', 'DVIew');
     }
     foreach ($scriptList as $k) {
         //the scripts are included in top to down order
         include_once $k;
     }
 }
 public static function init()
 {
     self::$config = array('cacheFolder' => DFPath('res.cache'), 'cacheThreshold' => 3, 'cachePrefix' => 'cache-');
 }