@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // Si a ce stade on n'a pas de table, il y a un bug |
| 232 | 232 | if (!is_array($this->tableau)) { |
| 233 | 233 | $this->err = true; |
| 234 | - spip_log("erreur datasource " . var_export($command, true)); |
|
| 234 | + spip_log("erreur datasource ".var_export($command, true)); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // {datapath query.results} |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | if (isset($this->command['sourcemode']) |
| 272 | 272 | and !in_array($this->command['sourcemode'], array('table', 'array', 'tableau')) |
| 273 | 273 | ) { |
| 274 | - charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true); |
|
| 274 | + charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | # le premier argument peut etre un array, une URL etc. |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | # avons-nous un cache dispo ? |
| 281 | 281 | $cle = null; |
| 282 | 282 | if (is_string($src)) { |
| 283 | - $cle = 'datasource_' . md5($this->command['sourcemode'] . ':' . var_export($this->command['source'], true)); |
|
| 283 | + $cle = 'datasource_'.md5($this->command['sourcemode'].':'.var_export($this->command['source'], true)); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $cache = $this->cache_get($cle); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | if (!$this->err |
| 335 | - and $data_to_array = charger_fonction($this->command['sourcemode'] . '_to_array', 'inc', true) |
|
| 335 | + and $data_to_array = charger_fonction($this->command['sourcemode'].'_to_array', 'inc', true) |
|
| 336 | 336 | ) { |
| 337 | 337 | $args = $this->command['source']; |
| 338 | 338 | $args[0] = $data; |
@@ -467,13 +467,13 @@ discard block |
||
| 467 | 467 | $tv = '%s'; |
| 468 | 468 | } # {par valeur/xx/yy} ?? |
| 469 | 469 | else { |
| 470 | - $tv = 'table_valeur(%s, ' . var_export($r[1], true) . ')'; |
|
| 470 | + $tv = 'table_valeur(%s, '.var_export($r[1], true).')'; |
|
| 471 | 471 | } |
| 472 | 472 | $sortfunc .= ' |
| 473 | - $a = ' . sprintf($tv, '$aa') . '; |
|
| 474 | - $b = ' . sprintf($tv, '$bb') . '; |
|
| 473 | + $a = ' . sprintf($tv, '$aa').'; |
|
| 474 | + $b = ' . sprintf($tv, '$bb').'; |
|
| 475 | 475 | if ($a <> $b) |
| 476 | - return ($a ' . (!empty($r[2]) ? '>' : '<') . ' $b) ? -1 : 1;'; |
|
| 476 | + return ($a ' . (!empty($r[2]) ? '>' : '<').' $b) ? -1 : 1;'; |
|
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | } |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | function inc_sql_to_array_dist($data) { |
| 627 | 627 | # sortir le connecteur de $data |
| 628 | 628 | preg_match(',^(?:(\w+):)?(.*)$,Sm', $data, $v); |
| 629 | - $serveur = (string)$v[1]; |
|
| 629 | + $serveur = (string) $v[1]; |
|
| 630 | 630 | $req = trim($v[2]); |
| 631 | 631 | if ($s = sql_query($req, $serveur)) { |
| 632 | 632 | $r = array(); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | if (is_array($json = json_decode($data)) |
| 651 | 651 | or is_object($json) |
| 652 | 652 | ) { |
| 653 | - return (array)$json; |
|
| 653 | + return (array) $json; |
|
| 654 | 654 | } |
| 655 | 655 | } |
| 656 | 656 | |
@@ -669,13 +669,13 @@ discard block |
||
| 669 | 669 | $i = 1; |
| 670 | 670 | foreach ($entete as $k => $v) { |
| 671 | 671 | if (trim($v) == "") { |
| 672 | - $v = "col" . $i; |
|
| 672 | + $v = "col".$i; |
|
| 673 | 673 | } // reperer des eventuelles cases vides |
| 674 | 674 | if (is_numeric($v) and $v < 0) { |
| 675 | - $v = "__" . $v; |
|
| 675 | + $v = "__".$v; |
|
| 676 | 676 | } // ne pas risquer d'ecraser une cle numerique |
| 677 | 677 | if (is_numeric($v)) { |
| 678 | - $v = "_" . $v; |
|
| 678 | + $v = "_".$v; |
|
| 679 | 679 | } // ne pas risquer d'ecraser une cle numerique |
| 680 | 680 | $v = strtolower(preg_replace(',\W+,', '_', translitteration($v))); |
| 681 | 681 | foreach ($csv as &$item) { |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | * @return array|bool |
| 760 | 760 | */ |
| 761 | 761 | function inc_pregfiles_to_array_dist($dir, $regexp = -1, $limit = 10000) { |
| 762 | - return (array)preg_files($dir, $regexp, $limit); |
|
| 762 | + return (array) preg_files($dir, $regexp, $limit); |
|
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | /** |
@@ -774,13 +774,13 @@ discard block |
||
| 774 | 774 | $glob_to_array = charger_fonction('glob_to_array', 'inc'); |
| 775 | 775 | $a = $glob_to_array($data); |
| 776 | 776 | foreach ($a as &$v) { |
| 777 | - $b = (array)@stat($v); |
|
| 777 | + $b = (array) @stat($v); |
|
| 778 | 778 | foreach ($b as $k => $ignore) { |
| 779 | 779 | if (is_numeric($k)) { |
| 780 | 780 | unset($b[$k]); |
| 781 | 781 | } |
| 782 | 782 | } |
| 783 | - $b['file'] = preg_replace('`/$`','',$v) ; |
|
| 783 | + $b['file'] = preg_replace('`/$`', '', $v); |
|
| 784 | 784 | $v = array_merge( |
| 785 | 785 | pathinfo($v), |
| 786 | 786 | $b |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | $xml_array = array(); |
| 801 | 801 | for ($object->rewind(); $object->valid(); $object->next()) { |
| 802 | 802 | if (array_key_exists($key = $object->key(), $xml_array)) { |
| 803 | - $key .= '-' . uniqid(); |
|
| 803 | + $key .= '-'.uniqid(); |
|
| 804 | 804 | } |
| 805 | 805 | $vars = get_object_vars($object->current()); |
| 806 | 806 | if (isset($vars['@attributes'])) { |