diff options
author | emkael <emkael@tlen.pl> | 2015-01-28 11:40:25 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2015-01-28 11:40:25 +0100 |
commit | b11bd21d0f1932eb1d4e7459d78c4a994d7c22b9 (patch) | |
tree | 01024121e15ea1e5f1bc64a27eaa7cf68ed153d7 /README | |
parent | 6fc649ae7a5501dd45e78fd44c1805d0d8e003cd (diff) |
* README
Diffstat (limited to 'README')
-rw-r--r-- | README | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,51 @@ +1. Installation + +1.1 Pre-requirements + + * HTTP server with mod_rewrite support + * PHP >= 5.4 + * HTTP stream context and remote file_get_contents (`allow_url_fopen=1`) + execution enabled + * PECL HTTP v2 (`pecl install pecl_http`) + * QueryPath library (developed and tested with v2.1.2) + +1.2 Installation + + * http/ folder is the publicly visible document root for the project + * cache/ folder is where cached (HTML) data is held, it's outside the document + root by default (if you can't put it elsewhere, you can change the path) + +1.3 Configuration + +Main application file, http/index.php defines some configuration parameters: + * BASE_PATH: absolute path for the application within host/domain + (change if you're planning on running the app from a subfolder) + * CACHE_PATH: path to the cache data folder (must be writable by web-server), + relative to http/index.php + * CEZAR_URL: remote URL for fetched site (main page) + * QUERYPATH_PATH: path to the QueryPath.php file from QueryPath library + +2. Usage + +The following assumes BASE_PATH is set to default "/" (app runs on separate +host/domain). + +Every request in form of /[ANYTHING] is forwarded to the search form +of the remote site (?pid_search=[ANYTHING]&p=21). +Fetched data is cached for 24 hours (cache key is [ANYTHING]). Cache can be +force-refreshed by requesting /[ANYTHING]/refresh URL. + +Every request to /pic/[RESOURCE_FILE] for files which are not present locally +is being forwarded to the remote server. The file is fetched and from then on +served from local server (so once we become mature enough not to steal content, +we can remake these files). + +Fetched data is then diced and sliced to provide a compact, business card-like +view of the profile. All images outside of /pic/[RESOURCE_FILE] sources are +being fetched from remote server and served locally from the /foto directory. + +For added evilness, all requests to remote servers spoof User Agent String to +the original UAS from end-user browser request. + +Good thing the remote site has metric shitton of inline CSS, so that very little +style alteration was necessary. |