[geeklog-devtalk] geeklog-devel digest, Vol 1 #425 - 4 msgs
geeklog-devel-request at lists.geeklog.net
geeklog-devel-request at lists.geeklog.net
Thu Nov 4 13:00:02 EST 2004
Send geeklog-devel mailing list submissions to
geeklog-devel at lists.geeklog.net
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.geeklog.net/listinfo/geeklog-devel
or, via email, send a message with subject or body 'help' to
geeklog-devel-request at lists.geeklog.net
You can reach the person managing the list at
geeklog-devel-admin at lists.geeklog.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of geeklog-devel digest..."
Today's Topics:
1. Geeklog 2 and Propel (Tony Bibbs)
2. Propel revisit (Tony Bibbs)
3. Re: State of the Na^Wproject (Dirk Haun)
4. Re: State of the Na^Wproject (Vincent Furia)
--__--__--
Message: 1
Date: Wed, 03 Nov 2004 17:10:14 -0600
From: Tony Bibbs <tony at tonybibbs.com>
To: geeklog-devel at tonybibbs.com
Subject: [geeklog-devel] Geeklog 2 and Propel
Reply-To: geeklog-devel at lists.geeklog.net
If you do anything today please read this entire message...it's a bit
long but I want to be sure you all get a quick look of something that
really excites me and could make all our PHP5 coding faster.
I just finished my test drive with Propel. I had to do so because we
are looking for an Object Relational Mapping (ORM) tool to use in our
PHP environment here at work. I do have it working already with a copy
of the Auth_Enterprise database I have. As a recap here is what it can do:
1) You can define your data model and use Propel to generate an XML file
that describes your database. Here is a snippet from that file (note
there is a DTD you can use for validating this):
<table name="ae_group">
<column name="grp_id" type="SMALLINT" required="true"
primaryKey="true"/>
<column name="grp_app_id" type="VARCHAR" size="30" required="true"
primaryKey="true" default=""/>
<column name="grp_logical_name" type="VARCHAR" size="50"
required="true" default=""/>
<column name="grp_display_name" type="VARCHAR" size="50"
required="true" default=""/>
<column name="grp_descr" type="VARCHAR" size="255" required="true"
default=""/>
<column name="grp_create_date" type="INTEGER" required="true"
default="0"/>
<column name="grp_change_date" type="INTEGER"/>
<column name="grp_change_user_name" type="VARCHAR" size="75"
primaryKey="true"/>
<foreign-key foreignTable="ae_application">
<reference local="grp_app_id" foreign="app_id"/>
</foreign-key>
<foreign-key foreignTable="ae_user">
<reference local="grp_change_user_name" foreign="user_name"/>
</foreign-key>
</table>
If you look closely you'll notice it basically is the schema represented
in XML. Only gotcha was that I had to define all the foreign keys by
hand even though this database uses foreign key. Not a huge deal.
2) Then you can build your project. A build seems like something that
PHP projects shouldn't have to do but here is what happens during the build:
- Schema is used to build php5 classes, two for each table in the
database. The first is the model class and it is an object the
represents the table with all the appropriate getters and setters. The
second is a 'Peer' class which is used to do searches against that table
- The config file (ini style) is then converted to a PHP array
3) You simply copy the classes and the config file over to your webtree
and you have at it. Here is code to save a new application in
Auth_Enterprise:
include_once 'propel/Propel.php';
Propel::init('/var/www/localhost/htdocs/PropelCreoleTest/Auth_Enterprise-conf.php');
include_once 'PropelCreoleTest/classes/Auth_Enterprise/AeApplication.php';
$app = new AeApplication();
$app->setAppId('PROPEL_TEST_APP_ID');
$app->setAppName('Propel Auth_Enterprise Test Application');
$app->setAppContactEmail('tony at geeklog.net');
$app->save(); // note this is transaction safe.
Only gotcha is the build system is required on developer machines. The
build tool is called Phing (http://phing.info). It seems to be
complicated to me yet because I don't understand how it works really but
using Propel most of the Phing specifics are hidden from you. Note that
Phing is not required when deploying applications (i.e. end-users
wouldn't need it).
This may all seem complicated but after I got Phing, Propel and Creole
installed (most of which use the pear install command) I was able to get
this code up and running in a matter of minutes.
Anyway, even if it doesn't make it into Geeklog 2 it should at least be
considered. The main reason is that by using Propel, we don't worry
about the database access portion anymore an we can simply concentrate
on implementing our features.
Only gotchas so far is that it requires the use of their DB abstraction
layer called Creole (i.e. it won't work with PEAR::DB).
--Tony
--__--__--
Message: 2
Date: Wed, 03 Nov 2004 20:04:02 -0600
From: Tony Bibbs <tony at tonybibbs.com>
To: geeklog-devel at lists.geeklog.net
Subject: [geeklog-devel] Propel revisit
Reply-To: geeklog-devel at lists.geeklog.net
FYI, the XSLT requirement is only for the build process...not for all
application using it.
--Tony
Vincent Furia wrote:
>I just noticed this about propel (pre-installation requirements):
>
># PHP >= 5.0.0 with XSLT support (--with-xsl on *nix, or enable
>php_xsl.dll on Windows)
>
>Is XSLT a commonly supported item? Can we depend on it being compiled
>in on most PHP5 installations at ISPs?
>
>-Vinny
>
>
>On Mon, 02 Aug 2004 09:13:03 -0500, Tony Bibbs <tony at tonybibbs.com> wrote:
>
>
>>Well, as far as other DB connections go, that is up to the coder,
>>obviously. GL2 should only worry about talking to the GL2 database so
>>if you want to access another database you should, without much hassle,
>>be able to open connections using the Creole DB layer that Propel uses:
>>
>>http://creole.phpdb.org/wiki/
>>
>>Obviously you can still do your own with PEAR::DB or raw MySQL in your
>>code. The DAO layer simply provides a slick way to prevent the
>>developer from issuing raw SQL in the code...sometimes that can't be
>>avoided and I'm sure there is probably way to issue raw SQL in unique
>>scenarios (I need to verify that).
>>
>>--Tony
>>
>>
>>
>>Blaine Lang wrote:
>>
>>
>>
>>>It does look interesting and like many new libraries or models, it may be
>>>able to improve code readability, reduce code size, and improve
>>>re-useability but I do wonder if
>>>1) There are any SQL usage restrictions or more complex SQL queries that
>>>will not work.
>>>2) Will you still be able to use another DB access method and direct mysql_
>>>calls using PHP
>>>3) Making GL2 too complex to understand for developers will effect it's
>>>support
>>>
>>>I have had reason on several occasions to need to access another mysql
>>>database when doing application integration. I just used the direct php
>>>mysql_ calls and created a 2nd DBlink. The current mysql library in GL1.x
>>>does not support this. We should consider this need in GL2
>>>
>>>Blaine
>>>----- Original Message -----
>>>From: "Vincent Furia" <vfuria at gmail.com>
>>>To: <geeklog-devel at lists.geeklog.net>
>>>Sent: Saturday, July 31, 2004 11:17 PM
>>>Subject: Re: [geeklog-devel] Is this rocking the boat?
>>>
>>>
>>>I haven't had enough time to read up on this extensively, but it looks
>>>promising. We just have to make sure that it fulfills all our needs
>>>completely and won't cause any problems down the road. Also, we have
>>>to be able to support it on the off chance that the current developers
>>>drop the project.
>>>
>>>My one worry is possible performance penalties. I think we should
>>>check how much overhead Propel requires.
>>>
>>>Most importantly: I want to see GL2 get moving really soon. So a
>>>decision on this has to happen soon. Can we get enough research done
>>>on this topic that we're not causing more delays?
>>>
>>>I'll spend some more time reading the Propel docs. If nothing else the
>>>idea sounds pretty interesting.
>>>
>>>-Vinny
>>>
>>>On Fri, 30 Jul 2004 16:38:26 -0500, Tony Bibbs <tony at tonybibbs.com> wrote:
>>>
>>>
>>>
>>>
>>>>Ok, I think I sent this link here, but the more I read what I see, the
>>>>more I like it. Please take some time to read about Propel:
>>>>
>>>>http://propel.phpdb.org
>>>>
>>>>And read the user guide:
>>>>
>>>>http://propel.phpdb.org/docs/user_guide/
>>>>
>>>>The long and short of it is this. We could implement Data Acces Objects
>>>>that our code uses to interact with the database. DAO is a good idea no
>>>>matter what DB abstraction layer we use and regardless if we use a tool
>>>>like Propel. Essentially it hides the data access specifics from the
>>>>developers. Instead developers will call simple methods on the data
>>>>access objects and let the DAO layer do the grunt work.
>>>>
>>>>We could essentially use DAO to wrap the use of Propel for data acess.
>>>>
>>>>That said there are some pros and cons:
>>>>
>>>>Pros:
>>>>1) Clean API, developers no longer have to write SQL except in really
>>>>rare instances.
>>>>2) Object oriented...right in line with GL2
>>>>3) Database changes are easier, now developers don't have to find all
>>>>SQL effected by a database change. We simply change things at the
>>>>Propel level (wrapped by DAO), modify our HTML templates and we are off
>>>>to the race.
>>>>
>>>>Cons:
>>>>1) It is conceptionally more complicated. Requires some ramp up.
>>>>2) Uses it's own DB abstraction layer (i.e. you can't use PEAR::DB even
>>>>if you wanted to).
>>>>3) It's in Beta.
>>>>
>>>>I think this tool could really save a ton of time. Please give this a
>>>>gander and try using it against a very simply table and let me know your
>>>>thoughts.
>>>>
>>>>--Tony
>>>>_______________________________________________
>>>>geeklog-devel mailing list
>>>>geeklog-devel at lists.geeklog.net
>>>>http://lists.geeklog.net/listinfo/geeklog-devel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>_______________________________________________
>>>geeklog-devel mailing list
>>>geeklog-devel at lists.geeklog.net
>>>http://lists.geeklog.net/listinfo/geeklog-devel
>>>
>>>_______________________________________________
>>>geeklog-devel mailing list
>>>geeklog-devel at lists.geeklog.net
>>>http://lists.geeklog.net/listinfo/geeklog-devel
>>>
>>>
>>>
>>>
>>_______________________________________________
>>geeklog-devel mailing list
>>geeklog-devel at lists.geeklog.net
>>http://lists.geeklog.net/listinfo/geeklog-devel
>>
>>
>>
>_______________________________________________
>geeklog-devel mailing list
>geeklog-devel at lists.geeklog.net
>http://lists.geeklog.net/listinfo/geeklog-devel
>
>
--__--__--
Message: 3
From: "Dirk Haun" <dirk at haun-online.de>
To: <geeklog-devel at lists.geeklog.net>
Subject: Re: [geeklog-devel] State of the Na^Wproject
Date: Thu, 4 Nov 2004 18:07:23 +0100
Organization: Terra Software Systems
Reply-To: geeklog-devel at lists.geeklog.net
Blaine,
>Hum, the LOCK TABLES call in comment.php is generating a SQL error for me.
>I've contacted my host admin to change my DB perms.
>I wonder if others will see this issue with 1.3.10 - I suspect we would
>have heard by now.
You're not the first one - see
<http://www.geeklog.net/comment.php?mode=view&cid=12256>
bye, Dirk
--
http://www.haun-online.de/
http://www.macosx-faq.de/
--__--__--
Message: 4
Date: Thu, 4 Nov 2004 12:30:49 -0500
From: Vincent Furia <vfuria at gmail.com>
To: geeklog-devel at lists.geeklog.net
Subject: Re: [geeklog-devel] State of the Na^Wproject
Reply-To: geeklog-devel at lists.geeklog.net
If people feel this is going to be a big deal I can make it an option
to use "LOCK". With it disabled though there is a risk of the
comments table becoming corrupted (this could happen if two comment
operations, specifically delete or add, occur at the same time). Not
likely a problem for small sites, but could cause issues for even
moderately sized sites.
Fixing such a corruption is possible (and not too complicated), but
does takes some MySQL magic.
Thoughts?
-Vinny
On Thu, 4 Nov 2004 18:07:23 +0100, Dirk Haun <dirk at haun-online.de> wrote:
> Blaine,
>
> >Hum, the LOCK TABLES call in comment.php is generating a SQL error for me.
> >I've contacted my host admin to change my DB perms.
> >I wonder if others will see this issue with 1.3.10 - I suspect we would
> >have heard by now.
>
> You're not the first one - see
> <http://www.geeklog.net/comment.php?mode=view&cid=12256>
>
> bye, Dirk
>
> --
> http://www.haun-online.de/
> http://www.macosx-faq.de/
>
>
>
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
>
--__--__--
_______________________________________________
geeklog-devel mailing list
geeklog-devel at lists.geeklog.net
http://lists.geeklog.net/listinfo/geeklog-devel
End of geeklog-devel Digest
More information about the geeklog-devtalk
mailing list