In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you the "thinkPHP how to achieve online automatic loading exceptions and repair methods", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "thinkPHP how to achieve online automatic loading anomalies and repair methods" this article.
The details are as follows:
The project encountered a strange problem, the local code is normal, but not on the server.
After testing, there should be something wrong with the automatic loading and tried various methods.
1. Manual loading, found good trouble, endless.
two。 Write their own automatic loading, can not write out, embarrassed.
3. Modify the configuration to support automatic loading, but it still doesn't work.
Debugging was carried out later.
Discover local support
Import ('@ .ORG.OSS\ OssClient'); import ('@ .ORG.OSS\ Core\ OssUtil')
On the server, this slash is not supported, but it is supported. The way
Later, the core code of thinkphp was adjusted.
/ / try to search $paths = explode (',', C ('APP_AUTOLOAD_PATH')); foreach ($paths as $path) {$class = str_replace ("\\", ".", $class); / / dump ($class); if (import ($path.'.'.$class)) {/ / dump ($path.'.'.$class); / / return return if the class is loaded successfully;}
After this small action, OK, the server can use OSS.
The above is all the contents of the article "how to automatically load exceptions and fixes online by thinkPHP". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.