#!/usr/bin/env php >> DBG L." . __LINE__ . ": url: '{$url}'\n"; // UrlAction_ProjektyProNetMediaZamZlec // https://biuro.pro-netmedia.pl/dev-pl-se/index.php?_route=UrlAction_ProjektyProNetMediaZamZlec&ID_PROJECT=50 if (false === strpos($url, 'index.php')) die("Unrecognized url - no index.php\n"); $query = parse_url($url, PHP_URL_QUERY);// only query string echo">>> query:"; print_r($query);echo"\n"; $args = array(); parse_str($query, $args); echo">>> args:"; print_r($args);echo"\n"; if (!empty($args['_route'])) { $route = $args['_route']; echo">>> DBG L." . __LINE__ . ": found route '{$route}'\n"; $pathProject = dirname(__FILE__); $path = $pathProject . '/SE/se-lib/Route/' . implode('/', explode('_', $route)) . '.php'; echo">>> DBG L." . __LINE__ . ": path '{$path}'\n"; if (file_exists($path)) { echo">>> DBG L." . __LINE__ . ": found file '{$path}' for route '{$route}'\n"; exec("cd {$pathProject}; atom {$path}"); return; } else { $path = "{$pathProject}/SE/se-lib/Route/{$route}.php"; if (file_exists($path)) { echo">>> DBG L." . __LINE__ . ": found file '{$path}' for route '{$route}'\n"; exec("cd {$pathProject}; atom {$path}"); return; } } die("Unrecognized url - cannot find class file for route '{$route}'\n"); } else die("Unrecognized url - missing _route\n"); exit; ?>