From 1fd90324ca4537c16771e64c6c966e1df9650c43 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 10 Feb 2016 23:13:02 +0300 Subject: [PATCH] temporary disable OptHelper fix getDate method (add file not empty check) --- retailcrm/app.php | 7 ------- retailcrm/src/Helpers/DataHelper.php | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/retailcrm/app.php b/retailcrm/app.php index 5bcc4c9..ef2b30a 100644 --- a/retailcrm/app.php +++ b/retailcrm/app.php @@ -14,16 +14,9 @@ $shortopts = 'dluce:m:p:r:h:'; $options = getopt($shortopts); -if (!$options || $options == -1) { - $opt = new OptHelper($shortopts); - $options = $opt->get(); -} - if (isset($options['e'])) { $command = new Command($options); $command->run(); -} elseif (!$options) { - CommandHelper::notWorkGetOptNotice(); } else { CommandHelper::runHelp(); } diff --git a/retailcrm/src/Helpers/DataHelper.php b/retailcrm/src/Helpers/DataHelper.php index 352a5df..c5aca4f 100644 --- a/retailcrm/src/Helpers/DataHelper.php +++ b/retailcrm/src/Helpers/DataHelper.php @@ -4,7 +4,7 @@ class DataHelper { public static function getDate($file) { - if (file_exists($file)) { + if (file_exists($file) && 1 < filesize($file)) { $result = file_get_contents($file); } else { $result = date(