Sfoglia il codice sorgente

Updated config constant names and locations.

Taddeus Kroes 14 anni fa
parent
commit
607f0cafd8
5 ha cambiato i file con 5 aggiunte e 75 eliminazioni
  1. 0 56
      pquery.config.php
  2. 2 2
      pquery.php
  3. 2 2
      pquery.sql.php
  4. 1 14
      test/config.php
  5. 0 1
      test/test_sql.php

+ 0 - 56
pquery.config.php

@@ -1,56 +0,0 @@
-<?php
-/**
- * Base and plugin config for pQuery utility framework.
- * 
- * @package pQuery
- */
-
-/**
- * Indicates whether the framework is in debug mode, which right
- * now only means that occuring errors will be displayed or not.
- * 
- * @var bool
- */
-define('DEBUG', true);
-
-/**
- * The root location of the pQuery framework folder, used for file
- * inclusions. The path is absolute and should end with a slash ('/').
- * 
- * @var string
- */
-define('PQUERY_ROOT', 'D:/xampp/htdocs/pquery/');
-
-/**
- * Abstract class containing plugin configs.
- */
-abstract class pQueryConfig {
-	/**
-	 * Indicates whether errors occuring in the framework will
-	 * terminate the script.
-	 * 
-	 * @var bool
-	 */
-	const ERROR_IS_FATAL = true;
-	
-	/**
-	 * Name of the utilities folder
-	 * 
-	 * @var string
-	 */
-	const UTILS_FOLDER = 'utils/';
-	
-	/**
-	 * Config for MySQL plugin.
-	 * 
-	 * @var array
-	 */
-	static $sql = array(
-		'host' => 'localhost',
-		'username' => 'root',
-		'password' => '',
-		'dbname' => 'tcms2'
-	);
-}
-
-?>

+ 2 - 2
pquery.php

@@ -112,7 +112,7 @@ class pQuery {
 	}
 	
 	/**
-	 * Display an error message if in {@link DEBUG} mode.
+	 * Display an error message if in debug mode.
 	 * 
 	 * The optional arguments are passed to {@link printf}, along with $error.
 	 * 
@@ -314,7 +314,7 @@ function _p($variable, $plugin=null) {
 		// Use custom plugin class
 		if( isset(pQuery::$plugins[$plugin]) )
 			$class_name = pQuery::$plugins[$plugin];
-		else if( DEBUG )
+		else if( PQUERY_DEBUG )
 			pQuery::error('Plugin "%s" does not exist.', $plugin);
 	}
 	

+ 2 - 2
pquery.sql.php

@@ -271,14 +271,14 @@ class pQuerySql extends pQuery implements pQueryExtension {
 	
 	/**
 	 * Extention of {@link pQuery::error}, returning FALSE (useful in result loops).
-	 * Also, the current query is printed in DEBUG mode.
+	 * Also, the current query is printed in debug mode.
 	 * 
 	 * @returns bool FALSE
 	 */
 	static function error() {
 		parent::error('MySQL error %d: %s.', mysql_errno(), mysql_error());
 		
-		if( DEBUG )
+		if( PQUERY_DEBUG )
 			echo $this->query;
 		
 		return false;

+ 1 - 14
test/config.php

@@ -11,7 +11,7 @@
  * 
  * @var bool
  */
-define('DEBUG', true);
+define('PQUERY_DEBUG', true);
 
 /**
  * The root location of the pQuery framework folder, used for file
@@ -21,17 +21,4 @@ define('DEBUG', true);
  */
 define('PQUERY_ROOT', 'D:/xampp/htdocs/pquery/');
 
-/**
- * Abstract class containing plugin configs.
- */
-abstract class pQueryConfig {
-	/**
-	 * Indicates whether errors occuring in the framework will
-	 * terminate the script.
-	 * 
-	 * @var bool
-	 */
-	const ERROR_IS_FATAL = true;
-}
-
 ?>

+ 0 - 1
test/test_sql.php

@@ -1,7 +1,6 @@
 <?php
 
 __p::load_plugin('sql');
-include '../../debug.php';
 
 class pQuerySqlTest extends UnitTestCase {
 	function __construct() {