Skip to content

Commit

Permalink
Merge pull request #178 from jackalope/1-to-2
Browse files Browse the repository at this point in the history
1 to 2
  • Loading branch information
dbu committed Nov 14, 2023
2 parents a451b61 + a9db261 commit da105b4
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 10 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----

Expand Down
15 changes: 14 additions & 1 deletion bin/jackrabbit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions src/Jackalope/Tools/Console/Helper/JackrabbitHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 1 addition & 3 deletions src/Jackalope/Transport/Jackrabbit/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion src/Jackalope/Transport/Jackrabbit/EventBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Jackalope\Transport\Jackrabbit;

use DOMElement;
use Jackalope\FactoryInterface;
use Jackalope\Observation\Event;
use Jackalope\Observation\EventFilter;
Expand Down
2 changes: 0 additions & 2 deletions src/Jackalope/Transport/Jackrabbit/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/ImplementationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down
1 change: 0 additions & 1 deletion tests/Jackalope/Transport/Jackrabbit/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ private function buildTransportMock($args = 'testuri', $changeMethods = [])
}

/**
* @param mixed $response
* @param string[] $changeMethods
*
* @return Request&MockObject
Expand Down

0 comments on commit da105b4

Please sign in to comment.