Changeset 3473 for extensions/CommentEditor/include/ce_functions.inc.php
- Timestamp:
- Jun 29, 2009, 1:55:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/CommentEditor/include/ce_functions.inc.php
r3462 r3473 1 1 <?php 2 /* $Id: ce_functions.inc.php,v 1. 6 2009/06/26 08:56:32Criss Exp $ */2 /* $Id: ce_functions.inc.php,v 1.7 2009/06/29 11:43:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 … … 10 10 function ce_require_class($aClassName) { 11 11 require_once CE_CLASSES .strtolower($aClassName) . '.class.php'; 12 } 13 14 function ce_clean_obsolete_files($obsolete_file_list) { 15 if (!file_exists(CE_PATH.$obsolete_file_list)) { 16 return TRUE; 17 } 18 $obsolete = file(CE_PATH.$obsolete_file_list); 19 array_push($obsolete, $obsolete_file_list); 20 return ce_clean_obsolete_list($obsolete); 21 } 22 23 function ce_clean_obsolete_list($file_list = array(), &$errors = array()) { 24 if (!function_exists('unlink')) { 25 // No unlink available... 26 array_push($errors, l10n('ce_no_unlink')); 27 return FALSE; 28 } 29 $success = TRUE; 30 foreach ($file_list as $file) { 31 $file = CE_PATH . $file; 32 if (file_exists($file)) { 33 // Remove obsolete file 34 $success &= unlink($file); 35 } 36 } 37 if (!$success) { 38 array_push($errors, l10n('ce_unlink_errors')); 39 } 40 return $success; 12 41 } 13 42
Note: See TracChangeset
for help on using the changeset viewer.