diff options
author | Urban Müller | 2020-10-30 13:23:10 +0100 |
---|---|---|
committer | Urban Müller | 2020-10-30 13:23:10 +0100 |
commit | 7a90374e44f42c88ac968863c16846ad351bcaf0 (patch) | |
tree | 6cca96f8e032c9cb265cbb9bd8432208a340450b | |
parent | e6de1a44981894e907fb07fe9d84c82fd5f5a472 (diff) | |
download | itools-7a90374e44f42c88ac968863c16846ad351bcaf0.tar.gz itools-7a90374e44f42c88ac968863c16846ad351bcaf0.tar.bz2 itools-7a90374e44f42c88ac968863c16846ad351bcaf0.zip |
remove support for old array syntax
-rw-r--r-- | it_text.class | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/it_text.class b/it_text.class index 7b27006..dbfda47 100644 --- a/it_text.class +++ b/it_text.class @@ -274,18 +274,12 @@ function dump_php() $oldmask = umask(002); $filename = $this->p['phpfiles'][0]; - $oldsyntax = file_exists($filename) && it::system('fgrep -q " => [" {filename}', ['filename' => $filename]); - if ((count($this->p['phpfiles']) == 1) && ($f = it::fopen($filename, 'w'))) + if ((count($this->p['phpfiles']) == 1)) { $dump = '<?php return ' . strtr(var_export($this->statictext, true), array("=> \n array (" => "=> array(", "array (\n '_'" => "array(\n'_'", "\n ),\n " => "\n),\n", "\n ),\n" => "\n),\n", "\r" => "")) . ";\n?>\n"; - if (!$oldsyntax) - { - it::file_put_contents($tmpfile = tempnam('/tmp/', 'texts_'), $dump); - $dump = it::exec('/www/server/bin/convertsyntax.php -a {tmpfile}', ['tmpfile' => $tmpfile]); - unlink($tmpfile); - } - $result = (fputs($f, $dump) !== false); - fclose($f); + it::file_put_contents($tmpfile = tempnam('/tmp/', 'texts_'), $dump); + $result = it::system('/www/server/bin/convertsyntax.php -a {tmpfile} >{filename}', ['tmpfile' => $tmpfile, 'filename' => $filename]) == 0; + unlink($tmpfile); } umask($oldmask); |