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

Class: PHP_Archive_Creator

Source Location: /PHP_Archive-0.5.0/Archive/Creator.php

Class Overview


PHP_Archive Creator Class


Author(s):

Version:

  • $Id: Creator.php,v 1.11 2005/04/15 04:31:24 cellog Exp $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 41]
PHP_Archive Creator Class

This class allows you to easily, programatically create PHP Archives (PHAR files)

  • Author: Davey Shafik <[email protected]>
  • Version: $Id: Creator.php,v 1.11 2005/04/15 04:31:24 cellog Exp $
  • Copyright:
  • Link: Synaptic Media
  • Todo: Implement PHP_Archive_Creator::addDir();
  • Example: example not found


[ Top ]


Class Variables

$archive_name =

[line 47]

  • Var: The Archive Filename

Type:   string


[ Top ]

$compress =  false

[line 71]

  • Var: Whether or not the archive should be compressed

Type:   boolean


[ Top ]

$modified =  false

[line 77]

  • Var: Whether or not a file has been added to the archive

Type:   boolean


[ Top ]

$save_path =

[line 65]

  • Var: Where the TAR archive will be saved

Type:   string


[ Top ]

$tar =

[line 53]

  • Var: instance of Archive_Tar

Type:   object An


[ Top ]

$temp_path =

[line 59]

  • Var: The temporary path to the TAR archive

Type:   string


[ Top ]



Method Detail

PHP_Archive_Creator (Constructor)   [line 166]

PHP_Archive_Creator PHP_Archive_Creator( [ $init_file = 'index.php'], [ $compress = false], [ $allow_direct_access = false])

PHP4 Compatible Constructor
  • See: PHP_Archive_Creator::__construct

Parameters:

   $init_file   — 
   $compress   — 
   $allow_direct_access   — 

[ Top ]

__construct (Constructor)   [line 92]

void __construct( [string $init_file = 'index.php'], [boolean $compress = false], [mixed $allow_direct_access = false])

PHP_Archive Constructor

Parameters:

string   $init_file   —  Init file (file called by default upon PHAR execution)
boolean   $compress   —  Whether to compress the files or not (will cause slowdown!)
mixed   $allow_direct_access   —  The file extension to prepend to requests for files (i.e. request is /index, this is .php or .htm or whatever), false means that users can't browse to any file but the init file (you should handle other pages in your init file code). If you set it to True, then the exact PATH_INFO is used

[ Top ]

addArray   [line 428]

boolean addArray( array $files, [ $magicrequire = false])

Add an array of files to the archive

Parameters:

array   $files   —  This is an associative array of the format 'file_to_archive' => 'save_path_in_archive'
   $magicrequire   — 

[ Top ]

addDir   [line 413]

boolean addDir( string $dir, [array $ignore = array()], [array $include = array()], [bool $magicrequire = false])

Add a directory to the archive

Parameters:

string   $dir   —  The directory path to add
array   $ignore   —  files to ignore
array   $include   —  files to include (all others ignored)
bool   $magicrequire   —  If set, then "require_once '" will be replaced with "require_once 'phar://$magicrequire/"

[ Top ]

addFile   [line 179]

boolean addFile( string $file, string $save_path, [ $magicrequire = false])

Add a file to the PHP Archive

Parameters:

string   $file   —  Path of the File to add
string   $save_path   —  The save location of the file in the archive
   $magicrequire   — 

[ Top ]

addString   [line 192]

boolean addString( string $file_contents, string $save_path, [ $magicrequire = false])

Add a string to the PHP Archive as a file

Parameters:

string   $file_contents   —  Contents of the File to add
string   $save_path   —  The save location of the file in the archive
   $magicrequire   — 

[ Top ]

dirList   [line 352]

array dirList( string $directory, [ $toplevel = null])

Retrieve a listing of every file in $directory and all subdirectories.

The return format is an array of full paths to files

  • Return: list of files in a directory
  • Access: protected

Parameters:

string   $directory   —  full path to the directory you want the list of
   $toplevel   — 

[ Top ]

savePhar   [line 446]

void savePhar( [string $file_path = null])

Save the PHAR Archive

Parameters:

string   $file_path   —  The file path of where to save the file

[ Top ]


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