Example #1
0
    case 'show':
    case 'articles':
        $downloader->setPath($_CONF['path_images'] . 'articles/');
        break;
    case 'topics':
        $downloader->setPath($_CONF['path_images'] . 'topics/');
        break;
    case 'userphotos':
        $downloader->setPath($_CONF['path_images'] . 'userphotos/');
        break;
    default:
        // Hrm, got a bad path, just die
        exit;
}
// Let's see if we don't have a legit file.  If not bail
$pathToImage = $downloader->getPath() . $image;
if (is_file($pathToImage)) {
    // support conditional GET, if possible
    $st = @stat($pathToImage);
    if (is_array($st)) {
        // cf. RFC 2616, Section 3.3.1 Full Date
        $last_mod = str_replace('+0000', 'GMT', gmdate('r', $st['mtime']));
        $etag = '"' . md5($image) . '"';
        $mod_since = '';
        $none_match = '';
        if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
            $mod_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
        }
        if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
            $none_match = $_SERVER['HTTP_IF_NONE_MATCH'];
        }
 public function testGetPathDefault()
 {
     $this->assertEquals('', $this->dl->getPath());
 }