Re: GSoC Storage Packages

112 views
Skip to first unread message

Ian

unread,
Apr 3, 2013, 11:21:42 AM4/3/13
to joomla-dev...@googlegroups.com
Off the top of my head it sounds interesting.  One thing that came to mind is the possibility of building an abstraction layer so that one might be able to interface with various storage backends using a standard interface.

Ian

On Wednesday, 3 April 2013 10:50:18 UTC-4, Diana Maria Neculai wrote:
Hi everyone,

Last summer when I applied to GSoC with the social packages project, I also proposed another project that included two storage packages: Amazon S3 and RackSpace.I would add to these Dropbox, or replace RackSpace with it, and I think the Google Cloud Storage API should be included in the JGoogle package.

IMO these packages would be very useful and I want to propose this project for this summer and mentor it, but first I want to hear your thoughts.

Thanks,
Diana

Donald Gilbert

unread,
Apr 3, 2013, 11:53:36 AM4/3/13
to joomla-dev...@googlegroups.com
That's what I would suggest as well. Building out a new Filesystem package with support for various storage backends.


--
Source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Jooma!
---
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-frame...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework?hl=en-GB.
 
 

Dieudonné

unread,
Apr 3, 2013, 12:10:39 PM4/3/13
to joomla-dev...@googlegroups.com

 


De : Donald Gilbert <dilber...@gmail.com>
À : joomla-dev...@googlegroups.com
Envoyé le : Mercredi 3 avril 2013 17h53
Objet : Re: [jfw] Re: GSoC Storage Packages

Amy Stephen

unread,
Apr 3, 2013, 2:08:13 PM4/3/13
to joomla-dev...@googlegroups.com
If helpful, I've offered Molajo's Filesystem for the Framework. Not quite done, but close.

https://github.com/Molajo/Standard/tree/master/Vendor/Molajo/Filesystem

Interfaces defined with the intention of the cloud, along with the local and FTP type filesystems.

https://github.com/Molajo/Standard/tree/master/Vendor/Molajo/Filesystem/Adapter/

Basic doc:
https://github.com/Molajo/Standard/blob/master/Vendor/Molajo/Filesystem/README.md#what-is-filesystem

Would be great to see cloud adapters created for it - if it's useful to the project.

Diana Maria Neculai

unread,
Apr 4, 2013, 12:19:09 PM4/4/13
to joomla-dev...@googlegroups.com
Yes, I believe Molajo's Filesystem would be very useful for the project. It's a good starting point and it'll allow the student to work on several cloud storage bakends. Although, I don't know exactly what Molajo is, other than a Joomla distribution, and how this code could be used in the Joomla! FW.

--
Diana

Diana Maria Neculai

unread,
Apr 4, 2013, 3:47:40 PM4/4/13
to joomla-dev...@googlegroups.com
Thanks for your suggestion. I was looking for the most used storage providers: Amazon, Google, Dropbox and Rackspace. I haven't thought about which has the simplest API or is cheapest.

I think 4 APIs are a bit too much, so before adding the project on the idea page, I would like to hear other suggestions too.

--
Diana

On Thursday, April 4, 2013 9:48:25 PM UTC+3, Alex Crawford wrote:
Don't replace Rackspace, Rackspace Cloudfiles is probably has the simplest API to work with, and might even be the cheapest of all the services, unlike Rackspace's other overpriced services.

Amy Stephen

unread,
Apr 4, 2013, 7:58:58 PM4/4/13
to joomla-dev...@googlegroups.com
Cool. To clarify, it's something I wrote for Molajo and have offered to the Joomla Framework. I'll go through it and change the Molajo references to Joomla and if it meets with the project's satisfaction, it will hopefully be offered with the Joomla project.

When does your project begin? If you want, you can add me on Skype (AmyStephen) - and we can talk about how I can get it ready for you and your student. I'd be more than happy to help you throughout the project too.

Really great idea, Diana.

Andrew Eddie

unread,
Apr 4, 2013, 8:52:02 PM4/4/13
to joomla-dev...@googlegroups.com
Just looking at https://github.com/Molajo/Standard/tree/master/Vendor/Molajo/Filesystem really quickly, I'm not sure I'd go with your format:

$adapter = new Molajo/Filesystem/Adapter($action, $path, $filesystem_type, $options);

For example, I'd probably use an iterator pattern for lists, and have the balance of the actions as methods. I'd probably borrow ideas from how Monolog sets itself out. I could see somethingl ike the following:

use Joomla\Storage;

$stream = new Stream(/* input */);
$stream->read(...);
$stream->write(...);

