Doctrine 入門(一)

準備

依照之前整合的 Zend Framework 1.11.0 and Doctrine 1.2.3 and Smarty 3.0.4 環境,來做學習與測試.
更改index.php

< ?php
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    realpath(APPLICATION_PATH . '/../models'),
    realpath(APPLICATION_PATH . '/../models/generated'),
    get_include_path(),
)));

application.ini 環境

;Doctrine
autoloaderNamespaces[] = "Doctrine_"
pluginPaths.ZendX_Doctrine_Application_Resource = "ZendX/Application/Resource"
resources.doctrine.debug = 1
resources.doctrine.paths.models_path = APPLICATION_PATH "/../models"
resources.doctrine.connections.orm1.dsn.adapter = mysql
resources.doctrine.connections.orm1.dsn.user = "user"
resources.doctrine.connections.orm1.dsn.pass = "password"
resources.doctrine.connections.orm1.dsn.hostspec = "localhost"
resources.doctrine.connections.orm1.dsn.database = "orm1_sd_idv_tw"

檔案架構

Read More