[ Index ] |
|
Code source de CakePHP 1.1.13.4450 |
1 <?php 2 /* SVN FILE: $Id: cake_log.php 4450 2007-02-05 05:18:05Z phpnut $ */ 3 /** 4 * Logging. 5 * 6 * Log messages to text files. 7 * 8 * PHP versions 4 and 5 9 * 10 * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> 11 * Copyright 2005-2007, Cake Software Foundation, Inc. 12 * 1785 E. Sahara Avenue, Suite 490-204 13 * Las Vegas, Nevada 89104 14 * 15 * Licensed under The MIT License 16 * Redistributions of files must retain the above copyright notice. 17 * 18 * @filesource 19 * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. 20 * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project 21 * @package cake 22 * @subpackage cake.cake.libs 23 * @since CakePHP(tm) v 0.2.9 24 * @version $Revision: 4450 $ 25 * @modifiedby $LastChangedBy: phpnut $ 26 * @lastmodified $Date: 2007-02-04 23:18:05 -0600 (Sun, 04 Feb 2007) $ 27 * @license http://www.opensource.org/licenses/mit-license.php The MIT License 28 */ 29 /** 30 * Included libraries. 31 * 32 */ 33 if (!class_exists('File')) { 34 uses('file'); 35 } 36 /** 37 * Logs messages to text files 38 * 39 * @package cake 40 * @subpackage cake.cake.libs 41 */ 42 class CakeLog{ 43 /** 44 * Writes given message to a log file in the logs directory. 45 * 46 * @param string $type Type of log, becomes part of the log's filename 47 * @param string $msg Message to log 48 * @return boolean Success 49 */ 50 function write($type, $msg) { 51 $filename = LOGS . $type . '.log'; 52 $output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $msg . "\n"; 53 $log = new File($filename); 54 return $log->append($output); 55 } 56 } 57 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 19:27:47 2007 | par Balluche grâce à PHPXref 0.7 |