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

Class: PHP_Archive_Creator

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

Class Overview


PHP_Archive Creator Class


Author(s):

Version:

  • $Id: Creator.php,v 1.17 2005/09/05 19:58:32 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 <davey@synapticmedia.net>
  • Version: $Id: Creator.php,v 1.17 2005/09/05 19:58:32 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
  • Access: protected

Type:   string


[ Top ]

$compress =  false

[line 71]

  • Var: Whether or not the archive should be compressed
  • Access: protected

Type:   boolean


[ Top ]

$modified =  false

[line 77]

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

Type:   boolean


[ Top ]

$save_path =

[line 65]

  • Var: Where the TAR archive will be saved
  • Access: protected

Type:   string


[ Top ]

$tar =

[line 53]

  • Var: instance of Archive_Tar
  • Access: protected

Type:   object An


[ Top ]

$temp_path =

[line 59]

  • Var: The temporary path to the TAR archive
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 92]

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

PHP_Archive Constructor
  • Access: public

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

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

Add an array of files to the archive
  • Access: public

Parameters:

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

[ Top ]

addDir   [line 402]

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

Add a directory to the archive
  • Access: public

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

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

Add a file to the PHP Archive
  • Access: public

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

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

Add a string to the PHP Archive as a file
  • Access: public

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

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: public

Parameters:

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

[ Top ]

savePhar   [line 436]

void savePhar( [string $file_path = null])

Save the PHAR Archive
  • Access: public

Parameters:

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

[ Top ]


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