$valid_modules = array(); $invalid_modules = array(); foreach ($modules as $m) { if (utilities::module_valid($m)) { $valid_modules[] = $m; } else { $invalid_modules[] = $m; } } $this->modules = $valid_modules; $this->invalid_modules = $invalid_modules; return $this->modules; } } $modules_dir_name = 'pemme_modules'; $console = new jsonui_console(); $console->writeln("pemme here B)", "green"); $console->writeln("pemme auto bootstrap near field php files :)", "blue"); $console->writeln("searching for " . __DIR__ . '/pemme_modules :)', "blue"); $search_path = __DIR__ . '/' . $modules_dir_name; if (file_exists($search_path)) { $loader = new module_loader(__DIR__ . '/' . $modules_dir_name); $loader->load_modules(); $modules_count = count($loader->modules); $console->writeln("found " . $modules_count . " modules.", "blue"); if ($modules_count > 0) { $console->options("how can i help u :? ", $loader->modules); } else { $console->writeln("i have no modules to do anything :/ thats embaressing", "brown"); } $console->writeln("bye bye now :|", "green");
<?php require __DIR__ . '/vendor/autoload.php'; $console = new jsonui_console(); $console->writeln("Welcome to jsonui command line tool", "green"); $actions = (include __DIR__ . '/commands/actions.php'); $console->options("What can i do for you?", $actions["callback"]());