From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../libraries/classes/Charsets/Charset.php | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 srcs/phpmyadmin/libraries/classes/Charsets/Charset.php (limited to 'srcs/phpmyadmin/libraries/classes/Charsets/Charset.php') diff --git a/srcs/phpmyadmin/libraries/classes/Charsets/Charset.php b/srcs/phpmyadmin/libraries/classes/Charsets/Charset.php new file mode 100644 index 0000000..0b25790 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Charsets/Charset.php @@ -0,0 +1,103 @@ +name = $name; + $this->description = $description; + $this->defaultCollation = $defaultCollation; + $this->maxLength = $maxLength; + } + + /** + * @param array $state State obtained from the database server + * @return Charset + */ + public static function fromServer(array $state): self + { + return new self( + $state['Charset'] ?? '', + $state['Description'] ?? '', + $state['Default collation'] ?? '', + (int) ($state['Maxlen'] ?? 0) + ); + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @return string + */ + public function getDescription(): string + { + return $this->description; + } + + /** + * @return string + */ + public function getDefaultCollation(): string + { + return $this->defaultCollation; + } + + /** + * @return int + */ + public function getMaxLength(): int + { + return $this->maxLength; + } +} -- cgit