propel-gen problem

34 views
Skip to first unread message

ctodd

unread,
Oct 25, 2007, 10:20:54 PM10/25/07
to phocoa dev
I'm running through the steps in the new version of the "Getting
Started" guide. I use CentOS and MySQL.

CentOS 4.5
php-5.1.6
propel 1.2.1
phing 2.3.0beta1
creole 1.10

I transcribed the PostGRES schema to MySQL. Note that datetime has to
have a default value or Creole complains.

CREATE TABLE `blog` (
`blog_id` int(11) NOT NULL,
`post_dts` datetime NOT NULL default '0000-00-00 00:00:00',
`title` varchar(100) NOT NULL,
`post` text NOT NULL,
PRIMARY KEY (`blog_id`)
);

I ran into an issue with the incorrect database URL being generated in
build.properties :

[echo] +-----------------------------------------------+
[echo] | |
[echo] | Generating XML from Creole connection ! |
[echo] | |
[echo] +-----------------------------------------------+
[propel-creole-transform] Propel - CreoleToXMLSchema starting
[propel-creole-transform] Your DB settings are:
[propel-creole-transform] driver : (default)
[propel-creole-transform] URL : mysql://phocoa_blog:phocoa_blog+localhost/phocoa_blog
[propel-creole-transform] There was an error building XML from
metadata: connect failed [Native Error: Unknown MySQL server host
'phocoa_blog' (1)] [User Info: Array]
[propel-creole-transform] Propel - CreoleToXMLSchema finished

The '+' in the above URL should be an '@' not '+'. This may be used
due to SQLite syntax.

I changed this and the script executed further, but failed with :

BUILD FAILED
Target 'convert-conf' does not exist in this project.

I did some digging and I see the Phing target 'convert-conf' changed
in Propel 1.3, previously the target is called 'convert-props'. Once I
changed this, it appears to have worked fine.

I pulled the software from Pear, so I have "stable' versions rather
than 'beta'. I suspect others using mainstream OSes will run into
this. FYI...

Alan Pinstein

unread,
Oct 26, 2007, 10:36:20 AM10/26/07
to phoco...@googlegroups.com
FYI, the propel mailing lists at phpdb.org are great and you'll be
able to get better/faster answers to propel questions there. I am on
that list too so I'll see them as well.

I use postgres, so I don't know too much about mysql issues and
propel. I know that it's used a lot, I just don't pay attention to
the changes done on the mysql end.

Alan

ctodd

unread,
Oct 26, 2007, 2:44:52 PM10/26/07
to phocoa dev

On Oct 26, 7:36 am, Alan Pinstein <apinst...@mac.com> wrote:
> FYI, the propel mailing lists at phpdb.org are great and you'll be
> able to get better/faster answers to propel questions there. I am on
> that list too so I'll see them as well.
>
> I use postgres, so I don't know too much about mysql issues and
> propel. I know that it's used a lot, I just don't pay attention to
> the changes done on the mysql end.

What mechanism generates the build.properties file? That's where the
issue is. Wasn't sure if that's Phocoa, Phing, etc.

Alan Pinstein

unread,
Oct 26, 2007, 3:43:49 PM10/26/07
to phoco...@googlegroups.com
Which build.properties? The one in project/propel-build? If so,
that's phocoa. If not, it's not phocoa. The "phocoa" cli script is
just a phing wrapper, so they are equivalent.

Alan

ctodd

unread,
Oct 26, 2007, 4:21:39 PM10/26/07
to phocoa dev

On Oct 26, 12:43 pm, Alan Pinstein <apinst...@mac.com> wrote:
> Which build.properties? The one in project/propel-build?

Yes. I went back and looked at the CLI output and it seemed this was
phocoa.

So you need to treat mysql and sqlite differently.

Chris

Alan Pinstein

unread,
Oct 26, 2007, 4:31:03 PM10/26/07
to phoco...@googlegroups.com
I do? Or one does? What's different, the DSN?

ctodd

unread,
Oct 26, 2007, 7:30:02 PM10/26/07
to phocoa dev

On Oct 26, 1:31 pm, Alan Pinstein <apinst...@mac.com> wrote:
> I do? Or one does? What's different, the DSN?

Yes. Sorry, I thought I made that clear in the previous post. :-)

mysql://phocoa_blog:phocoa_blog+localhost/phocoa_blog

Should be :

mysql://phocoa_blog:phocoa_blog@localhost/phocoa_blog

Chris

ctodd

unread,
Oct 26, 2007, 8:04:21 PM10/26/07
to phocoa dev

Looks like that's hard coded in the phing/build.xml file. Seems this
will be different depending on the database type. I guess + must work
for PostgreSQL. I saw a reference to SQLite somewhere, that's where I
thought the + came from since SQLite is possibly used in place of
MySQL.

Chris

Alan Pinstein

unread,
Oct 26, 2007, 9:59:08 PM10/26/07
to phoco...@googlegroups.com
Ok thanks. I did not realize that the DNS format wasn't universal. I
kinda thought that was the point. Now I know!

Alan

Alan Pinstein

unread,
Oct 26, 2007, 10:01:57 PM10/26/07
to phoco...@googlegroups.com
Ok I posted it as an issue. I'll see about fixing this soon.

BTW you are really motivating me to get the svn up! Lots of these are
tiny fixes :)

Alan

ctodd

unread,
Nov 2, 2007, 2:46:58 AM11/2/07
to phocoa dev

Apparently the + is *not* an issue as previously thought. There is a
new issue concerning the way Propel gets MySQL credentials. Unlike the
pgsql driver, the MySQL username is not derived from the DSN, it
requires an extra attribute <user> in runtime-conf.xml. i.e. :

<!-- propel 1.3 -->

<dsn>mysql:dbname=blog;user=blog;host=localhost;password=blog</dsn>
<user>blog</user>

Chris

Alan Pinstein

unread,
Nov 2, 2007, 9:06:02 AM11/2/07
to phoco...@googlegroups.com
Yep OK I saw that bug report. I'll fix that up. Should work with PG
too now that I've seen how the propel code works under the covers.
Let me fix it and test a bit and I'll post something this weekend.

Alan

Reply all
Reply to author
Forward
0 new messages