• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sfCoreAutoload类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: renderPdf

 public function renderPdf($data, $pageSize = 'a4', $pageOrientation = 'portrait')
 {
     $previous_error_reporting = ini_get('error_reporting');
     // to avoid the complaining for fixing DOMPDF_FONT_DIR at
     // siwappConfiguration.class.php
     ini_set('error_reporting', E_ALL ^ E_NOTICE);
     $input_data = $this->render($data, true);
     sfCoreAutoload::getInstance()->unregister();
     sfAutoload::getInstance()->unregister();
     if (class_exists('sfAutoloadAgain')) {
         sfAutoloadAgain::getInstance()->unregister();
     }
     require_once sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'sfDomPDFPlugin' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'sfDomPDFPlugin.class.php';
     $q = new sfDomPDFPlugin($input_data);
     sfCoreAutoload::getInstance()->register();
     sfAutoload::getInstance()->register();
     if (class_exists('sfAutoloadAgain')) {
         sfAutoloadAgain::getInstance()->register();
     }
     $q->setProtocol('http://');
     $q->setHost($_SERVER['HTTP_HOST']);
     $q->setPaper($pageSize, $pageOrientation);
     $q->render();
     ini_set('error_reporting', $previous_error_reporting);
     return $q->getPdf();
 }
开发者ID:solutema,项目名称:siwapp-sf1,代码行数:26,代码来源:Printer.class.php


示例2: getInstance

 /**
  * Retrieves the singleton instance of this class.
  *
  * @return sfCoreAutoload A sfCoreAutoload implementation instance.
  */
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new sfCoreAutoload();
     }
     return self::$instance;
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:12,代码来源:sfCoreAutoload.class.php


示例3: register

 /**
  * Register sfCoreAutoload in spl autoloader.
  *
  * @return void
  */
 public static function register()
 {
     if (self::$registered) {
         return;
     }
     ini_set('unserialize_callback_func', 'spl_autoload_call');
     if (false === spl_autoload_register(array(self::getInstance(), 'autoload'))) {
         throw new sfException(sprintf('Unable to register %s::autoload as an autoloading method.', get_class(self::getInstance())));
     }
     self::$registered = true;
 }
开发者ID:habtom,项目名称:uas,代码行数:16,代码来源:sfCoreAutoload.class.php


示例4: execute

 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     require_once dirname(__FILE__) . '/../../vendor/lime/lime.php';
     require_once dirname(__FILE__) . '/lime_symfony.php';
     // cleanup
     require_once dirname(__FILE__) . '/../../util/sfToolkit.class.php';
     if ($files = glob(sys_get_temp_dir() . DIRECTORY_SEPARATOR . '/sf_autoload_unit_*')) {
         foreach ($files as $file) {
             unlink($file);
         }
     }
     // update sfCoreAutoload
     if ($options['update-autoloader']) {
         require_once dirname(__FILE__) . '/../../autoload/sfCoreAutoload.class.php';
         sfCoreAutoload::make();
     }
     $status = false;
     $statusFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . sprintf('/.test_symfony_%s_status', md5(dirname(__FILE__)));
     if ($options['only-failed']) {
         if (file_exists($statusFile)) {
             $status = unserialize(file_get_contents($statusFile));
         }
     }
     $h = new lime_symfony(array('force_colors' => $options['color'], 'verbose' => $options['trace']));
     $h->base_dir = realpath(dirname(__FILE__) . '/../../../test');
     // remove generated files
     if ($options['rebuild-all']) {
         $finder = sfFinder::type('dir')->name(array('base', 'om', 'map'));
         foreach ($finder->in(glob($h->base_dir . '/../lib/plugins/*/test/functional/fixtures/lib')) as $dir) {
             sfToolkit::clearDirectory($dir);
         }
     }
     if ($status) {
         foreach ($status as $file) {
             $h->register($file);
         }
     } else {
         $h->register(sfFinder::type('file')->prune('fixtures')->name('*Test.php')->in(array_merge(array($h->base_dir . '/unit'), glob($h->base_dir . '/../lib/plugins/*/test/unit'), array($h->base_dir . '/functional'), glob($h->base_dir . '/../lib/plugins/*/test/functional'), array($h->base_dir . '/other'))));
     }
     $ret = $h->run() ? 0 : 1;
     file_put_contents($statusFile, serialize($h->get_failed_files()));
     if ($options['xml']) {
         file_put_contents($options['xml'], $h->to_xml());
     }
     return $ret;
 }
开发者ID:cuongnv540,项目名称:jobeet,代码行数:49,代码来源:sfSymfonyTestTask.class.php


示例5: __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


示例6: 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


