Changeset 730026
- Timestamp:
- 06/22/2013 04:06:04 PM (13 years ago)
- Location:
- json-api
- Files:
-
- 1 deleted
- 5 edited
- 36 copied
-
tags/1.1.0 (copied) (copied from json-api/trunk)
-
tags/1.1.0/controllers/core.php (copied) (copied from json-api/trunk/controllers/core.php)
-
tags/1.1.0/controllers/posts.php (copied) (copied from json-api/trunk/controllers/posts.php)
-
tags/1.1.0/json-api.php (copied) (copied from json-api/trunk/json-api.php) (1 diff)
-
tags/1.1.0/library/JSON.php (copied) (copied from json-api/trunk/library/JSON.php)
-
tags/1.1.0/models/attachment.php (copied) (copied from json-api/trunk/models/attachment.php)
-
tags/1.1.0/readme.txt (copied) (copied from json-api/trunk/readme.txt) (4 diffs)
-
tags/1.1.0/singletons/api.php (copied) (copied from json-api/trunk/singletons/api.php)
-
tags/1.1.0/singletons/introspector.php (copied) (copied from json-api/trunk/singletons/introspector.php) (2 diffs)
-
tags/1.1.0/singletons/query.php (copied) (copied from json-api/trunk/singletons/query.php)
-
tags/1.1.0/singletons/response.php (copied) (copied from json-api/trunk/singletons/response.php) (2 diffs)
-
tags/1.1.0/tests/core.get_author_index-01.phpt (copied) (copied from json-api/trunk/tests/core.get_author_index-01.phpt)
-
tags/1.1.0/tests/core.get_author_posts-01.phpt (copied) (copied from json-api/trunk/tests/core.get_author_posts-01.phpt)
-
tags/1.1.0/tests/core.get_author_posts-02.phpt (copied) (copied from json-api/trunk/tests/core.get_author_posts-02.phpt)
-
tags/1.1.0/tests/core.get_author_posts-03.phpt (copied) (copied from json-api/trunk/tests/core.get_author_posts-03.phpt)
-
tags/1.1.0/tests/core.get_author_posts-04.phpt (deleted)
-
tags/1.1.0/tests/core.get_category_index-01.phpt (copied) (copied from json-api/trunk/tests/core.get_category_index-01.phpt)
-
tags/1.1.0/tests/core.get_category_posts-01.phpt (copied) (copied from json-api/trunk/tests/core.get_category_posts-01.phpt)
-
tags/1.1.0/tests/core.get_date_index-01.phpt (copied) (copied from json-api/trunk/tests/core.get_date_index-01.phpt)
-
tags/1.1.0/tests/core.get_date_posts-01.phpt (copied) (copied from json-api/trunk/tests/core.get_date_posts-01.phpt)
-
tags/1.1.0/tests/core.get_date_posts-02.phpt (copied) (copied from json-api/trunk/tests/core.get_date_posts-02.phpt)
-
tags/1.1.0/tests/core.get_date_posts-03.phpt (copied) (copied from json-api/trunk/tests/core.get_date_posts-03.phpt)
-
tags/1.1.0/tests/core.get_page-01.phpt (copied) (copied from json-api/trunk/tests/core.get_page-01.phpt)
-
tags/1.1.0/tests/core.get_page-02.phpt (copied) (copied from json-api/trunk/tests/core.get_page-02.phpt)
-
tags/1.1.0/tests/core.get_post-01.phpt (copied) (copied from json-api/trunk/tests/core.get_post-01.phpt)
-
tags/1.1.0/tests/core.get_posts-01.phpt (copied) (copied from json-api/trunk/tests/core.get_posts-01.phpt)
-
tags/1.1.0/tests/core.get_posts-02.phpt (copied) (copied from json-api/trunk/tests/core.get_posts-02.phpt)
-
tags/1.1.0/tests/core.get_posts-03.phpt (copied) (copied from json-api/trunk/tests/core.get_posts-03.phpt)
-
tags/1.1.0/tests/core.get_recent_posts-01.phpt (copied) (copied from json-api/trunk/tests/core.get_recent_posts-01.phpt)
-
tags/1.1.0/tests/core.get_recent_posts-02.phpt (copied) (copied from json-api/trunk/tests/core.get_recent_posts-02.phpt)
-
tags/1.1.0/tests/core.get_recent_posts-03.phpt (copied) (copied from json-api/trunk/tests/core.get_recent_posts-03.phpt)
-
tags/1.1.0/tests/core.get_search_posts-01.phpt (copied) (copied from json-api/trunk/tests/core.get_search_posts-01.phpt)
-
tags/1.1.0/tests/core.get_tag_index-01.phpt (copied) (copied from json-api/trunk/tests/core.get_tag_index-01.phpt)
-
tags/1.1.0/tests/core.get_tag_posts-01.phpt (copied) (copied from json-api/trunk/tests/core.get_tag_posts-01.phpt)
-
tags/1.1.0/tests/core.info-01.phpt (copied) (copied from json-api/trunk/tests/core.info-01.phpt) (2 diffs)
-
tags/1.1.0/tests/core.info-02.phpt (copied) (copied from json-api/trunk/tests/core.info-02.phpt)
-
tags/1.1.0/tests/query-01.phpt (copied) (copied from json-api/trunk/tests/query-01.phpt)
-
trunk/json-api.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/singletons/introspector.php (modified) (2 diffs)
-
trunk/singletons/response.php (modified) (2 diffs)
-
trunk/tests/core.info-01.phpt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
json-api/tags/1.1.0/json-api.php
r729608 r730026 4 4 Plugin URI: http://wordpress.org/plugins/json-api/ 5 5 Description: A RESTful API for WordPress 6 Version: 1. 0.96 Version: 1.1.0 7 7 Author: Dan Phiffer 8 8 Author URI: http://phiffer.org/ -
json-api/tags/1.1.0/readme.txt
r729608 r730026 4 4 Tags: json, api, ajax, cms, admin, integration, moma 5 5 Requires at least: 2.8 6 Tested up to: 3.5. 17 Stable tag: 1. 0.96 Tested up to: 3.5.2 7 Stable tag: 1.1.0 8 8 9 9 A RESTful API for WordPress … … 690 690 * Setting `redirect_[status]` allows you to control the resulting browser redirection depending on the `status` value. 691 691 * Setting `dev` to a non-empty value adds whitespace for readability and responds with `text/plain` 692 * Setting `json_encode_options` will let you specify an integer bitmask to modify the behavior of [PHP's `json_encode`](http://php.net/manual/en/function.json-encode.php) 692 * Setting `json_encode_options` will let you specify an integer bitmask to modify the behavior of [PHP's `json_encode`](http://php.net/manual/en/function.json-encode.php) (Note: this option is only recognized in PHP version 5.3+) 693 693 * Setting `json_unescaped_unicode` will replace unicode-escaped characters with their unescaped equivalents (e.g., `\u00e1` becomes á) 694 694 * Omitting all of the above arguments will result in a standard JSON response. … … 1035 1035 == Changelog == 1036 1036 1037 = 1.1.0 (2013-06-22): = 1038 * Bugfix for `json_encode` compatibility with PHP < 5.3 1039 * Bugfix for `get_author_index` warnings in WordPress > 3.5 1040 1037 1041 = 1.0.9 (2013-06-21): = 1038 1042 * Added `update_post` and `delete_post` methods to Post controller … … 1159 1163 == Upgrade Notice == 1160 1164 1165 = 1.1.0 = 1166 Minor bugfixes 1167 1161 1168 = 1.0.9 = 1162 1169 Update/delete post methods and some other bugfixes and improvements -
json-api/tags/1.1.0/singletons/introspector.php
r729608 r730026 172 172 public function get_authors() { 173 173 global $wpdb; 174 $author_ids = $wpdb->get_col( $wpdb->prepare("174 $author_ids = $wpdb->get_col(" 175 175 SELECT u.ID, m.meta_value AS last_name 176 176 FROM $wpdb->users AS u, … … 179 179 AND m.meta_key = 'last_name' 180 180 ORDER BY last_name 181 ") );181 "); 182 182 $all_authors = array_map(array(&$this, 'get_author_by_id'), $author_ids); 183 183 $active_authors = array_filter($all_authors, array(&$this, 'is_active_author')); -
json-api/tags/1.1.0/singletons/response.php
r729608 r730026 34 34 if (function_exists('json_encode')) { 35 35 // Use the built-in json_encode function if it's available 36 $json_encode_options = 0; 37 if ($json_api->query->json_encode_options) { 38 $json_encode_options = $json_api->query->json_encode_options; 39 } 40 $json = json_encode($data, $json_encode_options); 36 if (version_compare(PHP_VERSION, '5.3') < 0) { 37 $json = json_encode($data); 38 } else { 39 $json_encode_options = 0; 40 if ($json_api->query->json_encode_options) { 41 $json_encode_options = $json_api->query->json_encode_options; 42 } 43 $json = json_encode($data, $json_encode_options); 44 } 41 45 } else { 42 46 // Use PEAR's Services_JSON encoder otherwise … … 49 53 } 50 54 55 // Thanks to Stack Overflow user Gumbo stackoverflow.com/questions/2934563 51 56 if ($json_api->query->json_unescaped_unicode) { 52 57 $callback = array($this, 'replace_unicode_escape_sequence'); -
json-api/tags/1.1.0/tests/core.info-01.phpt
r725741 r730026 11 11 12 12 echo "Response status: $response->status\n"; 13 echo "Version: $response->json_api_version\n";14 13 echo "Controllers:\n"; 15 14 var_dump($response->controllers); … … 18 17 --EXPECT-- 19 18 Response status: ok 20 Version: 1.0.821 19 Controllers: 22 20 array(4) { -
json-api/trunk/json-api.php
r729608 r730026 4 4 Plugin URI: http://wordpress.org/plugins/json-api/ 5 5 Description: A RESTful API for WordPress 6 Version: 1. 0.96 Version: 1.1.0 7 7 Author: Dan Phiffer 8 8 Author URI: http://phiffer.org/ -
json-api/trunk/readme.txt
r729608 r730026 4 4 Tags: json, api, ajax, cms, admin, integration, moma 5 5 Requires at least: 2.8 6 Tested up to: 3.5. 17 Stable tag: 1. 0.96 Tested up to: 3.5.2 7 Stable tag: 1.1.0 8 8 9 9 A RESTful API for WordPress … … 690 690 * Setting `redirect_[status]` allows you to control the resulting browser redirection depending on the `status` value. 691 691 * Setting `dev` to a non-empty value adds whitespace for readability and responds with `text/plain` 692 * Setting `json_encode_options` will let you specify an integer bitmask to modify the behavior of [PHP's `json_encode`](http://php.net/manual/en/function.json-encode.php) 692 * Setting `json_encode_options` will let you specify an integer bitmask to modify the behavior of [PHP's `json_encode`](http://php.net/manual/en/function.json-encode.php) (Note: this option is only recognized in PHP version 5.3+) 693 693 * Setting `json_unescaped_unicode` will replace unicode-escaped characters with their unescaped equivalents (e.g., `\u00e1` becomes á) 694 694 * Omitting all of the above arguments will result in a standard JSON response. … … 1035 1035 == Changelog == 1036 1036 1037 = 1.1.0 (2013-06-22): = 1038 * Bugfix for `json_encode` compatibility with PHP < 5.3 1039 * Bugfix for `get_author_index` warnings in WordPress > 3.5 1040 1037 1041 = 1.0.9 (2013-06-21): = 1038 1042 * Added `update_post` and `delete_post` methods to Post controller … … 1159 1163 == Upgrade Notice == 1160 1164 1165 = 1.1.0 = 1166 Minor bugfixes 1167 1161 1168 = 1.0.9 = 1162 1169 Update/delete post methods and some other bugfixes and improvements -
json-api/trunk/singletons/introspector.php
r729608 r730026 172 172 public function get_authors() { 173 173 global $wpdb; 174 $author_ids = $wpdb->get_col( $wpdb->prepare("174 $author_ids = $wpdb->get_col(" 175 175 SELECT u.ID, m.meta_value AS last_name 176 176 FROM $wpdb->users AS u, … … 179 179 AND m.meta_key = 'last_name' 180 180 ORDER BY last_name 181 ") );181 "); 182 182 $all_authors = array_map(array(&$this, 'get_author_by_id'), $author_ids); 183 183 $active_authors = array_filter($all_authors, array(&$this, 'is_active_author')); -
json-api/trunk/singletons/response.php
r729608 r730026 34 34 if (function_exists('json_encode')) { 35 35 // Use the built-in json_encode function if it's available 36 $json_encode_options = 0; 37 if ($json_api->query->json_encode_options) { 38 $json_encode_options = $json_api->query->json_encode_options; 39 } 40 $json = json_encode($data, $json_encode_options); 36 if (version_compare(PHP_VERSION, '5.3') < 0) { 37 $json = json_encode($data); 38 } else { 39 $json_encode_options = 0; 40 if ($json_api->query->json_encode_options) { 41 $json_encode_options = $json_api->query->json_encode_options; 42 } 43 $json = json_encode($data, $json_encode_options); 44 } 41 45 } else { 42 46 // Use PEAR's Services_JSON encoder otherwise … … 49 53 } 50 54 55 // Thanks to Stack Overflow user Gumbo stackoverflow.com/questions/2934563 51 56 if ($json_api->query->json_unescaped_unicode) { 52 57 $callback = array($this, 'replace_unicode_escape_sequence'); -
json-api/trunk/tests/core.info-01.phpt
r725741 r730026 11 11 12 12 echo "Response status: $response->status\n"; 13 echo "Version: $response->json_api_version\n";14 13 echo "Controllers:\n"; 15 14 var_dump($response->controllers); … … 18 17 --EXPECT-- 19 18 Response status: ok 20 Version: 1.0.821 19 Controllers: 22 20 array(4) {
Note: See TracChangeset
for help on using the changeset viewer.