Subversion Repositories Applications.papyrus

Rev

Rev 1305 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1305 Rev 1312
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: ezmlm-parser.php,v 1.2.4.2 2007-04-11 12:30:50 alexandre_tb Exp $
22
// CVS : $Id: ezmlm-parser.php,v 1.2.4.3 2007-04-12 13:37:02 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* classe ezmlm_parser pour lire les fichiers d index de ezmlm-idx
26
* classe ezmlm_parser pour lire les fichiers d index de ezmlm-idx
27
*
27
*
28
*@package projet
28
*@package projet
29
//Auteur original : ?? recupere dans ezmlm-php
29
//Auteur original : ?? recupere dans ezmlm-php
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
*@copyright     Tela-Botanica 2000-2004
31
*@copyright     Tela-Botanica 2000-2004
32
*@version       $Revision: 1.2.4.2 $
32
*@version       $Revision: 1.2.4.3 $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
Line 35... Line 35...
35
 
35
 
36
 
36
 
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
Line 38... Line 38...
38
// |                                            ENTETE du PROGRAMME                                       |
38
// |                                            ENTETE du PROGRAMME                                       |
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
Line 40... Line 40...
40
 
40
 
41
// $Id: ezmlm-parser.php,v 1.2.4.2 2007-04-11 12:30:50 alexandre_tb Exp $
41
// $Id: ezmlm-parser.php,v 1.2.4.3 2007-04-12 13:37:02 alexandre_tb Exp $
42
//
42
//
Line 106... Line 106...
106
				$temp = fgets($fichier_index, 4096);
106
				$temp = fgets($fichier_index, 4096);
107
				preg_match('/([0-9]+): ([a-z]+) (.*)/', $temp, $match) ;
107
				preg_match('/([0-9]+): ([a-z]+) (.*)/', $temp, $match) ;
Line 108... Line 108...
108
				
108
				
109
				// dans la seconde on recupere la date, hash auteur et auteur
109
				// dans la seconde on recupere la date, hash auteur et auteur
110
				$temp = fgets($fichier_index, 4096);
110
				$temp = fgets($fichier_index, 4096);
111
				preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9]) ([^;]+);(.*) (.*)/', $temp, $match_deuxieme_ligne) ;
111
				preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9]) ([^;]+);([^ ]*) (.*)/', $temp, $match_deuxieme_ligne) ;
112
				if ($match[1] != '') {
112
				if ($match[1] != '') {
113
				$tableau_message[$match[1]] = array ($match[2], $match[3], 
113
				$tableau_message[$match[1]] = array ($match[2], $match[3], 
114
									$match_deuxieme_ligne[1].' '.$match_deuxieme_ligne[2].' '.$match_deuxieme_ligne[3], 
114
									$match_deuxieme_ligne[1].' '.$match_deuxieme_ligne[2].' '.$match_deuxieme_ligne[3], 
115
									$match_deuxieme_ligne[5], 
115
									$match_deuxieme_ligne[5], 
Line 136... Line 136...
136
			
136
			
137
			for ($i = count ($tableau_message); $i <= $show; $i++) {
137
			for ($i = count ($tableau_message); $i <= $show; $i++) {
138
				// Recuperation du numero de message, du hash du sujet et du sujet
138
				// Recuperation du numero de message, du hash du sujet et du sujet
Line 139... Line 139...
139
				// dans la seconde on recupere la date, hash auteur et auteur
139
				// dans la seconde on recupere la date, hash auteur et auteur
140
 
140
 
141
				preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9]) ([^;]+);(.*) (.*)/', 
141
				preg_match('/\t([0-9]+) ([a-zA-Z][a-zA-Z][a-zA-Z]) ([0-9][0-9][0-9][0-9]) ([^;]+);([^ ]*) (.*)/', 
142
									current ($fichier_index), $match_deuxieme_ligne) ;
142
									current ($fichier_index), $match_deuxieme_ligne) ;
Line 143... Line 143...
143
				preg_match('/([0-9]+): ([a-z]+) (.*)/', next($fichier_index), $match) ;
143
				preg_match('/([0-9]+): ([a-z]+) (.*)/', next($fichier_index), $match) ;
Line 188... Line 188...
188
        $data = file_get_contents ($file) ;
188
        $data = file_get_contents ($file) ;
189
        $message = file_get_contents($file) ;
189
        $message = file_get_contents($file) ;
190
        $mimeDecode = new Mail_mimeDecode($message) ;
190
        $mimeDecode = new Mail_mimeDecode($message) ;
191
        $mailDecode = $mimeDecode->decode() ;
191
        $mailDecode = $mimeDecode->decode() ;
192
        return $mailDecode ;
192
        return $mailDecode ;
193
		/*$fd = fopen($file, "r");
-
 
194
		while (!feof($fd)) { $data .= fgets($fd,4096); }
-
 
195
		fclose($fd);*/
-
 
196
        if ($this->_get_headers($data, $simple)) return true ;
-
 
197
		return false ;
-
 
198
	}
193
	}
Line 199... Line 194...
199
 
194
 
200
	// this does all of the work (well it calls two functions that do all the work :)
195
	// this does all of the work (well it calls two functions that do all the work :)
201
	// all the decoding a part breaking follows RFC2045 (http://www.faqs.org/rfcs/rfc2045.html)
196
	// all the decoding a part breaking follows RFC2045 (http://www.faqs.org/rfcs/rfc2045.html)