mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-03-05 04:54:34 +00:00
32
tools/spark
Normal file
32
tools/spark
Normal 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);
|
||||
Reference in New Issue
Block a user