fileTask() public method

public fileTask ( $target, $prerequisites, $action )
Example #1
0
 function boot(Application $app)
 {
     if (!isset($app['testing.dist_config'])) {
         $app['testing.dist_config'] = "phpunit.dist.xml";
     }
     if (!isset($app['testing.phpunit_bin'])) {
         $app['testing.phpunit_bin'] = "./vendor/bin/phpunit";
     }
     $app->fileTask('phpunit.xml', array($app['testing.dist_config']), function ($task) {
         copy($task->prerequisites->current(), $task->name);
     });
     $app->task('test', array('phpunit.xml'), function () use($app) {
         b\sh($app['testing.phpunit_bin'], array('fail_on_error' => true));
     })->description = "Run test suite";
 }
Example #2
0
 function boot(Application $app)
 {
     $app->task('composer.phar', function ($task) {
         if (file_exists($task->name)) {
             return true;
         }
         $src = fopen('http://getcomposer.org/composer.phar', 'rb');
         $dest = fopen($task->name, 'wb');
         stream_copy_to_stream($src, $dest);
     });
     $app->task('composer:install', array('composer.phar'), function () {
         b\php(array('composer.phar', 'install'), null, array('failOnError' => true));
     });
     $app->task('composer:update', array('composer.phar'), function () {
         b\php(array('composer.phar', 'update'), null, array('failOnError' => true));
     });
     $app->fileTask('composer.lock', array('composer.phar', 'composer.json'), function ($task) use($app) {
         $app->task('composer:update')->invoke();
     });
 }