Example #1
0
 /**
  * コンポーネントの作成
  *
  * @param string $componentName
  * @param string $registerName
  * @return Object
  */
 public function create($componentName, $registerName = '')
 {
     $componentName = str_replace('.', '\\', $componentName);
     if (strlen($registerName) > 0) {
         $registerName = str_replace('.', '\\', $registerName);
     } else {
         $registerName = $componentName;
     }
     // コンポーネントが既に存在する場合はここでリターン
     if (is_object($this->get($registerName))) {
         return $this->get($registerName);
     }
     $obj = Object::build($componentName);
     if ($obj instanceof Singleton) {
         $this->register($obj, $registerName);
     }
     return $obj;
 }
Example #2
0
 public static function exec($obj, $methodName)
 {
     return Builder::execMethod($obj, $methodName);
 }