$directory = new Directory('path');
foreach ($directory as $thing)
{
    // $thing could be a file, another "directory" (folder), could be an LDAP node, etc
}

Just shooting from the hip ...

Keep in mind that we should be thinging about interfaces that could form future PSR's.

Regards,
Andrew Eddie

Amy Stephen

unread,
Apr 5, 2013, 12:33:08 AM4/5/13
to joomla-dev...@googlegroups.com
I agree. I actually just changed the frontend adapter to use the ActionsInterface last night as I was hooking up to the DI container.

https://github.com/Molajo/Filesystem/blob/master/Adapter/ActionsInterface.php

The Adapter was using the following - but it was really an over simplification so I went with both (will combine) Sounds like you agree:

https://github.com/Molajo/Filesystem/blob/master/Adapter/AdapterInterface.php

There are other interfaces that define Metadata, :
https://github.com/Molajo/Filesystem/blob/master/Adapter/AdapterInterface.php

The system interface (important for those filesystems that require credentials)
https://github.com/Molajo/Filesystem/blob/master/Adapter/SystemInterface.php

And, it will have a fileupload interface (not done) (Still not sure if it should be in the HTTP package or the Filesystem package or both).

Now it instantiates a Filesystem type, like Local

    $local = new Molajo/Filesystem/Adapter('Local');

// Read a file
$results = $local->read('path/to/file.txt');

// Metadata for file or folder
$results = $local->getMetadata('path');

// List folders and files - recursively is optional
$results = $local->getList('path', $recursive);

// Deletes a file or folder - optionally removing subdirectories (safety)
$results = $local->delete('can/be/folder/or/file.txt', $delete_subdirectories);

// Copies a file or folder/files to target, can be copied between filesystems
$results = $local->copy('source/folder/or/file.txt', 'target/folder', 'target-file-name.txt', $replace, $target-filesystem);

// Moves a file or folder/files to target, can be copied between filesystems
$results = $local->move('source/folder/or/file.txt', 'target/folder', 'target-file-name.txt', $replace, $target-filesystem);


// ChangeOwner
$results = $local->changeOwner('folder/or/file.txt', $username);

// Change Group
$results = $local->changeGroup('folder/or/file.txt', $groupid);

// Change Permission
$results = $local->changePermission('folder/or/file.txt', $permission);

// Touch
$results = $local->touch('folder/or/file.txt', $modification_time, $access_time);

Is that heading the right direction?

Thanks for your feedback.

Absolutely.
 

Regards,
Andrew Eddie

Andrew Eddie

unread,
Apr 5, 2013, 12:47:56 AM4/5/13
to joomla-dev...@googlegroups.com
On 5 April 2013 14:33, Amy Stephen <amyst...@gmail.com> wrote:
Now it instantiates a Filesystem type, like Local

    $local = new Molajo/Filesystem/Adapter('Local');

If you are going to do that, maybe it's better to look at a factory pattern. Though, I really only use them when I have a lot of initialisation to do (another way of approaching the DI dilemma).
 
// Read a file
$results = $local->read('path/to/file.txt');

// Metadata for file or folder
$results = $local->getMetadata('path');

// List folders and files - recursively is optional
$results = $local->getList('path', $recursive);

// Deletes a file or folder - optionally removing subdirectories (safety)
$results = $local->delete('can/be/folder/or/file.txt', $delete_subdirectories);

// Copies a file or folder/files to target, can be copied between filesystems
$results = $local->copy('source/folder/or/file.txt', 'target/folder', 'target-file-name.txt', $replace, $target-filesystem);

// Moves a file or folder/files to target, can be copied between filesystems
$results = $local->move('source/folder/or/file.txt', 'target/folder', 'target-file-name.txt', $replace, $target-filesystem);


// ChangeOwner
$results = $local->changeOwner('folder/or/file.txt', $username);

// Change Group
$results = $local->changeGroup('folder/or/file.txt', $groupid);

// Change Permission
$results = $local->changePermission('folder/or/file.txt', $permission);

// Touch
$results = $local->touch('folder/or/file.txt', $modification_time, $access_time);

Is that heading the right direction?


That's closer to what feels right, though I emphasise I'm only giving this a cursory glance. It's not something I'm immersed in at work.

Regards,
Andrew Eddie 

Amy Stephen

unread,
Apr 5, 2013, 1:28:56 AM4/5/13
to joomla-dev...@googlegroups.com
Apologies to Dianne for hijacking her discussion. I opened a new discussion here https://groups.google.com/forum/#!topic/joomla-dev-framework/g6GrGeYCzrw


Andrew - thanks for your review and feedback. I know you are very busy so I appreciate your time very much.
Reply all
Reply to author
Forward
0 new messages