Skip to content

Anatomy of a phark package

igorw edited this page Jan 2, 2012 · 6 revisions

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 include_path
  • 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 <lachlan@ljd.cc>')
  ->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/**')
  ;

Questions

  • How do we handle classloaders?

References

Something went wrong with that request. Please try again.