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


PHP sfToolkit::addIncludePath方法代码示例

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


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

示例1: execute

 protected function execute($arguments = array(), $options = array())
 {
     require sfConfig::get('sf_data_dir') . '/version.php';
     sfToolkit::addIncludePath(array(sfConfig::get('sf_lib_dir') . '/vendor/'));
     $pluginList = $this->getPluginList();
     foreach ($pluginList as $name => $info) {
         if (!preg_match('/^op[a-zA-Z0-9_\\-]+Plugin$/', $name)) {
             continue;
         }
         if (isset($info['install']) && false === $info['install']) {
             continue;
         }
         $option = array();
         if (isset($info['version'])) {
             $option[] = '--release=' . $info['version'];
         }
         if (isset($info['channel'])) {
             $option[] = '--channel=' . $info['channel'];
         }
         try {
             $task = new opPluginInstallTask($this->dispatcher, $this->formatter);
             $task->run(array('name' => $name), $option);
         } catch (sfCommandException $e) {
             $str = "Failed install";
             $this->logBlock($str, 'ERROR');
         }
     }
 }
开发者ID:Kazuhiro-Murota,项目名称:OpenPNE3,代码行数:28,代码来源:opPluginSyncTask.class.php

示例2: execute

 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     /**
      * include path to propel generator
      */
     sfToolkit::addIncludePath(array(sfConfig::get('sf_propel_path') . '/generator/lib'));
     /**
      * first check the db connectivity for all connections
      */
     $this->logBlock('Checking Db Connectivity', "QUESTION");
     if (!$this->createTask('afs:db-connectivity')->run()) {
         return;
     }
     $this->logBlock('Creating specific AppFlower folders', "QUESTION");
     $this->createFolders();
     $this->logBlock('Setting Symfony project permissions', "QUESTION");
     $this->createTask('project:permissions')->run();
     $type_method = 'execute' . sfInflector::camelize($options['type']);
     if (!method_exists($this, $type_method)) {
         throw new sfCommandException("Type method '{$type_method}' not defined.");
     }
     call_user_func(array($this, $type_method), $arguments, $options);
     $this->logBlock('Creating models from current schema', "QUESTION");
     $this->createTask('propel:build-model')->run();
     $this->logBlock('Creating forms from current schema', "QUESTION");
     $this->createTask('propel:build-forms')->run();
     $this->logBlock('Setting AppFlower project permissions', "QUESTION");
     $this->createTask('afs:fix-perms')->run();
     $this->logBlock('Creating AppFlower validator cache', "QUESTION");
     $this->createTask('appflower:validator-cache')->run(array('frontend', 'cache', 'yes'));
     $this->logBlock('Clearing Symfony cache', "QUESTION");
     $this->createTask('cc')->run();
 }
开发者ID:cbsistem,项目名称:appflower_studio,代码行数:36,代码来源:afsInitTask.class.php

示例3: initialize

 /**
  * @see sfPluginConfiguration
  */
 public function initialize()
 {
     sfConfig::set('sf_orm', 'propel');
     if (!sfConfig::get('sf_admin_module_web_dir')) {
         sfConfig::set('sf_admin_module_web_dir', '/sfPropelPlugin');
     }
     sfToolkit::addIncludePath(array(sfConfig::get('sf_root_dir'), sfConfig::get('sf_propel_runtime_path', realpath(dirname(__FILE__) . '/../lib/vendor'))));
     require_once 'propel/Propel.php';
     if (!Propel::isInit()) {
         if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) {
             Propel::setLogger(new sfPropelLogger($this->dispatcher));
         }
         $propelConfiguration = new PropelConfiguration();
         Propel::setConfiguration($propelConfiguration);
         $this->dispatcher->notify(new sfEvent($propelConfiguration, 'propel.configure'));
         Propel::initialize();
     }
     $this->dispatcher->connect('user.change_culture', array('sfPropel', 'listenToChangeCultureEvent'));
     if (sfConfig::get('sf_web_debug')) {
         $this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelPropel', 'listenToAddPanelEvent'));
     }
     if (sfConfig::get('sf_test')) {
         $this->dispatcher->connect('context.load_factories', array($this, 'clearAllInstancePools'));
     }
 }
开发者ID:xfifix,项目名称:symfony-1.4,代码行数:28,代码来源:sfPropelPluginConfiguration.class.php

示例4: initialize

 public function initialize()
 {
     sfToolkit::addIncludePath(array($this->rootDir . '/lib/vendor/Shindig/'));
     $this->dispatcher->connect('op_confirmation.list', array($this, 'getConfirmList'));
     $this->dispatcher->connect('op_confirmation.decision', array($this, 'processConfirm'));
     $this->dispatcher->connect('op_opensocial.addapp', array($this, 'processAddAppEvent'));
     $this->dispatcher->connect('op_opensocial.removeapp', array($this, 'processRemoveAppEvent'));
 }
