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


PHP sfCoreAutoload::getInstance方法代码示例

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


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

示例3: lime_test

<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
 * 
 * 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

示例4: chdir

<?php

/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
 * 
 * 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::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。