Google Groups Home
Help | Sign in
Handling config for JFilesystemBackend
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Anthony Ferrara  
View profile
 More options May 13, 10:45 am
From: "Anthony Ferrara" <ircmax...@gmail.com>
Date: Tue, 13 May 2008 10:45:04 -0400
Local: Tues, May 13 2008 10:45 am
Subject: Handling config for JFilesystemBackend

http://forum.joomla.org/viewtopic.php?f=502&t=266258

I've been working on this (and the library classes are actually almost
done).  The basic idea, is the ability to specify an arbitrary backend
(aside from just php and FTP) by dropping a class in
/libs/j/filesystem/backend/.  It works now (I've written backends for php,
FTP and SSH/SCP/SFTP so far), but the question I have is about
configuration.

Basically, each one of the backends may require different configuration
options in global config.  For example, FTP requires Host, Port, User, Pass
and Path.  SSH on the other hand requires Host, Port, Path, and either
User/Pass or path to public key file.  I would like to store these
credentials in an associave array in JConfig, so that you can switch between
backends without loosing the config settings.  So, the question is, what's
the best way to get the backend dependant config options?

One thought I had, was to add a method to each backend ::getConfig which
returns an associative array of the params ('name'=>'type'), so ftp would
return an array('host'=>'text', 'port'=>'text', etc), then build a JParam
object for each backend, and render all of them and use JS to switch to the
active backend...

One other difference I've implimented (for discussion), is a pair of checks
on each backend.  ::enabled() returns if the backend can be used (for
example, SSH requires that LibSSH is installed in PHP), and ::check() which
actually opens the backend, and checks a known path for existance
(basically, makes sure the credentials are good).  So this allows us to
impliment a fallback (well, it's there already).  So if you load the FTP
backend, and the credentials are wrong, it'll fall back to php...

Thoughts/Comments?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Louis Landry  
View profile
 More options May 14, 11:09 am
From: "Louis Landry" <louis.lan...@joomla.org>
Date: Wed, 14 May 2008 10:09:14 -0500
Local: Wed, May 14 2008 11:09 am
Subject: Re: Handling config for JFilesystemBackend

I think the JRegistry handler for PHP needs to be able to support second
level values and store them in associative arrays.  With that functionality
this becomes a much easier nut to crack.

- Louis

On Tue, May 13, 2008 at 9:45 AM, Anthony Ferrara <ircmax...@gmail.com>
wrote:

--
Project Manager & Developer
Joomla! CMS http://www.joomla.org

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian MacLennan  
View profile
 More options May 14, 11:14 am
From: "Ian MacLennan" <ianlen...@gmail.com>
Date: Wed, 14 May 2008 11:14:04 -0400
Local: Wed, May 14 2008 11:14 am
Subject: Re: Handling config for JFilesystemBackend

If we're looking at config for these values, should we also look at cache
handler config as well?  I think the same thing would apply...

Ian

On Wed, May 14, 2008 at 11:09 AM, Louis Landry <louis.lan...@joomla.org>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jinx  
View profile
 More options May 14, 11:16 am
From: Jinx <jjanss...@gmail.com>
Date: Wed, 14 May 2008 08:16:37 -0700 (PDT)
Local: Wed, May 14 2008 11:16 am
Subject: Re: Handling config for JFilesystemBackend
Agreed, I would try to use JRegistry for this. It was designed
especially to handle these kind of situations.

Johan

On May 14, 5:09 pm, "Louis Landry" <louis.lan...@joomla.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Louis Landry  
View profile
 More options May 14, 11:19 am
From: "Louis Landry" <louis.lan...@joomla.org>
Date: Wed, 14 May 2008 10:19:20 -0500
Local: Wed, May 14 2008 11:19 am
Subject: Re: Handling config for JFilesystemBackend

Exactly Ian.

Ideally this would all just work in JRegistry and any option like that would
be much more simple to handle.

- Louis

--
Project Manager & Developer
Joomla! CMS http://www.joomla.org

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hannes Papenberg  
View profile
 More options May 14, 11:40 am
From: Hannes Papenberg <hackwa...@googlemail.com>
Date: Wed, 14 May 2008 17:40:56 +0200
Local: Wed, May 14 2008 11:40 am
Subject: Re: Handling config for JFilesystemBackend

I'm throwing in JParameter (which we maybe should rename to something
different, but thats another story) which could do what you want with my
proposal and pre-made patch. :-)

Hannes

Louis Landry schrieb:

  patch_jparameter_0_3.patch
7K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Moffatt  
View profile
 More options May 14, 12:21 pm
From: "Sam Moffatt" <pasa...@gmail.com>
Date: Wed, 14 May 2008 23:21:30 +0700
Local: Wed, May 14 2008 12:21 pm
Subject: Re: Handling config for JFilesystemBackend
I agree however I would be hesitant to put another thing into global
configuration, especially something like this that I'd really much
prefer to see in a dedicated interface. A lot of options for the most
part in the global config can't damage your site or make it hard to
use beyond the existing FTP ones or database settings. Additionally
you comment it would be nice to have a validation, I don't
particularly feel that it would be logical to extend global config in
this way. The down side is that it would be another place to configure
things which is also bad. So its a bit hard as well.

Just my 2 cents

Sam

--
Sam Moffatt
http://pasamio.id.au

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google