CodeIgniter package management system, Sparks

http://getsparks.org
This commit is contained in:
Ismo Vuorinen
2013-07-11 07:44:42 +03:00
parent c10c9e3131
commit fabd8585ab
19 changed files with 1309 additions and 0 deletions

32
tools/spark Normal file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env php
<?php
require_once 'lib/spark/spark_source.php';
require_once 'lib/spark/spark_cli.php';
// define a source
$sources = array();
if ($fh = @fopen(dirname(__FILE__) . '/lib/spark/sources', 'r'))
{
while ($line = fgets($fh))
{
$line = trim($line);
if ($line && $line[0] != '#') $sources[] = new Spark_source($line);
}
fclose($fh);
}
if (count($sources) == 0)
{
$default_source = 'sparks.oconf.org';
Spark_utils::warning("No sources found, using $default_source");
$sources[] = new Spark_source($default_source);
}
// take commands
$cli = new Spark_CLI($sources);
$cmd = $argc > 1 ? $argv[1] : null;
$args = $argc > 2 ? array_slice($argv, 2) : array();
$cli->execute($cmd, $args);