开发者ID:niryuu,项目名称:opOpenSocialPlugin,代码行数:8,代码来源:opOpenSocialPluginConfiguration.class.php

示例5: initialize

 public function initialize()
 {
     sfToolkit::addIncludePath(array(realpath(dirname(__FILE__) . '/../lib/PHPExcel')));
     if ($this->configuration instanceof sfApplicationConfiguration) {
         if ($file = $this->configuration->getConfigCache()->checkConfig('config/phpexcel.yml', true)) {
             include $file;
         }
     }
 }
开发者ID:nagiro,项目名称:hospici_cultural,代码行数:9,代码来源:sfPhpExcelPluginConfiguration.class.php

示例6: initialize

 public function initialize()
 {
     $pathToPlugin = sfConfig::get('sf_plugins_dir') . '/opPluginChannelServerPlugin';
     sfToolkit::addIncludePath(array($pathToPlugin . '/lib/vendor/PEAR/', $pathToPlugin . '/lib/vendor/ActiveResource/'));
     $this->dispatcher->connect('op_confirmation.list', array($this, 'listJoinConfirmation'));
     $this->dispatcher->connect('op_confirmation.decision', array($this, 'processJoinConfirmation'));
     $this->dispatcher->connect('response.filter_content', array($this, 'cacheOutput'));
     /*
     $this->dispatcher->connect('op_action.post_execute_friend_link', array('opMessagePluginObserver', 'listenToPostActionEventSendFriendLinkRequestMessage'));
     $this->dispatcher->connect('form.post_configure', array('opMessagePluginObserver', 'injectMessageFormField'));
     */
     $this->dispatcher->connect('op_action.post_execute_package_home', array(__CLASS__, 'appendHatenaStar'));
 }
开发者ID:balibali,项目名称:opPluginChannelServerPlugin,代码行数:13,代码来源:opPluginChannelServerPluginConfiguration.class.php

示例7: initialize

 /**
  * @see sfPluginConfiguration
  */
 public function initialize()
 {
     sfConfig::set('sf_orm', 'propel');
     if (!sfConfig::get('sf_admin_module_web_dir')) {
         sfConfig::set('sf_admin_module_web_dir', '/sfPropelPlugin');
     }
     sfToolkit::addIncludePath(array(sfConfig::get('sf_root_dir'), sfConfig::get('sf_symfony_lib_dir'), realpath(dirname(__FILE__) . '/../lib/vendor')));
     if (sfConfig::get('sf_web_debug')) {
         require_once dirname(__FILE__) . '/../lib/debug/sfWebDebugPanelPropel.class.php';
         $this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelPropel', 'listenToAddPanelEvent'));
     }
     if (sfConfig::get('sf_test')) {
         $this->dispatcher->connect('context.load_factories', array('sfPropel', 'clearAllInstancePools'));
     }
 }
开发者ID:bigcalm,项目名称:urlcatcher,代码行数:18,代码来源:sfPropelPluginConfiguration.class.php

示例8: getGeneratorConfig

 protected function getGeneratorConfig($params = array())
 {
     $iniFile = sfConfig::get('sf_config_dir') . '/propel.ini';
     if (!$params && file_exists($iniFile)) {
         $params = parse_ini_file($iniFile);
     }
     $behaviorsMapping = array('timestampable' => 'TimestampableBehavior', 'alternative_coding_standards' => 'AlternativeCodingStandardsBehavior', 'soft_delete' => 'SoftDeleteBehavior', 'auto_add_pk' => 'AutoAddPkBehavior', 'nested_set' => 'nestedset.NestedSetBehavior', 'sortable' => 'sortable.SortableBehavior', 'sluggable' => 'sluggable.SluggableBehavior', 'concrete_inheritance' => 'concrete_inheritance.ConcreteInheritanceBehavior', 'query_cache' => 'query_cache.QueryCacheBehavior', 'aggregate_column' => 'aggregate_column.AggregateColumnBehavior', 'versionable' => 'versionable.VersionableBehavior', 'i18n' => 'i18n.I18nBehavior');
     foreach ($behaviorsMapping as $behavior => $value) {
         $key = 'propel.behavior.' . $behavior . '.class';
         if (!isset($params[$key])) {
             $params[$key] = 'behavior.' . $value;
         }
     }
     sfToolkit::addIncludePath(array(sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__) . '/../vendor/propel/generator/lib'))));
     require_once 'config/GeneratorConfig.php';
     return new GeneratorConfig($params);
 }
开发者ID:rafix,项目名称:gesCorreo,代码行数:17,代码来源:sfPropelBaseTask.class.php

示例9: initialize

 public function initialize()
 {
     sfToolkit::addIncludePath(dirname(__FILE__) . '/../lib/vendor');
 }
