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
30 changes: 30 additions & 0 deletions components/ILIAS/Database/classes/PDO/Details.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\Database\PDO;

use ilDBInterface;
use ilAtomQuery;

interface Details
{
public function supportsTransactions(): bool;
public function atomQuery(ilDBInterface $db): ilAtomQuery;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
*********************************************************************/

declare(strict_types=1);
/**
* Class ilDBPdoMySQLInnoDB
*
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDBPdoMySQLGalera extends ilDBPdoMySQLInnoDB

namespace ILIAS\Database\PDO;

use ilAtomQuery;
use ilAtomQueryTransaction;
use ilDBInterface;

class GaleraDetails implements Details
{
#[\Override]
public function supportsTransactions(): bool
Expand All @@ -31,8 +33,8 @@ public function supportsTransactions(): bool
}

#[\Override]
public function buildAtomQuery(): ilAtomQuery
public function atomQuery(ilDBInterface $db): ilAtomQuery
{
return new ilAtomQueryTransaction($this);
return new ilAtomQueryTransaction($db);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,38 @@
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\Database\PDO;

use ILIAS\Database\FieldDefinition;
use PDO;
use ilDBConstants;
use ilDBInterface;
use ilDBManager;
use ilDBReverse;
use ilDBPdoManager;
use ilDBPdoReverse;
use ilDBPdoMySQLFieldDefinition;
use PDOException;
use ilDatabaseException;
use Exception;
use ilAtomQuery;
use ilAtomQueryLock;

/**
* Class ilDBPdoMySQLInnoDB
*
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDBPdoMySQLInnoDB extends ilDBPdoMySQL
class InnoDBDetails implements Details
{
protected string $storage_engine = 'InnoDB';

#[\Override]
public function supportsFulltext(): bool
{
return false;
}


#[\Override]
public function supportsTransactions(): bool
{
return false;
}


#[\Override]
public function addFulltextIndex(string $table_name, array $fields, string $name = 'in'): bool
public function atomQuery(ilDBInterface $db): ilAtomQuery
{
return false; // NOT SUPPORTED
return new ilAtomQueryLock($db);
}
}
30 changes: 30 additions & 0 deletions components/ILIAS/Database/classes/PDO/Internal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\Database\PDO;

use ilDBInterface;
use ilDBPdoInterface;

interface Internal extends ilDBInterface, ilDBPdoInterface
{
public function getFieldDefinition(): ?\ilDBPdoFieldDefinition;
public function getIndexName(string $index_name_base): string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
declare(strict_types=1);

use ILIAS\Database\PDO\FieldDefinition\ForeignKeyConstraints;
use ILIAS\Database\PDO\Internal;

/**
* Class ilDBPdoManager
Expand All @@ -28,10 +29,7 @@ class ilDBPdoManager implements ilDBManager, ilDBPdoManagerInterface
{
protected ?\ilQueryUtils $query_utils = null;

/**
* ilDBPdoManager constructor.
*/
public function __construct(protected \PDO $pdo, protected \ilDBPdo $db_instance)
public function __construct(protected \PDO $pdo, protected Internal $db_instance)
{
}

Expand All @@ -44,7 +42,7 @@ public function getQueryUtils(): \ilQueryUtils
return $this->query_utils;
}

public function getDBInstance(): \ilDBPdo
public function getDBInstance(): Internal
{
return $this->db_instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

declare(strict_types=1);

use ILIAS\Database\PDO\Internal;

/**
* Class ilDBPdoReverse
* @author Fabian Schmid <fs@studer-raimann.ch>
Expand All @@ -26,10 +28,7 @@ class ilDBPdoReverse implements ilDBReverse
{
protected ?\ilMySQLQueryUtils $query_utils = null;

/**
* ilDBPdoReverse constructor.
*/
public function __construct(protected \PDO $pdo, protected \ilDBPdo $db_instance)
public function __construct(protected \PDO $pdo, protected Internal $db_instance)
{
}

Expand Down
Loading
Loading