diff options
author | Urban Müller | 2008-05-09 01:59:41 +0000 |
---|---|---|
committer | Urban Müller | 2008-05-09 01:59:41 +0000 |
commit | 99a45216ecec35e631f232c6bfc36fdcd7222ffe (patch) | |
tree | 0f130a1ffb1dfb33054e7940e093bc3b185f8f5c /it_text.class | |
parent | 555be4ad6ad1e774497bdaf687a3021cda49f372 (diff) | |
download | itools-99a45216ecec35e631f232c6bfc36fdcd7222ffe.tar.gz itools-99a45216ecec35e631f232c6bfc36fdcd7222ffe.tar.bz2 itools-99a45216ecec35e631f232c6bfc36fdcd7222ffe.zip |
allow save when only one textfile in path
Diffstat (limited to 'it_text.class')
-rw-r--r-- | it_text.class | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/it_text.class b/it_text.class index 3d48d96..c920941 100644 --- a/it_text.class +++ b/it_text.class @@ -52,7 +52,7 @@ function it_text($p = array()) foreach ((array)$p['phpfile'] as $phpfile) { $oldtext = $this->statictext; - if (is_array($ret = @include($phpfile))) + if (is_array($ret = include($phpfile))) $this->statictext += $ret; else $this->statictext = $oldtext + $this->statictext; # FIXME: compatibility mode @@ -238,7 +238,8 @@ function dump_php() $this->statictext = array_merge(array('_' => $text['_']), $text); $oldmask = umask(002); - if ($f = fopen($this->p['phpfile'], 'w')) + $phpfiles = (array)$this->p['phpfile']; + if ($f = fopen(count($phpfiles) == 1 ? $phpfiles[0] : null, 'w')) { $result = (fputs($f, '<?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") !== false); fclose($f); |