Esempio n. 1
0
 /**
  * Gets the object named as in the arguments.<br />
  * The name of the object is stranslated to start with SH_PREFIX.
  * @param string $objectName The name of the object, starting with SH_PREFIX or not
  * @return object|boolean
  * <ul><li>The object that was asked for.</li>
  * <li>False if none was found.</li></ul>
  */
 public function __get($objectName)
 {
     $objectName = $this->cleanObjectName($objectName);
     if (isset($this->{$objectName}) && is_object($this->{$objectName})) {
         return $this->{$objectName};
     }
     if (method_exists($objectName, 'getInstance')) {
         $object = $objectName::getInstance($objectName);
         $this->{$objectName} = $object;
         $object->construct();
         $this->objects[$objectName] = $object;
         return $object;
     }
     echo __CLASS__ . '::' . __LINE__ . ' : The class ' . $objectName . ' does not exist or doesn\'t have a getInstance() static method.<br />';
     if ($this->admin->isAdmin(true)) {
         $debugger = new sh_debugger();
         $debugger->xdebug(__FILE__ . ' : ' . __LINE__);
     }
     return null;
 }
Esempio n. 2
0
 protected function xdebug($text = '')
 {
     return $this->debugger->xdebug($text);
 }