Phar: Mapping HTTP URLs to a www/ subdirectory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,


I'm failing to create a .phar file for SemanticScuttle[1], a
self-hosted social bookmarking application.

The directory layout of SC is as follows:
- data/
- doc/
- scripts/
- src/
  - SemanticScuttle/
    - Service.php
- www/
  - index.php
  - edit.php

The separation of src/, data/ and www/ is to be sure only relevant
files are exposed to the web visitor, keeping files in data/, scripts/
and src/ only accessible via the file system, but not via the web
server.

I am trying to do the same with the .phar: Have all www/ files
accessible from outside while still having src/ and scripts/ in the
.phar for CLI access.

There seemed to be several possible solutions:

1. Modify $_SERVER['REQUEST_URI']
by adding /www/, so the normal phar web mapping code would take place.
This does not work - the phar C code uses the original SERVER
variables, not the ones from PHP:
> When executed by a web-based sapi, this reads
> $_SERVER['REQUEST_URI'] (the actual original value) 

2. Use webPhar()'s mapping functionality.
This is very hard to achieve, because I have over 200 files that need
to be accessible, and I don't want to add all that mappings.


Is there a better solution to map all web/HTTP requests to the phar to
a subdirectory inside the phar?


-- 
Regards/Mit freundlichen Grüßen
Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux