PHP: Phar::loadPhar - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Phar::mapPhar Phar->getVersion

Last updated: Sat, 27 Jan 2007

view this page in

# Phar::loadPhar

(no version information, might be only in CVS)

Phar::loadPhar -- Loads any phar archive with an alias

## Описание

bool Phar::loadPhar ( string filename [, string alias] )

This can be used to read the contents of an external Phar archive. This is most useful for assigning an alias to a phar so that subsequent references to the phar can use the shorter alias.

## Список параметров

`filename`

  the full or relative path to the phar archive to open

`alias`

  The alias that may be used to refer to the phar archive. Note that many phar archives specify an explicit alias inside the phar archive, and an E_RECOVERABLE_ERROR will be thrown if a new alias is specified in this case.

## Возвращаемые значения

Возвращает `TRUE` в случае успешного завершения или `FALSE` в случае возникновения ошибки.

## Errors/Exceptions

E_RECOVERABLE_ERROR is thrown if an alias is passed in and the phar archive already has an explicit alias

## Примеры

Пример 1. A Phar::loadPhar() example

loadPhar can be used anywhere to load an external Phar archive, whereas mapPhar should be used in a loader stub for a Phar.

`<?php Phar::loadPhar('/path/to/phar.phar', 'my.phar'); echo file_get_contents('phar://my.phar/file.txt'); ?>`

## Смотрите также

Phar::mapPhar()

add a note User Contributed Notes
Phar::loadPhar
There are no user contributed notes for this page.
Phar::mapPhar Phar->getVersion

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST