mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 15:22:15 +09:00
Change autoloader to support case-sensitive class files + fix lang path for namespaced modules
This commit is contained in:
parent
7218e4fac6
commit
a07307d343
2 changed files with 36 additions and 23 deletions
|
|
@ -802,19 +802,16 @@ class Context
|
|||
* Load language file according to language type
|
||||
*
|
||||
* @param string $path Path of the language file
|
||||
* @param string $plugin_name
|
||||
* @return void
|
||||
*/
|
||||
public static function loadLang($path)
|
||||
public static function loadLang($path, $plugin_name = null)
|
||||
{
|
||||
if (preg_match('@/(modules|addons|plugins|widgets)/([a-zA-Z0-9_-]+)/lang/?(?:lang\.xml)?$@', str_replace('\\', '/', $path), $matches))
|
||||
if ($plugin_name === null && preg_match('@/(modules|addons|plugins|widgets)/([a-zA-Z0-9_-]+)/lang/?(?:lang\.xml)?$@', str_replace('\\', '/', $path), $matches))
|
||||
{
|
||||
$path = \RX_BASEDIR . $matches[1] . '/' . $matches[2] . '/lang';
|
||||
$plugin_name = $matches[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
$plugin_name = null;
|
||||
}
|
||||
|
||||
if (!(($GLOBALS['lang'] ?? null) instanceof Rhymix\Framework\Lang))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue