警告:require_once(phing/BuildException.php):无法打开流

警告:require_once(phing/BuildException.php):无法打开流,php,zend-framework,propel,phing,Php,Zend Framework,Propel,Phing,我刚开始使用Zend Framework 1.11和推进ORM,我遇到了一个非常简单的问题。以下是url上的错误: 警告:require_once(phing/BuildException.php):无法打开 流:中没有这样的文件或目录 /var/projects/library/vendor/propel/propel1/generator/lib/exception/EngineException.php 第11行 致命错误:require_once():无法打开所需文件 'phing/Bu

我刚开始使用Zend Framework 1.11和推进ORM,我遇到了一个非常简单的问题。以下是url上的错误:

警告:require_once(phing/BuildException.php):无法打开 流:中没有这样的文件或目录 /var/projects/library/vendor/propel/propel1/generator/lib/exception/EngineException.php 第11行

致命错误:require_once():无法打开所需文件 'phing/BuildException.php' (包括_path='/var/projects/fle portal/application/models/prople:/var/projects/fle portal/application/。/library:/var/projects/library/vendor/zendframework/zendframework1/library:/var/projects/propel1/runtime/lib:/var/projects/library/ventor/lib:/var/projects/projects/generator/lib:/var/projects/library:://usr/share/php:/usr/share/pear') 在里面 /var/projects/library/vendor/propel/propel1/generator/lib/exception/EngineException.php 第11行

我的DomainController索引非常简单:

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());
    }
}

域列表

身份证件 标签 行动 域列表

没有要显示的域

我不明白的是,我对另外两个对象做了完全相同的操作,效果非常好。我只得到域对象的错误

你认为错误来自哪里?Phing配置?推进配置?密码? 有什么办法帮我吗

require_once(phing/BuildException.php):无法打开流:没有这样的文件或目录

这是你的问题。该文件应该存在,您需要找出它不存在的原因

require_once(phing/BuildException.php):无法打开流:没有这样的文件或目录


这是你的问题。该文件应该存在,您需要找出它不存在的原因。

这是您自己生成的推进模型类
与中具有相同名称的推进供应商类之间存在冲突的问题

事实上,引发的错误具有误导性,因为它是由在上下文之外执行的Propel vendor类触发的。当代码尝试
Domain::getAll()
时,由于方法
getAll()
不存在,Propel vendor类会引发异常。但是,一开始无法看到该异常,因为
phing/BuildException.php
不在包含路径上(上下文问题):这就是发生初始错误的原因。我承认这有点棘手


您可以在为生成的对象添加前缀时解决此问题。为此,请将
spreep.classPrefix
属性设置到
build.properties
文件()中,然后重新生成对象模型。但是要小心,您必须相应地修改代码。

这是您自己的Prope生成模型类
与中具有相同名称的Prope供应商类之间的冲突问题

事实上,引发的错误具有误导性,因为它是由在上下文之外执行的Propel vendor类触发的。当代码尝试
Domain::getAll()
时,由于方法
getAll()
不存在,Propel vendor类会引发异常。但是,一开始无法看到该异常,因为
phing/BuildException.php
不在包含路径上(上下文问题):这就是发生初始错误的原因。我承认这有点棘手


您可以在为生成的对象添加前缀时解决此问题。为此,请将
spreep.classPrefix
属性设置到
build.properties
文件()中,然后重新生成对象模型。不过要小心,您必须相应地修改代码。

我刚切换到composer autoloader时遇到了同样的问题。我的命名冲突是我的搜索索引类
索引
。当我切换到composer autoloader时遇到了同样的问题。我的命名冲突是我的搜索索引类
索引
<!-- 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; ?>