2012-09-22 4 views
1

저는 Zend Framework 1.11과 Propel ORM을 함께 사용하여 새롭고 매우 간단합니다. 아주 간단한경고 : require_once (phing/BuildException.php) : 스트림을 열지 못했습니다.

Warning: require_once(phing/BuildException.php): failed to open stream: No such file or directory in /var/projects/library/vendor/propel/propel1/generator/lib/exception/EngineException.php on line 11

Fatal error: require_once(): Failed opening required 'phing/BuildException.php' (include_path='/var/projects/fle-portal/application/models/propel:/var/projects/fle-portal/application/../library:/var/projects/library/vendor/zendframework/zendframework1/library:/var/projects/library/vendor/propel/propel1/runtime/lib:/var/projects/library/vendor/propel/propel1/generator/lib:/var/projects/library:.:/usr/share/php:/usr/share/pear') in /var/projects/library/vendor/propel/propel1/generator/lib/exception/EngineException.php on line 11

내 DomainController 선택 IndexAction입니다 : 여기에 URL을 http://fle.localhost/domain에 오류가 있습니다

public function indexAction() 
{ 
    $this->view->messages = $this->_helper->flashMessenger->getMessages(); 
    $this->view->collDomains = Domain::getAll(); 
} 

이 하나가 Domain.php에서 추진 객체 클래스를 호출 :

<?php 

/** 
* Skeleton subclass for representing a row from the 'domain' table. 
* 
* You should add additional methods to this class to meet the application requirements. 
* This class will only be generated as long as it does not already exist in the output 
* directory. 
* @package propel.generator.fleazup 
*/ 
class Domain extends BaseDomain 
{ 
    public static function getAll() 
    { 
     return DomainPeer::doSelect(new Criteria()); 
    } 
} 

또한보기에서 어려운 것도 없습니다. views/script/domain/index.phtml :

<!-- CONDITION: if there are domains --> 
<?php 
if (!empty($this->collDomains)): 
?> 

     <!-- if condition ok, display domains table --> 
      <!-- Page header --> 
      <div class="row"> 
       <div class="span12"> 
        <div class="page-header"> 
         <h1>Domains List</h1> 
        </div> 
       </div> 
      </div> 

      <!-- Flash messages --> 
      <div> 
       <?php if (count($this->messages)) : ?> 

        <div class="alert alert-info"> 
         <a class="close" data-dismiss="alert" href="#">×</a> 
         <ul id="messages"> 
          <?php foreach ($this->messages as $message) : ?> 
           <li><?php echo $this->escape($message); ?></li> 
          <?php endforeach; ?> 
         </ul> 
        </div> 
       <?php endif; ?> 
      </div> 

      <!-- Link to add action --> 
      <div> 
       <p><a href="<?php echo $this->url(array('controller'=>'domain', 'action'=>'add'));?>">Add a new domain</a></p> 
      </div> 

      <!-- domains table --> 
      <table class="table table-striped"> 
       <thead> 
        <tr> 
         <th>Id</th> 
         <th>Label</th> 
         <th>Actions</th> 
        </tr> 
       </thead> 

       <tbody> 
        <?php foreach ($this->collDomains as $domain): ?> 
        <tr> 
         <td><?php echo $this->escape($domain->getId()) ?></td> 
         <td><?php echo $this->escape($domain->getLabel()) ?></td> 
         <td> 
          <a href="<?php echo $this->url(array('controller'=>'domain', 'action'=>'modify', 'id'=>$this->escape($domain->getId())));?>">Modify</a> 
          <a href="<?php echo $this->url(array('controller'=>'domain', 'action'=>'delete', 'id'=>$this->escape($domain->getId())));?>">Delete</a> 
         </td> 
        </tr> 
        <?php endforeach; ?> 
       </tbody> 
      </table> 

     <!-- If condition KO --> 
     <?php else: ?> 
      <!-- Page header --> 
      <div class="row"> 
       <div class="span12"> 
        <div class="page-header"> 
         <h1>Domains List</h1> 
        </div> 
       </div> 
      </div> 

      <!-- Link to add action --> 
      <div> 
       <p><a href="<?php echo $this->url(array('controller'=>'domain', 'action'=>'add'));?>">Add a new domain</a></p> 
      </div> 

      <!-- Message --> 
      <p>No domain to display.</p> 

    <!-- End of condition -->   
    <?php endif; ?> 

내가 이해할 수없는 것은 내가 2 개의 다른 대상과 정확히 동일하게 잘 작동한다는 것입니다. 도메인 객체에 대해서만 오류가 발생합니다 ...

어디에서 오류가 발생한다고 생각합니까? 핑 구성? Propel 설정? 코드? 나를 도울 생각이 있으십니까?

답변

0

require_once(phing/BuildException.php): failed to open stream: No such file or directory

이것은 사용자의 문제입니다. 파일이 있어야하며 존재하지 않는 이유를 찾아야합니다.

1

이것은 Propel이 생성 한 모델 클래스 Domainthe generator/lib/model folder에 동일한 이름을 가진 Propel 공급 업체 클래스 사이에 충돌이있는 문제입니다.

실제로 발생한 오류는 컨텍스트에서 실행되는 Propel 공급 업체 클래스에 의해 트리거되기 때문에 오도 된 것입니다. 코드에서 Domain::getAll()을 시도하면 getAll() 메서드가 없기 때문에 Propel 공급 업체 클래스는 예외를 throw합니다. 하지만 phing/BuildException.php이 포함 경로 (컨텍스트 문제)에 없으므로 처음에는 예외가 표시되지 않습니다. 이것이 초기 오류가 발생한 이유입니다. 까다로운 일의 종류, 나는 고백한다.

생성 된 개체의 접두어로이 문제를 해결할 수 있습니다. 이렇게하려면 build.properties 파일 (read the Propel documentation on Customizing Generated Object Model)에 propel.classPrefix 속성을 설정하고 개체 모델을 다시 작성하십시오. 그러나주의 깊게 코드를 수정해야합니다.

+0

작곡가 오토로더로 전환했을 때도 똑같은 문제가 발생했습니다. 내 이름 충돌은 내 검색 색인 클래스'색인'이었습니다. –

관련 문제