当前位置: 首页>>代码示例>>PHP>>正文


PHP Doctrine::setExtensionsPath方法代码示例

本文整理汇总了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();
 }
开发者ID:swk,项目名称:bluebox,代码行数:8,代码来源:ExtensionTestCase.php

示例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);
 }
开发者ID:kawahara,项目名称:OpenPNE3,代码行数:23,代码来源:opProjectConfiguration.class.php

示例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);
开发者ID:jdudek,项目名称:doctrine-sortable,代码行数:20,代码来源:run.php

示例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);
开发者ID:swk,项目名称:bluebox,代码行数:31,代码来源:config.php

示例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);
开发者ID:nicolasmartin,项目名称:framework,代码行数:12,代码来源:run.php


注:本文中的Doctrine::setExtensionsPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。