diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9b7a3ca3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/nbproject/private/ +/nbproject/ +~ +~*.* diff --git a/ez_sql_help.htm b/_Documentation/ez_sql_help.htm similarity index 100% rename from ez_sql_help.htm rename to _Documentation/ez_sql_help.htm diff --git a/ez_sql_with_smarty.html b/_Documentation/ez_sql_with_smarty.html similarity index 100% rename from ez_sql_with_smarty.html rename to _Documentation/ez_sql_with_smarty.html diff --git a/_Documentation/phpDocumentator/blank.html b/_Documentation/phpDocumentator/blank.html new file mode 100644 index 00000000..926bb3ea --- /dev/null +++ b/_Documentation/phpDocumentator/blank.html @@ -0,0 +1,13 @@ + + + ezSQL + + + + +

ezSQL

+Welcome to default!
+
+This documentation was generated by phpDocumentor v1.4.4
+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/classtrees_default.html b/_Documentation/phpDocumentator/classtrees_default.html new file mode 100644 index 00000000..c0edc1ca --- /dev/null +++ b/_Documentation/phpDocumentator/classtrees_default.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + +

+ +

+

Root class ezSQLcore

+ + +

Root class ezSQLcore

+ + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/classtrees_ezSQL.html b/_Documentation/phpDocumentator/classtrees_ezSQL.html new file mode 100644 index 00000000..0d989a16 --- /dev/null +++ b/_Documentation/phpDocumentator/classtrees_ezSQL.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + +

+ +

+

Root class ezSQLcore

+ + +

Root class ezSQL_recordset

+ + +

Root class PHPUnit_Framework_TestCase

+ + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---codeigniter---ezSQL_codeigniterTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---codeigniter---ezSQL_codeigniterTest.php.html new file mode 100644 index 00000000..d41dd2bd --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---codeigniter---ezSQL_codeigniterTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_codeigniterTest.php + + + + +
+

/_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_codeigniterTest + + Test class for ezSQL_codeigniter. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../codeigniter/Ezsql_codeigniter.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Fri, 06 Apr 2012 16:20:00 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html new file mode 100644 index 00000000..e11fb9f4 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_mssqlTest.php + + + + +
+

/_Test/unit_tests/mssql/ezSQL_mssqlTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_mssqlTest + + Test class for ezSQL_mssql. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../mssql/ez_sql_mssql.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Fri, 06 Apr 2012 14:16:58 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html new file mode 100644 index 00000000..9ba99c28 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_oracle8_9Test.php + + + + +
+

/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_oracle8_9Test + + Test class for ezSQL_oracle8_9. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../oracle8_9/ez_sql_oracle8_9.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Fri, 06 Apr 2012 16:20:01 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---shared---ezSQLcoreTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---shared---ezSQLcoreTest.php.html new file mode 100644 index 00000000..c1a261d7 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---shared---ezSQLcoreTest.php.html @@ -0,0 +1,87 @@ + + + + + + Docs for page ezSQLcoreTest.php + + + + +
+

/_Test/unit_tests/shared/ezSQLcoreTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQLcoreTest + + Test class for ezSQLcore. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Fri, 06 Apr 2012 14:13:42 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---sqlite---ezSQL_sqliteTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---sqlite---ezSQL_sqliteTest.php.html new file mode 100644 index 00000000..f40909a3 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---sqlite---ezSQL_sqliteTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_sqliteTest.php + + + + +
+

/_Test/unit_tests/sqlite/ezSQL_sqliteTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_sqliteTest + + Test class for ezSQL_sqlite. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../sqlite/ez_sql_sqlite.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Fri, 06 Apr 2012 10:51:40 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html b/_Documentation/phpDocumentator/default/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html new file mode 100644 index 00000000..bc9eaf91 --- /dev/null +++ b/_Documentation/phpDocumentator/default/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_sybaseTest.php + + + + +
+

/_Test/unit_tests/sybase/ezSQL_sybaseTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_sybaseTest + + Test class for ezSQL_sybase. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../sybase/ez_sql_sybase.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Fri, 06 Apr 2012 16:20:02 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html b/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html new file mode 100644 index 00000000..086c2b27 --- /dev/null +++ b/_Documentation/phpDocumentator/default/_mysql---disk_cache_example.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page disk_cache_example.php + + + + +
+

/mysql/disk_cache_example.php

+ + +
+
Description
+ +
+ + +
+
+ + + +
+
Includes
+ +
+ +
+ +
+ + include_once + ("ez_sql_mysql.php") + (line 8) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html b/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html new file mode 100644 index 00000000..50f30e59 --- /dev/null +++ b/_Documentation/phpDocumentator/default/_oracle8_9---disk_cache_example.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page disk_cache_example.php + + + + +
+

/oracle8_9/disk_cache_example.php

+ + +
+
Description
+ +
+ + +
+
+ + + +
+
Includes
+ +
+ +
+ +
+ + include_once + ("ez_sql_oracle8_9.php") + (line 10) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html new file mode 100644 index 00000000..b6eb5ec7 --- /dev/null +++ b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_2.1_debughack_0.2alpha.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page ez_sql_core_2.1_debughack_0.2alpha.php + + + + +
+

/shared/ez_sql_core_2.1_debughack_0.2alpha.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ + + ******************************************************************** +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html new file mode 100644 index 00000000..81cb9dea --- /dev/null +++ b/_Documentation/phpDocumentator/default/_shared---ez_sql_core_202console.php.html @@ -0,0 +1,60 @@ + + + + + + Docs for page ez_sql_core_202console.php + + + + +
+

/shared/ez_sql_core_202console.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQLcore + + ******************************************************************** +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_codeigniterTest.html b/_Documentation/phpDocumentator/default/ezSQL_codeigniterTest.html new file mode 100644 index 00000000..448b9a85 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_codeigniterTest.html @@ -0,0 +1,255 @@ + + + + + + Docs For Class ezSQL_codeigniterTest + + + + +
+

Class ezSQL_codeigniterTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_codeigniter.

+

Generated by PHPUnit on 2012-04-02 at 00:25:20.

+

+ Located in /_Test/unit_tests/codeigniter/ezSQL_codeigniterTest.php (line 10) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_codeigniterTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+ +
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testEscape + () +
+
+ void + testQuery + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_codeigniter + $object + (line 15) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 21) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 29) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testEscape (line 48) +
+ + +
    +
  • todo: Implement testEscape().
  • +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testQuery (line 37) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Fri, 06 Apr 2012 16:20:00 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_mssqlTest.html b/_Documentation/phpDocumentator/default/ezSQL_mssqlTest.html new file mode 100644 index 00000000..8e58b6bb --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_mssqlTest.html @@ -0,0 +1,458 @@ + + + + + + Docs For Class ezSQL_mssqlTest + + + + +
+

Class ezSQL_mssqlTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_mssql.

+

Generated by PHPUnit on 2012-04-02 at 00:23:05.

+

+ Located in /_Test/unit_tests/mssql/ezSQL_mssqlTest.php (line 10) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_mssqlTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testConvertMySqlToMSSql + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetDBHost + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_mssql + $object + (line 15) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 21) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 29) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 48) +
+ + +
    +
  • todo: Implement testConnect().
  • +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testConvertMySqlToMSSql (line 103) +
+ + +
    +
  • todo: Implement testConvertMySqlToMSSql().
  • +
  • access: public
  • +
+ +
+ void + + testConvertMySqlToMSSql + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 114) +
+ + +
    +
  • todo: Implement testDisconnect().
  • +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 70) +
+ + +
    +
  • todo: Implement testEscape().
  • +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetDBHost (line 125) +
+ + +
    +
  • todo: Implement testGetDBHost().
  • +
  • access: public
  • +
+ +
+ void + + testGetDBHost + + () +
+ + + +
+ +
+ +
+ testQuery (line 92) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 37) +
+ + +
    +
  • todo: Implement testQuick_connect().
  • +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 59) +
+ + +
    +
  • todo: Implement testSelect().
  • +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 81) +
+ + +
    +
  • todo: Implement testSysdate().
  • +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Fri, 06 Apr 2012 14:16:58 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_oracle8_9Test.html b/_Documentation/phpDocumentator/default/ezSQL_oracle8_9Test.html new file mode 100644 index 00000000..3ce0b4f6 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_oracle8_9Test.html @@ -0,0 +1,545 @@ + + + + + + Docs For Class ezSQL_oracle8_9Test + + + + +
+

Class ezSQL_oracle8_9Test

+ + +
+
Description
+ +
+ +

Test class for ezSQL_oracle8_9.

+

Generated by PHPUnit on 2012-04-02 at 00:24:07.

+

+ Located in /_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php (line 10) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_oracle8_9Test
+ +
+
+ + + + +
+
Variable Summary
+ +
+ +
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetDBName + () +
+
+ void + testInsert_id + () +
+
+ void + testIs_equal_int + () +
+
+ void + testIs_equal_str + () +
+
+ void + testNextVal + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_oracle8_9 + $object + (line 15) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 21) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 29) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 37) +
+ + +
    +
  • todo: Implement testConnect().
  • +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 147) +
+ + +
    +
  • todo: Implement testDisconnect().
  • +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 70) +
+ + +
    +
  • todo: Implement testEscape().
  • +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetDBName (line 158) +
+ + +
    +
  • todo: Implement testGetDBName().
  • +
  • access: public
  • +
+ +
+ void + + testGetDBName + + () +
+ + + +
+ +
+ +
+ testInsert_id (line 114) +
+ + +
    +
  • todo: Implement testInsert_id().
  • +
  • access: public
  • +
+ +
+ void + + testInsert_id + + () +
+ + + +
+ +
+ +
+ testIs_equal_int (line 103) +
+ + +
    +
  • todo: Implement testIs_equal_int().
  • +
  • access: public
  • +
+ +
+ void + + testIs_equal_int + + () +
+ + + +
+ +
+ +
+ testIs_equal_str (line 92) +
+ + +
    +
  • todo: Implement testIs_equal_str().
  • +
  • access: public
  • +
+ +
+ void + + testIs_equal_str + + () +
+ + + +
+ +
+ +
+ testNextVal (line 125) +
+ + +
    +
  • todo: Implement testNextVal().
  • +
  • access: public
  • +
+ +
+ void + + testNextVal + + () +
+ + + +
+ +
+ +
+ testQuery (line 136) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 48) +
+ + +
    +
  • todo: Implement testQuick_connect().
  • +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 59) +
+ + +
    +
  • todo: Implement testSelect().
  • +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 81) +
+ + +
    +
  • todo: Implement testSysdate().
  • +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Fri, 06 Apr 2012 16:20:01 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_sqliteTest.html b/_Documentation/phpDocumentator/default/ezSQL_sqliteTest.html new file mode 100644 index 00000000..55ccada9 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_sqliteTest.html @@ -0,0 +1,400 @@ + + + + + + Docs For Class ezSQL_sqliteTest + + + + +
+

Class ezSQL_sqliteTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_sqlite.

+

Generated by PHPUnit on 2012-04-02 at 00:23:35.

+

+ Located in /_Test/unit_tests/sqlite/ezSQL_sqliteTest.php (line 10) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_sqliteTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_sqlite + $object + (line 15) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 21) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 29) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 37) +
+ + +
    +
  • todo: Implement testConnect().
  • +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 103) +
+ + +
    +
  • todo: Implement testDisconnect().
  • +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 70) +
+ + +
    +
  • todo: Implement testEscape().
  • +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testQuery (line 92) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 48) +
+ + +
    +
  • todo: Implement testQuick_connect().
  • +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 59) +
+ + +
    +
  • todo: Implement testSelect().
  • +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 81) +
+ + +
    +
  • todo: Implement testSysdate().
  • +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Fri, 06 Apr 2012 10:51:40 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQL_sybaseTest.html b/_Documentation/phpDocumentator/default/ezSQL_sybaseTest.html new file mode 100644 index 00000000..a5903430 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQL_sybaseTest.html @@ -0,0 +1,458 @@ + + + + + + Docs For Class ezSQL_sybaseTest + + + + +
+

Class ezSQL_sybaseTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_sybase.

+

Generated by PHPUnit on 2012-04-02 at 00:23:50.

+

+ Located in /_Test/unit_tests/sybase/ezSQL_sybaseTest.php (line 10) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_sybaseTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testConvertMySqlTosybase + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetDBHost + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_sybase + $object + (line 15) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 21) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 29) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 48) +
+ + +
    +
  • todo: Implement testConnect().
  • +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testConvertMySqlTosybase (line 103) +
+ + +
    +
  • todo: Implement testConvertMySqlTosybase().
  • +
  • access: public
  • +
+ +
+ void + + testConvertMySqlTosybase + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 114) +
+ + +
    +
  • todo: Implement testDisconnect().
  • +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 70) +
+ + +
    +
  • todo: Implement testEscape().
  • +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetDBHost (line 125) +
+ + +
    +
  • todo: Implement testGetDBHost().
  • +
  • access: public
  • +
+ +
+ void + + testGetDBHost + + () +
+ + + +
+ +
+ +
+ testQuery (line 92) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 37) +
+ + +
    +
  • todo: Implement testQuick_connect().
  • +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 59) +
+ + +
    +
  • todo: Implement testSelect().
  • +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 81) +
+ + +
    +
  • todo: Implement testSysdate().
  • +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Fri, 06 Apr 2012 16:20:02 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQLcore.html b/_Documentation/phpDocumentator/default/ezSQLcore.html new file mode 100644 index 00000000..94352687 --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQLcore.html @@ -0,0 +1,1105 @@ + + + + + + Docs For Class ezSQLcore + + + + +
+

Class ezSQLcore

+ + +
+
Description
+ +
+ +

********************************************************************

+

Core class containg common functions to manipulate query result sets once returned

+

+ Located in /shared/ez_sql_core_202console.php (line 45) +

+ + +

+	
+			
+
+ + + + +
+
Variable Summary
+ +
+
+
+ mixed + $cache_dir +
+
+ mixed + $cache_inserts +
+
+ mixed + $cache_queries +
+
+ mixed + $cache_timeout +
+
+ mixed + $captured_errors +
+
+ mixed + $col_info +
+
+ mixed + $debug_all +
+
+ mixed + $debug_called +
+
+ mixed + $debug_echo +
+
+ mixed + $last_error +
+
+ mixed + $last_query +
+
+ mixed + $num_queries +
+
+ mixed + $show_errors +
+
+ mixed + $trace +
+
+ mixed + $use_disk_cache +
+
+ mixed + $vardump_called +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQLcore + ezSQLcore + () +
+
+ void + connect + () +
+
+ void + debug + ( $debug_echo) +
+
+ void + donation + () +
+
+ void + dumpvar + ( $mixed) +
+
+ void + escape + () +
+
+ void + flush + () +
+
+ void + get_cache + ( $query) +
+
+ void + get_col + ([ $query = null], [ $x = 0]) +
+
+ void + get_col_info + ([ $info_type = "name"], [ $col_offset = -1]) +
+
+ void + get_results + ([ $query = null], [ $output = OBJECT]) +
+
+ void + get_row + ([ $query = null], [ $output = OBJECT], [ $y = 0]) +
+
+ void + get_var + ([ $query = null], [ $x = 0], [ $y = 0]) +
+
+ void + hide_errors + () +
+
+ void + query + () +
+
+ void + register_error + ( $err_str) +
+
+ void + select + () +
+
+ void + show_errors + () +
+
+ void + store_cache + ( $query,  $is_insert) +
+
+ void + sysdate + () +
+
+ void + vardump + ([ $mixed = '']) +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + mixed + $cache_dir + = false (line 60) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $cache_inserts + = false (line 62) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $cache_queries + = false (line 61) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $cache_timeout + = 24 (line 64) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $captured_errors + = array() (line 59) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $col_info + = null (line 58) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $debug_all + = false (line 49) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $debug_called + = false (line 52) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $debug_echo + = true (line 51) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $last_error + = null (line 57) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $last_query + = null (line 56) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $num_queries + = 0 (line 55) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $show_errors + = true (line 54) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $trace + = false (line 48) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $use_disk_cache + = false (line 63) + +
+ + + + + + + +
+ +
+ +
+ + mixed + $vardump_called + = false (line 53) + +
+ + + + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor ezSQLcore (line 70) +
+ + +

********************************************************************

+

Constructor

+ +
+ ezSQLcore + + ezSQLcore + + () +
+ + + +
+ +
+ +
+ connect (line 78) +
+ + +

********************************************************************

+

Connect to DB - over-ridden by specific DB class

+ +
+ void + + connect + + () +
+ + + +
+ +
+ +
+ debug (line 460) +
+ + +

******************************************************************** Displays the last query string that was sent to the database & a table listing results (if there were any).

+

(abstracted into a seperate file to save server overhead).

+ +
+ void + + debug + + ( $debug_echo) +
+ +
    +
  • + + $debug_echo
  • +
+ + +
+ +
+ +
+ donation (line 556) +
+ + +

********************************************************************

+

Naughty little function to ask for some remuniration!

+ +
+ void + + donation + + () +
+ + + +
+ +
+ +
+ dumpvar (line 444) +
+ + +

********************************************************************

+

Alias for the above function

+ +
+ void + + dumpvar + + ( $mixed) +
+ +
    +
  • + + $mixed
  • +
+ + +
+ +
+ +
+ escape (line 106) +
+ + +

********************************************************************

+

Format a string correctly for safe insert - over-ridden by specific DB class

+ +
+ void + + escape + + () +
+ + + +
+ +
+ +
+ flush (line 156) +
+ + +

********************************************************************

+

Kill cached query results

+ +
+ void + + flush + + () +
+ + + +
+ +
+ +
+ get_cache (line 370) +
+ + +

********************************************************************

+

get_cache

+ +
+ void + + get_cache + + ( $query) +
+ +
    +
  • + + $query
  • +
+ + +
+ +
+ +
+ get_col (line 235) +
+ + +

********************************************************************

+

Function to get 1 column from the cached result set based in X index see docs for usage and info

+ +
+ void + + get_col + + ([ $query = null], [ $x = 0]) +
+ +
    +
  • + + $query
  • +
  • + + $x
  • +
+ + +
+ +
+ +
+ get_col_info (line 308) +
+ + +

********************************************************************

+

Function to get column meta data info pertaining to the last query see docs for more info and usage

+ +
+ void + + get_col_info + + ([ $info_type = "name"], [ $col_offset = -1]) +
+ +
    +
  • + + $info_type
  • +
  • + + $col_offset
  • +
+ + +
+ +
+ +
+ get_results (line 258) +
+ + +

********************************************************************

+

Return the the query as a result set - see docs for more details

+ +
+ void + + get_results + + ([ $query = null], [ $output = OBJECT]) +
+ +
    +
  • + + $query
  • +
  • + + $output
  • +
+ + +
+ +
+ +
+ get_row (line 195) +
+ + +

********************************************************************

+

Get one row from the DB - see docs for more detail

+ +
+ void + + get_row + + ([ $query = null], [ $output = OBJECT], [ $y = 0]) +
+ +
    +
  • + + $query
  • +
  • + + $output
  • +
  • + + $y
  • +
+ + +
+ +
+ +
+ get_var (line 169) +
+ + +

********************************************************************

+

Get one variable from the DB - see docs for more detail

+ +
+ void + + get_var + + ([ $query = null], [ $x = 0], [ $y = 0]) +
+ +
    +
  • + + $query
  • +
  • + + $x
  • +
  • + + $y
  • +
+ + +
+ +
+ +
+ hide_errors (line 147) +
+ + + +
+ void + + hide_errors + + () +
+ + + +
+ +
+ +
+ query (line 96) +
+ + +

********************************************************************

+

Basic Query - over-ridden by specific DB class

+ +
+ void + + query + + () +
+ + + +
+ +
+ +
+ register_error (line 125) +
+ + +

********************************************************************

+

Print SQL/DB error - over-ridden by specific DB class

+ +
+ void + + register_error + + ( $err_str) +
+ +
    +
  • + + $err_str
  • +
+ + +
+ +
+ +
+ select (line 87) +
+ + +

********************************************************************

+

Select DB - over-ridden by specific DB class

+ +
+ void + + select + + () +
+ + + +
+ +
+ +
+ show_errors (line 142) +
+ + +

******************************************************************** Turn error handling on or off..

+ +
+ void + + show_errors + + () +
+ + + +
+ +
+ +
+ store_cache (line 336) +
+ + +

********************************************************************

+

store_cache

+ +
+ void + + store_cache + + ( $query,  $is_insert) +
+ +
    +
  • + + $query
  • +
  • + + $is_insert
  • +
+ + +
+ +
+ +
+ sysdate (line 116) +
+ + +

********************************************************************

+

Return database specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+ +
+ void + + sysdate + + () +
+ + + +
+ +
+ +
+ vardump (line 413) +
+ + +

********************************************************************

+

Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, Var or Array

+ +
+ void + + vardump + + ([ $mixed = '']) +
+ +
    +
  • + + $mixed
  • +
+ + +
+ +
+
+ + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/default/ezSQLcoreTest.html b/_Documentation/phpDocumentator/default/ezSQLcoreTest.html new file mode 100644 index 00000000..6c1ac4bf --- /dev/null +++ b/_Documentation/phpDocumentator/default/ezSQLcoreTest.html @@ -0,0 +1,731 @@ + + + + + + Docs For Class ezSQLcoreTest + + + + +
+

Class ezSQLcoreTest

+ + +
+
Description
+ +
+ +

Test class for ezSQLcore.

+

Generated by PHPUnit on 2012-04-02 at 00:15:51.

+

+ Located in /_Test/unit_tests/shared/ezSQLcoreTest.php (line 9) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQLcoreTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testDebug + () +
+
+ void + testDonation + () +
+
+ void + testDumpvar + () +
+
+ void + testFlush + () +
+
+ void + testGet_cache + () +
+
+ void + testGet_col + () +
+
+ void + testGet_col_info + () +
+
+ void + testGet_results + () +
+
+ void + testGet_row + () +
+
+ void + testGet_var + () +
+
+ void + testHide_errors + () +
+
+ void + testRegister_error + () +
+
+ void + testShow_errors + () +
+
+ void + testStore_cache + () +
+
+ void + testTimer_elapsed + () +
+
+ void + testTimer_get_cur + () +
+
+ void + testTimer_start + () +
+
+ void + testTimer_update_global + () +
+
+ void + testVardump + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQLcore + $object + (line 14) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 20) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 28) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testDebug (line 153) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testDebug + + () +
+ + + +
+ +
+ +
+ testDonation (line 163) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testDonation + + () +
+ + + +
+ +
+ +
+ testDumpvar (line 146) +
+ + +

The test echos HTML, it is just a test, that is still running

+
    +
  • access: public
  • +
+ +
+ void + + testDumpvar + + () +
+ + + +
+ +
+ +
+ testFlush (line 68) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testFlush + + () +
+ + + +
+ +
+ +
+ testGet_cache (line 126) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_cache + + () +
+ + + +
+ +
+ +
+ testGet_col (line 94) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_col + + () +
+ + + +
+ +
+ +
+ testGet_col_info (line 108) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_col_info + + () +
+ + + +
+ +
+ +
+ testGet_results (line 101) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_results + + () +
+ + + +
+ +
+ +
+ testGet_row (line 87) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_row + + () +
+ + + +
+ +
+ +
+ testGet_var (line 80) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_var + + () +
+ + + +
+ +
+ +
+ testHide_errors (line 59) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testHide_errors + + () +
+ + + +
+ +
+ +
+ testRegister_error (line 35) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testRegister_error + + () +
+ + + +
+ +
+ +
+ testShow_errors (line 46) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testShow_errors + + () +
+ + + +
+ +
+ +
+ testStore_cache (line 115) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testStore_cache + + () +
+ + + +
+ +
+ +
+ testTimer_elapsed (line 188) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_elapsed + + () +
+ + + +
+ +
+ +
+ testTimer_get_cur (line 170) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_get_cur + + () +
+ + + +
+ +
+ +
+ testTimer_start (line 181) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_start + + () +
+ + + +
+ +
+ +
+ testTimer_update_global (line 199) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_update_global + + () +
+ + + +
+ +
+ +
+ testVardump (line 138) +
+ + +

The test echos HTML, it is just a test, that is still running

+
    +
  • access: public
  • +
+ +
+ void + + testVardump + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Fri, 06 Apr 2012 14:13:42 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/elementindex.html b/_Documentation/phpDocumentator/elementindex.html new file mode 100644 index 00000000..c2bbb4df --- /dev/null +++ b/_Documentation/phpDocumentator/elementindex.html @@ -0,0 +1,2724 @@ + + + + + + + + + + + +

Full index

+

Package indexes

+ +
+
+ a + c + d + e + f + g + h + i + k + l + n + o + p + q + r + s + t + u + v + _ +
+ + +
+
a
+
top
+
+
+
+
+ $affectedRows +
+
+ +
Contains the number of affected rows of a query
+
+
+ affectedRows +
+
+ +
Returns the affected rows of a query
+
+
+ ARRAY_A +
+
+ +
Constant boolean
+
+
+ ARRAY_N +
+
+ +
Constant boolean
+
+
+ +
+
c
+
top
+
+
+
+
+ $cache_dir +
+
+ +
Using the cache directory
+
+
+ $cache_dir +
+
+
ezSQLcore::$cache_dir in ez_sql_core_202console.php
+
+
+ $cache_inserts +
+
+ +
Insert queries into the cache
+
+
+ $cache_inserts +
+
+
ezSQLcore::$cache_inserts in ez_sql_core_202console.php
+
+
+ $cache_queries +
+
+ +
Caching queries
+
+
+ $cache_queries +
+
+
ezSQLcore::$cache_queries in ez_sql_core_202console.php
+
+
+ $cache_timeout +
+
+ +
The cache timeout in hours
+
+
+ $cache_timeout +
+
+
ezSQLcore::$cache_timeout in ez_sql_core_202console.php
+
+
+ $captured_errors +
+
+ +
Captured errors
+
+
+ $captured_errors +
+
+
ezSQLcore::$captured_errors in ez_sql_core_202console.php
+
+
+ $col_info +
+
+ +
The last column info
+
+
+ $col_info +
+
+
ezSQLcore::$col_info in ez_sql_core_202console.php
+
+
+ $connected +
+
+ +
Whether the database connection is established, or not
+
+
+ catch_error +
+
+ +
Hooks into PDO error system and reports it to user
+
+
+ connect +
+
+
ezSQL_mysql::connect() in ezSQL_mysql
+
Try to connect to mySQL database server
+
+
+ connect +
+
+
ezSQL_mssql::connect() in ezSQL_mssql
+
Try to connect to mssql database server
+
+
+ connect +
+
+
ezSQLcore::connect() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ connect +
+
+
ezSQL_oracle8_9::connect() in ezSQL_oracle8_9
+
Try to connect to Oracle database server
+
+
+ connect +
+
+ +
Try to connect to the database server in the DSN parameters
+
+
+ connect +
+
+
ezSQL_postgresql::connect() in ezSQL_postgresql
+
Try to connect to PostgreSQL database server
+
+
+ connect +
+
+
ezSQL_sybase::connect() in ezSQL_sybase
+
Try to connect to sybase database server
+
+
+ ConvertMySqlToMSSql +
+
+ +
Convert a Query From MySql Syntax to MS-Sql syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - + the character is removed.
+
+
+ ConvertMySqlTosybase +
+
+ +
Convert a Query From MySql Syntax to Sybase syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - the + character is removed.
+
+
+ current +
+
+
ezSQL_recordset::current() in ezSQL_recordset
+
Returns the current row of the recordset as stdClass, which is the default mode, or as array as fieldname - fieldvalue.
+
+
+ +
+
d
+
top
+
+
+
+
+ $dbh +
+
+ +
The database connection object
+
+
+ $db_connect_time +
+
+ +
The time it took to establish a connection
+
+
+ $debug +
+
+
ezSQL_codeigniter::$debug in ezSQL_codeigniter
+
Run in debug mode
+
+
+ $debug_all +
+
+ +
same as $trace
+
+
+ $debug_all +
+
+
ezSQLcore::$debug_all in ez_sql_core_202console.php
+
+
+ $debug_called +
+
+ +
Debug is called
+
+
+ $debug_called +
+
+
ezSQLcore::$debug_called in ez_sql_core_202console.php
+
+
+ $debug_echo +
+
+
ezSQLcore::$debug_echo in ez_sql_core_202console.php
+
+
+ $debug_echo_is_on +
+
+ +
== TJH == default now needed for echo of debug function
+
+
+ $do_profile +
+
+ +
Using profiling
+
+
+ debug +
+
+ +
Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ debug +
+
+
ezSQLcore::debug() in ez_sql_core_202console.php
+
******************************************************************** Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ descTable +
+
+
ezSQL_postgresql::descTable() in ezSQL_postgresql
+
Return the description of the given table
+
+
+ disconnect +
+
+
ezSQL_postgresql::disconnect() in ezSQL_postgresql
+
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ donation +
+
+
ezSQLcore::donation() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ donation +
+
+ +
Naughty little function to ask for some remuniration!
+
+
+ dumpvar +
+
+
ezSQLcore::dumpvar() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ dumpvar +
+
+ +
An alias for vardump method
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ +
+
e
+
top
+
+
+
+
+ $ezSQL +
+
+
ezSQL_recordsetTest::$ezSQL in ezSQL_recordsetTest.php
+
ezSQL connection
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
+
+ escape +
+
+
ezSQL_oracle8_9::escape() in ezSQL_oracle8_9
+
Format a Oracle string correctly for safe Oracle insert
+
+
+ escape +
+
+
ezSQL_mysql::escape() in ezSQL_mysql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_postgresql::escape() in ezSQL_postgresql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_sybase::escape() in ezSQL_sybase
+
Format a sybase string correctly for safe sybase insert
+
+
+ escape +
+
+
ezSQL_mssql::escape() in ezSQL_mssql
+
Format a mssql string correctly for safe mssql insert
+
+
+ escape +
+
+
ezSQLcore::escape() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ escape +
+
+
ezSQL_pdo::escape() in ezSQL_pdo
+
Escape a string with the PDO method
+
+
+ escape +
+
+
ezSQL_codeigniter::escape() in ezSQL_codeigniter
+
Format a sql string correctly for safe insert
+
+
+ ezSQLcore +
+
+
ezSQLcore in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore::ezSQLcore() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore in ezSQL
+
ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).
+
+
+ ezSQLcoreTest +
+
+
ezSQLcoreTest in ezSQLcoreTest.php
+
Test class for ezSQLcore.
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_fetch_assoc +
+
+ +
Behaves like mysql_fetch_assoc. This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_assoc.
+
+
+ ezSQL_fetch_object +
+
+ +
Behaves like mysql_fetch_object This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_object.
+
+
+ ezSQL_fetch_row +
+
+ +
Behaves like mysql_fetch_row This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_row.
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.
+
+
+ ezSQL_mssqlTest +
+
+
ezSQL_mssqlTest in ezSQL_mssqlTest.php
+
Test class for ezSQL_mssql.
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_mysqlTest +
+
+
ezSQL_mysqlTest in ezSQL_mysqlTest.php
+
Test class for ezSQL_mysql.
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_oracle8_9Test +
+
+
ezSQL_oracle8_9Test in ezSQL_oracle8_9Test.php
+
Test class for ezSQL_oracle8_9.
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_pdoTest +
+
+
ezSQL_pdoTest in ezSQL_pdoTest.php
+
Test class for ezSQL_pdo.
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_postgresqlTest +
+
+
ezSQL_postgresqlTest in ezSQL_postgresqlTest.php
+
Test class for ezSQL_postgresql.
+
+
+ ezSQL_recordset +
+
+
ezSQL_recordset in ezSQL_recordset
+
ezSQL Database specific class for working with query results Desc..: recordset component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_recordsetTest +
+
+
ezSQL_recordsetTest in ezSQL_recordsetTest.php
+
Test class for ezSQL_recordset.
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.
+
+
+ ezSQL_sybaseTest +
+
+
ezSQL_sybaseTest in ezSQL_sybaseTest.php
+
Test class for ezSQL_sybase.
+
+
+ EZSQL_VERSION +
+
+ +
Constant string ezSQL version information
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
+
+ ezSQL +
+
+
ezSQL in ezSQL
+
+
+ ez_sql_core_2.1_debughack_0.2alpha.php +
+
+
ez_sql_core_2.1_debughack_0.2alpha.php in ez_sql_core_2.1_debughack_0.2alpha.php
+
+
+ ez_sql_core_202console.php +
+
+
ez_sql_core_202console.php in ez_sql_core_202console.php
+
+
+ ezSQL_recordset +
+
+
ezSQL_recordset in ezSQL_recordset
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
+
+ ezSQL_mssqlTest.php +
+
+
ezSQL_mssqlTest.php in ezSQL_mssqlTest.php
+
+
+ ezSQL_mysqlTest.php +
+
+
ezSQL_mysqlTest.php in ezSQL_mysqlTest.php
+
+
+ ezSQL_oracle8_9Test.php +
+
+
ezSQL_oracle8_9Test.php in ezSQL_oracle8_9Test.php
+
+
+ ezSQL_pdoTest.php +
+
+
ezSQL_pdoTest.php in ezSQL_pdoTest.php
+
+
+ ezSQL_postgresqlTest.php +
+
+
ezSQL_postgresqlTest.php in ezSQL_postgresqlTest.php
+
+
+ ezSQLcoreTest.php +
+
+
ezSQLcoreTest.php in ezSQLcoreTest.php
+
+
+ ezSQL_recordsetTest.php +
+
+
ezSQL_recordsetTest.php in ezSQL_recordsetTest.php
+
+
+ ezSQL_sybaseTest.php +
+
+
ezSQL_sybaseTest.php in ezSQL_sybaseTest.php
+
+
+ +
+
f
+
top
+
+
+
+
+ $from_disk_cache +
+
+ +
Get data from disk cache
+
+
+ flush +
+
+
ezSQLcore::flush() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ flush +
+
+ +
Kill cached query results
+
+
+ +
+
g
+
top
+
+
+
+
+ getCharset +
+
+ +
Returns the current connection charset
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+
ezSQL_postgresql::getDBHost() in ezSQL_postgresql
+
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBName +
+
+
ezSQL_oracle8_9::getDBName() in ezSQL_oracle8_9
+
Returns the current database name
+
+
+ getInsertId +
+
+ +
Returns the last inserted autoincrement
+
+
+ getPort +
+
+
ezSQL_postgresql::getPort() in ezSQL_postgresql
+
Returns the current TCP/IP port
+
+
+ getShowErrors +
+
+ +
Returns the current show error state
+
+
+ get_cache +
+
+ +
Get the query cache of a query
+
+
+ get_cache +
+
+
ezSQLcore::get_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col +
+
+
ezSQLcore::get_col() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col +
+
+ +
Function to get 1 column from the cached result set based in X index see docs for usage and info
+
+
+ get_col_info +
+
+
ezSQLcore::get_col_info() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col_info +
+
+ +
Function to get column meta data info pertaining to the last query See docs for more info and usage
+
+
+ get_results +
+
+ +
Return the the query as a result set - see docs for more details
+
+
+ get_results +
+
+
ezSQLcore::get_results() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_row +
+
+
ezSQLcore::get_row() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_row +
+
+ +
Get one row from the DB - see docs for more detail
+
+
+ get_set +
+
+ +
Creates a SET nvp sql string from an associative array (and escapes all values)
+
+
+ get_var +
+
+
ezSQLcore::get_var() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_var +
+
+ +
Get one variable from the DB - see docs for more detail
+
+
+ +
+
h
+
top
+
+
+
+
+ hide_errors +
+
+
ezSQLcore::hide_errors() in ez_sql_core_202console.php
+
+
+ hide_errors +
+
+ +
Turn error handling off
+
+
+ +
+
i
+
top
+
+
+
+
+ insert_id +
+
+
ezSQL_oracle8_9::insert_id() in ezSQL_oracle8_9
+
Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.
+
+
+ isConnected +
+
+ +
Returns, whether a database connection is established, or not
+
+
+ is_equal_int +
+
+ +
Returns an equal string for integer values
+
+
+ is_equal_str +
+
+ +
Returns an escaped equal string
+
+
+ +
+
k
+
top
+
+
+
+
+ key +
+
+
ezSQL_recordset::key() in ezSQL_recordset
+
Returns the current position in the recordset
+
+
+ +
+
l
+
top
+
+
+
+
+ $last_error +
+
+
ezSQLcore::$last_error in ez_sql_core_202console.php
+
+
+ $last_error +
+
+ +
The last error object
+
+
+ $last_query +
+
+ +
The last query object
+
+
+ $last_query +
+
+
ezSQLcore::$last_query in ez_sql_core_202console.php
+
+
+ $last_result +
+
+ +
The last query result
+
+
+ +
+
n
+
top
+
+
+
+
+ $num_queries +
+
+
ezSQLcore::$num_queries in ez_sql_core_202console.php
+
+
+ $num_queries +
+
+ +
Number of queries
+
+
+ next +
+
+
ezSQL_recordset::next() in ezSQL_recordset
+
Sets the position of the recordset up by one
+
+
+ nextVal +
+
+
ezSQL_oracle8_9::nextVal() in ezSQL_oracle8_9
+
An alias for insert_id using the original Oracle function name.
+
+
+ +
+
o
+
top
+
+
+
+
+ $object +
+
+
ezSQL_postgresqlTest::$object in ezSQL_postgresqlTest.php
+
+
+ $object +
+
+
ezSQL_recordsetTest::$object in ezSQL_recordsetTest.php
+
+
+ $object +
+
+
ezSQL_sybaseTest::$object in ezSQL_sybaseTest.php
+
+
+ $object +
+
+
ezSQL_pdoTest::$object in ezSQL_pdoTest.php
+
+
+ $object +
+
+
ezSQL_oracle8_9Test::$object in ezSQL_oracle8_9Test.php
+
+
+ $object +
+
+
ezSQLcoreTest::$object in ezSQLcoreTest.php
+
+
+ $object +
+
+
ezSQL_mssqlTest::$object in ezSQL_mssqlTest.php
+
+
+ $object +
+
+
ezSQL_mysqlTest::$object in ezSQL_mysqlTest.php
+
+
+ OBJECT +
+
+ +
Constant boolean Object
+
+
+ +
+
p
+
top
+
+
+
+
+ $profile_times +
+
+ +
Array for storing profiling times
+
+
+ previous +
+
+
ezSQL_recordset::previous() in ezSQL_recordset
+
Sets position of the recordset down by one, if the position is below the
+
+
+ +
+
q
+
top
+
+
+
+
+ query +
+
+
ezSQL_oracle8_9::query() in ezSQL_oracle8_9
+
Perform Oracle query and try to determine result value
+
+
+ query +
+
+
ezSQL_codeigniter::query() in ezSQL_codeigniter
+
Perform codignitor query and try to determine result value
+
+
+ query +
+
+
ezSQL_pdo::query() in ezSQL_pdo
+
Basic Query - see docs for more detail
+
+
+ query +
+
+
ezSQL_postgresql::query() in ezSQL_postgresql
+
Perform PostgreSQL query and try to detirmin result value
+
+
+ query +
+
+
ezSQL_mysql::query() in ezSQL_mysql
+
Perform mySQL query and try to determine result value
+
+
+ query +
+
+
ezSQL_mssql::query() in ezSQL_mssql
+
Perform the mssql query and try to determine the result value
+
+
+ query +
+
+
ezSQLcore::query() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ query +
+
+
ezSQL_sybase::query() in ezSQL_sybase
+
Perform sybase query and try to detirmin result value
+
+
+ quick_connect +
+
+ +
Short hand way to connect to sybase database server and select a sybase database at the same time
+
+
+ quick_connect +
+
+ +
In the case of PostgreSQL quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
In the case of Oracle quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
With PDO it is only an alias for the connect method
+
+
+ +
+
r
+
top
+
+
+
+
+ register_error +
+
+
ezSQLcore::register_error() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ register_error +
+
+ +
Print SQL/DB error - over-ridden by specific DB class
+
+
+ RESULT_AS_ARRAY +
+
+ +
Returns the result as array
+
+
+ RESULT_AS_OBJECT +
+
+ +
Returns the result as object of stdClass
+
+
+ RESULT_AS_ROW +
+
+ +
Returns the result as numeric array
+
+
+ rewind +
+
+
ezSQL_recordset::rewind() in ezSQL_recordset
+
Sets the position to zero
+
+
+ +
+
s
+
top
+
+
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+
ezSQL_postgresql::$show_errors in ezSQL_postgresql
+
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+
ezSQL_codeigniter::$show_errors in ezSQL_codeigniter
+
Show errors
+
+
+ $show_errors +
+
+
ezSQLcore::$show_errors in ez_sql_core_202console.php
+
+
+ $sql_log_file +
+
+ +
Use a SQL log file
+
+
+ select +
+
+
ezSQL_oracle8_9::select() in ezSQL_oracle8_9
+
No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQLcore::select() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ select +
+
+
ezSQL_sybase::select() in ezSQL_sybase
+
Try to select a sybase database
+
+
+ select +
+
+
ezSQL_postgresql::select() in ezSQL_postgresql
+
No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_pdo::select() in ezSQL_pdo
+
With PDO it is only an alias for the connect method
+
+
+ select +
+
+
ezSQL_mssql::select() in ezSQL_mssql
+
Try to select a mssql database
+
+
+ select +
+
+
ezSQL_mysql::select() in ezSQL_mysql
+
Try to select a mySQL database
+
+
+ setUp +
+
+
ezSQL_mssqlTest::setUp() in ezSQL_mssqlTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_sybaseTest::setUp() in ezSQL_sybaseTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_mysqlTest::setUp() in ezSQL_mysqlTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_pdoTest::setUp() in ezSQL_pdoTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_recordsetTest::setUp() in ezSQL_recordsetTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_postgresqlTest::setUp() in ezSQL_postgresqlTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_oracle8_9Test::setUp() in ezSQL_oracle8_9Test.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQLcoreTest::setUp() in ezSQLcoreTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ showDatabases +
+
+ +
Return all databases of the current server
+
+
+ showTables +
+
+
ezSQL_postgresql::showTables() in ezSQL_postgresql
+
Return PostgreSQL specific values: Return all tables of the current schema
+
+
+ show_errors +
+
+ +
Turn error handling on, by default error handling is on
+
+
+ show_errors +
+
+
ezSQLcore::show_errors() in ez_sql_core_202console.php
+
******************************************************************** Turn error handling on or off..
+
+
+ store_cache +
+
+ +
Store the cache
+
+
+ store_cache +
+
+
ezSQLcore::store_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ sysdate +
+
+
ezSQLcore::sysdate() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ sysdate +
+
+
ezSQL_postgresql::sysdate() in ezSQL_postgresql
+
Return PostgreSQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
+
Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_mysql::sysdate() in ezSQL_mysql
+
Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+ +
Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_mssql::sysdate() in ezSQL_mssql
+
Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
+
+
+ sysdate +
+
+
ezSQL_sybase::sysdate() in ezSQL_sybase
+
Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
+
+
+ +
+
t
+
top
+
+
+
+
+ $timers +
+
+ +
Timers
+
+
+ $total_query_time +
+
+ +
The total query time
+
+
+ $trace +
+
+
ezSQLcore::$trace in ez_sql_core_202console.php
+
+
+ $trace +
+
+ +
same as $debug_all
+
+
+ $trace_log +
+
+ +
The trace log
+
+
+ tearDown +
+
+
ezSQL_mssqlTest::tearDown() in ezSQL_mssqlTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_postgresqlTest::tearDown() in ezSQL_postgresqlTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_recordsetTest::tearDown() in ezSQL_recordsetTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_oracle8_9Test::tearDown() in ezSQL_oracle8_9Test.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_sybaseTest::tearDown() in ezSQL_sybaseTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_mysqlTest::tearDown() in ezSQL_mysqlTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_pdoTest::tearDown() in ezSQL_pdoTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQLcoreTest::tearDown() in ezSQLcoreTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ testAffectedRows +
+
+ +
+
+ testConnect +
+
+
ezSQL_oracle8_9Test::testConnect() in ezSQL_oracle8_9Test.php
+
+
+ testConnect +
+
+
ezSQL_sybaseTest::testConnect() in ezSQL_sybaseTest.php
+
+
+ testConnect +
+
+
ezSQL_mssqlTest::testConnect() in ezSQL_mssqlTest.php
+
+
+ testConnect +
+
+
ezSQL_postgresqlTest::testConnect() in ezSQL_postgresqlTest.php
+
+
+ testConnect +
+
+
ezSQL_mysqlTest::testConnect() in ezSQL_mysqlTest.php
+
+
+ testConvertMySqlToMSSql +
+
+ +
+
+ testConvertMySqlTosybase +
+
+ +
+
+ testCurrent +
+
+
ezSQL_recordsetTest::testCurrent() in ezSQL_recordsetTest.php
+
+
+ testDebug +
+
+
ezSQLcoreTest::testDebug() in ezSQLcoreTest.php
+
+
+ testDescTable +
+
+
ezSQL_postgresqlTest::testDescTable() in ezSQL_postgresqlTest.php
+
+
+ testDisconnect +
+
+
ezSQL_mssqlTest::testDisconnect() in ezSQL_mssqlTest.php
+
+
+ testDisconnect +
+
+
ezSQL_postgresqlTest::testDisconnect() in ezSQL_postgresqlTest.php
+
+
+ testDisconnect +
+
+
ezSQL_sybaseTest::testDisconnect() in ezSQL_sybaseTest.php
+
+
+ testDisconnect +
+
+
ezSQL_oracle8_9Test::testDisconnect() in ezSQL_oracle8_9Test.php
+
+
+ testDisconnect +
+
+
ezSQL_mysqlTest::testDisconnect() in ezSQL_mysqlTest.php
+
+
+ testDonation +
+
+
ezSQLcoreTest::testDonation() in ezSQLcoreTest.php
+
+
+ testDumpvar +
+
+
ezSQLcoreTest::testDumpvar() in ezSQLcoreTest.php
+
The test echos HTML, it is just a test, that is still running
+
+
+ testEscape +
+
+
ezSQL_sybaseTest::testEscape() in ezSQL_sybaseTest.php
+
+
+ testEscape +
+
+
ezSQL_postgresqlTest::testEscape() in ezSQL_postgresqlTest.php
+
+
+ testEscape +
+
+
ezSQL_oracle8_9Test::testEscape() in ezSQL_oracle8_9Test.php
+
+
+ testEscape +
+
+
ezSQL_mysqlTest::testEscape() in ezSQL_mysqlTest.php
+
+
+ testEscape +
+
+
ezSQL_mssqlTest::testEscape() in ezSQL_mssqlTest.php
+
+
+ testEzSQL_fetch_assoc +
+
+ +
+
+ testEzSQL_fetch_object +
+
+ +
+
+ testEzSQL_fetch_row +
+
+ +
+
+ testFlush +
+
+
ezSQLcoreTest::testFlush() in ezSQLcoreTest.php
+
+
+ testGetCharset +
+
+
ezSQL_mysqlTest::testGetCharset() in ezSQL_mysqlTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_mysqlTest::testGetDBHost() in ezSQL_mysqlTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_postgresqlTest::testGetDBHost() in ezSQL_postgresqlTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_sybaseTest::testGetDBHost() in ezSQL_sybaseTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_mssqlTest::testGetDBHost() in ezSQL_mssqlTest.php
+
+
+ testGetDBName +
+
+
ezSQL_oracle8_9Test::testGetDBName() in ezSQL_oracle8_9Test.php
+
+
+ testGetInsertId +
+
+
ezSQL_mysqlTest::testGetInsertId() in ezSQL_mysqlTest.php
+
+
+ testGetPort +
+
+
ezSQL_postgresqlTest::testGetPort() in ezSQL_postgresqlTest.php
+
+
+ testGet_cache +
+
+
ezSQLcoreTest::testGet_cache() in ezSQLcoreTest.php
+
+
+ testGet_col +
+
+
ezSQLcoreTest::testGet_col() in ezSQLcoreTest.php
+
+
+ testGet_col_info +
+
+ +
+
+ testGet_results +
+
+ +
+
+ testGet_row +
+
+
ezSQLcoreTest::testGet_row() in ezSQLcoreTest.php
+
+
+ testGet_var +
+
+
ezSQLcoreTest::testGet_var() in ezSQLcoreTest.php
+
+
+ testHide_errors +
+
+ +
+
+ testInsert_id +
+
+
ezSQL_oracle8_9Test::testInsert_id() in ezSQL_oracle8_9Test.php
+
+
+ testIs_equal_int +
+
+
ezSQL_oracle8_9Test::testIs_equal_int() in ezSQL_oracle8_9Test.php
+
+
+ testIs_equal_str +
+
+
ezSQL_oracle8_9Test::testIs_equal_str() in ezSQL_oracle8_9Test.php
+
+
+ testKey +
+
+
ezSQL_recordsetTest::testKey() in ezSQL_recordsetTest.php
+
+
+ testMySQLCatch_error +
+
+ +
+
+ testMySQLConnect +
+
+ +
+
+ testMySQLConnectWithOptions +
+
+ +
+
+ testMySQLDisconnect +
+
+ +
+
+ testMySQLEscape +
+
+ +
+
+ testMySQLGet_set +
+
+ +
+
+ testMySQLQuery +
+
+
ezSQL_pdoTest::testMySQLQuery() in ezSQL_pdoTest.php
+
+
+ testMySQLQuick_connect +
+
+ +
+
+ testMySQLSelect +
+
+ +
+
+ testMySQLSysdate +
+
+ +
+
+ testNext +
+
+
ezSQL_recordsetTest::testNext() in ezSQL_recordsetTest.php
+
+
+ testNextVal +
+
+
ezSQL_oracle8_9Test::testNextVal() in ezSQL_oracle8_9Test.php
+
+
+ testPosgreSQLCatch_error +
+
+ +
+
+ testPosgreSQLConnect +
+
+ +
+
+ testPosgreSQLDisconnect +
+
+ +
+
+ testPosgreSQLEscape +
+
+ +
+
+ testPosgreSQLQuery +
+
+ +
+
+ testPosgreSQLQuick_connect +
+
+ +
+
+ testPosgreSQLSelect +
+
+ +
+
+ testPosgreSQLSysdate +
+
+ +
+
+ testPostgreSQLGet_set +
+
+ +
+
+ testPrevious +
+
+
ezSQL_recordsetTest::testPrevious() in ezSQL_recordsetTest.php
+
+
+ testQuery +
+
+
ezSQL_sybaseTest::testQuery() in ezSQL_sybaseTest.php
+
+
+ testQuery +
+
+
ezSQL_mssqlTest::testQuery() in ezSQL_mssqlTest.php
+
+
+ testQuery +
+
+
ezSQL_oracle8_9Test::testQuery() in ezSQL_oracle8_9Test.php
+
+
+ testQuery +
+
+
ezSQL_postgresqlTest::testQuery() in ezSQL_postgresqlTest.php
+
+
+ testQueryInsert +
+
+
ezSQL_mysqlTest::testQueryInsert() in ezSQL_mysqlTest.php
+
+
+ testQuerySelect +
+
+
ezSQL_mysqlTest::testQuerySelect() in ezSQL_mysqlTest.php
+
+
+ testQuick_connect +
+
+ +
+
+ testQuick_connect +
+
+ +
+
+ testQuick_connect +
+
+
ezSQL_postgresqlTest::testQuick_connect() in ezSQL_postgresqlTest.php
+
+
+ testQuick_connect +
+
+ +
+
+ testQuick_connect +
+
+
ezSQL_oracle8_9Test::testQuick_connect() in ezSQL_oracle8_9Test.php
+
+
+ testRegister_error +
+
+ +
+
+ testRewind +
+
+
ezSQL_recordsetTest::testRewind() in ezSQL_recordsetTest.php
+
+
+ testSelect +
+
+
ezSQL_oracle8_9Test::testSelect() in ezSQL_oracle8_9Test.php
+
+
+ testSelect +
+
+
ezSQL_mysqlTest::testSelect() in ezSQL_mysqlTest.php
+
+
+ testSelect +
+
+
ezSQL_postgresqlTest::testSelect() in ezSQL_postgresqlTest.php
+
+
+ testSelect +
+
+
ezSQL_sybaseTest::testSelect() in ezSQL_sybaseTest.php
+
+
+ testSelect +
+
+
ezSQL_mssqlTest::testSelect() in ezSQL_mssqlTest.php
+
+
+ testShowDatabases +
+
+
ezSQL_postgresqlTest::testShowDatabases() in ezSQL_postgresqlTest.php
+
+
+ testShowTables +
+
+
ezSQL_postgresqlTest::testShowTables() in ezSQL_postgresqlTest.php
+
+
+ testShow_errors +
+
+ +
+
+ testSQLiteCatch_error +
+
+ +
+
+ testSQLiteConnect +
+
+ +
+
+ testSQLiteDisconnect +
+
+ +
+
+ testSQLiteEscape +
+
+ +
+
+ testSQLiteGet_set +
+
+ +
+
+ testSQLiteQuery +
+
+ +
+
+ testSQLiteQuick_connect +
+
+ +
+
+ testSQLiteSelect +
+
+ +
+
+ testSQLiteSysdate +
+
+ +
+
+ testStore_cache +
+
+ +
+
+ testSysdate +
+
+
ezSQL_sybaseTest::testSysdate() in ezSQL_sybaseTest.php
+
+
+ testSysdate +
+
+
ezSQL_postgresqlTest::testSysdate() in ezSQL_postgresqlTest.php
+
+
+ testSysdate +
+
+
ezSQL_mysqlTest::testSysdate() in ezSQL_mysqlTest.php
+
+
+ testSysdate +
+
+
ezSQL_mssqlTest::testSysdate() in ezSQL_mssqlTest.php
+
+
+ testSysdate +
+
+
ezSQL_oracle8_9Test::testSysdate() in ezSQL_oracle8_9Test.php
+
+
+ testTimer_elapsed +
+
+ +
+
+ testTimer_get_cur +
+
+ +
+
+ testTimer_start +
+
+ +
+
+ testTimer_update_global +
+
+ +
+
+ testValid +
+
+
ezSQL_recordsetTest::testValid() in ezSQL_recordsetTest.php
+
+
+ testVardump +
+
+
ezSQLcoreTest::testVardump() in ezSQLcoreTest.php
+
The test echos HTML, it is just a test, that is still running
+
+
+ TEST_DB_CHARSET +
+
+
ezSQL_pdoTest::TEST_DB_CHARSET in ezSQL_pdoTest.php
+
constant string database connection charset
+
+
+ TEST_DB_CHARSET +
+
+
ezSQL_recordsetTest::TEST_DB_CHARSET in ezSQL_recordsetTest.php
+
constant database connection charset
+
+
+ TEST_DB_CHARSET +
+
+
ezSQL_mysqlTest::TEST_DB_CHARSET in ezSQL_mysqlTest.php
+
constant database connection charset
+
+
+ TEST_DB_HOST +
+
+
ezSQL_postgresqlTest::TEST_DB_HOST in ezSQL_postgresqlTest.php
+
constant database host
+
+
+ TEST_DB_HOST +
+
+
ezSQL_pdoTest::TEST_DB_HOST in ezSQL_pdoTest.php
+
constant string database host
+
+
+ TEST_DB_HOST +
+
+
ezSQL_recordsetTest::TEST_DB_HOST in ezSQL_recordsetTest.php
+
constant database host
+
+
+ TEST_DB_HOST +
+
+
ezSQL_mysqlTest::TEST_DB_HOST in ezSQL_mysqlTest.php
+
constant database host
+
+
+ TEST_DB_NAME +
+
+
ezSQL_recordsetTest::TEST_DB_NAME in ezSQL_recordsetTest.php
+
constant database name
+
+
+ TEST_DB_NAME +
+
+
ezSQL_postgresqlTest::TEST_DB_NAME in ezSQL_postgresqlTest.php
+
constant database name
+
+
+ TEST_DB_NAME +
+
+
ezSQL_pdoTest::TEST_DB_NAME in ezSQL_pdoTest.php
+
constant string database name
+
+
+ TEST_DB_NAME +
+
+
ezSQL_mysqlTest::TEST_DB_NAME in ezSQL_mysqlTest.php
+
constant database name
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_pdoTest::TEST_DB_PASSWORD in ezSQL_pdoTest.php
+
constant string password
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_recordsetTest::TEST_DB_PASSWORD in ezSQL_recordsetTest.php
+
constant string password
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_mysqlTest::TEST_DB_PASSWORD in ezSQL_mysqlTest.php
+
constant string password
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_postgresqlTest::TEST_DB_PASSWORD in ezSQL_postgresqlTest.php
+
constant string password
+
+
+ TEST_DB_PORT +
+
+
ezSQL_postgresqlTest::TEST_DB_PORT in ezSQL_postgresqlTest.php
+
constant database port
+
+
+ TEST_DB_PORT +
+
+
ezSQL_pdoTest::TEST_DB_PORT in ezSQL_pdoTest.php
+
constant string database port
+
+
+ TEST_DB_USER +
+
+
ezSQL_recordsetTest::TEST_DB_USER in ezSQL_recordsetTest.php
+
constant string user name
+
+
+ TEST_DB_USER +
+
+
ezSQL_postgresqlTest::TEST_DB_USER in ezSQL_postgresqlTest.php
+
constant string user name
+
+
+ TEST_DB_USER +
+
+
ezSQL_pdoTest::TEST_DB_USER in ezSQL_pdoTest.php
+
constant string user name
+
+
+ TEST_DB_USER +
+
+
ezSQL_mysqlTest::TEST_DB_USER in ezSQL_mysqlTest.php
+
constant string user name
+
+
+ TEST_SQLITE_DB +
+
+
ezSQL_pdoTest::TEST_SQLITE_DB in ezSQL_pdoTest.php
+
constant string path and file name of the SQLite test database
+
+
+ timer_elapsed +
+
+ +
Returns the elapsed time of the given timer by name
+
+
+ timer_get_cur +
+
+ +
Get current time
+
+
+ timer_start +
+
+ +
Start a timer by name
+
+
+ timer_update_global +
+
+ +
Update the global timer with an existing timer
+
+
+ +
+
u
+
top
+
+
+
+
+ $use_disk_cache +
+
+ +
Using disk cache
+
+
+ $use_disk_cache +
+
+
ezSQLcore::$use_disk_cache in ez_sql_core_202console.php
+
+
+ $use_trace_log +
+
+ +
Use the trace log
+
+
+ +
+
v
+
top
+
+
+
+
+ $vardump_called +
+
+
ezSQLcore::$vardump_called in ez_sql_core_202console.php
+
+
+ $vardump_called +
+
+ +
Vardump called
+
+
+ valid +
+
+
ezSQL_recordset::valid() in ezSQL_recordset
+
Whether the current position contains a row, or not
+
+
+ vardump +
+
+
ezSQLcore::vardump() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ vardump +
+
+ +
Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, public or Array
+
+
+ +
+
_
+
top
+
+
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_postgresql class
+
+
+ __construct +
+
+ +
Initializes the record object
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_oracle8_9 class
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mssql class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mysql class
+
+
+ __construct +
+
+ +
Constructor of ezSQL
+
+
+ +
+ a + c + d + e + f + g + h + i + k + l + n + o + p + q + r + s + t + u + v + _ +
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/elementindex_default.html b/_Documentation/phpDocumentator/elementindex_default.html new file mode 100644 index 00000000..9ab62577 --- /dev/null +++ b/_Documentation/phpDocumentator/elementindex_default.html @@ -0,0 +1,438 @@ + + + + + + + + + + + +

[default] element index

+

Package indexes

+ +All elements +
+
+ c + d + e + f + g + h + l + n + q + r + s + t + u + v +
+ + +
+
c
+
top
+
+
+
+
+ $cache_dir +
+
+
ezSQLcore::$cache_dir in ez_sql_core_202console.php
+
+
+ $cache_inserts +
+
+
ezSQLcore::$cache_inserts in ez_sql_core_202console.php
+
+
+ $cache_queries +
+
+
ezSQLcore::$cache_queries in ez_sql_core_202console.php
+
+
+ $cache_timeout +
+
+
ezSQLcore::$cache_timeout in ez_sql_core_202console.php
+
+
+ $captured_errors +
+
+
ezSQLcore::$captured_errors in ez_sql_core_202console.php
+
+
+ $col_info +
+
+
ezSQLcore::$col_info in ez_sql_core_202console.php
+
+
+ connect +
+
+
ezSQLcore::connect() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
d
+
top
+
+
+
+
+ $debug_all +
+
+
ezSQLcore::$debug_all in ez_sql_core_202console.php
+
+
+ $debug_called +
+
+
ezSQLcore::$debug_called in ez_sql_core_202console.php
+
+
+ $debug_echo +
+
+
ezSQLcore::$debug_echo in ez_sql_core_202console.php
+
+
+ debug +
+
+
ezSQLcore::debug() in ez_sql_core_202console.php
+
******************************************************************** Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ donation +
+
+
ezSQLcore::donation() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ dumpvar +
+
+
ezSQLcore::dumpvar() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ disk_cache_example.php +
+
+
disk_cache_example.php in disk_cache_example.php
+
+
+ +
+
e
+
top
+
+
+
+
+ escape +
+
+
ezSQLcore::escape() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore::ezSQLcore() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ezSQLcore +
+
+
ezSQLcore in ez_sql_core_202console.php
+
********************************************************************
+
+
+ ez_sql_core_2.1_debughack_0.2alpha.php +
+
+
ez_sql_core_2.1_debughack_0.2alpha.php in ez_sql_core_2.1_debughack_0.2alpha.php
+
+
+ ez_sql_core_202console.php +
+
+
ez_sql_core_202console.php in ez_sql_core_202console.php
+
+
+ +
+
f
+
top
+
+
+
+
+ flush +
+
+
ezSQLcore::flush() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
g
+
top
+
+
+
+
+ get_cache +
+
+
ezSQLcore::get_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col +
+
+
ezSQLcore::get_col() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_col_info +
+
+
ezSQLcore::get_col_info() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_results +
+
+
ezSQLcore::get_results() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_row +
+
+
ezSQLcore::get_row() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ get_var +
+
+
ezSQLcore::get_var() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
h
+
top
+
+
+
+
+ hide_errors +
+
+
ezSQLcore::hide_errors() in ez_sql_core_202console.php
+
+
+ +
+
l
+
top
+
+
+
+
+ $last_error +
+
+
ezSQLcore::$last_error in ez_sql_core_202console.php
+
+
+ $last_query +
+
+
ezSQLcore::$last_query in ez_sql_core_202console.php
+
+
+ +
+
n
+
top
+
+
+
+
+ $num_queries +
+
+
ezSQLcore::$num_queries in ez_sql_core_202console.php
+
+
+ +
+
q
+
top
+
+
+
+
+ query +
+
+
ezSQLcore::query() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
r
+
top
+
+
+
+
+ register_error +
+
+
ezSQLcore::register_error() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
s
+
top
+
+
+
+
+ $show_errors +
+
+
ezSQLcore::$show_errors in ez_sql_core_202console.php
+
+
+ select +
+
+
ezSQLcore::select() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ show_errors +
+
+
ezSQLcore::show_errors() in ez_sql_core_202console.php
+
******************************************************************** Turn error handling on or off..
+
+
+ store_cache +
+
+
ezSQLcore::store_cache() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ sysdate +
+
+
ezSQLcore::sysdate() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+
t
+
top
+
+
+
+
+ $trace +
+
+
ezSQLcore::$trace in ez_sql_core_202console.php
+
+
+ +
+
u
+
top
+
+
+
+
+ $use_disk_cache +
+
+
ezSQLcore::$use_disk_cache in ez_sql_core_202console.php
+
+
+ +
+
v
+
top
+
+
+
+
+ $vardump_called +
+
+
ezSQLcore::$vardump_called in ez_sql_core_202console.php
+
+
+ vardump +
+
+
ezSQLcore::vardump() in ez_sql_core_202console.php
+
********************************************************************
+
+
+ +
+ c + d + e + f + g + h + l + n + q + r + s + t + u + v +
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/elementindex_ezSQL.html b/_Documentation/phpDocumentator/elementindex_ezSQL.html new file mode 100644 index 00000000..6be4ca9c --- /dev/null +++ b/_Documentation/phpDocumentator/elementindex_ezSQL.html @@ -0,0 +1,2451 @@ + + + + + + + + + + + +

[ezSQL] element index

+

Package indexes

+ +All elements +
+
+ a + c + d + e + f + g + h + i + k + l + n + o + p + q + r + s + t + u + v + _ +
+ + +
+
_
+
top
+
+
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_postgresql class
+
+
+ __construct +
+
+ +
Initializes the record object
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_oracle8_9 class
+
+
+ __construct +
+
+ +
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mssql class
+
+
+ __construct +
+
+ +
Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mysql class
+
+
+ __construct +
+
+ +
Constructor of ezSQL
+
+
+ +
+
a
+
top
+
+
+
+
+ $affectedRows +
+
+ +
Contains the number of affected rows of a query
+
+
+ affectedRows +
+
+ +
Returns the affected rows of a query
+
+
+ ARRAY_A +
+
+ +
Constant boolean
+
+
+ ARRAY_N +
+
+ +
Constant boolean
+
+
+ +
+
c
+
top
+
+
+
+
+ $cache_dir +
+
+ +
Using the cache directory
+
+
+ $cache_inserts +
+
+ +
Insert queries into the cache
+
+
+ $cache_queries +
+
+ +
Caching queries
+
+
+ $cache_timeout +
+
+ +
The cache timeout in hours
+
+
+ $captured_errors +
+
+ +
Captured errors
+
+
+ $col_info +
+
+ +
The last column info
+
+
+ $connected +
+
+ +
Whether the database connection is established, or not
+
+
+ catch_error +
+
+ +
Hooks into PDO error system and reports it to user
+
+
+ connect +
+
+ +
Try to connect to the database server in the DSN parameters
+
+
+ connect +
+
+
ezSQL_postgresql::connect() in ezSQL_postgresql
+
Try to connect to PostgreSQL database server
+
+
+ connect +
+
+
ezSQL_oracle8_9::connect() in ezSQL_oracle8_9
+
Try to connect to Oracle database server
+
+
+ connect +
+
+
ezSQL_sybase::connect() in ezSQL_sybase
+
Try to connect to sybase database server
+
+
+ connect +
+
+
ezSQL_mysql::connect() in ezSQL_mysql
+
Try to connect to mySQL database server
+
+
+ connect +
+
+
ezSQL_mssql::connect() in ezSQL_mssql
+
Try to connect to mssql database server
+
+
+ ConvertMySqlToMSSql +
+
+ +
Convert a Query From MySql Syntax to MS-Sql syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - + the character is removed.
+
+
+ ConvertMySqlTosybase +
+
+ +
Convert a Query From MySql Syntax to Sybase syntax Following conversions are made:
  1. The '`' character used for MySql queries is not supported - the + character is removed.
+
+
+ current +
+
+
ezSQL_recordset::current() in ezSQL_recordset
+
Returns the current row of the recordset as stdClass, which is the default mode, or as array as fieldname - fieldvalue.
+
+
+ +
+
d
+
top
+
+
+
+
+ $dbh +
+
+ +
The database connection object
+
+
+ $db_connect_time +
+
+ +
The time it took to establish a connection
+
+
+ $debug +
+
+
ezSQL_codeigniter::$debug in ezSQL_codeigniter
+
Run in debug mode
+
+
+ $debug_all +
+
+ +
same as $trace
+
+
+ $debug_called +
+
+ +
Debug is called
+
+
+ $debug_echo_is_on +
+
+ +
== TJH == default now needed for echo of debug function
+
+
+ $do_profile +
+
+ +
Using profiling
+
+
+ debug +
+
+ +
Displays the last query string that was sent to the database & a table listing results (if there were any).
+
+
+ descTable +
+
+
ezSQL_postgresql::descTable() in ezSQL_postgresql
+
Return the description of the given table
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+
ezSQL_postgresql::disconnect() in ezSQL_postgresql
+
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ disconnect +
+
+ +
Close the database connection
+
+
+ donation +
+
+ +
Naughty little function to ask for some remuniration!
+
+
+ dumpvar +
+
+ +
An alias for vardump method
+
+
+ +
+
e
+
top
+
+
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
+
+ escape +
+
+
ezSQL_pdo::escape() in ezSQL_pdo
+
Escape a string with the PDO method
+
+
+ escape +
+
+
ezSQL_mysql::escape() in ezSQL_mysql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_postgresql::escape() in ezSQL_postgresql
+
Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)
+
+
+ escape +
+
+
ezSQL_sybase::escape() in ezSQL_sybase
+
Format a sybase string correctly for safe sybase insert
+
+
+ escape +
+
+
ezSQL_mssql::escape() in ezSQL_mssql
+
Format a mssql string correctly for safe mssql insert
+
+
+ escape +
+
+
ezSQL_oracle8_9::escape() in ezSQL_oracle8_9
+
Format a Oracle string correctly for safe Oracle insert
+
+
+ escape +
+
+
ezSQL_codeigniter::escape() in ezSQL_codeigniter
+
Format a sql string correctly for safe insert
+
+
+ ezSQLcore +
+
+
ezSQLcore in ezSQL
+
ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).
+
+
+ ezSQL_codeigniter +
+
+
ezSQL_codeigniter in ezSQL_codeigniter
+
ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_fetch_assoc +
+
+ +
Behaves like mysql_fetch_assoc. This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_assoc.
+
+
+ ezSQL_fetch_object +
+
+ +
Behaves like mysql_fetch_object This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_object.
+
+
+ ezSQL_fetch_row +
+
+ +
Behaves like mysql_fetch_row This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_row.
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_recordset +
+
+
ezSQL_recordset in ezSQL_recordset
+
ezSQL Database specific class for working with query results Desc..: recordset component (part of ezSQL databse abstraction library)
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.
+
+
+ EZSQL_VERSION +
+
+ +
Constant string ezSQL version information
+
+
+ ezSQL_mssql +
+
+
ezSQL_mssql in ezSQL_mssql
+
+
+ ezSQL_mysql +
+
+
ezSQL_mysql in ezSQL_mysql
+
+
+ ezSQL_oracle8_9 +
+
+
ezSQL_oracle8_9 in ezSQL_oracle8_9
+
+
+ ezSQL_pdo +
+
+
ezSQL_pdo in ezSQL_pdo
+
+
+ ezSQL_postgresql +
+
+
ezSQL_postgresql in ezSQL_postgresql
+
+
+ ezSQL +
+
+
ezSQL in ezSQL
+
+
+ ezSQL_recordset +
+
+
ezSQL_recordset in ezSQL_recordset
+
+
+ ezSQL_sybase +
+
+
ezSQL_sybase in ezSQL_sybase
+
+
+ $ezSQL +
+
+
ezSQL_recordsetTest::$ezSQL in ezSQL_recordsetTest.php
+
ezSQL connection
+
+
+ ezSQLcoreTest +
+
+
ezSQLcoreTest in ezSQLcoreTest.php
+
Test class for ezSQLcore.
+
+
+ ezSQL_mssqlTest +
+
+
ezSQL_mssqlTest in ezSQL_mssqlTest.php
+
Test class for ezSQL_mssql.
+
+
+ ezSQL_mysqlTest +
+
+
ezSQL_mysqlTest in ezSQL_mysqlTest.php
+
Test class for ezSQL_mysql.
+
+
+ ezSQL_oracle8_9Test +
+
+
ezSQL_oracle8_9Test in ezSQL_oracle8_9Test.php
+
Test class for ezSQL_oracle8_9.
+
+
+ ezSQL_pdoTest +
+
+
ezSQL_pdoTest in ezSQL_pdoTest.php
+
Test class for ezSQL_pdo.
+
+
+ ezSQL_postgresqlTest +
+
+
ezSQL_postgresqlTest in ezSQL_postgresqlTest.php
+
Test class for ezSQL_postgresql.
+
+
+ ezSQL_recordsetTest +
+
+
ezSQL_recordsetTest in ezSQL_recordsetTest.php
+
Test class for ezSQL_recordset.
+
+
+ ezSQL_sybaseTest +
+
+
ezSQL_sybaseTest in ezSQL_sybaseTest.php
+
Test class for ezSQL_sybase.
+
+
+ ezSQL_mssqlTest.php +
+
+
ezSQL_mssqlTest.php in ezSQL_mssqlTest.php
+
+
+ ezSQL_mysqlTest.php +
+
+
ezSQL_mysqlTest.php in ezSQL_mysqlTest.php
+
+
+ ezSQL_oracle8_9Test.php +
+
+
ezSQL_oracle8_9Test.php in ezSQL_oracle8_9Test.php
+
+
+ ezSQL_pdoTest.php +
+
+
ezSQL_pdoTest.php in ezSQL_pdoTest.php
+
+
+ ezSQL_postgresqlTest.php +
+
+
ezSQL_postgresqlTest.php in ezSQL_postgresqlTest.php
+
+
+ ezSQLcoreTest.php +
+
+
ezSQLcoreTest.php in ezSQLcoreTest.php
+
+
+ ezSQL_recordsetTest.php +
+
+
ezSQL_recordsetTest.php in ezSQL_recordsetTest.php
+
+
+ ezSQL_sybaseTest.php +
+
+
ezSQL_sybaseTest.php in ezSQL_sybaseTest.php
+
+
+ +
+
f
+
top
+
+
+
+
+ $from_disk_cache +
+
+ +
Get data from disk cache
+
+
+ flush +
+
+ +
Kill cached query results
+
+
+ +
+
g
+
top
+
+
+
+
+ getCharset +
+
+ +
Returns the current connection charset
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBHost +
+
+
ezSQL_postgresql::getDBHost() in ezSQL_postgresql
+
Returns the current database server host
+
+
+ getDBHost +
+
+ +
Returns the current database server host
+
+
+ getDBName +
+
+
ezSQL_oracle8_9::getDBName() in ezSQL_oracle8_9
+
Returns the current database name
+
+
+ getInsertId +
+
+ +
Returns the last inserted autoincrement
+
+
+ getPort +
+
+
ezSQL_postgresql::getPort() in ezSQL_postgresql
+
Returns the current TCP/IP port
+
+
+ getShowErrors +
+
+ +
Returns the current show error state
+
+
+ get_cache +
+
+ +
Get the query cache of a query
+
+
+ get_col +
+
+ +
Function to get 1 column from the cached result set based in X index see docs for usage and info
+
+
+ get_col_info +
+
+ +
Function to get column meta data info pertaining to the last query See docs for more info and usage
+
+
+ get_results +
+
+ +
Return the the query as a result set - see docs for more details
+
+
+ get_row +
+
+ +
Get one row from the DB - see docs for more detail
+
+
+ get_set +
+
+ +
Creates a SET nvp sql string from an associative array (and escapes all values)
+
+
+ get_var +
+
+ +
Get one variable from the DB - see docs for more detail
+
+
+ +
+
h
+
top
+
+
+
+
+ hide_errors +
+
+ +
Turn error handling off
+
+
+ +
+
i
+
top
+
+
+
+
+ insert_id +
+
+
ezSQL_oracle8_9::insert_id() in ezSQL_oracle8_9
+
Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.
+
+
+ isConnected +
+
+ +
Returns, whether a database connection is established, or not
+
+
+ is_equal_int +
+
+ +
Returns an equal string for integer values
+
+
+ is_equal_str +
+
+ +
Returns an escaped equal string
+
+
+ +
+
k
+
top
+
+
+
+
+ key +
+
+
ezSQL_recordset::key() in ezSQL_recordset
+
Returns the current position in the recordset
+
+
+ +
+
l
+
top
+
+
+
+
+ $last_error +
+
+ +
The last error object
+
+
+ $last_query +
+
+ +
The last query object
+
+
+ $last_result +
+
+ +
The last query result
+
+
+ +
+
n
+
top
+
+
+
+
+ $num_queries +
+
+ +
Number of queries
+
+
+ next +
+
+
ezSQL_recordset::next() in ezSQL_recordset
+
Sets the position of the recordset up by one
+
+
+ nextVal +
+
+
ezSQL_oracle8_9::nextVal() in ezSQL_oracle8_9
+
An alias for insert_id using the original Oracle function name.
+
+
+ +
+
o
+
top
+
+
+
+
+ OBJECT +
+
+ +
Constant boolean Object
+
+
+ $object +
+
+
ezSQL_postgresqlTest::$object in ezSQL_postgresqlTest.php
+
+
+ $object +
+
+
ezSQL_recordsetTest::$object in ezSQL_recordsetTest.php
+
+
+ $object +
+
+
ezSQL_sybaseTest::$object in ezSQL_sybaseTest.php
+
+
+ $object +
+
+
ezSQL_pdoTest::$object in ezSQL_pdoTest.php
+
+
+ $object +
+
+
ezSQL_oracle8_9Test::$object in ezSQL_oracle8_9Test.php
+
+
+ $object +
+
+
ezSQL_mssqlTest::$object in ezSQL_mssqlTest.php
+
+
+ $object +
+
+
ezSQL_mysqlTest::$object in ezSQL_mysqlTest.php
+
+
+ $object +
+
+
ezSQLcoreTest::$object in ezSQLcoreTest.php
+
+
+ +
+
p
+
top
+
+
+
+
+ $profile_times +
+
+ +
Array for storing profiling times
+
+
+ previous +
+
+
ezSQL_recordset::previous() in ezSQL_recordset
+
Sets position of the recordset down by one, if the position is below the
+
+
+ +
+
q
+
top
+
+
+
+
+ query +
+
+
ezSQL_oracle8_9::query() in ezSQL_oracle8_9
+
Perform Oracle query and try to determine result value
+
+
+ query +
+
+
ezSQL_codeigniter::query() in ezSQL_codeigniter
+
Perform codignitor query and try to determine result value
+
+
+ query +
+
+
ezSQL_pdo::query() in ezSQL_pdo
+
Basic Query - see docs for more detail
+
+
+ query +
+
+
ezSQL_postgresql::query() in ezSQL_postgresql
+
Perform PostgreSQL query and try to detirmin result value
+
+
+ query +
+
+
ezSQL_sybase::query() in ezSQL_sybase
+
Perform sybase query and try to detirmin result value
+
+
+ query +
+
+
ezSQL_mssql::query() in ezSQL_mssql
+
Perform the mssql query and try to determine the result value
+
+
+ query +
+
+
ezSQL_mysql::query() in ezSQL_mysql
+
Perform mySQL query and try to determine result value
+
+
+ quick_connect +
+
+ +
In the case of PostgreSQL quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
Short hand way to connect to sybase database server and select a sybase database at the same time
+
+
+ quick_connect +
+
+ +
In the case of Oracle quick_connect is not really needed because std.
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
Short hand way to connect to mssql database server and select a mssql database at the same time
+
+
+ quick_connect +
+
+ +
With PDO it is only an alias for the connect method
+
+
+ +
+
r
+
top
+
+
+
+
+ register_error +
+
+ +
Print SQL/DB error - over-ridden by specific DB class
+
+
+ RESULT_AS_ARRAY +
+
+ +
Returns the result as array
+
+
+ RESULT_AS_OBJECT +
+
+ +
Returns the result as object of stdClass
+
+
+ RESULT_AS_ROW +
+
+ +
Returns the result as numeric array
+
+
+ rewind +
+
+
ezSQL_recordset::rewind() in ezSQL_recordset
+
Sets the position to zero
+
+
+ +
+
s
+
top
+
+
+
+
+ $show_errors +
+
+
ezSQL_postgresql::$show_errors in ezSQL_postgresql
+
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+
ezSQL_codeigniter::$show_errors in ezSQL_codeigniter
+
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $show_errors +
+
+ +
Show errors
+
+
+ $sql_log_file +
+
+ +
Use a SQL log file
+
+
+ select +
+
+
ezSQL_postgresql::select() in ezSQL_postgresql
+
No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_sybase::select() in ezSQL_sybase
+
Try to select a sybase database
+
+
+ select +
+
+
ezSQL_pdo::select() in ezSQL_pdo
+
With PDO it is only an alias for the connect method
+
+
+ select +
+
+
ezSQL_oracle8_9::select() in ezSQL_oracle8_9
+
No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency
+
+
+ select +
+
+
ezSQL_mysql::select() in ezSQL_mysql
+
Try to select a mySQL database
+
+
+ select +
+
+
ezSQL_mssql::select() in ezSQL_mssql
+
Try to select a mssql database
+
+
+ showDatabases +
+
+ +
Return all databases of the current server
+
+
+ showTables +
+
+
ezSQL_postgresql::showTables() in ezSQL_postgresql
+
Return PostgreSQL specific values: Return all tables of the current schema
+
+
+ show_errors +
+
+ +
Turn error handling on, by default error handling is on
+
+
+ store_cache +
+
+ +
Store the cache
+
+
+ sysdate +
+
+
ezSQL_sybase::sysdate() in ezSQL_sybase
+
Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()
+
+
+ sysdate +
+
+
ezSQL_postgresql::sysdate() in ezSQL_postgresql
+
Return PostgreSQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+ +
Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_oracle8_9::sysdate() in ezSQL_oracle8_9
+
Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_mysql::sysdate() in ezSQL_mysql
+
Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()
+
+
+ sysdate +
+
+
ezSQL_mssql::sysdate() in ezSQL_mssql
+
Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()
+
+
+ setUp +
+
+
ezSQL_postgresqlTest::setUp() in ezSQL_postgresqlTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_recordsetTest::setUp() in ezSQL_recordsetTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_sybaseTest::setUp() in ezSQL_sybaseTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_pdoTest::setUp() in ezSQL_pdoTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_oracle8_9Test::setUp() in ezSQL_oracle8_9Test.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_mssqlTest::setUp() in ezSQL_mssqlTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQL_mysqlTest::setUp() in ezSQL_mysqlTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ setUp +
+
+
ezSQLcoreTest::setUp() in ezSQLcoreTest.php
+
Sets up the fixture, for example, opens a network connection.
+
+
+ +
+
t
+
top
+
+
+
+
+ $timers +
+
+ +
Timers
+
+
+ $total_query_time +
+
+ +
The total query time
+
+
+ $trace +
+
+ +
same as $debug_all
+
+
+ $trace_log +
+
+ +
The trace log
+
+
+ timer_elapsed +
+
+ +
Returns the elapsed time of the given timer by name
+
+
+ timer_get_cur +
+
+ +
Get current time
+
+
+ timer_start +
+
+ +
Start a timer by name
+
+
+ timer_update_global +
+
+ +
Update the global timer with an existing timer
+
+
+ tearDown +
+
+
ezSQL_pdoTest::tearDown() in ezSQL_pdoTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_mssqlTest::tearDown() in ezSQL_mssqlTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_mysqlTest::tearDown() in ezSQL_mysqlTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_postgresqlTest::tearDown() in ezSQL_postgresqlTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_oracle8_9Test::tearDown() in ezSQL_oracle8_9Test.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQLcoreTest::tearDown() in ezSQLcoreTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_sybaseTest::tearDown() in ezSQL_sybaseTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ tearDown +
+
+
ezSQL_recordsetTest::tearDown() in ezSQL_recordsetTest.php
+
Tears down the fixture, for example, closes a network connection.
+
+
+ testAffectedRows +
+
+ +
+
+ testConnect +
+
+
ezSQL_postgresqlTest::testConnect() in ezSQL_postgresqlTest.php
+
+
+ testConnect +
+
+
ezSQL_mysqlTest::testConnect() in ezSQL_mysqlTest.php
+
+
+ testConnect +
+
+
ezSQL_mssqlTest::testConnect() in ezSQL_mssqlTest.php
+
+
+ testConnect +
+
+
ezSQL_sybaseTest::testConnect() in ezSQL_sybaseTest.php
+
+
+ testConnect +
+
+
ezSQL_oracle8_9Test::testConnect() in ezSQL_oracle8_9Test.php
+
+
+ testConvertMySqlToMSSql +
+
+ +
+
+ testConvertMySqlTosybase +
+
+ +
+
+ testCurrent +
+
+
ezSQL_recordsetTest::testCurrent() in ezSQL_recordsetTest.php
+
+
+ testDebug +
+
+
ezSQLcoreTest::testDebug() in ezSQLcoreTest.php
+
+
+ testDescTable +
+
+
ezSQL_postgresqlTest::testDescTable() in ezSQL_postgresqlTest.php
+
+
+ testDisconnect +
+
+
ezSQL_mysqlTest::testDisconnect() in ezSQL_mysqlTest.php
+
+
+ testDisconnect +
+
+
ezSQL_mssqlTest::testDisconnect() in ezSQL_mssqlTest.php
+
+
+ testDisconnect +
+
+
ezSQL_oracle8_9Test::testDisconnect() in ezSQL_oracle8_9Test.php
+
+
+ testDisconnect +
+
+
ezSQL_postgresqlTest::testDisconnect() in ezSQL_postgresqlTest.php
+
+
+ testDisconnect +
+
+
ezSQL_sybaseTest::testDisconnect() in ezSQL_sybaseTest.php
+
+
+ testDonation +
+
+
ezSQLcoreTest::testDonation() in ezSQLcoreTest.php
+
+
+ testDumpvar +
+
+
ezSQLcoreTest::testDumpvar() in ezSQLcoreTest.php
+
The test echos HTML, it is just a test, that is still running
+
+
+ testEscape +
+
+
ezSQL_oracle8_9Test::testEscape() in ezSQL_oracle8_9Test.php
+
+
+ testEscape +
+
+
ezSQL_postgresqlTest::testEscape() in ezSQL_postgresqlTest.php
+
+
+ testEscape +
+
+
ezSQL_mysqlTest::testEscape() in ezSQL_mysqlTest.php
+
+
+ testEscape +
+
+
ezSQL_mssqlTest::testEscape() in ezSQL_mssqlTest.php
+
+
+ testEscape +
+
+
ezSQL_sybaseTest::testEscape() in ezSQL_sybaseTest.php
+
+
+ testEzSQL_fetch_assoc +
+
+ +
+
+ testEzSQL_fetch_object +
+
+ +
+
+ testEzSQL_fetch_row +
+
+ +
+
+ testFlush +
+
+
ezSQLcoreTest::testFlush() in ezSQLcoreTest.php
+
+
+ testGetCharset +
+
+
ezSQL_mysqlTest::testGetCharset() in ezSQL_mysqlTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_postgresqlTest::testGetDBHost() in ezSQL_postgresqlTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_sybaseTest::testGetDBHost() in ezSQL_sybaseTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_mssqlTest::testGetDBHost() in ezSQL_mssqlTest.php
+
+
+ testGetDBHost +
+
+
ezSQL_mysqlTest::testGetDBHost() in ezSQL_mysqlTest.php
+
+
+ testGetDBName +
+
+
ezSQL_oracle8_9Test::testGetDBName() in ezSQL_oracle8_9Test.php
+
+
+ testGetInsertId +
+
+
ezSQL_mysqlTest::testGetInsertId() in ezSQL_mysqlTest.php
+
+
+ testGetPort +
+
+
ezSQL_postgresqlTest::testGetPort() in ezSQL_postgresqlTest.php
+
+
+ testGet_cache +
+
+
ezSQLcoreTest::testGet_cache() in ezSQLcoreTest.php
+
+
+ testGet_col +
+
+
ezSQLcoreTest::testGet_col() in ezSQLcoreTest.php
+
+
+ testGet_col_info +
+
+ +
+
+ testGet_results +
+
+ +
+
+ testGet_row +
+
+
ezSQLcoreTest::testGet_row() in ezSQLcoreTest.php
+
+
+ testGet_var +
+
+
ezSQLcoreTest::testGet_var() in ezSQLcoreTest.php
+
+
+ testHide_errors +
+
+ +
+
+ testInsert_id +
+
+
ezSQL_oracle8_9Test::testInsert_id() in ezSQL_oracle8_9Test.php
+
+
+ testIs_equal_int +
+
+
ezSQL_oracle8_9Test::testIs_equal_int() in ezSQL_oracle8_9Test.php
+
+
+ testIs_equal_str +
+
+
ezSQL_oracle8_9Test::testIs_equal_str() in ezSQL_oracle8_9Test.php
+
+
+ testKey +
+
+
ezSQL_recordsetTest::testKey() in ezSQL_recordsetTest.php
+
+
+ testMySQLCatch_error +
+
+ +
+
+ testMySQLConnect +
+
+ +
+
+ testMySQLConnectWithOptions +
+
+ +
+
+ testMySQLDisconnect +
+
+ +
+
+ testMySQLEscape +
+
+ +
+
+ testMySQLGet_set +
+
+ +
+
+ testMySQLQuery +
+
+
ezSQL_pdoTest::testMySQLQuery() in ezSQL_pdoTest.php
+
+
+ testMySQLQuick_connect +
+
+ +
+
+ testMySQLSelect +
+
+ +
+
+ testMySQLSysdate +
+
+ +
+
+ testNext +
+
+
ezSQL_recordsetTest::testNext() in ezSQL_recordsetTest.php
+
+
+ testNextVal +
+
+
ezSQL_oracle8_9Test::testNextVal() in ezSQL_oracle8_9Test.php
+
+
+ testPosgreSQLCatch_error +
+
+ +
+
+ testPosgreSQLConnect +
+
+ +
+
+ testPosgreSQLDisconnect +
+
+ +
+
+ testPosgreSQLEscape +
+
+ +
+
+ testPosgreSQLQuery +
+
+ +
+
+ testPosgreSQLQuick_connect +
+
+ +
+
+ testPosgreSQLSelect +
+
+ +
+
+ testPosgreSQLSysdate +
+
+ +
+
+ testPostgreSQLGet_set +
+
+ +
+
+ testPrevious +
+
+
ezSQL_recordsetTest::testPrevious() in ezSQL_recordsetTest.php
+
+
+ testQuery +
+
+
ezSQL_mssqlTest::testQuery() in ezSQL_mssqlTest.php
+
+
+ testQuery +
+
+
ezSQL_postgresqlTest::testQuery() in ezSQL_postgresqlTest.php
+
+
+ testQuery +
+
+
ezSQL_oracle8_9Test::testQuery() in ezSQL_oracle8_9Test.php
+
+
+ testQuery +
+
+
ezSQL_sybaseTest::testQuery() in ezSQL_sybaseTest.php
+
+
+ testQueryInsert +
+
+
ezSQL_mysqlTest::testQueryInsert() in ezSQL_mysqlTest.php
+
+
+ testQuerySelect +
+
+
ezSQL_mysqlTest::testQuerySelect() in ezSQL_mysqlTest.php
+
+
+ testQuick_connect +
+
+ +
+
+ testQuick_connect +
+
+ +
+
+ testQuick_connect +
+
+ +
+
+ testQuick_connect +
+
+
ezSQL_oracle8_9Test::testQuick_connect() in ezSQL_oracle8_9Test.php
+
+
+ testQuick_connect +
+
+
ezSQL_postgresqlTest::testQuick_connect() in ezSQL_postgresqlTest.php
+
+
+ testRegister_error +
+
+ +
+
+ testRewind +
+
+
ezSQL_recordsetTest::testRewind() in ezSQL_recordsetTest.php
+
+
+ testSelect +
+
+
ezSQL_sybaseTest::testSelect() in ezSQL_sybaseTest.php
+
+
+ testSelect +
+
+
ezSQL_mssqlTest::testSelect() in ezSQL_mssqlTest.php
+
+
+ testSelect +
+
+
ezSQL_postgresqlTest::testSelect() in ezSQL_postgresqlTest.php
+
+
+ testSelect +
+
+
ezSQL_mysqlTest::testSelect() in ezSQL_mysqlTest.php
+
+
+ testSelect +
+
+
ezSQL_oracle8_9Test::testSelect() in ezSQL_oracle8_9Test.php
+
+
+ testShowDatabases +
+
+
ezSQL_postgresqlTest::testShowDatabases() in ezSQL_postgresqlTest.php
+
+
+ testShowTables +
+
+
ezSQL_postgresqlTest::testShowTables() in ezSQL_postgresqlTest.php
+
+
+ testShow_errors +
+
+ +
+
+ testSQLiteCatch_error +
+
+ +
+
+ testSQLiteConnect +
+
+ +
+
+ testSQLiteDisconnect +
+
+ +
+
+ testSQLiteEscape +
+
+ +
+
+ testSQLiteGet_set +
+
+ +
+
+ testSQLiteQuery +
+
+ +
+
+ testSQLiteQuick_connect +
+
+ +
+
+ testSQLiteSelect +
+
+ +
+
+ testSQLiteSysdate +
+
+ +
+
+ testStore_cache +
+
+ +
+
+ testSysdate +
+
+
ezSQL_oracle8_9Test::testSysdate() in ezSQL_oracle8_9Test.php
+
+
+ testSysdate +
+
+
ezSQL_mysqlTest::testSysdate() in ezSQL_mysqlTest.php
+
+
+ testSysdate +
+
+
ezSQL_sybaseTest::testSysdate() in ezSQL_sybaseTest.php
+
+
+ testSysdate +
+
+
ezSQL_mssqlTest::testSysdate() in ezSQL_mssqlTest.php
+
+
+ testSysdate +
+
+
ezSQL_postgresqlTest::testSysdate() in ezSQL_postgresqlTest.php
+
+
+ testTimer_elapsed +
+
+ +
+
+ testTimer_get_cur +
+
+ +
+
+ testTimer_start +
+
+ +
+
+ testTimer_update_global +
+
+ +
+
+ testValid +
+
+
ezSQL_recordsetTest::testValid() in ezSQL_recordsetTest.php
+
+
+ testVardump +
+
+
ezSQLcoreTest::testVardump() in ezSQLcoreTest.php
+
The test echos HTML, it is just a test, that is still running
+
+
+ TEST_DB_CHARSET +
+
+
ezSQL_pdoTest::TEST_DB_CHARSET in ezSQL_pdoTest.php
+
constant string database connection charset
+
+
+ TEST_DB_CHARSET +
+
+
ezSQL_recordsetTest::TEST_DB_CHARSET in ezSQL_recordsetTest.php
+
constant database connection charset
+
+
+ TEST_DB_CHARSET +
+
+
ezSQL_mysqlTest::TEST_DB_CHARSET in ezSQL_mysqlTest.php
+
constant database connection charset
+
+
+ TEST_DB_HOST +
+
+
ezSQL_recordsetTest::TEST_DB_HOST in ezSQL_recordsetTest.php
+
constant database host
+
+
+ TEST_DB_HOST +
+
+
ezSQL_postgresqlTest::TEST_DB_HOST in ezSQL_postgresqlTest.php
+
constant database host
+
+
+ TEST_DB_HOST +
+
+
ezSQL_pdoTest::TEST_DB_HOST in ezSQL_pdoTest.php
+
constant string database host
+
+
+ TEST_DB_HOST +
+
+
ezSQL_mysqlTest::TEST_DB_HOST in ezSQL_mysqlTest.php
+
constant database host
+
+
+ TEST_DB_NAME +
+
+
ezSQL_pdoTest::TEST_DB_NAME in ezSQL_pdoTest.php
+
constant string database name
+
+
+ TEST_DB_NAME +
+
+
ezSQL_recordsetTest::TEST_DB_NAME in ezSQL_recordsetTest.php
+
constant database name
+
+
+ TEST_DB_NAME +
+
+
ezSQL_mysqlTest::TEST_DB_NAME in ezSQL_mysqlTest.php
+
constant database name
+
+
+ TEST_DB_NAME +
+
+
ezSQL_postgresqlTest::TEST_DB_NAME in ezSQL_postgresqlTest.php
+
constant database name
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_mysqlTest::TEST_DB_PASSWORD in ezSQL_mysqlTest.php
+
constant string password
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_postgresqlTest::TEST_DB_PASSWORD in ezSQL_postgresqlTest.php
+
constant string password
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_pdoTest::TEST_DB_PASSWORD in ezSQL_pdoTest.php
+
constant string password
+
+
+ TEST_DB_PASSWORD +
+
+
ezSQL_recordsetTest::TEST_DB_PASSWORD in ezSQL_recordsetTest.php
+
constant string password
+
+
+ TEST_DB_PORT +
+
+
ezSQL_pdoTest::TEST_DB_PORT in ezSQL_pdoTest.php
+
constant string database port
+
+
+ TEST_DB_PORT +
+
+
ezSQL_postgresqlTest::TEST_DB_PORT in ezSQL_postgresqlTest.php
+
constant database port
+
+
+ TEST_DB_USER +
+
+
ezSQL_recordsetTest::TEST_DB_USER in ezSQL_recordsetTest.php
+
constant string user name
+
+
+ TEST_DB_USER +
+
+
ezSQL_pdoTest::TEST_DB_USER in ezSQL_pdoTest.php
+
constant string user name
+
+
+ TEST_DB_USER +
+
+
ezSQL_mysqlTest::TEST_DB_USER in ezSQL_mysqlTest.php
+
constant string user name
+
+
+ TEST_DB_USER +
+
+
ezSQL_postgresqlTest::TEST_DB_USER in ezSQL_postgresqlTest.php
+
constant string user name
+
+
+ TEST_SQLITE_DB +
+
+
ezSQL_pdoTest::TEST_SQLITE_DB in ezSQL_pdoTest.php
+
constant string path and file name of the SQLite test database
+
+
+ +
+
u
+
top
+
+
+
+
+ $use_disk_cache +
+
+ +
Using disk cache
+
+
+ $use_trace_log +
+
+ +
Use the trace log
+
+
+ +
+
v
+
top
+
+
+
+
+ $vardump_called +
+
+ +
Vardump called
+
+
+ valid +
+
+
ezSQL_recordset::valid() in ezSQL_recordset
+
Whether the current position contains a row, or not
+
+
+ vardump +
+
+ +
Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, public or Array
+
+
+ +
+ a + c + d + e + f + g + h + i + k + l + n + o + p + q + r + s + t + u + v + _ +
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/errors.html b/_Documentation/phpDocumentator/errors.html new file mode 100644 index 00000000..09ec3d2d --- /dev/null +++ b/_Documentation/phpDocumentator/errors.html @@ -0,0 +1,206 @@ + + + + + + phpDocumentor Parser Errors and Warnings + + + + + Post-parsing
+disk_cache_example.php
+ezSQLcoreTest.php
+ezSQL_mssqlTest.php
+ezSQL_mysqlTest.php
+ezSQL_oracle8_9Test.php
+ezSQL_pdoTest.php
+ezSQL_postgresqlTest.php
+ezSQL_recordsetTest.php
+ezSQL_sybaseTest.php
+ez_sql_core_2.1_debughack_0.2alpha.php
+ez_sql_core_202console.php
+ +

Post-parsing

+

Warnings:


+Warning - Class ezSQLcoreTest parent PHPUnit_Framework_TestCase not found
+Warning - Class ezSQL_recordsetTest parent PHPUnit_Framework_TestCase not found
+Warning - Class ezSQL_mssqlTest parent PHPUnit_Framework_TestCase not found
+Warning - Class ezSQL_postgresqlTest parent PHPUnit_Framework_TestCase not found
+Warning - Class ezSQL_sybaseTest parent PHPUnit_Framework_TestCase not found
+Warning - Class ezSQL_pdoTest parent PHPUnit_Framework_TestCase not found
+Warning - Class ezSQL_oracle8_9Test parent PHPUnit_Framework_TestCase not found
+Warning - +duplicate class element "ezSQLcore" in file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_2.1_debughack_0.2alpha.php will be ignored. +Use an @ignore tag on the original if you want this case to be documented.
+Warning - Class ezSQL_mysqlTest parent PHPUnit_Framework_TestCase not found
+ +

demo.php

+

Warnings:


+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/mysql/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/mssql/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/postgresql/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/oracle8_9/demo.php
+Warning on line 10 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/pdo/demo.php
+ +

disk_cache_example.php

+

Warnings:


+Warning on line 55 - File "/home/stefanie/Projects/ezSQL/ezSQL/mysql/disk_cache_example.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+Warning on line 58 - File "/home/stefanie/Projects/ezSQL/ezSQL/oracle8_9/disk_cache_example.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQLcoreTest.php

+

Warnings:


+Warning on line 40 - Unknown tag "@covers" used
+Warning on line 51 - Unknown tag "@covers" used
+Warning on line 64 - Unknown tag "@covers" used
+Warning on line 73 - Unknown tag "@covers" used
+Warning on line 85 - Unknown tag "@covers" used
+Warning on line 92 - Unknown tag "@covers" used
+Warning on line 99 - Unknown tag "@covers" used
+Warning on line 106 - Unknown tag "@covers" used
+Warning on line 113 - Unknown tag "@covers" used
+Warning on line 120 - Unknown tag "@covers" used
+Warning on line 131 - Unknown tag "@covers" used
+Warning on line 143 - Unknown tag "@covers" used
+Warning on line 151 - Unknown tag "@covers" used
+Warning on line 158 - Unknown tag "@covers" used
+Warning on line 168 - Unknown tag "@covers" used
+Warning on line 175 - Unknown tag "@covers" used
+Warning on line 186 - Unknown tag "@covers" used
+Warning on line 193 - Unknown tag "@covers" used
+Warning on line 204 - Unknown tag "@covers" used
+Warning on line 212 - Unknown tag "@covers" used
+Warning on line 216 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/shared/ezSQLcoreTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQL_mssqlTest.php

+

Warnings:


+Warning on line 47 - Unknown tag "@covers" used
+Warning on line 58 - Unknown tag "@covers" used
+Warning on line 69 - Unknown tag "@covers" used
+Warning on line 79 - Unknown tag "@covers" used
+Warning on line 88 - Unknown tag "@covers" used
+Warning on line 96 - Unknown tag "@covers" used
+Warning on line 107 - Unknown tag "@covers" used
+Warning on line 118 - Unknown tag "@covers" used
+Warning on line 129 - Unknown tag "@covers" used
+Warning on line 136 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/mssql/ezSQL_mssqlTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQL_mysqlTest.php

+

Warnings:


+Warning on line 72 - Unknown tag "@covers" used
+Warning on line 81 - Unknown tag "@covers" used
+Warning on line 90 - Unknown tag "@covers" used
+Warning on line 102 - Unknown tag "@covers" used
+Warning on line 111 - Unknown tag "@covers" used
+Warning on line 118 - Unknown tag "@covers" used
+Warning on line 131 - Unknown tag "@covers" used
+Warning on line 157 - Unknown tag "@covers" used
+Warning on line 164 - Unknown tag "@covers" used
+Warning on line 171 - Unknown tag "@covers" used
+Warning on line 180 - Unknown tag "@covers" used
+Warning on line 193 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/mysql/ezSQL_mysqlTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQL_oracle8_9Test.php

+

Warnings:


+Warning on line 47 - Unknown tag "@covers" used
+Warning on line 58 - Unknown tag "@covers" used
+Warning on line 69 - Unknown tag "@covers" used
+Warning on line 79 - Unknown tag "@covers" used
+Warning on line 88 - Unknown tag "@covers" used
+Warning on line 95 - Unknown tag "@covers" used
+Warning on line 104 - Unknown tag "@covers" used
+Warning on line 114 - Unknown tag "@covers" used
+Warning on line 125 - Unknown tag "@covers" used
+Warning on line 136 - Unknown tag "@covers" used
+Warning on line 147 - Unknown tag "@covers" used
+Warning on line 158 - Unknown tag "@covers" used
+Warning on line 165 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQL_pdoTest.php

+

Warnings:


+Warning on line 91 - Unknown tag "@covers" used
+Warning on line 98 - Unknown tag "@covers" used
+Warning on line 105 - Unknown tag "@covers" used
+Warning on line 112 - Unknown tag "@covers" used
+Warning on line 123 - Unknown tag "@covers" used
+Warning on line 130 - Unknown tag "@covers" used
+Warning on line 139 - Unknown tag "@covers" used
+Warning on line 150 - Unknown tag "@covers" used
+Warning on line 161 - Unknown tag "@covers" used
+Warning on line 182 - Unknown tag "@covers" used
+Warning on line 189 - Unknown tag "@covers" used
+Warning on line 196 - Unknown tag "@covers" used
+Warning on line 203 - Unknown tag "@covers" used
+Warning on line 214 - Unknown tag "@covers" used
+Warning on line 221 - Unknown tag "@covers" used
+Warning on line 230 - Unknown tag "@covers" used
+Warning on line 241 - Unknown tag "@covers" used
+Warning on line 252 - Unknown tag "@covers" used
+Warning on line 263 - Unknown tag "@covers" used
+Warning on line 284 - Unknown tag "@covers" used
+Warning on line 291 - Unknown tag "@covers" used
+Warning on line 298 - Unknown tag "@covers" used
+Warning on line 305 - Unknown tag "@covers" used
+Warning on line 316 - Unknown tag "@covers" used
+Warning on line 323 - Unknown tag "@covers" used
+Warning on line 332 - Unknown tag "@covers" used
+Warning on line 343 - Unknown tag "@covers" used
+Warning on line 354 - Unknown tag "@covers" used
+Warning on line 368 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/pdo/ezSQL_pdoTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQL_postgresqlTest.php

+

Warnings:


+Warning on line 72 - Unknown tag "@covers" used
+Warning on line 80 - Unknown tag "@covers" used
+Warning on line 87 - Unknown tag "@covers" used
+Warning on line 96 - Unknown tag "@covers" used
+Warning on line 105 - Unknown tag "@covers" used
+Warning on line 112 - Unknown tag "@covers" used
+Warning on line 123 - Unknown tag "@covers" used
+Warning on line 139 - Unknown tag "@covers" used
+Warning on line 151 - Unknown tag "@covers" used
+Warning on line 162 - Unknown tag "@covers" used
+Warning on line 171 - Unknown tag "@covers" used
+Warning on line 178 - Unknown tag "@covers" used
+Warning on line 184 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQL_recordsetTest.php

+

Warnings:


+Warning on line 90 - Unknown tag "@covers" used
+Warning on line 105 - Unknown tag "@covers" used
+Warning on line 116 - Unknown tag "@covers" used
+Warning on line 127 - Unknown tag "@covers" used
+Warning on line 138 - Unknown tag "@covers" used
+Warning on line 151 - Unknown tag "@covers" used
+Warning on line 158 - Unknown tag "@covers" used
+Warning on line 169 - Unknown tag "@covers" used
+Warning on line 180 - Unknown tag "@covers" used
+Warning on line 188 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/shared/ezSQL_recordsetTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ezSQL_sybaseTest.php

+

Warnings:


+Warning on line 47 - Unknown tag "@covers" used
+Warning on line 58 - Unknown tag "@covers" used
+Warning on line 69 - Unknown tag "@covers" used
+Warning on line 79 - Unknown tag "@covers" used
+Warning on line 88 - Unknown tag "@covers" used
+Warning on line 96 - Unknown tag "@covers" used
+Warning on line 107 - Unknown tag "@covers" used
+Warning on line 118 - Unknown tag "@covers" used
+Warning on line 129 - Unknown tag "@covers" used
+Warning on line 136 - File "/home/stefanie/Projects/ezSQL/ezSQL/_Test/unit_tests/sybase/ezSQL_sybaseTest.php" has no page-level DocBlock, use @package in the first DocBlock to create one
+ +

ez_sql_core_2.1_debughack_0.2alpha.php

+

Warnings:


+Warning on line 67 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_2.1_debughack_0.2alpha.php
+Warning on line 82 - no @package tag was used in a DocBlock for class ezSQLcore
+ +

ez_sql_core_202console.php

+

Warnings:


+Warning on line 30 - no @package tag was used in a DocBlock for file /home/stefanie/Projects/ezSQL/ezSQL/shared/ez_sql_core_202console.php
+Warning on line 45 - no @package tag was used in a DocBlock for class ezSQLcore
+

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html b/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html new file mode 100644 index 00000000..03900f5c --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_codeigniter---Ezsql_codeigniter.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_codeigniter + + + + +
+

/codeigniter/Ezsql_codeigniter.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_codeigniter
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_codeigniter + + ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html b/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html new file mode 100644 index 00000000..37f86791 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_mssql---ez_sql_mssql.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_mssql + + + + +
+

/mssql/ez_sql_mssql.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.

+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_mssql + + ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class. +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html b/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html new file mode 100644 index 00000000..60d7ad60 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_mysql---ez_sql_mysql.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_mysql + + + + +
+

/mysql/ez_sql_mysql.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_mysql
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_mysql + + ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html b/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html new file mode 100644 index 00000000..5339246f --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_oracle8_9---ez_sql_oracle8_9.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_oracle8_9 + + + + +
+

/oracle8_9/ez_sql_oracle8_9.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_oracle8_9
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_oracle8_9 + + ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html b/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html new file mode 100644 index 00000000..33449c92 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_pdo---ez_sql_pdo.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_pdo + + + + +
+

/pdo/ez_sql_pdo.php

+ + +
+
Description
+ +
+ +

ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_pdo
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_pdo + + ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html b/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html new file mode 100644 index 00000000..8b335f54 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_postgresql---ez_sql_postgresql.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_postgresql + + + + +
+

/postgresql/ez_sql_postgresql.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_postgresql
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_postgresql + + ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html new file mode 100644 index 00000000..832585a4 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_core.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL + + + + +
+

/shared/ez_sql_core.php

+ + +
+
Description
+ +
+ +

ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).

+
    +
  • author: Justin Vincent (jv@vip.ie)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://justinvincent.com
  • +
  • name: ezSQL
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQLcore + + ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules). +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_recordset.php.html b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_recordset.php.html new file mode 100644 index 00000000..3f563678 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_shared---ez_sql_recordset.php.html @@ -0,0 +1,66 @@ + + + + + + Docs for page ezSQL_recordset + + + + +
+

/shared/ez_sql_recordset.php

+ + +
+
Description
+ +
+ +

ezSQL Database specific class for working with query results Desc..: recordset component (part of ezSQL databse abstraction library)

+
    +
  • author: Stefanie Janine Stoelting
  • +
  • name: ezSQL_recordset
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_recordset + + ezSQL Database specific class for working with query results Desc..: recordset component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html b/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html new file mode 100644 index 00000000..dca5966c --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_sqlite---ez_sql_sqlite.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_sqlite + + + + +
+

/sqlite/ez_sql_sqlite.php

+ + +
+
Description
+ +
+ +

ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_sqlite
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_sqlite + + ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library) +
+
+
+ + + + + +

+ Documentation generated on Fri, 06 Apr 2012 10:51:40 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html b/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html new file mode 100644 index 00000000..4ca0b8d7 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/_sybase---ez_sql_sybase.php.html @@ -0,0 +1,68 @@ + + + + + + Docs for page ezSQL_sybase + + + + +
+

/sybase/ez_sql_sybase.php

+ + +
+
Description
+ +
+ +

ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.

+
    +
  • author: Muhammad Iyas (iyasilias@gmail.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link:
  • +
  • name: ezSQL_sybase
  • +
  • license: FREE
  • +
+ +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_sybase + + ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class. +
+
+
+ + + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html new file mode 100644 index 00000000..dc431433 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_codeigniter.html @@ -0,0 +1,439 @@ + + + + + + Docs For Class ezSQL_codeigniter + + + + +
+

Class ezSQL_codeigniter

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_codeigniter
  • +
  • license: FREE
  • +
+

+ Located in /codeigniter/Ezsql_codeigniter.php (line 15) +

+ + +
ezSQLcore
+   |
+   --ezSQL_codeigniter
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $debug +
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_codeigniter + __construct + () +
+
+ string + escape + (string $str, [boolean $like = false]) +
+
+ boolean|int + query + (string $query) +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + boolean + $debug + = true (line 21) + +
+ + +

Run in debug mode

+
    +
  • var: Default is true
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $show_errors + = true (line 27) + +
+ + +

Show errors

+
    +
  • var: Default is true
  • +
  • access: public
  • +
+ + + + + +
+

Inherited Variables

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::$affectedRows
+
+ + ezSQLcore::$cache_dir
+
+ + ezSQLcore::$cache_inserts
+
+ + ezSQLcore::$cache_queries
+
+ + ezSQLcore::$cache_timeout
+
+ + ezSQLcore::$captured_errors
+
+ + ezSQLcore::$col_info
+
+ + ezSQLcore::$connected
+
+ + ezSQLcore::$dbh
+
+ + ezSQLcore::$db_connect_time
+
+ + ezSQLcore::$debug_all
+
+ + ezSQLcore::$debug_called
+
+ + ezSQLcore::$debug_echo_is_on
+
+ + ezSQLcore::$do_profile
+
+ + ezSQLcore::$from_disk_cache
+
+ + ezSQLcore::$last_error
+
+ + ezSQLcore::$last_query
+
+ + ezSQLcore::$last_result
+
+ + ezSQLcore::$num_queries
+
+ + ezSQLcore::$profile_times
+
+ + ezSQLcore::$sql_log_file
+
+ + ezSQLcore::$timers
+
+ + ezSQLcore::$total_query_time
+
+ + ezSQLcore::$trace
+
+ + ezSQLcore::$trace_log
+
+ + ezSQLcore::$use_disk_cache
+
+ + ezSQLcore::$use_trace_log
+
+ + ezSQLcore::$vardump_called
+
+
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 33) +
+ + +
    +
  • throws: Exception Requires ez_sql_core.php
  • +
+ +
+ ezSQL_codeigniter + + __construct + + () +
+ + +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ escape (line 164) +
+ + +

Format a sql string correctly for safe insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str, [boolean $like = false]) +
+ +
    +
  • + string + $str
  • +
  • + boolean + $like
  • +
+ + +
+ +
+ +
+ query (line 49) +
+ + +

Perform codignitor query and try to determine result value

+
    +
  • access: public
  • +
+ +
+ boolean|int + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::affectedRows()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::getShowErrors()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html new file mode 100644 index 00000000..26b8564a --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_mssql.html @@ -0,0 +1,668 @@ + + + + + + Docs For Class ezSQL_mssql + + + + +
+

Class ezSQL_mssql

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class.

+ +

+ Located in /mssql/ez_sql_mssql.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_mssql
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_mssql + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToMSSqlQuery = true]) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+
+ string + ConvertMySqlToMSSql + (string $query) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBHost + () +
+
+ boolean + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+
+ boolean + select + ([string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + +
+
Variables
+ + +
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 81) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mssql class

+
    +
  • throws: Exception Requires ntwdblib.dll and ez_sql_core.php
  • +
  • access: public
  • +
+ +
+ ezSQL_mssql + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToMSSqlQuery = true]) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + boolean + $convertMySqlToMSSqlQuery: Default is true
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 125) +
+ + +

Try to connect to mssql database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ ConvertMySqlToMSSql (line 368) +
+ + +

Convert a Query From MySql Syntax to MS-Sql syntax Following conversions are made:

  1. The '`' character used for MySql queries is not supported - + the character is removed.

+

2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with getDate(). Warning: This logic may not be right. 3. unix_timestamp function is removed. 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested.

Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. This method doesn't at all guarantee complete conversion. Certain queries will still not work. e.g. MS SQL requires all columns in Select Clause to be present in 'group by' clause. There is no such restriction in MySql.

+
    +
  • access: public
  • +
+ +
+ string + + ConvertMySqlToMSSql + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ disconnect (line 407) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 182) +
+ + +

Format a mssql string correctly for safe mssql insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBHost (line 419) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ query (line 226) +
+ + +

Perform the mssql query and try to determine the result value

+
    +
  • access: public
  • +
+ +
+ boolean + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 109) +
+ + +

Short hand way to connect to mssql database server and select a mssql database at the same time

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ select (line 153) +
+ + +

Try to select a mssql database

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbname = '']) +
+ +
    +
  • + string + $dbname: The name of the database
  • +
+ + +
+ +
+ +
+ sysdate (line 215) +
+ + +

Return mssql specific system date syntax i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::affectedRows()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::getShowErrors()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_mysql.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_mysql.html new file mode 100644 index 00000000..162c023e --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_mysql.html @@ -0,0 +1,692 @@ + + + + + + Docs For Class ezSQL_mysql + + + + +
+

Class ezSQL_mysql

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_mysql
  • +
  • license: FREE
  • +
+

+ Located in /mysql/ez_sql_mysql.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_mysql
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_mysql + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $charset = '']) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost'], [type $charset = '']) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getCharset + () +
+
+ string + getDBHost + () +
+
+ int + getInsertId + () +
+
+ boolean + query + (type $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+
+ boolean + select + ([string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + +
+
Variables
+ + +
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 78) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_mysql class

+
    +
  • access: public
  • +
+ +
+ ezSQL_mysql + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $charset = '']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $charset: The database charset Default is empty string
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 126) +
+ + +

Try to connect to mySQL database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost'], [type $charset = '']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + type + $charset: The database charset Default is empty string
  • +
+ + +
+ +
+ +
+ disconnect (line 302) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 189) +
+ + +

Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getCharset (line 325) +
+ + +

Returns the current connection charset

+
    +
  • access: public
  • +
+ +
+ string + + getCharset + + () +
+ + + +
+ +
+ +
+ getDBHost (line 316) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ getInsertId (line 334) +
+ + +

Returns the last inserted autoincrement

+
    +
  • access: public
  • +
+ +
+ int + + getInsertId + + () +
+ + + +
+ +
+ +
+ query (line 209) +
+ + +

Perform mySQL query and try to determine result value

+
    +
  • access: public
  • +
+ +
+ boolean + + query + + (type $query) +
+ +
    +
  • + type + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 108) +
+ + +

Short hand way to connect to mssql database server and select a mssql database at the same time

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ select (line 156) +
+ + +

Try to select a mySQL database

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbname = '']) +
+ +
    +
  • + string + $dbname: The name of the database
  • +
+ + +
+ +
+ +
+ sysdate (line 199) +
+ + +

Return mySQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::affectedRows()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::getShowErrors()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_oracle8_9.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_oracle8_9.html new file mode 100644 index 00000000..05c6b928 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_oracle8_9.html @@ -0,0 +1,767 @@ + + + + + + Docs For Class ezSQL_oracle8_9 + + + + +
+

Class ezSQL_oracle8_9

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_oracle8_9
  • +
  • license: FREE
  • +
+

+ Located in /oracle8_9/ez_sql_oracle8_9.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_oracle8_9
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_oracle8_9 + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBName + () +
+
+ string + insert_id + (string $seq_name) +
+
+ string + is_equal_int + (string $int) +
+
+ string + is_equal_str + ([string $str = '']) +
+
+ string + nextVal + (string $seq_name) +
+
+ object + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ boolean + select + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + +
+
Variables
+ + +
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 62) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_oracle8_9 class

+
    +
  • throws: Exception Requires Orcle OCI Lib and ez_sql_core.php
  • +
  • access: public
  • +
+ +
+ ezSQL_oracle8_9 + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 92) +
+ + +

Try to connect to Oracle database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ disconnect (line 348) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 154) +
+ + +

Format a Oracle string correctly for safe Oracle insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBName (line 360) +
+ + +

Returns the current database name

+
    +
  • access: public
  • +
+ +
+ string + + getDBName + + () +
+ + + +
+ +
+ +
+ insert_id (line 230) +
+ + +

Another oracle specific function - if you have set up a sequence this function returns the next ID from that sequence If the sequence is not defined, the sequence is created by this method.

+

Though be shure, that you use the correct sequence name not to end in more than one sequence for a primary key of a table.

+
    +
  • access: public
  • +
+ +
+ string + + insert_id + + (string $seq_name) +
+ +
    +
  • + string + $seq_name: Name of the sequenze
  • +
+ + +
+ +
+ +
+ is_equal_int (line 216) +
+ + +

Returns an equal string for integer values

+
    +
  • access: public
  • +
+ +
+ string + + is_equal_int + + (string $int) +
+ +
    +
  • + string + $int
  • +
+ + +
+ +
+ +
+ is_equal_str (line 206) +
+ + +

Returns an escaped equal string

+
    +
  • access: public
  • +
+ +
+ string + + is_equal_str + + ([string $str = '']) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ nextVal (line 250) +
+ + +

An alias for insert_id using the original Oracle function name.

+
    +
  • access: public
  • +
+ +
+ string + + nextVal + + (string $seq_name) +
+ +
    +
  • + string + $seq_name: Name of the sequenze
  • +
+ + +
+ +
+ +
+ query (line 260) +
+ + +

Perform Oracle query and try to determine result value

+
    +
  • access: public
  • +
+ +
+ object + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 128) +
+ + +

In the case of Oracle quick_connect is not really needed because std.

+

connect already does what quick connect does - but for the sake of consistency it has been included

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ select (line 144) +
+ + +

No real equivalent of mySQL select in Oracle, once again, function included for the sake of consistency

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ sysdate (line 187) +
+ + +

Return Oracle specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::affectedRows()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::getShowErrors()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_pdo.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_pdo.html new file mode 100644 index 00000000..19a559ca --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_pdo.html @@ -0,0 +1,687 @@ + + + + + + Docs For Class ezSQL_pdo + + + + +
+

Class ezSQL_pdo

+ + +
+
Description
+ +
+ +

ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_pdo
  • +
  • license: FREE
  • +
+

+ Located in /pdo/ez_sql_pdo.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_pdo
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_pdo + __construct + ([string $dsn = ''], [string $user = ''], [string $password = ''], [array $options = array()], [boolean $isFileBased = false]) +
+
+ string + catch_error + () +
+
+ boolean + connect + ([string $dsn = ''], [string $dbuser = ''], [string $dbpassword = ''], [array $options = array()], [boolean $isFileBased = false]) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + get_set + (array $params) +
+
+ object + query + (type $query) +
+
+ boolean + quick_connect + ([string $dsn = ''], [string $user = ''], [string $password = ''], [array $options = array()], [boolean $isFileBased = false]) +
+
+ boolean + select + ([string $dsn = ''], [string $user = ''], [string $password = ''], [array $options = array()], [boolean $isFileBased = false]) +
+
+ string + sysdate + () +
+
+
+
+ + +
+
Variables
+ + +
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 81) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class

+
    +
  • access: public
  • +
+ +
+ ezSQL_pdo + + __construct + + ([string $dsn = ''], [string $user = ''], [string $password = ''], [array $options = array()], [boolean $isFileBased = false]) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $user: The database user name Default is empty string
  • +
  • + string + $password: The database password Default is empty string
  • +
  • + array + $options: Array for setting connection options as MySQL charset for example Default is an empty array
  • +
  • + boolean + $isFileBased: File based databases like SQLite don't need user and password, they work with path in the dsn parameter Default is false
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ catch_error (line 249) +
+ + +

Hooks into PDO error system and reports it to user

+
    +
  • access: public
  • +
+ +
+ string + + catch_error + + () +
+ + + +
+ +
+ +
+ connect (line 118) +
+ + +

Try to connect to the database server in the DSN parameters

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dsn = ''], [string $dbuser = ''], [string $dbpassword = ''], [array $options = array()], [boolean $isFileBased = false]) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database password Default is empty string
  • +
  • + array + $options: Array for setting connection options as MySQL charset for example Default is an empty array
  • +
  • + boolean + $isFileBased: File based databases like SQLite don't need user and password, they work with path in the dsn parameter Default is false
  • +
+ + +
+ +
+ +
+ disconnect (line 400) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 222) +
+ + +

Escape a string with the PDO method

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ get_set (line 425) +
+ + +

Creates a SET nvp sql string from an associative array (and escapes all values)

+

$db_data = array('login'=>'jv','email'=>'jv@vip.ie', 'user_id' => 1, 'created' => 'NOW()');

$db->query("INSERT INTO users SET ".$db->get_set($db_data));

...OR...

$db->query("UPDATE users SET ".$db->get_set($db_data)." WHERE user_id = 1");

Output:

login = 'jv', email = 'jv@vip.ie', user_id = 1, created = NOW()

+
    +
  • access: public
  • +
+ +
+ string + + get_set + + (array $params) +
+ +
    +
  • + array + $params
  • +
+ + +
+ +
+ +
+ query (line 278) +
+ + +

Basic Query - see docs for more detail

+
    +
  • access: public
  • +
+ +
+ object + + query + + (type $query) +
+ +
    +
  • + type + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 180) +
+ + +

With PDO it is only an alias for the connect method

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dsn = ''], [string $user = ''], [string $password = ''], [array $options = array()], [boolean $isFileBased = false]) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $user: The database user name Default is empty string
  • +
  • + string + $password: The database password Default is empty string
  • +
  • + array + $options: Array for setting connection options as MySQL charset for example Default is an empty array
  • +
  • + boolean + $isFileBased: File based databases like SQLite don't need user and password, they work with path in the dsn parameter Default is false
  • +
+ + +
+ +
+ +
+ select (line 207) +
+ + +

With PDO it is only an alias for the connect method

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dsn = ''], [string $user = ''], [string $password = ''], [array $options = array()], [boolean $isFileBased = false]) +
+ +
    +
  • + string + $dsn: The connection parameter string Default is empty string
  • +
  • + string + $user: The database user name Default is empty string
  • +
  • + string + $password: The database password Default is empty string
  • +
  • + array + $options: Array for setting connection options as MySQL charset for example Default is an empty array
  • +
  • + boolean + $isFileBased: File based databases like SQLite don't need user and password, they work with path in the dsn parameter Default is false
  • +
+ + +
+ +
+ +
+ sysdate (line 240) +
+ + +

Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::affectedRows()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::getShowErrors()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_postgresql.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_postgresql.html new file mode 100644 index 00000000..47330b41 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_postgresql.html @@ -0,0 +1,771 @@ + + + + + + Docs For Class ezSQL_postgresql + + + + +
+

Class ezSQL_postgresql

+ + +
+
Description
+ +
+ +

ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_postgresql
  • +
  • license: FREE
  • +
+

+ Located in /postgresql/ez_sql_postgresql.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_postgresql
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_postgresql + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+
+ string + descTable + (string $tbl_name) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBHost + () +
+
+ string + getPort + () +
+
+ boolean + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+
+ boolean + select + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+
+ string + showDatabases + () +
+
+ string + showTables + () +
+
+ string + sysdate + () +
+
+
+
+ + +
+
Variables
+ + +
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 77) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_postgresql class

+
    +
  • access: public
  • +
+ +
+ ezSQL_postgresql + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $dbport: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 131) +
+ + +

Try to connect to PostgreSQL database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $dbport: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ + +
+ +
+ +
+ descTable (line 213) +
+ + +

Return the description of the given table

+
    +
  • access: public
  • +
+ +
+ string + + descTable + + (string $tbl_name) +
+ +
    +
  • + string + $tbl_name: The table name
  • +
+ + +
+ +
+ +
+ disconnect (line 341) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 183) +
+ + +

Format a mySQL string correctly for safe mySQL insert (no matter if magic quotes are on or not)

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBHost (line 353) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ getPort (line 362) +
+ + +

Returns the current TCP/IP port

+
    +
  • access: public
  • +
+ +
+ string + + getPort + + () +
+ + + +
+ +
+ +
+ query (line 232) +
+ + +

Perform PostgreSQL query and try to detirmin result value

+
    +
  • access: public
  • +
+ +
+ boolean + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 108) +
+ + +

In the case of PostgreSQL quick_connect is not really needed because std.

+

connect already does what quick connect does - but for the sake of consistency it has been included

+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $dbport: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ + +
+ +
+ +
+ select (line 168) +
+ + +

No real equivalent of mySQL select in PostgreSQL once again, function included for the sake of consistency

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [string $dbport = '5432']) +
+ +
    +
  • + string + $dbuser: The database user name
  • +
  • + string + $dbpassword: The database users password
  • +
  • + string + $dbname: The name of the database
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + string + $dbport: The database TCP/IP port Default is PostgreSQL default port 5432
  • +
+ + +
+ +
+ +
+ showDatabases (line 222) +
+ + +

Return all databases of the current server

+
    +
  • access: public
  • +
+ +
+ string + + showDatabases + + () +
+ + + +
+ +
+ +
+ showTables (line 203) +
+ + +

Return PostgreSQL specific values: Return all tables of the current schema

+
    +
  • access: public
  • +
+ +
+ string + + showTables + + () +
+ + + +
+ +
+ +
+ sysdate (line 193) +
+ + +

Return PostgreSQL specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::affectedRows()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::getShowErrors()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_recordset.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_recordset.html new file mode 100644 index 00000000..f37388b7 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_recordset.html @@ -0,0 +1,510 @@ + + + + + + Docs For Class ezSQL_recordset + + + + +
+

Class ezSQL_recordset

+ + +
+
Description
+ +
+

+ Implements interfaces: +

    +
  • Iterator (internal interface)
+

+ +

ezSQL Database specific class for working with query results Desc..: recordset component (part of ezSQL databse abstraction library)

+
    +
  • author: Stefanie Janine Stoelting
  • +
  • name: ezSQL_recordset
  • +
  • license: FREE
  • +
+

+ Located in /shared/ez_sql_recordset.php (line 12) +

+ + +

+	
+			
+
+ + + +
+
Class Constant Summary
+ +
+
+
+ RESULT_AS_ARRAY = 'array' + +
+
+ RESULT_AS_OBJECT = 'object' + +
+
+ RESULT_AS_ROW = 'row' + +
+
+
+
+ + + +
+
Method Summary
+ +
+
+ +
+ ezSQL_recordset + __construct + (array $ezSQL_queryresult) +
+
+ stdClass/array + current + ([string $mode = self::RESULT_AS_OBJECT]) +
+
+ array + ezSQL_fetch_assoc + () +
+
+ array + ezSQL_fetch_object + () +
+
+ array + ezSQL_fetch_row + () +
+
+ int + key + () +
+
+ void + next + () +
+
+ void + previous + () +
+
+ void + rewind + () +
+
+ boolean + valid + () +
+
+
+
+ + + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 58) +
+ + +

Initializes the record object

+
    +
  • throws: Exception When $ezSQL_queryresult is not an array
  • +
  • access: public
  • +
+ +
+ ezSQL_recordset + + __construct + + (array $ezSQL_queryresult) +
+ +
    +
  • + array + $ezSQL_queryresult: The result of an ezSQL query
  • +
+ + +
+ +
+ +
+ current (line 82) +
+ + +

Returns the current row of the recordset as stdClass, which is the default mode, or as array as fieldname - fieldvalue.

+
    +
  • access: public
  • +
+ +
+ stdClass/array + + current + + ([string $mode = self::RESULT_AS_OBJECT]) +
+ +
    +
  • + string + $mode: Return the current row as array, or object Default is RESULT_AS_OBJECT
  • +
+ +
+
Implementation of:
+
+
Iterator::current
+
+ +
+ +
+ +
+ ezSQL_fetch_assoc (line 163) +
+ + +

Behaves like mysql_fetch_assoc. This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_assoc.

+

It returns the current record as an associative array and moves the internal data pointer ahead.

+
    +
  • access: public
  • +
+ +
+ array + + ezSQL_fetch_assoc + + () +
+ + + +
+ +
+ +
+ ezSQL_fetch_object (line 201) +
+ + +

Behaves like mysql_fetch_object This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_object.

+

It returns n object with properties that correspond to the fetched row and moves the internal data pointer ahead.

+
    +
  • access: public
  • +
+ +
+ array + + ezSQL_fetch_object + + () +
+ + + +
+ +
+ +
+ ezSQL_fetch_row (line 182) +
+ + +

Behaves like mysql_fetch_row This method it to implement ezSQL easier in an existing system, that made us of mysql_fetch_row.

+

It returns the current record as a numeric array and moves the internal data pointer ahead.

+
    +
  • access: public
  • +
+ +
+ array + + ezSQL_fetch_row + + () +
+ + + +
+ +
+ +
+ key (line 123) +
+ + +

Returns the current position in the recordset

+
    +
  • access: public
  • +
+ +
+ int + + key + + () +
+ + +
+
Implementation of:
+
+
Iterator::key
+
+ +
+ +
+ +
+ next (line 130) +
+ + +

Sets the position of the recordset up by one

+
    +
  • access: public
  • +
+ +
+ void + + next + + () +
+ + +
+
Implementation of:
+
+
Iterator::next
+
+ +
+ +
+ +
+ previous (line 138) +
+ + +

Sets position of the recordset down by one, if the position is below the

+

start, the position is set to the start position

+
    +
  • access: public
  • +
+ +
+ void + + previous + + () +
+ + + +
+ +
+ +
+ rewind (line 70) +
+ + +

Sets the position to zero

+
    +
  • access: public
  • +
+ +
+ void + + rewind + + () +
+ + +
+
Implementation of:
+
+
Iterator::rewind
+
+ +
+ +
+ +
+ valid (line 151) +
+ + +

Whether the current position contains a row, or not

+
    +
  • access: public
  • +
+ +
+ boolean + + valid + + () +
+ + +
+
Implementation of:
+
+
Iterator::valid
+
+ +
+ +
+
+ + +
+
Class Constants
+ +
+ +
+ +
+ + RESULT_AS_ARRAY + = 'array' + (line 17) + +
+ + +

Returns the result as array

+ + +
+ +
+ +
+ + RESULT_AS_OBJECT + = 'object' + (line 22) + +
+ + +

Returns the result as object of stdClass

+ + +
+ +
+ +
+ + RESULT_AS_ROW + = 'row' + (line 27) + +
+ + +

Returns the result as numeric array

+ + +
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_sqlite.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_sqlite.html new file mode 100644 index 00000000..68af18d2 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_sqlite.html @@ -0,0 +1,578 @@ + + + + + + Docs For Class ezSQL_sqlite + + + + +
+

Class ezSQL_sqlite

+ + +
+
Description
+ +
+ +

ezSQL class - SQLite Desc..: SQLite component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • name: ezSQL_sqlite
  • +
  • license: FREE
  • +
+

+ Located in /sqlite/ez_sql_sqlite.php (line 14) +

+ + +
ezSQLcore
+   |
+   --ezSQL_sqlite
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_sqlite + __construct + ([string $dbpath = ''], [string $dbname = '']) +
+
+ boolean + connect + ([string $dbpath = ''], [string $dbname = '']) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ object + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbpath = ''], [string $dbname = '']) +
+
+ boolean + select + ([string $dbpath = ''], [string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + +
+
Variables
+ + +
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 40) +
+ + +

Constructor - allow the user to perform a qucik connect at the same time as initialising the ezSQL_sqlite class

+
    +
  • access: public
  • +
+ +
+ ezSQL_sqlite + + __construct + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 67) +
+ + +

Try to connect to SQLite database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ disconnect (line 221) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 121) +
+ + +

Format a SQLite string correctly for safe SQLite insert (no matter if magic quotes are on or not)

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ query (line 142) +
+ + +

Perform SQLite query and try to detirmin result value Basic Query - see docs for more detail

+
    +
  • access: public
  • +
+ +
+ object + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 96) +
+ + +

In the case of SQLite quick_connect is not really needed because std.

+

connect already does what quick connect does - but for the sake of consistency it has been included

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ select (line 110) +
+ + +

No real equivalent of mySQL select in SQLite once again, function included for the sake of consistency

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbpath = ''], [string $dbname = '']) +
+ +
    +
  • + string + $dbpath: Path to the SQLite file Default is empty string
  • +
  • + string + $dbname: Name of the database Default is empty string
  • +
+ + +
+ +
+ +
+ sysdate (line 131) +
+ + +

Return SQLite specific system date syntax i.e. Oracle: SYSDATE Mysql: NOW()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_set()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Fri, 06 Apr 2012 10:51:40 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQL_sybase.html b/_Documentation/phpDocumentator/ezSQL/ezSQL_sybase.html new file mode 100644 index 00000000..03ac6309 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQL_sybase.html @@ -0,0 +1,667 @@ + + + + + + Docs For Class ezSQL_sybase + + + + +
+

Class ezSQL_sybase

+ + +
+
Description
+ +
+ +

ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class.

+
    +
  • author: Muhammad Iyas (iyasilias@gmail.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link:
  • +
  • name: ezSQL_sybase
  • +
  • license: FREE
  • +
+

+ Located in /sybase/ez_sql_sybase.php (line 15) +

+ + +
ezSQLcore
+   |
+   --ezSQL_sybase
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+
+ boolean + $show_errors +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ ezSQL_sybase + __construct + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToSybaseQuery = true]) +
+
+ boolean + connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+
+ string + ConvertMySqlTosybase + (string $query) +
+
+ void + disconnect + () +
+
+ string + escape + (string $str) +
+
+ string + getDBHost + () +
+
+ object + query + (string $query) +
+
+ boolean + quick_connect + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+
+ boolean + select + ([string $dbname = '']) +
+
+ string + sysdate + () +
+
+
+
+ + +
+
Variables
+ + +
+ + +
+
Methods
+ +
+ + + +
+ +
+ Constructor __construct (line 85) +
+ + +
    +
  • throws: Exception Requires ntwdblib.dll and ez_sql_core.php
  • +
  • access: public
  • +
+ +
+ ezSQL_sybase + + __construct + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost'], [boolean $convertMySqlToSybaseQuery = true]) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
  • + boolean + $convertMySqlToSybaseQuery: Default is true
  • +
+ +
+
Redefinition of:
+
+
ezSQLcore::__construct()
+
Constructor of ezSQL
+
+ +
+ +
+ +
+ connect (line 135) +
+ + +

Try to connect to sybase database server

+
    +
  • access: public
  • +
+ +
+ boolean + + connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ ConvertMySqlTosybase (line 377) +
+ + +

Convert a Query From MySql Syntax to Sybase syntax Following conversions are made:

  1. The '`' character used for MySql queries is not supported - the + character is removed.

+

2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with getDate(). Warning: This logic may not be right. 3. unix_timestamp function is removed. 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested.

Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. This method doesn't at all guarantee complete conversion. Certain queries will still not work.

+
    +
  • access: public
  • +
+ +
+ string + + ConvertMySqlTosybase + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ disconnect (line 421) +
+ + +

Close the database connection

+
    +
  • access: public
  • +
+ +
+ void + + disconnect + + () +
+ + + +
+ +
+ +
+ escape (line 197) +
+ + +

Format a sybase string correctly for safe sybase insert

+
    +
  • access: public
  • +
+ +
+ string + + escape + + (string $str) +
+ +
    +
  • + string + $str
  • +
+ + +
+ +
+ +
+ getDBHost (line 433) +
+ + +

Returns the current database server host

+
    +
  • access: public
  • +
+ +
+ string + + getDBHost + + () +
+ + + +
+ +
+ +
+ query (line 240) +
+ + +

Perform sybase query and try to detirmin result value

+
    +
  • access: public
  • +
+ +
+ object + + query + + (string $query) +
+ +
    +
  • + string + $query
  • +
+ + +
+ +
+ +
+ quick_connect (line 117) +
+ + +

Short hand way to connect to sybase database server and select a sybase database at the same time

+
    +
  • access: public
  • +
+ +
+ boolean + + quick_connect + + ([string $dbuser = ''], [string $dbpassword = ''], [string $dbname = ''], [string $dbhost = 'localhost']) +
+ +
    +
  • + string + $dbuser: The database user name Default is empty string
  • +
  • + string + $dbpassword: The database users password Default is empty string
  • +
  • + string + $dbname: The name of the database Default is empty string
  • +
  • + string + $dbhost: The host name or IP address of the database server. Default is localhost
  • +
+ + +
+ +
+ +
+ select (line 166) +
+ + +

Try to select a sybase database

+
    +
  • access: public
  • +
+ +
+ boolean + + select + + ([string $dbname = '']) +
+ +
    +
  • + string + $dbname
  • +
+ + +
+ +
+ +
+ sysdate (line 230) +
+ + +

Return sybase specific system date syntax i.e. Oracle: SYSDATE sybase: getDate()

+
    +
  • access: public
  • +
+ +
+ string + + sysdate + + () +
+ + + +
+

Inherited Methods

+ + +

Inherited From ezSQLcore

+
+ ezSQLcore::__construct()
+ ezSQLcore::affectedRows()
+ ezSQLcore::debug()
+ ezSQLcore::donation()
+ ezSQLcore::dumpvar()
+ ezSQLcore::flush()
+ ezSQLcore::getShowErrors()
+ ezSQLcore::get_cache()
+ ezSQLcore::get_col()
+ ezSQLcore::get_col_info()
+ ezSQLcore::get_results()
+ ezSQLcore::get_row()
+ ezSQLcore::get_var()
+ ezSQLcore::hide_errors()
+ ezSQLcore::isConnected()
+ ezSQLcore::register_error()
+ ezSQLcore::show_errors()
+ ezSQLcore::store_cache()
+ ezSQLcore::timer_elapsed()
+ ezSQLcore::timer_get_cur()
+ ezSQLcore::timer_start()
+ ezSQLcore::timer_update_global()
+ ezSQLcore::vardump()
+
+ +
+
+ + +
+
Class Constants
+ +
+

Inherited Constants

+ +

Inherited from ezSQLcore

+
+ + ezSQLcore::ARRAY_A
+
+ + ezSQLcore::ARRAY_N
+
+ + ezSQLcore::EZSQL_VERSION
+
+ + ezSQLcore::OBJECT
+
+
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/ezSQLcore.html b/_Documentation/phpDocumentator/ezSQL/ezSQLcore.html new file mode 100644 index 00000000..6acae62d --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/ezSQLcore.html @@ -0,0 +1,1865 @@ + + + + + + Docs For Class ezSQLcore + + + + +
+

Class ezSQLcore

+ + +
+
Description
+ +
+ +

ezSQL Core module - database abstraction library to make it very easy to deal with databases. ezSQLcore can not be used by itself (it is designed for use by database specific modules).

+
    +
  • author: Justin Vincent (jv@vip.ie)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://justinvincent.com
  • +
  • name: ezSQL
  • +
  • license: FREE
  • +
+

+ Located in /shared/ez_sql_core.php (line 14) +

+ + +

+	
+			
+
+ + +
+
Direct descendents
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ClassDescription
ezSQL_postgresql + ezSQL Database specific class - PostgreSQL Desc..: PostgreSQL component (part of ezSQL databse abstraction library) +
ezSQL_codeigniter + ezSQL Database specific class - codeigniter Desc..: codeigniter component (part of ezSQL databse abstraction library) +
ezSQL_mssql + ezSQL Database specific class - mssql Microsoft Sql Server component (part of ezSQL databse abstraction library) - based on ezSql_mySql library class. +
ezSQL_pdo + ezSQL class - PDO Desc..: PDO component (part of ezSQL databse abstraction library) +
ezSQL_sybase + ezSQL class - Sybase ASE Desc..: Sybase ASE component (part of ezSQL database abstraction library) - based on ezSql_mssql library class. +
ezSQL_oracle8_9 + ezSQL Database specific class - Oracle 8 and 9 Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library) +
ezSQL_mysql + ezSQL Database specific class - mySQL Desc..: mySQL component (part of ezSQL databse abstraction library) +
+
+
+ + +
+
Class Constant Summary
+ +
+
+
+ ARRAY_A = true + +
+
+ ARRAY_N = true + +
+
+ EZSQL_VERSION = '3.02' + +
+
+ OBJECT = true + +
+
+
+
+ + +
+
Variable Summary
+ +
+
+
+ int + $affectedRows +
+
+ boolean + $cache_dir +
+
+ boolean + $cache_inserts +
+
+ boolean + $cache_queries +
+
+ integer + $cache_timeout +
+
+ array + $captured_errors +
+
+ object Default + $col_info +
+
+ boolean + $connected +
+
+ object Default + $dbh +
+
+ int + $db_connect_time +
+
+ boolean + $debug_all +
+
+ mixed + $debug_called +
+
+ boolean + $debug_echo_is_on +
+
+ boolean + $do_profile +
+
+ boolean + $from_disk_cache +
+
+ object Default + $last_error +
+
+ object Default + $last_query +
+
+ object Default + $last_result +
+
+ int + $num_queries +
+
+ array + $profile_times +
+
+ boolean + $sql_log_file +
+
+ array + $timers +
+
+ int + $total_query_time +
+
+ boolean + $trace +
+
+ array + $trace_log +
+
+ boolean + $use_disk_cache +
+
+ boolean + $use_trace_log +
+
+ boolean + $vardump_called +
+
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ int + affectedRows + () +
+
+ string + debug + ([boolean $print_to_screen = true]) +
+
+ string + donation + () +
+
+ string + dumpvar + (variant $mixed) +
+
+ ezSQLcore + __construct + () +
+
+ void + flush + () +
+
+ boolean + getShowErrors + () +
+
+ object + get_cache + (object $query) +
+
+ array + get_col + ([object $query = null], [type $x = 0]) +
+
+ type + get_col_info + ([type $info_type = 'name'], [type $col_offset = -1]) +
+
+ array + get_results + ([object $query = null], [boolean $output = self::OBJECT]) +
+
+ type + get_row + ([object $query = null], [bolean $output = self::OBJECT], [int $y = 0]) +
+
+ variant + get_var + ([$query $query = null], [$x $x = 0], [$y $y = 0]) +
+
+ void + hide_errors + () +
+
+ boolean + isConnected + () +
+
+ void + register_error + ($err_str $err_str) +
+
+ void + show_errors + () +
+
+ void + store_cache + (object $query, boolean $is_insert) +
+
+ float + timer_elapsed + (string $timer_name) +
+
+ float + timer_get_cur + () +
+
+ void + timer_start + (string $timer_name) +
+
+ void + timer_update_global + (string $timer_name) +
+
+ string + vardump + ([variant $mixed = '']) +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + int + $affectedRows + = 0 (line 190) + +
+ + +

Contains the number of affected rows of a query

+
    +
  • var: Default is 0
  • +
  • access: protected
  • +
+ + + + + +
+ +
+ +
+ + boolean + $cache_dir + = false (line 100) + +
+ + +

Using the cache directory

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $cache_inserts + = false (line 112) + +
+ + +

Insert queries into the cache

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $cache_queries + = false (line 106) + +
+ + +

Caching queries

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + integer + $cache_timeout + = 24 (line 124) + +
+ + +

The cache timeout in hours

+
    +
  • var: Default is 24
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $captured_errors + = array() (line 94) + +
+ + +

Captured errors

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + object Default + $col_info + = null (line 88) + +
+ + +

The last column info

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $connected + = false (line 184) + +
+ + +

Whether the database connection is established, or not

+
    +
  • var: Default is false
  • +
  • access: protected
  • +
+ + + + + +
+ +
+ +
+ + object Default + $dbh + = null (line 178) + +
+ + +

The database connection object

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + int + $db_connect_time + = 0 (line 142) + +
+ + +

The time it took to establish a connection

+
    +
  • var: Default is 0
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $debug_all + = false (line 46) + +
+ + +

same as $trace

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + mixed + $debug_called + = false (line 52) + +
+ + +

Debug is called

+
    +
  • public: boolean Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $debug_echo_is_on + = true (line 198) + +
+ + +

== TJH == default now needed for echo of debug function

+

The default for returning errors, turn it of, if you are not interested in seeing your database errors

+
    +
  • var: Default is true
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $do_profile + = false (line 166) + +
+ + +

Using profiling

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $from_disk_cache + = false (line 210) + +
+ + +

Get data from disk cache

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + object Default + $last_error + = null (line 82) + +
+ + +

The last error object

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + object Default + $last_query + = null (line 76) + +
+ + +

The last query object

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + object Default + $last_result + = null (line 204) + +
+ + +

The last query result

+
    +
  • var: is null
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + int + $num_queries + = 0 (line 70) + +
+ + +

Number of queries

+
    +
  • var: Default is 0
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $profile_times + = array() (line 172) + +
+ + +

Array for storing profiling times

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $sql_log_file + = false (line 160) + +
+ + +

Use a SQL log file

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $timers + = array() (line 130) + +
+ + +

Timers

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + int + $total_query_time + = 0 (line 136) + +
+ + +

The total query time

+
    +
  • var: Default is 0
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $trace + = false (line 40) + +
+ + +

same as $debug_all

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + array + $trace_log + = array() (line 148) + +
+ + +

The trace log

+
    +
  • var: Default is empty array
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $use_disk_cache + = false (line 118) + +
+ + +

Using disk cache

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $use_trace_log + = false (line 154) + +
+ + +

Use the trace log

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+ +
+ + boolean + $vardump_called + = false (line 58) + +
+ + +

Vardump called

+
    +
  • var: Default is false
  • +
  • access: public
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ affectedRows (line 717) +
+ + +

Returns the affected rows of a query

+
    +
  • access: public
  • +
+ +
+ int + + affectedRows + + () +
+ + + +
+ +
+ +
+ debug (line 545) +
+ + +

Displays the last query string that was sent to the database & a table listing results (if there were any).

+

(Abstracted into a seperate files to save server overhead).

+
    +
  • return: The HTML result
  • +
  • access: public
  • +
+ +
+ string + + debug + + ([boolean $print_to_screen = true]) +
+ +
    +
  • + boolean + $print_to_screen: Default is true
  • +
+ + +
+ +
+ +
+ donation (line 635) +
+ + +

Naughty little function to ask for some remuniration!

+
    +
  • return: An HTML string with payment information
  • +
  • access: public
  • +
+ +
+ string + + donation + + () +
+ + + +
+ +
+ +
+ dumpvar (line 533) +
+ + +

An alias for vardump method

+
    +
  • return: Returns HTML result
  • +
  • access: public
  • +
+ +
+ string + + dumpvar + + (variant $mixed) +
+ +
    +
  • + variant + $mixed: Default is empty String
  • +
+ + +
+ +
+ +
+ Constructor __construct (line 221) +
+ + +

Constructor of ezSQL

+
    +
  • access: public
  • +
+ +
+ ezSQLcore + + __construct + + () +
+ + + +
+
Redefined in descendants as:
+ +
+ +
+ +
+ flush (line 259) +
+ + +

Kill cached query results

+
    +
  • access: public
  • +
+ +
+ void + + flush + + () +
+ + + +
+ +
+ +
+ getShowErrors (line 708) +
+ + +

Returns the current show error state

+
    +
  • access: public
  • +
+ +
+ boolean + + getShowErrors + + () +
+ + + +
+ +
+ +
+ get_cache (line 460) +
+ + +

Get the query cache of a query

+
    +
  • access: public
  • +
+ +
+ object + + get_cache + + (object $query) +
+ +
    +
  • + object + $query
  • +
+ + +
+ +
+ +
+ get_col (line 336) +
+ + +

Function to get 1 column from the cached result set based in X index see docs for usage and info

+
    +
  • access: public
  • +
+ +
+ array + + get_col + + ([object $query = null], [type $x = 0]) +
+ +
    +
  • + object + $query: Default is null
  • +
  • + type + $x: Default is 0
  • +
+ + +
+ +
+ +
+ get_col_info (line 406) +
+ + +

Function to get column meta data info pertaining to the last query See docs for more info and usage

+
    +
  • access: public
  • +
+ +
+ type + + get_col_info + + ([type $info_type = 'name'], [type $col_offset = -1]) +
+ +
    +
  • + type + $info_type
  • +
  • + type + $col_offset
  • +
+ + +
+ +
+ +
+ get_results (line 362) +
+ + +

Return the the query as a result set - see docs for more details

+
    +
  • access: public
  • +
+ +
+ array + + get_results + + ([object $query = null], [boolean $output = self::OBJECT]) +
+ +
    +
  • + object + $query: Default is null
  • +
  • + boolean + $output: Default is the OBJECT constant
  • +
+ + +
+ +
+ +
+ get_row (line 301) +
+ + +

Get one row from the DB - see docs for more detail

+
    +
  • access: public
  • +
+ +
+ type + + get_row + + ([object $query = null], [bolean $output = self::OBJECT], [int $y = 0]) +
+ +
    +
  • + object + $query: Default is null
  • +
  • + bolean + $output: Default is the OBJECT constant
  • +
  • + int + $y: Default is 0
  • +
+ + +
+ +
+ +
+ get_var (line 275) +
+ + +

Get one variable from the DB - see docs for more detail

+
    +
  • return: The value of a variable
  • +
  • access: public
  • +
+ +
+ variant + + get_var + + ([$query $query = null], [$x $x = 0], [$y $y = 0]) +
+ +
    +
  • + $query + $query: object A query object, default is null
  • +
  • + $x + $x: int Default is 0
  • +
  • + $y + $y: int Default is 0
  • +
+ + +
+ +
+ +
+ hide_errors (line 252) +
+ + +

Turn error handling off

+
    +
  • access: public
  • +
+ +
+ void + + hide_errors + + () +
+ + + +
+ +
+ +
+ isConnected (line 699) +
+ + +

Returns, whether a database connection is established, or not

+
    +
  • access: public
  • +
+ +
+ boolean + + isConnected + + () +
+ + + +
+ +
+ +
+ register_error (line 230) +
+ + +

Print SQL/DB error - over-ridden by specific DB class

+
    +
  • access: public
  • +
+ +
+ void + + register_error + + ($err_str $err_str) +
+ +
    +
  • + $err_str + $err_str: string
  • +
+ + +
+ +
+ +
+ show_errors (line 245) +
+ + +

Turn error handling on, by default error handling is on

+
    +
  • access: public
  • +
+ +
+ void + + show_errors + + () +
+ + + +
+ +
+ +
+ store_cache (line 430) +
+ + +

Store the cache

+
    +
  • access: public
  • +
+ +
+ void + + store_cache + + (object $query, boolean $is_insert) +
+ +
    +
  • + object + $query
  • +
  • + boolean + $is_insert
  • +
+ + +
+ +
+ +
+ timer_elapsed (line 673) +
+ + +

Returns the elapsed time of the given timer by name

+
    +
  • access: public
  • +
+ +
+ float + + timer_elapsed + + (string $timer_name) +
+ +
    +
  • + string + $timer_name
  • +
+ + +
+ +
+ +
+ timer_get_cur (line 653) +
+ + +

Get current time

+
    +
  • access: public
  • +
+ +
+ float + + timer_get_cur + + () +
+ + + +
+ +
+ +
+ timer_start (line 663) +
+ + +

Start a timer by name

+
    +
  • access: public
  • +
+ +
+ void + + timer_start + + (string $timer_name) +
+ +
    +
  • + string + $timer_name
  • +
+ + +
+ +
+ +
+ timer_update_global (line 682) +
+ + +

Update the global timer with an existing timer

+
    +
  • access: public
  • +
+ +
+ void + + timer_update_global + + (string $timer_name) +
+ +
    +
  • + string + $timer_name
  • +
+ + +
+ +
+ +
+ vardump (line 493) +
+ + +

Dumps the contents of any input variable to screen in a nicely formatted and easy to understand way - any type: Object, public or Array

+
    +
  • return: Returns HTML result
  • +
  • access: public
  • +
+ +
+ string + + vardump + + ([variant $mixed = '']) +
+ +
    +
  • + variant + $mixed: Default is empty String
  • +
+ + +
+ +
+
+ + +
+
Class Constants
+ +
+ +
+ +
+ + ARRAY_A + = true + (line 29) + +
+ + +

Constant boolean

+ + +
+ +
+ +
+ + ARRAY_N + = true + (line 34) + +
+ + +

Constant boolean

+ + +
+ +
+ +
+ + EZSQL_VERSION + = '3.02' + (line 19) + +
+ + +

Constant string ezSQL version information

+ + +
+ +
+ +
+ + OBJECT + = true + (line 24) + +
+ + +

Constant boolean Object

+ + +
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html new file mode 100644 index 00000000..94dfa8c5 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---mssql---ezSQL_mssqlTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_mssqlTest.php + + + + +
+

/_Test/unit_tests/mssql/ezSQL_mssqlTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_mssqlTest + + Test class for ezSQL_mssql. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../mssql/ez_sql_mssql.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---mysql---ezSQL_mysqlTest.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---mysql---ezSQL_mysqlTest.php.html new file mode 100644 index 00000000..a968c375 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---mysql---ezSQL_mysqlTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_mysqlTest.php + + + + +
+

/_Test/unit_tests/mysql/ezSQL_mysqlTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_mysqlTest + + Test class for ezSQL_mysql. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../mysql/ez_sql_mysql.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html new file mode 100644 index 00000000..6fdedf55 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---oracle8_9---ezSQL_oracle8_9Test.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_oracle8_9Test.php + + + + +
+

/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_oracle8_9Test + + Test class for ezSQL_oracle8_9. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../oracle8_9/ez_sql_oracle8_9.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---pdo---ezSQL_pdoTest.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---pdo---ezSQL_pdoTest.php.html new file mode 100644 index 00000000..9844a73a --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---pdo---ezSQL_pdoTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_pdoTest.php + + + + +
+

/_Test/unit_tests/pdo/ezSQL_pdoTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_pdoTest + + Test class for ezSQL_pdo. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../pdo/ez_sql_pdo.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---postgresql---ezSQL_postgresqlTest.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---postgresql---ezSQL_postgresqlTest.php.html new file mode 100644 index 00000000..aa736e12 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---postgresql---ezSQL_postgresqlTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_postgresqlTest.php + + + + +
+

/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_postgresqlTest + + Test class for ezSQL_postgresql. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../postgresql/ez_sql_postgresql.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---shared---ezSQL_recordsetTest.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---shared---ezSQL_recordsetTest.php.html new file mode 100644 index 00000000..c2ce401c --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---shared---ezSQL_recordsetTest.php.html @@ -0,0 +1,115 @@ + + + + + + Docs for page ezSQL_recordsetTest.php + + + + +
+

/_Test/unit_tests/shared/ezSQL_recordsetTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_recordsetTest + + Test class for ezSQL_recordset. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../mysql/ez_sql_mysql.php') + (line 4) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_recordset.php') + (line 5) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---shared---ezSQLcoreTest.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---shared---ezSQLcoreTest.php.html new file mode 100644 index 00000000..dbd238dd --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---shared---ezSQLcoreTest.php.html @@ -0,0 +1,87 @@ + + + + + + Docs for page ezSQLcoreTest.php + + + + +
+

/_Test/unit_tests/shared/ezSQLcoreTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQLcoreTest + + Test class for ezSQLcore. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html new file mode 100644 index 00000000..9fe939f3 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/__Test---unit_tests---sybase---ezSQL_sybaseTest.php.html @@ -0,0 +1,101 @@ + + + + + + Docs for page ezSQL_sybaseTest.php + + + + +
+

/_Test/unit_tests/sybase/ezSQL_sybaseTest.php

+ + +
+
Description
+ +
+ + +
+
+ + +
+
Classes
+ +
+ + + + + + + + + +
ClassDescription
+ ezSQL_sybaseTest + + Test class for ezSQL_sybase. +
+
+
+ + +
+
Includes
+ +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../shared/ez_sql_core.php') + (line 3) + +
+ + + +
+ +
+ +
+ + require_once + (dirname(__FILE__).'/../../../sybase/ez_sql_sybase.php') + (line 4) + +
+ + + +
+
+
+ + + + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_mssqlTest.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_mssqlTest.html new file mode 100644 index 00000000..310a0f93 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_mssqlTest.html @@ -0,0 +1,464 @@ + + + + + + Docs For Class ezSQL_mssqlTest + + + + +
+

Class ezSQL_mssqlTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_mssql.

+

Desc..: MS SQL Server component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • todo: The connection to MS SQL Server is not tested by now. There might also be tests done for different versions of SQL Server
  • +
  • name: ezSQL_mssqlTest
  • +
  • license: FREE
  • +
+

+ Located in /_Test/unit_tests/mssql/ezSQL_mssqlTest.php (line 21) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_mssqlTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testConvertMySqlToMSSql + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetDBHost + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_mssql + $object + (line 26) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 32) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 40) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 59) +
+ + +
    +
  • todo: Implement testConnect().
  • +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testConvertMySqlToMSSql (line 108) +
+ + +
    +
  • todo: Implement testConvertMySqlToMSSql().
  • +
  • access: public
  • +
+ +
+ void + + testConvertMySqlToMSSql + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 119) +
+ + +
    +
  • todo: Implement testDisconnect().
  • +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 80) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetDBHost (line 130) +
+ + +
    +
  • todo: Implement testGetDBHost().
  • +
  • access: public
  • +
+ +
+ void + + testGetDBHost + + () +
+ + + +
+ +
+ +
+ testQuery (line 97) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 48) +
+ + +
    +
  • todo: Implement testQuick_connect().
  • +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 70) +
+ + +
    +
  • todo: Implement testSelect().
  • +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 89) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_mysqlTest.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_mysqlTest.html new file mode 100644 index 00000000..faea39b3 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_mysqlTest.html @@ -0,0 +1,657 @@ + + + + + + Docs For Class ezSQL_mysqlTest + + + + +
+

Class ezSQL_mysqlTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_mysql.

+

Generated by PHPUnit

Needs database tear up to run test, that creates database and a user with appropriate rights. Run database tear down after tests to get rid of the database and the user.

+
    +
  • author: Stefanie Janine Stoelting
  • +
  • name: ezSQL_mysql_tear_up
  • +
  • license: FREE
  • +
  • uses: mysql_test_db_tear_down.sql
  • +
  • uses: mysql_test_db_tear_up.sql
  • +
+

+ Located in /_Test/unit_tests/mysql/ezSQL_mysqlTest.php (line 22) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_mysqlTest
+ +
+
+ + + +
+
Class Constant Summary
+ +
+
+
+ TEST_DB_CHARSET = 'utf8' + +
+
+ TEST_DB_HOST = 'localhost' + +
+
+ TEST_DB_NAME = 'ez_test' + +
+
+ TEST_DB_PASSWORD = 'ezTest' + +
+
+ TEST_DB_USER = 'ez_test' + +
+
+
+
+ + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetCharset + () +
+
+ void + testGetDBHost + () +
+
+ void + testGetInsertId + () +
+
+ void + testQueryInsert + () +
+
+ void + testQuerySelect + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_mysql + $object + (line 52) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 58) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 66) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 82) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 172) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 103) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetCharset (line 165) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGetCharset + + () +
+ + + +
+ +
+ +
+ testGetDBHost (line 158) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGetDBHost + + () +
+ + + +
+ +
+ +
+ testGetInsertId (line 181) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGetInsertId + + () +
+ + + +
+ +
+ +
+ testQueryInsert (line 119) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testQueryInsert + + () +
+ + + +
+ +
+ +
+ testQuerySelect (line 132) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testQuerySelect + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 73) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 91) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 112) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +
+
Class Constants
+ +
+ +
+ +
+ + TEST_DB_CHARSET + = 'utf8' + (line 47) + +
+ + +

constant database connection charset

+ + +
+ +
+ +
+ + TEST_DB_HOST + = 'localhost' + (line 42) + +
+ + +

constant database host

+ + +
+ +
+ +
+ + TEST_DB_NAME + = 'ez_test' + (line 37) + +
+ + +

constant database name

+ + +
+ +
+ +
+ + TEST_DB_PASSWORD + = 'ezTest' + (line 32) + +
+ + +

constant string password

+ + +
+ +
+ +
+ + TEST_DB_USER + = 'ez_test' + (line 27) + +
+ + +

constant string user name

+ + +
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_oracle8_9Test.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_oracle8_9Test.html new file mode 100644 index 00000000..b23178df --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_oracle8_9Test.html @@ -0,0 +1,549 @@ + + + + + + Docs For Class ezSQL_oracle8_9Test + + + + +
+

Class ezSQL_oracle8_9Test

+ + +
+
Description
+ +
+ +

Test class for ezSQL_oracle8_9.

+

Desc..: Oracle 8 + 9 component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • todo: The connection to Oracle is not tested by now. There might also be tests done for different versions of Oracle
  • +
  • name: ezSQL_oracle8_9Test
  • +
  • license: FREE
  • +
+

+ Located in /_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php (line 21) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_oracle8_9Test
+ +
+
+ + + + +
+
Variable Summary
+ +
+ +
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetDBName + () +
+
+ void + testInsert_id + () +
+
+ void + testIs_equal_int + () +
+
+ void + testIs_equal_str + () +
+
+ void + testNextVal + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_oracle8_9 + $object + (line 26) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 32) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 40) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 48) +
+ + +
    +
  • todo: Implement testConnect().
  • +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 148) +
+ + +
    +
  • todo: Implement testDisconnect().
  • +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 80) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetDBName (line 159) +
+ + +
    +
  • todo: Implement testGetDBName().
  • +
  • access: public
  • +
+ +
+ void + + testGetDBName + + () +
+ + + +
+ +
+ +
+ testInsert_id (line 115) +
+ + +
    +
  • todo: Implement testInsert_id().
  • +
  • access: public
  • +
+ +
+ void + + testInsert_id + + () +
+ + + +
+ +
+ +
+ testIs_equal_int (line 105) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testIs_equal_int + + () +
+ + + +
+ +
+ +
+ testIs_equal_str (line 96) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testIs_equal_str + + () +
+ + + +
+ +
+ +
+ testNextVal (line 126) +
+ + +
    +
  • todo: Implement testNextVal().
  • +
  • access: public
  • +
+ +
+ void + + testNextVal + + () +
+ + + +
+ +
+ +
+ testQuery (line 137) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 59) +
+ + +
    +
  • todo: Implement testQuick_connect().
  • +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 70) +
+ + +
    +
  • todo: Implement testSelect().
  • +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 89) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_pdoTest.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_pdoTest.html new file mode 100644 index 00000000..9418b4de --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_pdoTest.html @@ -0,0 +1,1176 @@ + + + + + + Docs For Class ezSQL_pdoTest + + + + +
+

Class ezSQL_pdoTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_pdo.

+

Generated by PHPUnit

Needs database tear up to run test, that creates database and a user with appropriate rights. Run database tear down after tests to get rid of the database and the user. The PDO tests where done with a PostgreSQL database, please use the scripts of PostgreSQL

+
    +
  • author: Stefanie Janine Stoelting
  • +
  • name: ezSQL_pdoTest
  • +
  • uses: postgresql_test_db_tear_up.sql
  • +
  • license: FREE
  • +
  • uses: postgresql_test_db_tear_down.sql
  • +
  • uses: mysql_test_db_tear_down.sql
  • +
  • uses: ez_test.sqlite
  • +
  • uses: mysql_test_db_tear_up.sql
  • +
+

+ Located in /_Test/unit_tests/pdo/ezSQL_pdoTest.php (line 31) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_pdoTest
+ +
+
+ + + +
+
Class Constant Summary
+ +
+
+
+ TEST_DB_CHARSET = 'utf8' + +
+
+ TEST_DB_HOST = 'localhost' + +
+
+ TEST_DB_NAME = 'ez_test' + +
+
+ TEST_DB_PASSWORD = 'ezTest' + +
+
+ TEST_DB_PORT = '5432' + +
+
+ TEST_DB_USER = 'ez_test' + +
+
+ TEST_SQLITE_DB = '_Test/unit_tests/pdo/ez_test.sqlite' + +
+
+
+
+ + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testMySQLCatch_error + () +
+
+ void + testMySQLConnect + () +
+
+ void + testMySQLConnectWithOptions + () +
+
+ void + testMySQLDisconnect + () +
+
+ void + testMySQLEscape + () +
+
+ void + testMySQLGet_set + () +
+
+ void + testMySQLQuery + () +
+
+ void + testMySQLQuick_connect + () +
+
+ void + testMySQLSelect + () +
+
+ void + testMySQLSysdate + () +
+
+ void + testPosgreSQLCatch_error + () +
+
+ void + testPosgreSQLConnect + () +
+
+ void + testPosgreSQLDisconnect + () +
+
+ void + testPosgreSQLEscape + () +
+
+ void + testPosgreSQLQuery + () +
+
+ void + testPosgreSQLQuick_connect + () +
+
+ void + testPosgreSQLSelect + () +
+
+ void + testPosgreSQLSysdate + () +
+
+ void + testPostgreSQLGet_set + () +
+
+ void + testSQLiteCatch_error + () +
+
+ void + testSQLiteConnect + () +
+
+ void + testSQLiteDisconnect + () +
+
+ void + testSQLiteEscape + () +
+
+ void + testSQLiteGet_set + () +
+
+ void + testSQLiteQuery + () +
+
+ void + testSQLiteQuick_connect + () +
+
+ void + testSQLiteSelect + () +
+
+ void + testSQLiteSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_pdo + $object + (line 71) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 77) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 85) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testMySQLCatch_error (line 222) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLCatch_error + + () +
+ + + +
+ +
+ +
+ testMySQLConnect (line 183) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLConnect + + () +
+ + + +
+ +
+ +
+ testMySQLConnectWithOptions (line 253) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLConnectWithOptions + + () +
+ + + +
+ +
+ +
+ testMySQLDisconnect (line 242) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLDisconnect + + () +
+ + + +
+ +
+ +
+ testMySQLEscape (line 204) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLEscape + + () +
+ + + +
+ +
+ +
+ testMySQLGet_set (line 264) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLGet_set + + () +
+ + + +
+ +
+ +
+ testMySQLQuery (line 231) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLQuery + + () +
+ + + +
+ +
+ +
+ testMySQLQuick_connect (line 190) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLQuick_connect + + () +
+ + + +
+ +
+ +
+ testMySQLSelect (line 197) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLSelect + + () +
+ + + +
+ +
+ +
+ testMySQLSysdate (line 215) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testMySQLSysdate + + () +
+ + + +
+ +
+ +
+ testPosgreSQLCatch_error (line 131) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLCatch_error + + () +
+ + + +
+ +
+ +
+ testPosgreSQLConnect (line 92) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLConnect + + () +
+ + + +
+ +
+ +
+ testPosgreSQLDisconnect (line 151) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLDisconnect + + () +
+ + + +
+ +
+ +
+ testPosgreSQLEscape (line 113) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLEscape + + () +
+ + + +
+ +
+ +
+ testPosgreSQLQuery (line 140) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLQuery + + () +
+ + + +
+ +
+ +
+ testPosgreSQLQuick_connect (line 99) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLQuick_connect + + () +
+ + + +
+ +
+ +
+ testPosgreSQLSelect (line 106) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLSelect + + () +
+ + + +
+ +
+ +
+ testPosgreSQLSysdate (line 124) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPosgreSQLSysdate + + () +
+ + + +
+ +
+ +
+ testPostgreSQLGet_set (line 162) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPostgreSQLGet_set + + () +
+ + + +
+ +
+ +
+ testSQLiteCatch_error (line 324) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteCatch_error + + () +
+ + + +
+ +
+ +
+ testSQLiteConnect (line 285) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteConnect + + () +
+ + + +
+ +
+ +
+ testSQLiteDisconnect (line 344) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteDisconnect + + () +
+ + + +
+ +
+ +
+ testSQLiteEscape (line 306) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteEscape + + () +
+ + + +
+ +
+ +
+ testSQLiteGet_set (line 355) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteGet_set + + () +
+ + + +
+ +
+ +
+ testSQLiteQuery (line 333) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteQuery + + () +
+ + + +
+ +
+ +
+ testSQLiteQuick_connect (line 292) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteQuick_connect + + () +
+ + + +
+ +
+ +
+ testSQLiteSelect (line 299) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteSelect + + () +
+ + + +
+ +
+ +
+ testSQLiteSysdate (line 317) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSQLiteSysdate + + () +
+ + + +
+ +
+
+ + +
+
Class Constants
+ +
+ +
+ +
+ + TEST_DB_CHARSET + = 'utf8' + (line 56) + +
+ + +

constant string database connection charset

+ + +
+ +
+ +
+ + TEST_DB_HOST + = 'localhost' + (line 51) + +
+ + +

constant string database host

+ + +
+ +
+ +
+ + TEST_DB_NAME + = 'ez_test' + (line 46) + +
+ + +

constant string database name

+ + +
+ +
+ +
+ + TEST_DB_PASSWORD + = 'ezTest' + (line 41) + +
+ + +

constant string password

+ + +
+ +
+ +
+ + TEST_DB_PORT + = '5432' + (line 61) + +
+ + +

constant string database port

+ + +
+ +
+ +
+ + TEST_DB_USER + = 'ez_test' + (line 36) + +
+ + +

constant string user name

+ + +
+ +
+ +
+ + TEST_SQLITE_DB + = '_Test/unit_tests/pdo/ez_test.sqlite' + (line 66) + +
+ + +

constant string path and file name of the SQLite test database

+ + +
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:21 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_postgresqlTest.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_postgresqlTest.html new file mode 100644 index 00000000..7d0ce0bc --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_postgresqlTest.html @@ -0,0 +1,685 @@ + + + + + + Docs For Class ezSQL_postgresqlTest + + + + +
+

Class ezSQL_postgresqlTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_postgresql.

+

Generated by PHPUnit

Needs database tear up to run test, that creates database and a user with appropriate rights. Run database tear down after tests to get rid of the database and the user.

+
    +
  • author: Stefanie Janine Stoelting
  • +
  • name: ezSQL_postgresql_tear_up
  • +
  • license: FREE
  • +
  • uses: postgresql_test_db_tear_down.sql
  • +
  • uses: postgresql_test_db_tear_up.sql
  • +
+

+ Located in /_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php (line 22) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_postgresqlTest
+ +
+
+ + + +
+
Class Constant Summary
+ +
+
+
+ TEST_DB_HOST = 'localhost' + +
+
+ TEST_DB_NAME = 'ez_test' + +
+
+ TEST_DB_PASSWORD = 'ezTest' + +
+
+ TEST_DB_PORT = '5432' + +
+
+ TEST_DB_USER = 'ez_test' + +
+
+
+
+ + +
+
Variable Summary
+ +
+ +
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testDescTable + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetDBHost + () +
+
+ void + testGetPort + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testShowDatabases + () +
+
+ void + testShowTables + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_postgresql + $object + (line 52) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 58) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 66) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 81) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testDescTable (line 124) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testDescTable + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 163) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 97) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetDBHost (line 172) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGetDBHost + + () +
+ + + +
+ +
+ +
+ testGetPort (line 179) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGetPort + + () +
+ + + +
+ +
+ +
+ testQuery (line 152) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 73) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 88) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testShowDatabases (line 140) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testShowDatabases + + () +
+ + + +
+ +
+ +
+ testShowTables (line 113) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testShowTables + + () +
+ + + +
+ +
+ +
+ testSysdate (line 106) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +
+
Class Constants
+ +
+ +
+ +
+ + TEST_DB_HOST + = 'localhost' + (line 42) + +
+ + +

constant database host

+ + +
+ +
+ +
+ + TEST_DB_NAME + = 'ez_test' + (line 37) + +
+ + +

constant database name

+ + +
+ +
+ +
+ + TEST_DB_PASSWORD + = 'ezTest' + (line 32) + +
+ + +

constant string password

+ + +
+ +
+ +
+ + TEST_DB_PORT + = '5432' + (line 47) + +
+ + +

constant database port

+ + +
+ +
+ +
+ + TEST_DB_USER + = 'ez_test' + (line 27) + +
+ + +

constant string user name

+ + +
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_recordsetTest.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_recordsetTest.html new file mode 100644 index 00000000..1a9c1594 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_recordsetTest.html @@ -0,0 +1,625 @@ + + + + + + Docs For Class ezSQL_recordsetTest + + + + +
+

Class ezSQL_recordsetTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_recordset.

+

Generated by PHPUnit

+
    +
  • author: Stefanie Janine Stoelting
  • +
  • name: SQL_recordsetTest
  • +
  • license: FREE
  • +
+

+ Located in /_Test/unit_tests/shared/ezSQL_recordsetTest.php (line 17) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_recordsetTest
+ +
+
+ + + +
+
Class Constant Summary
+ +
+
+
+ TEST_DB_CHARSET = 'utf8' + +
+
+ TEST_DB_HOST = 'localhost' + +
+
+ TEST_DB_NAME = 'ez_test' + +
+
+ TEST_DB_PASSWORD = 'ezTest' + +
+
+ TEST_DB_USER = 'ez_test' + +
+
+
+
+ + +
+
Variable Summary
+ +
+ +
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testCurrent + () +
+
+ void + testEzSQL_fetch_assoc + () +
+
+ void + testEzSQL_fetch_object + () +
+
+ void + testEzSQL_fetch_row + () +
+
+ void + testKey + () +
+
+ void + testNext + () +
+
+ void + testPrevious + () +
+
+ void + testRewind + () +
+
+ void + testValid + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_mysql + $ezSQL + = null (line 53) + +
+ + +

ezSQL connection

+
    +
  • access: protected
  • +
+ + + + + +
+ +
+ +
+ + ezSQL_recordset + $object + (line 47) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 60) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 82) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testCurrent (line 106) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testCurrent + + () +
+ + + +
+ +
+ +
+ testEzSQL_fetch_assoc (line 159) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEzSQL_fetch_assoc + + () +
+ + + +
+ +
+ +
+ testEzSQL_fetch_object (line 181) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEzSQL_fetch_object + + () +
+ + + +
+ +
+ +
+ testEzSQL_fetch_row (line 170) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEzSQL_fetch_row + + () +
+ + + +
+ +
+ +
+ testKey (line 117) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testKey + + () +
+ + + +
+ +
+ +
+ testNext (line 128) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testNext + + () +
+ + + +
+ +
+ +
+ testPrevious (line 139) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testPrevious + + () +
+ + + +
+ +
+ +
+ testRewind (line 91) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testRewind + + () +
+ + + +
+ +
+ +
+ testValid (line 152) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testValid + + () +
+ + + +
+ +
+
+ + +
+
Class Constants
+ +
+ +
+ +
+ + TEST_DB_CHARSET + = 'utf8' + (line 42) + +
+ + +

constant database connection charset

+ + +
+ +
+ +
+ + TEST_DB_HOST + = 'localhost' + (line 37) + +
+ + +

constant database host

+ + +
+ +
+ +
+ + TEST_DB_NAME + = 'ez_test' + (line 32) + +
+ + +

constant database name

+ + +
+ +
+ +
+ + TEST_DB_PASSWORD + = 'ezTest' + (line 27) + +
+ + +

constant string password

+ + +
+ +
+ +
+ + TEST_DB_USER + = 'ez_test' + (line 22) + +
+ + +

constant string user name

+ + +
+ +
+
+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_sybaseTest.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_sybaseTest.html new file mode 100644 index 00000000..4aec4bb8 --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQL_sybaseTest.html @@ -0,0 +1,464 @@ + + + + + + Docs For Class ezSQL_sybaseTest + + + + +
+

Class ezSQL_sybaseTest

+ + +
+
Description
+ +
+ +

Test class for ezSQL_sybase.

+

Desc..: Sybase ASE component (part of ezSQL databse abstraction library)

+
    +
  • author: Justin Vincent (jv@jvmultimedia.com)
  • +
  • author: Stefanie Janine Stoelting
  • +
  • link: http://twitter.com/justinvincent
  • +
  • todo: The connection to Sybase ASE is not tested by now. There might also be tests done for different versions of Sybase ASE
  • +
  • name: ezSQL_sybaseTest
  • +
  • license: FREE
  • +
+

+ Located in /_Test/unit_tests/sybase/ezSQL_sybaseTest.php (line 21) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQL_sybaseTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testConnect + () +
+
+ void + testConvertMySqlTosybase + () +
+
+ void + testDisconnect + () +
+
+ void + testEscape + () +
+
+ void + testGetDBHost + () +
+
+ void + testQuery + () +
+
+ void + testQuick_connect + () +
+
+ void + testSelect + () +
+
+ void + testSysdate + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQL_sybase + $object + (line 26) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 32) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 40) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testConnect (line 59) +
+ + +
    +
  • todo: Implement testConnect().
  • +
  • access: public
  • +
+ +
+ void + + testConnect + + () +
+ + + +
+ +
+ +
+ testConvertMySqlTosybase (line 108) +
+ + +
    +
  • todo: Implement testConvertMySqlTosybase().
  • +
  • access: public
  • +
+ +
+ void + + testConvertMySqlTosybase + + () +
+ + + +
+ +
+ +
+ testDisconnect (line 119) +
+ + +
    +
  • todo: Implement testDisconnect().
  • +
  • access: public
  • +
+ +
+ void + + testDisconnect + + () +
+ + + +
+ +
+ +
+ testEscape (line 80) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testEscape + + () +
+ + + +
+ +
+ +
+ testGetDBHost (line 130) +
+ + +
    +
  • todo: Implement testGetDBHost().
  • +
  • access: public
  • +
+ +
+ void + + testGetDBHost + + () +
+ + + +
+ +
+ +
+ testQuery (line 97) +
+ + +
    +
  • todo: Implement testQuery().
  • +
  • access: public
  • +
+ +
+ void + + testQuery + + () +
+ + + +
+ +
+ +
+ testQuick_connect (line 48) +
+ + +
    +
  • todo: Implement testQuick_connect().
  • +
  • access: public
  • +
+ +
+ void + + testQuick_connect + + () +
+ + + +
+ +
+ +
+ testSelect (line 70) +
+ + +
    +
  • todo: Implement testSelect().
  • +
  • access: public
  • +
+ +
+ void + + testSelect + + () +
+ + + +
+ +
+ +
+ testSysdate (line 89) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testSysdate + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQLcoreTest.html b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQLcoreTest.html new file mode 100644 index 00000000..5e2d385b --- /dev/null +++ b/_Documentation/phpDocumentator/ezSQL/unitTests/ezSQLcoreTest.html @@ -0,0 +1,764 @@ + + + + + + Docs For Class ezSQLcoreTest + + + + +
+

Class ezSQLcoreTest

+ + +
+
Description
+ +
+ +

Test class for ezSQLcore.

+

Generated by PHPUnit

+
    +
  • author: Stefanie Janine Stoelting
  • +
  • name: ezSQLcoreTest
  • +
  • license: FREE
  • +
+

+ Located in /_Test/unit_tests/shared/ezSQLcoreTest.php (line 15) +

+ + +
PHPUnit_Framework_TestCase
+   |
+   --ezSQLcoreTest
+ +
+
+ + + + +
+
Variable Summary
+ +
+
+ +
+
+
+ + +
+
Method Summary
+ +
+
+ +
+ void + setUp + () +
+
+ void + tearDown + () +
+
+ void + testAffectedRows + () +
+
+ void + testDebug + () +
+
+ void + testDonation + () +
+
+ void + testDumpvar + () +
+
+ void + testFlush + () +
+
+ void + testGet_cache + () +
+
+ void + testGet_col + () +
+
+ void + testGet_col_info + () +
+
+ void + testGet_results + () +
+
+ void + testGet_row + () +
+
+ void + testGet_var + () +
+
+ void + testHide_errors + () +
+
+ void + testRegister_error + () +
+
+ void + testShow_errors + () +
+
+ void + testStore_cache + () +
+
+ void + testTimer_elapsed + () +
+
+ void + testTimer_get_cur + () +
+
+ void + testTimer_start + () +
+
+ void + testTimer_update_global + () +
+
+ void + testVardump + () +
+
+
+
+ + +
+
Variables
+ +
+ +
+ +
+ + ezSQLcore + $object + (line 20) + +
+ + +
    +
  • access: protected
  • +
+ + + + + +
+ +
+
+ + +
+
Methods
+ +
+ + + +
+ +
+ setUp (line 26) +
+ + +

Sets up the fixture, for example, opens a network connection.

+

This method is called before a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + setUp + + () +
+ + + +
+ +
+ +
+ tearDown (line 34) +
+ + +

Tears down the fixture, for example, closes a network connection.

+

This method is called after a test is executed.

+
    +
  • access: protected
  • +
+ +
+ void + + tearDown + + () +
+ + + +
+ +
+ +
+ testAffectedRows (line 213) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testAffectedRows + + () +
+ + + +
+ +
+ +
+ testDebug (line 159) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testDebug + + () +
+ + + +
+ +
+ +
+ testDonation (line 169) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testDonation + + () +
+ + + +
+ +
+ +
+ testDumpvar (line 152) +
+ + +

The test echos HTML, it is just a test, that is still running

+
    +
  • access: public
  • +
+ +
+ void + + testDumpvar + + () +
+ + + +
+ +
+ +
+ testFlush (line 74) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testFlush + + () +
+ + + +
+ +
+ +
+ testGet_cache (line 132) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_cache + + () +
+ + + +
+ +
+ +
+ testGet_col (line 100) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_col + + () +
+ + + +
+ +
+ +
+ testGet_col_info (line 114) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_col_info + + () +
+ + + +
+ +
+ +
+ testGet_results (line 107) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_results + + () +
+ + + +
+ +
+ +
+ testGet_row (line 93) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_row + + () +
+ + + +
+ +
+ +
+ testGet_var (line 86) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testGet_var + + () +
+ + + +
+ +
+ +
+ testHide_errors (line 65) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testHide_errors + + () +
+ + + +
+ +
+ +
+ testRegister_error (line 41) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testRegister_error + + () +
+ + + +
+ +
+ +
+ testShow_errors (line 52) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testShow_errors + + () +
+ + + +
+ +
+ +
+ testStore_cache (line 121) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testStore_cache + + () +
+ + + +
+ +
+ +
+ testTimer_elapsed (line 194) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_elapsed + + () +
+ + + +
+ +
+ +
+ testTimer_get_cur (line 176) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_get_cur + + () +
+ + + +
+ +
+ +
+ testTimer_start (line 187) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_start + + () +
+ + + +
+ +
+ +
+ testTimer_update_global (line 205) +
+ + +
    +
  • access: public
  • +
+ +
+ void + + testTimer_update_global + + () +
+ + + +
+ +
+ +
+ testVardump (line 144) +
+ + +

The test echos HTML, it is just a test, that is still running

+
    +
  • access: public
  • +
+ +
+ void + + testVardump + + () +
+ + + +
+ +
+
+ + +

+ Documentation generated on Mon, 23 Apr 2012 06:40:20 +0200 by phpDocumentor 1.4.4 +

+
+ \ No newline at end of file diff --git a/_Documentation/phpDocumentator/index.html b/_Documentation/phpDocumentator/index.html new file mode 100644 index 00000000..8553906b --- /dev/null +++ b/_Documentation/phpDocumentator/index.html @@ -0,0 +1,24 @@ + + + + + + ezSQL + + + + + + + + + + + <H2>Frame Alert</H2> + <P>This document is designed to be viewed using the frames feature. + If you see this message, you are using a non-frame-capable web client.</P> + + + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/li_default.html b/_Documentation/phpDocumentator/li_default.html new file mode 100644 index 00000000..e516e1da --- /dev/null +++ b/_Documentation/phpDocumentator/li_default.html @@ -0,0 +1,38 @@ + + + + + + + + + + +
default
+
+ +
+ +
Description
+
+ Class trees
+ Index of elements
+ Todo List
+
+ + + +
Classes
+
ezSQLcore
+
Files
+
disk_cache_example.php
+
disk_cache_example.php
+
ez_sql_core_2.1_debughack_0.2alpha.php
+
ez_sql_core_202console.php
+ + +
+
+

phpDocumentor v 1.4.4

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/li_ezSQL.html b/_Documentation/phpDocumentator/li_ezSQL.html new file mode 100644 index 00000000..a6cee23e --- /dev/null +++ b/_Documentation/phpDocumentator/li_ezSQL.html @@ -0,0 +1,78 @@ + + + + + + + + + + +
ezSQL
+
+ +
+ +
Description
+
+ Class trees
+ Index of elements
+ Todo List
+
+ + + +
Classes
+
ezSQLcore
+
ezSQL_codeigniter
+
ezSQL_mssql
+
ezSQL_mysql
+
ezSQL_oracle8_9
+
ezSQL_pdo
+
ezSQL_postgresql
+
ezSQL_recordset
+
ezSQL_sybase
+
Files
+
ezSQL
+
ezSQL_codeigniter
+
ezSQL_mssql
+
ezSQL_mysql
+
ezSQL_oracle8_9
+
ezSQL_pdo
+
ezSQL_postgresql
+
ezSQL_recordset
+
ezSQL_sybase
+ + + + +
unitTests
+
+
+
Classes
+
ezSQLcoreTest
+
ezSQL_mssqlTest
+
ezSQL_mysqlTest
+
ezSQL_oracle8_9Test
+
ezSQL_pdoTest
+
ezSQL_postgresqlTest
+
ezSQL_recordsetTest
+
ezSQL_sybaseTest
+
Files
+
ezSQLcoreTest.php
+
ezSQL_mssqlTest.php
+
ezSQL_mysqlTest.php
+
ezSQL_oracle8_9Test.php
+
ezSQL_pdoTest.php
+
ezSQL_postgresqlTest.php
+
ezSQL_recordsetTest.php
+
ezSQL_sybaseTest.php
+
+
+ + +
+
+

phpDocumentor v 1.4.4

+ + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/media/banner.css b/_Documentation/phpDocumentator/media/banner.css new file mode 100644 index 00000000..f2149ebb --- /dev/null +++ b/_Documentation/phpDocumentator/media/banner.css @@ -0,0 +1,32 @@ +body +{ + background-color: #CCCCFF; + margin: 0px; + padding: 0px; +} + +/* Banner (top bar) classes */ + +.banner { } + +.banner-menu +{ + clear: both; + padding: .5em; + border-top: 2px solid #6666AA; +} + +.banner-title +{ + text-align: right; + font-size: 20pt; + font-weight: bold; + margin: .2em; +} + +.package-selector +{ + background-color: #AAAADD; + border: 1px solid black; + color: yellow; +} diff --git a/_Documentation/phpDocumentator/media/stylesheet.css b/_Documentation/phpDocumentator/media/stylesheet.css new file mode 100644 index 00000000..1fc91c19 --- /dev/null +++ b/_Documentation/phpDocumentator/media/stylesheet.css @@ -0,0 +1,144 @@ +a { color: #336699; text-decoration: none; } +a:hover { color: #6699CC; text-decoration: underline; } +a:active { color: #6699CC; text-decoration: underline; } + +body { background : #FFFFFF; } +body, table { font-family: Georgia, Times New Roman, Times, serif; font-size: 10pt } +p, li { line-height: 140% } +a img { border: 0px; } +dd { margin-left: 0px; padding-left: 1em; } + +/* Page layout/boxes */ + +.info-box {} +.info-box-title { margin: 1em 0em 0em 0em; padding: .25em; font-weight: normal; font-size: 14pt; border: 2px solid #999999; background-color: #CCCCFF } +.info-box-body { border: 1px solid #999999; padding: .5em; } +.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; } + +.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} +.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} + +.page-body { max-width: 800px; margin: auto; } +.tree dl { margin: 0px } + +/* Index formatting classes */ + +.index-item-body { margin-top: .5em; margin-bottom: .5em} +.index-item-description { margin-top: .25em } +.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } +.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} +.index-letter-title { font-size: 12pt; font-weight: bold } +.index-letter-menu { text-align: center; margin: 1em } +.index-letter { font-size: 12pt } + +/* Docbook classes */ + +.description {} +.short-description { font-weight: bold; color: #666666; } +.tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; } +.parameters { padding-left: 0em; margin-left: 3em; font-style: italic; list-style-type: square; } +.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } +.package { } +.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } +.package-details { font-size: 85%; } +.sub-package { font-weight: bold; font-size: 120% } +.tutorial { border-width: thin; border-color: #0066ff } +.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; } +.nav-button-disabled { color: #999999; } +.nav-button:active, +.nav-button:focus, +.nav-button:hover { background-color: #DDDDDD; outline: 1px solid #999999; text-decoration: none } +.folder-title { font-style: italic } + +/* Generic formatting */ + +.field { font-weight: bold; } +.detail { font-size: 8pt; } +.notes { font-style: italic; font-size: 8pt; } +.separator { background-color: #999999; height: 2px; } +.warning { color: #FF6600; } +.disabled { font-style: italic; color: #999999; } + +/* Code elements */ + +.line-number { } + +.class-table { width: 100%; } +.class-table-header { border-bottom: 1px dotted #666666; text-align: left} +.class-name { color: #000000; font-weight: bold; } + +.method-summary { padding-left: 1em; font-size: 8pt } +.method-header { } +.method-definition { margin-bottom: .3em } +.method-title { font-weight: bold; } +.method-name { font-weight: bold; } +.method-signature { font-size: 85%; color: #666666; margin: .5em 0em } +.method-result { font-style: italic; } + +.var-summary { padding-left: 1em; font-size: 8pt; } +.var-header { } +.var-title { margin-bottom: .3em } +.var-type { font-style: italic; } +.var-name { font-weight: bold; } +.var-default {} +.var-description { font-weight: normal; color: #000000; } + +.include-title { } +.include-type { font-style: italic; } +.include-name { font-weight: bold; } + +.const-title { } +.const-name { font-weight: bold; } + +/* Syntax highlighting */ + +.src-code { border: 1px solid #336699; padding: 1em; background-color: #EEEEEE; } +.src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } + +.src-comm { color: green; } +.src-id { } +.src-inc { color: #0000FF; } +.src-key { color: #0000FF; } +.src-num { color: #CC0000; } +.src-str { color: #66cccc; } +.src-sym { font-weight: bold; } +.src-var { } + +.src-php { font-weight: bold; } + +.src-doc { color: #009999 } +.src-doc-close-template { color: #0000FF } +.src-doc-coretag { color: #0099FF; font-weight: bold } +.src-doc-inlinetag { color: #0099FF } +.src-doc-internal { color: #6699cc } +.src-doc-tag { color: #0080CC } +.src-doc-template { color: #0000FF } +.src-doc-type { font-style: italic } +.src-doc-var { font-style: italic } + +.tute-tag { color: #009999 } +.tute-attribute-name { color: #0000FF } +.tute-attribute-value { color: #0099FF } +.tute-entity { font-weight: bold; } +.tute-comment { font-style: italic } +.tute-inline-tag { color: #636311; font-weight: bold } + +/* tutorial */ + +.authors { } +.author { font-style: italic; font-weight: bold } +.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } +.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } +*[class="example"] { line-height : 0.5em } +.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } +*[class="listing"] { line-height : 0.5em } +.release-info { font-size: 85%; font-style: italic; margin: 1em 0em } +.ref-title-box { } +.ref-title { } +.ref-purpose { font-style: italic; color: #666666 } +.ref-synopsis { } +.title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #CCCCFF } +.cmd-synopsis { margin: 1em 0em } +.cmd-title { font-weight: bold } +.toc { margin-left: 2em; padding-left: 0em } + diff --git a/_Documentation/phpDocumentator/packages.html b/_Documentation/phpDocumentator/packages.html new file mode 100644 index 00000000..a8b4cd8e --- /dev/null +++ b/_Documentation/phpDocumentator/packages.html @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/_Documentation/phpDocumentator/todolist.html b/_Documentation/phpDocumentator/todolist.html new file mode 100644 index 00000000..7b4f08d3 --- /dev/null +++ b/_Documentation/phpDocumentator/todolist.html @@ -0,0 +1,117 @@ + + + + + + Todo List + + + + +

Todo List

+

ezSQL

+

ezSQL_mssqlTest

+ +

ezSQL_oracle8_9Test

+ +

ezSQL_sybaseTest

+ +

ezSQL_mssqlTest::testConnect()

+ +

ezSQL_oracle8_9Test::testConnect()

+ +

ezSQL_sybaseTest::testConnect()

+ +

ezSQL_mssqlTest::testConvertMySqlToMSSql()

+ +

ezSQL_sybaseTest::testConvertMySqlTosybase()

+ +

ezSQL_oracle8_9Test::testDisconnect()

+ +

ezSQL_sybaseTest::testDisconnect()

+ +

ezSQL_mssqlTest::testDisconnect()

+ +

ezSQL_mssqlTest::testGetDBHost()

+ +

ezSQL_sybaseTest::testGetDBHost()

+ +

ezSQL_oracle8_9Test::testGetDBName()

+ +

ezSQL_oracle8_9Test::testInsert_id()

+ +

ezSQL_oracle8_9Test::testNextVal()

+ +

ezSQL_mssqlTest::testQuery()

+ +

ezSQL_sybaseTest::testQuery()

+ +

ezSQL_oracle8_9Test::testQuery()

+ +

ezSQL_mssqlTest::testQuick_connect()

+ +

ezSQL_oracle8_9Test::testQuick_connect()

+ +

ezSQL_sybaseTest::testQuick_connect()

+ +

ezSQL_sybaseTest::testSelect()

+ +

ezSQL_mssqlTest::testSelect()

+ +

ezSQL_oracle8_9Test::testSelect()

+ +

+ Documentation generated on Mon, 23 Apr 2012 06:40:22 +0200 by phpDocumentor 1.4.4 +

+ + \ No newline at end of file diff --git a/_Test/unit_tests/mssql/ezSQL_mssqlTest.php b/_Test/unit_tests/mssql/ezSQL_mssqlTest.php new file mode 100644 index 00000000..2a5e6ba0 --- /dev/null +++ b/_Test/unit_tests/mssql/ezSQL_mssqlTest.php @@ -0,0 +1,137 @@ + + * @link http://twitter.com/justinvincent + * @name ezSQL_mssqlTest + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * @todo The connection to MS SQL Server is not tested by now. There might also + * be tests done for different versions of SQL Server + * + */ +class ezSQL_mssqlTest extends PHPUnit_Framework_TestCase { + + /** + * @var ezSQL_mssql + */ + protected $object; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->object = new ezSQL_mssql; + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->object = null; + } // tearDown + + /** + * @covers ezSQL_mssql::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testQuick_connect + + /** + * @covers ezSQL_mssql::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testConnect + + /** + * @covers ezSQL_mssql::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testSelect + + /** + * @covers ezSQL_mssql::escape + */ + public function testEscape() { + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testEscape + + /** + * @covers ezSQL_mssql::sysdate + */ + public function testSysdate() { + $this->assertEquals('getDate()', $this->object->sysdate()); + } // testSysdate + + /** + * @covers ezSQL_mssql::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testQuery + + /** + * @covers ezSQL_mssql::ConvertMySqlToMSSql + * @todo Implement testConvertMySqlToMSSql(). + */ + public function testConvertMySqlToMSSql() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testConvert + + /** + * @covers ezSQL_mssql::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testDisconnect + + /** + * @covers ezSQL_mssql::getDBHost + * @todo Implement testGetDBHost(). + */ + public function testGetDBHost() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testGetDBHost + +} // ezSQL_mssqlTest diff --git a/_Test/unit_tests/mysql/ezSQL_mysqlTest.php b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php new file mode 100644 index 00000000..28c2b9b5 --- /dev/null +++ b/_Test/unit_tests/mysql/ezSQL_mysqlTest.php @@ -0,0 +1,194 @@ + + * @name ezSQL_mysql_tear_up + * @uses mysql_test_db_tear_up.sql + * @uses mysql_test_db_tear_down.sql + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQL_mysqlTest extends PHPUnit_Framework_TestCase { + + /** + * constant string user name + */ + const TEST_DB_USER = 'ez_test'; + + /** + * constant string password + */ + const TEST_DB_PASSWORD = 'ezTest'; + + /** + * constant database name + */ + const TEST_DB_NAME = 'ez_test'; + + /** + * constant database host + */ + const TEST_DB_HOST = 'localhost'; + + /** + * constant database connection charset + */ + const TEST_DB_CHARSET = 'utf8'; + + /** + * @var ezSQL_mysql + */ + protected $object; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->object = new ezSQL_mysql; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->object = null; + } + + /** + * @covers ezSQL_mysql::quick_connect + */ + public function testQuick_connect() { + $result = $this->object->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME); + + $this->assertTrue($result); + } + + /** + * @covers ezSQL_mysql::connect + */ + public function testConnect() { + $result = $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + + $this->assertTrue($result); + } // testConnect + + /** + * @covers ezSQL_mysql::select + */ + public function testSelect() { + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + $this->assertTrue($this->object->isConnected()); + + $result = $this->object->select(self::TEST_DB_NAME); + + $this->assertTrue($result); + } // testSelect + + /** + * @covers ezSQL_mysql::escape + */ + public function testEscape() { + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is\\'nt escaped.", $result); + } // testEscape + + /** + * @covers ezSQL_mysql::sysdate + */ + public function testSysdate() { + $this->assertEquals('NOW()', $this->object->sysdate()); + } // testSysdate + + /** + * @covers ezSQL_mysql::query + */ + public function testQueryInsert() { + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + + $this->object->select(self::TEST_DB_NAME); + + $this->assertEquals($this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))'), 0); + $this->assertEquals($this->object->query('INSERT INTO unit_test(id, test_key) VALUES(1, \'test 1\')'), 1); + $this->assertEquals($this->object->query('DROP TABLE unit_test'), 0); + } // testQueryInsert + + /** + * @covers ezSQL_mysql::query + */ + public function testQuerySelect() { + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + + $this->object->select(self::TEST_DB_NAME); + + $this->assertEquals($this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))'), 0); + + $this->assertEquals($this->object->query('INSERT INTO unit_test(id, test_key) VALUES(1, \'test 1\')'), 1); + $this->assertEquals($this->object->query('INSERT INTO unit_test(id, test_key) VALUES(2, \'test 2\')'), 1); + $this->assertEquals($this->object->query('INSERT INTO unit_test(id, test_key) VALUES(3, \'test 3\')'), 1); + + $result = $this->object->query('SELECT * FROM unit_test'); + + $i = 1; + foreach ($this->object->get_results() as $row) { + $this->assertEquals($i, $row->id); + $this->assertEquals('test ' . $i, $row->test_key); + ++$i; + } + + $this->assertEquals($this->object->query('DROP TABLE unit_test'), 0); + } // testQuerySelect + + /** + * @covers ezSQL_mysql::getDBHost + */ + public function testGetDBHost() { + $this->assertEquals(self::TEST_DB_HOST, $this->object->getDBHost()); + } // testGetDBHost + + /** + * @covers ezSQL_mysql::getCharset + */ + public function testGetCharset() { + $this->assertEquals(self::TEST_DB_CHARSET, $this->object->getCharset()); + } // testGetCharset + + /** + * @covers ezSQL_mysql::disconnect + */ + public function testDisconnect() { + $this->object->disconnect(); + + $this->assertTrue(true); + } // testDisconnect + + /** + * @covers ezSQL_mysql::getInsertId + */ + public function testGetInsertId() { + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD); + + $this->object->select(self::TEST_DB_NAME); + + $this->assertEquals($this->object->query('CREATE TABLE unit_test(id int(11) NOT NULL AUTO_INCREMENT, test_key varchar(50), PRIMARY KEY (ID))ENGINE=MyISAM DEFAULT CHARSET=utf8'), 0); + $this->assertEquals($this->object->query('INSERT INTO unit_test(id, test_key) VALUES(1, \'test 1\')'), 1); + + $this->assertEquals(1, $this->object->getInsertId($this->object->dbh)); + + $this->assertEquals($this->object->query('DROP TABLE unit_test'), 0); + } // testInsertId + +} // ezSQL_mysqlTest \ No newline at end of file diff --git a/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql b/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql new file mode 100644 index 00000000..a6574381 --- /dev/null +++ b/_Test/unit_tests/mysql/mysql_test_db_tear_down.sql @@ -0,0 +1,15 @@ +/** + * Tear down script to remove all test objects after the test + * + * @author Stefanie Janine Stoelting + * @name ezSQL_mysql_tear_down + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ + +-- Drop the user +DROP USER ez_test@localhost; + +-- Drop the database +DROP DATABASE ez_test; diff --git a/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql b/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql new file mode 100644 index 00000000..471ecc83 --- /dev/null +++ b/_Test/unit_tests/mysql/myssql_test_db_tear_up.sql @@ -0,0 +1,15 @@ +/** + * Tear up script for generating database and user for tests + * + * @author Stefanie Janine Stoelting + * @name ezSQL_mysql_tear_up + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ + +-- Create the database +CREATE DATABASE ez_test charset='utf8'; + +-- Create the user +GRANT ALL PRIVILEGES ON ez_test.* TO ez_test@localhost IDENTIFIED BY 'ezTest'; diff --git a/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php b/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php new file mode 100644 index 00000000..3c97ab2a --- /dev/null +++ b/_Test/unit_tests/oracle8_9/ezSQL_oracle8_9Test.php @@ -0,0 +1,166 @@ + + * @link http://twitter.com/justinvincent + * @name ezSQL_oracle8_9Test + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * @todo The connection to Oracle is not tested by now. There might also be + * tests done for different versions of Oracle + * + */ +class ezSQL_oracle8_9Test extends PHPUnit_Framework_TestCase { + + /** + * @var ezSQL_oracle8_9 + */ + protected $object; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->object = new ezSQL_oracle8_9; + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->object = null; + } // tearDown + + /** + * @covers ezSQL_oracle8_9::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testConnect + + /** + * @covers ezSQL_oracle8_9::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testQuick_connect + + /** + * @covers ezSQL_oracle8_9::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testSelect + + /** + * @covers ezSQL_oracle8_9::escape + */ + public function testEscape() { + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testEscape + + /** + * @covers ezSQL_oracle8_9::sysdate + */ + public function testSysdate() { + $this->assertEquals('SYSDATE', $this->object->sysdate()); + } // testSysdate + + /** + * @covers ezSQL_oracle8_9::is_equal_str + */ + public function testIs_equal_str() { + $expected = '= \'ezTest string\''; + + $this->assertEquals($expected, $this->object->is_equal_str('ezTest string')); + } // testIs_equal_str + + /** + * @covers ezSQL_oracle8_9::is_equal_int + */ + public function testIs_equal_int() { + $expected = '= 123'; + + $this->assertEquals($expected, $this->object->is_equal_int(123)); + } // testIs_equal_int + + /** + * @covers ezSQL_oracle8_9::insert_id + * @todo Implement testInsert_id(). + */ + public function testInsert_id() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testInsert_id + + /** + * @covers ezSQL_oracle8_9::nextVal + * @todo Implement testNextVal(). + */ + public function testNextVal() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testNextVal + + /** + * @covers ezSQL_oracle8_9::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testQuery + + /** + * @covers ezSQL_oracle8_9::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testDisconnect + + /** + * @covers ezSQL_oracle8_9::getDBName + * @todo Implement testGetDBName(). + */ + public function testGetDBName() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testGetDBName + +} // ezSQL_oracle8_9Test \ No newline at end of file diff --git a/_Test/unit_tests/pdo/ezSQL_pdoTest.php b/_Test/unit_tests/pdo/ezSQL_pdoTest.php new file mode 100644 index 00000000..3051fc79 --- /dev/null +++ b/_Test/unit_tests/pdo/ezSQL_pdoTest.php @@ -0,0 +1,369 @@ + + * @name ezSQL_pdoTest + * @uses postgresql_test_db_tear_up.sql + * @uses postgresql_test_db_tear_down.sql + * @uses mysql_test_db_tear_up.sql + * @uses mysql_test_db_tear_down.sql + * @uses ez_test.sqlite + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQL_pdoTest extends PHPUnit_Framework_TestCase { + + /** + * constant string user name + */ + const TEST_DB_USER = 'ez_test'; + + /** + * constant string password + */ + const TEST_DB_PASSWORD = 'ezTest'; + + /** + * constant string database name + */ + const TEST_DB_NAME = 'ez_test'; + + /** + * constant string database host + */ + const TEST_DB_HOST = 'localhost'; + + /** + * constant string database connection charset + */ + const TEST_DB_CHARSET = 'utf8'; + + /** + * constant string database port + */ + const TEST_DB_PORT = '5432'; + + /** + * constant string path and file name of the SQLite test database + */ + const TEST_SQLITE_DB = '_Test/unit_tests/pdo/ez_test.sqlite'; + + /** + * @var ezSQL_pdo + */ + protected $object; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->object = new ezSQL_pdo; + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->object = null; + } // tearDown + + /** + * @covers ezSQL_pdo::connect + */ + public function testPosgreSQLConnect() { + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testPosgreSQLConnect + + /** + * @covers ezSQL_pdo::quick_connect + */ + public function testPosgreSQLQuick_connect() { + $this->assertTrue($this->object->quick_connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testPosgreSQLQuick_connect + + /** + * @covers ezSQL_pdo::select + */ + public function testPosgreSQLSelect() { + $this->assertTrue($this->object->select('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testPosgreSQLSelect + + /** + * @covers ezSQL_pdo::escape + */ + public function testPosgreSQLEscape() { + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testPosgreSQLEscape + + /** + * @covers ezSQL_pdo::sysdate + */ + public function testPosgreSQLSysdate() { + $this->assertEquals("datetime('now')", $this->object->sysdate()); + } // testPosgreSQLSysdate + + /** + * @covers ezSQL_pdo::catch_error + */ + public function testPosgreSQLCatch_error() { + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertNull($this->object->catch_error()); + } // testPosgreSQLCatch_error + + /** + * @covers ezSQL_pdo::query + */ + public function testPosgreSQLQuery() { + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testPosgreSQLQuery + + /** + * @covers ezSQL_pdo::disconnect + */ + public function testPosgreSQLDisconnect() { + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->object->disconnect(); + + $this->assertTrue(true); + } // testPosgreSQLDisconnect + + /** + * @covers ezSQL_pdo::get_set + */ + public function testPostgreSQLGet_set() { + $expected = "test_var1 = '1', test_var2 = 'ezSQL test', test_var3 = 'This is''nt escaped.'"; + + $params = array( + 'test_var1' => 1, + 'test_var2' => 'ezSQL test', + 'test_var3' => "This is'nt escaped." + ); + + $this->assertTrue($this->object->connect('pgsql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertequals($expected, $this->object->get_set($params)); + } // testPostgreSQLGet_set + + /** + * Here starts the MySQL PDO unit test + */ + + /** + * @covers ezSQL_pdo::connect + */ + public function testMySQLConnect() { + $this->assertTrue($this->object->connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testMySQLConnect + + /** + * @covers ezSQL_pdo::quick_connect + */ + public function testMySQLQuick_connect() { + $this->assertTrue($this->object->quick_connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testMySQLQuick_connect + + /** + * @covers ezSQL_pdo::select + */ + public function testMySQLSelect() { + $this->assertTrue($this->object->select('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + } // testMySQLSelect + + /** + * @covers ezSQL_pdo::escape + */ + public function testMySQLEscape() { + $this->assertTrue($this->object->connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is\'nt escaped.", $result); + } // testMySQLEscape + + /** + * @covers ezSQL_pdo::sysdate + */ + public function testMySQLSysdate() { + $this->assertEquals("datetime('now')", $this->object->sysdate()); + } // testMySQLSysdate + + /** + * @covers ezSQL_pdo::catch_error + */ + public function testMySQLCatch_error() { + $this->assertTrue($this->object->connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertNull($this->object->catch_error()); + } // testMySQLCatch_error + + /** + * @covers ezSQL_pdo::query + */ + public function testMySQLQuery() { + $this->assertTrue($this->object->connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testMySQLQuery + + /** + * @covers ezSQL_pdo::disconnect + */ + public function testMySQLDisconnect() { + $this->assertTrue($this->object->connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->object->disconnect(); + + $this->assertTrue(true); + } // testMySQLDisconnect + + /** + * @covers ezSQL_pdo::connect + */ + public function testMySQLConnectWithOptions() { + $options = array( + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + ); + + $this->assertTrue($this->object->connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD, $options)); + } // testMySQLConnectWithOptions + + /** + * @covers ezSQL_pdo::get_set + */ + public function testMySQLGet_set() { + $expected = "test_var1 = '1', test_var2 = 'ezSQL test', test_var3 = 'This is\'nt escaped.'"; + + $params = array( + 'test_var1' => 1, + 'test_var2' => 'ezSQL test', + 'test_var3' => "This is'nt escaped." + ); + + $this->assertTrue($this->object->connect('mysql:host=' . self::TEST_DB_HOST . ';dbname=' . self::TEST_DB_NAME . ';port=' . self::TEST_DB_PORT, self::TEST_DB_USER, self::TEST_DB_PASSWORD)); + + $this->assertequals($expected, $this->object->get_set($params)); + } // testMySQLGet_set + + /** + * Here starts the SQLite PDO unit test + */ + + /** + * @covers ezSQL_pdo::connect + */ + public function testSQLiteConnect() { + $this->assertTrue($this->object->connect('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + } // testSQLiteConnect + + /** + * @covers ezSQL_pdo::quick_connect + */ + public function testSQLiteQuick_connect() { + $this->assertTrue($this->object->quick_connect('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + } // testSQLiteQuick_connect + + /** + * @covers ezSQL_pdo::select + */ + public function testSQLiteSelect() { + $this->assertTrue($this->object->select('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + } // testSQLiteSelect + + /** + * @covers ezSQL_pdo::escape + */ + public function testSQLiteEscape() { + $this->assertTrue($this->object->connect('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testSQLiteEscape + + /** + * @covers ezSQL_pdo::sysdate + */ + public function testSQLiteSysdate() { + $this->assertEquals("datetime('now')", $this->object->sysdate()); + } // testSQLiteSysdate + + /** + * @covers ezSQL_pdo::catch_error + */ + public function testSQLiteCatch_error() { + $this->assertTrue($this->object->connect('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + + $this->assertNull($this->object->catch_error()); + } // testSQLiteCatch_error + + /** + * @covers ezSQL_pdo::query + */ + public function testSQLiteQuery() { + $this->assertTrue($this->object->connect('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testSQLiteQuery + + /** + * @covers ezSQL_pdo::disconnect + */ + public function testSQLiteDisconnect() { + $this->assertTrue($this->object->connect('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + + $this->object->disconnect(); + + $this->assertTrue(true); + } // testSQLiteDisconnect + + /** + * @covers ezSQL_pdo::get_set + */ + public function testSQLiteGet_set() { + $expected = "test_var1 = '1', test_var2 = 'ezSQL test', test_var3 = 'This is''nt escaped.'"; + + $params = array( + 'test_var1' => 1, + 'test_var2' => 'ezSQL test', + 'test_var3' => "This is'nt escaped." + ); + + $this->assertTrue($this->object->connect('sqlite:' . self::TEST_SQLITE_DB, '', '', array(), true)); + + $this->assertequals($expected, $this->object->get_set($params)); + } // testSQLiteGet_set + +} // ezSQL_pdoTest \ No newline at end of file diff --git a/sqlite/sqlite_test.db b/_Test/unit_tests/pdo/ez_test.sqlite old mode 100755 new mode 100644 similarity index 60% rename from sqlite/sqlite_test.db rename to _Test/unit_tests/pdo/ez_test.sqlite index f17b9e70..57915ff4 Binary files a/sqlite/sqlite_test.db and b/_Test/unit_tests/pdo/ez_test.sqlite differ diff --git a/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php new file mode 100644 index 00000000..6c2fe966 --- /dev/null +++ b/_Test/unit_tests/postgresql/ezSQL_postgresqlTest.php @@ -0,0 +1,185 @@ + + * @name ezSQL_postgresql_tear_up + * @uses postgresql_test_db_tear_up.sql + * @uses postgresql_test_db_tear_down.sql + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQL_postgresqlTest extends PHPUnit_Framework_TestCase { + + /** + * constant string user name + */ + const TEST_DB_USER = 'ez_test'; + + /** + * constant string password + */ + const TEST_DB_PASSWORD = 'ezTest'; + + /** + * constant database name + */ + const TEST_DB_NAME = 'ez_test'; + + /** + * constant database host + */ + const TEST_DB_HOST = 'localhost'; + + /** + * constant database port + */ + const TEST_DB_PORT = '5432'; + + /** + * @var ezSQL_postgresql + */ + protected $object; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->object = new ezSQL_postgresql; + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->object = null; + } // tearDown + + /** + * @covers ezSQL_postgresql::quick_connect + */ + public function testQuick_connect() { + $this->object->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + } // testQuick_connect + + /** + * @covers ezSQL_postgresql::connect + * + */ + public function testConnect() { + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + } // testConnect + + /** + * @covers ezSQL_postgresql::select + */ + public function testSelect() { + $this->object->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + + $this->assertTrue($this->object->select(self::TEST_DB_NAME)); + } // testSelect + + /** + * @covers ezSQL_postgresql::escape + */ + public function testEscape() { + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testEscape + + /** + * @covers ezSQL_postgresql::sysdate + */ + public function testSysdate() { + $this->assertEquals('NOW()', $this->object->sysdate()); + } // testSysdate + + /** + * @covers ezSQL_postgresql::showTables + */ + public function testShowTables() { + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $result = $this->object->showTables(); + + $this->assertEquals('SELECT table_name FROM information_schema.tables WHERE table_schema = \'' . self::TEST_DB_NAME . '\' AND table_type=\'BASE TABLE\'', $result); + } // testShowTables + + /** + * @covers ezSQL_postgresql::descTable + */ + public function testDescTable() { + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals( + "SELECT ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = 'unit_test' AND table_schema='" . self::TEST_DB_NAME . "' ORDER BY ordinal_position", + $this->object->descTable('unit_test') + ); + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testDescTable + + /** + * @covers ezSQL_postgresql::showDatabases + */ + public function testShowDatabases() { + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $this->assertEquals( + "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1", + $this->object->showDatabases() + ); + } // testShowDatabases + + /** + * @covers ezSQL_postgresql::query + */ + public function testQuery() { + $this->assertTrue($this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT)); + + $this->assertEquals(0, $this->object->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))')); + + $this->assertEquals(0, $this->object->query('DROP TABLE unit_test')); + } // testQuery + + /** + * @covers ezSQL_postgresql::disconnect + */ + public function testDisconnect() { + $this->object->disconnect(); + + $this->assertFalse($this->object->isConnected()); + } // testDisconnect + + /** + * @covers ezSQL_postgresql::getDBHost + */ + public function testGetDBHost() { + $this->assertEquals(self::TEST_DB_HOST, $this->object->getDBHost()); + } // testGetDBHost + + /** + * @covers ezSQL_postgresql::getPort + */ + public function testGetPort() { + $this->object->connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME, self::TEST_DB_HOST, self::TEST_DB_PORT); + + $this->assertEquals(self::TEST_DB_PORT, $this->object->getPort()); + } // testGetPort + +} // ezSQL_postgresqlTest \ No newline at end of file diff --git a/_Test/unit_tests/postgresql/postgresql_test_db_tear_down.sql b/_Test/unit_tests/postgresql/postgresql_test_db_tear_down.sql new file mode 100644 index 00000000..88c4ab14 --- /dev/null +++ b/_Test/unit_tests/postgresql/postgresql_test_db_tear_down.sql @@ -0,0 +1,15 @@ +/** + * Tear down script to remove all test objects after the test + * + * @author Stefanie Janine Stoelting + * @name ezSQL_postgresql_tear_down + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ + +-- Drop the database +DROP DATABASE ez_test; + +-- Drop the user +DROP USER ezTest; diff --git a/_Test/unit_tests/postgresql/postgresql_test_db_tear_up.sql b/_Test/unit_tests/postgresql/postgresql_test_db_tear_up.sql new file mode 100644 index 00000000..ff2569fa --- /dev/null +++ b/_Test/unit_tests/postgresql/postgresql_test_db_tear_up.sql @@ -0,0 +1,15 @@ +/** + * Tear up script for generating database and user for tests + * + * @author Stefanie Janine Stoelting + * @name ezSQL_postgresql_tear_up + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ + +-- Create the user +CREATE USER ez_test WITH PASSWORD 'ezTest'; + +-- Create the database +CREATE DATABASE ez_test OWNER ez_test; diff --git a/_Test/unit_tests/shared/ezSQL_recordsetTest.php b/_Test/unit_tests/shared/ezSQL_recordsetTest.php new file mode 100644 index 00000000..41df2289 --- /dev/null +++ b/_Test/unit_tests/shared/ezSQL_recordsetTest.php @@ -0,0 +1,189 @@ + + * @name SQL_recordsetTest + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQL_recordsetTest extends PHPUnit_Framework_TestCase { + + /** + * constant string user name + */ + const TEST_DB_USER = 'ez_test'; + + /** + * constant string password + */ + const TEST_DB_PASSWORD = 'ezTest'; + + /** + * constant database name + */ + const TEST_DB_NAME = 'ez_test'; + + /** + * constant database host + */ + const TEST_DB_HOST = 'localhost'; + + /** + * constant database connection charset + */ + const TEST_DB_CHARSET = 'utf8'; + + /** + * @var ezSQL_recordset + */ + protected $object; + + /** + * ezSQL connection + * @var ezSQL_mysql + */ + protected $ezSQL = null; + + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->ezSQL = new ezSQL_mysql; + $this->ezSQL->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME); + + $this->ezSQL->select(self::TEST_DB_NAME); + + $this->ezSQL->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(1, \'test 1\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(2, \'test 2\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(3, \'test 3\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(4, \'test 4\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(5, \'test 5\')'); + + $this->ezSQL->query('SELECT * FROM unit_test'); + + $this->object = new ezSQL_recordset($this->ezSQL->get_results()); + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->ezSQL->query('DROP TABLE unit_test'); + + $this->object = null; + } // tearDown + + /** + * @covers ezSQL_recordset::rewind + */ + public function testRewind() { + for ($index = 0; $index < 3; $index++) { + $result = $this->object->ezSQL_fetch_object(); + + $this->assertEquals($index + 1, $result->id); + } + + $this->object->rewind(); + $result = $this->object->ezSQL_fetch_object(); + $this->assertEquals(1, $result->id); + } // testRewind + + /** + * @covers ezSQL_recordset::current + */ + public function testCurrent() { + $result = $this->object->current(ezSQL_recordset::RESULT_AS_OBJECT); + + $this->assertTrue(is_a($result, 'stdClass')); + + $this->assertEquals(1, $result->id); + } // testCurrent + + /** + * @covers ezSQL_recordset::key + */ + public function testKey() { + $this->assertEquals(0, $this->object->key()); + + $this->object->ezSQL_fetch_object(); + + $this->assertEquals(1, $this->object->key()); + } // testKey + + /** + * @covers ezSQL_recordset::next + */ + public function testNext() { + $this->object->current(ezSQL_recordset::RESULT_AS_OBJECT); + $this->assertEquals(0, $this->object->key()); + + $this->object->next(); + $this->assertEquals(1, $this->object->key()); + } // testNext + + /** + * @covers ezSQL_recordset::previous + */ + public function testPrevious() { + $this->object->current(ezSQL_recordset::RESULT_AS_OBJECT); + $this->object->next(); + $this->object->next(); + $this->assertEquals(2, $this->object->key()); + + $this->object->previous(); + $this->assertEquals(1, $this->object->key()); + } // testPrevious + + /** + * @covers ezSQL_recordset::valid + */ + public function testValid() { + $this->assertTrue($this->object->valid()); + } // testValid + + /** + * @covers ezSQL_recordset::ezSQL_fetch_assoc + */ + public function testEzSQL_fetch_assoc() { + $result = $this->object->ezSQL_fetch_assoc(); + + $this->assertTrue(is_array($result)); + + $this->assertEquals(1, $result['id']); + } // testEzSQL_fetch_assoc + + /** + * @covers ezSQL_recordset::ezSQL_fetch_row + */ + public function testEzSQL_fetch_row() { + $result = $this->object->ezSQL_fetch_row(); + + $this->assertTrue(is_array($result)); + + $this->assertEquals(1, $result[0]); + } // testEzSQL_fetch_row + + /** + * @covers ezSQL_recordset::ezSQL_fetch_object + */ + public function testEzSQL_fetch_object() { + $result = $this->object->ezSQL_fetch_object(); + + $this->assertTrue(is_a($result, 'stdClass')); + + $this->assertEquals(1, $result->id); + } // testEzSQL_fetch_object + +} // ezSQL_recordsetTest \ No newline at end of file diff --git a/_Test/unit_tests/shared/ezSQL_recordsetTest_2.php b/_Test/unit_tests/shared/ezSQL_recordsetTest_2.php new file mode 100644 index 00000000..68d1a3a4 --- /dev/null +++ b/_Test/unit_tests/shared/ezSQL_recordsetTest_2.php @@ -0,0 +1,189 @@ + + * @name SQL_recordsetTest + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQL_recordsetTest2 extends PHPUnit_Framework_TestCase { + + /** + * constant string user name + */ + const TEST_DB_USER = 'ez_test'; + + /** + * constant string password + */ + const TEST_DB_PASSWORD = 'ezTest'; + + /** + * constant database name + */ + const TEST_DB_NAME = 'ez_test'; + + /** + * constant database host + */ + const TEST_DB_HOST = 'localhost'; + + /** + * constant database connection charset + */ + const TEST_DB_CHARSET = 'utf8'; + + /** + * @var ezSQL_recordset + */ + protected $object; + + /** + * ezSQL connection + * @var ezSQL_mysql + */ + protected $ezSQL = null; + + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->ezSQL = new ezSQL_mysql; + $this->ezSQL->quick_connect(self::TEST_DB_USER, self::TEST_DB_PASSWORD, self::TEST_DB_NAME); + + $this->ezSQL->select(self::TEST_DB_NAME); + + $this->ezSQL->query('CREATE TABLE unit_test(id integer, test_key varchar(50), PRIMARY KEY (ID))'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(1, \'test 1\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(2, \'test 2\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(3, \'test 3\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(4, \'test 4\')'); + $this->ezSQL->query('INSERT INTO unit_test(id, test_key) VALUES(5, \'test 5\')'); + + $this->ezSQL->query('SELECT * FROM unit_test WHERE id = 7'); + + $this->object = new ezSQL_recordset($this->ezSQL->get_results()); + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->ezSQL->query('DROP TABLE unit_test'); + + $this->object = null; + } // tearDown + + /** + * @covers ezSQL_recordset::rewind + */ + public function testRewind() { + for ($index = 0; $index < 3; $index++) { + $result = $this->object->ezSQL_fetch_object(); + + $this->assertEquals($index + 1, $result->id); + } + + $this->object->rewind(); + $result = $this->object->ezSQL_fetch_object(); + $this->assertEquals(1, $result->id); + } // testRewind + + /** + * @covers ezSQL_recordset::current + */ + public function testCurrent() { + $result = $this->object->current(ezSQL_recordset::RESULT_AS_OBJECT); + + $this->assertTrue(is_a($result, 'stdClass')); + + $this->assertEquals(1, $result->id); + } // testCurrent + + /** + * @covers ezSQL_recordset::key + */ + public function testKey() { + $this->assertEquals(0, $this->object->key()); + + $this->object->ezSQL_fetch_object(); + + $this->assertEquals(1, $this->object->key()); + } // testKey + + /** + * @covers ezSQL_recordset::next + */ + public function testNext() { + $this->object->current(ezSQL_recordset::RESULT_AS_OBJECT); + $this->assertEquals(0, $this->object->key()); + + $this->object->next(); + $this->assertEquals(1, $this->object->key()); + } // testNext + + /** + * @covers ezSQL_recordset::previous + */ + public function testPrevious() { + $this->object->current(ezSQL_recordset::RESULT_AS_OBJECT); + $this->object->next(); + $this->object->next(); + $this->assertEquals(2, $this->object->key()); + + $this->object->previous(); + $this->assertEquals(1, $this->object->key()); + } // testPrevious + + /** + * @covers ezSQL_recordset::valid + */ + public function testValid() { + $this->assertTrue($this->object->valid()); + } // testValid + + /** + * @covers ezSQL_recordset::ezSQL_fetch_assoc + */ + public function testEzSQL_fetch_assoc() { + $result = $this->object->ezSQL_fetch_assoc(); + + $this->assertTrue(is_array($result)); + + $this->assertEquals(1, $result['id']); + } // testEzSQL_fetch_assoc + + /** + * @covers ezSQL_recordset::ezSQL_fetch_row + */ + public function testEzSQL_fetch_row() { + $result = $this->object->ezSQL_fetch_row(); + + $this->assertTrue(is_array($result)); + + $this->assertEquals(1, $result[0]); + } // testEzSQL_fetch_row + + /** + * @covers ezSQL_recordset::ezSQL_fetch_object + */ + public function testEzSQL_fetch_object() { + $result = $this->object->ezSQL_fetch_object(); + + $this->assertTrue(is_a($result, 'stdClass')); + + $this->assertEquals(1, $result->id); + } // testEzSQL_fetch_object + +} // ezSQL_recordsetTest \ No newline at end of file diff --git a/_Test/unit_tests/shared/ezSQLcoreTest.php b/_Test/unit_tests/shared/ezSQLcoreTest.php new file mode 100644 index 00000000..482bc46a --- /dev/null +++ b/_Test/unit_tests/shared/ezSQLcoreTest.php @@ -0,0 +1,217 @@ + + * @name ezSQLcoreTest + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQLcoreTest extends PHPUnit_Framework_TestCase { + + /** + * @var ezSQLcore + */ + protected $object; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->object = new ezSQLcore; + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->object = null; + } // tearDown + + /** + * @covers ezSQLcore::register_error + */ + public function testRegister_error() { + $err_str = 'Test error string'; + + $this->object->register_error($err_str); + + $this->assertEquals($err_str, $this->object->last_error); + } // testRegister_error + + /** + * @covers ezSQLcore::show_errors + */ + public function testShow_errors() { + $this->object->hide_errors(); + + $this->assertFalse($this->object->getShowErrors()); + + $this->object->show_errors(); + + $this->assertTrue($this->object->getShowErrors()); + } // testShow_errors + + /** + * @covers ezSQLcore::hide_errors + */ + public function testHide_errors() { + $this->object->hide_errors(); + + $this->assertFalse($this->object->getShowErrors()); + } // testHide_errors + + /** + * @covers ezSQLcore::flush + */ + public function testFlush() { + $this->object->flush(); + + $this->assertNull($this->object->last_result); + $this->assertNull($this->object->col_info); + $this->assertNull($this->object->last_query); + $this->assertFalse($this->object->from_disk_cache); + } // testFlush + + /** + * @covers ezSQLcore::get_var + */ + public function testGet_var() { + $this->assertNull($this->object->get_var()); + } // testGet_var + + /** + * @covers ezSQLcore::get_row + */ + public function testGet_row() { + $this->assertNull($this->object->get_row()); + } // testGet_row + + /** + * @covers ezSQLcore::get_col + */ + public function testGet_col() { + $this->assertEmpty($this->object->get_col()); + } // testGet_col + + /** + * @covers ezSQLcore::get_results + */ + public function testGet_results() { + $this->assertNull($this->object->get_results()); + } // testGet_results + + /** + * @covers ezSQLcore::get_col_info + */ + public function testGet_col_info() { + $this->assertEmpty($this->object->get_col_info()); + } // testGet_col_info + + /** + * @covers ezSQLcore::store_cache + */ + public function testStore_cache() { + $sql = 'SELECT * FROM ez_test'; + + $this->object->store_cache($sql, true); + + $this->assertNull($this->object->get_cache($sql)); + } // testStore_cache + + /** + * @covers ezSQLcore::get_cache + */ + public function testGet_cache() { + $sql = 'SELECT * FROM ez_test'; + + $this->object->store_cache($sql, true); + + $this->assertNull($this->object->get_cache($sql)); + } // testGet_cache + + /** + * The test echos HTML, it is just a test, that is still running + * @covers ezSQLcore::vardump + */ + public function testVardump() { + $this->object->vardump(); + } // testVardump + + /** + * The test echos HTML, it is just a test, that is still running + * @covers ezSQLcore::dumpvar + */ + public function testDumpvar() { + $this->object->dumpvar(''); + } // testDumpvar + + /** + * @covers ezSQLcore::debug + */ + public function testDebug() { + $this->assertNotEmpty($this->object->debug(false)); + + // In addition of getting a result, it fills the console + $this->assertNotEmpty($this->object->debug(true)); + } // testDebug + + /** + * @covers ezSQLcore::donation + */ + public function testDonation() { + $this->assertNotEmpty($this->object->donation()); + } // testDonation + + /** + * @covers ezSQLcore::timer_get_cur + */ + public function testTimer_get_cur() { + list($usec, $sec) = explode(' ',microtime()); + + $expected = ((float)$usec + (float)$sec); + + $this->assertGreaterThanOrEqual($expected, $this->object->timer_get_cur()); + } // testTimer_get_cur + + /** + * @covers ezSQLcore::timer_start + */ + public function testTimer_start() { + $this->object->timer_start('test_timer'); + } // testTimer_start + + /** + * @covers ezSQLcore::timer_elapsed + */ + public function testTimer_elapsed() { + $expected = 0; + + $this->object->timer_start('test_timer'); + + $this->assertGreaterThanOrEqual($expected, $this->object->timer_elapsed('test_timer')); + } // testTimer_elapsed + + /** + * @covers ezSQLcore::timer_update_global + */ + public function testTimer_update_global() { + $this->object->timer_start('test_timer'); + $this->object->timer_update_global('test_timer'); + } + + /** + * @covers ezSQLcore::affectedRows + */ + public function testAffectedRows() { + $this->assertEquals(0, $this->object->affectedRows()); + } // testAffectedRows + +} // diff --git a/_Test/unit_tests/sybase/ezSQL_sybaseTest.php b/_Test/unit_tests/sybase/ezSQL_sybaseTest.php new file mode 100644 index 00000000..2e215d44 --- /dev/null +++ b/_Test/unit_tests/sybase/ezSQL_sybaseTest.php @@ -0,0 +1,137 @@ + + * @link http://twitter.com/justinvincent + * @name ezSQL_sybaseTest + * @package ezSQL + * @subpackage unitTests + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * @todo The connection to Sybase ASE is not tested by now. There might also + * be tests done for different versions of Sybase ASE + * + */ +class ezSQL_sybaseTest extends PHPUnit_Framework_TestCase { + + /** + * @var ezSQL_sybase + */ + protected $object; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + $this->object = new ezSQL_sybase; + } // setUp + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + $this->object = null; + } // tearDown + + /** + * @covers ezSQL_sybase::quick_connect + * @todo Implement testQuick_connect(). + */ + public function testQuick_connect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testQuick_connect + + /** + * @covers ezSQL_sybase::connect + * @todo Implement testConnect(). + */ + public function testConnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testConnect + + /** + * @covers ezSQL_sybase::select + * @todo Implement testSelect(). + */ + public function testSelect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testSelect + + /** + * @covers ezSQL_sybase::escape + */ + public function testEscape() { + $result = $this->object->escape("This is'nt escaped."); + + $this->assertEquals("This is''nt escaped.", $result); + } // testEscape + + /** + * @covers ezSQL_sybase::sysdate + */ + public function testSysdate() { + $this->assertEquals('getDate()', $this->object->sysdate()); + } // testSysdate + + /** + * @covers ezSQL_sybase::query + * @todo Implement testQuery(). + */ + public function testQuery() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testQuery + + /** + * @covers ezSQL_sybase::ConvertMySqlTosybase + * @todo Implement testConvertMySqlTosybase(). + */ + public function testConvertMySqlTosybase() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testConvertMySqlTosybase + + /** + * @covers ezSQL_sybase::disconnect + * @todo Implement testDisconnect(). + */ + public function testDisconnect() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testDisconnect + + /** + * @covers ezSQL_sybase::getDBHost + * @todo Implement testGetDBHost(). + */ + public function testGetDBHost() { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } // testGetDBHost + +} // ezSQL_sybaseTest \ No newline at end of file diff --git a/codeigniter/Ezsql_codeigniter.php b/codeigniter/Ezsql_codeigniter.php index 360698e7..574204ca 100755 --- a/codeigniter/Ezsql_codeigniter.php +++ b/codeigniter/Ezsql_codeigniter.php @@ -1,158 +1,168 @@ -Fatal Error: ezSQL requires ezSQLcore (application/helpers/ez_sql_core_helper.php) to be included/loaded before it can be used'); - - class ezSQL_codeigniter extends ezSQLcore - { - - var $debug = true; - - function __construct() - { - global $db; - $db = $this; - $this->CI =& get_instance(); - } - - function query($query) - { - // Initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Start timer - $this->timer_start($this->num_queries); - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $cache; - } - - // Perform the query via CI database system - $ci_query = $this->CI->db->query($query); - - // If there is an error then take note of it.. - if ( $str = $this->CI->db->_error_message() ) - { - $this->register_error($str); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return false; - } - - // Query was write (insert/delete/update etc.) query? - $is_insert = false; - - if ( preg_match("/^(insert|delete|update|replace|truncate|drop|create|alter)\s+/i",$query) ) - { - $this->rows_affected = $this->CI->db->affected_rows(); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = $this->CI->db->insert_id(); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Store Query Results - $num_rows=0; - if ( $ci_query->num_rows() ) - { - foreach ($ci_query->result() as $row) - { - // Take note of column info - if ( $num_rows == 0 ) - { - $i=0; - foreach ( get_object_vars($row) as $k => $v ) - { - $this->col_info[$i]->name = $k; - $this->col_info[$i]->max_length = $k; - $this->col_info[$i]->type = ''; - $i++; - } - } - - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - } - - // Log number of rows the query returned - $return_val = $this->num_rows = $num_rows; - - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $return_val; - - } - - /********************************************************************** - * Format a sql string correctly for safe insert - */ - - function escape($str, $like = FALSE) - { - return $this->CI->db->escape_str(stripslashes($str), $like = FALSE); - } - - } + + * @link http://twitter.com/justinvincent + * @name ezSQL_codeigniter + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_codeigniter extends ezSQLcore +{ + /** + * Run in debug mode + * @var boolean Default is true + */ + public $debug = true; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + + /** + * + * @throws Exception Requires ez_sql_core.php + */ + function __construct() { + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL requires ezSQLcore (application/helpers/ez_sql_core_helper.php) to be included/loaded before it can be used'); + } + + global $db; + $db = $this; + $this->CI =& get_instance(); + } // __construct + + /** + * Perform codignitor query and try to determine result value + * + * @param string $query + * @return boolean|int + */ + public function query($query) { + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Start timer + $this->timer_start($this->num_queries); + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } + + return $cache; + } + + // Perform the query via CI database system + $ci_query = $this->CI->db->query($query); + + // If there is an error then take note of it.. + if ( $str = $this->CI->db->_error_message() ) { + $this->register_error($str); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return false; + } + + // Query was write (insert/delete/update etc.) query? + $is_insert = false; + + if ( preg_match("/^(insert|delete|update|replace|truncate|drop|create|alter)\s+/i", $query) ) { + $this->rows_affected = $this->CI->db->affected_rows(); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) + { + $this->insert_id = $this->CI->db->insert_id(); + } + + // Return number fo rows affected + $return_val = $this->rows_affected; + } else { + // Query was a select + // Store Query Results + $num_rows=0; + if ( $ci_query->num_rows() ) { + foreach ($ci_query->result() as $row) { + // Take note of column info + if ( $num_rows == 0 ) { + $i = 0; + foreach ( get_object_vars($row) as $k => $v ) { + $this->col_info[$i]->name = $k; + $this->col_info[$i]->max_length = $k; + $this->col_info[$i]->type = ''; + $i++; + } + } + + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + } + + // Log number of rows the query returned + $return_val = $this->num_rows = $num_rows; + + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } + + return $return_val; + } // query + + /** + * Format a sql string correctly for safe insert + * + * @param string $str + * @param boolean $like + * @return string + */ + public function escape($str, $like=false) { + return $this->CI->db->escape_str(stripslashes($str), $like = false); + } // escape + +} // ezSQL_codeigniter \ No newline at end of file diff --git a/mssql/demo.php b/mssql/demo.php index 98928c1d..0d38f2de 100755 --- a/mssql/demo.php +++ b/mssql/demo.php @@ -1,4 +1,7 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing mssql database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'SQL Server database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - mssql - */ - - if ( ! function_exists ('mssql_connect') ) die('Fatal Error: ezSQL_mssql requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable MS-SQL extenstion in PHP.ini file '); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_mssql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_mssql extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - //if we want to convert Queries in MySql syntax to MS-SQL syntax. Yes, there - //are some differences in query syntax. - var $convertMySqlToMSSqlQuery = TRUE; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_mssql class - */ - - function ezSQL_mssql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlToMSSqlQuery=true) - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - $this->convertMySqlToMSSqlQuery = $convertMySqlToMSSqlQuery; - } - - /********************************************************************** - * Short hand way to connect to mssql database server - * and select a mssql database at the same time - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to mssql database server - */ - - function connect($dbuser='', $dbpassword='', $dbhost='localhost') - { - global $ezsql_mssql_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_mssql_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - - else if ( ! $this->dbh = @mssql_connect($dbhost,$dbuser,$dbpassword) ) - { - $this->register_error($ezsql_mssql_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Try to select a mssql database - */ - - function select($dbname='') - { - global $ezsql_mssql_str; $return_val = false; - - // Must have a database name - if ( ! $dbname ) - { - $this->register_error($ezsql_mssql_str[3].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[3],E_USER_WARNING) : null; - } - - // Must have an active database connection - else if ( ! $this->dbh ) - { - $this->register_error($ezsql_mssql_str[4].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mssql_str[4],E_USER_WARNING) : null; - } - - // Try to connect to the database - - else if ( !@mssql_select_db($dbname,$this->dbh) ) - { - $str = $ezsql_mssql_str[5]; - - $this->register_error($str.' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - } - else - { - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Format a mssql string correctly for safe mssql insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - //not sure about this. - //applying following logic - //1. add 1 more ' to ' character - - return str_ireplace("'", "''", $str); - - } - - /********************************************************************** - * Return mssql specific system date syntax - * i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate() - */ - - function sysdate() - { - return 'getDate()'; - } - - /********************************************************************** - * Perform mssql query and try to detirmin result value - */ - - function query($query) - { - - //if flag to convert query from MySql syntax to MS-Sql syntax is true - //convert the query - if($this->convertMySqlToMSSqlQuery == true) - $query = $this->ConvertMySqlToMSSql($query); - - - - // Initialise return - $return_val = 0; - - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - - - - // Perform the query via std mssql_query function.. - - $this->result = @mssql_query($query); - - - - // If there is an error then take note of it.. - if ($this->result == false ) - { - - $get_errorcodeSql = "SELECT @@ERROR as errorcode"; - $error_res = @mssql_query($get_errorcodeSql, $this->dbh); - $errorCode = @mssql_result($error_res, 0, "errorcode"); - - $get_errorMessageSql = "SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ".$errorCode ; - $errormessage_res = @mssql_query($get_errorMessageSql, $this->dbh); - if($errormessage_res) - { - $errorMessage_Row = @mssql_fetch_row($errormessage_res); - $errorSeverity = $errorMessage_Row[0]; - $errorMessage = $errorMessage_Row[1]; - } - - $sqlError = "ErrorCode: ".$errorCode." ### Error Severity: ".$errorSeverity." ### Error Message: ".$errorMessage." ### Query: ".$query; - - $is_insert = true; - $this->register_error($sqlError); - $this->show_errors ? trigger_error($sqlError ,E_USER_WARNING) : null; - return false; - } - - - - - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @mssql_rows_affected($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - - $identityresultset = @mssql_query("select SCOPE_IDENTITY()"); - - if ($identityresultset != false ) - { - $identityrow = @mssql_fetch_row($identityresultset); - $this->insert_id = $identityrow[0]; - } - - } - - // Return number of rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Take note of column info - $i=0; - while ($i < @mssql_num_fields($this->result)) - { - $this->col_info[$i] = @mssql_fetch_field($this->result); - $i++; - - } - - // Store Query Results - $num_rows=0; - - while ( $row = @mssql_fetch_object($this->result) ) - { - - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - - @mssql_free_result($this->result); - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - - - /********************************************************************** - * Convert a Query From MySql Syntax to MS-Sql syntax - Following conversions are made:- - 1. The '`' character used for MySql queries is not supported - the character is removed. - 2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with - getDate(). Warning: This logic may not be right. - 3. unix_timestamp function is removed. - 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested. - - Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. - This method doesn't at all guarantee complete conversion. Certain queries will still - not work. e.g. MS SQL requires all columns in Select Clause to be present in 'group by' clause. - There is no such restriction in MySql. - */ - - function ConvertMySqlToMSSql($query) - { - - - //replace the '`' character used for MySql queries, but not - //supported in MS-Sql - - $query = str_replace("`", "", $query); - - //replace From UnixTime command in MS-Sql, doesn't work - - $pattern = "FROM_UNIXTIME\(([^/]{0,})\)"; - $replacement = "getdate()"; - //ereg($pattern, $query, $regs); - //we can get the Unix Time function parameter value from this string - //$valueInsideFromUnixTime = $regs[1]; - - $query = eregi_replace($pattern, $replacement, $query); - - - //replace LIMIT keyword. Works only on MySql not on MS-Sql - //replace it with TOP keyword - - $pattern = "LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})"; - $replacement = ""; - eregi($pattern, $query, $regs); - $query = eregi_replace($pattern, $replacement, $query); - - if($regs[2]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[3]." ", $query); - else - { - if($regs[1]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[1]." ", $query); - } - - - //replace unix_timestamp function. Doesn't work in MS-Sql - $pattern = "unix_timestamp\(([^/]{0,})\)"; - $replacement = "\\1"; - $query = eregi_replace($pattern, $replacement, $query); - - return $query; - - } - - - - - } - - -?> +/** + * ezSQL Database specific class - mssql + * Microsoft Sql Server component (part of ezSQL databse abstraction library) - + * based on ezSql_mySql library class. + * + * @author ashank (ashank@gmail.com) + * @author Stefanie Janine Stoelting + * @link http://twitter.com/justinvincent + * @name ezSQL_mssql + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQL_mssql extends ezSQLcore +{ + /** + * ezSQL error strings - mssql + * @var array Default 5 error messages + */ + private $ezsql_mssql_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing mssql database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'SQL Server database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + + /** + * If we want to convert Queries in MySql syntax to MS-SQL syntax. Yes, + * there are some differences in query syntax. + * @var boolean Default is true + */ + private $convertMySqlToMSSqlQuery = true; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_mssql class + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param boolean $convertMySqlToMSSqlQuery Default is true + * @throws Exception Requires ntwdblib.dll and ez_sql_core.php + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlToMSSqlQuery=true) { + if ( ! function_exists ('mssql_connect') ) { + throw new Exception('Fatal Error: ezSQL_mssql requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable MS-SQL extenstion in PHP.ini file '); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_mssql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + $this->convertMySqlToMSSqlQuery = $convertMySqlToMSSqlQuery; + } // __construct + + /** + * Short hand way to connect to mssql database server and select a mssql + * database at the same time + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { + if ( ! $this->connect($dbuser, $dbpassword, $dbhost) ) ; + else if ( ! $this->select($dbname) ); + + return $this->connected; + } // quick_connect + + /** + * Try to connect to mssql database server + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { + $this->connected = false; + + // Must have a user and a password + if ( ! $dbuser ) + { + $this->register_error($this->ezsql_mssql_str[1] . ' in ' . __FILE__ . ' on line ' .__LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = @mssql_connect($dbhost, $dbuser, $dbpassword) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_mssql_str[2] . ' in ' .__FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[2], E_USER_WARNING) : null; + } else { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbhost = $dbhost; + $this->connected = true; + } + + return $this->connected; + } // connect + + /** + * Try to select a mssql database + * + * @param string $dbname The name of the database + * @return boolean + */ + public function select($dbname='') { + if ( ! $dbname ) { + // Must have a database name + $this->register_error($this->ezsql_mssql_str[3] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[3], E_USER_WARNING) : null; + } else if ( ! $this->dbh ) { + // Must have an active database connection + $this->register_error($this->ezsql_mssql_str[4] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mssql_str[4], E_USER_WARNING) : null; + } else if ( !@mssql_select_db($dbname,$this->dbh) ) { + // Try to connect to the database + $str = $this->ezsql_mssql_str[5]; + + $this->register_error($str . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + } else { + $this->dbname = $dbname; + $this->connected = true; + } + + return $this->connected; + } // select + + /** + * Format a mssql string correctly for safe mssql insert + * + * @param string $str + * @return string + */ + public function escape($str) { + $return_val = ''; + + if ( !isset($str) or empty($str) ) { + $return_val = ''; + } else if ( is_numeric($str) ) { + $return_val = $str; + } else { + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', // 11 + '/\x0c/', // 12 + '/[\x0e-\x1f]/' // 14-31 + ); + + foreach ( $non_displayables as $regex ) { + $str = preg_replace( $regex, '', $str ); + } + + $return_val = str_replace("'", "''", $str ); + } + + return $return_val; + } // escape + + /** + * Return mssql specific system date syntax + * i.e. Oracle: SYSDATE mssql: NOW(), MS-SQL : getDate() + * + * @return string + */ + public function sysdate() { + return 'getDate()'; + } // sysdate + + + /** + * Perform the mssql query and try to determine the result value + * + * @param string $query + * @return boolean + */ + public function query($query) { + + // If flag to convert query from MySql syntax to MS-Sql syntax is true + // convert the query + if($this->convertMySqlToMSSqlQuery == true) { + $query = $this->ConvertMySqlToMSSql($query); + } + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); + $this->select($this->dbname); + } + + // Perform the query via std mssql_query function.. + + $this->result = @mssql_query($query); + + // If there is an error then take note of it.. + if ($this->result == false ) { + + $get_errorcodeSql = "SELECT @@ERROR as errorcode"; + $error_res = @mssql_query($get_errorcodeSql, $this->dbh); + $errorCode = @mssql_result($error_res, 0, 'errorcode'); + + $get_errorMessageSql = "SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ".$errorCode ; + $errormessage_res = @mssql_query($get_errorMessageSql, $this->dbh); + + if($errormessage_res) { + $errorMessage_Row = @mssql_fetch_row($errormessage_res); + $errorSeverity = $errorMessage_Row[0]; + $errorMessage = $errorMessage_Row[1]; + } + + $sqlError = "ErrorCode: " . $errorCode . " ### Error Severity: " . $errorSeverity . " ### Error Message: ".$errorMessage." ### Query: " . $query; + + $is_insert = true; + $this->register_error($sqlError); + $this->show_errors ? trigger_error($sqlError, E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) { + $this->affectedRows = @mssql_rows_affected($this->dbh); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i",$query) ) { + + $identityresultset = @mssql_query("select SCOPE_IDENTITY()"); + + if ($identityresultset != false) { + $identityrow = @mssql_fetch_row($identityresultset); + $this->insert_id = $identityrow[0]; + } + } + + // Return number of rows affected + $return_val = $this->affectedRows; + } else { + // Query was a select + + // Take note of column info + $i=0; + while ($i < @mssql_num_fields($this->result)) { + $this->col_info[$i] = @mssql_fetch_field($this->result); + $i++; + } + + // Store Query Results + $num_rows=0; + + while ( $row = @mssql_fetch_object($this->result) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + + @mssql_free_result($this->result); + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + } + + // disk caching of queries + $this->store_cache($query,$is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + } // query + + /** + * Convert a Query From MySql Syntax to MS-Sql syntax + * Following conversions are made: + * 1. The '`' character used for MySql queries is not supported - + * the character is removed. + * 2. FROM_UNIXTIME method is not supported. The Function is removed.It is + * replaced with getDate(). Warning: This logic may not be right. + * 3. unix_timestamp function is removed. + * 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully + * tested. + * + * Note: This method is only a small attempt to convert the syntax. There + * are many aspects which are not covered here. + * This method doesn't at all guarantee complete conversion. Certain + * queries will still not work. e.g. MS SQL requires all columns in + * Select Clause to be present in 'group by' clause. + * There is no such restriction in MySql. + * + * @param string $query + * @return string + */ + public function ConvertMySqlToMSSql($query) { + // replace the '`' character used for MySql queries, but not + // supported in MS-Sql + + $query = str_replace('`', '', $query); + + // replace From UnixTime command in MS-Sql, doesn't work + $pattern = "FROM_UNIXTIME\(([^/]{0,})\)"; + $replacement = 'getdate()'; + //ereg($pattern, $query, $regs); + //we can get the Unix Time function parameter value from this string + //$valueInsideFromUnixTime = $regs[1]; + + $query = eregi_replace($pattern, $replacement, $query); + + // replace LIMIT keyword. Works only on MySql not on MS-Sql + // replace it with TOP keyword + $pattern = "LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})"; + $replacement = ''; + eregi($pattern, $query, $regs); + $query = eregi_replace($pattern, $replacement, $query); + + if ( $regs[2] ) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[3] . ' ', $query); + } else if ( $regs[1] ) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[1] . ' ', $query); + } + + //replace unix_timestamp function. Doesn't work in MS-Sql + $pattern = "unix_timestamp\(([^/]{0,})\)"; + $replacement = "\\1"; + $query = eregi_replace($pattern, $replacement, $query); + + return $query; + } // ConvertMySqlToMSSql + + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + $this->dbh = null; + $this->connected = false; + } + } // disconnect + + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + +} // ezSQL_mssql \ No newline at end of file diff --git a/mysql/demo.php b/mysql/demo.php index 8850b104..ea1aa7c3 100755 --- a/mysql/demo.php +++ b/mysql/demo.php @@ -1,4 +1,7 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing mySQL database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'mySQL database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - mySQL - */ - - if ( ! function_exists ('mysql_connect') ) die('Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_mysql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_mysql extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_mysql class - */ - - function ezSQL_mysql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - } - - /********************************************************************** - * Short hand way to connect to mySQL database server - * and select a mySQL database at the same time - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to mySQL database server - */ - - function connect($dbuser='', $dbpassword='', $dbhost='localhost') - { - global $ezsql_mysql_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_mysql_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = @mysql_connect($dbhost,$dbuser,$dbpassword,true,131074) ) - { - $this->register_error($ezsql_mysql_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Try to select a mySQL database - */ - - function select($dbname='') - { - global $ezsql_mysql_str; $return_val = false; - - // Must have a database name - if ( ! $dbname ) - { - $this->register_error($ezsql_mysql_str[3].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[3],E_USER_WARNING) : null; - } - - // Must have an active database connection - else if ( ! $this->dbh ) - { - $this->register_error($ezsql_mysql_str[4].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_mysql_str[4],E_USER_WARNING) : null; - } - - // Try to connect to the database - else if ( !@mysql_select_db($dbname,$this->dbh) ) - { - // Try to get error supplied by mysql if not use our own - if ( !$str = @mysql_error($this->dbh)) - $str = $ezsql_mysql_str[5]; - - $this->register_error($str.' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - } - else - { - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Format a mySQL string correctly for safe mySQL insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - return mysql_real_escape_string(stripslashes($str)); - } - - /********************************************************************** - * Return mySQL specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return 'NOW()'; - } - - /********************************************************************** - * Perform mySQL query and try to detirmin result value - */ - - function query($query) - { - - // Initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - // Perform the query via std mysql_query function.. - $this->result = @mysql_query($query,$this->dbh); - - // If there is an error then take note of it.. - if ( $str = @mysql_error($this->dbh) ) - { - $is_insert = true; - $this->register_error($str); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - return false; - } - - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @mysql_affected_rows($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = @mysql_insert_id($this->dbh); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Take note of column info - $i=0; - while ($i < @mysql_num_fields($this->result)) - { - $this->col_info[$i] = @mysql_fetch_field($this->result); - $i++; - } - - // Store Query Results - $num_rows=0; - while ( $row = @mysql_fetch_object($this->result) ) - { - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - - @mysql_free_result($this->result); - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - } - -?> +/** + * ezSQL Database specific class - mySQL + * Desc..: mySQL component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting + * @link http://twitter.com/justinvincent + * @name ezSQL_mysql + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_mysql extends ezSQLcore +{ + /* + * ezSQL error strings - mySQL + * @var array + */ + private $ezsql_mysql_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing mySQL database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'mySQL database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * Database charset + * @var string Default is utf8 + */ + private $charset = 'utf8'; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_mysql class + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $charset The database charset + * Default is empty string + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $charset='') { + if ( ! function_exists ('mysql_connect') ) { + throw new Exception('Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_mysql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + if ( ! empty($charset) ) { + $this->charset = $charset; + } + } // __construct + + /** + * Short hand way to connect to mssql database server and select a mssql + * database at the same time + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { + if ( ! $this->connect($dbuser, $dbpassword, $dbhost, true) ) ; + else if ( ! $this->select($dbname) ) ; + + return $this->connected; + } // quick_connect + + /** + * Try to connect to mySQL database server + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param type $charset The database charset + * Default is empty string + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbhost='localhost', $charset='') { + $this->connected = false; + + $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; + $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; + $this->dbhost = $dbhost!='localhost' ? $this->dbhost : $dbhost; + $this->charset = empty($charset) ? $this->charset : $charset; + + // Must have a user and a password + if ( empty($this->dbuser) ) { + $this->register_error($this->ezsql_mysql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true, 131074) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_mysql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[2], E_USER_WARNING) : null; + } else { + mysql_set_charset($this->charset, $this->dbh); + $this->connected = true; + } + + return $this->connected; + } // connect + + /** + * Try to select a mySQL database + * + * @param string $dbname The name of the database + * @return boolean + */ + public function select($dbname='') { + if ( ! $dbname ) { + // Must have a database name + $this->register_error($this->ezsql_mysql_str[3] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[3], E_USER_WARNING) : null; + } else if ( ! $this->dbh ) { + // Must have an active database connection + $this->register_error($this->ezsql_mysql_str[4] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_mysql_str[4], E_USER_WARNING) : null; + } else if ( !@mysql_select_db($dbname, $this->dbh) ) { + // Try to connect to the database + // Try to get error supplied by mysql if not use our own + if ( !$str = @mysql_error($this->dbh)) { + $str = $this->ezsql_mysql_str[5]; + } + + $this->register_error($str . ' in ' .__FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + } else { + $this->dbname = $dbname; + $this->connected = true; + } + + return $this->connected; + } // select + + /** + * Format a mySQL string correctly for safe mySQL insert + * (no matter if magic quotes are on or not) + * + * @param string $str + * @return string + */ + public function escape($str) { + return mysql_real_escape_string(stripslashes($str)); + } // escape + + /** + * Return mySQL specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return 'NOW()'; + } // sysdate + + /** + * Perform mySQL query and try to determine result value + * + * @param type $query + * @return boolean + */ + public function query($query) { + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); + $this->select($this->dbname); + } + + // Perform the query via std mysql_query function.. + $this->result = @mysql_query($query,$this->dbh); + + // If there is an error then take note of it.. + if ( $str = @mysql_error($this->dbh) ) { + $is_insert = true; + $this->register_error($str); + $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { + $this->affectedRows = @mysql_affected_rows($this->dbh); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) { + $this->insert_id = @mysql_insert_id($this->dbh); + } + + // Return number fo rows affected + $return_val = $this->affectedRows; + } else { + // Query was a select + + // Take note of column info + $i=0; + while ($i < @mysql_num_fields($this->result)) { + $this->col_info[$i] = @mysql_fetch_field($this->result); + $i++; + } + + // Store Query Results + $num_rows=0; + while ( $row = @mysql_fetch_object($this->result) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + + @mysql_free_result($this->result); + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + } // query + + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + mysql_close($this->dbh); + $this->connected = false; + } + + $this->connected = false; + } // function + + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + + /** + * Returns the current connection charset + * + * @return string + */ + public function getCharset() { + return $this->charset; + } // getCharset + + /** + * Returns the last inserted autoincrement + * + * @return int + */ + public function getInsertId() { + return mysql_insert_id(); + } // getInsertId +} // ezSQL_mysql \ No newline at end of file diff --git a/oracle8_9/demo.php b/oracle8_9/demo.php index 7df278fe..6d6e99c6 100755 --- a/oracle8_9/demo.php +++ b/oracle8_9/demo.php @@ -1,14 +1,17 @@ 'Require $dbuser, $dbpassword and $dbname to connect to a database server', - 2 => 'ezSQL auto created the following Oracle sequence' - ); - - /********************************************************************** - * ezSQL Database specific class - Oracle - */ - - if ( ! function_exists ('OCILogon') ) die('Fatal Error: ezSQL_oracle8_9 requires Oracle OCI Lib to be compiled and/or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_oracle8_9 requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_oracle8_9 extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_oracle8_9 class - */ - - function ezSQL_oracle8_9($dbuser='', $dbpassword='', $dbname='') - { - - // Turn on track errors - ini_set('track_errors',1); - - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - - } - - /********************************************************************** - * Try to connect to Oracle database server - */ - - function connect($dbuser='', $dbpassword='', $dbname='') - { - global $ezsql_oracle8_9_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser || ! $dbpassword || ! $dbname ) - { - $this->register_error($ezsql_oracle8_9_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_oracle8_9_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = OCILogon($dbuser, $dbpassword, $dbname) ) - { - $this->register_error($php_errormsg); - $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * In the case of Oracle quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='') - { - return $this->connect($dbuser='', $dbpassword='', $dbname=''); - } - - /********************************************************************** - * No real equivalent of mySQL select in Oracle - * once again, function included for the sake of consistency - */ - - function select($dbuser='', $dbpassword='', $dbname='') - { - return $this->connect($dbuser='', $dbpassword='', $dbname=''); - } - - /********************************************************************** - * Format a Oracle string correctly for safe Oracle insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - return str_replace("'","''",str_replace("''","'",stripslashes($str))); - } - - /********************************************************************** - * Return Oracle specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return "SYSDATE"; - } - - /********************************************************************** - * These special Oracle functions make sure that even if your test - * pattern is '' it will still match records that are null if - * you don't use these funcs then oracle will return no results - * if $user = ''; even if there were records that = '' - * - * SELECT * FROM USERS WHERE USER = ".$db->is_equal_str($user)." - */ - - function is_equal_str($str='') - { - return ($str==''?'IS NULL':"= '".$this->escape($str)."'"); - } - - function is_equal_int($int) - { - return ($int==''?'IS NULL':'= '.$int); - } - - /********************************************************************** - * Another oracle specific function - if you have set up a sequence - * this function returns the next ID from that sequence - */ - - function insert_id($seq_name) - { - global $ezsql_oracle8_9_str; - - $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); - - // If no return value then try to create the sequence - if ( ! $return_val ) - { - $this->query("CREATE SEQUENCE $seq_name maxValue 9999999999 INCREMENT BY 1 START WITH 1 CACHE 20 CYCLE"); - $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); - $this->register_error($ezsql_oracle8_9_str[2].": $seq_name"); - $this->show_errors ? trigger_error($ezsql_oracle8_9_str[2].": $seq_name",E_USER_NOTICE) : null; - } - - return $return_val; - } - - /********************************************************************** - * Perform Oracle query and try to determine result value - */ - - function query($query) - { - - $return_value = 0; - - // Flush cached values.. - $this->flush(); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbname); - } - - // Parses the query and returns a statement.. - if ( ! $stmt = OCIParse($this->dbh, $query)) - { - $error = OCIError($this->dbh); - $this->register_error($error["message"]); - $this->show_errors ? trigger_error($error["message"],E_USER_WARNING) : null; - return false; - } - - // Execut the query.. - elseif ( ! $this->result = OCIExecute($stmt)) - { - $error = OCIError($stmt); - $this->register_error($error["message"]); - $this->show_errors ? trigger_error($error["message"],E_USER_WARNING) : null; - return false; - } - - // If query was an insert - $is_insert = false; - if ( preg_match('/^(insert|delete|update|create) /i', $query) ) - { - $is_insert = true; - - // num afected rows - $return_value = $this->rows_affected = @OCIRowCount($stmt); - } - // If query was a select - else - { - - // Get column information - if ( $num_cols = @OCINumCols($stmt) ) - { - // Fetch the column meta data - for ( $i = 1; $i <= $num_cols; $i++ ) - { - $this->col_info[($i-1)]->name = @OCIColumnName($stmt,$i); - $this->col_info[($i-1)]->type = @OCIColumnType($stmt,$i); - $this->col_info[($i-1)]->size = @OCIColumnSize($stmt,$i); - } - } - - // If there are any results then get them - if ($this->num_rows = @OCIFetchStatement($stmt,$results)) - { - // Convert results into object orientated results.. - // Due to Oracle strange return structure - loop through columns - foreach ( $results as $col_title => $col_contents ) - { - $row_num=0; - // then - loop through rows - foreach ( $col_contents as $col_content ) - { - $this->last_result[$row_num]->{$col_title} = $col_content; - $row_num++; - } - } - } - - // num result rows - $return_value = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_value; - - } - - } - -?> \ No newline at end of file +/** + * ezSQL Database specific class - Oracle 8 and 9 + * Desc..: Oracle 8i/9i component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting + * @link http://twitter.com/justinvincent + * @name ezSQL_oracle8_9 + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_oracle8_9 extends ezSQLcore +{ + /** + * ezSQL error strings - Oracle 8 and 9 + * @var array + */ + private $ezsql_oracle8_9_str = array + ( + 1 => 'Require $dbuser, $dbpassword and $dbname to connect to a database server', + 2 => 'ezSQL auto created the following Oracle sequence' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_oracle8_9 class + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @throws Exception Requires Orcle OCI Lib and ez_sql_core.php + */ + public function __construct($dbuser='', $dbpassword='', $dbname='') { + if ( ! function_exists ('OCILogon') ) { + throw new Exception('Fatal Error: ezSQL_oracle8_9 requires Oracle OCI Lib to be compiled and/or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_oracle8_9 requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + // Turn on track errors + ini_set('track_errors',1); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + + } // __construct + + /** + * Try to connect to Oracle database server + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbname='') { + $this->connected = false; + + // Must have a user and a password + if ( ! $dbuser || ! $dbpassword || ! $dbname ) { + $this->register_error($this->ezsql_oracle8_9_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_oracle8_9_str[1], E_USER_WARNING) : null; + } + // Try to establish the server database handle + else if ( ! $this->dbh = OCILogon($dbuser, $dbpassword, $dbname) ) + { + $this->register_error($php_errormsg); + $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null; + } else { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->connected = true; + } + + return $this->connected; + } + + /** + * In the case of Oracle quick_connect is not really needed because std. + * connect already does what quick connect does - but for the sake of + * consistency it has been included + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @return boolean + */ + public function quick_connect($dbuser='', $dbpassword='', $dbname='') { + return $this->connect($dbuser, $dbpassword, $dbname); + } // quick_connect + + /** + * No real equivalent of mySQL select in Oracle, once again, function + * included for the sake of consistency + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @return boolean + */ + public function select($dbuser='', $dbpassword='', $dbname='') { + return $this->connect($dbuser, $dbpassword, $dbname); + } // select + + /** + * Format a Oracle string correctly for safe Oracle insert + * + * @param string $str + * @return string + */ + public function escape($str) { + $return_val = ''; + + if ( !isset($str) or empty($str) ) { + $return_val = ''; + } else if ( is_numeric($str) ) { + $return_val = $str; + } else { + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', // 11 + '/\x0c/', // 12 + '/[\x0e-\x1f]/' // 14-31 + ); + + foreach ( $non_displayables as $regex ) { + $str = preg_replace( $regex, '', $str ); + } + + $return_val = str_replace("'", "''", $str ); + } + + return $return_val; + } // escape + + /** + * Return Oracle specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return 'SYSDATE'; + } // sysdate + + /********************************************************************** + * These special Oracle functions make sure that even if your test + * pattern is '' it will still match records that are null if + * you don't use these funcs then oracle will return no results + * if $user = ''; even if there were records that = '' + * + * SELECT * FROM USERS WHERE USER = ".$db->is_equal_str($user)." + */ + + /** + * Returns an escaped equal string + * + * @param string $str + * @return string + */ + public function is_equal_str($str='') { + return ($str=='' ? 'IS NULL' : "= '" . $this->escape($str) . "'"); + } // is_equal_str + + /** + * Returns an equal string for integer values + * + * @param string $int + * @return string + */ + public function is_equal_int($int) { + return ($int=='' ? 'IS NULL': '= ' . $int); + } // is_equal_int + + /** + * Another oracle specific function - if you have set up a sequence this + * function returns the next ID from that sequence + * If the sequence is not defined, the sequence is created by this method. + * Though be shure, that you use the correct sequence name not to end in + * more than one sequence for a primary key of a table. + * + * @param string $seq_name Name of the sequenze + * @return string + */ + public function insert_id($seq_name) { + $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); + + // If no return value then try to create the sequence + if ( ! $return_val ) { + $this->query("CREATE SEQUENCE $seq_name maxValue 9999999999 INCREMENT BY 1 START WITH 1 CACHE 20 CYCLE"); + $return_val = $this->get_var("SELECT $seq_name.nextVal id FROM Dual"); + $this->register_error($this->ezsql_oracle8_9_str[2] . ": $seq_name"); + $this->show_errors ? trigger_error($this->ezsql_oracle8_9_str[2] . ": $seq_name", E_USER_NOTICE) : null; + } + + return $return_val; + } // insert_id + + /** + * An alias for insert_id using the original Oracle function name. + * + * @param string $seq_name Name of the sequenze + * @return string + */ + public function nextVal($seq_name) { + return $this->insert_id($seq_name); + } // nextVal + + /** + * Perform Oracle query and try to determine result value + * + * @param string $query + * @return object + */ + public function query($query) { + $return_value = 0; + + // Flush cached values.. + $this->flush(); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbname); + } + + // Parses the query and returns a statement.. + if ( ! $stmt = OCIParse($this->dbh, $query)) { + $error = OCIError($this->dbh); + $this->register_error($error['message']); + $this->show_errors ? trigger_error($error['message'], E_USER_WARNING) : null; + return false; + } elseif ( ! $this->result = OCIExecute($stmt)) { + // Execut the query.. + $error = OCIError($stmt); + $this->register_error($error['message']); + $this->show_errors ? trigger_error($error['message'], E_USER_WARNING) : null; + return false; + } + + // If query was an insert + $is_insert = false; + if ( preg_match('/^(insert|delete|update|create) /i', $query) ) { + $is_insert = true; + + // num afected rows + $this->affectedRows = @OCIRowCount($stmt); + $return_value = $this->affectedRows; + } else { + // If query was a select + // Get column information + if ( $num_cols = @OCINumCols($stmt) ) { + // Fetch the column meta data + for ( $i = 1; $i <= $num_cols; $i++ ) { + $this->col_info[($i-1)]->name = @OCIColumnName($stmt, $i); + $this->col_info[($i-1)]->type = @OCIColumnType($stmt, $i); + $this->col_info[($i-1)]->size = @OCIColumnSize($stmt, $i); + } + } + + // If there are any results then get them + if ($this->num_rows = @OCIFetchStatement($stmt, $results)) { + // Convert results into object orientated results.. + // Due to Oracle strange return structure - loop through columns + foreach ( $results as $col_title => $col_contents ) { + $row_num=0; + // Then - loop through rows + foreach ( $col_contents as $col_content ) { + $this->last_result[$row_num]->{$col_title} = $col_content; + $row_num++; + } + } + } + + // Num result rows + $return_value = $this->num_rows; + } + + // Disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null; + + return $return_value; + } // query + + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + $this->dbh = null; + $this->connected = false; + } + } // disconnect + + /** + * Returns the current database name + * + * @return string + */ + public function getDBName() { + return $this->dbname; + } // getDBName + +} // ezSQL_oracle8_9 \ No newline at end of file diff --git a/pdo/demo.php b/pdo/demo.php index 46e99ee0..f7bbc8ec 100755 --- a/pdo/demo.php +++ b/pdo/demo.php @@ -1,4 +1,11 @@ 'Require $dsn and $user and $password to create a connection' - ); - - /********************************************************************** - * ezSQL Database specific class - SQLite - */ - - if ( ! class_exists ('PDO') ) die('Fatal Error: ezSQL_sqlite requires PDO Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_sqlite requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_pdo extends ezSQLcore - { - - var $dsn; - var $user; - var $password; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_sqlite class - */ - - function ezSQL_pdo($dsn='', $user='', $password='') - { - // Turn on track errors - ini_set('track_errors',1); - - if ( $dsn && $user && $password ) - { - $this->connect($dsn, $user, $password); - } - } - - /********************************************************************** - * Try to connect to SQLite database server - */ - - function connect($dsn='', $user='', $password='') - { - global $ezsql_pdo_str; $return_val = false; - - // Must have a user and a password - if ( ! $dsn || ! $user || ! $password ) - { - $this->register_error($ezsql_pdo_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_pdo_str[1],E_USER_WARNING) : null; - } - - // Establish PDO connection - try - { - $this->dbh = new PDO($dsn, $user, $password); - $return_val = true; - } - catch (PDOException $e) - { - $this->register_error($e->getMessage()); - $this->show_errors ? trigger_error($e->getMessage(),E_USER_WARNING) : null; - } - - return $return_val; - } - - /********************************************************************** - * In the case of SQLite quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dsn='', $user='', $password='') - { - return $this->connect($dsn, $user, $password); - } - - /********************************************************************** - * No real equivalent of mySQL select in SQLite - * once again, function included for the sake of consistency - */ - - function select($dsn='', $user='', $password='') - { - return $this->connect($dsn, $user, $password); - } - - /********************************************************************** - * Format a SQLite string correctly for safe SQLite insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - switch (gettype($str)) - { - case 'string' : $str = addslashes(stripslashes($str)); - break; - case 'boolean' : $str = ($str === FALSE) ? 0 : 1; - break; - default : $str = ($str === NULL) ? 'NULL' : $str; - break; - } - - return $str; - } - - /********************************************************************** - * Return SQLite specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return "datetime('now')"; - } - - /********************************************************************** - * Hooks into PDO error system and reports it to user - */ - - function catch_error() - { - $error_str = 'No error info'; - - $err_array = $this->dbh->errorInfo(); - - // Note: Ignoring error - bind or column index out of range - if ( isset($err_array[1]) && $err_array[1] != 25) - { - - $error_str = ''; - foreach ( $err_array as $entry ) - { - $error_str .= $entry . ', '; - } - - $error_str = substr($error_str,0,-2); - - $this->register_error($error_str); - $this->show_errors ? trigger_error($error_str.' '.$this->last_query,E_USER_WARNING) : null; - - return true; - } - - } - - // ================================================================== - // Basic Query - see docs for more detail - - function query($query) - { - - // For reg expressions - $query = str_replace("/[\n\r]/",'',trim($query)); - - // initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - $this->num_queries++; - - // Start timer - $this->timer_start($this->num_queries); - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dsn, $this->user, $this->password); - } - - // Query was an insert, delete, update, replace - if ( preg_match("/^(insert|delete|update|replace|drop|create)\s+/i",$query) ) - { - - // Perform the query and log number of affected rows - $this->rows_affected = $this->dbh->exec($query); - - // If there is an error then take note of it.. - if ( $this->catch_error() ) return false; - - $is_insert = true; - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = @$this->dbh->lastInsertId(); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - - } - // Query was an select - else - { - - // Perform the query and log number of affected rows - $sth = $this->dbh->query($query); - - // If there is an error then take note of it.. - if ( $this->catch_error() ) return false; - - $is_insert = false; - - $col_count = $sth->columnCount(); - - for ( $i=0 ; $i < $col_count ; $i++ ) - { - if ( $meta = $sth->getColumnMeta($i) ) - { - $this->col_info[$i]->name = $meta['name']; - $this->col_info[$i]->type = $meta['native_type']; - $this->col_info[$i]->max_length = ''; - } - else - { - $this->col_info[$i]->name = 'undefined'; - $this->col_info[$i]->type = 'undefined'; - $this->col_info[$i]->max_length = ''; - } - } - - // Store Query Results - $num_rows=0; - while ( $row = @$sth->fetch(PDO::FETCH_ASSOC) ) - { - // Store relults as an objects within main array - $this->last_result[$num_rows] = (object) $row; - $num_rows++; - } - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - // Keep tack of how long all queries have taken - $this->timer_update_global($this->num_queries); - - // Trace all queries - if ( $this->use_trace_log ) - { - $this->trace_log[] = $this->debug(false); - } - - return $return_val; - - } - - } - -?> \ No newline at end of file +/** + * ezSQL class - PDO + * Desc..: PDO component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting + * @link http://twitter.com/justinvincent + * @name ezSQL_pdo + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_pdo extends ezSQLcore +{ + /** + * ezSQL error strings - PDO + * @var array + */ + private $ezsql_pdo_str = array + ( + 1 => 'Require $dsn and $user and $password to create a connection', + 2 => 'File based databases require $dsn to create a connection' + ); + + /** + * The connection parameter string + * @var string + */ + private $dsn; + + /** + * The database user name + * @var string + */ + private $dbuser; + + /** + * The database password + * @var string + */ + private $dbpassword; + + /** + * The array for connection options, MySQL connection charset, for example + * @var array + */ + private $options; + + /** + * Whether it is a file based datbase connection, for example to a SQLite + * database file, or not + * @var boolean Default is false + */ + private $isFileBased=false; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_sqlite class + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $user The database user name + * Default is empty string + * @param string $password The database password + * Default is empty string + * @param array $options Array for setting connection options as MySQL + * charset for example + * Default is an empty array + * @param boolean $isFileBased File based databases like SQLite don't need + * user and password, they work with path in the + * dsn parameter + * Default is false + */ + public function __construct($dsn='', $user='', $password='', $options=array(), $isFileBased=false) { + if ( ! class_exists ('PDO') ) { + throw new Exception('Fatal Error: ezSQL_pdo requires PDO Lib to be compiled and or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_pdo requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + // Turn on track errors + ini_set('track_errors', 1); + + if ( !empty($dsn) && !empty($user) && !empty($password) ) { + print "

constructor: $dsn

"; + $this->connect($dsn, $user, $password, $options, $isFileBased); + } + } // __construct + + /** + * Try to connect to the database server in the DSN parameters + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database password + * Default is empty string + * @param array $options Array for setting connection options as MySQL + * charset for example + * Default is an empty array + * @param boolean $isFileBased File based databases like SQLite don't need + * user and password, they work with path in the + * dsn parameter + * Default is false + * @return boolean + */ + public function connect($dsn='', $dbuser='', $dbpassword='', $options=array(), $isFileBased=false) { + $this->connected = false; + + $this->dsn = empty($dsn) ? $this->dsn : $dsn; + $this->isFileBased = $isFileBased; + + if (!$isFileBased) { + $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; + $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; + $this->options = $options; + + // Must have a user and a password if not file based + if ( empty($this->dsn) || empty($this->dbuser) || empty($this->dbpassword) ) { + $this->register_error($this->ezsql_pdo_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_pdo_str[1], E_USER_WARNING) : null; + } + } elseif (empty($this->dsn)) { + // Must have a dsn + $this->register_error($this->ezsql_pdo_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_pdo_str[2], E_USER_WARNING) : null; + + } + + + // Establish PDO connection + try { + if ($this->isFileBased) { + $this->dbh = new PDO($this->dsn); + $this->connected = true; + } else { + $this->dbh = new PDO($this->dsn, $this->dbuser, $this->dbpassword, $this->options); + $this->connected = true; + } + } + catch (PDOException $e) { + $this->register_error($e->getMessage()); + $this->show_errors ? trigger_error($e->getMessage() . '- $dsn: ' . $dsn, E_USER_WARNING) : null; + } + + $this->isConnected = $this->connected; + + return $this->connected; + } // connect + + /** + * With PDO it is only an alias for the connect method + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $user The database user name + * Default is empty string + * @param string $password The database password + * Default is empty string + * @param array $options Array for setting connection options as MySQL + * charset for example + * Default is an empty array + * @param boolean $isFileBased File based databases like SQLite don't need + * user and password, they work with path in the + * dsn parameter + * Default is false + * @return boolean + */ + public function quick_connect($dsn='', $user='', $password='', $options=array(), $isFileBased=false) { + return $this->connect($dsn, $user, $password, $options, $isFileBased); + } // quick_connect + + /********************************************************************** + * No real equivalent of mySQL select in SQLite + * once again, function included for the sake of consistency + */ + + /** + * With PDO it is only an alias for the connect method + * + * @param string $dsn The connection parameter string + * Default is empty string + * @param string $user The database user name + * Default is empty string + * @param string $password The database password + * Default is empty string + * @param array $options Array for setting connection options as MySQL + * charset for example + * Default is an empty array + * @param boolean $isFileBased File based databases like SQLite don't need + * user and password, they work with path in the + * dsn parameter + * Default is false + * @return boolean + */ + public function select($dsn='', $user='', $password='', $options=array(), $isFileBased=false) { + return $this->connect($dsn, $user, $password, $options, $isFileBased); + } // select + + /********************************************************************** + * Format a SQLite string correctly for safe SQLite insert + * (no mater if magic quotes are on or not) + */ + + /** + * Escape a string with the PDO method + * + * @param string $str + * @return string + */ + public function escape($str) { + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dsn, $this->user, $this->password, $this->options, $this->isFileBased); + } + + // pdo quote adds ' at the beginning and at the end, remove them for standard behavior + $return_val = substr($this->dbh->quote($str), 1, -1); + + return $return_val; + } // escape + + /** + * Return SQLite specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return "datetime('now')"; + } // sysdate + + /** + * Hooks into PDO error system and reports it to user + * + * @return string + */ + public function catch_error(){ + $error_str = 'No error info'; + + $err_array = $this->dbh->errorInfo(); + + // Note: Ignoring error - bind or column index out of range + if ( isset($err_array[1]) && $err_array[1] != 25) { + + $error_str = ''; + foreach ( $err_array as $entry ) { + $error_str .= $entry . ', '; + } + + $error_str = substr($error_str, 0, -2); + + $this->register_error($error_str); + $this->show_errors ? trigger_error($error_str . ' ' . $this->last_query, E_USER_WARNING) : null; + + return true; + } + + } // catch_error + + /** + * Basic Query - see docs for more detail + * + * @param type $query + * @return object + */ + public function query($query) { + // For reg expressions + $query = str_replace("/[\n\r]/", '', trim($query)); + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + $this->num_queries++; + + // Start timer + $this->timer_start($this->num_queries); + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } + + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dsn, $this->user, $this->password, $this->options, $this->isFileBased); + } + + // Query was an insert, delete, update, replace + if ( preg_match("/^(insert|delete|update|replace|drop|create)\s+/i", $query) ) { + + // Perform the query and log number of affected rows + $this->affectedRows = $this->dbh->exec($query); + + // If there is an error then take note of it.. + if ( $this->catch_error() ) { + return false; + } + + $is_insert = true; + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) { + $this->insert_id = @$this->dbh->lastInsertId(); + } + + // Return number fo rows affected + $return_val = $this->affectedRows; + + } else { + // Query was an select + + // Perform the query and log number of affected rows + $sth = $this->dbh->query($query); + + // If there is an error then take note of it.. + if ( $this->catch_error() ) return false; + + $is_insert = false; + + $col_count = $sth->columnCount(); + + for ( $i=0 ; $i < $col_count ; $i++ ) { + if ( $meta = $sth->getColumnMeta($i) ) { + $this->col_info[$i]->name = $meta['name']; + $this->col_info[$i]->type = $meta['native_type']; + $this->col_info[$i]->max_length = ''; + } else { + $this->col_info[$i]->name = 'undefined'; + $this->col_info[$i]->type = 'undefined'; + $this->col_info[$i]->max_length = ''; + } + } + + // Store Query Results + $num_rows=0; + while ( $row = @$sth->fetch(PDO::FETCH_ASSOC) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = (object) $row; + $num_rows++; + } + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + // Keep tack of how long all queries have taken + $this->timer_update_global($this->num_queries); + + // Trace all queries + if ( $this->use_trace_log ) { + $this->trace_log[] = $this->debug(false); + } + + return $return_val; + + } // query + + /** + * Close the database connection + */ + public function disconnect(){ + if ($this->dbh) { + $this->dbh = null; + $this->connected = false; + } + } // disconnect + + /** + * Creates a SET nvp sql string from an associative array (and escapes all values) + * + * $db_data = array('login'=>'jv','email'=>'jv@vip.ie', 'user_id' => 1, 'created' => 'NOW()'); + * + * $db->query("INSERT INTO users SET ".$db->get_set($db_data)); + * + * ...OR... + * + * $db->query("UPDATE users SET ".$db->get_set($db_data)." WHERE user_id = 1"); + * + * Output: + * + * login = 'jv', email = 'jv@vip.ie', user_id = 1, created = NOW() + * + * @param array $params + * @return string + */ + public function get_set($params) { + $sql = ''; + + foreach ( $params as $field => $val ) { + if ( $val === 'true' ) { + $val = 1; + } elseif ( $val === 'false' ) { + $val = 0; + } elseif ( $val == 'NOW()' ) { + $sql .= "$field = " . $this->escape($val) . ', '; + } else { + $sql .= "$field = '".$this->escape($val).'\', '; + } + } + + return substr($sql, 0, -2); + } // get_set + +} // ezSQL_pdo diff --git a/postgresql/demo.php b/postgresql/demo.php index bf5aba61..ac5e1ba4 100755 --- a/postgresql/demo.php +++ b/postgresql/demo.php @@ -1,4 +1,7 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing PostgreSQL database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'mySQL database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - mySQL - */ - - if ( ! function_exists ('pg_connect') ) die('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_postgresql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_postgresql extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_postgresql class - */ - - function ezSQL_postgresql($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - } - - /********************************************************************** - * In the case of PostgreSQL quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to mySQL database server - */ - - function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - global $ezsql_postgresql_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_postgresql_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_postgresql_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = @pg_connect("host=$dbhost user=$dbuser password=$dbpassword dbname=$dbname",true) ) //should be modified for port - { - $this->register_error($ezsql_postgresql_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_postgresql_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * No real equivalent of mySQL select in PostgreSQL - * once again, function included for the sake of consistency - */ - - function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Format a mySQL string correctly for safe mySQL insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - return pg_escape_string(stripslashes($str)); - } - - /********************************************************************** - * Return PostgreSQL specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return 'NOW()'; - } - - /********************************************************************** - * Return PostgreSQL specific values - */ - - function showTables() - { - return "table_name FROM information_schema.tables WHERE table_schema = 'public' and table_type='BASE TABLE'"; - } - - function descTable($tbl_name) - { - return "ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' ORDER BY ordinal_position"; - } - - function showDatabases() - { - return "datname from pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1"; - } - - /********************************************************************** - * Perform PostgreSQL query and try to detirmin result value - */ - - function query($query) - { - - // Initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbname); - } - - // Perform the query via std postgresql_query function.. - $this->result = @pg_query($this->dbh, $query); - - - // If there is an error then take note of it.. - if ( $str = @pg_last_error($this->dbh) ) - { - $is_insert = true; - $this->register_error($str); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - return false; - } - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @pg_affected_rows($this->result); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - //$this->insert_id = @postgresql_insert_id($this->dbh); - //$this->insert_id = pg_last_oid($this->result); - - // Thx. Rafael Bernal - $insert_query = pg_query("SELECT lastval();"); - $insert_row = pg_fetch_row($insert_query); - $this->insert_id = $insert_row[0]; - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { $num_rows=0; - //if ( $this->result ) //may be needed but my tests did not - //{ - - // ======================================================= - // Take note of column info - - $i=0; - while ($i < @pg_num_fields($this->result)) - { - $this->col_info[$i]->name = pg_field_name($this->result,$i); - $this->col_info[$i]->type = pg_field_type($this->result,$i); - $this->col_info[$i]->size = pg_field_size($this->result,$i); - $i++; - } - - // ======================================================= - // Store Query Results - - //while ( $row = @pg_fetch_object($this->result, $i, PGSQL_ASSOC) ) doesn't work? donno - //while ( $row = @pg_fetch_object($this->result,$num_rows) ) does work - while ( $row = @pg_fetch_object($this->result) ) - { - // Store results as an objects within main array - $this->last_result[$num_rows] = $row ; - $num_rows++; - } - - @pg_free_result($this->result); - //} - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - } - -?> +/** + * ezSQL Database specific class - PostgreSQL + * Desc..: PostgreSQL component (part of ezSQL databse abstraction library) + * + * @author Justin Vincent (jv@jvmultimedia.com) + * @author Stefanie Janine Stoelting + * @link http://twitter.com/justinvincent + * @name ezSQL_postgresql + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_postgresql extends ezSQLcore +{ + /* + * ezSQL error strings - mySQL + * @var array + */ + private $ezsql_postgresql_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing PostgreSQL database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'mySQL database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * TCP/IP port of PostgreSQL + * @var string Default is PostgreSQL default port 5432 + */ + private $dbport = '5432'; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + + /** + * Constructor - allow the user to perform a qucik connect at the same time + * as initialising the ezSQL_postgresql class + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $dbport The database TCP/IP port + * Default is PostgreSQL default port 5432 + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { + if ( ! function_exists ('pg_connect') ) { + throw new Exception('Fatal Error: ezSQL_postgresql requires PostgreSQL Lib to be compiled and or linked in to the PHP engine'); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_postgresql requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + parent::__construct(); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + $this->dbport = $dbport; + } // __construct + + /** + * In the case of PostgreSQL quick_connect is not really needed because std. + * connect already does what quick connect does - but for the sake of + * consistency it has been included + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $dbport The database TCP/IP port + * Default is PostgreSQL default port 5432 + * @return boolean + */ + function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { + if ( ! $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $dbport, true) ) ; + else if ( ! $this->select($dbname) ); + + return $this->connected; + } // quick_connect + + /********************************************************************** + * Try to connect to mySQL database server + */ + + /** + * Try to connect to PostgreSQL database server + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $dbport The database TCP/IP port + * Default is PostgreSQL default port 5432 + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { + $this->connected = false; + + $this->dbuser = empty($dbuser) ? $this->dbuser : $dbuser; + $this->dbpassword = empty($dbpassword) ? $this->dbpassword : $dbpassword; + $this->dbname = empty($dbname) ? $this->dbname : $dbname; + $this->dbhost = $dbhost!='localhost' ? $this->dbhost : $dbhost; + $this->dbport = $dbport!='5432' ? $dbport : $this->dbport; + + if ( !$this->dbuser ) { + // Must have a user and a password + $this->register_error($this->ezsql_postgresql_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_postgresql_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = pg_connect("host=$this->dbhost port=$this->dbport dbname=$this->dbname user=$this->dbuser password=$this->dbpassword", true) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_postgresql_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_postgresql_str[2], E_USER_WARNING) : null; + } else { + $this->connected = true; + } + + return $this->connected; + } // connect + + /** + * No real equivalent of mySQL select in PostgreSQL once again, function + * included for the sake of consistency + * + * @param string $dbuser The database user name + * @param string $dbpassword The database users password + * @param string $dbname The name of the database + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param string $dbport The database TCP/IP port + * Default is PostgreSQL default port 5432 + * @return boolean + */ + public function select($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $dbport='5432') { + $this->disconnect(); + + $this->connect($dbuser, $dbpassword, $dbname, $dbhost, $dbport); + + return $this->connected; + } // select + + /** + * Format a mySQL string correctly for safe mySQL insert + * (no matter if magic quotes are on or not) + * + * @param string $str + * @return string + */ + public function escape($str) { + return pg_escape_string(stripslashes($str)); + } // escape + + /** + * Return PostgreSQL specific system date syntax + * i.e. Oracle: SYSDATE Mysql: NOW() + * + * @return string + */ + public function sysdate() { + return 'NOW()'; + } // sysdate + + /** + * Return PostgreSQL specific values: Return all tables of the current + * schema + * + * @return string + */ + public function showTables() { + return "SELECT table_name FROM information_schema.tables WHERE table_schema = '$this->dbname' AND table_type='BASE TABLE'"; + } // showTables + + /** + * Return the description of the given table + * + * @param string $tbl_name The table name + * @return string + */ + public function descTable($tbl_name) { + return "SELECT ordinal_position, column_name, data_type, column_default, is_nullable, character_maximum_length, numeric_precision FROM information_schema.columns WHERE table_name = '$tbl_name' AND table_schema='$this->dbname' ORDER BY ordinal_position"; + } // descTable + + /** + * Return all databases of the current server + * + * @return string + */ + public function showDatabases() { + return "SELECT datname FROM pg_database WHERE datname NOT IN ('template0', 'template1') ORDER BY 1"; + } // showDatabases + + /** + * Perform PostgreSQL query and try to detirmin result value + * + * @param string $query + * @return boolean + */ + public function query($query) { + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbname, $this->dbhost, $this->dbport); + } + + // Perform the query via std postgresql_query function.. + $this->result = @pg_query($this->dbh, $query); + + + // If there is an error then take note of it.. + if ( $str = @pg_last_error($this->dbh) ) { + $is_insert = true; + $this->register_error($str); + $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { + $this->affectedRows = @pg_affected_rows($this->result); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i", $query) ) { + //$this->insert_id = @postgresql_insert_id($this->dbh); + //$this->insert_id = pg_last_oid($this->result); + + // Thx. Rafael Bernal + $insert_query = pg_query("SELECT lastval();"); + $insert_row = pg_fetch_row($insert_query); + $this->insert_id = $insert_row[0]; + } + + // Return number fo rows affected + $return_val = $this->affectedRows; + } else { + // Query was a select + $num_rows=0; + //if ( $this->result ) //may be needed but my tests did not + //{ + + // ======================================================= + // Take note of column info + + $i=0; + while ($i < @pg_num_fields($this->result)) { + $this->col_info[$i]->name = pg_field_name($this->result,$i); + $this->col_info[$i]->type = pg_field_type($this->result,$i); + $this->col_info[$i]->size = pg_field_size($this->result,$i); + $i++; + } + + // ======================================================= + // Store Query Results + + //while ( $row = @pg_fetch_object($this->result, $i, PGSQL_ASSOC) ) doesn't work? donno + //while ( $row = @pg_fetch_object($this->result,$num_rows) ) does work + while ( $row = @pg_fetch_object($this->result) ) { + // Store results as an objects within main array + $this->last_result[$num_rows] = $row ; + $num_rows++; + } + + @pg_free_result($this->result); + //} + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + + } + + // Disk caching of queries + $this->store_cache($query,$is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + } // query + + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + pg_close($this->dbh); + $this->connected = false; + } + } // disconnect + + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + + /** + * Returns the current TCP/IP port + * + * @return string + */ + public function getPort() { + return $this->dbport; + } // getPort + +} // ezSQL_postgresql \ No newline at end of file diff --git a/readme.txt b/readme.txt index 0effac3f..7822da99 100755 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,6 @@ ======================================================================= Author: Justin Vincent - http://justinvincent.com/ezsql +Author: Stefanie Janine Stoelting - http://stefanie-stoelting.de Name: ezSQL Desc: Class to make it very easy to deal with database connections. License: FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) @@ -15,6 +16,18 @@ http://techzinglive.com Change Log: +3.03 - Changed error messages, wrong classname used in a messages + +3.02 - Improved ezSQL_recordset, array results of rows are faster + +3.01 - Added a class for query result handling. The ezSQL_recordset contains methods that behave like fetch_assoc, fetch_row, and fetch_object + +3.00 - Changed the code to PHP5, added PHPDoc tags, and added unit tests + +2.17 - Updates to ezSQL_postgresql (thx Stefanie Janine Stoelting) + +2.16 - Added profiling functions to mySQL version & added fix to stop mySQL hanging on very long runnign scripts + 2.15 - Fixed long standing bug with $db->rows_affected (thx Pere Pasqual) 2.14 - Added sybase connector by Muhammad Iyas diff --git a/shared/ez_sql_core.php b/shared/ez_sql_core.php index 0675ec67..f271fb7a 100755 --- a/shared/ez_sql_core.php +++ b/shared/ez_sql_core.php @@ -1,589 +1,721 @@ last_error = $err_str; - - // Capture all errors to an error array no matter what happens - $this->captured_errors[] = array - ( - 'error_str' => $err_str, - 'query' => $this->last_query - ); - } - - /********************************************************************** - * Turn error handling on or off.. - */ - - function show_errors() - { - $this->show_errors = true; - } - - function hide_errors() - { - $this->show_errors = false; - } - - /********************************************************************** - * Kill cached query results - */ - - function flush() - { - // Get rid of these - $this->last_result = null; - $this->col_info = null; - $this->last_query = null; - $this->from_disk_cache = false; - } - - /********************************************************************** - * Get one variable from the DB - see docs for more detail - */ - - function get_var($query=null,$x=0,$y=0) - { - - // Log how the function was called - $this->func_call = "\$db->get_var(\"$query\",$x,$y)"; - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // Extract var out of cached results based x,y vals - if ( $this->last_result[$y] ) - { - $values = array_values(get_object_vars($this->last_result[$y])); - } - - // If there is a value return it else return null - return (isset($values[$x]) && $values[$x]!=='')?$values[$x]:null; - } - - /********************************************************************** - * Get one row from the DB - see docs for more detail - */ - - function get_row($query=null,$output=OBJECT,$y=0) - { - - // Log how the function was called - $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // If the output is an object then return object using the row offset.. - if ( $output == OBJECT ) - { - return $this->last_result[$y]?$this->last_result[$y]:null; - } - // If the output is an associative array then return row as such.. - elseif ( $output == ARRAY_A ) - { - return $this->last_result[$y]?get_object_vars($this->last_result[$y]):null; - } - // If the output is an numerical array then return row as such.. - elseif ( $output == ARRAY_N ) - { - return $this->last_result[$y]?array_values(get_object_vars($this->last_result[$y])):null; - } - // If invalid output type was specified.. - else - { - $this->print_error(" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"); - } - - } - - /********************************************************************** - * Function to get 1 column from the cached result set based in X index - * see docs for usage and info - */ - - function get_col($query=null,$x=0) - { - - $new_array = array(); - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // Extract the column values - for ( $i=0; $i < count($this->last_result); $i++ ) - { - $new_array[$i] = $this->get_var(null,$x,$i); - } - - return $new_array; - } - - - /********************************************************************** - * Return the the query as a result set - see docs for more details - */ - - function get_results($query=null, $output = OBJECT) - { - - // Log how the function was called - $this->func_call = "\$db->get_results(\"$query\", $output)"; - - // If there is a query then perform it if not then use cached results.. - if ( $query ) - { - $this->query($query); - } - - // Send back array of objects. Each row is an object - if ( $output == OBJECT ) - { - return $this->last_result; - } - elseif ( $output == ARRAY_A || $output == ARRAY_N ) - { - if ( $this->last_result ) - { - $i=0; - foreach( $this->last_result as $row ) - { - - $new_array[$i] = get_object_vars($row); - - if ( $output == ARRAY_N ) - { - $new_array[$i] = array_values($new_array[$i]); - } - - $i++; - } - - return $new_array; - } - else - { - return null; - } - } - } - - - /********************************************************************** - * Function to get column meta data info pertaining to the last query - * see docs for more info and usage - */ - - function get_col_info($info_type="name",$col_offset=-1) - { - - if ( $this->col_info ) - { - if ( $col_offset == -1 ) - { - $i=0; - foreach($this->col_info as $col ) - { - $new_array[$i] = $col->{$info_type}; - $i++; - } - return $new_array; - } - else - { - return $this->col_info[$col_offset]->{$info_type}; - } - - } - - } - - /********************************************************************** - * store_cache - */ - - function store_cache($query,$is_insert) - { - - // The would be cache file for this query - $cache_file = $this->cache_dir.'/'.md5($query); - - // disk caching of queries - if ( $this->use_disk_cache && ( $this->cache_queries && ! $is_insert ) || ( $this->cache_inserts && $is_insert )) - { - if ( ! is_dir($this->cache_dir) ) - { - $this->register_error("Could not open cache dir: $this->cache_dir"); - $this->show_errors ? trigger_error("Could not open cache dir: $this->cache_dir",E_USER_WARNING) : null; - } - else - { - // Cache all result values - $result_cache = array - ( - 'col_info' => $this->col_info, - 'last_result' => $this->last_result, - 'num_rows' => $this->num_rows, - 'return_value' => $this->num_rows, - ); - error_log ( serialize($result_cache), 3, $cache_file); - } - } - - } - - /********************************************************************** - * get_cache - */ - - function get_cache($query) - { - - // The would be cache file for this query - $cache_file = $this->cache_dir.'/'.md5($query); - - // Try to get previously cached version - if ( $this->use_disk_cache && file_exists($cache_file) ) - { - // Only use this cache file if less than 'cache_timeout' (hours) - if ( (time() - filemtime($cache_file)) > ($this->cache_timeout*3600) ) - { - unlink($cache_file); - } - else - { - $result_cache = unserialize(file_get_contents($cache_file)); - - $this->col_info = $result_cache['col_info']; - $this->last_result = $result_cache['last_result']; - $this->num_rows = $result_cache['num_rows']; - - $this->from_disk_cache = true; - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $result_cache['return_value']; - } - } - - } - - /********************************************************************** - * Dumps the contents of any input variable to screen in a nicely - * formatted and easy to understand way - any type: Object, Var or Array - */ - - function vardump($mixed='') - { - - // Start outup buffering - ob_start(); - - echo "

"; - echo "
";
-
-			if ( ! $this->vardump_called )
-			{
-				echo "ezSQL (v".EZSQL_VERSION.") Variable Dump..\n\n";
-			}
-
-			$var_type = gettype ($mixed);
-			print_r(($mixed?$mixed:"No Value / False"));
-			echo "\n\nType: " . ucfirst($var_type) . "\n";
-			echo "Last Query [$this->num_queries]: ".($this->last_query?$this->last_query:"NULL")."\n";
-			echo "Last Function Call: " . ($this->func_call?$this->func_call:"None")."\n";
-			echo "Last Rows Returned: ".count($this->last_result)."\n";
-			echo "
".$this->donation(); - echo "\n


"; - - // Stop output buffering and capture debug HTML - $html = ob_get_contents(); - ob_end_clean(); - - // Only echo output if it is turned on - if ( $this->debug_echo_is_on ) - { - echo $html; - } - - $this->vardump_called = true; - - return $html; - - } - - /********************************************************************** - * Alias for the above function - */ - - function dumpvar($mixed) - { - $this->vardump($mixed); - } - - /********************************************************************** - * Displays the last query string that was sent to the database & a - * table listing results (if there were any). - * (abstracted into a seperate file to save server overhead). - */ - - function debug($print_to_screen=true) - { - - // Start outup buffering - ob_start(); - - echo "
"; - - // Only show ezSQL credits once.. - if ( ! $this->debug_called ) - { - echo "ezSQL (v".EZSQL_VERSION.") Debug..

\n"; - } - - if ( $this->last_error ) - { - echo "Last Error -- [$this->last_error]

"; - } - - if ( $this->from_disk_cache ) - { - echo "Results retrieved from disk cache

"; - } - - echo "Query [$this->num_queries] -- "; - echo "[$this->last_query]

"; - - echo "Query Result.."; - echo "

"; - - if ( $this->col_info ) - { - - // ===================================================== - // Results top rows - - echo ""; - echo ""; - - - for ( $i=0; $i < count($this->col_info); $i++ ) - { - echo ""; - } - - echo ""; - - // ====================================================== - // print main results - - if ( $this->last_result ) - { - - $i=0; - foreach ( $this->get_results(null,ARRAY_N) as $one_row ) - { - $i++; - echo ""; - - foreach ( $one_row as $item ) - { - echo ""; - } - - echo ""; - } - - } // if last result - else - { - echo ""; - } - - echo "
(row){$this->col_info[$i]->type} {$this->col_info[$i]->max_length}
{$this->col_info[$i]->name}
$i$item
No Results
"; - - } // if col_info - else - { - echo "No Results"; - } - - echo "
".$this->donation()."
"; - - // Stop output buffering and capture debug HTML - $html = ob_get_contents(); - ob_end_clean(); - - // Only echo output if it is turned on - if ( $this->debug_echo_is_on && $print_to_screen) - { - echo $html; - } - - $this->debug_called = true; - - return $html; - - } - - /********************************************************************** - * Naughty little function to ask for some remuniration! - */ - - function donation() - { - return "If ezSQL has helped make a donation!?   "; - } - - /********************************************************************** - * Timer related functions - */ - - function timer_get_cur() - { - list($usec, $sec) = explode(" ",microtime()); - return ((float)$usec + (float)$sec); - } - - function timer_start($timer_name) - { - $this->timers[$timer_name] = $this->timer_get_cur(); - } - - function timer_elapsed($timer_name) - { - return round($this->timer_get_cur() - $this->timers[$timer_name],2); - } - - function timer_update_global($timer_name) - { - if ( $this->do_profile ) - { - $this->profile_times[] = array - ( - 'query' => $this->last_query, - 'time' => $this->timer_elapsed($timer_name) - ); - } - - $this->total_query_time += $this->timer_elapsed($timer_name); - } - - /********************************************************************** - * Creates a SET nvp sql string from an associative array (and escapes all values) - * - * Usage: - * - * $db_data = array('login'=>'jv','email'=>'jv@vip.ie', 'user_id' => 1, 'created' => 'NOW()'); - * - * $db->query("INSERT INTO users SET ".$db->get_set($db_data)); - * - * ...OR... - * - * $db->query("UPDATE users SET ".$db->get_set($db_data)." WHERE user_id = 1"); - * - * Output: - * - * login = 'jv', email = 'jv@vip.ie', user_id = 1, created = NOW() - */ - - function get_set($parms) - { - $sql = ''; - foreach ( $parms as $field => $val ) - { - if ( $val === 'true' ) $val = 1; - if ( $val === 'false' ) $val = 0; - - if ( $val == 'NOW()' ) - { - $sql .= "$field = ".$this->escape($val).", "; - } - else - { - $sql .= "$field = '".$this->escape($val)."', "; - } - } - - return substr($sql,0,-2); - } - - } +/** + * ezSQL Core module - database abstraction library to make it very easy + * to deal with databases. ezSQLcore can not be used by itself + * (it is designed for use by database specific modules). + * + * @author Justin Vincent (jv@vip.ie) + * @author Stefanie Janine Stoelting + * @link http://justinvincent.com + * @name ezSQL + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + */ +class ezSQLcore +{ + /** + * Constant string ezSQL version information + */ + const EZSQL_VERSION = '3.02'; + + /** + * Constant boolean Object + */ + const OBJECT = true; + + /** + * Constant boolean + */ + const ARRAY_A = true; + + /** + * Constant boolean + */ + const ARRAY_N = true; + + /** + * same as $debug_all + * @var boolean Default is false + */ + public $trace = false; + + /** + * same as $trace + * @var boolean Default is false + */ + public $debug_all = false; + + /** + * Debug is called + * @public boolean Default is false + */ + public $debug_called = false; + + /** + * Vardump called + * @var boolean Default is false + */ + public $vardump_called = false; + + /** + * Show errors + * @public boolean Default is false + */ + private $show_errors = true; + + /** + * Number of queries + * @var int Default is 0 + */ + public $num_queries = 0; + + /** + * The last query object + * @var object Default is null + */ + public $last_query = null; + + /** + * The last error object + * @var object Default is null + */ + public $last_error = null; + + /** + * The last column info + * @var object Default is null + */ + public $col_info = null; + + /** + * Captured errors + * @var array Default is empty array + */ + public $captured_errors = array(); + + /** + * Using the cache directory + * @var boolean Default is false + */ + public $cache_dir = false; + + /** + * Caching queries + * @var boolean Default is false + */ + public $cache_queries = false; + + /** + * Insert queries into the cache + * @var boolean Default is false + */ + public $cache_inserts = false; + + /** + * Using disk cache + * @var boolean Default is false + */ + public $use_disk_cache = false; + + /** + * The cache timeout in hours + * @var integer Default is 24 + */ + public $cache_timeout = 24; + + /** + * Timers + * @var array Default is empty array + */ + public $timers = array(); + + /** + * The total query time + * @var int Default is 0 + */ + public $total_query_time = 0; + + /** + * The time it took to establish a connection + * @var int Default is 0 + */ + public $db_connect_time = 0; + + /** + * The trace log + * @var array Default is empty array + */ + public $trace_log = array(); + + /** + * Use the trace log + * @var boolean Default is false + */ + public $use_trace_log = false; + + /** + * Use a SQL log file + * @var boolean Default is false + */ + public $sql_log_file = false; + + /** + * Using profiling + * @var boolean Default is false + */ + public $do_profile = false; + + /** + * Array for storing profiling times + * @var array Default is empty array + */ + public $profile_times = array(); + + /** + * The database connection object + * @var object Default is null + */ + public $dbh = null; + + /** + * Whether the database connection is established, or not + * @var boolean Default is false + */ + protected $connected = false; + + /** + * Contains the number of affected rows of a query + * @var int Default is 0 + */ + protected $affectedRows = 0; + + /** + * == TJH == default now needed for echo of debug function + * The default for returning errors, turn it of, if you are not + * interested in seeing your database errors + * @var boolean Default is true + */ + public $debug_echo_is_on = true; + + /** + * The last query result + * @var object Default is null + */ + public $last_result = null; + + /** + * Get data from disk cache + * @var boolean Default is false + */ + public $from_disk_cache = false; + + /** + * Function called + * @var string + */ + private $func_call; + + /** + * Constructor of ezSQL + */ + public function __construct() { + + } // __construct + + /** + * Print SQL/DB error - over-ridden by specific DB class + * + * @param $err_str string + */ + public function register_error($err_str) { + // Keep track of last error + $this->last_error = $err_str; + + // Capture all errors to an error array no matter what happens + $this->captured_errors[] = array + ( + 'error_str' => $err_str, + 'query' => $this->last_query + ); + } // register_error + + /** + * Turn error handling on, by default error handling is on + */ + public function show_errors() { + $this->show_errors = true; + } // show_errors + + /** + * Turn error handling off + */ + public function hide_errors() { + $this->show_errors = false; + } // hide_errors + + /** + * Kill cached query results + */ + public function flush() { + // Get rid of these + $this->last_result = null; + $this->col_info = null; + $this->last_query = null; + $this->from_disk_cache = false; + } // flush + + /** + * Get one variable from the DB - see docs for more detail + * + * @param $query object A query object, default is null + * @param $x int Default is 0 + * @param $y int Default is 0 + * @return variant The value of a variable + */ + public function get_var($query=null, $x=0, $y=0) { + // Log how the function was called + $this->func_call = "\$db->get_var(\"$query\",$x,$y)"; + + // If there is a query then perform it if not then use cached results.. + if ( $query ) { + $this->query($query); + } + + // Extract public out of cached results based x,y vals + if ( $this->last_result[$y] ) { + $values = array_values(get_object_vars($this->last_result[$y])); + } + + // If there is a value return it else return null + return (isset($values[$x]) && $values[$x]!=='')?$values[$x]:null; + } // get_var + + /** + * Get one row from the DB - see docs for more detail + * + * @param object $query Default is null + * @param bolean $output Default is the OBJECT constant + * @param int $y Default is 0 + * @return type + */ + public function get_row($query=null, $output=self::OBJECT, $y=0) { + // Log how the function was called + $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; + + // If there is a query then perform it if not then use cached results.. + if ( $query ) { + $this->query($query); + } + + // If the output is an object then return object using the row offset.. + if ( $output == self::OBJECT ) { + return $this->last_result[$y] ? $this->last_result[$y] : null; + } + // If the output is an associative array then return row as such.. + elseif ( $output == self::ARRAY_A ) { + return $this->last_result[$y] ? get_object_vars($this->last_result[$y]) : null; + } elseif ( $output == self::ARRAY_N ) { + // If the output is an numerical array then return row as such.. + return $this->last_result[$y]?array_values(get_object_vars($this->last_result[$y])):null; + } else { + // If invalid output type was specified.. + $this->print_error(" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"); + } + + } // get_row + + /** + * Function to get 1 column from the cached result set based in + * X index + * see docs for usage and info + * + * @param object $query Default is null + * @param type $x Default is 0 + * @return array + */ + public function get_col($query=null, $x=0) { + + $new_array = array(); + + // If there is a query then perform it if not then use cached results.. + if ( $query ) { + $this->query($query); + } + + // Extract the column values + for ( $i=0; $i < count($this->last_result); $i++ ) { + $new_array[$i] = $this->get_var(null, $x, $i); + } + + return $new_array; + } // get_col + + + /** + * Return the the query as a result set - see docs for more + * details + * + * @param object $query Default is null + * @param boolean $output Default is the OBJECT constant + * @return array + */ + public function get_results($query=null, $output=self::OBJECT) { + + // Log how the function was called + $this->func_call = "\$db->get_results(\"$query\", $output)"; + + // If there is a query then perform it if not then use cached results.. + if ( $query ) { + $this->query($query); + } + + // Send back array of objects. Each row is an object + if ( $output == self::OBJECT ) { + return $this->last_result; + } elseif ( $output == self::RAY_A || $output == self::ARRAY_N ) { + if ( $this->last_result ) { + $i=0; + foreach( $this->last_result as $row ) { + + $new_array[$i] = get_object_vars($row); + + if ( $output == self::ARRAY_N ) { + $new_array[$i] = array_values($new_array[$i]); + } + + $i++; + } + + return $new_array; + } else { + return null; + } + } + } // get_results + + + /** + * Function to get column meta data info pertaining to the last + * query + * See docs for more info and usage + * + * @param type $info_type + * @param type $col_offset + * @return type + */ + public function get_col_info($info_type='name', $col_offset=-1) { + $new_array = array(); + + if ( $this->col_info ) { + if ( $col_offset == -1 ) { + $i=0; + foreach($this->col_info as $col ) { + $new_array[$i] = $col->{$info_type}; + $i++; + } + return $new_array; + } else { + return $this->col_info[$col_offset]->{$info_type}; + } + } + + } // get_col_info + + /** + * Store the cache + * + * @param object $query + * @param boolean $is_insert + */ + public function store_cache($query, $is_insert) { + + // The would be cache file for this query + $cache_file = $this->cache_dir.'/'.md5($query); + + // disk caching of queries + if ( $this->use_disk_cache && ( $this->cache_queries && ! $is_insert ) || ( $this->cache_inserts && $is_insert )) { + if ( ! is_dir($this->cache_dir) ) { + $this->register_error("Could not open cache dir: $this->cache_dir"); + $this->show_errors ? trigger_error("Could not open cache dir: $this->cache_dir",E_USER_WARNING) : null; + } else { + // Cache all result values + $result_cache = array + ( + 'col_info' => $this->col_info, + 'last_result' => $this->last_result, + 'num_rows' => $this->num_rows, + 'return_value' => $this->num_rows, + ); + error_log ( serialize($result_cache), 3, $cache_file); + } + } + } // store_cache + + /** + * Get the query cache of a query + * + * @param object $query + * @return object + */ + public function get_cache($query) { + // The would be cache file for this query + $cache_file = $this->cache_dir.'/'.md5($query); + + // Try to get previously cached version + if ( $this->use_disk_cache && file_exists($cache_file) ) { + // Only use this cache file if less than 'cache_timeout' (hours) + if ( (time() - filemtime($cache_file)) > ($this->cache_timeout*3600) ) { + unlink($cache_file); + } else { + $result_cache = unserialize(file_get_contents($cache_file)); + + $this->col_info = $result_cache['col_info']; + $this->last_result = $result_cache['last_result']; + $this->num_rows = $result_cache['num_rows']; + + $this->from_disk_cache = true; + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $result_cache['return_value']; + } + } + } // get_cache + + /** + * Dumps the contents of any input variable to screen in a nicely formatted + * and easy to understand way - any type: Object, public or Array + * + * @param variant $mixed Default is empty String + * @return string Returns HTML result + */ + public function vardump($mixed='') { + // Start outup buffering + ob_start(); + + echo "

"; + echo "
";
+
+        if ( ! $this->vardump_called ) {
+            echo "ezSQL (v" . self::EZSQL_VERSION . ") Variable Dump..\n\n";
+        }
+
+        $var_type = gettype ($mixed);
+        print_r(($mixed?$mixed:"No Value / False"));
+        echo "\n\nType: " . ucfirst($var_type) . "\n";
+        echo "Last Query [$this->num_queries]: ".($this->last_query?$this->last_query:"NULL")."\n";
+        echo "Last Function Call: " . ($this->func_call ? $this->func_call : "None")."\n";
+        echo "Last Rows Returned: ".count($this->last_result)."\n";
+        echo "
".$this->donation(); + echo "\n


"; + + // Stop output buffering and capture debug HTML + $html = ob_get_contents(); + ob_end_clean(); + + // Only echo output if it is turned on + if ( $this->debug_echo_is_on ) { + echo $html; + } + + $this->vardump_called = true; + + return $html; + } // vardump + + /** + * An alias for vardump method + * + * @param variant $mixed Default is empty String + * @return string Returns HTML result + */ + public function dumpvar($mixed) { + return $this->vardump($mixed); + } // dumpvar + + /** + * Displays the last query string that was sent to the database & a table + * listing results (if there were any). + * (Abstracted into a seperate files to save server overhead). + * + * @param boolean $print_to_screen Default is true + * @return string The HTML result + */ + public function debug($print_to_screen=true) { + // Start outup buffering + ob_start(); + + echo "
"; + + // Only show ezSQL credits once.. + if ( ! $this->debug_called ) { + echo "ezSQL (v". self::EZSQL_VERSION .") Debug..

\n"; + } + + if ( $this->last_error ) { + echo "Last Error -- [$this->last_error]

"; + } + + if ( $this->from_disk_cache ) { + echo "Results retrieved from disk cache

"; + } + + echo "Query [$this->num_queries] -- "; + echo "[$this->last_query]

"; + + echo "Query Result.."; + echo "

"; + + if ( $this->col_info ) { + + // ===================================================== + // Results top rows + + echo ""; + echo ""; + + + for ( $i=0; $i < count($this->col_info); $i++ ) { + echo ""; + } + + echo ""; + + // ====================================================== + // print main results + + if ( $this->last_result ) { + + $i=0; + foreach ( $this->get_results(null, self::ARRAY_N) as $one_row ) { + $i++; + echo ""; + + foreach ( $one_row as $item ) { + echo ""; + } + + echo ""; + } + + } else { + // if last result + echo ""; + } + + echo "
(row){$this->col_info[$i]->type} {$this->col_info[$i]->max_length}
{$this->col_info[$i]->name}
$i$item
No Results
"; + + } else { + // if col_info + echo "No Results"; + } + + echo "
".$this->donation()."
"; + + // Stop output buffering and capture debug HTML + $html = ob_get_contents(); + ob_end_clean(); + + // Only echo output if it is turned on + if ( $this->debug_echo_is_on && $print_to_screen) { + echo $html; + } + + $this->debug_called = true; + + return $html; + } // debug + + /** + * Naughty little function to ask for some remuniration! + * + * @return string An HTML string with payment information + */ + public function donation() { + $return_val = '' + . 'If ezSQL has helped make a donation!?   ' + . ''; + + return $return_val; + } // donation + + /*************************************************************************** + * Timer related functions + ***************************************************************************/ + + /** + * Get current time + * + * @return float + */ + public function timer_get_cur() { + list($usec, $sec) = explode(' ',microtime()); + return ((float)$usec + (float)$sec); + } // timer_get_cur + + /** + * Start a timer by name + * + * @param string $timer_name + */ + public function timer_start($timer_name) { + $this->timers[$timer_name] = $this->timer_get_cur(); + } // timer_start + + /** + * Returns the elapsed time of the given timer by name + * + * @param string $timer_name + * @return float + */ + public function timer_elapsed($timer_name) { + return round($this->timer_get_cur() - $this->timers[$timer_name],2); + } // timer_elapsed + + /** + * Update the global timer with an existing timer + * + * @param string $timer_name + */ + public function timer_update_global($timer_name) { + if ( $this->do_profile ) { + $this->profile_times[] = array + ( + 'query' => $this->last_query, + 'time' => $this->timer_elapsed($timer_name) + ); + } + + $this->total_query_time += $this->timer_elapsed($timer_name); + } // timer_update_global + + /** + * Returns, whether a database connection is established, or not + * + * @return boolean + */ + public function isConnected() { + return $this->connected; + } // isConnected + + /** + * Returns the current show error state + * + * @return boolean + */ + public function getShowErrors() { + return $this->show_errors; + } // getShowErrors + + /** + * Returns the affected rows of a query + * + * @return int + */ + public function affectedRows() { + return $this->affectedRows; + } // affectedRows + +} // ezSQLcore \ No newline at end of file diff --git a/shared/ez_sql_core_2.1_debughack_0.2alpha.php b/shared/ez_sql_core_2.1_debughack_0.2alpha.php index 440c11de..9d75c9ca 100755 --- a/shared/ez_sql_core_2.1_debughack_0.2alpha.php +++ b/shared/ez_sql_core_2.1_debughack_0.2alpha.php @@ -1,4 +1,7 @@ vardump and $db->debug functions diff --git a/shared/ez_sql_core_202console.php b/shared/ez_sql_core_202console.php index c226c269..7daa22ec 100755 --- a/shared/ez_sql_core_202console.php +++ b/shared/ez_sql_core_202console.php @@ -1,4 +1,7 @@ vardump and $db->debug functions diff --git a/shared/ez_sql_recordset.php b/shared/ez_sql_recordset.php new file mode 100644 index 00000000..666ec737 --- /dev/null +++ b/shared/ez_sql_recordset.php @@ -0,0 +1,213 @@ + + * @name ezSQL_recordset + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_recordset implements Iterator +{ + /** + * Returns the result as array + */ + const RESULT_AS_ARRAY = 'array'; + + /** + * Returns the result as object of stdClass + */ + const RESULT_AS_OBJECT = 'object'; + + /** + * Returns the result as numeric array + */ + const RESULT_AS_ROW = 'row'; + + /** + * The current position in the recordset + * @var int + */ + private $_position = 0; + + /** + * Contains the possible return types + * @var array + */ + private $_checkTypes = array( + 'array' + , 'object' + , 'row' + ); + + /** + * The recordset + * @var array + */ + private $_recordset = array(); + + + /** + * Initializes the record object + * + * @param array $ezSQL_queryresult The result of an ezSQL query + * @throws Exception When $ezSQL_queryresult is not an array + */ + public function __construct($ezSQL_queryresult) { + if (!is_array($ezSQL_queryresult)) { + throw new Exception('$ezSQL_queryresult is not valid.'); + } + + $this->_recordset = $ezSQL_queryresult; + $this->position = 0; + } // __construct + + /** + * Sets the position to zero + */ + public function rewind() { + $this->_position = 0; + } // rewind + + /** + * Returns the current row of the recordset as stdClass, which is the + * default mode, or as array as fieldname - fieldvalue. + * + * @param string $mode Return the current row as array, or object + * Default is RESULT_AS_OBJECT + * @return stdClass/array + */ + public function current($mode=self::RESULT_AS_OBJECT) { + $return_val = null; + + if (!in_array($mode, $this->_checkTypes)) { + throw new Exception(sprintf('$mode is not in %s1 or %s2', self::RESULT_AS_OBJECT, self::RESULT_AS_ARRAY)); + } + + if ($this->valid()) { + switch ($mode) { + case self::RESULT_AS_OBJECT: + // The result is a standard ezSQL row of stdClass + $return_val = $this->_recordset[$this->_position]; + + break; + + case self::RESULT_AS_ARRAY: + $return_val = get_object_vars($this->_recordset[$this->_position]); + + break; + + case self::RESULT_AS_ROW: + $return_val = array_values(get_object_vars($this->_recordset[$this->_position])); + + break; + + default: + + break; + } + } else { + $result = false; + } + + return $return_val; + } // current + + /** + * Returns the current position in the recordset + * + * @return int + */ + public function key() { + return $this->_position; + } // key + + /** + * Sets the position of the recordset up by one + */ + public function next() { + ++$this->_position; + } // next + + /** + * Sets position of the recordset down by one, if the position is below the + * start, the position is set to the start position + */ + public function previous() { + --$this->_position; + + if ($this->_position < 0) { + $this->_position = 0; + } + } // previous + + /** + * Whether the current position contains a row, or not + * + * @return boolean + */ + public function valid() { + return isset($this->_recordset[$this->_position]); + } // valid + + /** + * Behaves like mysql_fetch_assoc. This method it to implement ezSQL easier + * in an existing system, that made us of mysql_fetch_assoc. + * It returns the current record as an associative array and moves the + * internal data pointer ahead. + * + * @return array + */ + public function ezSQL_fetch_assoc() { + if ($this->valid()) { + $return_val = $this->current(self::RESULT_AS_ARRAY); + $this->next(); + } else { + $return_val = false; + } + + return $return_val; + } // ezSQL_fetch_assoc + + /** + * Behaves like mysql_fetch_row This method it to implement ezSQL easier + * in an existing system, that made us of mysql_fetch_row. + * It returns the current record as a numeric array and moves the internal + * data pointer ahead. + * + * @return array + */ + public function ezSQL_fetch_row() { + if ($this->valid()) { + $return_val = $this->current(self::RESULT_AS_ROW); + $this->next(); + } else { + $return_val = false; + } + + return $return_val; + } // ezSQL_fetch_row + + /** + * Behaves like mysql_fetch_object This method it to implement ezSQL easier + * in an existing system, that made us of mysql_fetch_object. + * It returns n object with properties that correspond to the fetched row + * and moves the internal data pointer ahead. + * + * @return array + */ + public function ezSQL_fetch_object() { + if ($this->valid()) { + $return_val = $this->current(self::RESULT_AS_OBJECT); + $this->next(); + } else { + $return_val = false; + } + + return $return_val; + } // ezSQL_fetch_object + //public function + +} // dbapi_recordset \ No newline at end of file diff --git a/sqlite/demo.php b/sqlite/demo.php deleted file mode 100755 index 0ba15828..00000000 --- a/sqlite/demo.php +++ /dev/null @@ -1,45 +0,0 @@ -query("CREATE TABLE test_table ( MyColumnA INTEGER PRIMARY KEY, MyColumnB TEXT(32) );"); - - // Insert test data - for($i=0;$i<3;++$i) - { - $db->query('INSERT INTO test_table (MyColumnB) VALUES ("'.md5(microtime()).'");'); - } - - // Get list of tables from current database.. - $my_tables = $db->get_results("SELECT * FROM sqlite_master WHERE sql NOTNULL;"); - - // Print out last query and results.. - $db->debug(); - - // Loop through each row of results.. - foreach ( $my_tables as $table ) - { - // Get results of DESC table.. - $db->get_results("SELECT * FROM $table->name;"); - - // Print out last query and results.. - $db->debug(); - } - - // Get rid of the table we created.. - $db->query("DROP TABLE test_table;"); - -?> \ No newline at end of file diff --git a/sqlite/ez_sql_sqlite.php b/sqlite/ez_sql_sqlite.php deleted file mode 100755 index 09a5e188..00000000 --- a/sqlite/ez_sql_sqlite.php +++ /dev/null @@ -1,207 +0,0 @@ - 'Require $dbpath and $dbname to open an SQLite database' - ); - - /********************************************************************** - * ezSQL Database specific class - SQLite - */ - - if ( ! function_exists ('sqlite_open') ) die('Fatal Error: ezSQL_sqlite requires SQLite Lib to be compiled and or linked in to the PHP engine'); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_sqlite requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_sqlite extends ezSQLcore - { - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_sqlite class - */ - - function ezSQL_sqlite($dbpath='', $dbname='') - { - // Turn on track errors - ini_set('track_errors',1); - - if ( $dbpath && $dbname ) - { - $this->connect($dbpath, $dbname); - } - } - - /********************************************************************** - * Try to connect to SQLite database server - */ - - function connect($dbpath='', $dbname='') - { - global $ezsql_sqlite_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbpath || ! $dbname ) - { - $this->register_error($ezsql_sqlite_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sqlite_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - else if ( ! $this->dbh = @sqlite_open($dbpath.$dbname) ) - { - $this->register_error($php_errormsg); - $this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null; - } - else - $return_val = true; - - return $return_val; - } - - /********************************************************************** - * In the case of SQLite quick_connect is not really needed - * because std. connect already does what quick connect does - - * but for the sake of consistency it has been included - */ - - function quick_connect($dbpath='', $dbname='') - { - return $this->connect($dbpath, $dbname); - } - - /********************************************************************** - * No real equivalent of mySQL select in SQLite - * once again, function included for the sake of consistency - */ - - function select($dbpath='', $dbname='') - { - return $this->connect($dbpath, $dbname); - } - - /********************************************************************** - * Format a SQLite string correctly for safe SQLite insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - return sqlite_escape_string(stripslashes(preg_replace("/[\r\n]/",'',$str))); - } - - /********************************************************************** - * Return SQLite specific system date syntax - * i.e. Oracle: SYSDATE Mysql: NOW() - */ - - function sysdate() - { - return 'now'; - } - - /********************************************************************** - * Perform SQLite query and try to detirmin result value - */ - - // ================================================================== - // Basic Query - see docs for more detail - - function query($query) - { - - // For reg expressions - $query = str_replace("/[\n\r]/",'',trim($query)); - - // initialise return - $return_val = 0; - - // Flush cached values.. - $this->flush(); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Perform the query via std mysql_query function.. - $this->result = @sqlite_query($this->dbh,$query); - $this->num_queries++; - - // If there is an error then take note of it.. - if (@sqlite_last_error($this->dbh)) - { - $err_str = sqlite_error_string (sqlite_last_error($this->dbh)); - $this->register_error($err_str); - $this->show_errors ? trigger_error($err_str,E_USER_WARNING) : null; - return false; - } - - // Query was an insert, delete, update, replace - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @sqlite_changes($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - $this->insert_id = @sqlite_last_insert_rowid($this->dbh); - } - - // Return number fo rows affected - $return_val = $this->rows_affected; - - } - // Query was an select - else - { - - // Take note of column info - $i=0; - while ($i < @sqlite_num_fields($this->result)) - { - $this->col_info[$i]->name = sqlite_field_name ( $this->result, $i); - $this->col_info[$i]->type = null; - $this->col_info[$i]->max_length = null; - $i++; - } - - // Store Query Results - $num_rows=0; - while ($row = @sqlite_fetch_array($this->result,SQLITE_ASSOC) ) - { - // Store relults as an objects within main array - $obj= (object) $row; //convert to object - $this->last_result[$num_rows] = $obj; - $num_rows++; - } - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - - } - - // If debug ALL queries - $this->trace||$this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - } - -?> diff --git a/sybase/ez_sql_sybase.php b/sybase/ez_sql_sybase.php index 8e999286..9d9868aa 100644 --- a/sybase/ez_sql_sybase.php +++ b/sybase/ez_sql_sybase.php @@ -1,389 +1,437 @@ 'Require $dbuser and $dbpassword to connect to a database server', - 2 => 'Error establishing sybase database connection. Correct user/password? Correct hostname? Database server running?', - 3 => 'Require $dbname to select a database', - 4 => 'SQL Server database connection is not active', - 5 => 'Unexpected error while trying to select database' - ); - - /********************************************************************** - * ezSQL Database specific class - sybase - */ - - if ( ! function_exists ('sybase_connect') ) die('Fatal Error: ezSQL_sybase requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable sybase extenstion in PHP.ini file '); - if ( ! class_exists ('ezSQLcore') ) die('Fatal Error: ezSQL_sybase requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); - - class ezSQL_sybase extends ezSQLcore - { - - var $dbuser = false; - var $dbpassword = false; - var $dbname = false; - var $dbhost = false; - //if we want to convert Queries in MySql syntax to Sybase syntax. Yes, there - //are some differences in query syntax. - var $convertMySqlTosybaseQuery = TRUE; - - /********************************************************************** - * Constructor - allow the user to perform a qucik connect at the - * same time as initialising the ezSQL_sybase class - */ - - function ezSQL_sybase($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlTosybaseQuery=true) - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbname = $dbname; - $this->dbhost = $dbhost; - $this->convertMySqlTosybaseQuery = $convertMySqlTosybaseQuery; - } - - /********************************************************************** - * Short hand way to connect to sybase database server - * and select a sybase database at the same time - */ - - function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') - { - $return_val = false; - if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; - else if ( ! $this->select($dbname) ) ; - else $return_val = true; - return $return_val; - } - - /********************************************************************** - * Try to connect to sybase database server - */ - - function connect($dbuser='', $dbpassword='', $dbhost='localhost') - { - global $ezsql_sybase_str; $return_val = false; - - // Must have a user and a password - if ( ! $dbuser ) - { - $this->register_error($ezsql_sybase_str[1].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[1],E_USER_WARNING) : null; - } - // Try to establish the server database handle - - else if ( ! $this->dbh = @sybase_connect($dbhost,$dbuser,$dbpassword) ) - { - $this->register_error($ezsql_sybase_str[2].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[2],E_USER_WARNING) : null; - } - else - { - $this->dbuser = $dbuser; - $this->dbpassword = $dbpassword; - $this->dbhost = $dbhost; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Try to select a sybase database - */ - - function select($dbname='') - { - global $ezsql_sybase_str; $return_val = false; - - // Must have a database name - if ( ! $dbname ) - { - $this->register_error($ezsql_sybase_str[3].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[3],E_USER_WARNING) : null; - } - - // Must have an active database connection - else if ( ! $this->dbh ) - { - $this->register_error($ezsql_sybase_str[4].' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($ezsql_sybase_str[4],E_USER_WARNING) : null; - } - - // Try to connect to the database - - else if ( !@sybase_select_db($dbname,$this->dbh) ) - { - $str = $ezsql_sybase_str[5]; - - $this->register_error($str.' in '.__FILE__.' on line '.__LINE__); - $this->show_errors ? trigger_error($str,E_USER_WARNING) : null; - } - else - { - $this->dbname = $dbname; - $return_val = true; - } - - return $return_val; - } - - /********************************************************************** - * Format a sybase string correctly for safe sybase insert - * (no mater if magic quotes are on or not) - */ - - function escape($str) - { - //not sure about this. - //applying following logic - //1. add 1 more ' to ' character - - return str_ireplace("'", "''", $str); - - } - - /********************************************************************** - * Return sybase specific system date syntax - * i.e. Oracle: SYSDATE sybase: getDate() - */ - - function sysdate() - { - return 'getDate()'; - } - - /********************************************************************** - * Perform sybase query and try to detirmin result value - */ - - function query($query) - { - - //if flag to convert query from MySql syntax to Sybase syntax is true - //convert the query - if($this->convertMySqlTosybaseQuery == true) - $query = $this->ConvertMySqlTosybase($query); - - - - // Initialise return - $return_val = 0; - - - // Flush cached values.. - $this->flush(); - - // For reg expressions - $query = trim($query); - - // Log how the function was called - $this->func_call = "\$db->query(\"$query\")"; - - // Keep track of the last query for debug.. - $this->last_query = $query; - - // Count how many queries there have been - $this->num_queries++; - - // Use core file cache function - if ( $cache = $this->get_cache($query) ) - { - return $cache; - } - - - // If there is no existing database connection then try to connect - if ( ! isset($this->dbh) || ! $this->dbh ) - { - $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); - $this->select($this->dbname); - } - - - - - // Perform the query via std sybase_query function.. - - $this->result = @sybase_query($query); - - - - // If there is an error then take note of it.. - if ($this->result == false ) - { - - $get_errorcodeSql = "SELECT @@ERROR as errorcode"; - $error_res = @sybase_query($get_errorcodeSql, $this->dbh); - $errorCode = @sybase_result($error_res, 0, "errorcode"); - - $get_errorMessageSql = "SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ".$errorCode ; - $errormessage_res = @sybase_query($get_errorMessageSql, $this->dbh); - if($errormessage_res) - { - $errorMessage_Row = @sybase_fetch_row($errormessage_res); - $errorSeverity = $errorMessage_Row[0]; - $errorMessage = $errorMessage_Row[1]; - } - - $sqlError = "ErrorCode: ".$errorCode." ### Error Severity: ".$errorSeverity." ### Error Message: ".$errorMessage." ### Query: ".$query; - - $is_insert = true; - $this->register_error($sqlError); - $this->show_errors ? trigger_error($sqlError ,E_USER_WARNING) : null; - return false; - } - - - - - // Query was an insert, delete, update, replace - $is_insert = false; - if ( preg_match("/^(insert|delete|update|replace)\s+/i",$query) ) - { - $this->rows_affected = @sybase_rows_affected($this->dbh); - - // Take note of the insert_id - if ( preg_match("/^(insert|replace)\s+/i",$query) ) - { - - $identityresultset = @sybase_query("select SCOPE_IDENTITY()"); - - if ($identityresultset != false ) - { - $identityrow = @sybase_fetch_row($identityresultset); - $this->insert_id = $identityrow[0]; - } - - } - - // Return number of rows affected - $return_val = $this->rows_affected; - } - // Query was a select - else - { - - // Take note of column info - $i=0; - while ($i < @sybase_num_fields($this->result)) - { - $this->col_info[$i] = @sybase_fetch_field($this->result); - $i++; - - } - - // Store Query Results - $num_rows=0; - - while ( $row = @sybase_fetch_object($this->result) ) - { - - // Store relults as an objects within main array - $this->last_result[$num_rows] = $row; - $num_rows++; - } - - @sybase_free_result($this->result); - - // Log number of rows the query returned - $this->num_rows = $num_rows; - - // Return number of rows selected - $return_val = $this->num_rows; - } - - // disk caching of queries - $this->store_cache($query,$is_insert); - - // If debug ALL queries - $this->trace || $this->debug_all ? $this->debug() : null ; - - return $return_val; - - } - - - - /********************************************************************** - * Convert a Query From MySql Syntax to Sybase syntax - Following conversions are made:- - 1. The '`' character used for MySql queries is not supported - the character is removed. - 2. FROM_UNIXTIME method is not supported. The Function is removed.It is replaced with - getDate(). Warning: This logic may not be right. - 3. unix_timestamp function is removed. - 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully tested. - - Note: This method is only a small attempt to convert the syntax. There are many aspects which are not covered here. - This method doesn't at all guarantee complete conversion. Certain queries will still - not work. - */ - - function ConvertMySqlTosybase($query) - { - - - //replace the '`' character used for MySql queries, but not - //supported in Sybase - - $query = str_replace("`", "", $query); - - //replace From UnixTime command in Sybase, doesn't work - - $pattern = "/FROM_UNIXTIME\(([^\/]{0,})\)/i"; - $replacement = "getdate()"; - //ereg($pattern, $query, $regs); - //we can get the Unix Time function parameter value from this string - //$valueInsideFromUnixTime = $regs[1]; - - $query = preg_replace($pattern, $replacement, $query); - - - //replace LIMIT keyword. Works only on MySql not on Sybase - //replace it with TOP keyword - - $pattern = "/LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})/i"; - $replacement = ""; - preg_match($pattern, $query, $regs); - - $query = preg_replace($pattern, $replacement, $query); - - if(count($regs) > 0): - if($regs[2]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[3]." ", $query); - else - { - if($regs[1]) - $query = str_ireplace("SELECT ", "SELECT TOP ".$regs[1]." ", $query); - } - endif; - - //replace unix_timestamp function. Doesn't work in Sybase - $pattern = "/unix_timestamp\(([^\/]{0,})\)/i"; - $replacement = "\\1"; - $query = preg_replace($pattern, $replacement, $query); - - return $query; - - } - - - - - } - - -?> +/** + * ezSQL class - Sybase ASE + * Desc..: Sybase ASE component (part of ezSQL database abstraction library) - + * based on ezSql_mssql library class. + * + * @author Muhammad Iyas (iyasilias@gmail.com) + * @author Stefanie Janine Stoelting + * @link + * @name ezSQL_sybase + * @package ezSQL + * @license FREE / Donation (LGPL - You may do what you like with ezSQL - no exceptions.) + * + */ +class ezSQL_sybase extends ezSQLcore +{ + /** + * ezSQL error strings - Sybase ASE + * @var array + */ + private $ezsql_sybase_str = array + ( + 1 => 'Require $dbuser and $dbpassword to connect to a database server', + 2 => 'Error establishing sybase database connection. Correct user/password? Correct hostname? Database server running?', + 3 => 'Require $dbname to select a database', + 4 => 'SQL Server database connection is not active', + 5 => 'Unexpected error while trying to select database' + ); + + /** + * Database user name + * @var string + */ + private $dbuser; + + /** + * Database password for the given user + * @var string + */ + private $dbpassword; + + /** + * Database name + * @var string + */ + private $dbname; + + /** + * Host name or IP address + * @var string + */ + private $dbhost; + + /** + * Show errors + * @var boolean Default is true + */ + public $show_errors = true; + + /** + * if we want to convert Queries in MySql syntax to Sybase syntax. Yes, + * there are some differences in query syntax. + * @var boolean Default is true + */ + private $convertMySqlToSybaseQuery = true; + + /********************************************************************** + * Constructor - allow the user to perform a qucik connect at the + * same time as initialising the ezSQL_sybase class + */ + + /** + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @param boolean $convertMySqlToSybaseQuery Default is true + * @throws Exception Requires ntwdblib.dll and ez_sql_core.php + */ + public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost', $convertMySqlToSybaseQuery=true) { + if ( ! function_exists ('sybase_connect') ) { + throw new Exception('Fatal Error: ezSQL_sybase requires ntwdblib.dll to be present in your winowds\system32 folder. Also enable sybase extenstion in PHP.ini file '); + } + if ( ! class_exists ('ezSQLcore') ) { + throw new Exception('Fatal Error: ezSQL_sybase requires ezSQLcore (ez_sql_core.php) to be included/loaded before it can be used'); + } + + sybase_min_server_severity(20); + parent::__construct(); + + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbname = $dbname; + $this->dbhost = $dbhost; + $this->convertMySqlToSybaseQuery = $convertMySqlToSybaseQuery; + } // __construct + + /** + * Short hand way to connect to sybase database server and select a sybase + * database at the same time + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbname The name of the database + * Default is empty string + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') { + if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ; + else if ( ! $this->select($dbname) ) ; + + return $this->connected; + } // quick_connect + + /** + * Try to connect to sybase database server + * + * @param string $dbuser The database user name + * Default is empty string + * @param string $dbpassword The database users password + * Default is empty string + * @param string $dbhost The host name or IP address of the database server. + * Default is localhost + * @return boolean + */ + public function connect($dbuser='', $dbpassword='', $dbhost='localhost') { + $this->connected = false; + + // Must have a user and a password + if ( ! $dbuser ) { + $this->register_error($this->ezsql_sybase_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[1], E_USER_WARNING) : null; + } else if ( ! $this->dbh = @sybase_connect($dbhost, $dbuser, $dbpassword) ) { + // Try to establish the server database handle + $this->register_error($this->ezsql_sybase_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[2], E_USER_WARNING) : null; + } else { + $this->dbuser = $dbuser; + $this->dbpassword = $dbpassword; + $this->dbhost = $dbhost; + $this->connected = true; + } + + return $this->connected; + } // connect + + /********************************************************************** + * + */ + + /** + * Try to select a sybase database + * + * @param string $dbname + * @return boolean + */ + public function select($dbname='') { + $this->connected = false; + + // Must have a database name + if ( ! $dbname ) { + $this->register_error($this->ezsql_sybase_str[3] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[3], E_USER_WARNING) : null; + } else if ( ! $this->dbh ) { + // Must have an active database connection + $this->register_error($this->ezsql_sybase_str[4] . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($this->ezsql_sybase_str[4], E_USER_WARNING) : null; + } else if ( !@sybase_select_db($dbname,$this->dbh) ) { + // Try to connect to the database + $str = $ezsql_sybase_str[5]; + + $this->register_error($str . ' in ' . __FILE__ . ' on line ' . __LINE__); + $this->show_errors ? trigger_error($str, E_USER_WARNING) : null; + } else { + $this->dbname = $dbname; + $this->connected = true; + } + + return $this->connected; + } // select + + /** + * Format a sybase string correctly for safe sybase insert + * + * @param string $str + * @return string + */ + public function escape($str) { + $return_val = ''; + + if ( !isset($str) or empty($str) ) { + $return_val = ''; + } else if ( is_numeric($str) ) { + $return_val = $str; + } else { + $non_displayables = array( + '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15 + '/%1[0-9a-f]/', // url encoded 16-31 + '/[\x00-\x08]/', // 00-08 + '/\x0b/', // 11 + '/\x0c/', // 12 + '/[\x0e-\x1f]/' // 14-31 + ); + + foreach ( $non_displayables as $regex ) { + $str = preg_replace( $regex, '', $str ); + } + + $return_val = str_replace("'", "''", $str ); + } + + return $return_val; + } // escape + + /** + * Return sybase specific system date syntax + * i.e. Oracle: SYSDATE sybase: getDate() + * + * @return string + */ + public function sysdate() { + return 'getDate()'; + } // sysdate + + /** + * Perform sybase query and try to detirmin result value + * + * @param string $query + * @return object + */ + public function query($query) { + // If flag to convert query from MySql syntax to Sybase syntax is true + // Convert the query + if($this->convertMySqlTosybaseQuery == true) { + $query = $this->ConvertMySqlTosybase($query); + } + + // Initialise return + $return_val = 0; + + // Flush cached values.. + $this->flush(); + + // For reg expressions + $query = trim($query); + + // Log how the function was called + $this->func_call = "\$db->query(\"$query\")"; + + // Keep track of the last query for debug.. + $this->last_query = $query; + + // Count how many queries there have been + $this->num_queries++; + + // Use core file cache function + if ( $cache = $this->get_cache($query) ) { + return $cache; + } + + // If there is no existing database connection then try to connect + if ( ! isset($this->dbh) || ! $this->dbh ) { + $this->connect($this->dbuser, $this->dbpassword, $this->dbhost); + $this->select($this->dbname); + } + + + // Perform the query via std sybase_query function.. + $this->result = @sybase_query($query); + + // If there is an error then take note of it.. + if ($this->result == false ) { + + $get_errorcodeSql = "SELECT @@ERROR as errorcode"; + $error_res = @sybase_query($get_errorcodeSql, $this->dbh); + $errorCode = @sybase_result($error_res, 0, 'errorcode'); + + $get_errorMessageSql = 'SELECT severity as errorSeverity, text as errorText FROM sys.messages WHERE message_id = ' . $errorCode; + $errormessage_res = @sybase_query($get_errorMessageSql, $this->dbh); + if($errormessage_res) { + $errorMessage_Row = @sybase_fetch_row($errormessage_res); + $errorSeverity = $errorMessage_Row[0]; + $errorMessage = $errorMessage_Row[1]; + } + + $sqlError = 'ErrorCode: ' . $errorCode. ' ### Error Severity: ' . $errorSeverity . ' ### Error Message: ' . $errorMessage.' ### Query: ' . $query; + + $is_insert = true; + $this->register_error($sqlError); + $this->show_errors ? trigger_error($sqlError, E_USER_WARNING) : null; + return false; + } + + // Query was an insert, delete, update, replace + $is_insert = false; + if ( preg_match("/^(insert|delete|update|replace)\s+/i", $query) ) { + $this->affectedRows = @sybase_rows_affected($this->dbh); + + // Take note of the insert_id + if ( preg_match("/^(insert|replace)\s+/i",$query) ) { + + $identityresultset = @sybase_query('select SCOPE_IDENTITY()'); + + if ($identityresultset != false ) { + $identityrow = @sybase_fetch_row($identityresultset); + $this->insert_id = $identityrow[0]; + } + } + + // Return number of rows affected + $return_val = $this->affectedRows; + } else { + // Query was a select + // Take note of column info + $i=0; + while ($i < @sybase_num_fields($this->result)) { + $this->col_info[$i] = @sybase_fetch_field($this->result); + $i++; + } + + // Store Query Results + $num_rows=0; + + while ( $row = @sybase_fetch_object($this->result) ) { + // Store relults as an objects within main array + $this->last_result[$num_rows] = $row; + $num_rows++; + } + + @sybase_free_result($this->result); + + // Log number of rows the query returned + $this->num_rows = $num_rows; + + // Return number of rows selected + $return_val = $this->num_rows; + } + + // disk caching of queries + $this->store_cache($query, $is_insert); + + // If debug ALL queries + $this->trace || $this->debug_all ? $this->debug() : null ; + + return $return_val; + + } // query + + /** + * Convert a Query From MySql Syntax to Sybase syntax + * Following conversions are made: + * 1. The '`' character used for MySql queries is not supported - the + * character is removed. + * 2. FROM_UNIXTIME method is not supported. The Function is removed.It is + * replaced with getDate(). Warning: This logic may not be right. + * 3. unix_timestamp function is removed. + * 4. LIMIT keyowrd is replaced with TOP keyword. Warning: Logic not fully + * tested. + * + * Note: This method is only a small attempt to convert the syntax. There + * are many aspects which are not covered here. This method doesn't at + * all guarantee complete conversion. Certain queries will still not + * work. + * + * @param string $query + * @return string + */ + public function ConvertMySqlTosybase($query) { + //replace the '`' character used for MySql queries, but not + //supported in Sybase + + $query = str_replace('`', '', $query); + + //replace From UnixTime command in Sybase, doesn't work + + $pattern = "/FROM_UNIXTIME\(([^\/]{0,})\)/i"; + $replacement = 'getdate()'; + //ereg($pattern, $query, $regs); + //we can get the Unix Time function parameter value from this string + //$valueInsideFromUnixTime = $regs[1]; + + $query = preg_replace($pattern, $replacement, $query); + + //replace LIMIT keyword. Works only on MySql not on Sybase + //replace it with TOP keyword + + $pattern = "/LIMIT[^\w]{1,}([0-9]{1,})([\,]{0,})([0-9]{0,})/i"; + $replacement = ''; + preg_match($pattern, $query, $regs); + + $query = preg_replace($pattern, $replacement, $query); + + if(count($regs) > 0) { + if($regs[2]) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[3] . ' ', $query); + } else if($regs[1]) { + $query = str_ireplace('SELECT ', 'SELECT TOP ' . $regs[1] . ' ', $query); + } + } + + //replace unix_timestamp function. Doesn't work in Sybase + $pattern = "/unix_timestamp\(([^\/]{0,})\)/i"; + $replacement = "\\1"; + $query = preg_replace($pattern, $replacement, $query); + + return $query; + } + + /** + * Close the database connection + */ + public function disconnect() { + if ( $this->dbh ) { + $this->dbh = null; + $this->connected = false; + } + } // disconnect + + /** + * Returns the current database server host + * + * @return string + */ + public function getDBHost() { + return $this->dbhost; + } // getDBHost + +} // ezSQL_sybase \ No newline at end of file