PHP_Archive
[ class tree: PHP_Archive ] [ index: PHP_Archive ] [ all elements ]

Class: PHP_Archive

Source Location: /PHP_Archive-0.10.0/Archive.php

Class Overview


PHP_Archive Class (implements .phar)


Author(s):

Version:

  • $Id: Archive.php,v 1.38 2007/02/06 04:31:45 cellog Exp $

Copyright:

  • Copyright David Shafik and Synaptic Media 2004. All rights reserved.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]
PHP_Archive Class (implements .phar)

PHAR files a singular archive from which an entire application can run. To use it, simply package it using {@see PHP_Archive_Creator} and use phar:// URIs to your includes. i.e. require_once 'phar://config.php' will include config.php from the root of the PHAR file.

Gz code borrowed from the excellent File_Archive package by Vincent Lascaux.



[ Top ]


Class Variables

$currentFilename =  null

[line 48]

Current file name in the phar
  • Access: protected

Type:   string


[ Top ]

$currentStat =  null

[line 58]

Current file statistics (size, creation date, etc.)
  • Access: protected

Type:   string


[ Top ]

$fp =  null

[line 62]

  • Var: Pointer to open .phar
  • Access: protected

Type:   resource|null


[ Top ]

$internalFileLength =  null

[line 53]

Length of current file in the phar
  • Access: protected

Type:   string


[ Top ]

$position =  0

[line 66]

  • Var: Current Position of the pointer
  • Access: protected

Type:   int


[ Top ]



Method Detail

APIVersion   [line 776]

string APIVersion( )

API version of this class
  • Access: public

[ Top ]

dir_closedir   [line 755]

void dir_closedir( )

Close a directory handle opened with opendir() - PHP streams API
  • Access: public

[ Top ]

dir_opendir   [line 683]

void dir_opendir( string $path)

Open a directory in the .phar for reading - PHP streams API
  • Access: public

Parameters:

string   $path   —  directory name

[ Top ]

dir_readdir   [line 741]

void dir_readdir( )

Read the next directory entry - PHP streams API
  • Access: public

[ Top ]

dir_rewinddir   [line 766]

void dir_rewinddir( )

Rewind to the first directory entry - PHP streams API
  • Access: public

[ Top ]

extractFile   [line 382]

array|string extractFile( string $path)

Seek to a file within the master archive, and extract its contents
  • Return: an array containing an error message string is returned upon error, otherwise the file contents are returned
  • Access: public

Parameters:

string   $path   — 

[ Top ]

getFileMetadata   [line 809]

null|mixed getFileMetadata( string $phar, string $file)

Retrieve File-specific metadata for a Phar archive file
  • Return: The value that was serialized for the Phar archive's metadata
  • Throws: Exception
  • Access: public

Parameters:

string   $phar   —  full path to Phar archive, or alias
string   $file   —  relative path to file within Phar archive

[ Top ]

getPharMetadata   [line 789]

null|mixed getPharMetadata( string $phar)

Retrieve Phar-specific metadata for a Phar archive
  • Return: The value that was serialized for the Phar archive's metadata
  • Throws: Exception
  • Access: public

Parameters:

string   $phar   —  full path to Phar archive, or alias

[ Top ]

initializeStream   [line 472]

string initializeStream( string $file)

Locate the .phar archive in the include_path and detect the file to open within the archive.

Possible parameters are phar://pharname.phar/filename_within_phar.ext

  • Return: the filename within the .phar to retrieve
  • Access: public

Parameters:

string   $file   —  a file within the archive

[ Top ]

loadPhar   [line 126]

void loadPhar( string $file)

Allows loading an external Phar archive without include()ing it
  • Throws: Exception
  • Access: public

Parameters:

string   $file   — 

[ Top ]

mapPhar   [line 157]

void mapPhar( string $file, int $dataoffset, string $alias, bool $compressed)

Map a full real file path to an alias used to refer to the .phar

This function can only be called from the initialization of the .phar itself. Any attempt to call from outside the .phar or to re-alias the .phar will fail as a security measure.

  • Access: public

Parameters:

string   $file   —  full realpath() filepath, like /path/to/go-pear.phar
string   $alias   —  alias used in opening a file within the phar like phar://go-pear.phar/file
bool   $compressed   —  determines whether to attempt zlib uncompression on accessing internal files
int   $dataoffset   —  the value of __COMPILER_HALT_OFFSET__

[ Top ]

parseUrl   [line 429]

false|array parseUrl( string $file)

Parse urls like phar:///fullpath/to/my.phar/file.txt
  • Access: protected

Parameters:

string   $file   — 

[ Top ]

selectFile   [line 338]

void selectFile( string $path, [ $allowdirs = true])

Seek in the master archive to a matching file or directory
  • Access: protected

Parameters:

string   $path   — 
   $allowdirs   — 

[ Top ]

stream_open   [line 519]

void stream_open( string $file)

Open the requested file - PHP streams API
  • Access: public

Parameters:

string   $file   —  String provided by the Stream wrapper

[ Top ]

stream_read   [line 565]

void stream_read( int $count)

Read the data - PHP streams API
  • Access: public

Parameters:

int   $count   — 

[ Top ]

stream_seek   [line 587]

void stream_seek( int $pos, SEEK_SET|SEEK_CUR|SEEK_END $whence)

For seeking the stream - PHP streams API
  • Access: public

Parameters:

int   $pos   — 
SEEK_SET|SEEK_CUR|SEEK_END   $whence   — 

[ Top ]

stream_stat   [line 628]

void stream_stat( )

The result of an fstat call, returns mod time from creation, and file size -

PHP streams API


[ Top ]

stream_tell   [line 617]

void stream_tell( )

The current position in the stream - PHP streams API
  • Access: public

[ Top ]

url_stat   [line 672]

void url_stat( string $url, int $flags)

Stat a closed file or directory - PHP streams API
  • Access: public

Parameters:

string   $url   — 
int   $flags   — 

[ Top ]

_stream_stat   [line 638]

void _stream_stat( [string $file = null])

Retrieve statistics on a file or directory within the .phar

Parameters:

string   $file   —  file/directory to stat

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:56:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.