|
Phar::mount(PHP >= 5.3.0, PECL phar >= 2.0.0) Phar::mount — Mount an external path or file to a virtual location within the phar archive Описание
void Phar::mount
( string $pharpath
, string $externalpath
)
Much like the unix file system concept of mounting external devices to paths within the directory tree, Phar::mount() allows referring to external files and directories as if they were inside of an archive. This allows powerful abstraction such as referring to external configuration files as if they were inside the archive. Список параметров
Возвращаемые значенияNo return. PharException is thrown on failure. ОшибкиThrows PharException if any problems occur mounting the path. Примеры
Пример #1 A Phar::mount() example The following example shows accessing an external configuration file as if it were a path within a phar archive. First, the code inside of a phar archive:
<?php Next the external code used to mount the configuration file:
<?php Another method is to put the mounting code inside the stub of the phar archive. Here is an example of setting up a default configuration file if no user configuration is specified:
<?php ...and the code externally to load this phar archive:
<?php |
|