Restructuring of some of the components

7 views
Skip to first unread message

Loic d'Anterroches

unread,
Apr 3, 2009, 1:11:58 AM4/3/09
to pluf-...@googlegroups.com
Hello,

as you are more and more to use Pluf in production, I would like to
inform you about the planned work on Pluf for the next weeks.

1. URLs definition
2. Applications
3. Multi Auth
4. Auto Admin

1. URLs definition

The sort order will be dropped, instead the order in which the URLs are
declared will be used. It will save some computing cycles to do some
more interesting things.

It will be possible to easily plug an application at a given point in
the URL space. Like Django, you will be able to say, everything starting
with '/admin/' is going to be handled by the admin application. This
will allow to easily reuse other applications.

Cache of the URLs forward and reverse. Let say, you have 10 applications
declared in your config file, this means that the urls.php will include
the urls of 10 apps, 10 includes... bad... this will be cached as one
PHP file on disk in production. For the reverse, when using the url for
view helpers a model/method and named view indexed cache will be
available. This will also speed up things.

2. Applications

Any directory in the PHP include path will be able to store an
application. For example 'Pluf/Admin' could be the name of an
application. The loading of the relations.php files will also be cached
in production.

The goal together with point 1. is to break Pluf in smaller apps and
make everything more reusable. For example the small search engine will
become an application with ready to use views and templates.

This is needed to nicely support multi authentication backends etc.

3. Multi Auth

The authentication backend will be refactored to allow OpenId, LDAP, etc.

4. Auto Admin

Long overdue, but this will come at least before end of May.

Basically, I want to refactor to provide ease of use and reuse and even
more performance.

Note that I am still a bit slow with the dvorak keyboard, this means
that my email answers and IRC answers may be very short. This is not
because I do not care or am in a bad mood...

loïc

Bath

unread,
Apr 3, 2009, 4:53:53 AM4/3/09
to Pluf Users
Hey Loïc,

Glad you focus on these points. 3 and 4 would be really really nice
improvements.
About authentication, I'd be ok to work on pam auth if needed.

One thing, you say more and more people are using pluf, but we don't
know each other ! Or maybe i'm not present enough.
Maybe a reminder to use the #pluf channel on freenode and a wiki
page : theyUsePluf would be welcome :) !

See you ,
Baptiste

On 3 avr, 07:11, Loic d'Anterroches <ti...@users.sourceforge.net>
wrote:

Bruno Renié

unread,
Apr 3, 2009, 6:11:31 AM4/3/09
to pluf-...@googlegroups.com
Hi all,

#1 and #2 (well, #3 too) are the points I miss the most, pluggable
applications for pluf would be an awesome feature.

Will there be backward-incompatible changes ? If so, it would be cool
to have a snapshot with the "old" version to let people choose whether
they update their apps or not.

Last thing, in Django you can get a model using other fields than 'id'
as parameters, and in Pluf the only way I found is to create a list
with Pluf::factory('My_Model')->getList() with a custom sql statement,
ant then check the length of the array I get. Would it be relevant to
add a helper for that purpose ?

Loïc, thank you for your work on Pluf... I'm far from being a php guru
so I can't contribute to Pluf's core, but if I can help with writing
some doc, please let me know !

Regards,
Bruno

Loic d'Anterroches

unread,
Apr 5, 2009, 5:54:55 AM4/5/09
to pluf-...@googlegroups.com
Hi Bruno,

> #1 and #2 (well, #3 too) are the points I miss the most, pluggable
> applications for pluf would be an awesome feature.

I am hitting the wall right now, so I am working on it. Big monoliths
are not good.

> Will there be backward-incompatible changes ? If so, it would be cool
> to have a snapshot with the "old" version to let people choose whether
> they update their apps or not.

I will try to make no backward-incompatible changes. Or at least
minimize them. One is the priority in the urls.php, so just sort
manually your urls. Then, there will be the need to update your config
file to add the new applications. The migration script will take care to
put everything in order (Pluf will need to be the first application in
the appnlication list).

I have a very large old application, so I will create a "legacy" branch
for the ones not wanting/being able to upgrade.

> Last thing, in Django you can get a model using other fields than 'id'
> as parameters, and in Pluf the only way I found is to create a list
> with Pluf::factory('My_Model')->getList() with a custom sql statement,
> ant then check the length of the array I get. Would it be relevant to
> add a helper for that purpose ?

Tell me how it should look like:

$m = Pluf_Model::getOne($sql->gen());

Exception or null result if not found?

> Loïc, thank you for your work on Pluf... I'm far from being a php guru
> so I can't contribute to Pluf's core, but if I can help with writing
> some doc, please let me know !

You are welcome, you can also write about your findings here I can then
integrate them in the website. I will create a "pluf website" project to
collaborate on it.

regards,
loïc

note, my emails are still short because of my dvorak switch.

Bruno Renié

unread,
Apr 5, 2009, 12:37:39 PM4/5/09
to pluf-...@googlegroups.com
Hi,

> I will try to make no backward-incompatible changes. Or at least
> minimize them. One is the priority in the urls.php, so just sort
> manually your urls. Then, there will be the need to update your config
> file to add the new applications. The migration script will take care to
> put everything in order (Pluf will need to be the first application in
> the appnlication list).
>
> I have a very large old application, so I will create a "legacy" branch
> for the ones not wanting/being able to upgrade.

Great.


> $m = Pluf_Model::getOne($sql->gen());
>
> Exception or null result if not found?

I'd say :
- Exception if the result contains more than one object,
- Null if the object does not exist.

Something like Pluf_Model::getOr404 could raise an exception... That's
how Django works and I like it :-)


> you can also write about your findings here I can then
> integrate them in the website. I will create a "pluf website" project to
> collaborate on it.

No problem :-)

Regards,
Bruno

Bruno Renié

unread,
May 27, 2009, 3:59:43 PM5/27/09
to pluf-...@googlegroups.com
Hi all,

First, (@loic) the Pluf_Model::getOne() method is very useful :-)

Second, see below

On Sun, Apr 5, 2009 at 11:54 AM, Loic d'Anterroches
<ti...@users.sourceforge.net> wrote:
>
>> Loïc, thank you for your work on Pluf... I'm far from being a php guru
>> so I can't contribute to Pluf's core, but if I can help with writing
>> some doc, please let me know !
>
> You are welcome, you can also write about your findings here I can then
> integrate them in the website. I will create a "pluf website" project to
> collaborate on it.

I just finished a rather big Pluf app, I worked 20 days on it. I had
to learn Pluf for this mission, and I'm very happy with my choice.
However I wasn't very confident at the beginning, because I knew I
would have to do some non-trivial things with my models, and I didn't
find anything about that in the doc.

So I used some nice but undocumented features (like models
'_a['views'] to create joins). Even at the beginning I didn't find how
to execute a simple SELECT...WHERE.

I think there is something missing in the documentation. A section
like "working with models" which would explain how to retrieve models,
filter them, adding some joins, definig the _a['views'] statically and
dynamically... insert your idea here.

I'd be happy to write something like that, so... what is the structure
of a documentation file ? Loïc, you emitted the idea of creating a
project for managing the documentation.

I also think that highlighting the code in the documentation would add
a lot of readability, user-friendliness and awesomeness : people (me
first) like colourful websites :-)

What do you think about that ? Let me know how I can get started.

Regards,
Bruno

Loic d'Anterroches

unread,
May 27, 2009, 6:39:45 PM5/27/09
to pluf-...@googlegroups.com
Hello,

> First, (@loic) the Pluf_Model::getOne() method is very useful :-)

Thanks!

> Second, see below
>
> On Sun, Apr 5, 2009 at 11:54 AM, Loic d'Anterroches
> <ti...@users.sourceforge.net> wrote:
>>> Loïc, thank you for your work on Pluf... I'm far from being a php guru
>>> so I can't contribute to Pluf's core, but if I can help with writing
>>> some doc, please let me know !
>> You are welcome, you can also write about your findings here I can then
>> integrate them in the website. I will create a "pluf website" project to
>> collaborate on it.
>
> I just finished a rather big Pluf app, I worked 20 days on it. I had
> to learn Pluf for this mission, and I'm very happy with my choice.

Really really great!

> However I wasn't very confident at the beginning, because I knew I
> would have to do some non-trivial things with my models, and I didn't
> find anything about that in the doc.
>
> So I used some nice but undocumented features (like models
> '_a['views'] to create joins). Even at the beginning I didn't find how
> to execute a simple SELECT...WHERE.
>
> I think there is something missing in the documentation. A section
> like "working with models" which would explain how to retrieve models,
> filter them, adding some joins, definig the _a['views'] statically and
> dynamically... insert your idea here.
>
> I'd be happy to write something like that, so... what is the structure
> of a documentation file ? Loïc, you emitted the idea of creating a
> project for managing the documentation.
>
> I also think that highlighting the code in the documentation would add
> a lot of readability, user-friendliness and awesomeness : people (me
> first) like colourful websites :-)
>
> What do you think about that ? Let me know how I can get started.

Ok, tomorrow I push on pluf.indefero.net my tools to create the website
with the source.

I am dead tired right now so better going to sleep!

loïc
Reply all
Reply to author
Forward
0 new messages