Tuesday 28 June 2011 10:52:40 am
Hello, I've a small script that needs to print the full url to a file (full url means including the http://domain.com). I need, in fact, to perform the same operation (in php) as the template operator ezurl(), so I use eZURI::transformURI. Here are the 2 lines of code:
$url = "/extension/djgfxstock/design/standard/images/foo.png"; eZURI::transformURI($url, false, 'full'); This piece of code perfectly works if I put it in a module/view, but the $url keeps unchanged if I use those 2 lines in a php scriptthat I launch with php cli, or even with runcronjobs... The solution would be (maybe) to force the load of a siteaccess, but even with that, I'm not sure it would work... (indeed runcronjobs loads a siteaccess, and even with that, impossible to use absolute url) The only solution I've found (which is crappy at a very high level) is to fill in, before my 2 lines, $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_PORT'] Any idea is welcome!
|