示例7: execute

 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     if (file_exists('symfony')) {
         throw new sfCommandException(sprintf('A project named "%s" already exists in this directory.', $arguments['name']));
     }
     // create basic project structure
     $finder = sfFinder::type('any')->discard('.sf');
     $this->getFilesystem()->mirror(dirname(__FILE__) . '/skeleton/project', sfConfig::get('sf_root_dir'), $finder);
     // update project name and directory
     $finder = sfFinder::type('file')->name('properties.ini', 'apache.conf', 'propel.ini', 'databases.yml');
     $this->getFileSystem()->replaceTokens($finder->in(sfConfig::get('sf_config_dir')), '##', '##', array('PROJECT_NAME' => $arguments['name'], 'PROJECT_DIR' => sfConfig::get('sf_root_dir')));
     // update ProjectConfiguration class
     $this->getFileSystem()->replaceTokens(sfConfig::get('sf_config_dir') . '/ProjectConfiguration.class.php', '##', '##', array('SYMFONY_LIB_DIR' => sfConfig::get('sf_symfony_lib_dir')));
     // update vhost sample file
     $this->getFileSystem()->replaceTokens(sfConfig::get('sf_config_dir') . '/vhost.sample', '##', '##', array('PROJECT_NAME' => $arguments['name'], 'SYMFONY_WEB_DIR' => sfConfig::get('sf_web_dir'), 'SYMFONY_SF_DIR' => realpath(sfCoreAutoload::getInstance()->getBaseDir() . '../data/web/sf')));
     // fix permission for common directories
     $fixPerms = new sfProjectPermissionsTask($this->dispatcher, $this->formatter);
     $fixPerms->setCommandApplication($this->commandApplication);
     $fixPerms->run();
     // publish assets for core plugins
     $publishAssets = new sfPluginPublishAssetsTask($this->dispatcher, $this->formatter);
     $publishAssets->setCommandApplication($this->commandApplication);
     $publishAssets->run(array(), array('--core-only'));
 }
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:27,代码来源:sfGenerateProjectTask.class.php


示例8: 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


示例9: unregister

 /**
  * Unregister sfCoreAutoload from spl autoloader.
  *
  * @return void
  */
 public static function unregister()
 {
     spl_autoload_unregister(array(self::getInstance(), 'autoload'));
     self::$registered = false;
 }
开发者ID:nubee,项目名称:bee-project,代码行数:10,代码来源:sfCoreAutoload.class.php


示例10: lime_test

<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <[email protected]>
 * 
 * For the full copyright and license information, please component the LICENSE
 * file that was distributed with this source code.
 */
require_once __DIR__ . '/../../bootstrap/unit.php';
$t = new lime_test(1);
$autoload = sfCoreAutoload::getInstance();
$t->is($autoload->getClassPath('sfaction'), $autoload->getBaseDir() . '/action/sfAction.class.php', '"sfCoreAutoload" is case-insensitive');
开发者ID:Phennim,项目名称:symfony1,代码行数:13,代码来源:sfCoreAutoloadTest.php


示例11: dirname

<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once dirname(__FILE__) . '/../../lib/vendor/lime/lime.php';
class lime_symfony extends lime_harness
{
    protected function get_relative_file($file)
    {
        $file = str_replace(DIRECTORY_SEPARATOR, '/', str_replace(array(realpath($this->base_dir) . DIRECTORY_SEPARATOR, realpath($this->base_dir . '/../lib/plugins') . DIRECTORY_SEPARATOR, $this->extension), '', $file));
        return preg_replace('#^(.*?)Plugin/test/(unit|functional)/#', '[$1] $2/', $file);
    }
}
require_once dirname(__FILE__) . '/../../lib/util/sfToolkit.class.php';
if ($files = glob(sfToolkit::getTmpDir() . DIRECTORY_SEPARATOR . '/sf_autoload_unit_*')) {
    foreach ($files as $file) {
        unlink($file);
    }
}
// update sfCoreAutoload
require_once dirname(__FILE__) . '/../../lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::make();
$h = new lime_symfony(new lime_output_color());
$h->base_dir = realpath(dirname(__FILE__) . '/..');
$h->register(sfFinder::type('file')->prune('fixtures')->name('*Test.php')->in(array_merge(array($h->base_dir . '/unit'), glob($h->base_dir . '/../lib/plugins/*/test/unit'), array($h->base_dir . '/functional'), glob($h->base_dir . '/../lib/plugins/*/test/functional'), array($h->base_dir . '/other'))));
exit($h->run() ? 0 : 1);
开发者ID:mediasadc,项目名称:alba,代码行数:31,代码来源:prove.php


示例12: 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


示例13: setup

<?php

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


示例14: chdir

<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <[email protected]>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
chdir(dirname(__FILE__));
require_once dirname(__FILE__) . '/config/ProjectConfiguration.class.php';
include sfCoreAutoload::getInstance()->getBaseDir() . '/command/cli.php';
开发者ID:theolymp,项目名称:diem,代码行数:12,代码来源:symfony.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP sfCultureInfo类代码示例发布时间:2022-05-23
下一篇:
PHP sfContext类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap