@@ -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 | |
@@ -14,10 +14,10 @@ discard block |
||
| 14 | 14 | private $feedDescription; |
| 15 | 15 | |
| 16 | 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 | - */ |
|
| 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 = [ |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * Internal function for connecting to the database |
|
| 71 | - * |
|
| 72 | - * @return void |
|
| 73 | - */ |
|
| 70 | + * Internal function for connecting to the database |
|
| 71 | + * |
|
| 72 | + * @return void |
|
| 73 | + */ |
|
| 74 | 74 | private function connect() |
| 75 | 75 | { |
| 76 | 76 | try { |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Compares RSS file created timestamp and database timestamp to judge if new RSS file is needed |
|
| 104 | - * |
|
| 105 | - * Sets internal variable $this->valid to true/false depending if new file needs to be generate |
|
| 106 | - * @return void |
|
| 107 | - */ |
|
| 103 | + * Compares RSS file created timestamp and database timestamp to judge if new RSS file is needed |
|
| 104 | + * |
|
| 105 | + * Sets internal variable $this->valid to true/false depending if new file needs to be generate |
|
| 106 | + * @return void |
|
| 107 | + */ |
|
| 108 | 108 | private function checkValidity() |
| 109 | 109 | { |
| 110 | 110 | |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | - * Creates a new RSS File with information from the database. Max amount of news is configured in the initiation. |
|
| 138 | - * |
|
| 139 | - * @return void |
|
| 140 | - */ |
|
| 137 | + * Creates a new RSS File with information from the database. Max amount of news is configured in the initiation. |
|
| 138 | + * |
|
| 139 | + * @return void |
|
| 140 | + */ |
|
| 141 | 141 | private function createRSS() |
| 142 | 142 | { |
| 143 | 143 | $file = fopen($this->rssFile, "w+"); |
@@ -178,10 +178,10 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | - * Function that should be called to receive the RSS feed. |
|
| 182 | - * Checks if the latest RSS File is up to date, if not, generates a new one. |
|
| 183 | - * @return void |
|
| 184 | - */ |
|
| 181 | + * Function that should be called to receive the RSS feed. |
|
| 182 | + * Checks if the latest RSS File is up to date, if not, generates a new one. |
|
| 183 | + * @return void |
|
| 184 | + */ |
|
| 185 | 185 | public function getRSS() |
| 186 | 186 | { |
| 187 | 187 | $this->checkValidity(); |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | - * Inserts information to RSS database |
|
| 199 | - * @param $input should be an associative array with three pars TITLE, LINK, DESCRIPTION |
|
| 200 | - * |
|
| 201 | - * @return void |
|
| 202 | - */ |
|
| 198 | + * Inserts information to RSS database |
|
| 199 | + * @param $input should be an associative array with three pars TITLE, LINK, DESCRIPTION |
|
| 200 | + * |
|
| 201 | + * @return void |
|
| 202 | + */ |
|
| 203 | 203 | public function insertRSS($input = []) |
| 204 | 204 | { |
| 205 | 205 | $stmt = $this->db->prepare("INSERT INTO " . $this->table . " (TITLE, LINK, DESCRIPTION, CREATED) VALUES (?, ?, ?, datetime('now', 'localtime'))"); |