<?php Leaps::setAlias('Common', dirname(__DIR__)); Leaps::setAlias('Frontend', dirname(dirname(__DIR__)) . '/Frontend'); Leaps::setAlias('Backend', dirname(dirname(__DIR__)) . '/Backend'); Leaps::setAlias('Mobile', dirname(dirname(__DIR__)) . '/Mobile'); Leaps::setAlias('WeChat', dirname(dirname(__DIR__)) . '/WeChat'); Leaps::setAlias('Api', dirname(dirname(__DIR__)) . '/Api'); Leaps::setAlias('Console', dirname(dirname(__DIR__)) . '/Console');
<?php // +---------------------------------------------------------------------- // | Leaps Framework [ WE CAN DO IT JUST THINK IT ] // +---------------------------------------------------------------------- // | Copyright (c) 2011-2014 Leaps Team (http://www.tintsoft.com) // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author XuTongle <*****@*****.**> // +---------------------------------------------------------------------- /** * 加载Leaps核心 */ require __DIR__ . '/src/Leaps/Kernel.php'; /** * Leaps is a helper class serving common framework functionalities. * * It extends from [[\Leaps\Kernel]] which provides the actual implementation. * By writing your own Leaps class, you can customize some functionalities of [[\Leaps\Kernel]]. */ class Leaps extends \Leaps\Kernel { } spl_autoload_register(['Leaps', 'autoload'], true, true); Leaps::$classMap = (require __DIR__ . '/classes.php'); Leaps::$container = new Leaps\Di\Container();
/** * Displays all available commands. */ protected function getDefaultHelp() { $commands = $this->getCommandDescriptions(); $this->stdout("\nThis is Leaps version " . \Leaps::getVersion() . ".\n"); if (!empty($commands)) { $this->stdout("\nThe following commands are available:\n\n", Console::BOLD); $len = 0; foreach ($commands as $command => $description) { $result = Leaps::$app->createController($command); if ($result !== false) { /** @var $controller Controller */ list($controller, $actionID) = $result; $actions = $this->getActions($controller); if (!empty($actions)) { $prefix = $controller->getUniqueId(); foreach ($actions as $action) { $string = $prefix . '/' . $action; if ($action === $controller->defaultAction) { $string .= ' (default)'; } if (($l = strlen($string)) > $len) { $len = $l; } } } } elseif (($l = strlen($command)) > $len) { $len = $l; } } foreach ($commands as $command => $description) { $this->stdout('- ' . $this->ansiFormat($command, Console::FG_YELLOW)); $this->stdout(str_repeat(' ', $len + 4 - strlen($command))); $this->stdout(Console::wrapText($description, $len + 4 + 2), Console::BOLD); $this->stdout("\n"); $result = Leaps::$app->createController($command); if ($result !== false) { list($controller, $actionID) = $result; $actions = $this->getActions($controller); if (!empty($actions)) { $prefix = $controller->getUniqueId(); foreach ($actions as $action) { $string = ' ' . $prefix . '/' . $action; $this->stdout(' ' . $this->ansiFormat($string, Console::FG_GREEN)); if ($action === $controller->defaultAction) { $string .= ' (default)'; $this->stdout(' (default)', Console::FG_YELLOW); } $summary = $controller->getActionHelpSummary($controller->createAction($action)); if ($summary !== '') { $this->stdout(str_repeat(' ', $len + 4 - strlen($string))); $this->stdout(Console::wrapText($summary, $len + 4 + 2)); } $this->stdout("\n"); } } $this->stdout("\n"); } } $scriptName = $this->getScriptName(); $this->stdout("\nTo see the help of each command, enter:\n", Console::BOLD); $this->stdout("\n {$scriptName} " . $this->ansiFormat('help', Console::FG_YELLOW) . ' ' . $this->ansiFormat('<command-name>', Console::FG_CYAN) . "\n\n"); } else { $this->stdout("\nNo commands are found.\n\n", Console::BOLD); } }
?> <?php echo ''; ?> <?php echo $content; ?> </div> </div> <footer class="footer"> <div class="container"> <p class="pull-left">© My Company <?php echo date('Y'); ?> </p> <p class="pull-right"><?php echo Leaps::powered(); ?> </p> </div> </footer> <?php $this->endBody(); ?> </body> </html> <?php $this->endPage();