php Sabre-HTTP-Util类(方法)实例源码

下面列出了php Sabre-HTTP-Util 类(方法)源码代码实例,从而了解它的用法。

作者:youprofi    项目:casebo   
/**
  * Fetches properties for a path.
  *
  * This method received a PropFind object, which contains all the
  * information about the properties that need to be fetched.
  *
  * Ususually you would just want to call 'get404Properties' on this object,
  * as this will give you the _exact_ list of properties that need to be
  * fetched, and haven't yet.
  *
  * @param string $path
  * @param PropFind $propFind
  * @return void
  */
 public function propFind($path, PropFind $propFind)
 {
     $propertyNames = $propFind->get404Properties();
     if (!$propertyNames) {
         return;
     }
     // error_log("propFind: path($path), " . print_r($propertyNames, true));
     $cachedNodes = \CB\Cache::get('DAVNodes');
     // error_log("propFind: " . print_r($cachedNodes, true));
     $path = trim($path, '/');
     $path = str_replace('\\', '/', $path);
     // Node with $path is not in cached nodes, return
     if (!array_key_exists($path, $cachedNodes)) {
         return;
     }
     $node = $cachedNodes[$path];
     // while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
     //     $propFind->set($row['name'], $row['value']);
     // }
     foreach ($propertyNames as $prop) {
         if ($prop == '{DAV:}creationdate') {
             $dttm = new \DateTime($node['cdate']);
             // $dttm->getTimestamp()
             $propFind->set($prop, \Sabre\HTTP\Util::toHTTPDate($dttm));
         } elseif ($prop == '{urn:schemas-microsoft-com:office:office}modifiedby' or $prop == '{DAV:}getmodifiedby') {
             // This has to be revised, because the User.login differs from User.DisplayName
             // moreover, during an edit, Word will check for File Properties and we
             // tell Word that the file is modified by another user
             // $propFind->set($prop, \CB\User::getDisplayName($node['uid']));
         }
     }
 }

