57 lines
1.4 KiB
PHP
57 lines
1.4 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace alveolata\database;
|
||
|
|
||
|
// require_once(DIR_ALVEOLATA . '/definitions.php');
|
||
|
require_once(DIR_ALVEOLATA . '/database/abstract/interface.php');
|
||
|
require_once(DIR_ALVEOLATA . '/database/implementation-mysql/functions.php');
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
class implementation_mysql implements interface_database
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @var struct_subject_mysql
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
private $subject;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
private function __construct(struct_subject_mysql $subject) {$this->subject = $subject;}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public static function make(
|
||
|
string $host,
|
||
|
int $port,
|
||
|
string $schema,
|
||
|
string $username,
|
||
|
string $password
|
||
|
) : implementation_mysql
|
||
|
{
|
||
|
$subject = mysql_make($host, $port, $schema, $username, $password);
|
||
|
return (new implementation_mysql($subject));
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* implementations
|
||
|
*
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public function terminal_autoincrement() : string {return mysql_terminal_autoincrement();}
|
||
|
public function boilerplate_field_definition_for_integer_primary_key_with_auto_increment() : string {return mysql_boilerplate_field_definition_for_integer_primary_key_with_auto_increment();}
|
||
|
public function query(string $template, array $arguments = []) : array {return mysql_query($this->subject, $template, $arguments);}
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|