Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
- check_mongodb_lib_version
- run_test

test-replica-set:
test-replica-set-mongo:
parameters:
mongo_version: { type: string }
docker:
Expand Down Expand Up @@ -153,12 +153,16 @@ workflows:
jobs:
- lint
- test:
name: test-php74
php_version: php74
mongo_version: 4.0.28
mongo_version: "4.2"
matrix:
parameters:
php_version:
- php74
- php84
- php85
- test-multiple-stores
- test-replica-set-mmap
- test-replica-set:
- test-replica-set-mongo:
matrix:
parameters:
mongo_version:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags
atlassian-ide-plugin.xml

composer.lock
docker-compose.override.yml
profiler
test-results
.phpunit.result.cache
Expand Down
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@
->ignoreVCSIgnored(true)
->ignoreDotFiles(false)
->notPath('rector.php')
->notPath('test/unit/mongo/mocks')
);
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Quickstart
require_once("tripod.inc.php");

// Queue worker must register these event listeners
Resque_Event::listen('beforePerform', [\Tripod\Mongo\Jobs\JobBase::class, 'beforePerform']);
Resque_Event::listen('onFailure', [\Tripod\Mongo\Jobs\JobBase::class, 'onFailure']);
Resque\Event::listen('beforePerform', [\Tripod\Mongo\Jobs\JobBase::class, 'beforePerform']);
Resque\Event::listen('onFailure', [\Tripod\Mongo\Jobs\JobBase::class, 'onFailure']);

\Tripod\Config::setConfig($conf); // set the config, usually read in as JSON from a file

