src/S3/StreamWrapper.php
private function formatUrlStat($result = null)
    {
        $stat = $this->getStatTemplate();
        switch (gettype($result)) {
            case 'NULL':
            case 'string':
                // Directory with 0777 access - see "man 2 stat".
                $stat['mode'] = $stat[2] = 0040777;
                break;
            case 'array':
                // Regular file with 0777 access - see "man 2 stat".
                $stat['mode'] = $stat[2] = 0100777;
                // Pluck the content-length if available.
                if (isset($result['ContentLength'])) {
                    $stat['size'] = $stat[7] = $result['ContentLength'];
                } elseif (isset($result['Size'])) {
                    $stat['size'] = $stat[7] = $result['Size'];
                }
                if (isset($result['LastModified'])) {
                    // ListObjects or HeadObject result
                    $stat['mtime'] = $stat[9] = $stat['ctime'] = $stat[10]
                        = strtotime($result['LastModified']);
                }
        }

        return $stat;
    }
private function formatUrlStat($result = null)
    {
        $stat = $this->getStatTemplate();
        switch (gettype($result)) {
            case 'NULL':
            case 'string':
                // Directory with 0777 access - see "man 2 stat".
                $stat['mode'] = $stat[2] = 0040777;
                break;
            case 'array':
                // Regular file with 0777 access - see "man 2 stat".
                $stat['mode'] = $stat[2] = 0100777;
                // Pluck the content-length if available.
                if (isset($result['ContentLength'])) {
                    $stat['size'] = $stat[7] = $result['ContentLength'];
                } elseif (isset($result['Size'])) {
                    $stat['size'] = $stat[7] = $result['Size'];
                }
                if (isset($result['LastModified'])) {
                    // ListObjects or HeadObject result
                    $stat['mtime'] = $stat[9] = $stat['ctime'] = $stat[10]
                        = strtotime($result['LastModified']);
                }
        }

        return $stat;
    }
private function formatUrlStat ( $ result = null ) { $ stat = $ this -> getStatTemplate ( ) ; switch ( gettype ( $ result ) ) { case 'NULL' : case 'string' : // Directory with 0777 access - see "man 2 stat". $ stat [ 'mode' ] = $ stat [ 2 ] = 0040777 ; break ; case 'array' : // Regular file with 0777 access - see "man 2 stat". $ stat [ 'mode' ] = $ stat [ 2 ] = 0100777 ; // Pluck the content-length if available. if ( isset ( $ result [ 'ContentLength' ] ) ) { $ stat [ 'size' ] = $ stat [ 7 ] = $ result [ 'ContentLength' ] ; } elseif ( isset ( $ result [ 'Size' ] ) ) { $ stat [ 'size' ] = $ stat [ 7 ] = $ result [ 'Size' ] ; } if ( isset ( $ result [ 'LastModified' ] ) ) { // ListObjects or HeadObject result $ stat [ 'mtime' ] = $ stat [ 9 ] = $ stat [ 'ctime' ] = $ stat [ 10 ] = strtotime ( $ result [ 'LastModified' ] ) ; } } return $ stat ; }
Prepare a url_stat result array

@param string|array $result Data to add

@return array Returns the modified url_stat result
Prepare a url_stat result array