Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 37 lines (29 sloc) 0.836 kb
#!/usr/bin/env php
<?php
// main working directory
define ( 'SPARK_DIR', dirname (__FILE__) );
@chdir(SPARK_DIR);
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);
Jump to Line
Something went wrong with that request. Please try again.