suggestion for finding domain
Posted: Sat Mar 31, 2007 2:51 pm
The __construct method in Swift.php currently has:
If run from CLI, $_SERVER['SERVER_NAME'] will not exist. I suggest you change to:
Personally, i'm just passing it as the second param to new Swift() but i thought somebody might want to see this.
Code: Select all
public function __construct(Swift_IConnection &$object, $domain=false)
{
if (!$domain) $domain = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'SwiftUser';Code: Select all
public function __construct(Swift_IConnection &$object, $domain=NULL)
{
$domain = !is_null($domain)
? $domain
: !empty($_SERVER['SERVER_NAME'])
? $_SERVER['SERVER_NAME']
: !empty($_SERVER['HOSTNAME'])
? $_SERVER['HOSTNAME']
: 'SwiftUser';Personally, i'm just passing it as the second param to new Swift() but i thought somebody might want to see this.