Archived
1
0
Fork 0
This repository has been archived on 2020-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
news-script/src/Publisher.php

30 lines
523 B
PHP

<?php
namespace Oreolek;
class Publisher {
public $text;
protected $dry_run = true;
public function __construct($config) {
$this->dry_run = $config['DRY_RUN'];
}
protected function _publish(string $text): void {
}
public function publish(string $text): void {
if (empty($this->client)) {
return;
}
try {
$this->_publish($text);
} catch (\Exception $e) {
echo $e;
return;
}
if (!$this->dry_run) {
file_put_contents('.lastrun', time());
}
}
}