Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #19505 Upgrading from 1.7.15 to 1.10.0 causes error due to no links file
Submitted: 2012-07-12 02:49 UTC
From: noeldc Assigned: alan_k
Status: Closed Package: DB_DataObject (version 1.10.0)
PHP Version: 5.3.8 OS: OSX 10.6.8
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 29 + 23 = ?

 
 [2012-07-12 02:49 UTC] noeldc (Noel Da Costa)
Description: ------------ I'm using DB_DataObjects without any links file because I find it non RAD to use the links.ini file. Until v1.7.15, this worked fine. It hasn't worked since then. Test script: --------------- $test = DB_DataObject::factory('menu'); DB_DataObject::debugLevel(5); $result = $test->get(1); var_dump($result); die('end'); Expected result: ---------------- Menu: CONNECT: NEW CONNECTION Menu: CONNECT: mysql://root:root@localhost/headspace_local fdc0344bd4c91aff97a75e2d0628c197 Menu: CONNECT: a:1: {s:32:"fdc0344bd4c91aff97a75e2d0628c197";O:8:"DB_mysql" :8: {s:10:"autocommit";b:1;s:8:"dbsyntax";s:5:"mysql";s:3:"dsn" ;a:9: {s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"u sername";s:4:"root";s:8:"password";s:4:"root";s:8:"protocol"; s:3:"tcp";s:8:"hostspec";s:9:"localhost";s:4:"port";b:0;s:6:"so cket";b:0;s:8:"database";s:15:"headspace_local";}s:8:"featur es";a:7: {s:5:"limit";s:5:"alter";s:8:"new_link";s:5:"4.2.0";s:7:"numro ws";b:1;s:8:"pconnect";b:1;s:7:"prepare";b:0;s:3:"ssl";b:0;s: 12:"transactions";b:1;}s:9:"fetchmode";i:1;s:22:"fetchmode_ object_class";s:8:"stdClass";s:7:"options";a:8: {s:16:"result_buffering";i:500;s:10:"persistent";b:0;s:3:"ssl"; b:0;s:5:"debug";i:0;s:14:"seqname_format";s:6:"%s_seq";s:8 :"autofree";b:0;s:11:"portability";i:0;s:8:"optimize";s:11:"perf ormance";}s:13:"was_connected";b:1;}} DB_DataObject_Generator: CONNECT: USING CACHED CONNECTION DB_DataObject_Generator: fillTable: getting def for headspace_local/menu DB_DataObject_Generator: defs: Array ( [0] => Array ( [table] => menu [name] => menu_id [type] => int [len] => 10 [flags] => not_null primary_key unsigned auto_increment ) [1] => Array ( [table] => menu [name] => name [type] => string [len] => 25 [flags] => ) [2] => Array ( [table] => menu [name] => editable [type] => int [len] => 1 [flags] => ) [3] => Array ( [table] => menu [name] => viewable [type] => string [len] => 255 [flags] => ) [4] => Array ( [table] => menu [name] => description [type] => blob [len] => 65535 [flags] => blob ) ) TABLE STRUCTURE FOR menu Array ( [0] => stdClass Object ( [table] => menu [name] => menu_id [type] => int [len] => 10 [flags] => not_null primary_key unsigned auto_increment ) [1] => stdClass Object ( [table] => menu [name] => name [type] => string [len] => 25 [flags] => ) [2] => stdClass Object ( [table] => menu [name] => editable [type] => int [len] => 1 [flags] => ) [3] => stdClass Object ( [table] => menu [name] => viewable [type] => string [len] => 255 [flags] => ) [4] => stdClass Object ( [table] => menu [name] => description [type] => blob [len] => 65535 [flags] => blob ) ) Array ( [0] => dump for menu [1] => Array ( [table] => Array ( [menu_id] => 129 [name] => 2 [editable] => 17 [viewable] => 2 [description] => 66 ) [keys] => Array ( [menu_id] => N ) ) ) Menu: GET: menu_id 1 Array ( [0] => menu_id ) Menu: __find: 1 Menu: QUERY: SELECT * FROM menu WHERE menu.menu_id = 1 Menu: query: QUERY DONE IN 0.000351905822754 seconds Menu: RESULT: O:9:"DB_result":11: {s:8:"autofree";b:0;s:3:"dbh";O:8:"DB_mysql":8: {s:10:"autocommit";b:1;s:8:"dbsyntax";s:5:"mysql";s:3:"dsn" ;a:9: {s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"u sername";s:4:"root";s:8:"password";s:4:"root";s:8:"protocol"; s:3:"tcp";s:8:"hostspec";s:9:"localhost";s:4:"port";b:0;s:6:"so cket";b:0;s:8:"database";s:15:"headspace_local";}s:8:"featur es";a:7: {s:5:"limit";s:5:"alter";s:8:"new_link";s:5:"4.2.0";s:7:"numro ws";b:1;s:8:"pconnect";b:1;s:7:"prepare";b:0;s:3:"ssl";b:0;s: 12:"transactions";b:1;}s:9:"fetchmode";i:1;s:22:"fetchmode_ object_class";s:8:"stdClass";s:7:"options";a:8: {s:16:"result_buffering";i:500;s:10:"persistent";b:0;s:3:"ssl"; b:0;s:5:"debug";i:0;s:14:"seqname_format";s:6:"%s_seq";s:8 :"autofree";b:0;s:11:"portability";i:0;s:8:"optimize";s:11:"perf ormance";}s:13:"was_connected";b:1;}s:9:"fetchmode";i:1;s: 22:"fetchmode_object_class";s:8:"stdClass";s:11:"limit_count" ;N;s:10:"limit_from";N;s:10:"parameters";a:0: {}s:5:"query";s:47:"SELECT * FROM menu WHERE menu.menu_id = 1 ";s:6:"result";i:0;s:11:"row_counter";N;s:9:"statement";N;} Menu: __find: CHECK autofetchd 1 Menu: __find: ABOUT TO AUTOFETCH Menu: FETCH: a:5: {s:7:"menu_id";s:1:"1";s:4:"name";s:8:"TopMenu2";s:8:"edit able";N;s:8:"viewable";s:1:"1";s:11:"description";s:30:"Main headspace navigation menu";} Menu: fetchrow LINE: menu_id = 1 Menu: fetchrow LINE: name = TopMenu2 Menu: fetchrow LINE: editable = Menu: fetchrow LINE: viewable = 1 Menu: fetchrow LINE: description = Main headspace navigation menu Menu: fetchrow: menu DONE Menu: __find: DONE int(1) end Actual result: -------------- Menu: CONNECT: Checking for database specific ini ('') : database_ in options Menu: CONNECT: NEW CONNECTION TP DATABASE : Menu: CONNECT: mysql://root:root@localhost/headspace_local fdc0344bd4c91aff97a75e2d0628c197 Menu: CONNECT: a:1: {s:32:"fdc0344bd4c91aff97a75e2d0628c197";O:8:"DB_mysql" :8: {s:10:"autocommit";b:1;s:8:"dbsyntax";s:5:"mysql";s:3:"dsn" ;a:9: {s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"u sername";s:4:"root";s:8:"password";s:4:"root";s:8:"protocol"; s:3:"tcp";s:8:"hostspec";s:9:"localhost";s:4:"port";b:0;s:6:"so cket";b:0;s:8:"database";s:15:"headspace_local";}s:8:"featur es";a:7: {s:5:"limit";s:5:"alter";s:8:"new_link";s:5:"4.2.0";s:7:"numro ws";b:1;s:8:"pconnect";b:1;s:7:"prepare";b:0;s:3:"ssl";b:0;s: 12:"transactions";b:1;}s:9:"fetchmode";i:1;s:22:"fetchmode_ object_class";s:8:"stdClass";s:7:"options";a:8: {s:16:"result_buffering";i:500;s:10:"persistent";b:0;s:3:"ssl"; b:0;s:5:"debug";i:0;s:14:"seqname_format";s:6:"%s_seq";s:8 :"autofree";b:0;s:11:"portability";i:0;s:8:"optimize";s:11:"perf ormance";}s:13:"was_connected";b:1;}} Menu: databaseStructure: Cant find database schema: headspace_local/menu in links file data: Array ( [headspace_local] => Array ( ) ) Menu: ERROR: Unable to load schema for database and table (turn debugging up to 5 for full error message) DB_DataObject Error: Unable to load schema for database and table (turn debugging up to 5 for full error message)

