Beispiel #1
0
 public static function registerObject($passedObjectParam)
 {
     if (self::$objRegisteredExecutors == NULL) {
         self::$objRegisteredExecutors = new A();
     }
     if ($passedObjectParam != NULL) {
         if (is_object($passedObjectParam)) {
             self::$objRegisteredExecutors[] = $passedObjectParam;
         } else {
             if (self::checkCanOutputErrorScreen()->toBoolean()) {
                 self::renderScreenOfDeath(new S(__CLASS__), new S(VAR_NOT_OBJECT), new S(VAR_NOT_OBJECT_FIX));
             } else {
                 throw new Exception(__CLASS__ . _DCSP . self::ARG_NOT_OBJECT);
             }
         }
     }
 }
Beispiel #2
0
// Include all developer files in DEVELOPER_DIR/DEVELOPER_HEADER;
$includeFiles = scandir(DOCUMENT_ROOT . DEVELOPER_DIR . _S . DEVELOPER_HEADER);
sort($includeFiles, SORT_STRING);
foreach ($includeFiles as $k => $v) {
    if ($v[0] != '.') {
        $f = DOCUMENT_ROOT . DEVELOPER_DIR . _S . DEVELOPER_HEADER . _S . $v;
        # Require ONCE;
        require_once $f;
    }
}
// We're done loading, we can make it work, now ... Yey!;
// We can either use these individual objects, to acces specific functions just from them, which should make the code
// a little bit clearer, or we can use the slower, object delegator that's setup below;
$URL = TheFactoryMethodOfSingleton::getInstance('URL');
$TPL = TheFactoryMethodOfSingleton::getInstance('TPL');
$SQL = TheFactoryMethodOfSingleton::getInstance('SQL');
$GPH = TheFactoryMethodOfSingleton::getInstance('GPH');
$FRM = TheFactoryMethodOfSingleton::getInstance('FRM');
$CNF = TheFactoryMethodOfSingleton::getInstance('CNF');
$MOD = TheFactoryMethodOfSingleton::getInstance('MOD');
### Make a common interface for ALL, with a delegator;
// Besides using each object, we can use ALL to map-out all objects in the framework;
// Because people are lazy, and they would usually want "one object to rule them all!";
$OBJ = new ObjectMethodDelegator();
$OBJ->registerObject($ERR);
$OBJ->registerObject($TPL);
$OBJ->registerObject($SQL);
$OBJ->registerObject($GPH);
$OBJ->registerObject($FRM);
$OBJ->registerObject($CNF);
$OBJ->registerObject($MOD);