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


PHP Phing::setProperty方法代码示例

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


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

示例1: testGetFileSystemReturnsCorrect

 /**
  * @dataProvider fileSystemMappingsDataProvider
  */
 public function testGetFileSystemReturnsCorrect($expectedFileSystemClass, $fsTypeKey)
 {
     $this->_resetFileSystem();
     Phing::setProperty('host.fstype', $fsTypeKey);
     $system = FileSystem::getFileSystem();
     $this->assertInstanceOf($expectedFileSystemClass, $system);
 }
开发者ID:eduardobenito10,项目名称:jenkins-php-quickstart,代码行数:10,代码来源:FileSystemTest.php

示例2: call_phing

 public static function call_phing($task, $target, $build_file = '', $options = array())
 {
     $args = array();
     foreach ($options as $key => $value) {
         $args[] = "-D{$key}={$value}";
     }
     if ($build_file) {
         $args[] = '-f';
         $args[] = realpath($build_file);
     }
     if (!$task->is_verbose()) {
         $args[] = '-q';
     }
     if (is_array($target)) {
         $args = array_merge($args, $target);
     } else {
         $args[] = $target;
     }
     if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT))) {
         $args[] = '-logger';
         $args[] = 'phing.listener.AnsiColorLogger';
     }
     Phing::startup();
     Phing::setProperty('phing.home', getenv('PHING_HOME'));
     $m = new pakePhing();
     $m->execute($args);
     $m->runBuild();
 }
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:28,代码来源:pakePhingTask.class.php

示例3: call_phing

 public static function call_phing($task, $target, $build_file = '', $options = array())
 {
     $args = array();
     foreach ($options as $key => $value) {
         $args[] = "-D{$key}={$value}";
     }
     if ($build_file) {
         $args[] = '-f';
         $args[] = realpath($build_file);
     }
     if (!$task->is_verbose()) {
         $args[] = '-q';
     }
     if (is_array($target)) {
         $args = array_merge($args, $target);
     } else {
         $args[] = $target;
     }
     Phing::startup();
     Phing::setProperty('phing.home', getenv('PHING_HOME'));
     ob_start(array('pakePhingTask', 'colorize'), 2);
     $m = new pakePhing();
     $m->execute($args);
     $m->runBuild();
     ob_end_clean();
 }
开发者ID:DBezemer,项目名称:server,代码行数:26,代码来源:pakePhingTask.class.php

示例4: setUp

 protected function setUp()
 {
     if (version_compare(PHP_VERSION, '5.3.2') < 0) {
         define('E_DEPRECATED', 8192);
     }
     chdir(dirname(__FILE__));
     Phing::setProperty('phing.home', ZECLIB_TEST_VENDOR_DIR . '/phing');
     Phing::startup();
 }
开发者ID:zenith6,项目名称:eccube-zeclib,代码行数:9,代码来源:TaskTestBase.php

示例5: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     try {
         $args = $this->preparePhingArgs($input, $output);
         $phingClasspath = $this->getContainer()->getParameter('rhapsody_phing.phing_classpath');
         $phingHome = $this->getContainer()->getParameter('rhapsody_phing.phing_home');
         if ($output->getVerbosity() == OutputInterface::VERBOSITY_VERBOSE) {
             $commandline = 'phing ' . implode(' ', $args);
             $output->writeln('Executing Phing with: ' . $commandline);
         }
         //require_once('phing/Phing.php');
         \Phing::startup();
         \Phing::setProperty('rhapsody_phing.home', $phingHome);
         \Phing::fire($args);
         \Phing::shutdown();
     } catch (ConfigurationException $x) {
         Phing::printMessage($x);
         exit(-1);
     } catch (Exception $x) {
         exit(1);
     }
 }
开发者ID:rhapsody-project,项目名称:phing-bundle,代码行数:25,代码来源:PhingCommand.php

