/** * List App Modules */ public static function appModules() { $mods = array(); $apps = Apps::getEnabledApps(); foreach ($apps as $appID) { $module_name = 'app_' . Apps::normalizeID($appID); $loc = Apps::getAppsDir() . "/{$appID}/module"; if (self::valid($module_name, $loc)) { $mods[$module_name] = array("id" => $module_name, "appID" => $appID, "location" => $loc, "url" => Lobby::getURL() . "/" . FS::rel($loc)); } } return $mods; }
/** * This is useful when Lobby is run using PHP Built In Server * When no routes are matched, by default a 404 is inited, * even when the file exists in Lobby as .php file. To prevent * this, we check if the file exist and return false to the PHP * Built in Server to make it serve the file normally * http://php.net/manual/en/features.commandline.webserver.php#example-430 */ public static function pathExists() { if (\Lobby\FS::rel($_SERVER['PHP_SELF']) !== "index.php") { return file_exists(L_DIR . $_SERVER['PHP_SELF']); } return false; }
public function addStyle($fileName) { $filePath = FS::rel("{$this->dir}/css/{$fileName}"); \Assets::css("{$this->id}-{$fileName}", $filePath); }
public function __construct($base = null) { $this->base = FS::rel($base); }