/** * Init class * @return true */ public static function init() { global $zbp; // Set Z-BlogPHP Enviroment $zbp->option['ZC_RUNINFO_DISPLAY'] = false; self::$Route = API_Route::getInstance(); self::$IO = API_IO::getInstance(isset($_SERVER['ACCEPT']) ? $_SERVER['ACCEPT'] : 'application/json'); self::$User = API_User::getInstance(); $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(API_PATH . '/route'), RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $path) { $fileName = $path->__toString(); if ($path->isFile()) { include $fileName; } } return true; }
$page->show(); break; /* * API used by JS, and possibly others... */ /* * API used by JS, and possibly others... */ case 'api': if (count($parameters) < 1) { throw new Exception('Missing parameter'); } $action2 = array_shift($parameters); switch ($action2) { case 'user': $api = new API_User($config, $parameters); $api->show(); break; case 'discojuice': $api = new API_DiscoJuice($config, $parameters); $api->show(); break; case 'foodlelist': $api = new API_Foodlelist($config, $parameters); $api->show(); break; case 'activity': $api = new API_Activity($config, $parameters); $api->show(); break; case 'e':