laravel/laravel — Issue #276: Placing 3rd party libraries in application/libaries results in weird autoloading
Author: jaysonic
Created: 2012-01-26 04:51:29+00:00
State: open

I encountered some problems when using Swift Mailer with 2.2 after switching from 2.1. It would spit the following error out:

~~~~
Unhandled Exception
Message:

Class 'Swift_Preferences' not found

Location:

/xx/application/libraries/swift/preferences.php on line 10

Stack Trace:

#0 /xx/laravel/laravel.php(45): Laravel\Error::shutdown()
#1 [internal function]: Laravel\{closure}()
#2 {main}
~~~~

It wasn't performing the correct autoloading. After talking with Michael he suggested moving Swift outside of the libraries directory and into something like 'packages'. So I did that and Swift now loads everything correctly and sends e-mails.

Not sure what it is yet, but something with the new 2.2 autoloader (possibly the PSR-0 standard part) is messing with the Swift autoloader.