I cleared out my phocoa_projects folder and began for the nth time
from the beginning of the documentation (altered version I have on my
desktop)
in short:
$ phocoa newProject
adding propel and building from mysql database (without timestamp)
$ cd blog/blog/modules
$ phocoa createSkeletonFromPropel
now my patched Horde/Yaml/Dumper.php writes the debugg test.txt file.
when I browse to debian2/blog I get a different error message:
An uncaught exception (PropelException) has occurred:
No connection information in your runtime configuration file for
datasource [blog]
Stack Trace:
Exception: PropelException
Error: No connection information in your runtime configuration file
for datasource [blog]
URL: http://debian2:8080/blog/list
Referrer: (none)
Trace: #0 /usr/share/php/propel/Propel.php(570): Propel::getConnection
('blog', 'write')
#1 /home/luke/phocoa_projects/blog/blog/classes/phocoa_blog/om/
BaseBlogPeer.php(261): Propel::getConnection('blog', 'read')
#2 /home/luke/phocoa_projects/blog/blog/classes/phocoa_blog/om/
BaseBlogPeer.php(243): BaseBlogPeer::doSelectStmt(Object(Criteria),
NULL)
#3 [internal function]: BaseBlogPeer::doSelect(Object(Criteria))
#4 /usr/share/php/phocoa/framework/WFPagination.php(918):
call_user_func(Array, Object(Criteria))
#5 /usr/share/php/phocoa/framework/WFPagination.php(624):
WFPagedPropelQuery->itemsAtIndex(1, 25, Array)
#6 /home/luke/phocoa_projects/blog/blog/modules/blog/blog.php(46):
WFPaginator->currentItems()
#7 /home/luke/phocoa_projects/blog/blog/modules/blog/blog.php(31):
module_blog_list->search(Object(WFPage), Array)
#8 /usr/share/php/phocoa/framework/WFPage.php(1574): module_blog_list-
>noAction(Object(WFPage), Array)
#9 /usr/share/php/phocoa/framework/WFPage.php(1324): WFPage->noAction
()
#10 /usr/share/php/phocoa/framework/WFModule.php(379): WFPage->initPage
('list')
#11 /usr/share/php/phocoa/framework/WFRequestController.php(137):
WFModuleInvocation->execute()
#12 /usr/share/php/phocoa/framework/WFRequestController.php(162):
WFRequestController->handleHTTPRequest()
#13 /usr/share/php/phocoa/framework/WFWebApplication.php(160):
WFRequestController->handleHTTPRequest()
#14 /usr/share/php/phocoa/framework/WFWebApplication.php(18):
WFWebApplication->runWebApplication()
#15 /home/luke/phocoa_projects/blog/blog/wwwroot/index.php(6):
WFWebApplicationMain()
#16 {main}
in the manual there are a bunch of single quotes:
postDts:
class: 'WFTextField'
bindings:
value:
instanceID: 'Blog'
controllerKey: 'selection'
modelKeyPath: 'postDts'
Wasn't that exactly what the Horde/Yaml/Dumper patch was supposed to
fix?
sorry, it's getting late, I shouldn't be posting anymore as I'm
getting more and more confused.
I've been working on getting phocoa running (with propel support) for
almost for a week now...
...devoted almost all day to it and still no real results...
Maybe an early week-end will help clear my mind and look at the whole
situation from another perspective.
Look in phocoa/framework/util/WFYaml.php it's a very simple wrapper
class.
Alan
On Dec 16, 2009, at 1:27 PM, SwissalpS wrote:
>> what is calling yaml? propel or phocoa directly?
> meant: Smarty or a Phocoa class directly
>
Mine looks like:
<config>
<!-- logging for this project moved to
MyWebApplicationDelegate.php::initialize() -->
<!--
#
# P R O P E L P R O P E R T I E S
#
# Note that you can configure multiple datasources; for example
if your
# project uses several databases.
-->
<propel>
<datasources default="showcaseng">
<datasource id="showcaseng">
<!-- the Propel adapter (usually same as phptype of
connection DSN) -->
<adapter>pgsql</adapter>
<!-- Connection DSN. See PEAR DSN format for other
supported parameters. -->
<connection>
<dsn>pgsql:dbname=mydb;user=mydbuser;host=localhost</dsn>
<classname>DebugPDO</classname>
</connection>
</datasource>
</datasources>
</propel>
</config>
Alan
Oh and maybe you're right; maybe the patch for Horde/YAML has to be in
place when you GENERATE the scaffold or it does them unquoted. So
maybe your horde/yaml is fixed, but you didn't re-run the scaffold
generator? Maybe it isnt' on the read side, but the write side...
Try just going into the search.yaml or list.yaml (forgot which the
scaffold gens) and change the
arrayController: #module#blah
to
arrayController: '#module#blah'
See if that works.
Alan
up to this point there are no error messages in Terminal
I check in list.yaml: all values containing # are enclosed in single
quotes -> seems ok to me
checking runtime-conf.xml I notice a difference to yours (appart from
the mysql bits)
in your listing there is a 'classname' tag which doesn't appear in
mine, but doesn't seem to matter:
<propel>
<datasources default="phocoa_blog">
<datasource id="phocoa_blog">
<!-- the Propel adapter (usually same as phptype of
connection DSN) -->
<adapter>mysql</adapter>
<!-- Connection DSN. See PEAR DSN format for other
supported parameters. -->
<connection>
<!-- propel 1.3 -->
<dsn>mysql:dbname=phocoa_blog;user=phocoa;host=localhost;password=phocoa</
dsn>
<user>phocoa</user>
<!-- propel 1.2 -->
<phptype>mysql</phptype>
<hostspec>localhost</hostspec>
<database>phocoa_blog</database>
<username>phocoa</username>
<password>phocoa</password>
</connection></datasource></dataso.....
Q: when createSkeleton is run, it doesn't actually connect to the db?
just looks up the schema.xml?
if anyone wants to recreate my scenario, here's also my sql:
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are
set.
SET FOREIGN_KEY_CHECKS = 0;
#-----------------------------------------------------------------------------
#-- blog
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `blog`;
CREATE TABLE `blog`
(
`blog_id` INTEGER(10) NOT NULL AUTO_INCREMENT,
`title` VARCHAR(100) NOT NULL,
`post` TEXT NOT NULL,
`post_dts` INTEGER(10) default 0 NOT NULL,
PRIMARY KEY (`blog_id`)
)Type=MyISAM;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
http://phocoa-server/blog/edit
and hey, no errors!
well until I actually fill the fields and attempt to create the entry.
The error message is now shown in a box
It reads: No connection information in your runtime configuration file
for datasource [blog]
Q: this message is generated by propel? If so, I must trace what's
happening in propel and not phocoa.
Trying to find the bug I've tried with different dbNames. Seems it
only works if (dbName === tableName) and possibly the project name
must also match.
So now my looming question is: what will I do when I want to access
another table in the same database?
The workaround seems to be to make a new db for each table....which
s****s imo
well I'm off. Got to do something productive after 'wasting' so much
time...
that's for debug connection, it's ok if it's not there.
> <propel>
> <datasources default="phocoa_blog">
> <datasource id="phocoa_blog">
> <!-- the Propel adapter (usually same as phptype of
> connection DSN) -->
> <adapter>mysql</adapter>
> <!-- Connection DSN. See PEAR DSN format for other
> supported parameters. -->
> <connection>
> <!-- propel 1.3 -->
>
> <
> dsn
> >mysql:dbname=phocoa_blog;user=phocoa;host=localhost;password=phocoa</
> dsn>
> <user>phocoa</user>
> <!-- propel 1.2 -->
> <phptype>mysql</phptype>
> <hostspec>localhost</hostspec>
> <database>phocoa_blog</database>
> <username>phocoa</username>
> <password>phocoa</password>
> </connection></datasource></dataso.....
>
> Q: when createSkeleton is run, it doesn't actually connect to the db?
> just looks up the schema.xml?
It does not talk to the db, or schema.xml.
Propel can be introspected at runtime to get the schema, and I the
"scaffold generator" talks to a WFModel which is a phocoa-internal
object hierarchy for representing object model. There is an adapter to
build a WFModel from Propel-generated classes. This is the decoupling
I was talking about earlier by which phocoa isn't hard-coded against
propel.
Alan
Not exactly sure what issue you're running into here, but just trying
to explain a little.
Maybe this weekend I can build the blog project on my box and share it
with you. I'll see if I have time.
Alan
I'm staying 'out of trouble' for the moment, getting to know the
framework using just one table, one database.
When I've collected some satisfaction/motivation from the great
results, I'll be back to figure out the depths of the couplings.
Hope that you have had time to look into whatever is causing the
problems, by then.
a grateful but tired and spent Luke