From 643c93a740d3ab6dd0611510260de7955f46a96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=A3=E8=A8=80?= <59419979@qq.com> Date: Wed, 27 Nov 2019 09:18:17 +0800 Subject: [PATCH] =?UTF-8?q?CronAbstract=20=E5=9F=BA=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/siam/AbstractInterface/CronAbstract.php | 58 +++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/siam/AbstractInterface/CronAbstract.php diff --git a/src/siam/AbstractInterface/CronAbstract.php b/src/siam/AbstractInterface/CronAbstract.php new file mode 100644 index 0000000..2654edb --- /dev/null +++ b/src/siam/AbstractInterface/CronAbstract.php @@ -0,0 +1,58 @@ +before(); + + $res = $this->doJob($data); + + return $this->after($res); + } + + /** + * @return mixed + */ + abstract function before(); + + /** + * @param null $data + * @return bool + */ + abstract function doJob($data = NULL); + + /** + * @param bool $res + * @return mixed + */ + abstract function after($res = true); + + protected function log($string) + { + echo date('Y-m-d H:i:s')." {$string} ". PHP_EOL; + } +} \ No newline at end of file