@@ -13,11 +13,11 @@ discard block |
||
| 13 | 13 | private $newsCount; |
| 14 | 14 | private $feedDescription; |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Initiates the class, takes parameters as input but should work with standard settings. |
|
| 18 | - * Connects to the DB and makes sure the table exists. |
|
| 19 | - * @param $params is the input to adjust standard settings. I recommend to change only the 'feedDescription' part. |
|
| 20 | - */ |
|
| 16 | + /** |
|
| 17 | + * Initiates the class, takes parameters as input but should work with standard settings. |
|
| 18 | + * Connects to the DB and makes sure the table exists. |
|
| 19 | + * @param $params is the input to adjust standard settings. I recommend to change only the 'feedDescription' part. |
|
| 20 | + */ |
|
| 21 | 21 | public function __construct($params = []) |
| 22 | 22 | { |
| 23 | 23 | $options = [ |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | $this->createDB(); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * Internal function for connecting to the database |
|
| 70 | - * |
|
| 71 | - * @return void |
|
| 72 | - */ |
|
| 68 | + /** |
|
| 69 | + * Internal function for connecting to the database |
|
| 70 | + * |
|
| 71 | + * @return void |
|
| 72 | + */ |
|
| 73 | 73 | private function connect() |
| 74 | 74 | { |
| 75 | 75 | try { |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | $stmt->execute(); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - /** |
|
| 102 | - * Compares RSS file created timestamp and database timestamp to judge if new RSS file is needed |
|
| 103 | - * |
|
| 104 | - * Sets internal variable $this->valid to true/false depending if new file needs to be generate |
|
| 105 | - * @return void |
|
| 106 | - */ |
|
| 101 | + /** |
|
| 102 | + * Compares RSS file created timestamp and database timestamp to judge if new RSS file is needed |
|
| 103 | + * |
|
| 104 | + * Sets internal variable $this->valid to true/false depending if new file needs to be generate |
|
| 105 | + * @return void |
|
| 106 | + */ |
|
| 107 | 107 | private function checkValidity() |
| 108 | 108 | { |
| 109 | 109 | |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - /** |
|
| 136 | - * Creates a new RSS File with information from the database. Max amount of news is configured in the initiation. |
|
| 137 | - * |
|
| 138 | - * @return void |
|
| 139 | - */ |
|
| 135 | + /** |
|
| 136 | + * Creates a new RSS File with information from the database. Max amount of news is configured in the initiation. |
|
| 137 | + * |
|
| 138 | + * @return void |
|
| 139 | + */ |
|
| 140 | 140 | private function createRSS() |
| 141 | 141 | { |
| 142 | 142 | $file = fopen($this->rssFile, "w+"); |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | </rss>'); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - /** |
|
| 180 | - * Function that should be called to receive the RSS feed. |
|
| 181 | - * Checks if the latest RSS File is up to date, if not, generates a new one. |
|
| 182 | - * @return void |
|
| 183 | - */ |
|
| 179 | + /** |
|
| 180 | + * Function that should be called to receive the RSS feed. |
|
| 181 | + * Checks if the latest RSS File is up to date, if not, generates a new one. |
|
| 182 | + * @return void |
|
| 183 | + */ |
|
| 184 | 184 | public function getRSS() |
| 185 | 185 | { |
| 186 | 186 | $this->checkValidity(); |
@@ -193,12 +193,12 @@ discard block |
||
| 193 | 193 | readfile($this->rssFile); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - /** |
|
| 197 | - * Inserts information to RSS database |
|
| 198 | - * @param $input should be an associative array with three pars TITLE, LINK, DESCRIPTION |
|
| 199 | - * |
|
| 200 | - * @return void |
|
| 201 | - */ |
|
| 196 | + /** |
|
| 197 | + * Inserts information to RSS database |
|
| 198 | + * @param $input should be an associative array with three pars TITLE, LINK, DESCRIPTION |
|
| 199 | + * |
|
| 200 | + * @return void |
|
| 201 | + */ |
|
| 202 | 202 | public function insertRSS($input = []) |
| 203 | 203 | { |
| 204 | 204 | $stmt = $this->db->prepare("INSERT INTO ". $this->table ." (TITLE, LINK, DESCRIPTION, CREATED) VALUES (?, ?, ?, datetime('now', 'localtime'))"); |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * An example of a project-specific implementation. |
|
| 4 | - * |
|
| 5 | - * After registering this autoload function with SPL, the following line |
|
| 6 | - * would cause the function to attempt to load the \Foo\Bar\Baz\Qux class |
|
| 7 | - * from /path/to/project/src/Baz/Qux.php: |
|
| 8 | - * |
|
| 9 | - * new \Foo\Bar\Baz\Qux; |
|
| 10 | - * |
|
| 11 | - * @param string $class The fully-qualified class name. |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 3 | + * An example of a project-specific implementation. |
|
| 4 | + * |
|
| 5 | + * After registering this autoload function with SPL, the following line |
|
| 6 | + * would cause the function to attempt to load the \Foo\Bar\Baz\Qux class |
|
| 7 | + * from /path/to/project/src/Baz/Qux.php: |
|
| 8 | + * |
|
| 9 | + * new \Foo\Bar\Baz\Qux; |
|
| 10 | + * |
|
| 11 | + * @param string $class The fully-qualified class name. |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | 14 | spl_autoload_register( |
| 15 | 15 | function ($class) { |
| 16 | 16 | |