function package($op = null, $pkgname = null) { ModuleManager::load('lepton.utils.l2package'); switch ($op) { case 'install': $pm = new L2PackageManager(); $pkg = new L2Package($pkgname); $pm->installPackage($pkg); break; case 'remove': $pm = new L2PackageManager(); $pkg = new L2Package($pkgname); $pm->removePackage($pkg); break; case 'list': $pm = new L2PackageManager(); $pm->listPackages(); break; default: Console::writeLn(__astr("\\b{Package}: Manage packages (l2p)")); Console::writeLn(__astr(" package \\b{install} \\u{package.l2p} Installs a package")); Console::writeLn(__astr(" package \\b{remove} \\u{package} Removes a package")); Console::writeLn(__astr(" package \\b{list} [\\u{package}] List packages")); Console::writeLn(__astr(" package \\b{info} [\\u{package}] Show information on packages")); Console::writeLn(__astr(" package \\b{find} [\\u{filename}] Find package that owns file")); Console::writeLn(__astr(" package \\b{update} [\\u{package}|\\b{all}] List packages")); Console::writeLn(); } }
public function check() { using('lepton.utils.l2package'); $pm = new L2PackageManager(); $pm->listPackages(); }