fix plugin namespace

This commit is contained in:
joyqi 2021-09-01 18:45:59 +08:00
parent 7db5f3c873
commit 50dea3fc24
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<?php
namespace HellWorld;
namespace HelloWorld;
use Typecho\Plugin\PluginInterface;
use Typecho\Widget\Helper\Form;

View File

@ -348,10 +348,10 @@ class Plugin
{
switch (true) {
case file_exists($pluginFileName = $path . '/' . $pluginName . '/Plugin.php'):
$className = $pluginName . '_Plugin';
$className = "\\{$pluginName}\Plugin";
break;
case file_exists($pluginFileName = $path . '/' . $pluginName . '.php'):
$className = $pluginName;
$className = "\\{$pluginName}";
break;
default:
throw new PluginException('Missing Plugin ' . $pluginName, 404);

View File

@ -256,7 +256,7 @@ class Options extends Base
*/
public function pluginDir(?string $plugin = null): string
{
return Common::url($plugin, __TYPECHO_ROOT_DIR__ . '/' . __TYPECHO_PLUGIN_DIR__);
return __TYPECHO_ROOT_DIR__ . '/' . __TYPECHO_PLUGIN_DIR__;
}
/**