Skip to content

Commit

Permalink
fix #1096
Browse files Browse the repository at this point in the history
Remove `include_path` setting.
  • Loading branch information
joyqi committed May 21, 2021
1 parent 13ac6f1 commit 0e49d18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
9 changes: 2 additions & 7 deletions install.php
Expand Up @@ -20,13 +20,8 @@
/** 后台路径(相对路径) */
define('__TYPECHO_ADMIN_DIR__', '/admin/');

/** 设置包含路径 */
@set_include_path(get_include_path() . PATH_SEPARATOR .
__TYPECHO_ROOT_DIR__ . '/var' . PATH_SEPARATOR .
__TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__);

/** 载入API支持 */
require_once 'Typecho/Common.php';
require_once __TYPECHO_ROOT_DIR__ . '/var/Typecho/Common.php';

/** 程序初始化 */
Typecho_Common::init();
Expand Down Expand Up @@ -537,7 +532,7 @@ function _u() {
}

/** 初始化配置文件 */
$lines = array_slice(file(__FILE__), 1, 31);
$lines = array_slice(file(__FILE__), 1, 26);
$lines[] = "
/** 定义数据库参数 */
\$db = new Typecho_Db('{$adapter}', '" . _r('dbPrefix') . "');
Expand Down
File renamed without changes.
13 changes: 12 additions & 1 deletion var/Typecho/Common.php
Expand Up @@ -229,7 +229,18 @@ public static function __parseAttrs($attrs)
*/
public static function __autoLoad($className)
{
@include_once str_replace(array('\\', '_'), '/', $className) . '.php';
$classFile = str_replace(array('\\', '_'), '/', $className) . '.php';
$systemPath = self::url($classFile, __TYPECHO_ROOT_DIR__ . '/var');

if (file_exists($systemPath)) {
@include_once $systemPath;
} else {
$pluginPath = self::url($classFile, __TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__);

if (file_exists($pluginPath)) {
@include_once $pluginPath;
}
}
}

/**
Expand Down

0 comments on commit 0e49d18

Please sign in to comment.