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

Class: PHP_Archive

Source Location: /PHP_Archive-0.9.2/Archive.php

Class Overview


PHP_Archive Class (implements .phar)


Author(s):

Version:

  • $Id: Archive.php,v 1.35 2007/01/06 21:58:24 cellog Exp $

Copyright:

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

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 31]
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 47]

Current file name in the phar
  • Access: protected

Type:   string


[ Top ]

$currentStat =  null

[line 57]

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

Type:   string


[ Top ]

$fp =  null

[line 61]

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

Type:   resource|null


[ Top ]

$internalFileLength =  null

[line 52]

Length of current file in the phar
  • Access: protected

Type:   string


[ Top ]

$position =  0

[line 65]

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

Type:   int


[ Top ]



Method Detail

APIVersion   [line 636]

string APIVersion( )

API version of this class
  • Access: public

[ Top ]

dir_closedir   [line 615]

void dir_closedir( )

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

[ Top ]

dir_opendir   [line 551]

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

void dir_readdir( )

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

[ Top ]

dir_rewinddir   [line 626]

void dir_rewinddir( )

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

[ Top ]

extractFile   [line 247]

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

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 ]

mapPhar   [line 125]

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 ]

selectFile   [line 203]

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

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

void stream_read( int $count)

Read the data - PHP streams API
  • Access: public

Parameters:

int   $count   — 

[ Top ]

stream_seek   [line 455]

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

void stream_stat( )

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

PHP streams API


[ Top ]

stream_tell   [line 485]

void stream_tell( )

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

[ Top ]

url_stat   [line 540]

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

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