[TYPO3-english] A problem with swiftmailer, autoloading and open_basedir

Dmitry Dulepov dmitry.dulepov at gmail.com
Fri Dec 23 14:54:28 CET 2011


Hi!

Jigal van Hemert wrote:
> The file is of course Swift/SwiftException.php and the translation
> should be done by the autoloader of SwiftMailer
> (typo3/contrib/swiftmailer/classes/Swift.php).
> It looks like the SwiftMailer autoloader isn't used in the CLI context..
> Very strange.

Scheduler in the BE is also failing now:

[23-Dec-2011 13:53:28] PHP Fatal error:  tx_scheduler_Module::listTasks(): 
The script tried to execute a method or access a property of an incomplete 
object. Please ensure that the class definition 
"Swift_RfcComplianceException" of the object you are trying to operate on 
was loaded _before_ unserialize() gets called or provide a __autoload() 
function to load the class definition  in 
/var/lib/typo3/TYPO3_4-5/typo3/sysext/scheduler/mod1/index.php on line 1153

I can understand this error: may be it tries to load an exception, for 
which there is no class loaded.

Regarding the original message, I have a guess too. PHP autoloader calls 
autoloaders in the order they were inserted. Thus TYPO3 autoloader will be 
called first with the 'SwiftException.php' parameter. Since there is no 
path in this parameter, PHP thinks it falls outside of the open_basedir. 
That would be correct because cron jobs do not run from the web directory.

I can fix that on the server I think. I just "cd" to the web directory 
before running the cli script. This is not required for CLI scripts but it 
will solve the issue.

-- 
Dmitry Dulepov
TYPO3 core team member
Blog: http://dmitry-dulepov.com/
Twitter: http://twitter.com/dmitryd

Simplicity will save the world.



More information about the TYPO3-english mailing list