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