Compare commits

..

No commits in common. "master" and "v1.0.0" have entirely different histories.

2 changed files with 26 additions and 8 deletions

View File

@ -1 +0,0 @@
This package is now obsolete. Consider using **bit/taskman_composer** instead please.

View File

@ -1,17 +1,36 @@
<?php <?php
namespace taskman; namespace taskman;
task('deps_update', function() task('try_deps_update', ['always' => true], function()
{ {
update_composer(true); global $GAME_ROOT;
if(try_update_composer())
echo "Composer was updated...\n";
if(file_exists("$GAME_ROOT/composer/vendor/composer/autoload_real.php"))
include_once("$GAME_ROOT/composer/vendor/autoload.php");
}); });
//NOTE: COMPOSER_FORCE_UPDATE = true will make composer to update packages and task('deps_update', function()
// a lock file {
// COMPOSER_FORCE_UPDATE = false will make composer install dependencies update_composer();
// listed in a lock file in case if it's present });
function update_composer($COMPOSER_FORCE_UPDATE = false)
function update_composer()
{ {
global $GAME_ROOT; global $GAME_ROOT;
include("$GAME_ROOT/composer/update.php"); include("$GAME_ROOT/composer/update.php");
} }
function try_update_composer()
{
global $GAME_ROOT;
if(!need_to_regen("$GAME_ROOT/composer/composer.last", ["$GAME_ROOT/composer/composer.json"]))
return false;
update_composer();
touch("$GAME_ROOT/composer/composer.last");
return true;
}