Cannot redeclare classLoader() (previously declared in 錯誤解決方案


這里是我遇到的問題指向這個文件 autoload.php 

<?php

function classLoader($class)
{
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$file = __DIR__ . '/src/' . $path . '.php';

if (file_exists($file)) {
include_once $file;
}
}
spl_autoload_register('classLoader');

include_once __DIR__ . '/src/Qiniu/functions.php';   

  Cannot redeclare classLoader()  翻譯過來  ‘無法重新聲明classLoader()’ 說明這個方法重名了  

所以 把  classLoader 改成其他名字就可  例如  classLoader_two 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM