[Scummvm-git-logs] scummvm-web master -> 4c0e0bebe88a6958e71f5e24ee73a5e1c2cecfde
Mataniko
mataniko at gmail.com
Fri Oct 2 12:53:41 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .
Summary:
c0c4209efe WEB: Fallback cache to files
4c0e0bebe8 BUILD: Update README
Commit: c0c4209efe926c4e535fe1dfc775e1e93f56964e
https://github.com/scummvm/scummvm-web/commit/c0c4209efe926c4e535fe1dfc775e1e93f56964e
Author: Mataniko (mataniko at gmail.com)
Date: 2020-10-02T08:53:30-04:00
Commit Message:
WEB: Fallback cache to files
Changed paths:
include/Models/BasicModel.php
public_html/index.php
diff --git a/include/Models/BasicModel.php b/include/Models/BasicModel.php
index f016f45f..69481e5f 100644
--- a/include/Models/BasicModel.php
+++ b/include/Models/BasicModel.php
@@ -3,17 +3,23 @@ namespace ScummVM\Models;
use Phpfastcache\Helper\Psr16Adapter;
use Phpfastcache\Drivers\Redis\Config;
+use Phpfastcache\Exceptions\PhpfastcacheDriverConnectException;
abstract class BasicModel
{
protected static $cache;
- private $data;
public function __construct()
{
if (is_null(self::$cache)) {
- $config = new Config(['database' => 8]);
- self::$cache = new Psr16Adapter('redis', $config);
+ try {
+ $database = $_SERVER['HTTP_HOST'] === 'www.scummvm.org' ? 8 : 7;
+ $config = new Config(['database' => $database]);
+ self::$cache = new Psr16Adapter('redis', $config);
+ } catch (PhpfastcacheDriverConnectException $ex) {
+ // Fallback to files based cache
+ self::$cache = new Psr16Adapter('files');
+ }
}
}
diff --git a/public_html/index.php b/public_html/index.php
index a87cc928..c9d6a1ac 100644
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -9,6 +9,7 @@ namespace ScummVM;
if (isset($_SERVER['SERVER_SOFTWARE']) &&
\preg_match("/PHP [\d\.]+ Development Server/",$_SERVER['SERVER_SOFTWARE'])) {
chdir('public_html');
+ define('DEV_SERVER', true);
if (\preg_match('/\.(?:png|jpg|jpeg|gif|css|js)/', $_SERVER["REQUEST_URI"])) {
return false;
}
Commit: 4c0e0bebe88a6958e71f5e24ee73a5e1c2cecfde
https://github.com/scummvm/scummvm-web/commit/4c0e0bebe88a6958e71f5e24ee73a5e1c2cecfde
Author: Mataniko (mataniko at gmail.com)
Date: 2020-10-02T08:53:30-04:00
Commit Message:
BUILD: Update README
Changed paths:
README.md
diff --git a/README.md b/README.md
index 6320c998..9bb13cf9 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,7 @@ Before installing please make sure you have the following installed:
* [Node.js & npm](https://nodejs.org/)
* [Git](https://git-scm.com/)
* [Glue](https://glue.readthedocs.io/en/latest/installation.html)
+* [Redis](https://redis.io/) (Optional)
### Installing
@@ -53,7 +54,9 @@ run site-install on the server.
## Updating data
Most data is now managed upstream in a spreadsheet. To re-generate the data files
-run `composer update-data`
+run `composer update-data` note that this will run automatically on site update
+but is encouraged for you to do manually to keep track on who's updating the
+data.
## Contributing
@@ -73,4 +76,4 @@ multiple components in a single commit.
YAML files should adhere to the [Flathub YAML Style Guide](https://github.com/flathub/flathub/wiki/YAML-Style-Guide).
-PHP files use phpcbf. Please run `composer lint` before committing code.
\ No newline at end of file
+PHP files use phpcbf. Please run `composer lint` before committing code.
More information about the Scummvm-git-logs
mailing list