[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 extra_functions.php

Zen Cart 源代码 extra_functions.php




下载文件

文件名: extra_functions.php
文件类型: PHP文件
文件大小: 1.53 KiB
MD5: 1cb3ab7e6cd3c1f2126d720555b24ff5

extra_functions.php - 关闭高亮
  1. <?php
  2. /**
  3.  * Load in any user functions
  4.  * see  {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
  5.  *
  6.  * @package initSystem
  7.  * @copyright Copyright 2003-2012 Zen Cart Development Team
  8.  * @copyright Portions Copyright 2003 osCommerce
  9.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  10.  * @version GIT: $Id: Author: DrByte  Fri Jul 6 11:57:44 2012 -0400 Modified in v1.5.1 $
  11.  */
  12. // must be called appropriately
  13. if (!defined('IS_ADMIN_FLAG')) {
  14.   die('Illegal Access');
  15. }
  16. // set directories to check for function files
  17. $extra_functions_directory = DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'extra_functions/';
  18. $ws_extra_functions_directory = DIR_WS_FUNCTIONS . 'extra_functions/';
  19.  
  20. // Check for new functions in extra_functions directory
  21. $directory_array = array();
  22.  
  23. if ($dir = @dir($extra_functions_directory)) {
  24.   while ($file = $dir->read()) {
  25.     if (!is_dir($extra_functions_directory . $file)) {
  26.       if (preg_match('~^[^\._].*\.php$~i', $file) > 0) {
  27.         $directory_array[] = $file;
  28.       }
  29.     }
  30.   }
  31.   if (sizeof($directory_array)) {
  32.     sort($directory_array);
  33.   }
  34.   $dir->close();
  35. }
  36.  
  37. $file_cnt=0;
  38. for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) {
  39.   $file_cnt++;
  40.   $file = $directory_array[$i];
  41.  
  42.   //      echo 'LOADING: ' . $ws_extra_functions_directory . $file . ' ' . $file_cnt . '<br />';
  43.   if (file_exists($ws_extra_functions_directory . $file)) {
  44.     include($ws_extra_functions_directory . $file);
  45.   }
  46. }
  47.