Hello!

I'm solving one problem and I'd like to ask you for hints/advices or 'RTFM at <link>' answers.

Problem is:

I need special type of URL to be 'rewritten' in the way how the Apache does the URL rewritting.

example:

fopen('chrome://myfile.txt', 'r');

to have be internaly resolved for eaxample as

fopen('/var/www/localhost/chrome/myfile.txt', 'r');

I know that there is the way how to register url wrapper in PHP5. It is the solution. But I do not need to implement whole API.

Is there way to do something like this?

class ChromeWrapper extends PHP_STD_FILE_WRAPPER {
function stream_open($path,$mode,$opts,$opened_path) {
  $path=str_replace('chrome://', '/var/www/localhost/chrome/', $path);
  parent::stream_open($path, $mode, $opts, $opened_path);
}
}

... simply implement easily only the path rewritting instead of implementing all the functions that are already done in built-in api.

Or is there some way how to register 'filter' that filters $path instead of the content?

Thank you for sharing your knowledge

Danny 'elixon' Sevcik

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to