Comments

 [2012-07-12 08:51 UTC] alan_k (Alan Knowles)
Can you test this - the decision code for using the proxy generator should be simpler. Note you need to have the ini setting 'proxy' => 1 set somewhere for it to work. http://svn.php.net/viewvc/pear/packages/DB_DataObject/trunk/DB/DataObject.php? revision=326601&view=co
 [2012-07-12 13:31 UTC] noeldc (Noel Da Costa)
Just tried the version on your (with proxy = full and then with proxy = 1). No change. Same error: Menu: CONNECT: Checking for database specific ini ('') : database_ in options Menu: CONNECT: NEW CONNECTION TP DATABASE : Menu: CONNECT: mysql://root:root@localhost/headspace_local fdc0344bd4c91aff97a75e2d0628c197 Menu: CONNECT: a:1: {s:32:"fdc0344bd4c91aff97a75e2d0628c197";O:8:"DB_mysql":8: {s:10:"autocommit";b:1;s:8:"dbsyntax";s:5:"mysql";s:3:"dsn";a:9: {s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"username";s:4:"root" ;s:8:"password";s:4:"root";s:8:"protocol";s:3:"tcp";s:8:"hostspec";s:9:"localhost";s :4:"port";b:0;s:6:"socket";b:0;s:8:"database";s:15:"headspace_local";}s:8:"featur es";a:7: {s:5:"limit";s:5:"alter";s:8:"new_link";s:5:"4.2.0";s:7:"numrows";b:1;s:8:"pconnec t";b:1;s:7:"prepare";b:0;s:3:"ssl";b:0;s:12:"transactions";b:1;}s:9:"fetchmode";i:1 ;s:22:"fetchmode_object_class";s:8:"stdClass";s:7:"options";a:8: {s:16:"result_buffering";i:500;s:10:"persistent";b:0;s:3:"ssl";b:0;s:5:"debug";i:0;s :14:"seqname_format";s:6:"%s_seq";s:8:"autofree";b:0;s:11:"portability";i:0;s:8:" optimize";s:11:"performance";}s:13:"was_connected";b:1;}} Menu: databaseStructure: Cant find database schema: headspace_local/menu in links file data: Array ( [headspace_local] => Array ( ) ) Menu: ERROR: Unable to load schema for database and table (turn debugging up to 5 for full error message) DB_DataObject Error: Unable to load schema for database and table (turn debugging up to 5 for full error message)
 [2012-07-12 14:23 UTC] alan_k (Alan Knowles)
