diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-10-13 12:07:13 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-10-13 12:07:13 +0200 |
commit | d9f6275ebca035fec8331652c677981056793ccc (patch) | |
tree | 37a64baf4f0eba6b781040605965383d8aded2cc /application/FileUtils.php | |
parent | 38672ba0d1c722e5d6d33a58255ceb55e9410e46 (diff) | |
parent | d63ff87a009313141ae684ec447b902562ff6ee7 (diff) | |
download | Shaarli-d9f6275ebca035fec8331652c677981056793ccc.tar.gz Shaarli-d9f6275ebca035fec8331652c677981056793ccc.tar.zst Shaarli-d9f6275ebca035fec8331652c677981056793ccc.zip |
Merge branch 'v0.11' into stablestable
Diffstat (limited to 'application/FileUtils.php')
-rw-r--r-- | application/FileUtils.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/application/FileUtils.php b/application/FileUtils.php index b89ea12b..30560bfc 100644 --- a/application/FileUtils.php +++ b/application/FileUtils.php | |||
@@ -1,6 +1,8 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | require_once 'exceptions/IOException.php'; | 3 | namespace Shaarli; |
4 | |||
5 | use Shaarli\Exceptions\IOException; | ||
4 | 6 | ||
5 | /** | 7 | /** |
6 | * Class FileUtils | 8 | * Class FileUtils |
@@ -44,7 +46,7 @@ class FileUtils | |||
44 | 46 | ||
45 | return file_put_contents( | 47 | return file_put_contents( |
46 | $file, | 48 | $file, |
47 | self::$phpPrefix.base64_encode(gzdeflate(serialize($content))).self::$phpSuffix | 49 | self::$phpPrefix . base64_encode(gzdeflate(serialize($content))) . self::$phpSuffix |
48 | ); | 50 | ); |
49 | } | 51 | } |
50 | 52 | ||
@@ -62,7 +64,7 @@ class FileUtils | |||
62 | { | 64 | { |
63 | // Note that gzinflate is faster than gzuncompress. | 65 | // Note that gzinflate is faster than gzuncompress. |
64 | // See: http://www.php.net/manual/en/function.gzdeflate.php#96439 | 66 | // See: http://www.php.net/manual/en/function.gzdeflate.php#96439 |
65 | if (! is_readable($file)) { | 67 | if (!is_readable($file)) { |
66 | return $default; | 68 | return $default; |
67 | } | 69 | } |
68 | 70 | ||