File Helper

What is the best way to read file in Yii?

readfile() ? file_get_contents() ?

It wouldn’t make much sense to wrap every existing PHP function just to make it look more “Yii-ish” ;)

You may see the file helper of codeigniter so it helps you to extend yii file class.

Found out that at one place Yii internally uses file command to read the file to an array!

I think it will make a sense to make it Yii-ish. Just a rough idea without too much thinking, the needs for it

READ: Read a file, the params can be ‘File Type’ like web page, text file, xml etc

TRANSFORM a: Temporal file for processing after read can be Array, Object etc.

TRANSFORM b: Temporal file content can be transformed from XML to Object/Array etc.

SAVE: Write the Temproal content in any desired format.

Other advantages the TRANSFORM can be used for any data objects as well.

Thank you I will look into it.