2011-12-14 9 views
0

Doctrine 2.1 + ZF 1を連携させるために環境をセットアップしようとしています。私の取り組みはBisnaを使用しようとしていますが、私のアプリケーションの/ libraryフォルダにORM/DBAL用のダウンロードパッケージを設定する情報が見つかりませんでした。BisnaでDoctrine 2.1.xとZend Framework 1をセットアップする方法

私はそこに何を置く必要がありますか? (doctrine-orm/doctrine-dbalのtar.gz全体)

よろしくお願いします。

答えて

0

Bisnaの設定は、あなたの環境にDoctrineがインストールされている場所には無関心です。実際には/ライブラリにある必要はありません。 Bisnaは期待しない何か、である、あなたの/パス/ /ドクトリン/フォルダに、以下の構造を有する:

/path/to/Doctrine/ORM 
/path/to/Doctrine/DBAL 
/path/to/Doctrine/Common 

私は、一般的に教義をを/ usr/share/PHP /教義では、どこでそれを見つけるためにBisnaを教えておくがapplication.ini

resources.doctrine.includePath = "/usr/share/php/Doctrine" 

に次の行を追加するDoctrineはアプリケーションのライブラリにある場合は、ご使​​用の構成は次のようになります。

resources.doctrine.includePath = APPLICATION_PATH「/../library/教義 "

+0

こんにちは、私はそれを確認します。私の場合は、ホストサーバーがシステム全体のパス上にそれを持っているかどうかを制御することができないので、プロジェクトにすべてのライブラリを持つ必要があります。私はおそらくライブラリに追加します。モデル(Doctrine2アノテーションを使用する)がどこに行くべきかという側面の質問?標準/モデルの下で? – bicatu

+0

まあ、うまくいきませんでした。 bisnaのapplication.iniには多くの設定が含まれています。私はそれを編集する必要があった。なぜならそれは../library/ vendor/doctrine ...を指していて、Bootstrap.php public function _initAutoloaderNamespaces()を編集する必要があった。 { require_once APPLICATION_PATH。 '/../library/Doctrine/Common/ClassLoader.php'; $ autoloader = \ Zend_Loader_Autoloader :: getInstance(); $ fmmAutoloader = new \ Doctrine \ Common \ ClassLoader( 'Bisna'); $ autoloader-> pushAutoloader(array($ fmmAutoloader、 'loadClass')、 'Bisna'); } – bicatu

+0

問題が発生しました。 application.ini内のすべてのエントリを慎重に読んだ後、適切な組み合わせを得ることができました。 – bicatu

1
Look for MyNamespace and replace with yours. 
The .ini assumes that the doctrine and symfiny libraries are located under library folder. 

; ------------------------------------------------------------------------------ 
; Doctrine Class Loader Configuration 
; ------------------------------------------------------------------------------ 

resources.doctrine.classLoader.loaderClass = "Doctrine\Common\ClassLoader" 
resources.doctrine.classLoader.loaderFile = APPLICATION_PATH "/../library/Doctrine/Common/ClassLoader.php" 

resources.doctrine.classLoader.loaders.doctrine_common.namespace = "Doctrine\Common" 
resources.doctrine.classLoader.loaders.doctrine_common.includePath = APPLICATION_PATH "/../library" 

resources.doctrine.classLoader.loaders.doctrine_dbal.namespace = "Doctrine\DBAL" 
resources.doctrine.classLoader.loaders.doctrine_dbal.includePath = APPLICATION_PATH "/../library" 

resources.doctrine.classLoader.loaders.doctrine_orm.namespace = "Doctrine\ORM" 
resources.doctrine.classLoader.loaders.doctrine_orm.includePath = APPLICATION_PATH "/../library" 

resources.doctrine.classLoader.loaders.symfony_console.namespace = "Symfony\Component\Console" 
resources.doctrine.classLoader.loaders.symfony_console.includePath = APPLICATION_PATH "/../library/Doctrine" 

resources.doctrine.classLoader.loaders.symfony_yaml.namespace = "Symfony\Component\Yaml" 
resources.doctrine.classLoader.loaders.symfony_yaml.includePath = APPLICATION_PATH "/../library/Doctrine" 

; ------------------------------------------------------------------------------ 
; Doctrine Cache Configuration 
; ------------------------------------------------------------------------------ 

; Points to default cache instance to be used. Optional is only one cache is defined 
resources.doctrine.cache.defaultCacheInstance = default 

