protected function buildCommands() { $cmds = array(); foreach ($this->kernel->getWidgetsPath() as $path) { $cmds += $this->getCmdFromDir($path, 'widget.'); } return $cmds; }
<?php /** * @author Wojtek Oledzki <*****@*****.**> * * Dashbord CLI */ $autoloaderPath = __DIR__ . '/../../../autoload.php'; if (!is_file($autoloaderPath)) { $autoloaderPath = __DIR__ . '/../vendor/autoload.php'; } include $autoloaderPath; $kernel = new \Hoborg\Dashboard\Kernel(__DIR__ . '/../', 'prod'); $option = getopt('c:p:d:'); $kernel->handleCli($option);
<?php $rootPath = getenv('DASHBOARD_ROOT') ? getenv('DASHBOARD_ROOT') : __DIR__ . '/..'; require_once "{$rootPath}/vendor/autoload.php"; $kernel = new \Hoborg\Dashboard\Kernel($rootPath); $kernel->setDefaultParam('conf', 'demo'); $kernel->handle(array_merge($_GET, $_POST));