diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 55f0a4fd..d54a4dfd 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -11,7 +11,7 @@ on: jobs: test: name: 'PHP ${{ matrix.php-version }} ${{ matrix.dependencies }}' - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -24,11 +24,26 @@ jobs: - php-version: '8.0' - php-version: '8.1' - php-version: '8.2' + - php-version: '8.3' steps: - name: Checkout project uses: actions/checkout@v3 + - name: Cache Jackrabbit + id: cache-jackrabbit + uses: actions/cache@v3 + with: + path: bin/jackrabbit-standalone-* + key: jackrabbit + + # default java installation not able to run newer versions of jackrabbit + - name: Install and configure Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: '8' + - name: Install and configure PHP uses: shivammathur/setup-php@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index bc61f691..34732043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,16 @@ Version 2 Version 1 ========= +1.4.6 +----- + +* Revert BC break with the command return type declarations. + +1.4.5 +----- + +* Improved the bin/jackrabbit.sh script to detect when the .jar fails to be started. + 1.4.4 ----- diff --git a/bin/jackrabbit.sh b/bin/jackrabbit.sh index d59116ed..c4e5077f 100755 --- a/bin/jackrabbit.sh +++ b/bin/jackrabbit.sh @@ -9,16 +9,29 @@ JAR=jackrabbit-standalone-$VERSION.jar # download jackrabbit jar from archive, as the dist only contains the latest # stable versions if [ ! -f "$DIR/$JAR" ]; then - wget http://archive.apache.org/dist/jackrabbit/$VERSION/$JAR + wget -nv http://archive.apache.org/dist/jackrabbit/$VERSION/$JAR fi java -jar $DIR/$JAR& +pid=$! +echo "started prodcess $pid" echo "Waiting until Jackrabbit is ready on port 8080" while [[ -z `curl -s 'http://localhost:8080' ` ]] do echo -n "." sleep 2s + count=$(ps | grep "$pid[^[]" | wc -l) + if [[ $count -eq 0 ]] + then + echo "process $pid not found, waiting on it to determine exit status" + if wait $pid; then + echo "jackrabbit terminated with success status (this should not happen)" + else + echo "jackrabbit failed (returned $?)" + fi + exit 1 + fi done echo "Jackrabbit is up" diff --git a/src/Jackalope/Tools/Console/Helper/JackrabbitHelper.php b/src/Jackalope/Tools/Console/Helper/JackrabbitHelper.php index 9f4225f3..307579dc 100644 --- a/src/Jackalope/Tools/Console/Helper/JackrabbitHelper.php +++ b/src/Jackalope/Tools/Console/Helper/JackrabbitHelper.php @@ -65,6 +65,7 @@ public function isServerRunning(): bool public function getServerPid(): string { $pid = trim(shell_exec("pgrep -f -n 'java \-jar {$this->jackrabbit_jar}'")); + // TODO: check it's a valid pid return $pid; } diff --git a/src/Jackalope/Transport/Jackrabbit/Client.php b/src/Jackalope/Transport/Jackrabbit/Client.php index fd7f0fcc..aab071ce 100644 --- a/src/Jackalope/Transport/Jackrabbit/Client.php +++ b/src/Jackalope/Transport/Jackrabbit/Client.php @@ -1266,8 +1266,6 @@ private function createNodeJsop(string $path, iterable $properties): void /** * This method is used when building a JSOP of the properties. - * - * @return mixed */ private function propertyToJsopString(Property $property) { @@ -1424,7 +1422,7 @@ public function getPermissions($path): array return $result; } - public function lockNode(string $absPath, bool $isDeep, bool $isSessionScoped, int $timeoutHint = PHP_INT_MAX, ?string $ownerInfo = null): LockInterface + public function lockNode(string $absPath, bool $isDeep, bool $isSessionScoped, int $timeoutHint = PHP_INT_MAX, string $ownerInfo = null): LockInterface { $timeout = PHP_INT_MAX === $timeoutHint ? 'infinite' : $timeoutHint; $ownerInfo = $ownerInfo ?? $this->credentials->getUserID(); diff --git a/src/Jackalope/Transport/Jackrabbit/EventBuffer.php b/src/Jackalope/Transport/Jackrabbit/EventBuffer.php index 726f9443..31e9cac2 100644 --- a/src/Jackalope/Transport/Jackrabbit/EventBuffer.php +++ b/src/Jackalope/Transport/Jackrabbit/EventBuffer.php @@ -2,7 +2,6 @@ namespace Jackalope\Transport\Jackrabbit; -use DOMElement; use Jackalope\FactoryInterface; use Jackalope\Observation\Event; use Jackalope\Observation\EventFilter; diff --git a/src/Jackalope/Transport/Jackrabbit/curl.php b/src/Jackalope/Transport/Jackrabbit/curl.php index 323de400..78d52c7f 100644 --- a/src/Jackalope/Transport/Jackrabbit/curl.php +++ b/src/Jackalope/Transport/Jackrabbit/curl.php @@ -47,8 +47,6 @@ public function __construct(string $url = null) /** * Sets the options to be used for the request. * - * @param mixed $value - * * @see curl_setopt */ public function setopt(int $option, $value): bool diff --git a/tests/ImplementationLoader.php b/tests/ImplementationLoader.php index f3c60414..699e4f67 100644 --- a/tests/ImplementationLoader.php +++ b/tests/ImplementationLoader.php @@ -5,7 +5,7 @@ */ class ImplementationLoader extends \PHPCR\Test\AbstractLoader { - private static $instance = null; + private static $instance; private $necessaryConfigValues = ['jackrabbit.uri', 'phpcr.user', 'phpcr.pass', 'phpcr.workspace', 'phpcr.additionalWorkspace', 'phpcr.defaultWorkspace']; diff --git a/tests/Jackalope/Transport/Jackrabbit/ClientTest.php b/tests/Jackalope/Transport/Jackrabbit/ClientTest.php index 59810984..02fb2397 100644 --- a/tests/Jackalope/Transport/Jackrabbit/ClientTest.php +++ b/tests/Jackalope/Transport/Jackrabbit/ClientTest.php @@ -46,7 +46,6 @@ private function buildTransportMock($args = 'testuri', $changeMethods = []) } /** - * @param mixed $response * @param string[] $changeMethods * * @return Request&MockObject