mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
commit
63acc1a2e8
7 changed files with 38 additions and 6 deletions
|
|
@ -24,3 +24,6 @@ indent_size = 2
|
|||
|
||||
[/version.txt]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
|
|
|
|||
4
docker/dev/mtt-php54-apache/Dockerfile
Normal file
4
docker/dev/mtt-php54-apache/Dockerfile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
FROM php:5.4-apache
|
||||
|
||||
RUN docker-php-ext-install mysqli
|
||||
11
docker/dev/mtt-php54-apache/docker-compose.yml
Normal file
11
docker/dev/mtt-php54-apache/docker-compose.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
version: '3'
|
||||
services:
|
||||
web:
|
||||
build: ./
|
||||
image: mtt-php5.4-apache
|
||||
container_name: mtt-php54-apache
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ../../src:/var/www/html
|
||||
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||
6
docker/dev/mtt-php54-apache/php-mtt.ini
Normal file
6
docker/dev/mtt-php54-apache/php-mtt.ini
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
# Since PHP 5.4 E_STRICT is included in E_ALL
|
||||
error_reporting = E_ALL
|
||||
|
||||
#log_errors = On
|
||||
#display_errors = On
|
||||
|
|
@ -152,10 +152,15 @@ class Database_Sqlite3
|
|||
|
||||
function table_exists($table)
|
||||
{
|
||||
$table = $this->dbh->quote($table);
|
||||
$q = $this->dbh->query("SELECT 1 FROM $table WHERE 1=0");
|
||||
if($q === false) return false;
|
||||
else return true;
|
||||
$exists = $this->sq("SELECT 1 FROM sqlite_master WHERE type='table' AND name=?", $table);
|
||||
if ($exists == "1") {
|
||||
return true;
|
||||
}
|
||||
$exists = $this->sq("SELECT 1 FROM sqlite_temp_master WHERE type='table' AND name=?", $table);
|
||||
if ($exists == "1") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -164,14 +164,14 @@ class Config
|
|||
if($f === false) throw new Exception("Error while saving config file");
|
||||
fwrite($f, "<?php\n\$config = array();\n$s?>");
|
||||
fclose($f);
|
||||
/*
|
||||
|
||||
//Reset Zend OPcache
|
||||
//opcache_get_status() sometimes crashes
|
||||
//TODO: save config in database!
|
||||
if (function_exists("opcache_invalidate") && 0 != (int)opcache_get_configuration()["directives"]["opcache.enable"]) {
|
||||
opcache_invalidate(MTTPATH. 'db/config.php', true);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -336,6 +336,9 @@ function testConnect(&$error)
|
|||
{
|
||||
if(Config::get('db') == 'mysql')
|
||||
{
|
||||
if ( !function_exists("mysqli_connect") ) {
|
||||
throw new Exception("Required PHP extension 'mysqli' is not installed");
|
||||
}
|
||||
require_once(MTTINC. 'class.db.mysql.php');
|
||||
$db = new Database_Mysql;
|
||||
$db->connect(Config::get('mysql.host'), Config::get('mysql.user'), Config::get('mysql.password'), Config::get('mysql.db'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue