- An Apache server. Minimum efforts would be made to port the .htaccess and provide compatibilty with other webservers.
- PHP 5.3+ with curl and mysql support
- MySQL
lessc(installed from packages ornpm)
Clone or download it from GitHub.
Move to the directory you just created with the sources cd AndroidReviews
- Go to the offical website to download the latest version.
- Extract the
tinymvcfolder only (you don't need the rest).
- If you plan to use TinyMVC for another project, put it in a global location.
- If you don't, you can just put it in the same directory (
AndroidReviews)
cp templates/index.php.template htdocs/index.php
$EDITOR htdocs/index.php- Replace
PATH_TO_TinyMVC_GLOBAL_FILESwith the path of thetinymvcfolder you previously installed (depends if you decided to use a global location or keep it with the rest of this website) - Replace
PATH_TO_THIS_REPO_ROOTwith the path of the website (probablyAndroidReviews)
# CREATE DATABASE androidreviews
mysql androidreviews < db.sqlcp templates/config_database.php.template myapp/configs/config_database.php
$EDITOR myapp/configs/config_database.phpwget https://raw.github.com/db0company/generic-api/master/consumer/php/consumer.php -O myapp/plugins/consumer.phplessc --yui-compress htdocs/less/androidreviews.less > htdocs/css/androidreviews.min.cssEdit the header to comment or remove the 2 lines about less files and uncomment the css line.
Your domain should point on the htdocs folder.
You should have allowed url rewriting.
You may install it on the same server, but the goal of this API is to serve several countries by having APIs installed in several different countries that communicate with the Android Market.
- A web server (ex: Apache)
- PHP 5.3+ with curl support
- The submodule
generic-api, should be cloned automatically with the website
Stay in the main folder `AndroidReviews'.
mkdir -p api/icons/cp templates/conf.php.template api/conf.php
$EDITOR api/conf.phpwget https://github.com/splitfeed/android-market-api-php/archive/master.zip
unzip master.zip
mv android-market-api-php-master/ api/android-market-api-php
rm master.zipYour domain should point on the api folder.
It should start with country.api.yourdomain where country is the country code where your server is hosted (us or fr or instance).
You should also point a sub domain files.country.api.yourdomain to the api/icons folder.
If you use apache, put this .htaccess file in /api
Options +FollowSymlinks
Options +Indexes
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-/]+)$ api.php?resource=$1&id=$2 [QSA]
RewriteRule ^([a-zA-Z0-9_\-]+)/*$ api.php?resource=$1 [QSA]
If you use nginx add this redirection rule:
rewrite ^/([a-zA-Z0-9_-]+)/*$ /api.php?resource=$1;
You may install as much countries you'd like by installing the API (only, not the website) on different servers in different countries.
Those countries should be added in the website configuration file. A picture of the flag of the coutry should also be added in the website's folder htdocs/img/countries.