Пример #1
0
 private function loadTilesConfiguration()
 {
     $tilesConfigurer = ApplicationContext::getBean('tilesConfigurer');
     $arrDefinitionsPath = $tilesConfigurer->getDefinitions();
     foreach ($arrDefinitionsPath as $definitionPath) {
         if (!file_exists(DIR_ROOT . '/' . $definitionPath)) {
             throw new Exception('Tiles 정의 파일이 지정된 위치에 존재하지 않습니다.');
         }
         $xml = new SimpleXMLElement(DIR_ROOT . '/' . $definitionPath, NULL, TRUE);
         if (!isset($xml->definition)) {
             $xml = null;
             unset($xml);
             continue;
         }
         foreach ($xml->definition as $definition) {
             $name = (string) $definition['name'];
             $attributes = array();
             if (isset($definition->{'put-attribute'})) {
                 foreach ($definition->{'put-attribute'} as $putAttribute) {
                     $attributes[(string) $putAttribute['name']] = array('type' => isset($putAttribute['type']) ? (string) $putAttribute['type'] : 'template', 'value' => (string) $putAttribute['value']);
                 }
             }
             $this->_definitionMap[$name] = array('template' => isset($definition['template']) ? (string) $definition['template'] : null, 'extends' => isset($definition['extends']) ? (string) $definition['extends'] : null, 'attribute' => $attributes);
             $attributes = null;
             unset($attributes);
         }
     }
 }
Пример #2
0
 public function &__call($name, $arguments)
 {
     $method = $this->_ro->getMethod($name);
     // NOTE : 서비스 클래스에서만 사용한다고 가정하고.
     // 트랜잭션을 묶어주는 역할을 합니다.
     $dataSourceBean = ApplicationContext::getBean('dataSource');
     $dataSourceBean->getConnection()->startTrans();
     try {
         $result = $method->invokeArgs($this->_class, $arguments);
     } catch (Exception $ex) {
         $dataSourceBean->getConnection()->rollbackTrans();
         throw $ex;
         return;
     }
     $dataSourceBean->getConnection()->commitTrans();
     return $result;
 }
Пример #3
0
 /**
  * <pre>
  * 컨트롤러 초기화
  * </pre>
  */
 function init()
 {
     $this->_sysPropService = ApplicationContext::getBean("sysPropService");
     $this->_homeService = getClassNewInstance(new HomeServiceImpl());
     parent::init();
 }
Пример #4
0
 private function loadContextConfig($path)
 {
     if (!file_exists($path)) {
         throw new Exception('컨텍스트 설정 파일이 지정한 위치(' . $path . ')에 존재하지 않습니다.');
     }
     $this->_contextConfigLocation = $path;
     $xml = new SimpleXMLElement($this->_contextConfigLocation, NULL, TRUE);
     $arrBasePackage = array();
     $arrComponentScan = $xml->xpath('//context:component-scan');
     foreach ($arrComponentScan as $componentScan) {
         $arrBasePackage[] = (string) $componentScan['base-package'];
     }
     $arrComponentScan = null;
     unset($arrComponentScan);
     $arrBeans = array();
     $arrBean = $xml->bean;
     foreach ($arrBean as $bean) {
         $this->praseBeanNode($bean);
     }
     $arrBean = null;
     unset($arrBean);
     $arrInterceptors = $xml->xpath('//mvc:interceptors');
     if (sizeof($arrInterceptors) > 0 && isset($arrInterceptors[0]->bean)) {
         foreach ($arrInterceptors[0]->bean as $bean) {
             $this->praseBeanNode($bean);
         }
     }
     $arrInterceptors = null;
     unset($arrInterceptors);
     ksort($this->_viewResolverMap);
     ApplicationContext::setBeanFactory($this->_beanMap);
     $this->_contextComponentScan =& $arrBasePackage;
 }