Expand Down
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@
"resque/php-resque": "Redis backed library for background jobs"
},
"require": {
"php" : ">=7.4",
"php": ">=7.4",
"ext-mongodb": ">=1.7.0",
"mongodb/mongodb": "*",
"monolog/monolog" : "~1.13",
"semsol/arc2": "2.2.6"
"psr/log": "*",
"semsol/arc2": "^2.2.6 || ^3.1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6.20",
"resque/php-resque": "v1.3.6",
"resque/php-resque": "v1.3.6 || dev-develop",
"friendsofphp/php-cs-fixer": "^3.4",
"perftools/php-profiler": "^1.2",
"phpstan/phpstan": "^2.1"
"phpstan/phpstan": "^2.1",
"monolog/monolog": "^2.11 || ^3.10"
},
"autoload": {
"classmap": ["src/"]
"classmap": ["src/"],
"exclude-from-classmap": ["src/resque/compat.inc.php"]
},
"autoload-dev": {
"classmap": ["test/"]
Expand Down
26 changes: 26 additions & 0 deletions docker-compose.php-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# An override file to allow using separate vendor directories for each PHP version.
# Usage:
# 1. Create the directories and composer.lock files for each PHP version:
# mkdir -p docker/{php74,php84,php85}/vendor
# echo '{}' > docker/{php74,php84,php85}/composer.lock
# 2. Run the desired PHP version with the appropriate vendor directory:
# docker compose -f docker-compose.yml -f docker-compose.php-versions.yml run --rm -it php84

services:
php74:
volumes:
- ./docker/php74/vendor:/var/tripod-php/vendor
- ./docker/php74/composer.lock:/var/tripod-php/composer.lock

php84:
volumes:
- ./docker/php84/vendor:/var/tripod-php/vendor
- ./docker/php84/composer.lock:/var/tripod-php/composer.lock

php85:
volumes:
- ./docker/php85/vendor:/var/tripod-php/vendor
- ./docker/php85/composer.lock:/var/tripod-php/composer.lock

mongodb2:
image: mongo:4.4
18 changes: 16 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,26 @@ services:
php74:
build:
context: ./docker
dockerfile: Dockerfile-php74
dockerfile: php74.Dockerfile
image: talis/tripod-php:php74-latest
<<: *base-config

php84:
build:
context: ./docker
dockerfile: php84.Dockerfile
image: talis/tripod-php:php84-latest
<<: *base-config

php85:
build:
context: ./docker
dockerfile: php85.Dockerfile
image: talis/tripod-php:php85-latest
<<: *base-config

mongodb:
image: mongo:3.6.23
image: mongo:4.0

redis:
image: valkey/valkey:8-alpine
File renamed without changes.
18 changes: 18 additions & 0 deletions docker/php84.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM php:8.4.19-cli

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sLo /tmp/mongosh.deb https://downloads.mongodb.com/compass/mongodb-mongosh_2.6.0_amd64.deb \
&& dpkg -i /tmp/mongosh.deb \
&& rm /tmp/mongosh.deb

COPY --from=mlocati/php-extension-installer:2.10.6 /usr/bin/install-php-extensions /usr/local/bin/
COPY --from=composer:2.9.5 /usr/bin/composer /usr/local/bin/

RUN IPE_ICU_EN_ONLY=1 install-php-extensions pcntl mongodb-1.19.4 xhprof
18 changes: 18 additions & 0 deletions docker/php85.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM php:8.5.4-cli

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sLo /tmp/mongosh.deb https://downloads.mongodb.com/compass/mongodb-mongosh_2.6.0_amd64.deb \
&& dpkg -i /tmp/mongosh.deb \
&& rm /tmp/mongosh.deb

COPY --from=mlocati/php-extension-installer:2.10.6 /usr/bin/install-php-extensions /usr/local/bin/
COPY --from=composer:2.9.5 /usr/bin/composer /usr/local/bin/

RUN IPE_ICU_EN_ONLY=1 install-php-extensions pcntl mongodb-2.2.1 xhprof
10 changes: 5 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
parameters:
level: 6
phpVersion:
min: 70400 # PHP 7.4
max: 80419 # PHP 8.4.19
bootstrapFiles:
- src/resque/compat.inc.php
tips:
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '#Access to undefined constant MongoDB\\Driver\\ReadPreference\:\:RP_.*#'
- '#Call to an undefined method MongoDB\\Driver\\ReadPreference\:\:getMode\(\)#'
- identifier: missingType.iterableValue
reportUnmatched: false
paths:
- src
- test
excludePaths:
- src/resque/compat.inc.php
- test/unit/mongo/mocks
5 changes: 2 additions & 3 deletions scripts/mongo/worker.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
require_once __DIR__ . '/../../src/tripod.inc.php';

// the global is necessary for Resque worker to send statements to
$logger = new Logger('TRIPOD-WORKER');
$logger->pushHandler(new StreamHandler('php://stderr', LogLevel::WARNING)); // resque too chatty on NOTICE & INFO. YMMV
$logger = new Logger('TRIPOD-WORKER', [new StreamHandler('php://stderr', LogLevel::NOTICE)]);

// this is so tripod itself uses the same logger
DriverBase::$logger = new Logger('TRIPOD-JOB', [new StreamHandler('php://stderr', LogLevel::DEBUG)]);
DriverBase::$logger = $logger;
2 changes: 1 addition & 1 deletion src/classes/ChangeSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct(array $a)
$parser->parse(false, $a[$rdf]);
$a[$rdf] = $parser->getSimpleIndex(0);
} elseif (
is_array($a[$rdf]) && isset($a[$rdf][0], $a[$rdf][0]['s'])
is_array($a[$rdf]) && isset($a[$rdf][0]['s'])
) { // triples array
/** @var \ARC2_RDFSerializer $ser */
$ser = \ARC2::getTurtleSerializer();
Expand Down
5 changes: 0 additions & 5 deletions src/classes/ExtendedGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ public function __construct($graph = null)
}
}

public function __destruct()
{
unset($this->_index);
}

/**
* Map a portion of a URI to a short prefix for use when serialising the graph.
*
Expand Down
Loading