I've tested it here with tests/bug6953.php Seems to work fine - it looks like it's not picking up your proxy setting try var_Dump'ing the value near line 1981 to check that it's trying to use the generator.
 [2012-07-12 14:26 UTC] noeldc (Noel Da Costa)
What variable must I var_dump?
 [2012-07-12 14:32 UTC] noeldc (Noel Da Costa)
OK never mind. Was getting confused between two code-bases. Setting proxy = 1 does work. Tx!
 [2012-07-18 21:58 UTC] alan_k (Alan Knowles)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alan_k
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2013-03-25 18:01 UTC] noeldc (Noel Da Costa)
I've tried this again recently in a bit more depth. While the proxy only seems now to work if I set it to "full" rather than to "1" – it is only actually working for getting the table information. Setter methods in the dataobject won't run at all. So for example, I have proxy = full and the following code: <code> $person = DB_DataObject::factory('person'); $person->setCompany(1); var_dump($person); </code> When I var_dump $person it shows no value for company property. Also if I go in an put debug code into the setPerson() method in the Company DataObject, it doesn't run. So it seems like the setters do not work when running with the proxy. It all still works fine on v1.7.15
 [2013-04-03 15:21 UTC] alan_k (Alan Knowles)
This really needs a test case. Looking at the code now - I'm supprised that proxy=1 would work, as factory calls Generatory::getProxy{ proxy option }()