Skip to content

Commit

Permalink
Merge Development Branch v2.1.2 (#21)
Browse files Browse the repository at this point in the history
* Fixes environment default

* Bump clue/ndjson-react from 1.1.0 to 1.2.0

Bumps [clue/ndjson-react](https://github.com/clue/reactphp-ndjson) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/clue/reactphp-ndjson/releases)
- [Changelog](https://github.com/clue/reactphp-ndjson/blob/master/CHANGELOG.md)
- [Commits](clue/reactphp-ndjson@v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: clue/ndjson-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump cache/array-adapter from 1.0.1 to 1.1.0

Bumps [cache/array-adapter](https://github.com/php-cache/array-adapter) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/php-cache/array-adapter/releases)
- [Changelog](https://github.com/php-cache/array-adapter/blob/master/Changelog.md)
- [Commits](php-cache/array-adapter@1.0.1...1.1.0)

---
updated-dependencies:
- dependency-name: cache/array-adapter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump monolog/monolog from 2.3.2 to 2.3.4

Bumps [monolog/monolog](https://github.com/Seldaek/monolog) from 2.3.2 to 2.3.4.
- [Release notes](https://github.com/Seldaek/monolog/releases)
- [Changelog](https://github.com/Seldaek/monolog/blob/main/CHANGELOG.md)
- [Commits](Seldaek/monolog@2.3.2...2.3.4)

---
updated-dependencies:
- dependency-name: monolog/monolog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump cache/namespaced-cache from 1.0.0 to 1.1.0

Bumps [cache/namespaced-cache](https://github.com/php-cache/namespaced-cache) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/php-cache/namespaced-cache/releases)
- [Changelog](https://github.com/php-cache/namespaced-cache/blob/master/Changelog.md)
- [Commits](php-cache/namespaced-cache@1.0.0...1.1.0)

---
updated-dependencies:
- dependency-name: cache/namespaced-cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump gulp-sass from 4.1.1 to 5.0.0

Bumps [gulp-sass](https://github.com/dlmanning/gulp-sass) from 4.1.1 to 5.0.0.
- [Release notes](https://github.com/dlmanning/gulp-sass/releases)
- [Changelog](https://github.com/dlmanning/gulp-sass/blob/master/CHANGELOG.md)
- [Commits](dlmanning/gulp-sass@v4.1.1...v5.0.0)

---
updated-dependencies:
- dependency-name: gulp-sass
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump node-sass from 4.14.1 to 6.0.1

Bumps [node-sass](https://github.com/sass/node-sass) from 4.14.1 to 6.0.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](sass/node-sass@v4.14.1...v6.0.1)

---
updated-dependencies:
- dependency-name: node-sass
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump gulp-brotli from 2.0.2 to 3.0.0

Bumps [gulp-brotli](https://github.com/seznam/gulp-brotli) from 2.0.2 to 3.0.0.
- [Release notes](https://github.com/seznam/gulp-brotli/releases)
- [Commits](seznam/gulp-brotli@v2.0.2...v3.0.0)

---
updated-dependencies:
- dependency-name: gulp-brotli
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump imagemin-webp from 5.1.0 to 6.0.0

Bumps [imagemin-webp](https://github.com/imagemin/imagemin-webp) from 5.1.0 to 6.0.0.
- [Release notes](https://github.com/imagemin/imagemin-webp/releases)
- [Commits](imagemin/imagemin-webp@v5.1.0...v6.0.0)

---
updated-dependencies:
- dependency-name: imagemin-webp
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: make pathfinder composer 2.x compliant

extract mixed class into dedicated file and address filename typo in order to make the project PSR-4 compliant and work with Composer 2

* Bump league/html-to-markdown from 4.9.1 to 5.0.1

Bumps [league/html-to-markdown](https://github.com/thephpleague/html-to-markdown) from 4.9.1 to 5.0.1.
- [Release notes](https://github.com/thephpleague/html-to-markdown/releases)
- [Changelog](https://github.com/thephpleague/html-to-markdown/blob/master/CHANGELOG.md)
- [Commits](thephpleague/html-to-markdown@4.9.1...5.0.1)

---
updated-dependencies:
- dependency-name: league/html-to-markdown
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* composer.json: bumps monolog to 2.3.4

* composer.lock: Updates after dependabot merges

* Adds package-lock.json

* .gitignore: removes package-lock.json from ignore

* Removes "slash" js dev dependency

* pathfinder.ini: bumps version

* Bumps version on public files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Loïc LEUILLIOT <[email protected]>
  • Loading branch information
3 people committed Sep 18, 2021
1 parent 22e6c85 commit 98bd07e
Show file tree
Hide file tree
Showing 211 changed files with 9,671 additions and 116 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Temporary Items
.usage
*.gz
composer-dev.lock
package-lock.json
/conf/
/node_modules/
/public/js/vX.X.X/
Expand Down
39 changes: 22 additions & 17 deletions app/Db/Sql/Mysql/Column.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
<?php


namespace Exodus4D\Pathfinder\Db\Sql\Mysql;

use DB\SQL;

class Column extends SQL\Column {
/**
* Class Column
* @package DB\SQL\MySQL
*/
class Column extends SQL\Column
{

/**
* missing table name error
*/
const ERROR_TABLE_NAME_MISSING = 'Table name missing for FOREIGN KEY in `%s`';
const TEXT_TableNameMissing = 'Table name missing for FOREIGN KEY in `%s`';

/**
* drop constraint from this column
* @param Constraint $constraint
*/
public function dropConstraint(Constraint $constraint){
public function dropConstraint(Constraint $constraint)
{
$this->table->dropConstraint($constraint);
}

/**
* add constraint to this column
* @param Constraint $constraint
*/
public function addConstraint(Constraint $constraint){
public function addConstraint(Constraint $constraint)
{
$this->table->addConstraint($constraint);
}

/**
* @param Constraint $constraint
* @return mixed
*/
public function constraintExists(Constraint $constraint){
public function constraintExists(Constraint $constraint)
{
return $this->table->constraintExists($constraint);
}

Expand All @@ -46,29 +50,30 @@ public function constraintExists(Constraint $constraint){
* @param array $constraintData
* @return Constraint
*/
public function newConstraint($constraintData){
public function newConstraint($constraintData)
{

$constraint = null;

if(isset($constraintData['table'])){
if(isset($constraintData['column'])){
if (isset($constraintData['table'])) {
if (isset($constraintData['column'])) {
$constraintData['column'] = (array)$constraintData['column'];
}else{
} else {
$constraintData['column'] = ['id'];
}

$constraint = new Constraint($this->table, $this->name, $constraintData['table'], $constraintData['column']);

if(isset($constraintData['on-delete'])){
if (isset($constraintData['on-delete'])) {
$constraint->setOnDelete($constraintData['on-delete']);
}

if(isset($constraintData['on-update'])){
if (isset($constraintData['on-update'])) {
$constraint->setOnUpdate($constraintData['on-update']);
}

}else{
trigger_error(sprintf(self::ERROR_TABLE_NAME_MISSING, $this->table->name . '->' . $this->name));
} else {
trigger_error(sprintf(self::TEXT_TableNameMissing, $this->table->name . '->' . $this->name));
}

return $constraint;
Expand Down
70 changes: 42 additions & 28 deletions app/Db/Sql/Mysql/Constraint.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php


namespace Exodus4D\Pathfinder\Db\Sql\Mysql;


use DB\SQL;

class Constraint {
class Constraint
{

// available actions
const ACTIONS_DELETE = ['RESTRICT', 'CASCADE', 'SET NULL', 'NO ACTION'];
Expand All @@ -16,7 +15,7 @@ class Constraint {
const ACTION_DELETE = 'RESTRICT';
const ACTION_UPDATE = 'RESTRICT';

const ERROR_ACTION_NOT_SUPPORTED = 'Constraint action `%s` is not supported.';
const TEXT_ActionNotSupported = 'Constraint action `%s` is not supported.';

protected $table;
protected $keys = [];
Expand All @@ -32,7 +31,8 @@ class Constraint {
* @param string $referencedTable
* @param array $referencedCols
*/
public function __construct(SQL\TableBuilder $table, $keys = [], $referencedTable = '', $referencedCols = ['id']){
public function __construct(SQL\TableBuilder $table, $keys = [], $referencedTable = '', $referencedCols = ['id'])
{
$this->table = &$table;
$this->setKeys($keys);
$this->setReferencedTable($referencedTable);
Expand All @@ -42,78 +42,88 @@ public function __construct(SQL\TableBuilder $table, $keys = [], $referencedTabl
/**
* @param mixed $keys
*/
public function setKeys($keys){
public function setKeys($keys)
{
$this->keys = (array)$keys;
}

/**
* @param mixed $referencedTable
*/
public function setReferencedTable($referencedTable){
public function setReferencedTable($referencedTable)
{
$this->referencedTable = $referencedTable;
}

/**
* @param mixed $referencedCols
*/
public function setReferencedCols($referencedCols){
public function setReferencedCols($referencedCols)
{
$this->referencedCols = (array)$referencedCols;
}

/**
* @param string $onDelete
*/
public function setOnDelete($onDelete){
if( in_array($onDelete, self::ACTIONS_DELETE) ){
public function setOnDelete($onDelete)
{
if (in_array($onDelete, self::ACTIONS_DELETE)) {
$this->onDelete = $onDelete;
}else{
trigger_error(sprintf(self::ERROR_ACTION_NOT_SUPPORTED, $onDelete));
} else {
trigger_error(sprintf(self::TEXT_ActionNotSupported, $onDelete));
}
}

/**
* @param string $onUpdate
*/
public function setOnUpdate($onUpdate){
if( in_array($onUpdate, self::ACTIONS_UPDATE) ){
public function setOnUpdate($onUpdate)
{
if (in_array($onUpdate, self::ACTIONS_UPDATE)) {
$this->onUpdate = $onUpdate;
}else{
trigger_error(sprintf(self::ERROR_ACTION_NOT_SUPPORTED, $onUpdate));
} else {
trigger_error(sprintf(self::TEXT_ActionNotSupported, $onUpdate));
}
}

/**
* @return array
*/
public function getKeys(){
public function getKeys()
{
return $this->keys;
}

/**
* @return string
*/
public function getReferencedTable(){
public function getReferencedTable()
{
return $this->referencedTable;
}

/**
* @return array
*/
public function getReferencedCols(){
public function getReferencedCols()
{
return $this->referencedCols;
}

/**
* @return string
*/
public function getOnDelete(){
public function getOnDelete()
{
return $this->onDelete;
}

/**
* @return string
*/
public function getOnUpdate(){
public function getOnUpdate()
{
return $this->onUpdate;
}

Expand All @@ -125,14 +135,15 @@ public function getOnUpdate(){
* -> To get a certain constraint or generate a unique constraint, ALL params are required!
* @return string
*/
public function getConstraintName(){
public function getConstraintName()
{
$constraintName = 'fk_' . $this->table->name;

if(!empty($this->getKeys())){
if (!empty($this->getKeys())) {
$constraintName .= '___' . implode('__', $this->getKeys());
if(!empty($this->getReferencedTable())){
if (!empty($this->getReferencedTable())) {
$constraintName .= '___' . $this->getReferencedTable();
if(!empty($this->getReferencedCols())){
if (!empty($this->getReferencedCols())) {
$constraintName .= '___' . implode('__', $this->getReferencedCols());
}
}
Expand All @@ -146,17 +157,20 @@ public function getConstraintName(){
* -> all required members must be set!
* @return bool
*/
public function isValid(){
public function isValid()
{
$valid = false;

if(
if (
!empty($this->getKeys()) &&
!empty($this->getReferencedTable()) &&
!empty($this->getReferencedCols())
){
) {
$valid = true;
}

return $valid;
}


}
12 changes: 5 additions & 7 deletions app/Db/Sql/Mysql/TableModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@

class TableModifier extends SQL\TableModifier {

/**
* invalid constraint error
*/
const ERROR_CONSTRAINT_NOT_VALID = 'Constraint `%s` is not valid';
const TEXT_ConstraintNotValid = 'Constraint `%s` is not valid';


/**
* return table foreign key constraints as assoc array
Expand Down Expand Up @@ -86,7 +84,7 @@ public function dropConstraint($constraint){
$this->queries[] = "ALTER TABLE " . $this->db->quotekey($this->name) . "
DROP FOREIGN KEY " . $this->db->quotekey($constraint->getConstraintName()) . ";";
}else{
trigger_error(sprintf(self::ERROR_CONSTRAINT_NOT_VALID, 'table: ' . $this->name . ' constraintName: ' . $constraint->getConstraintName()));
trigger_error(sprintf(self::TEXT_ConstraintNotValid, 'table: ' . $this->name . ' constraintName: ' . $constraint->getConstraintName()));
}
}

Expand All @@ -105,7 +103,7 @@ public function addConstraint($constraint){
ON DELETE " . $constraint->getOnDelete() . "
ON UPDATE " . $constraint->getOnUpdate() . ";";
}else{
trigger_error(sprintf(self::ERROR_CONSTRAINT_NOT_VALID, 'table: ' . $this->name . ' constraintName: ' . $constraint->getConstraintName()));
trigger_error(sprintf(self::TEXT_ConstraintNotValid, 'table: ' . $this->name . ' constraintName: ' . $constraint->getConstraintName()));
}
}
}
}
4 changes: 2 additions & 2 deletions app/pathfinder.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ NAME = Pathfinder
; Version is used for CSS/JS cache busting and is part of the URL for static resources:
; e.g. public/js/vX.X.X/app.js
; Syntax: String (current version)
; Default: v2.1.1
VERSION = v2.1.1
; Default: v2.1.2
VERSION = v2.1.2

; Contact information [optional]
; Shown on 'licence', 'contact' page.
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
"ikkez/f3-cortex": "dev-master#af035616ae8d708776117e05603dac43835f3d9a",
"ikkez/f3-sheet": "0.4.*",
"xfra35/f3-cron": "1.2.*",
"monolog/monolog": "2.*",
"monolog/monolog": "2.3.4",
"swiftmailer/swiftmailer": "6.2.*",
"league/html-to-markdown": "4.9.*",
"league/html-to-markdown": "5.0.*",
"cache/redis-adapter": "1.0.*",
"cache/filesystem-adapter": "1.0.*",
"cache/array-adapter": "1.0.*",
"cache/array-adapter": "1.1.*",
"cache/void-adapter": "1.0.*",
"cache/namespaced-cache": "1.0.*",
"cache/namespaced-cache": "1.1.*",
"react/socket": "1.3.*",
"react/promise-stream": "1.2.*",
"clue/ndjson-react": "1.1.*",
"clue/ndjson-react": "1.2.*",
"tyrheimdaleve/pathfinder_esi": "2.1.1"
},
"suggest": {
Expand Down
Loading

0 comments on commit 98bd07e

Please sign in to comment.