Changeset 2414079
- Timestamp:
- 11/06/2020 08:33:16 PM (5 years ago)
- Location:
- quant
- Files:
-
- 43 added
- 2 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/quant.php (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/src (added)
-
tags/1.0.2/src/App.php (added)
-
tags/1.0.2/src/Client.php (added)
-
tags/1.0.2/src/Field.php (added)
-
tags/1.0.2/src/Settings.php (added)
-
tags/1.0.2/src/SettingsScreen.php (added)
-
tags/1.0.2/src/functions.php (added)
-
tags/1.0.2/src/seed (added)
-
tags/1.0.2/src/seed/ArchivesBatch.php (added)
-
tags/1.0.2/src/seed/CategoryBatch.php (added)
-
tags/1.0.2/src/seed/CustomCronRoutesBatch.php (added)
-
tags/1.0.2/src/seed/CustomRoutesBatch.php (added)
-
tags/1.0.2/src/seed/HomeBatch.php (added)
-
tags/1.0.2/src/seed/PageBatch.php (added)
-
tags/1.0.2/src/seed/PostBatch.php (added)
-
tags/1.0.2/src/seed/TagBatch.php (added)
-
tags/1.0.2/src/seed/ThemeAssetsBatch.php (added)
-
tags/1.0.2/uninstall.php (added)
-
tags/1.0.2/wp-batch-processing (added)
-
tags/1.0.2/wp-batch-processing/README.md (added)
-
tags/1.0.2/wp-batch-processing/assets (added)
-
tags/1.0.2/wp-batch-processing/assets/processor.js (added)
-
tags/1.0.2/wp-batch-processing/changelog.txt (added)
-
tags/1.0.2/wp-batch-processing/examples (added)
-
tags/1.0.2/wp-batch-processing/examples/class-example-batch.php (added)
-
tags/1.0.2/wp-batch-processing/examples/processing.gif (added)
-
tags/1.0.2/wp-batch-processing/includes (added)
-
tags/1.0.2/wp-batch-processing/includes/class-batch-ajax-handler.php (added)
-
tags/1.0.2/wp-batch-processing/includes/class-batch-item.php (added)
-
tags/1.0.2/wp-batch-processing/includes/class-batch-list-table.php (added)
-
tags/1.0.2/wp-batch-processing/includes/class-batch-processor-admin.php (added)
-
tags/1.0.2/wp-batch-processing/includes/class-batch-processor.php (added)
-
tags/1.0.2/wp-batch-processing/includes/class-batch.php (added)
-
tags/1.0.2/wp-batch-processing/includes/class-bp-helper.php (added)
-
tags/1.0.2/wp-batch-processing/includes/class-bp-singleton.php (added)
-
tags/1.0.2/wp-batch-processing/views (added)
-
tags/1.0.2/wp-batch-processing/views/batch-list.php (added)
-
tags/1.0.2/wp-batch-processing/views/batch-manage.php (added)
-
tags/1.0.2/wp-batch-processing/views/batch-view.php (added)
-
tags/1.0.2/wp-batch-processing/wp-batch-processing.php (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Client.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
quant/trunk/readme.txt
r2411431 r2414079 6 6 Tested up to: 5.5.1 7 7 Requires PHP: 7.2 8 Stable tag: 1.0. 18 Stable tag: 1.0.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 48 48 == Changelog == 49 49 50 = 1.0.2 = 51 * Performance improvement with added concurrency. 52 50 53 = 1.0.1 = 51 54 * Added support for QuantSearch. -
quant/trunk/src/Client.php
r2411426 r2414079 123 123 */ 124 124 public function sendAttachments($media) { 125 $attachments = []; 125 126 126 127 foreach ($media as $item) { … … 143 144 144 145 if (file_exists(ABSPATH . $file)) { 145 $ this->file($file, ABSPATH . $file);146 $attachments[] = $file; 146 147 } 147 148 } 148 } 149 150 $this->multipleFiles($attachments); 151 } 152 153 154 /** 155 * Send multiple files in parallel to Quant API. 156 * 157 * @param array $files 158 * Array of files to send in parallel. 159 */ 160 public function multipleFiles($files) { 161 162 $headers = $this->headers; 163 $headers['Content-type'] = 'application/binary'; 164 165 $requests = []; 166 167 foreach ($files as $file) { 168 $headers['Quant-File-Url'] = $file; 169 $path = ABSPATH . $file; 170 171 $requests[] = [ 172 'url' => $this->endpoint . '/file-upload?path=' . $path, 173 'type' => 'POST', 174 'headers' => $headers, 175 ]; 176 } 177 178 // Register hook to alter curl opts on each handle. 179 $hooks = new \Requests_Hooks(); 180 $hooks->register('curl.before_multi_add', function(&$data) { 181 quant_attach_file($data); 182 }); 183 184 $options = [ 185 'hooks' => $hooks, 186 ]; 187 188 $requests = \Requests::request_multiple($requests, $options); 189 } 190 149 191 150 192 /**
Note: See TracChangeset
for help on using the changeset viewer.