1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-06-10 16:44:54 +02:00
Commit Graph

23 Commits

Author SHA1 Message Date
14c689e7a3 [core] Fix typos 2016-11-09 19:10:40 +01:00
4dfbc16a5b Fix Cache write verification
PHP operator '===' is the only strict way to mix up the value '0' and
the value 'FALSE'.

The function saveData of the FileCache tests if the write of the cache
files was done with success and raise an Exception if not. The test was
done without the '===' operator, and if the data is 0 bytes long the
error message says there is a permission error, which is false.

A data 0 bytes long is another issue, either in the json_encode function
either in the Bridge, but not a permission issue.
2016-11-09 02:11:22 +01:00
82ed2c5ffb [FileCache] Change output format to JSON
JSON format does not serialize object instances, which we don't
want anyways, and improves readability. The hashing algorithm
changed to md5 to prevent collisions with existing cache files
2016-10-16 11:15:11 +02:00
5c309e93dc [cache] Specify cache duration for 'purgeCache' 2016-10-08 16:18:10 +02:00
2d56b717cf [FileCache] Add property to define cache folder 2016-10-08 16:03:08 +02:00
5639b158e7 [FileCache] Change parameters to lower-case
This prevents creating multiple cache files for the same request.
2016-10-08 15:34:19 +02:00
d941fa41f6 [FileCache] Remove 'isPrepareCache'
There is no need to check the absense of the parameters in
all functions. Instead 'getCacheName' is the only function
actually using the parameters and thus should check the
availability.
2016-10-08 15:21:10 +02:00
ac0a9a90ad [FileCache] Build file name solely on given parameters
Previously the cache file name was build on the original request URI
which also included the parameters. This could result in different
file name for the same request (different format). Removing the format
from the request is already done in index.php and could lead to issues
in the future (if new parameters are introduced).
2016-10-08 15:17:08 +02:00
5ccde61a19 [FileCache] Rename 'prepare' to 'setParameters'
This is a cosmetic change to use the same naming convention for
all methods.
2016-10-08 15:04:14 +02:00
0998cbde9d [cache] Directly implement CacheInterface in FileCache
The function 'prepare' previously implemented in CacheAbstract
is specifically required for FileCache and thus belongs to FileCache.
Since this change removes all code from CacheAbstract, it can be
removed completely.
2016-10-08 14:52:03 +02:00
5f1c4e1c55 [FileCache] Implement recursive directory creation 2016-10-07 23:20:32 +02:00
ad825aa88a [FileCache] Assign same permission to group as others
It makes no sense for the group to get less access rights
than anyone else
2016-10-07 23:16:33 +02:00
45890d5969 [FileCache] Don't store folder creation status
The results of the function is_dir are already cached.
See http://php.net/manual/en/function.is-dir.php
2016-10-07 22:56:10 +02:00
5fdb3b2fd9 [FileCache] Build path using function instead of constant 2016-10-07 22:36:36 +02:00
9ac678aac5 [Cache] Move 'purge' function to implementations
The purge function is cache specific and thus belongs
to the specific implementation.
2016-10-07 22:33:45 +02:00
51ff8de346 [Cache] Remove orphan function utf8_encode_deep 2016-10-07 22:06:58 +02:00
62eec43980 [core] Apply common indentation
All files are now using tabs for indentation
2016-09-10 20:41:11 +02:00
c2ea8d0ee9 [FileCache] Ignore 'format' when generating the file name
Previously for each requested format a new cache file was created,
though the data is the same. With this the file name no longer depends
on the requested output format.
2016-08-28 13:09:45 +02:00
d9b6477ff6 [FileCache] Fix loading cached data
Previously cached data was translated into object data (Item),
this is no longer necessary.
2016-08-22 18:59:23 +02:00
e59bf64c42 Fix cache bug, the content of the cache was encoded in utf8 before
converting to json and saved, resulting in double-encoded caracters in
output
2016-01-21 14:33:58 +01:00
259e5ef9de Casting to UTF-8 before converting to JSON. 2016-01-19 12:18:54 +00:00
2e4e89aff8 Correction of few bugs.
Warn if RSS-Bridge cannot write to disk.
Try/Catch the bridge RSS generation.

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
927b04dfef Refonte du code 2013-08-11 13:30:41 +02:00