17 if (php_sapi_name() ===
'cli-server') {
18 $urlPath =
parse_url($_SERVER[
"REQUEST_URI"], PHP_URL_PATH);
20 if (preg_match(
'/^\/cache\/(.*)$/', $urlPath, $matches)) {
21 $_GET[
'request'] = $matches[1];
22 require(
'engine/handlers/cache_handler.php');
24 }
else if (preg_match(
'/^\/export\/([A-Za-z]+)\/([0-9]+)\/?$/', $urlPath, $matches)) {
25 $_GET[
'view'] = $matches[1];
26 $_GET[
'guid'] = $matches[2];
27 require(
'engine/handlers/export_handler.php');
29 }
else if (preg_match(
'/^\/export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$/', $urlPath, $matches)) {
30 $_GET[
'view'] = $matches[1];
31 $_GET[
'guid'] = $matches[2];
32 $_GET[
'type'] = $matches[3];
33 $_GET[
'idname'] = $matches[4];
34 require(
'engine/handlers/export_handler.php');
36 }
else if (preg_match(
"/^\/rewrite.php$/", $urlPath, $matches)) {
39 }
else if ($urlPath !==
'/' && file_exists(__DIR__ . $urlPath)) {
43 $_GET[
'__elgg_uri'] = $urlPath;
48 if (isset($_GET[
'__testing_rewrite'])) {
49 if (isset($_GET[
'__elgg_uri']) &&
false !== strpos($_GET[
'__elgg_uri'],
'__testing_rewrite')) {
55 require_once(dirname(__FILE__) .
"/engine/start.php");
elgg parse_url
Parse a URL into its parts.
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
elgg echo
Translates a string.
elgg require
Throw an error if the required package isn't present.