class Helper
{
+ public static function rewriteUrl($url)
+ {
+ if (!isset($GLOBALS['phinde']['urlRewrites'])
+ || count($GLOBALS['phinde']['urlRewrites']) == 0
+ ) {
+ return $url;
+ }
+
+ foreach ($GLOBALS['phinde']['urlRewrites'] as $pattern => $replacement) {
+ $url = preg_replace('#' . $pattern . '#', $replacement, $url);
+ }
+ return $url;
+ }
+
public static function isUrlAllowed($url)
{
$urlDomain = parse_url($url, PHP_URL_HOST);
$diff = microtime(true) - static::$timer[$timer];
echo '+timer: ' . number_format($diff, 3) . 'ms ' . $timer . "\n";
}
+
+ public static function baseDoc($url)
+ {
+ $esDoc = new \stdClass();
+ $esDoc->status = new \stdClass();
+ $esDoc->url = $url;
+ $esDoc->schemalessUrl = Helper::noSchema($url);
+ return $esDoc;
+ }
}
?>