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

Request #7363 Callbacks in MDB2_Schema_Writer::dumpDatabase
Submitted: 2006-04-11 04:24 UTC
From: stoyan Assigned: lsmith
Status: Closed Package: MDB2 (version 2.0.0)
PHP Version: 5.0.5 OS: Windows
Roadmaps: (Not assigned)    

 [2006-04-11 04:24 UTC] stoyan (Stoyan)
Description: ------------ Currently only functions can be defined as callbacks in the 'output' option when calling dumpDatabase() This will send the dump to print_r(): $operation = $schema->dumpDatabase( array( 'output' => 'print_r' ) ); This won't work: $operation = $schema->dumpDatabase( array( 'output' => array($instance, 'method') ) ); Just changig a few lines in dumpDatabase() made it possible to use this and any other PHP callback syntax. The changes are: 1. } elseif (function_exists($arguments['output'])) { becomes } elseif (is_callable($arguments['output'])) { on line 207 in Schema/Writer.php 2. All $output($buffer); and $output($result); become call_user_func($output, $buffer); and call_user_func($output, $result);


 [2006-04-11 08:21 UTC] lsmith (Lukas Smith)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.