php 7.4 dev branch

This commit is contained in:
2020-04-03 15:56:04 +02:00
parent 2636719583
commit a8fc52b42a
48 changed files with 456 additions and 530 deletions

View File

@@ -2,11 +2,14 @@
namespace Configuration;
use Error;
use Objects\ConnectionData;
class Configuration {
private $database;
private $mail;
private $jwt;
private ?ConnectionData $database;
private ?ConnectionData $mail;
private ?KeyData $jwt;
function __construct() {
}
@@ -34,7 +37,7 @@ class Configuration {
}
return $success;
} catch(\Error $e) {
} catch(Error $e) {
die($e);
}
}
@@ -48,7 +51,7 @@ class Configuration {
return file_exists($path);
}
public function create($className, $data) {
public function create(string $className, $data) {
$path = getClassPath("\\Configuration\\$className");
if($data) {
@@ -59,22 +62,15 @@ class Configuration {
namespace Configuration;
class $className {
private \$key;
class $className extends KeyData {
public function __construct() {
\$this->key = '$key';
parent::__construct('$key');
}
public function getKey() {
return \$this->key;
}
}
?>", false
}", false
);
} else {
} else if($data instanceof ConnectionData) {
$superClass = get_class($data);
$host = addslashes($data->getHost());
$port = intval($data->getPort());
@@ -102,18 +98,17 @@ class Configuration {
?>", false
);
} else {
return false;
}
} else {
$code = intendCode(
"<?php
?>", false);
$code = "<?php";
}
return @file_put_contents($path, $code);
}
public function delete($className) {
public function delete(string $className) {
$path = getClassPath("\\Configuration\\$className");
if(file_exists($path)) {
return unlink($path);
@@ -121,6 +116,4 @@ class Configuration {
return true;
}
};
?>
}

View File

@@ -2,16 +2,13 @@
namespace Configuration;
use \Driver\SQL\Query\CreateTable;
use \Driver\SQL\Query\Insert;
use \Driver\SQL\Column\Column;
use \Driver\SQL\Strategy\UpdateStrategy;
use Driver\SQL\SQL;
use \Driver\SQL\Strategy\SetNullStrategy;
use \Driver\SQL\Strategy\CascadeStrategy;
class CreateDatabase {
public static function createQueries($sql) {
public static function createQueries(SQL $sql) {
$queries = array();
// Language
@@ -111,5 +108,3 @@ class CreateDatabase {
return $queries;
}
}
?>

View File

@@ -0,0 +1,17 @@
<?php
namespace Configuration;
class KeyData {
protected string $key;
public function __construct(string $key) {
$this->key = $key;
}
public function getKey() {
return $this->key;
}
}