codeformunich/Muenchen-Transparent

View on GitHub
protected/commands/Reindex_BA_GremienCommand.php

Summary

Maintainability
A
2 hrs
Test Coverage
<?php

class Reindex_BA_GremienCommand extends CConsoleCommand
{
    public function run($args)
    {
        if (posix_getuid() === 0) die("This command cannot be run as root");
        if (!isset($args[0]) || ($args[0] != "alle" && $args[0] <= 1)) die("./yiic reindex_ba_gremien [BA-Gremien-ID]|alle\n");

        $parser = new BAGremienParser();

        if ($args[0] == "alle") {
            $parser->parseAll();
        } elseif ($args[0] > 0) {
            $parser->parse($args[0]);
        }
    }
}