<small id='TpqZJ'></small><noframes id='TpqZJ'>

    <i id='TpqZJ'><tr id='TpqZJ'><dt id='TpqZJ'><q id='TpqZJ'><span id='TpqZJ'><b id='TpqZJ'><form id='TpqZJ'><ins id='TpqZJ'></ins><ul id='TpqZJ'></ul><sub id='TpqZJ'></sub></form><legend id='TpqZJ'></legend><bdo id='TpqZJ'><pre id='TpqZJ'><center id='TpqZJ'></center></pre></bdo></b><th id='TpqZJ'></th></span></q></dt></tr></i><div id='TpqZJ'><tfoot id='TpqZJ'></tfoot><dl id='TpqZJ'><fieldset id='TpqZJ'></fieldset></dl></div>
  1. <tfoot id='TpqZJ'></tfoot>

  2. <legend id='TpqZJ'><style id='TpqZJ'><dir id='TpqZJ'><q id='TpqZJ'></q></dir></style></legend>
    • <bdo id='TpqZJ'></bdo><ul id='TpqZJ'></ul>

    1. 使用 generate.php 时出现致命错误

      Fatal Error with Doctrine while using generate.php(使用 generate.php 时出现致命错误)
        <bdo id='Tpq7d'></bdo><ul id='Tpq7d'></ul>

        <i id='Tpq7d'><tr id='Tpq7d'><dt id='Tpq7d'><q id='Tpq7d'><span id='Tpq7d'><b id='Tpq7d'><form id='Tpq7d'><ins id='Tpq7d'></ins><ul id='Tpq7d'></ul><sub id='Tpq7d'></sub></form><legend id='Tpq7d'></legend><bdo id='Tpq7d'><pre id='Tpq7d'><center id='Tpq7d'></center></pre></bdo></b><th id='Tpq7d'></th></span></q></dt></tr></i><div id='Tpq7d'><tfoot id='Tpq7d'></tfoot><dl id='Tpq7d'><fieldset id='Tpq7d'></fieldset></dl></div>
          <tbody id='Tpq7d'></tbody>
          • <legend id='Tpq7d'><style id='Tpq7d'><dir id='Tpq7d'><q id='Tpq7d'></q></dir></style></legend>
            <tfoot id='Tpq7d'></tfoot>

                <small id='Tpq7d'></small><noframes id='Tpq7d'>

                本文介绍了使用 generate.php 时出现致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在 http://www.Doctrine-project.org/上编写 Doctrine 教程 当我尝试运行生成模型并在数据库中创建表的 generate.php 脚本时收到致命错误:

                I'm working on the Doctrine tutorial at http://www.Doctrine-project.org/ and I receive a fatal error when I try to run my generate.php script which makes my models and makes tables in the database:

                Fatal error: Class 'BaseCharity' not found in ...modelsCharity.php on line 14
                

                生成.php:

                require_once('bootstrap.php');
                Doctrine_Core::dropDatabases();
                Doctrine_Core::createDatabases();
                Doctrine_Core::generateModelsFromYaml('schema.yml', 'models');
                Doctrine_Core::createTablesFromModels('models');
                

                和 schema.yml

                and schema.yml

                Charity:
                  actAs: [Timestampable]
                  columns:
                    active:
                      type: boolean
                      default: '1'
                    owed: decimal(32,2)
                    totalPayed: decimal(32,2)
                    name: string(255)
                    website: string(255)
                    description: text
                    icon: string(255)
                

                我对此感到很困惑,我可以让它正确地创建其他非常相似或更复杂的表.我也试过重写它.我真的不知道这个错误是从哪里来的.

                I am quite stumped by this, I can get it to correctly create other tables that are very similar or much more complicated then this one. I've tried rewriting it as well. I really have no clue where this error is coming from.

                推荐答案

                你需要用Doctrine提供的自动加载器注册模型.无需使用任何迭代器或其他任何东西

                You need to register the models with the autoloader provided by Doctrine. No need to use any Iterators or what so ever

                Doctrine::loadModels('path/to/your/models');  
                

                你当然可以多次使用它:

                You can of course use it sevaral times:

                Doctrine::loadModels('path/to/your/models/generated'); 
                Doctrine::loadModels('path/to/your/models/custom');    
                Doctrine::loadModels('path/to/your/models'); 
                

                这篇关于使用 generate.php 时出现致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Converting between timezones in PHP(在 PHP 中的时区之间转换)
                PHP - strtotime, specify timezone(PHP - strtotime,指定时区)
                Get current date, given a timezone in PHP?(获取当前日期,给定 PHP 中的时区?)
                List of US Time Zones for PHP to use?(PHP 使用的美国时区列表?)
                How to detect Ambiguous and Invalid DateTime in PHP?(如何在 PHP 中检测不明确和无效的 DateTime?)
                How to update timezonedb in PHP (updating timezones info)?(如何在 PHP 中更新 timezonedb(更新时区信息)?)

              1. <i id='0yEiA'><tr id='0yEiA'><dt id='0yEiA'><q id='0yEiA'><span id='0yEiA'><b id='0yEiA'><form id='0yEiA'><ins id='0yEiA'></ins><ul id='0yEiA'></ul><sub id='0yEiA'></sub></form><legend id='0yEiA'></legend><bdo id='0yEiA'><pre id='0yEiA'><center id='0yEiA'></center></pre></bdo></b><th id='0yEiA'></th></span></q></dt></tr></i><div id='0yEiA'><tfoot id='0yEiA'></tfoot><dl id='0yEiA'><fieldset id='0yEiA'></fieldset></dl></div>
                    <bdo id='0yEiA'></bdo><ul id='0yEiA'></ul>
                  • <legend id='0yEiA'><style id='0yEiA'><dir id='0yEiA'><q id='0yEiA'></q></dir></style></legend>
                      <tbody id='0yEiA'></tbody>
                  • <tfoot id='0yEiA'></tfoot>

                      1. <small id='0yEiA'></small><noframes id='0yEiA'>