本文整理匯總了PHP中Doctrine::setExtensionsPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine::setExtensionsPath方法的具體用法?PHP Doctrine::setExtensionsPath怎麽用?PHP Doctrine::setExtensionsPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine
的用法示例。
在下文中一共展示了Doctrine::setExtensionsPath方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: prepareTables
public function prepareTables()
{
Doctrine::setExtensionsPath(dirname(__FILE__) . '/Extension');
spl_autoload_register(array('Doctrine', 'extensionsAutoload'));
Doctrine_Manager::getInstance()->registerExtension('TestExtension');
$this->tables[] = 'ExtensionBehaviorTest';
parent::prepareTables();
}
示例2: configureDoctrine
public function configureDoctrine($manager)
{
spl_autoload_register(array('Doctrine', 'extensionsAutoload'));
Doctrine::setExtensionsPath(sfConfig::get('sf_lib_dir') . '/vendor/doctrine_extensions');
$manager->registerExtension('ExtraFunctions');
$manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);
$manager->setAttribute(Doctrine::ATTR_RECURSIVE_MERGE_FIXTURES, true);
$manager->setAttribute(Doctrine::ATTR_QUERY_CLASS, 'opDoctrineQuery');
if (extension_loaded('apc')) {
$options = array();
if ($prefix = sfConfig::get('op_doctrine_cache_key_prefix')) {
$options['prefix'] = $prefix;
} else {
$options['prefix'] = md5(dirname(__FILE__));
}
$cacheDriver = new Doctrine_Cache_Apc($options);
$manager->setAttribute(Doctrine::ATTR_QUERY_CACHE, $cacheDriver);
}
$manager->registerConnectionDriver('mysql', 'opDoctrineConnectionMysql');
$manager->registerConnectionDriver('pgsql', 'Doctrine_Connection_Pgsql_ExtraFunctions');
$manager->registerConnectionDriver('sqlite', 'Doctrine_Connection_Sqlite_ExtraFunctions');
$this->setupProjectOpenPNEDoctrine($manager);
}
示例3: unset
<?php
if (isset($argv[1])) {
$_SERVER['DOCTRINE_DIR'] = $argv[1];
unset($argv[1]);
$_SERVER['argv'] = array_values($argv);
}
if (isset($_REQUEST['doctrine_dir'])) {
$_SERVER['DOCTRINE_DIR'] = $_REQUEST['doctrine_dir'];
}
if (!isset($_SERVER['DOCTRINE_DIR'])) {
throw new Exception('You must set the path to the DOCTRINE_DIR');
}
require $_SERVER['DOCTRINE_DIR'] . '/tests/bootstrap.php';
spl_autoload_register(array('Doctrine', 'extensionsAutoload'));
Doctrine::setExtensionsPath(realpath(dirname(__FILE__) . '/../'));
$manager = Doctrine_Manager::getInstance()->registerExtension('Sortable', realpath(dirname(__FILE__) . '/../lib'));
$test = new DoctrineTest();
$test->addTestCase(new Doctrine_Template_Sortable_TestCase());
exit($test->run() ? 0 : 1);
示例4: define
/**
* Doctrine Configuration File
*
* This is a sample implementation of Doctrine
*
* @package Doctrine
* @subpackage Config
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision: 2753 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Jonathan H. Wage <jwage@mac.com>
*/
define('SANDBOX_PATH', dirname(__FILE__));
define('DOCTRINE_PATH', dirname(dirname(SANDBOX_PATH)) . DIRECTORY_SEPARATOR . 'lib');
define('DATA_FIXTURES_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'fixtures');
define('MODELS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models');
define('MIGRATIONS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'migrations');
define('SQL_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sql');
define('YAML_SCHEMA_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'schema');
define('DB_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'sandbox.db');
define('DSN', 'sqlite:///' . DB_PATH);
require_once DOCTRINE_PATH . DIRECTORY_SEPARATOR . 'Doctrine.php';
Doctrine::setExtensionsPath(dirname(__FILE__) . '/extensions');
spl_autoload_register(array('Doctrine', 'autoload'));
spl_autoload_register(array('Doctrine', 'modelsAutoload'));
spl_autoload_register(array('Doctrine', 'extensionsAutoload'));
$manager = Doctrine_Manager::getInstance();
$manager->openConnection(DSN, 'doctrine');
$manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);
示例5: dirname
<?php
$ROOT = dirname(__FILE__) . '/../../../../../../';
$_SERVER['DOCTRINE_DIR'] = $ROOT . '_lib/vendors/doctrine/';
require_once $ROOT . '_lib/tests/doctrine/bootstrap.php';
spl_autoload_register(array('Doctrine', 'extensionsAutoload'));
Doctrine::setExtensionsPath($ROOT . '_lib/tests/doctrine/');
$manager = Doctrine_Manager::getInstance()->registerExtension('SortableBehavior', '../');
require_once 'SortableTestCase.php';
$test = new DoctrineTest();
$test->addTestCase(new Doctrine_SortableTestCase());
exit($test->run() ? 0 : 1);