; Cache Instance configuration for "default" cache 
;resources.doctrine.cache.instances.default.id = default 
resources.doctrine.cache.instances.default.adapterClass = "Doctrine\Common\Cache\ApcCache" 
resources.doctrine.cache.instances.default.namespace = "MyNamespace_" 
;resources.doctrine.cache.instances.default.options.servers.0.host = localhost 
;resources.doctrine.cache.instances.default.options.servers.0.port = 11211 
;resources.doctrine.cache.instances.default.options.servers.0.persistent = true 
;resources.doctrine.cache.instances.default.options.servers.0.weight  = 1 
;resources.doctrine.cache.instances.default.options.servers.0.timeout  = 1 
;resources.doctrine.cache.instances.default.options.servers.0.retryInterval = 15 
;resources.doctrine.cache.instances.default.options.servers.0.status  = true 

; ------------------------------------------------------------------------------ 
; Doctrine DBAL Configuration 
; ------------------------------------------------------------------------------ 

; Points to default connection to be used. Optional if only one connection is defined 
resources.doctrine.dbal.defaultConnection = default 

; DBAL Connection configuration for "default" connection 
;resources.doctrine.dbal.connections.default.id = default 
;resources.doctrine.dbal.connections.default.eventManagerClass = "Doctrine\Common\EventManager" 
;resources.doctrine.dbal.connections.default.eventSubscribers[] = "DoctrineExtensions\Sluggable\SluggableSubscriber" 
;resources.doctrine.dbal.connections.default.configurationClass = "Doctrine\DBAL\Configuration" 
;resources.doctrine.dbal.connections.default.sqlLoggerClass  = "Doctrine\DBAL\Logging\EchoSQLLogger" 
;resources.doctrine.dbal.connections.default.types.my_type  = "Application\DBAL\Type\MyType" 

; Database configuration 
;resources.doctrine.dbal.connections.default.parameters.wrapperClass = "" 
resources.doctrine.dbal.connections.default.parameters.driver = "pdo_mysql" 
resources.doctrine.dbal.connections.default.parameters.dbname = "dbname" 
resources.doctrine.dbal.connections.default.parameters.host = "dbhosr" 
resources.doctrine.dbal.connections.default.parameters.port = 3306 
resources.doctrine.dbal.connections.default.parameters.user = "dbuser" 
resources.doctrine.dbal.connections.default.parameters.password = "dbpassword" 
;resources.doctrine.dbal.connections.default.parameters.driverOptions.ATTR_USE_BUFFERED_QUERIES = true 

; ------------------------------------------------------------------------------ 
; Doctrine ORM Configuration 
; ------------------------------------------------------------------------------ 

; Points to default EntityManager to be used. Optional if only one EntityManager is defined 
resources.doctrine.orm.defaultEntityManager = default 

; EntityManager configuration for "default" manager 
;resources.doctrine.orm.entityManagers.default.id = default 
;resources.doctrine.orm.entityManagers.default.entityManagerClass = "Doctrine\ORM\EntityManager" 
;resources.doctrine.orm.entityManagers.default.configurationClass = "Doctrine\ORM\Configuration" 
;resources.doctrine.orm.entityManagers.default.entityNamespaces.app = "Application\Entity" 
resources.doctrine.orm.entityManagers.default.connection  = default 
resources.doctrine.orm.entityManagers.default.proxy.autoGenerateClasses = true 
resources.doctrine.orm.entityManagers.default.proxy.namespace   = "MyNamespace\Entity\Proxy" 
resources.doctrine.orm.entityManagers.default.proxy.dir     = APPLICATION_PATH "/../library/Argo/Entity/Proxy" 
;resources.doctrine.orm.entityManagers.default.metadataCache = default 
;resources.doctrine.orm.entityManagers.default.queryCache = default 
;resources.doctrine.orm.entityManagers.default.resultCache = default 
;resources.doctrine.orm.entityManagers.default.DQLFunctions.numeric.PI = "DoctrineExtensions\ORM\Query\Functions\Numeric\PiFunction" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.annotationRegistry.annotationFiles[]  = APPLICATION_PATH "/../library/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php" 
;resources.doctrine.orm.entityManagers.default.metadataDrivers.annotationRegistry.annotationNamespaces.0.namespace = "Gedmo" 
;resources.doctrine.orm.entityManagers.default.metadataDrivers.annotationRegistry.annotationNamespaces.0.includePath = APPLICATION_PATH "/../library/vendor" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.adapterClass   = "Doctrine\ORM\Mapping\Driver\AnnotationDriver" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingNamespace  = "MyNamespace\Entity" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.mappingDirs[]   = APPLICATION_PATH "/../library/MyNamespace/Entity" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderClass = "Doctrine\Common\Annotations\AnnotationReader" 
resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderCache = default 
;resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderNamespaces.App = "Application\DoctrineExtensions\ORM\Mapping" 
関連する問題