Merge branch 'develop' into feature/ci
This commit is contained in:
commit
96d3261f25
25 changed files with 74 additions and 77 deletions
|
@ -21,13 +21,13 @@ In order to read/write objects from a database table, you'll need to configure a
|
||||||
// DriverFactory::factory() has the same arguments as PDO::__construct
|
// DriverFactory::factory() has the same arguments as PDO::__construct
|
||||||
// You can also construct a driver directly, from a class in Drivers,
|
// You can also construct a driver directly, from a class in Drivers,
|
||||||
// but for common databases DriverFactory::factory should pick the right class
|
// but for common databases DriverFactory::factory should pick the right class
|
||||||
$driver = \Digraph\DriverFactory::factory(
|
$driver = \Destructr\DriverFactory::factory(
|
||||||
'mysql:host=127.0.0.1',
|
'mysql:host=127.0.0.1',
|
||||||
'username',
|
'username',
|
||||||
'password'
|
'password'
|
||||||
);
|
);
|
||||||
// Driver is then used to construct a Factory
|
// Driver is then used to construct a Factory
|
||||||
$factory = new \Digraph\Destructr\Factory(
|
$factory = new \Destructr\Factory(
|
||||||
$driver, //driver is used to manage connection and generate queries
|
$driver, //driver is used to manage connection and generate queries
|
||||||
'dso_objects' //all of a Factory's data is stored in a single table
|
'dso_objects' //all of a Factory's data is stored in a single table
|
||||||
);
|
);
|
||||||
|
|
|
@ -30,12 +30,12 @@
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Digraph\\Destructr\\": "src/"
|
"Destructr\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Digraph\\Destructr\\": "tests/"
|
"Destructr\\": "tests/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
use \Digraph\FlatArray\FlatArray;
|
use \Digraph\FlatArray\FlatArray;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
https://github.com/digraphcms/destructr
|
namespace Destructr;
|
||||||
MIT License
|
|
||||||
Copyright (c) 2018 Joby Elliott <joby@byjoby.com> */
|
|
||||||
namespace Digraph\Destructr;
|
|
||||||
|
|
||||||
interface DSOFactoryInterface
|
interface DSOFactoryInterface
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
use Digraph\FlatArray\FlatArrayInterface;
|
use Digraph\FlatArray\FlatArrayInterface;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
class DriverFactory
|
class DriverFactory
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr\Drivers;
|
namespace Destructr\Drivers;
|
||||||
|
|
||||||
use Digraph\Destructr\DSOInterface;
|
use Destructr\DSOInterface;
|
||||||
use Digraph\Destructr\Search;
|
use Destructr\Search;
|
||||||
|
|
||||||
//TODO: Caching? It should happen somewhere in this class I think.
|
//TODO: Caching? It should happen somewhere in this class I think.
|
||||||
abstract class AbstractDriver implements DSODriverInterface
|
abstract class AbstractDriver implements DSODriverInterface
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr\Drivers;
|
namespace Destructr\Drivers;
|
||||||
|
|
||||||
use Digraph\Destructr\DSOInterface;
|
use Destructr\DSOInterface;
|
||||||
use Digraph\Destructr\Search;
|
use Destructr\Search;
|
||||||
|
|
||||||
interface DSODriverInterface
|
interface DSODriverInterface
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr\Drivers;
|
namespace Destructr\Drivers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What this driver supports: MySQL and MariaDB databases new enough to support
|
* What this driver supports: MySQL and MariaDB databases new enough to support
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
use mofodojodino\ProfanityFilter\Check;
|
use mofodojodino\ProfanityFilter\Check;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr\LegacyDrivers;
|
namespace Destructr\LegacyDrivers;
|
||||||
|
|
||||||
use Digraph\Destructr\Drivers\AbstractDriver;
|
use Destructr\Drivers\AbstractDriver;
|
||||||
use Digraph\Destructr\DSOInterface;
|
use Destructr\DSOInterface;
|
||||||
use Digraph\Destructr\Factory;
|
use Destructr\Factory;
|
||||||
use Digraph\Destructr\Search;
|
use Destructr\Search;
|
||||||
use Digraph\FlatArray\FlatArray;
|
use Digraph\FlatArray\FlatArray;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr\LegacyDrivers;
|
namespace Destructr\LegacyDrivers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What this driver supports: MySQL 5.6, as long as you have permissions to
|
* What this driver supports: MySQL 5.6, as long as you have permissions to
|
||||||
|
|
|
@ -20,7 +20,7 @@ The things many of this sort of driver will *not* ever support:
|
||||||
|
|
||||||
### SQLite 3
|
### SQLite 3
|
||||||
|
|
||||||
**\Digraph\Destructr\LegacyDrivers\SQLiteDriver**
|
**\Destructr\LegacyDrivers\SQLiteDriver**
|
||||||
|
|
||||||
**Overall support level: Highly functional, a touch slow**
|
**Overall support level: Highly functional, a touch slow**
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ using SQLite if you don't have access to a fully supported database version.
|
||||||
|
|
||||||
### MySQL 5.6
|
### MySQL 5.6
|
||||||
|
|
||||||
**\Digraph\Destructr\LegacyDrivers\MySQL56Driver**
|
**\Destructr\LegacyDrivers\MySQL56Driver**
|
||||||
|
|
||||||
**Overall support level: Decent performance, highly suspect accuracy**
|
**Overall support level: Decent performance, highly suspect accuracy**
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr\LegacyDrivers;
|
namespace Destructr\LegacyDrivers;
|
||||||
|
|
||||||
use Digraph\Destructr\DSOInterface;
|
use Destructr\DSOInterface;
|
||||||
use Digraph\FlatArray\FlatArray;
|
use Digraph\FlatArray\FlatArray;
|
||||||
use Digraph\Destructr\Factory;
|
use Destructr\Factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What this driver supports: Version of SQLite3 in PHP environments that allow
|
* What this driver supports: Version of SQLite3 in PHP environments that allow
|
||||||
|
@ -27,7 +27,7 @@ class SQLiteDriver extends AbstractLegacyDriver
|
||||||
*/
|
*/
|
||||||
$this->pdo->sqliteCreateFunction(
|
$this->pdo->sqliteCreateFunction(
|
||||||
'DESTRUCTR_JSON_EXTRACT',
|
'DESTRUCTR_JSON_EXTRACT',
|
||||||
'\\Digraph\\Destructr\\LegacyDrivers\\SQLiteDriver::JSON_EXTRACT',
|
'\\Destructr\\LegacyDrivers\\SQLiteDriver::JSON_EXTRACT',
|
||||||
2
|
2
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
use Digraph\Destructr\DSOFactoryInterface;
|
use Destructr\DSOFactoryInterface;
|
||||||
use Digraph\Destructr\Drivers\DSODriverInterface;
|
use Destructr\Drivers\DSODriverInterface;
|
||||||
|
|
||||||
class Search implements \Serializable
|
class Search implements \Serializable
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr\Drivers;
|
namespace Destructr\Drivers;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use PHPUnit\DbUnit\TestCaseTrait;
|
use PHPUnit\DbUnit\TestCaseTrait;
|
||||||
use Digraph\Destructr\DSO;
|
use Destructr\DSO;
|
||||||
use Digraph\Destructr\Search;
|
use Destructr\Search;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class tests a factory in isolation. In the name of simplicity it's a bit
|
* This class tests a factory in isolation. In the name of simplicity it's a bit
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr\Drivers\IntegrationTests;
|
namespace Destructr\Drivers\IntegrationTests;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use PHPUnit\DbUnit\TestCaseTrait;
|
use PHPUnit\DbUnit\TestCaseTrait;
|
||||||
use Digraph\Destructr\DSO;
|
use Destructr\DSO;
|
||||||
use Digraph\Destructr\Search;
|
use Destructr\Search;
|
||||||
use Digraph\Destructr\Factory;
|
use Destructr\Factory;
|
||||||
|
|
||||||
abstract class AbstractDriverIntegrationTest extends TestCase
|
abstract class AbstractDriverIntegrationTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr\Drivers\IntegrationTests;
|
namespace Destructr\Drivers\IntegrationTests;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
class MySQLDriverTest extends AbstractDriverIntegrationTest
|
class MySQLDriverTest extends AbstractDriverIntegrationTest
|
||||||
{
|
{
|
||||||
const DRIVER_CLASS = \Digraph\Destructr\Drivers\MySQLDriver::class;
|
const DRIVER_CLASS = \Destructr\Drivers\MySQLDriver::class;
|
||||||
const DRIVER_DSN = 'mysql:host=127.0.0.1;dbname=phpunit';
|
const DRIVER_DSN = 'mysql:host=127.0.0.1;dbname=phpunit';
|
||||||
const DRIVER_USERNAME = 'travis';
|
const DRIVER_USERNAME = 'travis';
|
||||||
const DRIVER_PASSWORD = null;
|
const DRIVER_PASSWORD = null;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr\Drivers;
|
namespace Destructr\Drivers;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
namespace Digraph\Destructr;
|
namespace Destructr;
|
||||||
|
|
||||||
class HarnessDriver implements Drivers\DSODriverInterface
|
class HarnessDriver implements Drivers\DSODriverInterface
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr\LegacyDrivers\IntegrationTests;
|
namespace Destructr\LegacyDrivers\IntegrationTests;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Digraph\Destructr\Drivers\IntegrationTests\AbstractDriverIntegrationTest;
|
use Destructr\Drivers\IntegrationTests\AbstractDriverIntegrationTest;
|
||||||
use Digraph\Destructr\LegacyDrivers\SQLiteDriver;
|
use Destructr\LegacyDrivers\SQLiteDriver;
|
||||||
|
|
||||||
class MySQLDriverTest extends AbstractDriverIntegrationTest
|
class MySQLDriverTest extends AbstractDriverIntegrationTest
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr\LegacyDrivers;
|
namespace Destructr\LegacyDrivers;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Digraph\Destructr\Drivers\AbstractDriverTest;
|
use Destructr\Drivers\AbstractDriverTest;
|
||||||
|
|
||||||
class MySQL56DriverTest extends AbstractDriverTest
|
class MySQL56DriverTest extends AbstractDriverTest
|
||||||
{
|
{
|
||||||
const DRIVER_CLASS = \Digraph\Destructr\LegacyDrivers\MySQL56Driver::class;
|
const DRIVER_CLASS = \Destructr\LegacyDrivers\MySQL56Driver::class;
|
||||||
const DRIVER_DSN = 'mysql:host=127.0.0.1;dbname=phpunit';
|
const DRIVER_DSN = 'mysql:host=127.0.0.1;dbname=phpunit';
|
||||||
const DRIVER_USERNAME = 'travis';
|
const DRIVER_USERNAME = 'travis';
|
||||||
const DRIVER_PASSWORD = null;
|
const DRIVER_PASSWORD = null;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
/* Digraph CMS: Destructr | https://github.com/digraphcms/destructr | MIT License */
|
/* Destructr | https://gitlab.com/byjoby/destructr | MIT License */
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace Digraph\Destructr\LegacyDrivers;
|
namespace Destructr\LegacyDrivers;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Digraph\Destructr\Drivers\AbstractDriverTest;
|
use Destructr\Drivers\AbstractDriverTest;
|
||||||
|
|
||||||
class SQLiteDriverTest extends AbstractDriverTest
|
class SQLiteDriverTest extends AbstractDriverTest
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue