This article describes the automatic loading anomaly and the repair method on the thinkphp line. Share to everyone for your reference, specific as follows:
The project encountered a strange problem, the local code is normal, the server is not normal.
After testing, should be automatically loaded out of the problem, tried various methods,
1. Manual loading, found a good trouble, endless.
2. Write their own automatic loading, not write out, embarrassed.
3. Modify the configuration so that it supports automatic loading, found or not.
Later debugging,
Discover local support
Import (' @.org.oss\ossclient ');
Import (' @.org.oss\core\ossutil ');
On the server, the way that this slash is not supported is supported. The Way
Later, the thinkphp core code is adjusted.
Try searching
$paths = explode (', ', C (' App_autoload_path ')) according to the automatic load path setting;
foreach ($paths as $path) {
$class = str_replace ("\", ".", $class);
Dump ($class);
if (Import ($path. '. ') $class)) {
//dump ($path. '. ') $class);
Returns return if the Load class succeeds
;
After this little action, it's OK, the server can use OSS.
It's not easy!
More interested in thinkphp related content readers can view the site topics: "thinkphp Introductory Course", "thinkphp Template Operation Skills Summary", "thinkphp Common Methods Summary", "PHP commonly used functions and skills summary", " Smarty Template Basics Tutorial and PHP template technology summary.
I hope this article will help you with the PHP program design based on thinkphp framework.