Map-based autoloader across php and phar resources

⌈⌋ ⎇ branch:  Canonic Autoloader


Artifact [7e8b9b024b]

Artifact 7e8b9b024b298f742df5ddfea04bb1c94181f7a9:

  • Executable file mk — part of check-in [18e74838b1] at 2015-01-22 21:58:36 on branch trunk — Build in trigger script for DPKG and RPM (untested). (user: mario size: 1523)

#!/bin/sh


#-- bump version
VERSION=$(version  read stub.php  bump show  write::2 stub.php)

#-- create plain phar
xpm -s src -t phar --phar-format zip-gz --phar-stub stub.php --phar-x -f stub.php

# test update classmap
ln -f shared.phar single/
php single/shared.phar

#-- deb + rpm
xpm -s dir -u man -t deb,rpm -f -v $VERSION -n php-shared-autoloader -a all \
--description "Canonic Autoloader / shared.phar
Provides a unified autoloader for /usr/share/php. It scans identifiers
in php scripts, but also makes phar collections first class citizens.
It's easily used from PHP:

   include_once('shared.phar');

It comes with a custom trigger for autoupdating the classmap on dpkg
installation, and falls back on 'phpab' generation if available. Class
identifiers are matched case-insensitively (as PHP expects it).
Also it's preparing for https://wiki.php.net/rfc/function_autoloading
in any future PHP version.

The shared autoloader is self-contained in a phar file, which eases
copying it onto and used in local project directories as well. Can be
split up into its individual scripts (autoloader, updater, classmap)
though." \
--url 'http://fossil.include-once.org/canonic' --category 'php' --vendor 'io' --maintainer 'mario#include-once:org' \
--depends php5-common --deb-suggests phpab \
--deb-interest /usr/share/php/ --after-install=deb_rpm_trigger \
--rpm-trigger-after-install '[-f ^./usr/share/php/]: deb_rpm_trigger' \
shared.phar=/usr/share/php/shared.phar \
manpage.1=/usr/share/man/man1/shared.phar.1 \