Joomla 4 - File::read

47 views
Skip to first unread message

darrenf...@gmail.com

unread,
Oct 1, 2021, 3:27:30 AM10/1/21
to Joomla! General Development
Hi,

I'm just writing a joomla template for Joomla 4.  I remember in Joomla 3 there was a method in file called File::read - of course I know file_get_contents does pretty much the same thing but I like to use the official Joomla methods.

I noticed in the Joomla documentation Joomla 4's file class has everything except reading a file - I thought maybe it's something someone missed off the API documentation but when trying to use File::read I get an error that this method doesn't exist.

Does anyone know any reason that reading a file was taken out of the file class? Did someone just forget to implement it or was it just assumed that most people would use file_get_contents anyway or is there some other better method for reading a file?

jms

unread,
Oct 2, 2021, 5:31:11 AM10/2/21
to joomla-de...@googlegroups.com
See in J3 file.php

@since 1.7.0
* @deprecated 4.0 - Use the native file_get_contents() instead.

Hope it helps.
JM
> --
> You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/860b1b31-a198-4b56-86f5-51a3177aa370n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages