فهرست منبع

Applied name change for util load fucntion.

Taddeus Kroes 14 سال پیش
والد
کامیت
7ddcaf4c37
4فایلهای تغییر یافته به همراه15 افزوده شده و 13 حذف شده
  1. 1 1
      pquery.css.php
  2. 1 1
      pquery.js.php
  3. 12 10
      pquery.php
  4. 1 1
      pquery.template.php

+ 1 - 1
pquery.css.php

@@ -6,7 +6,7 @@
  */
 
 __p::require_plugins('cache');
-__p::load_util('CssParser');
+__p::load_utils('CssParser');
 
 /**
  * @todo Documentation

+ 1 - 1
pquery.js.php

@@ -6,7 +6,7 @@
  */
 
 __p::require_plugins('cache');
-__p::load_util('jshrink');
+__p::load_utils('jshrink');
 
 /**
  * @todo Documentation

+ 12 - 10
pquery.php

@@ -147,19 +147,21 @@ class pQuery {
 	}
 	
 	/**
-	 * Try to load an utility file.
-	 * 
-	 * @param string $basename 
+	 * Try to load one or more utility files.
 	 */
-	static function load_util($basename) {
-		$path = PQUERY_ROOT.pQueryConfig::UTILS_FOLDER.$basename.'.php';
+	static function load_utils(/* $basename1 $basename2, ... */) {
+		$files = func_get_args();
 		
-		if( !file_exists($path) ) {
-			return self::error('Utility "%s" could not be loaded (looked in "%s").',
-				$basename, $path);
+		foreach( $files as $basename ) {
+			$path = PQUERY_ROOT.pQueryConfig::UTILS_FOLDER.$basename.'.php';
+			
+			if( !file_exists($path) ) {
+				return self::error('Utility "%s" could not be loaded (looked in "%s").',
+					$basename, $path);
+			}
+			
+			include_once $path;
 		}
-		
-		include_once $path;
 	}
 	
 	/**

+ 1 - 1
pquery.template.php

@@ -5,7 +5,7 @@
  * @package pQuery
  */
 
-__p::load_util('block');
+__p::load_utils('block');
 
 /**
  * @todo Documentation