示例6: callPhing

 protected function callPhing($taskName, $checkSchema, $properties = array())
 {
     $schemas = sfFinder::type('file')->name('*schema.xml')->relative()->follow_link()->in(sfConfig::get('sf_config_dir'));
     if (self::CHECK_SCHEMA === $checkSchema && !$schemas) {
         throw new sfCommandException('You must create a schema.yml or schema.xml file.');
     }
     // Call phing targets
     sfToolkit::addIncludePath(array(sfConfig::get('sf_symfony_lib_dir'), sfConfig::get('sf_propel_generator_path', realpath(dirname(__FILE__) . '/../vendor/propel-generator/classes'))));
     $args = array();
     $bufferPhingOutput = null === $this->commandApplication || !$this->commandApplication->withTrace();
     $properties = array_merge(array('build.properties' => 'propel.ini', 'project.dir' => sfConfig::get('sf_config_dir'), 'propel.output.dir' => sfConfig::get('sf_root_dir')), $properties);
     foreach ($properties as $key => $value) {
         $args[] = "-D{$key}={$value}";
     }
     // Build file
     $args[] = '-f';
     $args[] = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'propel-generator' . DIRECTORY_SEPARATOR . 'build.xml');
     // Logger
     if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT))) {
         $args[] = '-logger';
         $args[] = 'phing.listener.AnsiColorLogger';
     }
     // Add our listener to detect errors
     $args[] = '-listener';
     $args[] = 'sfPhingListener';
     // Add any arbitrary arguments last
     foreach ($this->additionalPhingArgs as $arg) {
         if (in_array($arg, array('verbose', 'debug'))) {
             $bufferPhingOutput = false;
         }
         $args[] = '-' . $arg;
     }
     $args[] = $taskName;
     // filter arguments through the event dispatcher
     $args = $this->dispatcher->filter(new sfEvent($this, 'propel.filter_phing_args'), $args)->getReturnValue();
     require_once dirname(__FILE__) . '/sfPhing.class.php';
     // enable output buffering
     Phing::setOutputStream(new OutputStream(fopen('php://output', 'w')));
     Phing::startup();
     Phing::setProperty('phing.home', getenv('PHING_HOME'));
     $this->logSection('propel', 'Running "' . $taskName . '" phing task');
     if ($bufferPhingOutput) {
         ob_start();
     }
     $m = new sfPhing();
     $m->execute($args);
     $m->runBuild();
     if ($bufferPhingOutput) {
         ob_end_clean();
     }
     chdir(sfConfig::get('sf_root_dir'));
     // any errors?
     $ret = true;
     if (sfPhingListener::hasErrors()) {
         $messages = array('Some problems occurred when executing the task:');
         foreach (sfPhingListener::getExceptions() as $exception) {
             $messages[] = '';
             $messages[] = preg_replace('/^.*build\\-propel\\.xml/', 'build-propel.xml', $exception->getMessage());
             $messages[] = '';
         }
         if (count(sfPhingListener::getErrors())) {
             $messages[] = 'If the exception message is not clear enough, read the output of the task for';
             $messages[] = 'more information';
         }
         $this->logBlock($messages, 'ERROR_LARGE');
         $ret = false;
     }
     return $ret;
 }
开发者ID:sensorsix,项目名称:app,代码行数:69,代码来源:sfPropelBaseTask.class.php

