本文整理汇总了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);