@Padraic that doesn't mean you cannot manually instantiate Zend\Loader in your index.php (example). Also, we're not discussing composer's package management side - see the configuration in the first post
Otherwise, I agree - composer is still affected by MITM. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 30 May 2013 19:33, Pádraic Brady <[email protected]> wrote: > I use both. > > Also, why on God's green earth would we pin all our future's on > Composer? It's nice to have, once you secure the workflow (it suffers > from SSL verification vulnerabilities), but shouldn't be a necessary > dependency. Next, someone will tell me that libraries should all be > either Modules or Bundles and I'll explode into rant mode over keeping > reusable functional units independent of optional overarching > certain-to-be-redundant-one-day architectures ;). > > Paddy > > On 30 May 2013 18:13, Marco Pivetta <[email protected]> wrote: > > Hi everybody! > > > > tl;dr: ZF2: do you use composer or Zend\Loader? Simply reply with > "loader" > > or "composer" :) > > > > I've been discussing on IRC about dropping the pre-configured Zend\Loader > > instance in standard MVC applications (we're discussing that for ZF3). > > Since I was asserting that most users do use composer for autoloading > their > > stuff, I got told to get proof of that - so please just drop me a line :) > > > > The main idea is to move away from configuring autoloading per-library > and > > instead use composer to autoload everything. Here's how the config of a > > composer.json file would look: > > > > { > > "autoload": { > > "psr-0": { > > "MyLib": "path/to/my-lib" > > } > > } > > } > > > > Here's how it would look with Zend\Loader: > > > > include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; > > Zend\Loader\AutoloaderFactory::factory(array( > > 'Zend\Loader\StandardAutoloader' => array( > > 'autoregister_zf' => true, > > 'namespaces' => array( > > 'MyLib' => "path/to/my-lib", > > ), > > ) > > )); > > > > The main difference here is that composer requires us to run `composer > > dump-autoload` before being able to use `MyLib` > > > > The idea is NOT about dropping Zend\Loader, but just removing the > > initialization logic from the skeleton application. > > > > If you also have thoughts except for your preference, please share! > > > > > > > > Marco Pivetta > > > > http://twitter.com/Ocramius > > > > http://ocramius.github.com/ > > > > -- > > -- > Pádraic Brady > > http://blog.astrumfutura.com > http://www.survivethedeepend.com > Zend Framework Community Review Team > Zend Framework PHP-FIG Representative >
