summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/ServiceProvider/DatabaseProvider.php2
-rw-r--r--app/constants.php1
-rw-r--r--composer.json2
-rw-r--r--composer.lock24
-rw-r--r--config.default.php3
-rw-r--r--vendor/composer/installed.json84
-rw-r--r--vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php4
-rw-r--r--vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php7
-rw-r--r--vendor/fguillot/picodb/lib/PicoDb/Driver/Sqlite.php8
9 files changed, 78 insertions, 57 deletions
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php
index ccd5a7b9..704e8079 100644
--- a/app/ServiceProvider/DatabaseProvider.php
+++ b/app/ServiceProvider/DatabaseProvider.php
@@ -136,6 +136,7 @@ class DatabaseProvider implements ServiceProviderInterface
'ssl_ca' => DB_SSL_CA,
'ssl_cert' => DB_SSL_CERT,
'verify_server_cert' => DB_VERIFY_SERVER_CERT,
+ 'timeout' => DB_TIMEOUT,
));
}
@@ -156,6 +157,7 @@ class DatabaseProvider implements ServiceProviderInterface
'password' => DB_PASSWORD,
'database' => DB_NAME,
'port' => DB_PORT,
+ 'timeout' => DB_TIMEOUT,
));
}
}
diff --git a/app/constants.php b/app/constants.php
index 4b87d18e..35d651e8 100644
--- a/app/constants.php
+++ b/app/constants.php
@@ -54,6 +54,7 @@ defined('DB_SSL_KEY') or define('DB_SSL_KEY', null);
defined('DB_SSL_CERT') or define('DB_SSL_CERT', null);
defined('DB_SSL_CA') or define('DB_SSL_CA', null);
defined('DB_VERIFY_SERVER_CERT') or define('DB_VERIFY_SERVER_CERT', null);
+defined('DB_TIMEOUT') or define('DB_TIMEOUT', null);
// Database backend group provider
defined('DB_GROUP_PROVIDER') or define('DB_GROUP_PROVIDER', true);
diff --git a/composer.json b/composer.json
index 41a1599d..a9926ca9 100644
--- a/composer.json
+++ b/composer.json
@@ -30,7 +30,7 @@
"eluceo/ical": "0.10.1",
"erusev/parsedown" : "1.6.0",
"fguillot/json-rpc" : "1.2.1",
- "fguillot/picodb" : "1.0.16",
+ "fguillot/picodb" : "1.0.17",
"fguillot/simpleLogger" : "1.0.1",
"fguillot/simple-validator" : "1.0.1",
"fguillot/simple-queue" : "1.0.1",
diff --git a/composer.lock b/composer.lock
index 708fd618..88c7259e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "100bd25a2613fac1b666b2103be0f3ce",
+ "content-hash": "6d59b34b5598ac4a46c73dce19772b9b",
"packages": [
{
"name": "aferrandini/phpqrcode",
@@ -288,16 +288,16 @@
},
{
"name": "fguillot/picodb",
- "version": "v1.0.16",
+ "version": "v1.0.17",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoDb.git",
- "reference": "03b89d09e283cbaffbb4039e4ba6eaa3d327002a"
+ "reference": "1699864992c40ad02395e95d7fbf44a571a116f3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fguillot/picoDb/zipball/03b89d09e283cbaffbb4039e4ba6eaa3d327002a",
- "reference": "03b89d09e283cbaffbb4039e4ba6eaa3d327002a",
+ "url": "https://api.github.com/repos/fguillot/picoDb/zipball/1699864992c40ad02395e95d7fbf44a571a116f3",
+ "reference": "1699864992c40ad02395e95d7fbf44a571a116f3",
"shasum": ""
},
"require": {
@@ -324,7 +324,7 @@
],
"description": "Minimalist database query builder",
"homepage": "https://github.com/fguillot/picoDb",
- "time": "2018-01-30T00:01:16+00:00"
+ "time": "2018-02-14T00:51:01+00:00"
},
{
"name": "fguillot/simple-queue",
@@ -1294,16 +1294,16 @@
},
{
"name": "phpspec/prophecy",
- "version": "1.7.3",
+ "version": "1.7.4",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf"
+ "reference": "9f901e29c93dae4aa77c0bb161df4276f9c9a1be"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
- "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/9f901e29c93dae4aa77c0bb161df4276f9c9a1be",
+ "reference": "9f901e29c93dae4aa77c0bb161df4276f9c9a1be",
"shasum": ""
},
"require": {
@@ -1315,7 +1315,7 @@
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
- "phpunit/phpunit": "^4.8.35 || ^5.7"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"extra": {
@@ -1353,7 +1353,7 @@
"spy",
"stub"
],
- "time": "2017-11-24T13:59:53+00:00"
+ "time": "2018-02-11T18:49:29+00:00"
},
{
"name": "phpunit/php-code-coverage",
diff --git a/config.default.php b/config.default.php
index a9e315e9..31849160 100644
--- a/config.default.php
+++ b/config.default.php
@@ -88,6 +88,9 @@ define('DB_SSL_CA', null);
// Mysql SSL server verification, set to false if you don't want the Mysql driver to validate the certificate CN
define('DB_VERIFY_SERVER_CERT', null);
+// Timeout value for PDO attribute
+define('DB_TIMEOUT', null);
+
// Enable LDAP authentication (false by default)
define('LDAP_AUTH', false);
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index d702ddd7..1326ba84 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -292,48 +292,6 @@
"homepage": "https://github.com/fguillot/JsonRPC"
},
{
- "name": "fguillot/picodb",
- "version": "v1.0.16",
- "version_normalized": "1.0.16.0",
- "source": {
- "type": "git",
- "url": "https://github.com/fguillot/picoDb.git",
- "reference": "03b89d09e283cbaffbb4039e4ba6eaa3d327002a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fguillot/picoDb/zipball/03b89d09e283cbaffbb4039e4ba6eaa3d327002a",
- "reference": "03b89d09e283cbaffbb4039e4ba6eaa3d327002a",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "4.8.*"
- },
- "time": "2018-01-30T00:01:16+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "PicoDb": "lib/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Frédéric Guillot",
- "homepage": "https://github.com/fguillot/"
- }
- ],
- "description": "Minimalist database query builder",
- "homepage": "https://github.com/fguillot/picoDb"
- },
- {
"name": "fguillot/simple-queue",
"version": "v1.0.1",
"version_normalized": "1.0.1.0",
@@ -1079,5 +1037,47 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com"
+ },
+ {
+ "name": "fguillot/picodb",
+ "version": "v1.0.17",
+ "version_normalized": "1.0.17.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fguillot/picoDb.git",
+ "reference": "1699864992c40ad02395e95d7fbf44a571a116f3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/fguillot/picoDb/zipball/1699864992c40ad02395e95d7fbf44a571a116f3",
+ "reference": "1699864992c40ad02395e95d7fbf44a571a116f3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.8.*"
+ },
+ "time": "2018-02-14T00:51:01+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "PicoDb": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Frédéric Guillot",
+ "homepage": "https://github.com/fguillot/"
+ }
+ ],
+ "description": "Minimalist database query builder",
+ "homepage": "https://github.com/fguillot/picoDb"
}
]
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php b/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php
index 147be816..17f44057 100644
--- a/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php
+++ b/vendor/fguillot/picodb/lib/PicoDb/Driver/Mysql.php
@@ -102,6 +102,10 @@ class Mysql extends Base
$options[PDO::ATTR_PERSISTENT] = $settings['persistent'];
}
+ if (! empty($settings['timeout'])) {
+ $options[PDO::ATTR_TIMEOUT] = $settings['timeout'];
+ }
+
if (isset($settings['verify_server_cert'])) {
$options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $settings['verify_server_cert'];
}
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php b/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
index 94279492..86036839 100644
--- a/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
+++ b/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
@@ -42,6 +42,7 @@ class Postgres extends Base
$dsn = 'pgsql:dbname='.$settings['database'];
$username = null;
$password = null;
+ $options = array();
if (! empty($settings['username'])) {
$username = $settings['username'];
@@ -59,7 +60,11 @@ class Postgres extends Base
$dsn .= ';port='.$settings['port'];
}
- $this->pdo = new PDO($dsn, $username, $password);
+ if (! empty($settings['timeout'])) {
+ $options[PDO::ATTR_TIMEOUT] = $settings['timeout'];
+ }
+
+ $this->pdo = new PDO($dsn, $username, $password, $options);
if (isset($settings['schema_table'])) {
$this->schemaTable = $settings['schema_table'];
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Driver/Sqlite.php b/vendor/fguillot/picodb/lib/PicoDb/Driver/Sqlite.php
index ea39f007..0503d336 100644
--- a/vendor/fguillot/picodb/lib/PicoDb/Driver/Sqlite.php
+++ b/vendor/fguillot/picodb/lib/PicoDb/Driver/Sqlite.php
@@ -29,7 +29,13 @@ class Sqlite extends Base
*/
public function createConnection(array $settings)
{
- $this->pdo = new PDO('sqlite:'.$settings['filename']);
+ $options = array();
+
+ if (! empty($settings['timeout'])) {
+ $options[PDO::ATTR_TIMEOUT] = $settings['timeout'];
+ }
+
+ $this->pdo = new PDO('sqlite:'.$settings['filename'], null, null, $options);
$this->enableForeignKeys();
}