开发者ID:nise-nabe,项目名称:opGyoenKintaiPlugin,代码行数:4,代码来源:opGyoenKintaiPluginConfiguration.class.php

示例10: realpath

<?php

sfConfig::set('sf_orm', 'propel');
if (!sfConfig::get('sf_admin_module_web_dir')) {
    sfConfig::set('sf_admin_module_web_dir', '/sfPropelPlugin');
}
sfToolkit::addIncludePath(array(sfConfig::get('sf_root_dir'), sfConfig::get('sf_symfony_lib_dir'), realpath(dirname(__FILE__) . '/../lib/vendor')));
if (sfConfig::get('sf_web_debug')) {
    require_once dirname(__FILE__) . '/../lib/debug/sfWebDebugPanelPropel.class.php';
    $this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelPropel', 'listenToAddPanelEvent'));
}
if (sfConfig::get('sf_test')) {
    $this->dispatcher->connect('context.load_factories', array('sfPropel', 'clearAllInstancePools'));
}
开发者ID:yasirgit,项目名称:afids,代码行数:14,代码来源:config.php

示例11: initialize

 public function initialize()
 {
     sfToolkit::addIncludePath(OPENPNE3_CONFIG_DIR . '/../lib/vendor');
 }
开发者ID:nishizoe,项目名称:opGyoenKintaiPlugin,代码行数:4,代码来源:opGyoenKintaiPluginConfiguration.class.php

示例12: array

$t->is(sfToolkit::getArrayValueForPath($arr, 'foobar'), 'foo', '::getArrayValueForPath() returns the value of the path if it exists');
$t->is(sfToolkit::getArrayValueForPath($arr, 'barfoo'), null, '::getArrayValueForPath() returns null if the path does not exist');
$t->is(sfToolkit::getArrayValueForPath($arr, 'barfoo', 'bar'), 'bar', '::getArrayValueForPath() takes a default value as its third argument');
$t->is(sfToolkit::getArrayValueForPath($arr, 'foo[bar][baz]'), 'foo bar', '::getArrayValueForPath() works with deep paths');
$t->is(sfToolkit::getArrayValueForPath($arr, 'foo[bar][bar]'), false, '::getArrayValueForPath() works with deep paths');
$t->is(sfToolkit::getArrayValueForPath($arr, 'foo[bar][bar]', 'bar'), 'bar', '::getArrayValueForPath() works with deep paths');
$t->is(sfToolkit::getArrayValueForPath($arr, 'foo[]'), array('bar' => array('baz' => 'foo bar')), '::getArrayValueForPath() accepts a [] at the end to check for an array');
$t->is(sfToolkit::getArrayValueForPath($arr, 'foobar[]'), null, '::getArrayValueForPath() accepts a [] at the end to check for an array');
$t->is(sfToolkit::getArrayValueForPath($arr, 'barfoo[]'), null, '::getArrayValueForPath() accepts a [] at the end to check for an array');
$t->is(sfToolkit::getArrayValueForPath($arr, 'foobar[]', 'foo'), 'foo', '::getArrayValueForPath() accepts a [] at the end to check for an array');
$t->is(sfToolkit::getArrayValueForPath($arr, 'bar[1]'), 'bar', '::getArrayValueForPath() can take an array indexed by integer');
$t->is(sfToolkit::getArrayValueForPath($arr, 'bar[2]'), null, '::getArrayValueForPath() can take an array indexed by integer');
$t->is(sfToolkit::getArrayValueForPath($arr, 'bar[2]', 'foo'), 'foo', '::getArrayValueForPath() can take an array indexed by integer');
$t->is(sfToolkit::getArrayValueForPath($arr, 'foo[bar][baz][booze]'), null, '::getArrayValueForPath() is not fooled by php mistaking strings and array');
// ::addIncludePath()
$t->diag('::addIncludePath()');
$path = get_include_path();
$t->is(sfToolkit::addIncludePath(__DIR__), $path, '::addIncludePath() returns the previous include_path');
$t->is(get_include_path(), __DIR__ . PATH_SEPARATOR . $path, '::addIncludePath() adds a path to the front of include_path');
sfToolkit::addIncludePath(__DIR__, 'back');
$t->is(get_include_path(), $path . PATH_SEPARATOR . __DIR__, '::addIncludePath() moves a path to the end of include_path');
sfToolkit::addIncludePath(array(__DIR__, __DIR__ . '/..'));
$t->is(get_include_path(), __DIR__ . PATH_SEPARATOR . __DIR__ . '/..' . PATH_SEPARATOR . $path, '::addIncludePath() adds multiple paths the the front of include_path');
sfToolkit::addIncludePath(array(__DIR__, __DIR__ . '/..'), 'back');
$t->is(get_include_path(), $path . PATH_SEPARATOR . __DIR__ . PATH_SEPARATOR . __DIR__ . '/..', '::addIncludePath() adds multiple paths the the back of include_path');
try {
    sfToolkit::addIncludePath(__DIR__, 'foobar');
    $t->fail('::addIncludePath() throws an exception if position is not valid');
} catch (Exception $e) {
    $t->pass('::addIncludePath() throws an exception if position is not valid');
}
开发者ID:yankeemedia,项目名称:symfony1,代码行数:31,代码来源:sfToolkitTest.php

