Page 1 of 1

Fatal error: Class 'Swift' not found

Posted: Fri Oct 26, 2007 2:32 pm
by panczel.levente
Hello!
I use v3.3.2 with PHP5, and while assembling a message it says:
Fatal error: Class 'Swift' not found in <my_Swift_root_path>\Swift\Message.php on line 85
And indeed: I can't find where Message.php would load the Swift class, though it is being referenced on line 85 (or more obviously on line 87).
Only include_once()-ing Message.php has been sufficient in the past, so I suppose this change was not intentional.
I suggest everyone who has this same problem to circumvent it by including Swift.php right before Message.php!

Re: Fatal error: Class 'Swift' not found

Posted: Sat Oct 27, 2007 9:54 pm
by Chris Corbyn
panczel.levente wrote:Hello!
I use v3.3.2 with PHP5, and while assembling a message it says:
Fatal error: Class 'Swift' not found in <my_Swift_root_path>\Swift\Message.php on line 85
And indeed: I can't find where Message.php would load the Swift class, though it is being referenced on line 85 (or more obviously on line 87).
Only include_once()-ing Message.php has been sufficient in the past, so I suppose this change was not intentional.
I suggest everyone who has this same problem to circumvent it by including Swift.php right before Message.php!
I've probably introduced some coupling which I could do with removing ;) Most like putting the version number in the headers since it's stored as a class constant of Swift itself. Including the Swift.php file will solve that problem either way, but I agree that behaviour has crept in somewere along the way.