From: Derick Alangi Date: Sun, 24 Mar 2019 23:14:49 +0000 (+0100) Subject: db: Use variable functions/callbacks instead of call_user_func() X-Git-Tag: 1.34.0-rc.0~2352^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%22id_auteur=%24connect_id_auteur%22%29%20.%20%22?a=commitdiff_plain;h=a7d1ad4d246b316c45b5ef882580869f85e19aa7;p=lhc%2Fweb%2Fwiklou.git db: Use variable functions/callbacks instead of call_user_func() Performance-wise, this gives a little boost in performance and also it's more readable I think. But I could be wrong so please someone let me know. See: https://www.php.net/manual/en/function.call-user-func.php Change-Id: I2f0a00408c29549a786b56792411f88998a5f003 --- diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 16bde4b959..cfc9e2949b 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -969,7 +969,7 @@ class DatabaseOracle extends Database { // Defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}'; while ( !feof( $fp ) ) { if ( $lineCallback ) { - call_user_func( $lineCallback ); + $lineCallback(); } $line = trim( fgets( $fp, 1024 ) ); $sl = strlen( $line ) - 1; @@ -1015,7 +1015,7 @@ class DatabaseOracle extends Database { $cmd = $this->replaceVars( $cmd ); if ( $inputCallback ) { - call_user_func( $inputCallback, $cmd ); + $inputCallback( $cmd ); } $res = $this->doQuery( $cmd ); if ( $resultCallback ) {