Map-based autoloader across php and phar resources

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


Artifact [a8d2b352b0]

Artifact a8d2b352b07b2f404618255a5ecd9958a88ca808:

Wiki page [FeatureComparison] by mario 2014-09-02 01:52:03.
D 2014-09-02T01:52:03.624
L FeatureComparison
N text/x-markdown
U mario
W 2486
Let me just preface this with: verdant conventions are better than no standards at all. And there's really nothing newsworthy here.<br>
Due to the ellipses in the PSR-x documents it's however helpful to detail some semantic deviations and oversights.

<style>
  .yes  { background: #bbeebb; }
  .no   { background: #eeccbb; }
  .part { background: #eedd99; }
  td, th { text-align: center; }
  td:first-child { text-align: left; font-weight: normal; }
</style>
<table width=100%>
<tr>
  <td style="text-align:left">**Property**
  <th>PHP
  <th>PSR-0
  <th>PSR-4
  <th>shared
<tr>
  <td class=yes>Class autoloading
  <td class=yes>โœ”
  <td class=yes>โœ”
  <td class=yes>โœ”
  <td class=yes>โœ”
<tr>
  <td>Zero configuration
  <td class=yes>โœ”
  <td class=yes>โ€Šโœ”
  <td class=no>โœ˜โ€Š
  <td class=no>โœ˜
<tr>
  <td>Multiple class declarations per script
  <td class=yes>โœ”
  <td class=no>โœ˜โ€Šยน
  <td class=no>โœ˜โ€Šยน
  <td class=yes>โœ”
<tr>
  <td>Namespace support
  <td class=yes>โœ”
  <td class=yes>โœ”
  <td class=yes>โœ”
  <td class=yes>โœ”
<tr>
  <td>Multiple namespaces per file
  <td class=yes>โœ”
  <td class=no>โœ˜โ€Š
  <td class=no>โœ˜โ€Š
  <td class=yes>โœ”
<tr>
  <td>Specific underscore treatment
  <td class=yes>โœ˜
  <td class=yes>โ€Šโœ”
  <td class=yes>โœ˜โ€Š
  <td class=yes>โœ˜
<tr>
  <td class=yes>Case-insensitive class identifiers ยฒ
  <td class=yes>โœ”
  <td class=no>โœ˜โ€Š
  <td class=no>โœ˜โ€Š
  <td class=yes>โœ”
<tr>
  <td>Function names
  <td class=yes>โœ”
  <td class=no>โฟ/โ‚
  <td class=no>โฟ/โ‚
  <td class=yes>โœ”
<tr>
  <td>Case-variant constants
  <td class=yes>โœ”
  <td class=no>โฟ/โ‚
  <td class=no>โ€Šโฟ/โ‚
  <td class=part>โœ˜
<tr>
  <td class=yes>Phar package support
  <td class=yes>โœ”
  <td class=part>โœ˜โ€Šยณ
  <td class=no>โœ˜โ€Š
  <td class=yes>โœ”
<tr>
  <td>Versioned bundles โด
  <td class=part>โœ”
  <td class=no>โœ˜โ€Š
  <td class=no>โœ˜โ€Š
  <td class=no>โœ˜
<tr>
</table>

<sup>1</sup> = Impractical, but symlinking dependency-merged class modules would be feasible workaround.<br>
<sup>2</sup> = Not just accidentally on some plattforms or filesystems.<br>
<sup>3</sup> = For most PSR-0 autoloaders one can at least handicraft phar:// paths into the namespace registry.<br>
<sup>4</sup> = Not a discreet PHP or Phar feature, and resolving dependencies is certainly still best left with composer, not done at runtime.<br>

Z eabebb48ad7707fe974569764c76a633