Anatomy of a phark package
Clone this wiki locally
A phark package is defined with a Pharkspec file in the root of a project. This defines metadata about the package including:
- Metadata about the package: Author, Email, Homepage, Version
- The files to include in the package
- Any executables that need to be linked into the shell path
- What paths to include in the php
- Other packages that this package depends on
Using this information, the
phark bundle command is used to generate a .phark file (which is actually a php phar file). This package is signed and can be uploaded to a central repository.
<?php $spec ->name('pheasant') ->authors('Lachlan Donald <email@example.com>') ->homepage('http://github.com/lox/pheasant') ->version('1.0.0') ->phpVersion('>=5.3.1') ->summary('A object mapper written for MySQL5.1 and PHP5.3') ->description('Pheasant is a simple object mapper for PHP 5.3+ and MySQL 5+. It offers basic relationships and query hydration.') ->dependency('simpletest','>=2.0.1beta') ->includePath('lib/**') ;
- How do we handle classloaders?