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

Class: PHP_Archive

Source Location: /PHP_Archive-0.6.0/Archive.php

Class Overview


PHP_Archive Class (implements .phar)


Author(s):

Version:

  • $Id: Archive.php,v 1.19 2005/07/24 15:42:20 cellog Exp $

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.

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



[ Top ]


Class Variables

$archiveName =  null

[line 36]

  • Var: Archive filename
  • Access: protected

Type:   string


[ Top ]

$basename =

[line 32]

  • Var: Current phar basename (like PEAR.phar)
  • Access: protected

Type:   string


[ Top ]

$currentFilename =  null

[line 45]

Current file name in the tar
  • Access: protected

Type:   string


[ Top ]

$currentStat =  null

[line 40]

Current Stat info of the current file in the tar
  • Access: protected

Type:   mixed


[ Top ]

$file =  null

[line 59]

  • Var: Content of the file being requested
  • Access: protected

Type:   string


[ Top ]

$footerLength =  0

[line 55]

Length of the current tar file's footer
  • Access: protected

Type:   int


[ Top ]

$fp =  null

[line 63]

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

Type:   resource|null


[ Top ]

$fplen =  null

[line 67]

  • Var: length of the current archive
  • Access: protected

Type:   int


[ Top ]

$internalFileLength =  0

[line 50]

Length of the current tar file
  • Access: protected

Type:   int


[ Top ]

$position =  0

[line 71]

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

Type:   int


[ Top ]



Method Detail

APIVersion   [line 606]

string APIVersion( )

API version of this class
  • Access: public

[ Top ]

cacheStat   [line 77]

void cacheStat( string $pharname)

  • Access: public

Parameters:

string   $pharname   —  basename of the phar to cache stat from.

[ Top ]

dir_closedir   [line 585]

void dir_closedir( )

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

[ Top ]

dir_opendir   [line 526]

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 571]

void dir_readdir( )

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

[ Top ]

dir_rewinddir   [line 596]

void dir_rewinddir( )

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

[ Top ]

extractFile   [line 265]

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 ]

initializeStream   [line 304]

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://filename_within_phar.ext or phar://pharname.phar/filename_within_phar.ext

phar://filename_within_phar.ext will simply use the last .phar opened.

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

Parameters:

string   $file   —  a file within the archive

[ Top ]

processFile   [line 88]

void processFile( string $path)

  • Access: protected

Parameters:

string   $path   — 

[ Top ]

selectFile   [line 107]

void selectFile( string $path)

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

Parameters:

string   $path   — 

[ Top ]

stream_open   [line 342]

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 416]

void stream_read( int $count)

Read the data - PHP streams API
  • Access: public

Parameters:

int   $count   — 

[ Top ]

stream_seek   [line 438]

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 478]

void stream_stat( )

The result of an fstat call, returns mod time from tar, and file size - PHP streams API

[ Top ]

stream_tell   [line 468]

void stream_tell( )

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

[ Top ]

url_stat   [line 513]

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 488]

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:15:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.