本文整理汇总了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');
}
}
}
示例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();
}
示例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'));
}
}
示例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'));
}
示例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;
}
}
}
示例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'));
}
}
示例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);
}
示例9: initialize
public function initialize()
{
sfToolkit::addIncludePath(dirname(__FILE__) . '/../lib/vendor');
}
示例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'));
}
示例11: initialize
public function initialize()
{
sfToolkit::addIncludePath(OPENPNE3_CONFIG_DIR . '/../lib/vendor');
}
示例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');
}
示例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');
示例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');
示例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');
}