Map-based autoloader across php and phar resources

โŒˆโŒ‹ โŽ‡ branch:  Canonic Autoloader


Update of "FeatureComparison"

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 979cde52ced37195ce4daba5685d8edf82a7af1f
Page Name:FeatureComparison
Date: 2014-09-02 18:34:26
Original User: mario
Mimetype:text/x-markdown
Parent: a8d2b352b07b2f404618255a5ecd9958a88ca808 (diff)
Next 9eb2a4de0db7232aefc06b97ac615298b8c9214b
Content

Let me just preface this with: inconclusive conventions are better than no standards at all. And there's probably nothing newsworthy here.
Due to the ellipses in the PSR-x documents it's however helpful to detail some technical deviations and oversights.

Feature PHP PSR-0 PSR-4 shared
Class autoloading โœ” โœ” โœ” โœ”
Zero configuration โœ” โ€Šโœ” โœ˜โ€Š โœ˜
Multiple class declarations per script โœ” โœ˜โ€Šยน โœ˜โ€Šยน โœ”
Namespace support โœ” โœ” โœ” โœ”
Multiple namespaces per file โœ” โœ˜โ€Š โœ˜โ€Š โœ”
Syntax verification โœ” โœ˜โ€Š โœ˜โ€Š โœ˜
Specific underscore treatment โœ˜ โ€Šโœ” โœ˜โ€Š โœ˜
Case-insensitive class identifiers ยฒ โœ” โœ˜โ€Š โœ˜โ€Šยฒ โœ”
Function names โœ” โฟ/โ‚ โฟ/โ‚ โœ”
Case-variant constants โœ” โฟ/โ‚ โ€Šโฟ/โ‚ โœ˜
Phar package support โœ” โœ˜โ€Šยณ โœ˜โ€Š โœ”
Versioned bundles โด โœ” โœ˜โ€Š โœ˜โ€Š โœ˜

1 = Impractical, but symlinking dependency-conjoined class modules might be a feasible workaround.
2 = Not just accidentally on some plattforms or filesystems.
3 = While prohibited, most PSR-0 autoloaders work with handicrafted phar:// paths in their namespace registry.
4 = Not a discreet PHP or Phar feature, and resolving dependencies is certainly still best left with composer, not done at runtime.

Origin of PSR-0/4

PSR-4 inherits the PSR-0 design as intended for and from PHP framework maintainers. Retaining the traditional class directory structures was the protogenic goal then. PSR-4 constitutively just removed the PEAR-style name splitting.

Which is where the plattform ambiguity due to absent identifier-to-file case normalization issues from. Holding on to the handed down file structuring schemes is also why namespaces were interpreted as PHP 5.3s only significant addition, but Phar support disregarded.