作者:MetallianFR6    项目:myroundcub   
function testSerialize()
    {
        $dt = new \DateTime('2010-03-14 16:35', new \DateTimeZone('UTC'));
        $lastMod = new GetLastModified($dt);
        $doc = new \DOMDocument();
        $root = $doc->createElement('d:getlastmodified');
        $root->setAttribute('xmlns:d', 'DAV:');
        $doc->appendChild($root);
        $server = new DAV\Server();
        $lastMod->serialize($server, $root);
        $xml = $doc->saveXML();
        /*
        $this->assertEquals(
        '<?xml version="1.0"?>
        <d:getlastmodified xmlns:d="DAV:" xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" b:dt="dateTime.rfc1123">' .
        HTTP\Util::toHTTPDate($dt) .
        '</d:getlastmodified>
        ', $xml);
        */
        $this->assertEquals('<?xml version="1.0"?>
<d:getlastmodified xmlns:d="DAV:">' . HTTP\Util::toHTTPDate($dt) . '</d:getlastmodified>
', $xml);
        $ok = false;
        try {
            GetLastModified::unserialize(DAV\XMLUtil::loadDOMDocument($xml)->firstChild, array());
        } catch (DAV\Exception $e) {
            $ok = true;
        }
        if (!$ok) {
            $this->markTestFailed('Unserialize should not be supported');
        }
    }

作者:samj191    项目:rep   
/**
  * serialize
  *
  * @param DAV\Server $server
  * @param \DOMElement $prop
  * @return void
  */
 public function serialize(DAV\Server $server, \DOMElement $prop)
 {
     $doc = $prop->ownerDocument;
     //$prop->setAttribute('xmlns:b','urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/');
     //$prop->setAttribute('b:dt','dateTime.rfc1123');
     $prop->nodeValue = HTTP\Util::toHTTPDate($this->time);
 }

作者:MetallianFR6    项目:myroundcub   
function testHEAD()
 {
     $request = new HTTP\Request('HEAD', '/test.txt');
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(['X-Sabre-Version' => [DAV\Version::VERSION], 'Content-Type' => ['application/octet-stream'], 'Content-Length' => [13], 'Last-Modified' => [HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt')))], 'ETag' => ['"' . md5_file($this->tempDir . '/test.txt') . '"']], $this->response->getHeaders());
     $this->assertEquals(200, $this->response->status);
     $this->assertEquals('', $this->response->body);
 }

作者:BlaBlaNe    项目:hubzill   
function setUp()
 {
     parent::setUp();
     $this->server->createFile('files/test.txt', 'Test contents');
     $this->lastModified = HTTP\Util::toHTTPDate(new DateTime('@' . $this->server->tree->getNodeForPath('files/test.txt')->getLastModified()));
     $stream = popen('echo "Test contents"', 'r');
     $streamingFile = new Mock\StreamingFile('no-seeking.txt', $stream);
     $streamingFile->setSize(12);
     $this->server->tree->getNodeForPath('files')->addNode($streamingFile);
 }

作者:samj191    项目:rep   
function testHEAD()
 {
     $serverVars = array('REQUEST_URI' => '/test.txt', 'REQUEST_METHOD' => 'HEAD');
     $request = new HTTP\Request($serverVars);
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(array('Content-Type' => 'application/octet-stream', 'Content-Length' => 13, 'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))), 'ETag' => '"' . md5_file($this->tempDir . '/test.txt') . '"'), $this->response->headers);
     $this->assertEquals('HTTP/1.1 200 OK', $this->response->status);
     $this->assertEquals('', $this->response->body);
 }

作者:BlaBlaNe    项目:hubzill   
function testBaseUri()
 {
     $serverVars = ['REQUEST_URI' => '/blabla/test.txt', 'REQUEST_METHOD' => 'GET'];
     $filename = $this->tempDir . '/test.txt';
     $request = HTTP\Sapi::createFromServerArray($serverVars);
     $this->server->setBaseUri('/blabla/');
     $this->assertEquals('/blabla/', $this->server->getBaseUri());
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(['X-Sabre-Version' => [Version::VERSION], 'Content-Type' => ['application/octet-stream'], 'Content-Length' => [13], 'Last-Modified' => [HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($filename)))], 'ETag' => ['"' . sha1(fileinode($filename) . filesize($filename) . filemtime($filename)) . '"']], $this->response->getHeaders());
     $this->assertEquals(200, $this->response->status);
     $this->assertEquals('Test contents', stream_get_contents($this->response->body));
 }

作者:nikos    项目:openeclas   
//.........这里部分代码省略.........

                    foreach ($ifNoneMatch as $ifNoneMatchItem) {

                        // Stripping any extra spaces
                        $ifNoneMatchItem = trim($ifNoneMatchItem, ' ');

                        if ($etag === $ifNoneMatchItem) $haveMatch = true;

                    }

                }

                if ($haveMatch) {
                    if ($etag) $response->setHeader('ETag', $etag);
                    if ($request->getMethod() === 'GET') {
                        $response->setStatus(304);
                        return false;
                    } else {
                        throw new Exception\PreconditionFailed('An If-None-Match header was specified, but the ETag matched (or * was specified).', 'If-None-Match');
                    }
                }
            }

        }

        if (!$ifNoneMatch && ($ifModifiedSince = $request->getHeader('If-Modified-Since'))) {

            // The If-Modified-Since header contains a date. We
            // will only return the entity if it has been changed since
            // that date. If it hasn't been changed, we return a 304
            // header
            // Note that this header only has to be checked if there was no If-None-Match header
            // as per the HTTP spec.
            $date = HTTP\Util::parseHTTPDate($ifModifiedSince);

            if ($date) {
                if (is_null($node)) {
                    $node = $this->tree->getNodeForPath($path);
                }
                $lastMod = $node->getLastModified();
                if ($lastMod) {
                    $lastMod = new \DateTime('@' . $lastMod);
                    if ($lastMod <= $date) {
                        $response->setStatus(304);
                        $response->setHeader('Last-Modified', HTTP\Util::toHTTPDate($lastMod));
                        return false;
                    }
                }
            }
        }

        if ($ifUnmodifiedSince = $request->getHeader('If-Unmodified-Since')) {

            // The If-Unmodified-Since will allow allow the request if the
            // entity has not changed since the specified date.
            $date = HTTP\Util::parseHTTPDate($ifUnmodifiedSince);

            // We must only check the date if it's valid
            if ($date) {
                if (is_null($node)) {
                    $node = $this->tree->getNodeForPath($path);
                }
                $lastMod = $node->getLastModified();
                if ($lastMod) {
                    $lastMod = new \DateTime('@' . $lastMod);
                    if ($lastMod > $date) {

作者:MetallianFR6    项目:myroundcub   
/**
  * @depends testRange
  */
 function testIfRangeModificationDateModified()
 {
     $node = $this->server->tree->getNodeForPath('test.txt');
     $serverVars = array('REQUEST_URI' => '/test.txt', 'REQUEST_METHOD' => 'GET', 'HTTP_RANGE' => 'bytes=2-5', 'HTTP_IF_RANGE' => '-2 years');
     $request = HTTP\Sapi::createFromServerArray($serverVars);
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(array('X-Sabre-Version' => [Version::VERSION], 'Content-Type' => ['application/octet-stream'], 'Content-Length' => [13], 'Last-Modified' => [HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt')))], 'ETag' => ['"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')) . '"']), $this->response->getHeaders());
     $this->assertEquals(200, $this->response->status);
     $this->assertEquals('Test contents', stream_get_contents($this->response->body));
 }

作者:sebbie4    项目:casebo   
/**
  * This event is triggered after GET requests.
  *
  * This is used to transform data into jCal, if this was requested.
  *
  * @param RequestInterface $request
  * @param ResponseInterface $response
  * @return void
  */
 function httpAfterGet(RequestInterface $request, ResponseInterface $response)
 {
     if (strpos($response->getHeader('Content-Type'), 'text/calendar') === false) {
         return;
     }
     $result = HTTP\Util::negotiate($request->getHeader('Accept'), ['text/calendar', 'application/calendar+json']);
     if ($result !== 'application/calendar+json') {
         // Do nothing
         return;
     }
     // Transforming.
     $vobj = VObject\Reader::read($response->getBody());
     $jsonBody = json_encode($vobj->jsonSerialize());
     $response->setBody($jsonBody);
     $response->setHeader('Content-Type', 'application/calendar+json');
     $response->setHeader('Content-Length', strlen($jsonBody));
 }

作者:pagee    项目:sabre-da   
/**
  * Intercepts GET requests on calendar urls ending with ?export.
  *
  * @param RequestInterface $request
  * @param ResponseInterface $response
  * @return bool
  */
 function httpGet(RequestInterface $request, ResponseInterface $response)
 {
     $queryParams = $request->getQueryParameters();
     if (!array_key_exists('export', $queryParams)) {
         return;
     }
     $path = $request->getPath();
     $node = $this->server->getProperties($path, ['{DAV:}resourcetype', '{DAV:}displayname', '{http://sabredav.org/ns}sync-token', '{DAV:}sync-token', '{http://apple.com/ns/ical/}calendar-color']);
     if (!isset($node['{DAV:}resourcetype']) || !$node['{DAV:}resourcetype']->is('{' . Plugin::NS_CALDAV . '}calendar')) {
         return;
     }
     // Marking the transactionType, for logging purposes.
     $this->server->transactionType = 'get-calendar-export';
     $properties = $node;
     $start = null;
     $end = null;
     $expand = false;
     $componentType = false;
     if (isset($queryParams['start'])) {
         if (!ctype_digit($queryParams['start'])) {
             throw new BadRequest('The start= parameter must contain a unix timestamp');
         }
         $start = DateTime::createFromFormat('U', $queryParams['start']);
     }
     if (isset($queryParams['end'])) {
         if (!ctype_digit($queryParams['end'])) {
             throw new BadRequest('The end= parameter must contain a unix timestamp');
         }
         $end = DateTime::createFromFormat('U', $queryParams['end']);
     }
     if (isset($queryParams['expand']) && !!$queryParams['expand']) {
         if (!$start || !$end) {
             throw new BadRequest('If you\'d like to expand recurrences, you must specify both a start= and end= parameter.');
         }
         $expand = true;
         $componentType = 'VEVENT';
     }
     if (isset($queryParams['componentType'])) {
         if (!in_array($queryParams['componentType'], ['VEVENT', 'VTODO', 'VJOURNAL'])) {
             throw new BadRequest('You are not allowed to search for components of type: ' . $queryParams['componentType'] . ' here');
         }
         $componentType = $queryParams['componentType'];
     }
     $format = \Sabre\HTTP\Util::Negotiate($request->getHeader('Accept'), ['text/calendar', 'application/calendar+json']);
     if (isset($queryParams['accept'])) {
         if ($queryParams['accept'] === 'application/calendar+json' || $queryParams['accept'] === 'jcal') {
             $format = 'application/calendar+json';
         }
     }
     if (!$format) {
         $format = 'text/calendar';
     }
     $this->generateResponse($path, $start, $end, $expand, $componentType, $format, $properties, $response);
     // Returning false to break the event chain
     return false;
 }

作者:sebbie4    项目:casebo   
/**
  * Makes sure the supplied value is a valid RFC2616 date.
  *
  * If we would just use strtotime to get a valid timestamp, we have no way of checking if a
  * user just supplied the word 'now' for the date header.
  *
  * This function also makes sure the Date header is within 15 minutes of the operating
  * system date, to prevent replay attacks.
  *
  * @param string $dateHeader
  * @return bool
  */
 protected function validateRFC2616Date($dateHeader)
 {
     $date = Util::parseHTTPDate($dateHeader);
     // Unknown format
     if (!$date) {
         $this->errorCode = self::ERR_INVALIDDATEFORMAT;
         return false;
     }
     $min = new \DateTime('-15 minutes');
     $max = new \DateTime('+15 minutes');
     // We allow 15 minutes around the current date/time
     if ($date > $max || $date < $min) {
         $this->errorCode = self::ERR_REQUESTTIMESKEWED;
         return false;
     }
     return $date;
 }

作者:matte    项目:sabre-da   
function testBaseUri()
 {
     $serverVars = array('REQUEST_URI' => '/blabla/test.txt', 'REQUEST_METHOD' => 'GET');
     $request = HTTP\Sapi::createFromServerArray($serverVars);
     $this->server->setBaseUri('/blabla/');
     $this->assertEquals('/blabla/', $this->server->getBaseUri());
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(array('X-Sabre-Version' => Version::VERSION, 'Content-Type' => 'application/octet-stream', 'Content-Length' => 13, 'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt')))), $this->response->getHeaders());
     $this->assertEquals(200, $this->response->status);
     $this->assertEquals('Test contents', stream_get_contents($this->response->body));
 }

作者:TamirA    项目:hubzill   
/**
  * @depends testRange
  * @covers \Sabre\DAV\Server::httpGet
  */
 function testIfRangeModificationDateModified()
 {
     $node = $this->server->tree->getNodeForPath('test.txt');
     $serverVars = array('REQUEST_URI' => '/test.txt', 'REQUEST_METHOD' => 'GET', 'HTTP_RANGE' => 'bytes=2-5', 'HTTP_IF_RANGE' => '-2 years');
     $request = new HTTP\Request($serverVars);
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(array('Content-Type' => 'application/octet-stream', 'Content-Length' => 13, 'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))), 'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')) . '"'), $this->response->headers);
     $this->assertEquals('HTTP/1.1 200 OK', $this->response->status);
     $this->assertEquals('Test contents', stream_get_contents($this->response->body));
 }

作者:nikos    项目:openeclas   
/**
     * This helper function performs the content-type negotiation for vcards.
     *
     * It will return one of the following strings:
     * 1. vcard3
     * 2. vcard4
     * 3. jcard
     *
     * It defaults to vcard3.
     *
     * @param string $input
     * @param string $mimeType
     * @return string
     */
    protected function negotiateVCard($input, &$mimeType = null) {

        $result = HTTP\Util::negotiate(
            $input,
            [
                // Most often used mime-type. Version 3
                'text/x-vcard',
                // The correct standard mime-type. Defaults to version 3 as
                // well.
                'text/vcard',
                // vCard 4
                'text/vcard; version=4.0',
                // vCard 3
                'text/vcard; version=3.0',
                // jCard
                'application/vcard+json',
            ]
        );

        $mimeType = $result;
        switch ($result) {

            default :
            case 'text/x-vcard' :
            case 'text/vcard' :
            case 'text/vcard; version=3.0' :
                $mimeType = 'text/vcard';
                return 'vcard3';
            case 'text/vcard; version=4.0' :
                return 'vcard4';
            case 'application/vcard+json' :
                return 'jcard';

        // @codeCoverageIgnoreStart
        }
        // @codeCoverageIgnoreEnd

    }

作者:sebbie4    项目:casebo   
/**
  * The serialize method is called during xml writing.
  *
  * It should use the $writer argument to encode this object into XML.
  *
  * Important note: it is not needed to create the parent element. The
  * parent element is already created, and we only have to worry about
  * attributes, child elements and text (if any).
  *
  * Important note 2: If you are writing any new elements, you are also
  * responsible for closing them.
  *
  * @param Writer $writer
  * @return void
  */
 function xmlSerialize(Writer $writer)
 {
     $writer->write(HTTP\Util::toHTTPDate($this->time));
 }

作者:samj191    项目:rep   
/**
  * This helper function performs the content-type negotiation for vcards.
  *
  * It will return one of the following strings:
  * 1. vcard3
  * 2. vcard4
  * 3. jcard
  *
  * It defaults to vcard3.
  *
  * @param string $input
  * @param string $mimeType
  * @return string
  */
 protected function negotiateVCard($input, &$mimeType = null)
 {
     $result = HTTP\Util::negotiate($input, ['text/x-vcard', 'text/vcard', 'text/vcard; version=4.0', 'text/vcard; version=3.0', 'application/vcard+json']);
     $mimeType = $result;
     switch ($result) {
         default:
         case 'text/x-vcard':
         case 'text/vcard':
         case 'text/vcard; version=3.0':
             $mimeType = 'text/vcard';
             return 'vcard3';
         case 'text/vcard; version=4.0':
             return 'vcard4';
         case 'application/vcard+json':
             return 'jcard';
             // @codeCoverageIgnoreStart
     }
     // @codeCoverageIgnoreEnd
 }

作者:floffel0    项目:pydio-cor   
//.........这里部分代码省略.........
                 // Stripping any extra spaces
                 $ifMatchItem = trim($ifMatchItem, ' ');
                 $etag = $node->getETag();
                 if ($etag === $ifMatchItem) {
                     $haveMatch = true;
                 } else {
                     // Evolution has a bug where it sometimes prepends the "
                     // with a \. This is our workaround.
                     if (str_replace('\\"', '"', $ifMatchItem) === $etag) {
                         $haveMatch = true;
                     }
                 }
             }
             if (!$haveMatch) {
                 throw new Exception\PreconditionFailed('An If-Match header was specified, but none of the specified the ETags matched.', 'If-Match');
             }
         }
     }
     if ($ifNoneMatch = $this->httpRequest->getHeader('If-None-Match')) {
         // The If-None-Match header contains an etag.
         // Only if the ETag does not match the current ETag, the request will succeed
         // The header can also contain *, in which case the request
         // will only succeed if the entity does not exist at all.
         $nodeExists = true;
         if (!$node) {
             try {
                 $node = $this->tree->getNodeForPath($uri);
             } catch (Exception\NotFound $e) {
                 $nodeExists = false;
             }
         }
         if ($nodeExists) {
             $haveMatch = false;
             if ($ifNoneMatch === '*') {
                 $haveMatch = true;
             } else {
                 // There might be multiple etags
                 $ifNoneMatch = explode(',', $ifNoneMatch);
                 $etag = $node->getETag();
                 foreach ($ifNoneMatch as $ifNoneMatchItem) {
                     // Stripping any extra spaces
                     $ifNoneMatchItem = trim($ifNoneMatchItem, ' ');
                     if ($etag === $ifNoneMatchItem) {
                         $haveMatch = true;
                     }
                 }
             }
             if ($haveMatch) {
                 if ($handleAsGET) {
                     $this->httpResponse->sendStatus(304);
                     return false;
                 } else {
                     throw new Exception\PreconditionFailed('An If-None-Match header was specified, but the ETag matched (or * was specified).', 'If-None-Match');
                 }
             }
         }
     }
     if (!$ifNoneMatch && ($ifModifiedSince = $this->httpRequest->getHeader('If-Modified-Since'))) {
         // The If-Modified-Since header contains a date. We
         // will only return the entity if it has been changed since
         // that date. If it hasn't been changed, we return a 304
         // header
         // Note that this header only has to be checked if there was no If-None-Match header
         // as per the HTTP spec.
         $date = HTTP\Util::parseHTTPDate($ifModifiedSince);
         if ($date) {
             if (is_null($node)) {
                 $node = $this->tree->getNodeForPath($uri);
             }
             $lastMod = $node->getLastModified();
             if ($lastMod) {
                 $lastMod = new \DateTime('@' . $lastMod);
                 if ($lastMod <= $date) {
                     $this->httpResponse->sendStatus(304);
                     $this->httpResponse->setHeader('Last-Modified', HTTP\Util::toHTTPDate($lastMod));
                     return false;
                 }
             }
         }
     }
     if ($ifUnmodifiedSince = $this->httpRequest->getHeader('If-Unmodified-Since')) {
         // The If-Unmodified-Since will allow allow the request if the
         // entity has not changed since the specified date.
         $date = HTTP\Util::parseHTTPDate($ifUnmodifiedSince);
         // We must only check the date if it's valid
         if ($date) {
             if (is_null($node)) {
                 $node = $this->tree->getNodeForPath($uri);
             }
             $lastMod = $node->getLastModified();
             if ($lastMod) {
                 $lastMod = new \DateTime('@' . $lastMod);
                 if ($lastMod > $date) {
                     throw new Exception\PreconditionFailed('An If-Unmodified-Since header was specified, but the entity has been changed since the specified date.', 'If-Unmodified-Since');
                 }
             }
         }
     }
     return true;
 }

作者:MetallianFR6    项目:myroundcub   
function testBaseUri()
 {
     $serverVars = array('REQUEST_URI' => '/blabla/test.txt', 'REQUEST_METHOD' => 'GET');
     $request = new HTTP\Request($serverVars);
     $this->server->setBaseUri('/blabla/');
     $this->assertEquals('/blabla/', $this->server->getBaseUri());
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(array('Content-Type' => 'application/octet-stream', 'Content-Length' => 13, 'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt')))), $this->response->headers);
     $this->assertEquals('HTTP/1.1 200 OK', $this->response->status);
     $this->assertEquals('Test contents', stream_get_contents($this->response->body));
 }

作者:Befo    项目:cda   
/**
  * @depends testRange
  */
 function testIfRangeModificationDateModified()
 {
     $node = $this->server->tree->getNodeForPath('test.txt');
     $request = new HTTP\Request('GET', '/test.txt', ['Range' => 'bytes=2-5', 'If-Range' => '-2 years']);
     $filename = SABRE_TEMPDIR . '/test.txt';
     $this->server->httpRequest = $request;
     $this->server->exec();
     $this->assertEquals(['X-Sabre-Version' => [Version::VERSION], 'Content-Type' => ['application/octet-stream'], 'Content-Length' => [13], 'Last-Modified' => [HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt')))], 'ETag' => ['"' . sha1(fileinode($filename) . filesize($filename) . filemtime($filename)) . '"']], $this->response->getHeaders());
     $this->assertEquals(200, $this->response->status);
     $this->assertEquals('Test contents', stream_get_contents($this->response->body));
 }


问题


面经


文章

微信
公众号

扫码关注公众号