-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DebugOutput setter function #26
Conversation
Hello, @Bankde , Please, see this line at PHPMailer: CodeIgniter detects CLI this way: https://github.com/bcit-ci/CodeIgniter/blob/3.1-stable/system/core/Common.php#L381 Therefore, for not breaking backward compatibility I would prefer the default configuration option to have this value: $config['debug_output'] = (PHP_SAPI === 'cli' OR defined('STDIN')) ? 'echo' : 'html'; // PHPMailer's SMTP debug output: 'html', 'echo', 'error_log' or user defined function with parameter $str and $level. Do you agree? If yes, you can add this change to this PR, or I can accept this PR as it is and make the change later. |
Since there is a newer version of PHPMailer and I hurry, I would merge this PR as it is and implement my suggestion. You can always customize the default value in your projects. Thank you very much for your contribution. |
I completely agree with you. I forgot that codeigniter could be run on CLI. Have you start implementing your suggestion yet ? I have a problem with modifying static default_properties. |
I researched a little bit, for this particular case, I think $config['debug_output'] = (strpos(PHP_SAPI, 'cli') !== false OR defined('STDIN')) ? 'echo' : 'html'; would be a better choice. https://www.sitepoint.com/taking-advantage-of-phps-built-in-server/ PHP_SAPI could return 'cli' or 'cli-server', for both of these cases I would set 'echo' as PHPMailer does. Let me do the changes and I would ask you for comments. |
…mately as PHPMailer does. Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Just a reminder, don't forget to fix debug_output from $default_properties. |
…brary as PHPMailer does. Tracking the option value by using the corresponding internal property. Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Actually, I used the constructor to enforce the autodetection. I think this part of code is finished now. |
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
If you have no objections I am going to make my usual testing and to tag a new release 1.2.26. |
The code looks great. I have no objections here. |
… be invoked by NULL or empty string value. Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Done. Thank you once again. :-) |
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
Having DebugOutput setter will give developers ability to create their own error handle function which can be very useful.