Support different rewrite levels for XE compatibility

This commit is contained in:
Kijin Sung 2020-06-12 13:24:01 +09:00
parent f01fb9ae42
commit 1cd3cfc7d9
7 changed files with 42 additions and 5 deletions

View file

@ -0,0 +1,28 @@
<?php
namespace Rhymix\Framework;
/**
* The router class.
*/
class Router
{
/**
* Return the currently configured rewrite level.
*
* 0 = None
* 1 = XE-compatible rewrite rules only
* 2 = Full rewrite support
*
* @return int
*/
public static function getRewriteLevel(): int
{
$level = Config::get('url.rewrite');
if ($level === null)
{
$level = Config::get('use_rewrite') ? 1 : 0;
}
return intval($level);
}
}