Browse Source

Merge branch 'develop'

Timothy J. Warren 2 years ago
parent
commit
a6131924f7
5 changed files with 54 additions and 22 deletions
  1. 4
    1
      .travis.yml
  2. 4
    4
      CONTRIBUTING.md
  3. 27
    0
      LICENSE.md
  4. 16
    15
      README.md
  5. 3
    2
      sonar-project.properties

+ 4
- 1
.travis.yml View File

@@ -7,6 +7,7 @@ php:
7 7
   - 5.4
8 8
   - 5.5
9 9
   - 5.6
10
+  - 7
10 11
   - hhvm
11 12
   - nightly
12 13
 
@@ -28,4 +29,6 @@ after_script:
28 29
 matrix:
29 30
   allow_failures:
30 31
     - php: 5.3
31
-    - php: hhvm
32
+    - php: 5.4
33
+    - php: 5.5
34
+    - php: nightly

+ 4
- 4
CONTRIBUTING.md View File

@@ -1,10 +1,10 @@
1
-#Contributing
1
+# Contributing
2 2
 
3
-Please submit pull requests to [timw4mail/Query](https://github.com/timw4mail/Query), but other issues to [aviat4ion/Query](https://github.com/aviat4ion/Query)
3
+Please submit pull requests and issues to [aviat4ion/Query](https://git.timshomepage.net/aviat4ion/Query)
4 4
 
5
-###Pull Requests
5
+### Pull Requests
6 6
 * All pull requests should have accompanying tests following the structure / makeup of the `/tests` folder
7
-* Pull requests should reference the issue number on [aviat4ion/Query](https://github.com/aviat4ion/Query), if applicable.
7
+* Pull requests should reference the issue number on [aviat4ion/Query](https://git.timshomepage.net/aviat4ion/Query), if applicable.
8 8
 * Pull requests must follow project style:
9 9
 	1. Follow [CodeIgniter Style](http://codeigniter.com/user_guide/general/styleguide.html)
10 10
 	2. Use tabs for indentation, and do not align arrays or other multiple line statements.

+ 27
- 0
LICENSE.md View File

@@ -0,0 +1,27 @@
1
+# DON'T BE A DICK PUBLIC LICENSE
2
+
3
+> Version 1, December 2009
4
+
5
+> Copyright (C) 2012 Timothy J. Warren <tim@timshomepage.net>
6
+
7
+ Everyone is permitted to copy and distribute verbatim or modified
8
+ copies of this license document, and changing it is allowed as long
9
+ as the name is changed.
10
+
11
+> DON'T BE A DICK PUBLIC LICENSE
12
+> TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
13
+
14
+ 1. Do whatever you like with the original work, just don't be a dick.
15
+
16
+     Being a dick includes - but is not limited to - the following instances:
17
+
18
+	 1a. Outright copyright infringement - Don't just copy this and change the name.  
19
+	 1b. Selling the unmodified original with no work done what-so-ever, that's REALLY being a dick.  
20
+	 1c. Modifying the original work to contain hidden harmful content. That would make you a PROPER dick.  
21
+
22
+ 2. If you become rich through modifications, related works/services, or supporting the original work,
23
+ share the love. Only a dick would make loads off this work and not buy the original work's
24
+ creator(s) a pint.
25
+
26
+ 3. Code is provided with no warranty. Using somebody else's code and bitching when it goes wrong makes
27
+ you a DONKEY dick. Fix the problem yourself. A non-dick would submit the fix back.

+ 16
- 15
README.md View File

@@ -1,30 +1,31 @@
1 1
 # Query
2 2
 
3
-A query builder/database abstraction layer, using prepared queries for security.
3
+A query builder/database abstraction layer, using prepared statements for security.
4 4
 
5 5
 [![Build Status](https://jenkins.timshomepage.net/buildStatus/icon?job=query)](https://jenkins.timshomepage.net/job/query/)
6
-[![Code Coverage](https://scrutinizer-ci.com/g/timw4mail/Query/badges/coverage.png?s=a96df5417089f90250aeb59013a3964b1ff9b588)](https://scrutinizer-ci.com/g/timw4mail/Query/)
7
-[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/timw4mail/Query/badges/quality-score.png?s=ce0f185067d7049cfe3f0aba2ca30ed56fb97b20)](https://scrutinizer-ci.com/g/timw4mail/Query/)
6
+[![Code Coverage](https://scrutinizer-ci.com/g/aviat4ion/Query/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/aviat4ion/Query/?branch=develop)
7
+[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/aviat4ion/Query/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/aviat4ion/Query/?branch=develop)
8 8
 [![Latest Stable Version](https://poser.pugx.org/aviat4ion/query/v/stable.png)](https://packagist.org/packages/aviat4ion/query)
9 9
 [![Total Downloads](https://poser.pugx.org/aviat4ion/query/downloads.png)](https://packagist.org/packages/aviat4ion/query)
10 10
 [![Latest Unstable Version](https://poser.pugx.org/aviat4ion/query/v/unstable.png)](https://packagist.org/packages/aviat4ion/query)
11 11
 [![License](https://poser.pugx.org/aviat4ion/query/license.png)](http://www.dbad-license.org/)
12 12
 
13 13
 ## Requirements
14
-* Pdo extensions for the databases you wish to use (unless it's Firebird, in which case, the interbase extension is required)
15
-* PHP 5.3+
14
+* PDO extensions for the databases you wish to use (unless it's Firebird, in which case, the interbase extension is required)
15
+* Supported version of PHP (Older versions may work, but are not supported)
16 16
 
17 17
 ## Databases Supported
18 18
 
19 19
 * Firebird (via interbase extension)
20
-* Firebird (via PDO) -- experimental
21 20
 * MySQL
22 21
 * PostgreSQL
23 22
 * SQLite
24 23
 
25 24
 ## Including Query in your application
26 25
 
27
-To include Query in your PHP project, just include the `autoload.php` file. This will automatically load the classes that are supported by the current PHP installation.
26
+* Install via composer and include `vendor/autoload.php`
27
+or
28
+* Just include the `autoload.php` file. This will automatically load the classes that are supported by the current PHP installation.
28 29
 
29 30
 
30 31
 ## Connecting
@@ -35,14 +36,14 @@ Create a connection array or object similar to this:
35 36
 <?php
36 37
 
37 38
 $params = array(
38
-	'type' => 'mysql',
39
-	'host' => 'localhost',
39
+	'type' => 'mysql', // mysql, pgsql, firebird, sqlite
40
+	'host' => 'localhost', // address or socket
40 41
 	'user' => 'root',
41 42
 	'pass' => '',
42 43
 	'port' => '3306',
43 44
 	'database' => 'test_db',
44 45
 
45
-	// Only required
46
+	// Only required for
46 47
 	// SQLite or Firebird
47 48
 	'file' => '/path/to/db/file',
48 49
 
@@ -81,9 +82,9 @@ Query('old')->query($sql);
81 82
 ```
82 83
 
83 84
 ### Running Queries
84
-Query uses the same interface as CodeIgniter's [Active Record class](http://ellislab.com/codeigniter/user-guide/database/active_record.html). However, it does not implement the `update_batch` or caching methods.
85
+Query uses the same interface as CodeIgniter's [Query Builder](http://www.codeigniter.com/user_guide/database/query_builder.html) class. However, it does not implement the `update_batch` or caching methods. For specific query builder methods, see the [class documentation](https://gitdev.timshomepage.net/Query/docs/classes/Query_QueryBuilder.html#methods).
85 86
 
86
-####You can also run queries manually.
87
+#### You can also run queries manually.
87 88
 
88 89
 To run a prepared statement, call
89 90
 `$db->prepare_execute($sql, $params)`.
@@ -105,7 +106,7 @@ $query = $db->select('id, key as k, val')
105 106
 	->get();
106 107
 ```
107 108
 
108
-This will generate a query similar to (with this being the output for a Postgres database):
109
+This will generate a query similar to (with this being the output for a PostgreSQL database):
109 110
 
110 111
 ```sql
111 112
 SELECT "id", "key" AS "k", "val"
@@ -117,7 +118,7 @@ LIMIT 3 OFFSET 1
117 118
 ```
118 119
 
119 120
 
120
-To retreive the results of a query, use the PDO method [fetch](http://php.net/manual/en/pdostatement.fetch.php) and/or [fetchAll](http://php.net/manual/en/pdostatement.fetchall.php).
121
+To retrieve the results of a query, use the PDO method [fetch](http://php.net/manual/en/pdostatement.fetch.php) and/or [fetchAll](http://php.net/manual/en/pdostatement.fetchall.php).
121 122
 
122 123
 ```php
123 124
 <?php
@@ -148,5 +149,5 @@ $query = $db->set('foo', 'bar')
148 149
 	->update('table');
149 150
 ```
150 151
 
151
-The `set` method can also take an array as a paramater, instead of setting individual values.
152
+The `set` method can also take an array as a parameter, instead of setting individual values.
152 153
 

+ 3
- 2
sonar-project.properties View File

@@ -1,6 +1,7 @@
1 1
 sonar.projectKey=query
2 2
 sonar.projectName=Query Builder
3
-sonar.projectVersion=1.0
3
+sonar.projectVersion=2.5.1
4 4
 sonar.sources=src
5
+sonar.language=php
5 6
 sonar.php.coverage.reportPath=build/logs/clover.xml
6
-#sonar.php.tests.reportPath=build/logs/junit.xml
7
+sonar.php.tests.reportPath=build/logs/junit.xml