Ver Fonte

Added SITE_ROOT constant for relative includes.

Taddeus Kroes há 14 anos atrás
pai
commit
65b55aee9b
2 ficheiros alterados com 3 adições e 7 exclusões
  1. 2 6
      pquery.php
  2. 1 1
      pquery.template.php

+ 2 - 6
pquery.php

@@ -276,18 +276,14 @@ class pQuery {
 	
 	/**
 	 * Assert that the given constants have been defined.
-	 * Add the prefix 'PQUERY_' to each constant name.
 	 */
 	static function assert_defined(/* $constant1 [ , $constant2, ... ] */) {
 		$constants = func_get_args();
 		$undefined = array();
 		
-		foreach( $constants as $constant ) {
-			$constant = 'PQUERY_'.$constant;
-			
+		foreach( $constants as $constant )
 			if( !defined($constant) )
 				$undefined[] = $constant;
-		}
 		
 		count($undefined) && self::error('The following constants have'
 			.' not been defined: %s', implode(', ', $undefined));
@@ -338,6 +334,6 @@ class_alias('pQuery', '__p');
  */
 set_exception_handler('__p::exception_handler');
 
-__p::assert_defined('DEBUG', 'ROOT');
+__p::assert_defined('PQUERY_DEBUG', 'PQUERY_ROOT', 'SITE_ROOT');
  
 ?>

+ 1 - 1
pquery.template.php

@@ -251,7 +251,7 @@ class pQueryTemplate extends pQuery {
 	 * @param bool $relative Indicates whether the path is relative to the document root.
 	 */
 	static function add_root($path, $relative=true) {
-		$relative && $path = PQUERY_ROOT.$path;
+		$relative && $path = SITE_ROOT.$path;
 		preg_match('%/$%', $path) || $path .= '/';
 		
 		if( !is_dir($path) )