示例7: define

    if (!defined('PHP_CLASSPATH')) {
        define('PHP_CLASSPATH', getenv('PHP_CLASSPATH') . PATH_SEPARATOR . get_include_path());
    }
    ini_set('include_path', PHP_CLASSPATH);
} else {
    if (!defined('PHP_CLASSPATH')) {
        define('PHP_CLASSPATH', get_include_path());
    }
}
require_once 'phing/Phing.php';
try {
    /* Setup Phing environment */
    Phing::startup();
    // Set phing.home property to the value from environment
    // (this may be NULL, but that's not a big problem.)
    Phing::setProperty('phing.home', getenv('PHING_HOME'));
    // Grab and clean up the CLI arguments
    $args = isset($argv) ? $argv : $_SERVER['argv'];
    // $_SERVER['argv'] seems to not work (sometimes?) when argv is registered
    array_shift($args);
    // 1st arg is script name, so drop it
    // Invoke the commandline entry point
    Phing::fire($args);
    // Invoke any shutdown routines.
    Phing::shutdown();
} catch (ConfigurationException $x) {
    Phing::printMessage($x);
    exit(-1);
    // This was convention previously for configuration errors.
} catch (Exception $x) {
    // Assume the message was already printed as part of the build and
开发者ID:umesecke,项目名称:phing,代码行数:31,代码来源:phing.php

示例8: runPhing

 /**
  * 
  * @param string $taskName
  */
 public function runPhing($taskName)
 {
     // Copy Files
     $this->mySchemaBuilder->loadXmlFiles();
     // Create build.properties file
     $this->createBuildPropertiesFile($this->tmpDir . '/build.properties');
     // Create buildtime-conf file
     $this->createBuildTimeConfFile($this->tmpDir . '/buildtime-conf.xml');
     //
     $args = array();
     $args = $this->getPhingArguments();
     $args[] = $taskName;
     // Enable output buffering
     \Phing::setOutputStream(new \OutputStream(fopen('php://output', 'w')));
     \Phing::setErrorStream(new \OutputStream(fopen('php://output', 'w')));
     \Phing::startup();
     \Phing::setProperty('phing.home', getenv('PHING_HOME'));
     //
     $myPhing = new \Phing();
     //$returnStatus = true;
     $myPhing->execute($args);
     $myPhing->runBuild();
     /*$this->buffer = ob_get_contents();
       // Guess errors
       if (strstr($this->buffer, 'failed. Aborting.') ||
           strstr($this->buffer, 'Failed to execute') ||
           strstr($this->buffer, 'failed for the following reason:')) {
       }*/
 }
开发者ID:rk4an,项目名称:centreon,代码行数:33,代码来源:PropelMigration.php

示例9: buildProject

 /**
  * Calls Phing's methods to generate propel's objects
  *
  * @param string $libraries_path
  * @param array $arguments
  */
 public static function buildProject($libraries_path, array &$arguments)
 {
     require_once 'phing/Phing.php';
     Phing::startup();
     Phing::setProperty('phing.home', $libraries_path . 'phing');
     Phing::start($arguments);
 }
开发者ID:nmicht,项目名称:tlalokes-in-acst,代码行数:13,代码来源:TlalokesPropelFactory.php

示例10: defined

<?php

defined('PHING_TEST_BASE') || define('PHING_TEST_BASE', dirname(__FILE__));
set_include_path(realpath(dirname(__FILE__) . '/../classes') . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/classes') . PATH_SEPARATOR . get_include_path());
require_once dirname(__FILE__) . '/classes/phing/BuildFileTest.php';
require_once 'phing/Phing.php';
Phing::setProperty('phing.home', realpath(dirname(__FILE__) . '/../'));
Phing::startup();
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT);
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:9,代码来源:bootstrap.php

示例11: callPhing

 protected function callPhing($taskName, $checkSchema)
 {
     $schemas = sfFinder::type('file')->name('*schema.xml')->relative()->follow_link()->in('config');
     if (self::CHECK_SCHEMA === $checkSchema && !$schemas) {
         throw new sfCommandException('You must create a schema.yml or schema.xml file.');
     }
     // Call phing targets
     if (false === strpos('propel-generator', get_include_path())) {
         set_include_path(sfConfig::get('sf_symfony_lib_dir') . '/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes' . PATH_SEPARATOR . get_include_path());
     }
     set_include_path(sfConfig::get('sf_root_dir') . PATH_SEPARATOR . get_include_path());
     $args = array();
     // Needed to include the right Propel builders
     set_include_path(sfConfig::get('sf_symfony_lib_dir') . PATH_SEPARATOR . get_include_path());
     $options = array('project.dir' => sfConfig::get('sf_config_dir'), 'build.properties' => 'propel.ini', 'propel.output.dir' => sfConfig::get('sf_root_dir'));
     foreach ($options as $key => $value) {
         $args[] = "-D{$key}={$value}";
     }
     // Build file
     $args[] = '-f';
     $args[] = realpath(sfConfig::get('sf_symfony_lib_dir') . '/plugins/sfPropelPlugin/lib/vendor/propel-generator/build.xml');
     if (is_null($this->commandApplication) || !$this->commandApplication->isVerbose()) {
         $args[] = '-q';
     }
     if (!is_null($this->commandApplication) && $this->commandApplication->withTrace()) {
         $args[] = '-debug';
     }
     // Logger
     if (DIRECTORY_SEPARATOR != '\\' && (function_exists('posix_isatty') && @posix_isatty(STDOUT))) {
         $args[] = '-logger';
         $args[] = 'phing.listener.AnsiColorLogger';
     }
     $args[] = $taskName;
     require_once dirname(__FILE__) . '/sfPhing.class.php';
     Phing::startup();
     Phing::setProperty('phing.home', getenv('PHING_HOME'));
     $m = new sfPhing();
     $m->execute($args);
     $m->runBuild();
     chdir(sfConfig::get('sf_root_dir'));
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:41,代码来源:sfPropelBaseTask.class.php

示例12: catch

    }
    $project->fireBuildFinished(null);
    if ($project->getProperty('project.available')) {
        $GLOBALS['PROJECT_DIRECTORY'] = $project->getProperty('project.directory');
    }
} catch (Exception $e) {
    /* This failed. Can't figure out project directory. Forget it. */
}
/* Switch to whichever project directory the script determined. */
$GLOBALS['PROPERTIES']['project.directory'] = $GLOBALS['PROJECT_DIRECTORY'];
/* Execute Phing. */
try {
    $project = new Project();
    // hax for Mac OS X 10.5 Leopard, where "dim" ANSI colors are broken...
    if (PHP_OS == 'Darwin' && (isset($_SERVER['TERM_PROGRAM']) && $_SERVER['TERM_PROGRAM'] == 'Apple_Terminal' || isset($_ENV['TERM_PROGRAM']) && $_ENV['TERM_PROGRAM'] == 'Apple_Terminal') && version_compare(preg_replace('/^ProductVersion:\\s*([0-9]+\\.[0-9]+)/ms', '$1', shell_exec('sw_vers')), '10.5', 'eq') && !Phing::getProperty('phing.logger.defaults')) {
        Phing::setProperty('phing.logger.defaults', new PhingFile(BUILD_DIRECTORY . '/agavi/phing/ansicolorlogger_osxleopard.properties'));
    } elseif (stripos(PHP_OS, 'Win') === 0) {
        $GLOBALS['LOGGER'] = 'phing.listener.DefaultLogger';
    }
    $GLOBALS['LOGGER'] = Phing::import($GLOBALS['LOGGER']);
    $logger = new AgaviProxyBuildLogger(new $GLOBALS['LOGGER']());
    $logger->setMessageOutputLevel($GLOBALS['VERBOSE'] ? Project::MSG_VERBOSE : Project::MSG_INFO);
    $logger->setOutputStream($GLOBALS['OUTPUT']);
    $logger->setErrorStream($GLOBALS['ERROR']);
    $project->addBuildListener($logger);
    $project->setInputHandler(new DefaultInputHandler());
    $project->setUserProperty('phing.file', $GLOBALS['BUILD']->getAbsolutePath());
    $project->setUserProperty('phing.version', Phing::getPhingVersion());
    /* Phing fucks with the cwd. Really, brilliant. */
    $project->setUserProperty('application.startdir', START_DIRECTORY);
    foreach ($GLOBALS['PROPERTIES'] as $name => $value) {
开发者ID:philippjenni,项目名称:icinga-web,代码行数:31,代码来源:agavi.php


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