views:

121

answers:

1

Version info: CI version 1.7.2 - PHP 5.3.1 - Apache2 - Mac OSX 10.6.3

For some reason, when I load CI's email library, either in my controller, or in autoload.php, it automatically and immediately echoes the config info like so:

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE

If I autoload the email library in autoload.php, it is echoed before anything else in my source/page. If I call it explicitly within my controller, it's echoed at that exact point.

I'm stumped, never seen that before. Any ideas on how to surpress/eliminate?

Loading the library in autoload: $autoload['libraries'] = array('database','encrypt','email');

Loading the library in the controller: $this->load->library('email');

+1  A: 

Seems rather odd. I'm using this library succesfully with the same CI version.

What is also odd is that the config values being printed are not the CI defaults!

Where are you setting the config values?

Are you definitely sure you're not setting the config anywhere else? e.g. in a config file in your config folder and accidently printing them here? This would explain both why the values are not defaults and they're only appearing when the class is loaded since it checks for a config file first.

rbaker86
Thanks, this pointed me to my config folder which had email.php in it with those values. Something from a long time ago I guess. I removed the contents of that file and the issue went away. However, I believe that file was implemented properly.
k00k
Perhaps `email.php` was missing a `<?php` at the start?
gnarf
@gnarf - Bingo! That was it. Ah the joy of multiple devs in my code. I'm accepting rbaker86's answer as it put us down the right path.added <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');to the top and it's all good. Thanks!
k00k
Cheers, well done. I've been there!
rbaker86