-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:oat-sa/generis into feature/adf-…
…1590/optimize-permissions-task-queue
- Loading branch information
Showing
52 changed files
with
4,137 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Sonarqube_CI | ||
on: | ||
|
||
push: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
|
||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Sonarqube_CI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Sonarqube scan | ||
uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
|
||
# Job will fail when the Quality Gate is red | ||
- name: Sonarqube quality gate check | ||
id: sonarqube-quality-gate-check | ||
uses: sonarsource/sonarqube-quality-gate-action@master | ||
timeout-minutes: 5 | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
|
||
- name: "Example show SonarQube Quality Gate Status value" | ||
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; under version 2 | ||
* of the License (non-upgradable). | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright (c) 2023 (original work) Open Assessment Technologies SA ; | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use Laudis\Neo4j\Contracts\ClientInterface; | ||
use Laudis\Neo4j\Databags\Statement; | ||
|
||
class common_persistence_GraphPersistence extends common_persistence_Persistence | ||
{ | ||
public function run(string $statement, iterable $parameters = []) | ||
{ | ||
/** @var ClientInterface $client */ | ||
$client = $this->getDriver()->getClient(); | ||
|
||
return $client->run($statement, $parameters); | ||
} | ||
|
||
public function runStatement(Statement $statement) | ||
{ | ||
/** @var ClientInterface $client */ | ||
$client = $this->getDriver()->getClient(); | ||
|
||
return $client->runStatement($statement); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; under version 2 | ||
* of the License (non-upgradable). | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* Copyright (c) 2023 (original work) Open Assessment Technologies SA ; | ||
*/ | ||
|
||
use Laudis\Neo4j\Authentication\Authenticate; | ||
use Laudis\Neo4j\ClientBuilder; | ||
use Laudis\Neo4j\Contracts\ClientInterface; | ||
|
||
class common_persistence_PhpNeo4jDriver implements common_persistence_Driver | ||
{ | ||
private ClientInterface $client; | ||
|
||
public function connect($id, array $params): common_persistence_Persistence | ||
{ | ||
$auth = Authenticate::basic($params['user'], $params['password']); | ||
|
||
$this->client = ClientBuilder::create() | ||
->withDriver('bolt', sprintf('bolt://%s', $params['host']), $auth) | ||
->withDefaultDriver('bolt') | ||
->build(); | ||
|
||
return new common_persistence_GraphPersistence($params, $this); | ||
} | ||
|
||
public function getClient(): ?ClientInterface | ||
{ | ||
return $this->client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace oat\generis\model\kernel\persistence; | ||
|
||
class Filter | ||
{ | ||
protected string $key; | ||
|
||
/** @var string|object */ | ||
protected $value; | ||
|
||
protected string $operator; | ||
|
||
protected array $orConditionValues = []; | ||
|
||
/** | ||
* @param string $key | ||
* @param string|object $value | ||
* @param string $operator | ||
* @param array $orConditionValues | ||
*/ | ||
public function __construct(string $key, $value, string $operator, array $orConditionValues = []) | ||
{ | ||
$this->key = $key; | ||
$this->value = $value; | ||
$this->operator = $operator; | ||
$this->orConditionValues = $orConditionValues; | ||
} | ||
|
||
public function getKey(): string | ||
{ | ||
return $this->key; | ||
} | ||
|
||
/** | ||
* @return string|object | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
|
||
public function getOperator(): string | ||
{ | ||
return $this->operator; | ||
} | ||
|
||
public function getOrConditionValues(): array | ||
{ | ||
return $this->orConditionValues; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.