Source for file fetch.php
Documentation is available at fetch.php
* * file : path or URI of the file to read (however reading from another website is not recommended for performance reasons)
* * assign : if set, the file will be saved in this variable instead of being output
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* @author Jordi Boggiano <j.boggiano@seld.be>
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://dwoo.org/LICENSE Modified BSD License
if ($policy =
$dwoo->getSecurityPolicy()) {
return $dwoo->triggerError('The security policy prevents you to read files from external sources.', E_USER_WARNING);
$dirs =
$policy->getAllowedDirectories();
foreach ($dirs as $dir=>
$dummy) {
if (strpos($file, $dir) ===
0) {
return $dwoo->triggerError('The security policy prevents you to read <em>'.
$file.
'</em>', E_USER_WARNING);
$file =
str_replace(array("\t", "\n", "\r"), array('\\t', '\\n', '\\r'), $file);
$dwoo->assignInScope($out, $assign);
Documentation generated on Sat, 18 Jul 2009 21:05:01 +0200 by phpDocumentor 1.4.0