* Uploaded Integrations */
($path_to_integrations)
| 4 | * Uploaded Integrations |
| 5 | */ |
| 6 | function uploaded_integrations($path_to_integrations){ |
| 7 | |
| 8 | // List all uploaded integrations. |
| 9 | $integration_folders = array_diff(scandir($path_to_integrations), array('..', '.')); |
| 10 | $uploaded_integrations = []; |
| 11 | foreach ($integration_folders as $integration_folder){ |
| 12 | |
| 13 | // Exclude certain files or folders |
| 14 | $excluded_items = array('.DS_Store'); |
| 15 | |
| 16 | // Create URI from folder name. |
| 17 | if(!in_array($integration_folder, $excluded_items)){ |
| 18 | array_push( |
| 19 | $uploaded_integrations, |
| 20 | array( |
| 21 | 'uri' => $integration_folder |
| 22 | ) |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | return $uploaded_integrations; |
| 28 | |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Get Integration Meta |