Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Config] Don't check PATH_CACHE for memcached #1489

Merged
merged 1 commit into from
Mar 24, 2022
Merged

[Config] Don't check PATH_CACHE for memcached #1489

merged 1 commit into from
Mar 24, 2022

Conversation

jakubvalenta
Copy link
Contributor

Motivation

Be able to run RSS-Bridge from a read-only directory with memcached cache.

Changes

Move the check for PATH_CACHE from Configuration to the respective cache implementations.

Also gitignore .phpunit.result.cache which is created when running phpunit as described in the Coding style policy.

Testing

  1. Check that file cache fails when PATH_CACHE is not writable:

    $ chmod -w cache
    $ echo "[cache]
    type=\"file\"" > config.ini.php
    $ php index.php action=display bridge=Twitter context=By+username u=jack norep=on format=Atom
    Exception: RSS-Bridge does not have write permissions for /home/jakub/devel/rss-bridge/lib/../cache/! in /home/jakub/devel/rss-bridge/lib/error.php:24
    #0 /home/jakub/devel/rss-bridge/lib/error.php(42): returnError()
    #1 /home/jakub/devel/rss-bridge/caches/FileCache.php(13): returnServerError()
  2. Check that sqlite cache fails when PATH_CACHE is not writable:

    $ chmod -w cache
    $ echo "[cache]
    type=\"sqlite\"" > config.ini.php
    $ php index.php action=display bridge=Twitter context=By+username u=jack norep=on format=Atom
    Exception: RSS-Bridge does not have write permissions for /home/jakub/devel/rss-bridge/lib/../cache/! in /home/jakub/devel/rss-bridge/lib/error.php:24
    Stack trace:
    #0 /home/jakub/devel/rss-bridge/lib/error.php(42): returnError()
    #1 /home/jakub/devel/rss-bridge/caches/SQLiteCache.php(19): returnServerError()
    ...
  3. Check that memcached doesn't fail when PATH_CACHE is not writable:

    $ chmod -w cache
    $ echo "[cache]
    type=\"memcached\"" > config.ini.php
    $ php index.php action=display bridge=Twitter context=By+username u=jack norep=on format=Atom
    <?xml version="1.0" encoding="UTF-8"?>
    <feed xmlns="http://www.w3.org/2005/Atom">
    ...

@somini
Copy link
Contributor

somini commented Mar 18, 2020

LGTM, thanks for the very detailed merge request (with examples!).

@dvikan
Copy link
Contributor

dvikan commented Mar 24, 2022

Looks good.

@dvikan dvikan merged commit 8e2b655 into RSS-Bridge:master Mar 24, 2022
Kwbmm pushed a commit to Kwbmm/rss-bridge that referenced this pull request Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants