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


PHP sfCoreAutoload::register方法代码示例

本文整理汇总了PHP中sfCoreAutoload::register方法的典型用法代码示例。如果您正苦于以下问题:PHP sfCoreAutoload::register方法的具体用法?PHP sfCoreAutoload::register怎么用?PHP sfCoreAutoload::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sfCoreAutoload的用法示例。


在下文中一共展示了sfCoreAutoload::register方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.
  *
  * @param string              $rootDir    The project root directory
  * @param sfEventDispatcher   $dispatcher The event dispatcher
  */
 public function __construct($rootDir = null, sfEventDispatcher $dispatcher = null)
 {
     if (is_null(sfProjectConfiguration::$active) || $this instanceof sfApplicationConfiguration) {
         sfProjectConfiguration::$active = $this;
     }
     $this->rootDir = is_null($rootDir) ? self::guessRootDir() : realpath($rootDir);
     $this->symfonyLibDir = realpath(dirname(__FILE__) . '/..');
     // initializes autoloading for symfony core classes
     require_once $this->symfonyLibDir . '/autoload/sfCoreAutoload.class.php';
     sfCoreAutoload::register();
     $this->dispatcher = is_null($dispatcher) ? new sfEventDispatcher() : $dispatcher;
     ini_set('magic_quotes_runtime', 'off');
     ini_set('register_globals', 'off');
     sfConfig::set('sf_symfony_lib_dir', $this->symfonyLibDir);
     $this->setRootDir($this->rootDir);
     $this->setup();
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:23,代码来源:sfProjectConfiguration.class.php

示例2: bootstrap

 public function bootstrap($app = 'frontend', $debug = true)
 {
     // so that all notices will appear
     error_reporting(E_ALL);
     // Load symfony core and lime testing framework
     require_once $this->getSymfonyDir() . '/autoload/sfCoreAutoload.class.php';
     sfCoreAutoload::register();
     // Create configuration and context
     require_once dirname(__FILE__) . '/../fixtures/project/config/ProjectConfiguration.class.php';
     $this->configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', $debug);
     require_once $this->configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
     $this->context = sfContext::createInstance($this->configuration);
     new sfDatabaseManager($this->configuration);
     // Register teardown / autoload functions
     spl_autoload_register(array($this, 'autoload'));
     register_shutdown_function(array($this, 'teardown'));
     // Cleanup and copy over SQLite DB
     $this->teardown();
     $this->setup();
 }
开发者ID:bshaffer,项目名称:Symfony-Snippets,代码行数:20,代码来源:sfPluginTestBootstrap.class.php

示例3: dirname

<?php

require_once dirname(__FILE__) . '/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();
class ProjectConfiguration extends sfProjectConfiguration
{
    public function setup()
    {
        $this->enablePlugins('sfDoctrinePlugin');
        $this->enablePlugins('sfTCPDFPlugin');
        $this->enablePlugins('sfDoctrineGuardPlugin');
    }
}
开发者ID:hunde,项目名称:bsc,代码行数:13,代码来源:ProjectConfiguration.class.php

示例4: bootstrap

 public function bootstrap($app = 'frontend', $debug = true)
 {
     // so that all notices will appear
     error_reporting(E_ALL);
     // Load symfony core and lime testing framework
     require_once $this->getSymfonyDir() . '/autoload/sfCoreAutoload.class.php';
     sfCoreAutoload::register();
     // Create configuration and context
     require_once dirname(__FILE__) . '/../fixtures/project/config/ProjectConfiguration.class.php';
     $dbms = 'sqlite';
     if (isset($_SERVER['DB'])) {
         $dbms = strtolower($_SERVER['DB']);
     }
     // Check if configuration for dbms exists
     if (!file_exists(dirname(__FILE__) . '/../fixtures/project/config/database-' . $dbms . '.yml')) {
         throw new Exception('Didnt find database-' . $dbms . 'yml for DBMS: "' . $dbms . '"');
     }
     copy(dirname(__FILE__) . '/../fixtures/project/config/database-' . $dbms . '.yml', dirname(__FILE__) . '/../fixtures/project/config/databases.yml');
     $this->configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', $debug);
     require_once $this->configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
     $this->context = sfContext::createInstance($this->configuration);
     $this->databasemanager = new sfDatabaseManager($this->configuration);
     // Register teardown / autoload functions
     spl_autoload_register(array($this, 'autoload'));
     register_shutdown_function(array($this, 'teardown'));
     $this->teardown();
     $this->setup();
 }
开发者ID:robo47,项目名称:csDoctrineActAsSortablePlugin-1,代码行数:28,代码来源:sfPluginTestBootstrap.class.php

示例5: setup

<?php

require_once sfCoreAutoload::register();
class ProjectConfiguration extends sfProjectConfiguration
{
    public function setup()
    {
    }
}
开发者ID:Phennim,项目名称:symfony1,代码行数:9,代码来源:ProjectConfiguration.class.php


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