Taddes Kroes 14 лет назад
Родитель
Сommit
17a0fe1b59
2 измененных файлов с 74 добавлено и 0 удалено
  1. 48 0
      config.php
  2. 26 0
      index.php

+ 48 - 0
config.php

@@ -0,0 +1,48 @@
+<?php
+/**
+ * Base and extention 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.
+ * 
+ * @var string
+ */
+define('PQUERY_ROOT', 'D:/xampp/htdocs/pquery/');
+
+/**
+ * Indicates whether errors occuring in the framework will
+ * terminate the script.
+ * 
+ * @var bool
+ */
+define('ERROR_IS_FATAL', true);
+
+/**
+ * Abstract class containing extention configs.
+ */
+abstract class Config {
+	/**
+	 * Config for MySQL extention.
+	 * 
+	 * @var array
+	 */
+	static $sql = array(
+		'host' => 'localhost',
+		'username' => 'root',
+		'password' => '',
+		'dbname' => 'tcms2'
+	);
+}
+
+?>

+ 26 - 0
index.php

@@ -0,0 +1,26 @@
+<?php
+
+include_once '../debug.php';
+include_once 'base.php';
+pQuery::require_plugins('array', 'sql');
+
+// Array test
+/*$a = _p(range(0, 10));
+
+while( !$a->is_empty() ) {
+	debug($a->pop(), $a->reverse()->pop());
+}*/
+
+
+
+echo '<br><br>';
+
+// SQL test
+$sql = _sql("select * from posts where slug = '[slug]'")
+		->set(array('slug' => 'contact'));
+$results = $sql->fetch_all('object');
+$results = _arr($results);
+
+debug($results);
+
+?>