Ignore:
Timestamp:
2011/01/17 14:46:37 (13 years ago)
Author:
Seasoft
Message:

#403(インクルードしているライブラリ群をバージョンアップする)

  • PEAR::Mail 1.2.0
  • PEAR::Net_SMTP 1.4.4
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/module/Mail.php

    r16523 r19942  
    11<?php 
    2 // 
    3 // +----------------------------------------------------------------------+ 
    4 // | PHP Version 4                                                        | 
    5 // +----------------------------------------------------------------------+ 
    6 // | Copyright (c) 1997-2003 The PHP Group                                | 
    7 // +----------------------------------------------------------------------+ 
    8 // | This source file is subject to version 2.02 of the PHP license,      | 
    9 // | that is bundled with this package in the file LICENSE, and is        | 
    10 // | available at through the world-wide-web at                           | 
    11 // | http://www.php.net/license/2_02.txt.                                 | 
    12 // | If you did not receive a copy of the PHP license and are unable to   | 
    13 // | obtain it through the world-wide-web, please send a note to          | 
    14 // | license@php.net so we can mail you a copy immediately.               | 
    15 // +----------------------------------------------------------------------+ 
    16 // | Author: Chuck Hagenbuch <chuck@horde.org>                            | 
    17 // +----------------------------------------------------------------------+ 
    18 // 
    19 // $Id: Mail.php,v 1.17 2006/09/15 03:41:18 jon Exp $ 
    20  
    21 require_once dirname(__FILE__) . "/PEAR.php"; 
     2/** 
     3 *  PEAR's Mail:: interface. 
     4 * 
     5 * PHP versions 4 and 5 
     6 * 
     7 * LICENSE: 
     8 * 
     9 * Copyright (c) 2002-2007, Richard Heyes 
     10 * All rights reserved. 
     11 * 
     12 * Redistribution and use in source and binary forms, with or without 
     13 * modification, are permitted provided that the following conditions 
     14 * are met: 
     15 * 
     16 * o Redistributions of source code must retain the above copyright 
     17 *   notice, this list of conditions and the following disclaimer. 
     18 * o Redistributions in binary form must reproduce the above copyright 
     19 *   notice, this list of conditions and the following disclaimer in the 
     20 *   documentation and/or other materials provided with the distribution. 
     21 * o The names of the authors may not be used to endorse or promote 
     22 *   products derived from this software without specific prior written 
     23 *   permission. 
     24 * 
     25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
     26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
     27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
     28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
     29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
     30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
     31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
     33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
     34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
     35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     36 * 
     37 * @category    Mail 
     38 * @package     Mail 
     39 * @author      Chuck Hagenbuch <chuck@horde.org> 
     40 * @copyright   1997-2010 Chuck Hagenbuch 
     41 * @license     http://opensource.org/licenses/bsd-license.php New BSD License 
     42 * @version     CVS: $Id: Mail.php 294747 2010-02-08 08:18:33Z clockwerx $ 
     43 * @link        http://pear.php.net/package/Mail/ 
     44 */ 
     45 
     46require_once 'PEAR.php'; 
    2247 
    2348/** 
     
    2752 * 
    2853 * @access public 
    29  * @version $Revision: 1.17 $ 
     54 * @version $Revision: 294747 $ 
    3055 * @package Mail 
    3156 */ 
     
    5075    { 
    5176        $driver = strtolower($driver); 
    52         $include_dir = realpath(dirname( __FILE__)); 
    53         include_once $include_dir ."/Mail/" . $driver . ".php"; 
     77        @include_once 'Mail/' . $driver . '.php'; 
    5478        $class = 'Mail_' . $driver; 
    5579        if (class_exists($class)) { 
     
    84108     *               containing a descriptive error message on 
    85109     *               failure. 
     110     * 
    86111     * @access public 
    87112     * @deprecated use Mail_mail::send instead 
     
    89114    function send($recipients, $headers, $body) 
    90115    { 
    91         $this->_sanitizeHeaders($headers); 
     116        if (!is_array($headers)) { 
     117            return PEAR::raiseError('$headers must be an array'); 
     118        } 
     119 
     120        $result = $this->_sanitizeHeaders($headers); 
     121        if (is_a($result, 'PEAR_Error')) { 
     122            return $result; 
     123        } 
    92124 
    93125        // if we're passed an array of recipients, implode it. 
     
    105137 
    106138        // flatten the headers out. 
    107         list(,$text_headers) = Mail::prepareHeaders($headers); 
     139        list(, $text_headers) = Mail::prepareHeaders($headers); 
    108140 
    109141        return mail($recipients, $subject, $body, $text_headers); 
    110  
    111142    } 
    112143 
     
    152183        foreach ($headers as $key => $value) { 
    153184            if (strcasecmp($key, 'From') === 0) { 
    154                 $include_dir = realpath(dirname( __FILE__)); 
    155                 include_once $include_dir ."/Mail/RFC822.php"; 
    156                 $parser = &new Mail_RFC822(); 
     185                include_once 'Mail/RFC822.php'; 
     186                $parser = new Mail_RFC822(); 
    157187                $addresses = $parser->parseAddressList($value, 'localhost', false); 
    158                 if (PEAR::isError($addresses)) { 
     188                if (is_a($addresses, 'PEAR_Error')) { 
    159189                    return $addresses; 
    160190                } 
     
    210240    function parseRecipients($recipients) 
    211241    { 
    212         include_once dirname(__FILE__) . "/Mail/RFC822.php"; 
     242        include_once 'Mail/RFC822.php'; 
    213243 
    214244        // if we're passed an array, assume addresses are valid and 
     
    224254 
    225255        // If parseAddressList() returned a PEAR_Error object, just return it. 
    226         if (PEAR::isError($addresses)) { 
     256        if (is_a($addresses, 'PEAR_Error')) { 
    227257            return $addresses; 
    228258        } 
Note: See TracChangeset for help on using the changeset viewer.