[Scummvm-git-logs] scummvm-web master -> fa02c297e2a7d719d8f54f1c9d9b4809022f43b1
Mataniko
mataniko at gmail.com
Sat Sep 1 20:10:34 CEST 2018
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .
Summary:
b72bd9e6f1 WEB: Fix deprecated PHP constructor
22303aacf4 BUILD: Update the build files to start development easily
31df61c560 BUILD: Remove unnecessary modifiation to the baseurl
43b9acb89c BUILD: Open the browser when starting a development session
fa02c297e2 BUILD: Add a README
Commit: b72bd9e6f196b9f45ba6103ab9015f0ed65f1af6
https://github.com/scummvm/scummvm-web/commit/b72bd9e6f196b9f45ba6103ab9015f0ed65f1af6
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-09-01T14:10:30-04:00
Commit Message:
WEB: Fix deprecated PHP constructor
Changed paths:
include/Objects/QASection.php
diff --git a/include/Objects/QASection.php b/include/Objects/QASection.php
index 7f2b7b6..5aba60b 100644
--- a/include/Objects/QASection.php
+++ b/include/Objects/QASection.php
@@ -17,7 +17,7 @@ class QASection extends BasicObject {
* @param int $section_number used in the TOC
* @param array $xref reference to xref map
*/
- public function QASection($data, $section_number, &$xref) {
+ public function __construct($data, $section_number, &$xref) {
$this->_title = $data['title'];
$this->_entries = array();
$this->_toc = array();
Commit: 22303aacf450830defdc4618f7ca32b95448b541
https://github.com/scummvm/scummvm-web/commit/22303aacf450830defdc4618f7ca32b95448b541
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-09-01T14:10:30-04:00
Commit Message:
BUILD: Update the build files to start development easily
Changed paths:
A dev-router.php
.htaccess
composer.json
site-update/install.sh
diff --git a/.htaccess b/.htaccess
index 3aca5ba..3776ce0 100644
--- a/.htaccess
+++ b/.htaccess
@@ -146,3 +146,8 @@ RewriteRule ^(vendor/|composer\.json|composer\.lock) - [F,L,NC]
# node
##
RewriteRule ^(node_modules/|package\.json|package-lock\.json) - [F,L,NC]
+
+##
+# dev files
+##
+RewriteRule ^(router-dev\.php) - [F,L,NC]
diff --git a/composer.json b/composer.json
index 12c04a5..6fc5473 100644
--- a/composer.json
+++ b/composer.json
@@ -16,6 +16,10 @@
"post-install-cmd": [
"pscss -f compressed ./scss/main.scss > ./css/main.css",
"pscss -f compressed ./scss/pages/_cloud-style.scss > ./css/cloud-style.css"
+ ],
+ "dev": [
+ "cd site-update;./install.sh;cd ..",
+ "php -S localhost:8000 dev-router.php"
]
}
}
diff --git a/dev-router.php b/dev-router.php
new file mode 100644
index 0000000..8a43a18
--- /dev/null
+++ b/dev-router.php
@@ -0,0 +1,30 @@
+<?php
+if (preg_match('/\.(?:png|jpg|jpeg|gif|css|js|svg)/', basename($_SERVER["REQUEST_URI"]))) {
+ return false; // serve the requested resource as-is.
+} else {
+ $url = str_replace('index.php', '', strtolower($_SERVER['PHP_SELF']));
+ $url = trim($url, '/');
+ $urlArray = explode("/", $url);
+
+ $_GET['p'] = $urlArray[0];
+ switch ($urlArray[0]) {
+ case "feeds":
+ $_GET['f'] = $urlArray[1];
+ break;
+ case "compatibility":
+ $_GET['v'] = $urlArray[1];
+ $_GET['t'] = $urlArray[2];
+ break;
+ case "news":
+ $_GET['d'] = $urlArray[1];
+ break;
+ case "screenshots":
+ $_GET['cat'] = $urlArray[1];
+ $_GET['game'] = $urlArray[2];
+ $_GET['num'] = $urlArray[3];
+ break;
+ }
+
+}
+$_SERVER['SCRIPT_NAME'] = '/index.php';
+require 'index.php';
diff --git a/site-update/install.sh b/site-update/install.sh
old mode 100644
new mode 100755
index afcc1b0..93b9545
--- a/site-update/install.sh
+++ b/site-update/install.sh
@@ -14,7 +14,12 @@ echo '$ git status'
git status
# Generate image sprite
-echo 'Generating games and platforms sprites'
+echo 'Checking for glue'
+if ! [ -x "$(command -v glue)" ]; then
+ echo 'Installing glue'
+ pip install glue
+fi
+echo 'Glue found. Generating games and platforms sprites'
glue images/icons/games/ --img=images/ --scss=scss/sprites/ --retina
glue images/icons/platforms/ --img=images/ --scss=scss/sprites/ --retina
mv scss/sprites/games.scss scss/sprites/_games.scss
@@ -32,7 +37,7 @@ export COMPOSER_HOME=/var/www/composer
echo "Composer home:" $COMPOSER_HOME
echo '$ composer install'
composer install 2>&1
-
+
# Run npm install
echo "$ npm install"
npm install 2>&1
Commit: 31df61c56087eb1475cd94d2817ac2e663531290
https://github.com/scummvm/scummvm-web/commit/31df61c56087eb1475cd94d2817ac2e663531290
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-09-01T14:10:30-04:00
Commit Message:
BUILD: Remove unnecessary modifiation to the baseurl
Changed paths:
include/config.inc.php
diff --git a/include/config.inc.php b/include/config.inc.php
index 192f160..c250cd4 100644
--- a/include/config.inc.php
+++ b/include/config.inc.php
@@ -15,11 +15,11 @@ date_default_timezone_set("UTC");
/* Base URL to the website. */
if ($_SERVER['SERVER_PORT'] == '80') {
- $url = "http://{$_SERVER['SERVER_NAME']}" . dirname($_SERVER['PHP_SELF']);
+ $url = "http://{$_SERVER['SERVER_NAME']}";
} else if ($_SERVER['SERVER_PORT'] == '443') {
- $url = "https://{$_SERVER['SERVER_NAME']}" . dirname($_SERVER['PHP_SELF']);
+ $url = "https://{$_SERVER['SERVER_NAME']}";
} else {
- $url = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}" . dirname($_SERVER['PHP_SELF']);
+ $url = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}";
}
if (substr($url, -1) != '/') {
Commit: 43b9acb89c637e9c9eeb6f7b47121df0cc15075c
https://github.com/scummvm/scummvm-web/commit/43b9acb89c637e9c9eeb6f7b47121df0cc15075c
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-09-01T14:10:30-04:00
Commit Message:
BUILD: Open the browser when starting a development session
Changed paths:
A dev-os.php
.htaccess
composer.json
diff --git a/.htaccess b/.htaccess
index 3776ce0..9f42817 100644
--- a/.htaccess
+++ b/.htaccess
@@ -150,4 +150,4 @@ RewriteRule ^(node_modules/|package\.json|package-lock\.json) - [F,L,NC]
##
# dev files
##
-RewriteRule ^(router-dev\.php) - [F,L,NC]
+RewriteRule ^(dev-router\.php|dev-os\.php) - [F,L,NC]
diff --git a/composer.json b/composer.json
index 6fc5473..033d735 100644
--- a/composer.json
+++ b/composer.json
@@ -17,9 +17,15 @@
"pscss -f compressed ./scss/main.scss > ./css/main.css",
"pscss -f compressed ./scss/pages/_cloud-style.scss > ./css/cloud-style.css"
],
- "dev": [
- "cd site-update;./install.sh;cd ..",
- "php -S localhost:8000 dev-router.php"
+ "build": [
+ "cd site-update;./install.sh;cd .."
+ ],
+ "run": [
+ "php -S localhost:8000 dev-router.php & php dev-os.php"
+ ],
+ "develop": [
+ "@build",
+ "@run"
]
}
}
diff --git a/dev-os.php b/dev-os.php
new file mode 100644
index 0000000..f53d4e3
--- /dev/null
+++ b/dev-os.php
@@ -0,0 +1,16 @@
+<?php
+ switch (PHP_OS) {
+ case "Darwin":
+ exec('open http://localhost:8000');
+ break;
+ case "Linux":
+ exec('xdg-open http://localhost:8000');
+ break;
+ case "Windows":
+ exec('start http://localhost:8000');
+ break;
+ default:
+ exec('xdg-open http://localhost:8000');
+ break;
+ }
+?>
Commit: fa02c297e2a7d719d8f54f1c9d9b4809022f43b1
https://github.com/scummvm/scummvm-web/commit/fa02c297e2a7d719d8f54f1c9d9b4809022f43b1
Author: Matan Bareket (mataniko at gmail.com)
Date: 2018-09-01T14:10:30-04:00
Commit Message:
BUILD: Add a README
Changed paths:
README
diff --git a/README b/README
index e69de29..2c19df0 100644
--- a/README
+++ b/README
@@ -0,0 +1,61 @@
+# ScummVM-Web
+
+This project is the main ScummVM website located at: https://www.scummvm.org
+
+## Getting Started
+
+These instructions will get you a copy of the project up and running on your
+local machine for development and testing purposes. See deployment for notes
+on how to deploy the project on a live system.
+
+### Prerequisites
+
+The ScummVM website relies on several tools to install properly.
+Before installing please make sure you have the following installed:
+
+* [Composer](https://getcomposer.org/)
+* [Python & pip](https://www.python.org/) (2.7.9+/3.4+)
+* [Node.js & npm](https://nodejs.org/)
+* [Git](https://git-scm.com/)
+
+### Installing
+
+Clone this repo
+
+```
+git clone https://github.com/scummvm/scummvm-web.git
+```
+
+Then run
+
+```
+composer develop
+```
+
+This will run the build scripts and start a web server on port 8000.
+
+Additionally you can either build or run independently using:
+```
+composer build
+composer run
+```
+respectively.
+
+## Deployment
+
+To deploy changes to the site, simply push the updates to origin/master and
+run site-install on the server.
+
+## Contributing
+
+Similar to ScummVM, please use the appropriate project name when contributing:
+* **I18N:** Modifications related to translations.
+* **CSS:** Changes to stylesheets.
+* **TEMPLATES:** Changes to page and component templates.
+* **IMAGES:** Site graphics (Icons are excluded).
+* **ICONS:** New game and platform Icons. Please see the Wiki for updated
+submission guidelines.
+* **DATA:** Site data files.
+* **BUILD:** Files related to building and developing the site.
+* **WEB:** Catch-all for things that don't fit any of the above, or a mix of
+multiple components in a single commit.
More information about the Scummvm-git-logs
mailing list