cvs: pear /MDB2_Schema/MDB2 Schema.php

From: Date: Thu, 17 Aug 2006 20:10:54 +0000
Subject: cvs: pear /MDB2_Schema/MDB2 Schema.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-41669@lists.php.net to get a copy of this message
lsmith Thu Aug 17 20:10:54 2006 UTC Modified files: /pear/MDB2_Schema/MDB2 Schema.php Log: - fixed argument handling for calls to the function module in getExpression() http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/MDB2/Schema.php?r1=1.82&r2=1.83&diff_format=u Index: pear/MDB2_Schema/MDB2/Schema.php diff -u pear/MDB2_Schema/MDB2/Schema.php:1.82 pear/MDB2_Schema/MDB2/Schema.php:1.83 --- pear/MDB2_Schema/MDB2/Schema.php:1.82 Thu Aug 17 11:00:52 2006 +++ pear/MDB2_Schema/MDB2/Schema.php Thu Aug 17 20:10:54 2006 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: Schema.php,v 1.82 2006/08/17 11:00:52 lsmith Exp $ +// $Id: Schema.php,v 1.83 2006/08/17 20:10:54 lsmith Exp $ // require_once 'MDB2.php'; @@ -774,24 +774,22 @@ $str.= $this->db->quoteIdentifier($element['data'], true); break; case 'function': + $arguments = array(); + if (!empty($element['data']['arguments']) + && is_array($element['data']['arguments']) + ) { + foreach ($element['data']['arguments'] as $v) { + $arguments[] = $this->getExpression($v); + } + } if (method_exists($this->db->function, $element['data']['name'])) { - $arguments = empty($element['data']['arguments']) - ? array() : $element['data']['arguments']; $str.= call_user_func_array( array(&$this->db->function, $element['data']['name']), $arguments ); } else { $str.= $element['data']['name'].'('; - if (!empty($element['data']['arguments']) - && is_array($element['data']['arguments']) - ) { - $arguments = array(); - foreach ($element['data']['arguments'] as $v) { - $arguments[] = $this->getExpression($v); - } - $str.= implode(', ', $arguments); - } + $str.= implode(', ', $arguments); $str.= ')'; } break;

« previous php.pear.cvs (#41669) next »