Yii Framework Forum: File Storage - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

File Storage

#1 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 19 October 2011 - 02:38 AM

Hi,

just because it's not part of Yii and hasn't been discussed yet. Are there plans for a kind of file storage component in Yii 2.0?

If a component, module or extension has to deal with files it may be useful if there would be a framework component helping them.

Basically this would be similar to a cache module, you may set or get files from the file storage component, but it may implement additional boundaries, if a module wants to store its files protected, so another module can't access it.
Also the file storage could come with a convention where to store the files (e.g. protected/data, protected/var).


Best regards,
schmunk
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,780
  • Joined: 17-January 09
  • Location:Russia

Posted 19 October 2011 - 11:21 AM

How's this different from regular PHP file management functionality?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 19 October 2011 - 01:51 PM

A "CFileStorage" would encapsulate the methods needed for file handling and could implement additional features like the boundaries I mentioned.
For sure you could still access files directly with PHP methods, but that's also true for other framework components, such as messages or authItems.

Additionally you could replace the component to implement another file storage (e.g. in a database, CDN).

At least I would like to see a convention like the /assets folder where the web application should store persistent files. My proposal would be protected/data or protected/var.

PS: Same could be asked for CHttpSession or the Cache components :)
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#4 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,780
  • Joined: 17-January 09
  • Location:Russia

Posted 19 October 2011 - 06:13 PM

So this is basically a backend for key-value storage. Persistent one.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#5 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 20 October 2011 - 05:59 PM

Yes basically, if you treat the path of the file as the key, but it may provide additional features like,
- better error handling
- automatic creation of subdirectories
- improved organization on file / folder basis, like .git/objects
- delete to trash, empty trash
- getting files by attributes (like find)

...just thinking loud.
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

Share this topic:


Page 1 of 1
  • 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