php - 错误:不推荐使用 __autoload(),请使用 spl_autoload_register() 代替
问题描述
Estou enfrentando um erro de PHP no servidor ao vivo。Eu acredito que é um problema de versão。
O erro está incluído abaixo e ocorre no arquivo config.inc.php:
function __autoload($Class)
{
$cDir = ['Conn', 'Helpers', 'Models'];
$iDir = null;
foreach ($cDir as $dirName) :
if (!$iDir && file_exists(__DIR__ . DIRECTORY_SEPARATOR . $dirName . DIRECTORY_SEPARATOR . $Class . '.class.php') && !is_dir(__DIR__ . DIRECTORY_SEPARATOR . $dirName . DIRECTORY_SEPARATOR . $Class . '.class.php')) :
include_once(__DIR__ . DIRECTORY_SEPARATOR . $dirName . DIRECTORY_SEPARATOR . $Class . '.class.php');
$iDir = true;
endif;
endforeach;
if (!$iDir) :
trigger_error("Não foi possível incluir {$Class}.class.php", E_USER_ERROR);
die;
endif;
}
解决方案
推荐阅读
- xamarin - 在 Xamarin Forms 的选项卡栏中添加自定义按钮
- haskell - System.Process 如何保持 shell 会话而不是创建新进程?
- elasticsearch - 在 Elasticsearch 中创建索引需要太多时间
- django - 更新唯一一起约束Django的问题
- elasticsearch - 获取elasticsearch 6.4.2 中的elasticsearch 存储脚本列表
- listview - ListView ItemTapEvent 使用 MVVMLight
- php - 基于 Woocommerce 中的运输等级和最低金额的有条件免费送货
- windows - 你能修复我的 Ctrl+Left Ctrl+Shift+Left 脚本吗?
- http - 如果使用 apache camel,http 和 https 连接将保留在“CLOSE_WAIT”中
- sas - 是否可以使用面板数据对 SAS 进行配对 t 检验?