Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter read_file() vs php file_get_content()
#1

[eluser]searain[/eluser]
I thought CodeIgniter read_file() would be just a wrap up around file_get_content(), but unlike php file_get_content, CodeIgniter read_file(), the path cannot be a url?

Thanks!
#2

[eluser]Nick_MyShuitings[/eluser]
K... you're 163 posts into the forum... so I expect a bit more sleuthing from you prior to posting.

Use your text editor of choice, open system/helpers/file_helper.php.... check the first ruddy function in there. What do you see?

You see that it is just a wrapper, but that it also calls a lovely error checking function ahead of it which is php's fancy dancy file_exists().

Go to http://php.net/manual/en/function.file-exists.php and you'll see that this function requires a path... not a url...

The end...

But in reality... stop treating the core like a black box you can't open and snoop around in. And if you ever want to use a php function over a CI one... just F-ing do it, if not we are turning into a community of idiots who can write Codeigniter but not PHP... like the people who post endlessly about the limitations of Active Record...
#3

[eluser]Clooner[/eluser]
[quote author="searain" date="1304739977"]I thought CodeIgniter read_file() would be just a wrap up around file_get_content(), but unlike php file_get_content, CodeIgniter read_file(), the path cannot be a url?

Thanks![/quote]

Indeed




Theme © iAndrew 2016 - Forum software by © MyBB