私はSymfony 1.4を設定しようとしています。私はMVCには新しくないが、これがSymfonyの私の最初の試みである。私はsymfony-project.org/reference/1_4のドキュメントに従っており、 "Hello、World!"ページ。symfony 1.4の最初のschema.ymlを設定してください
私は次のステップデータベースに移りました。
私はこれ(心配しないでlocalhostのみ:)。)でした:その後、私は私のconfig /ドクトリン/ schema.ymlファイルでこれを入れ
./symfony configure:database "mysql:host=localhost;dbname=myblog" myblog myblog
を:
Article:
actAs: [Sluggable, Timestampable]
columns:
title:
type: string(255)
notnull: true
content:
type: clob
status: string(255)
author_id: integer
category_id: integer
published_at: timestamp
relations:
Author:
foreignAlias: Articles
Category:
foreignAlias: Articles
Tags:
class: Tag
refClass: ArticleTag
foreignAlias: Articles
Author:
columns:
first_name: string(20)
last_name: string(20)
email: string(255)
active: boolean
Category:
columns:
name: string(255)
Tag:
columns:
name: string(255)
ArticleTag:
columns:
article_id:
type: integer
primary: true
tag_id:
type: integer
primary: true
relations:
Article:
onDelete: CASCADE
Tag:
onDelete: CASCADE
しかし、私「この取得メートル:
[email protected]:~/sfproject$ ./symfony doctrine:build --all-classes
>> doctrine generating model classes
>> file+ /tmp/doctrine_schema_30022.yml
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseArticleTag.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseCategory.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseArticle.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseAuthor.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseTag.class.php
>> autoload Resetting application autoloaders
>> file- /home/charlie/sfproject/cache/frontend/dev/config/config_autoload.yml.php
>> doctrine generating form classes
PHP Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
PHP Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
は私schema.ywlのために、いくつかの異なるサンプルファイルを試してみましたので、私はそれが欠陥だとは思いません。私は一歩足りなかったに違いない。
何かが正しくないが、私は完全に困惑している。どんな助けも非常に高く評価されます!
編集 私のオリジナルのconfig /ドクトリン/ schema.ymlのた:
Article:
actAs: { Timestampable: ~ }
columns:
title:
type: string(255)
notnull: true
content:
type: clob
status: string(255)
author_id: integer
category_id: integer
published_at: timestamp
relations:
Author:
foreignAlias: Articles
Category:
foreignAlias: Articles
Tags:
class: Tag
refClass: ArticleTag
foreignAlias: Articles
Author:
columns:
first_name: string(20)
last_name: string(20)
email: string(255)
active: boolean
Category:
columns:
name: string(255)
Tag:
columns:
name: string(255)
ArticleTag:
columns:
article_id:
type: integer
primary: true
tag_id:
type: integer
primary: true
relations:
Article:
onDelete: CASCADE
Tag:
onDelete: CASCADE
:
Posts:
actAs:
Timestampable: ~
columns:
title: string(255)
body: clob
編集2 パーマイクの要求、私はこのようにファイルを編集しましたエラーは次のとおりです。
[email protected]:~/sfproject$ ./symfony doctrine:build --all-classes
>> doctrine generating model classes
>> file+ /tmp/doctrine_schema_79366.yml
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseArticleTag.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BasePosts.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseCategory.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseArticle.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseAuthor.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseTag.class.php
>> autoload Resetting application autoloaders
>> doctrine generating form classes
PHP Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
PHP Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
[email protected]:~/sfproject$
マイクの手動ビルドの提案については
編集 、私は教義上の同じエラーを取得:と教義-フィルタを構築:ビルドフォーム:
[email protected]:~/sfproject$ php symfony doctrine:build-model
>> doctrine generating model classes
>> file+ /tmp/doctrine_schema_91741.yml
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseArticleTag.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BasePosts.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseCategory.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseArticle.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseAuthor.class.php
>> tokens /home/charlie/sfproject/lib/model/doctrine/base/BaseTag.class.php
>> autoload Resetting application autoloaders
>> file- /home/charlie/sfproject/cache/frontend/dev/config/config_autoload.yml.php
[email protected]:~/sfproject$ php symfony doctrine:build-filters
>> doctrine generating filter form classes
PHP Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
PHP Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
[email protected]:~/sfproject$ php symfony doctrine:build-forms
>> doctrine generating form classes
PHP Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
Fatal error: Class 'columns' not found in /home/charlie/sfproject/lib/model/doctrine/base/BasePost.class.php on line 25
PHP Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
Fatal error: Call to a member function evictAll() on a non-object in /home/charlie/sfproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1239
[email protected]:~/sfproject$ php symfony cc
>> cache Clearing cache type "all" for "frontend" app and "test" env
>> file+ /home/charlie/sfproject/data/frontend_test-cli.lck
>> chmod 777 /home/charlie/sfproject/data/frontend_test-cli.lck
>> file- /home/charlie/sfproject/cache/frontend/test/config/config_config_handlers.yml.php
>> file- /home/charlie/sfproject/cache/frontend/test/config/config_app.yml.php
>> file- /home/charlie/sfproject/cache/frontend/test/config/config_settings.yml.php
>> file- /home/charlie/sfproject/data/frontend_test-cli.lck
>> cache Clearing cache type "all" for "frontend" app and "dev" env
>> file+ /home/charlie/sfproject/data/frontend_dev-cli.lck
>> chmod 777 /home/charlie/sfproject/data/frontend_dev-cli.lck
>> file- /home/charlie/sfproject/cache/frontend/dev/config/config_autoload.yml.php
>> file- /home/charlie/sfproject/cache/frontend/dev/config/config_config_handlers.yml.php
>> file- /home/charlie/sfproject/cache/frontend/dev/config/config_databases.yml.php
>> file- /home/charlie/sfproject/cache/frontend/dev/config/config_app.yml.php
>> file- /home/charlie/sfproject/cache/frontend/dev/config/config_settings.yml.php
>> file- /home/charlie/sfproject/data/frontend_dev-cli.lck
>> cache Clearing cache type "all" for "frontend" app and "prod" env
>> file+ /home/charlie/sfproject/data/frontend_prod-cli.lck
>> chmod 777 /home/charlie/sfproject/data/frontend_prod-cli.lck
>> file- /home/charlie/sfproject/cache/frontend/prod/config/config_config_handlers.yml.php
>> file- /home/charlie/sfproject/cache/frontend/prod/config/config_app.yml.php
>> file- /home/charlie/sfproject/cache/frontend/prod/config/config_settings.yml.php
>> file- /home/charlie/sfproject/data/frontend_prod-cli.lck
[email protected]:~/sfproject$
あなたはそれを把握できましたか? –