win空间换成linux空间 竟然会变引入文件的大小写
本帖最后由 沦陷今生 于 2014-10-17 20:27 编辑$config['subclass_prefix'] = 'MY_';//大写的 对吧
有以下文件
/application/core/MY_Controller.php//这个会自动加载 并且加载成功 大写的 对吧
/application/helpers/MY_md5_helper.php //这个需要写入代码调用,前缀也是大写的 对吧
MY_Controller.php里
class M_Controller extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->helper('url');
$this->load->helper('MY_md5_helper');//这里会报错 Unable to load the requested file: helpers/my_md5_helper.php
然后我就回头去检查$config['subclass_prefix']
没错啊 确实是大写的MY_
文件也存在 哪错了呢?这套程序直接无错搬过来用的
弄了半天 把/application/helpers/MY_md5_helper.php复制一份改名
/application/helpers/my_md5_helper.php就没提示了
不懂是哪里不受控制 把代码里写写的$this->load->helper('MY_md5_helper');
给我改成实际效果是$this->load->helper('my_md5_helper');
设置好的MY_改成了小写
难道是win换了linux的问题吗?
win下文件名不区分大小写,而在linux上是区分的 你这种调用方法不对
直接$this->load(md5);
CI自己会组装文件名添加前缀跟'_heper'
在组装文件名前会调用个准备函数,有一步是将传入内容小写
你可以看看源码 system/core/load.phpfunction helper()函数
页:
[1]