update : 2015.11.03
php.shukuma.com검색:
|
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 설명
final public static 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. 예제
Example #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 |