| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
package - create a packaged release in phar, tar, tgz or zip formatIntroduction
The package command bundles up the files of a package and its package.xml into an archive for distribution. It accepts a single optional argument, the path to a package.xml. If the optional path is not provided, the command searches for a file named package.xml in the current directory. If this file is an older version 1.0, it also searches for package2.xml in the current directory, and uses that as the package file. This allows creating packages that are compatible with ancient versions of PEAR older than version 1.4.0 If package.xml exists and is a PEAR2 package (requires pear installer version equal to or newer than 2.0.0a1), the command will also look for a file in the current directory named package_compatible.xml. This file should be a package.xml customized for use by the PEAR Installer, and is automatically generated by the make command unless explicitly prevented. This file makes it possible for the PEAR Installer to install packages generated for Pyrus. The created archive can be in any or all of the following formats:
The formats are requested by passing their name as an option like so: php pyrus.phar package --phar --tar --tgz --zip . The phar file format is a format that can be used to create self-installing archives, or even archives that are self-contained commands. pyrus.phar, for instance, is a complete application that runs directly from its archive. Due to security considerations, the ability to create executable phar archives is disabled by default. To create a phar archive, the phar.readonly php.ini setting must be disabled like so: php -dphar.readonly=0 pyrus.phar package --phar The tar and tgz file formats are the formats familiar to users of PEAR. tgz is a gzipped tar archive, and requires the zlib extension be enabled in order to create it. The zip file format is most familiar to Windows users. PEAR2 packagesAll packages designed for Pyrus automatically have PEAR2/Autoload.php, PEAR2/Exception.php, PEAR2/MultiErrors.php, and PEAR2/MultiErrors/Exception.php bundled so that these dependencies are available when a package is extracted without use of Pyrus to install it. Packages designed for installation by the PEAR Installer and not for Pyrus do not bundle any dependencies. Package signingPyrus supports creating archives that have a mandatory signature using OpenSSL certificates such as those available from CACert. Signed archives cannot be processed without the presence of the openssl PHP extension. In addition, a bug in the phar extension's verification of openssl signatures requires PHP version 5.3.1 or newer. Creation of signatures only requires PHP version 5.3.0 or newer. To create a package signature, set the openssl_cert configuration variable to the path of your PKCS#12 certificate (generally saved with a file extension of p12), and the handle configuration variable to your handle in package.xml. --stubThe --stub or -s option specifies a PHP script to use as the stub to a phar archive, and is ignored if --phar is not passed to the command. The stub is a short executable script that is executed as a boot strap when a phar archive is passed to PHP like php pyrus.phar . All stubs must end with the __HALT_COMPILER(); directive to be a valid stub. If the --stub option is not explicitly specified and a phar archive is being created, Pyrus will look for a file named stub.php in the same directory as the package.xml, and will use that as the stub for the phar archive if found. Here is pyrus's stub:
<?php
--extrasetupThe --extrasetup or -e option is used to specify the path to a PHP script that is used to include files in the created packages that are not in the package.xml list of files. This is used to create archives that are designed to be friendly to users simply "trying before they buy" the archive, or to provide support files needed to create self-installing archives. If the --extrasetup option is not explicitly specified, then Pyrus looks for a file named extrasetup.php in the same directory as the package.xml, and will use this if found. The extrasetup script should create a variable named $extrafiles that contains an associative array mapping relative path within the archive to an absolute path of a file on disk. Here is Pyrus's extrasetup, which demonstrates bundling of the required dependencies PEAR2_HTTP_Request and PEAR2_Console_Commandline:
<?php
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「package - create a packaged release in phar, tar, tgz or zip format」をGoogle検索
|