Yii Framework Forum: [EXTENSION] CFile - Yii Framework Forum

Jump to content

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] CFile Rate Topic: -----

#1 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 25 October 2009 - 01:41 AM

CFile extension offers commonly used functions for file manipulation.
http://www.yiiframew...extension/cfile

This topic is for your feedback. You're welcome.
0

#2 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 26 October 2009 - 04:47 AM

Version 0.2 available
  • new: getContents() and setContents() methods
  • new: create() method
  • new: 'readable' & 'writeable' properties
  • fix: posix family functions existance check (in getOwner() & getGroup())

http://www.yiiframew...extension/cfile
0

#3 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 26 October 2009 - 05:34 AM

That's great.
I think a download() method would be usefull
0

#4 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 26 October 2009 - 07:51 AM

View PostSpyros, on 26 October 2009 - 05:34 AM, said:

That's great.
I think a download() method would be usefull

Certainly, Spyros, that's one of the upcoming release @todos.
0

#5 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 27 October 2009 - 03:19 AM

Version 0.3 available
  • new: setBasename() method (lazy file rename)
  • new: setFilename() method (lazy file rename)
  • new: setExtension() method (lazy file rename)
  • new: download() method
  • chg: copy() & rename() methods improved (destination file name without path is enough for them to perform actions in the current file directory)
  • fix: 'extension' key existance check (in pathInfo())


http://www.yiiframew...xtension/cfile/
0

#6 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 27 October 2009 - 04:13 AM

Minor note: Shouldn't it more correctly be called "send()" instead of "download()"? E.g. what if you want to supply a method to really download a file from somewhere else to the server?
0

#7 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 27 October 2009 - 04:28 AM

View PostMike, on 27 October 2009 - 04:13 AM, said:

Minor note: Shouldn't it more correctly be called "send()" instead of "download()"? E.g. what if you want to supply a method to really download a file from somewhere else to the server?

Probably something like "fetch()" would make sense in that case, I believe. What do you think?
0

#8 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 27 October 2009 - 04:36 AM

Yeah, well: remember you're on the server side. "download" would be the action on the client side. The server will "send". But that's really just nitpicking :)
0

#9 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 03 November 2009 - 02:49 AM

Version 0.4 is available, introducing directory handling functionality

  • new: 'isFile' & 'isDir' properties
  • new: rename(), move(), copy(), delete(), getSize() and getContents() methods now are able to deal with directories
  • new: purge() method to empty filesystem object
  • new: createDir() method to create directory
  • new: 'isEmpty' property
  • chg: '$formatPrecision' param of getSize() method now changed to '$format' and accepts format pattern for 'CNumberFormatter'
  • chg: download() method is now alias for primary send() method
  • chg: now 'readable' & 'writeable' properties are loaded on set() even when in non-greedy mode
  • fix: unnecessary file availability checks when 'greedy' option is specified for set() removed


http://www.yiiframew...xtension/cfile/
0

#10 User is offline   datashaman 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 27-September 09
  • Location:Cape Town, South Africa

Posted 03 November 2009 - 06:38 AM

View PostMike, on 27 October 2009 - 04:13 AM, said:

Minor note: Shouldn't it more correctly be called "send()" instead of "download()"? E.g. what if you want to supply a method to really download a file from somewhere else to the server?


Sendfile is a name for this, and it describes exactly what the application is doing. (EDIT: But would probably be confused with X-SENDFILE which is different).

This post has been edited by datashaman: 03 November 2009 - 06:55 AM

0

#11 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 525
  • Joined: 10-October 08
  • Location:European Union

Posted 03 November 2009 - 08:21 AM

The "C" prefix is discouraged for extensions as should be used only for core classes. A common practice was to use the "E" prefix
Yii user #37
0

#12 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 03 November 2009 - 10:07 AM

View Postekerazha, on 03 November 2009 - 08:21 AM, said:

The "C" prefix is discouraged for extensions as should be used only for core classes. A common practice was to use the "E" prefix

Where do you get it from, I should ask, have I missed something?
0

#13 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 525
  • Joined: 10-October 08
  • Location:European Union

Posted 03 November 2009 - 10:32 AM

View Postidle sign, on 03 November 2009 - 10:07 AM, said:

Where do you get it from, I should ask, have I missed something?


http://www.yiiframew...s-naming-why-e/

Read the qiang message
Yii user #37
0

#14 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 03 November 2009 - 10:33 AM

Also described in the definitive guide: http://www.yiiframew...asics.namespace

Quote

Tip: Because PHP prior to 5.3.0 does not support namespace intrinsically, you cannot create instances of two classes who have the same name but with different definitions. For this reason, all Yii framework classes are prefixed with a letter 'C' (meaning 'class') so that they can be differentiated from user-defined classes. It is recommended that the prefix 'C' be reserved for Yii framework use only, and user-defined classes be prefixed with other letters.

0

#15 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 03 November 2009 - 11:24 AM

View Postekerazha, on 03 November 2009 - 10:32 AM, said:



View PostY!!, on 03 November 2009 - 10:33 AM, said:

Also described in the definitive guide: http://www.yiiframew...asics.namespace


I see, yes, thank you.
I suppose if this is a discourage as such it should rather be stated in Yii Conventions, not as a Tip or forum message.
But I'll bear it in mind.
0

#16 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 03 November 2009 - 11:38 AM

View Postidle sign, on 03 November 2009 - 11:24 AM, said:

I suppose if this is a discourage as such it should rather be stated in Yii Conventions, not as a Tip or forum message.


Hmm. Do we have Yii conventions?
0

#17 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 03 November 2009 - 10:43 PM

View PostMike, on 03 November 2009 - 11:38 AM, said:

Hmm. Do we have Yii conventions?

I think so :D
http://www.yiiframew...sics.convention
0

#18 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 04 November 2009 - 03:33 AM

Oh, right. I forgot :)
0

#19 User is offline   scythah 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 44
  • Joined: 20-April 09

Posted 17 November 2009 - 01:58 PM

In the dirContents function, the $recursive parameter doesn't actually do anything. Regardless of whether it's set to true or false, the function always returns a recursive result.

Also, can I please request a feature? I would like a way to be able to use:
Yii::app()->file->set('/files/')->contents

To only display the files/folders in the current folder (ie. non-recursive).

Thanks.
0

#20 User is offline   idle sign 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 56
  • Joined: 18-September 09
  • Location:Novosibirsk, Russia

Posted 18 November 2009 - 12:19 PM

View Postscythah, on 17 November 2009 - 01:58 PM, said:

In the dirContents function, the $recursive parameter doesn't actually do anything.

Thank you for the report.
Recursive parameter issue would be fixed in 0.5, and so with that "Yii::app()->file->set('/files/')->contents" would work as expected.
0

Share this topic:


  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users