atom feed1 message in net.php.lists.pear-cvs[PEAR-CVS] svn: /pear/packages/DB_Dat...
FromSent OnAttachments
Alan KnowlesMay 5, 2015 3:37 am 
Subject:[PEAR-CVS] svn: /pear/packages/DB_DataObject/trunk/ DB/DataObject/Generator.php docs/example.ini
From:Alan Knowles (ala@php.net)
Date:May 5, 2015 3:37:33 am
List:net.php.lists.pear-cvs

alan_k Tue, 05 May 2015 10:37:33 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=336719

Log: fix feature request #20540 - support empty extends_location so that no
require_once is generated by Generator

Bug: http://pear.php.net/bugs/20540 (unknown)

Changed paths: U pear/packages/DB_DataObject/trunk/DB/DataObject/Generator.php U pear/packages/DB_DataObject/trunk/docs/example.ini

Modified: pear/packages/DB_DataObject/trunk/DB/DataObject/Generator.php =================================================================== --- pear/packages/DB_DataObject/trunk/DB/DataObject/Generator.php 2015-05-05
05:36:33 UTC (rev 336718) +++ pear/packages/DB_DataObject/trunk/DB/DataObject/Generator.php 2015-05-05
10:37:33 UTC (rev 336719) @@ -895,7 +895,7 @@ $options = &PEAR::getStaticProperty('DB_DataObject','options');

$this->_extends = empty($options['extends']) ? $this->_extends :
$options['extends']; - $this->_extendsFile = empty($options['extends_location']) ?
$this->_extendsFile : $options['extends_location']; + $this->_extendsFile = !isset($options['extends_location']) ?
$this->_extendsFile : $options['extends_location'];

foreach($this->tables as $this->table) { @@ -976,8 +976,12 @@ $head .= $this->derivedHookExtendsDocBlock();

- // requires - $head .= "require_once '{$this->_extendsFile}';\n\n"; + // requires - if you set extends_location = (blank) then no require
line will be set + // this can be used if you have an autoloader + + if (!empty($this->_extendsFile)) { + $head .= "require_once '{$this->_extendsFile}';\n\n"; + } // add dummy class header in... // class $head .= $this->derivedHookClassDocBlock(); @@ -1284,7 +1288,7 @@ $class_prefix = empty($options['class_prefix']) ? '' :
$options['class_prefix'];

$this->_extends = empty($options['extends']) ? $this->_extends :
$options['extends']; - $this->_extendsFile = empty($options['extends_location']) ?
$this->_extendsFile : $options['extends_location']; + $this->_extendsFile = !isset($options['extends_location']) ?
$this->_extendsFile : $options['extends_location'];

$classname = $this->classname =
$this->getClassNameFromTableName($this->table);

Modified: pear/packages/DB_DataObject/trunk/docs/example.ini =================================================================== --- pear/packages/DB_DataObject/trunk/docs/example.ini 2015-05-05 05:36:33 UTC
(rev 336718) +++ pear/packages/DB_DataObject/trunk/docs/example.ini 2015-05-05 10:37:33 UTC
(rev 336719) @@ -70,6 +70,8 @@ ; string added to php file for 'include('DB/DataObject');' ; usefull if you want to add an extra layer - eg. a table level
auth scheme.. ; optional :: default = DB/DataObject.php + ; if set to empty, then no 'require_once' line will be added -
usefull for + ; autoloading.

;extends =