示例13: define

<?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.
 */

define('SF_DIR', dirname(__FILE__).'/../../../../lib/vendor/symfony/');
require_once SF_DIR . 'test/bootstrap/unit.php';
require_once SF_DIR . 'lib/autoload/sfSimpleAutoload.class.php';

$autoload = sfSimpleAutoload::getInstance(sys_get_temp_dir().DIRECTORY_SEPARATOR.sprintf('sf_autoload_unit_propel_%s.data', md5(__FILE__)));
$autoload->addDirectory(realpath(dirname(__FILE__).'/../../lib'));
$autoload->addDirectory(realpath(dirname(__FILE__).'/../../lib/vendor/propel'));
$autoload->addDirectory(realpath(dirname(__FILE__).'/../../lib/vendor/phing/classes'));
$autoload->register();

$_test_dir = realpath(dirname(__FILE__).'/..');

sfToolkit::addIncludePath(dirname(__FILE__).'/../../lib/vendor');
sfToolkit::addIncludePath(dirname(__FILE__).'/../../lib/vendor/propel');
sfToolkit::addIncludePath(dirname(__FILE__).'/../../lib/vendor/phing/classes');
开发者ID:nurhidayatullah,项目名称:inventory,代码行数:25,代码来源:unit.php

示例14: dirname

<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 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.
 */
require_once dirname(__FILE__) . '/../../bootstrap/unit.php';
sfToolkit::addIncludePath(sfConfig::get('sf_symfony_lib_dir') . '/plugins/sfPropelPlugin/lib/vendor');
$t = new lime_test(1, new lime_output_color());
$configuration = array('propel' => array('datasources' => array('propel' => array('adapter' => 'mysql', 'connection' => array('dsn' => 'mysql:dbname=testdb;host=localhost', 'user' => 'foo', 'password' => 'bar', 'classname' => 'PropelPDO', 'options' => array('ATTR_PERSISTENT' => true, 'ATTR_AUTOCOMMIT' => false), 'settings' => array('charset' => array('value' => 'utf8'), 'queries' => array()))), 'default' => 'propel')));
$parametersTests = array('dsn' => 'mysql:dbname=testdb;host=localhost', 'username' => 'foo', 'password' => 'bar', 'encoding' => 'utf8', 'persistent' => true, 'options' => array('ATTR_AUTOCOMMIT' => false));
$p = new sfPropelDatabase($parametersTests);
$t->is($p->getConfiguration(), $configuration, 'initialize() - creates a valid propel configuration from parameters');
开发者ID:JimmyVB,项目名称:Symfony-v1.2,代码行数:16,代码来源:sfPropelDatabaseTest.php

示例15: get_include_path

// ::addIncludePath()
$t->diag('::addIncludePath()');
$path = get_include_path();
$t->is(sfToolkit::addIncludePath(dirname(__FILE__)), $path, '::addIncludePath() returns the previous include_path');
$t->is(get_include_path(), dirname(__FILE__).PATH_SEPARATOR.$path, '::addIncludePath() adds a path to the front of include_path');

sfToolkit::addIncludePath(dirname(__FILE__), 'back');
$t->is(get_include_path(), $path.PATH_SEPARATOR.dirname(__FILE__), '::addIncludePath() moves a path to the end of include_path');

sfToolkit::addIncludePath(array(
  dirname(__FILE__),
  dirname(__FILE__).'/..',
));
$t->is(get_include_path(), dirname(__FILE__).PATH_SEPARATOR.dirname(__FILE__).'/..'.PATH_SEPARATOR.$path, '::addIncludePath() adds multiple paths the the front of include_path');

sfToolkit::addIncludePath(array(
  dirname(__FILE__),
  dirname(__FILE__).'/..',
), 'back');
$t->is(get_include_path(), $path.PATH_SEPARATOR.dirname(__FILE__).PATH_SEPARATOR.dirname(__FILE__).'/..', '::addIncludePath() adds multiple paths the the back of include_path');

try
{
  sfToolkit::addIncludePath(dirname(__FILE__), 'foobar');
  $t->fail('::addIncludePath() throws an exception if position is not valid');
}
catch (Exception $e)
{
  $t->pass('::addIncludePath() throws an exception if position is not valid');
}
开发者ID:nationalfield,项目名称:symfony,代码行数:30,代码来源:sfToolkitTest.php


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