diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a91e100b..980c0cf1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,6 +20,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 + with: + submodules: recursive - name: Build - Install run: ./build_install.sh @@ -56,4 +58,3 @@ jobs: ssh-keyscan ${{ secrets.PTC_PROD_HOSTNAME }} >> ~/.ssh/known_hosts scp -i ./deploy_key ${{ env.PTC_PLUGIN_ZIP_FILE }} ${{ env.remote }}:${{ env.destination }} ssh -i ./deploy_key ${{ env.remote }} 'chmod 775 ${{ env.destination }}; chgrp www-data ${{ env.destination }}' || true - \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..a7fb6e23 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "php-asana"] + path = php-asana + url = https://github.com/PurpleTurtleCreative/php-asana.git diff --git a/build_install.sh b/build_install.sh index 6561ad68..d621bfe1 100755 --- a/build_install.sh +++ b/build_install.sh @@ -1,6 +1,15 @@ #!/bin/bash +# Currently, only dev dependencies are included, +# so installation is unnecessary. +# composer install --optimize-autoloader --no-dev + +# Install our own fork of Asana's PHP SDK because +# they haven't pushed updates in a very long time +# and we include our own repairs for PHP 8 compatibility. +pushd php-asana composer install --optimize-autoloader --no-dev +popd npm ci --no-audit npm run build diff --git a/composer.json b/composer.json index b3d3b7ce..f314f346 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,4 @@ { - "require": { - "asana/asana": "1.0.6" - }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "phpcompatibility/phpcompatibility-wp": "^2.1", diff --git a/composer.lock b/composer.lock index 0dbcfcc6..6685ae46 100644 --- a/composer.lock +++ b/composer.lock @@ -4,152 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5e078dce4e77ea47c96a3ede7f89f771", - "packages": [ - { - "name": "adoy/oauth2", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/adoy/PHP-OAuth2.git", - "reference": "2f28fc76ad5ad6974333eaf84a3d05164f2ed586" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/adoy/PHP-OAuth2/zipball/2f28fc76ad5ad6974333eaf84a3d05164f2ed586", - "reference": "2f28fc76ad5ad6974333eaf84a3d05164f2ed586", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "OAuth2": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Charron Pierrick", - "email": "pierrick@webstart.fr" - }, - { - "name": "Berejeb Anis", - "email": "anis.berejeb@gmail.com" - } - ], - "description": "Light PHP wrapper for the OAuth 2.0 protocol (based on OAuth 2.0 Authorization Protocol draft-ietf-oauth-v2-15)", - "support": { - "issues": "https://github.com/adoy/PHP-OAuth2/issues", - "source": "https://github.com/adoy/PHP-OAuth2/tree/1.3.1" - }, - "time": "2023-03-10T14:58:54+00:00" - }, - { - "name": "asana/asana", - "version": "v1.0.6", - "source": { - "type": "git", - "url": "https://github.com/Asana/php-asana.git", - "reference": "0ef547b7cb9c3964604c3fa81cf9210e0d48a686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Asana/php-asana/zipball/0ef547b7cb9c3964604c3fa81cf9210e0d48a686", - "reference": "0ef547b7cb9c3964604c3fa81cf9210e0d48a686", - "shasum": "" - }, - "require": { - "adoy/oauth2": "^1.2.0", - "nategood/httpful": "~0.2", - "php": ">=5.4.0" - }, - "require-dev": { - "instaclick/php-code-sniffer": "dev-master", - "phpunit/phpunit": "^9" - }, - "type": "library", - "autoload": { - "psr-0": { - "Asana\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP client for the Asana API", - "homepage": "https://github.com/Asana/php-asana", - "keywords": [ - "asana", - "client" - ], - "support": { - "issues": "https://github.com/Asana/php-asana/issues", - "source": "https://github.com/Asana/php-asana/tree/v1.0.6" - }, - "time": "2023-03-03T23:55:29+00:00" - }, - { - "name": "nategood/httpful", - "version": "0.3.2", - "source": { - "type": "git", - "url": "https://github.com/nategood/httpful.git", - "reference": "0cded3ea97ba905600de9ceb9ef13f3ab681587c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nategood/httpful/zipball/0cded3ea97ba905600de9ceb9ef13f3ab681587c", - "reference": "0cded3ea97ba905600de9ceb9ef13f3ab681587c", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "Httpful": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nate Good", - "email": "me@nategood.com", - "homepage": "http://nategood.com" - } - ], - "description": "A Readable, Chainable, REST friendly, PHP HTTP Client", - "homepage": "http://github.com/nategood/httpful", - "keywords": [ - "api", - "curl", - "http", - "requests", - "rest", - "restful" - ], - "support": { - "issues": "https://github.com/nategood/httpful/issues", - "source": "https://github.com/nategood/httpful/tree/v0.3.2" - }, - "time": "2020-01-25T01:13:13+00:00" - } - ], + "content-hash": "5d4ef1019a9a67a035d264a924e00015", + "packages": [], "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -811,5 +667,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/php-asana b/php-asana new file mode 160000 index 00000000..369e2f42 --- /dev/null +++ b/php-asana @@ -0,0 +1 @@ +Subproject commit 369e2f428909b25479f45fecb5d8a14ba1f0864c diff --git a/src/includes/class-autoloader.php b/src/includes/class-autoloader.php index c1ebbf65..5e139161 100644 --- a/src/includes/class-autoloader.php +++ b/src/includes/class-autoloader.php @@ -80,7 +80,7 @@ class Autoloader { */ public static function register() { // Autoload third-party dependencies. - require_once PLUGIN_PATH . '/vendor/autoload.php'; + require_once PLUGIN_PATH . '/php-asana/vendor/autoload.php'; // Autoload our own class files. spl_autoload_register( __CLASS__ . '::load_class_file' ); }