From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- .../Options/Groups/OptionsPropertyMainGroup.php | 35 ++++ .../Options/Groups/OptionsPropertyRootGroup.php | 35 ++++ .../Options/Groups/OptionsPropertySubgroup.php | 66 ++++++++ .../Properties/Options/Items/BoolPropertyItem.php | 35 ++++ .../Properties/Options/Items/DocPropertyItem.php | 35 ++++ .../Options/Items/HiddenPropertyItem.php | 35 ++++ .../Options/Items/MessageOnlyPropertyItem.php | 35 ++++ .../Options/Items/NumberPropertyItem.php | 35 ++++ .../Properties/Options/Items/RadioPropertyItem.php | 35 ++++ .../Options/Items/SelectPropertyItem.php | 35 ++++ .../Properties/Options/Items/TextPropertyItem.php | 35 ++++ .../Properties/Options/OptionsPropertyGroup.php | 109 +++++++++++++ .../Properties/Options/OptionsPropertyItem.php | 136 ++++++++++++++++ .../Properties/Options/OptionsPropertyOneItem.php | 161 +++++++++++++++++++ .../Properties/Plugins/ExportPluginProperties.php | 64 ++++++++ .../Properties/Plugins/ImportPluginProperties.php | 33 ++++ .../Properties/Plugins/PluginPropertyItem.php | 177 +++++++++++++++++++++ .../Properties/Plugins/SchemaPluginProperties.php | 46 ++++++ .../libraries/classes/Properties/PropertyItem.php | 48 ++++++ 19 files changed, 1190 insertions(+) create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Groups/OptionsPropertyRootGroup.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Groups/OptionsPropertySubgroup.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/BoolPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/DocPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/HiddenPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/MessageOnlyPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/NumberPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/RadioPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/SelectPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/Items/TextPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyGroup.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyOneItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Plugins/ExportPluginProperties.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Plugins/ImportPluginProperties.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Plugins/PluginPropertyItem.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/Plugins/SchemaPluginProperties.php create mode 100644 srcs/phpmyadmin/libraries/classes/Properties/PropertyItem.php (limited to 'srcs/phpmyadmin/libraries/classes/Properties') diff --git a/srcs/phpmyadmin/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php b/srcs/phpmyadmin/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php new file mode 100644 index 0000000..99d3546 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php @@ -0,0 +1,35 @@ +_subgroupHeader; + } + + /** + * Sets the subgroup header + * + * @param PropertyItem $subgroupHeader subgroup header + * + * @return void + */ + public function setSubgroupHeader($subgroupHeader) + { + $this->_subgroupHeader = $subgroupHeader; + } +} diff --git a/srcs/phpmyadmin/libraries/classes/Properties/Options/Items/BoolPropertyItem.php b/srcs/phpmyadmin/libraries/classes/Properties/Options/Items/BoolPropertyItem.php new file mode 100644 index 0000000..7441243 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Properties/Options/Items/BoolPropertyItem.php @@ -0,0 +1,35 @@ +getProperties() == null + && in_array($property, $this->getProperties(), true) + ) { + return; + } + $this->_properties[] = $property; + } + + /** + * Removes a property from the group of properties + * + * @param OptionsPropertyItem $property the property instance to be removed + * from the group + * + * @return void + */ + public function removeProperty($property) + { + $this->_properties = array_diff( + $this->getProperties(), + [$property] + ); + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the instance of the class + * + * @return OptionsPropertyGroup + */ + public function getGroup() + { + return $this; + } + + /** + * Gets the group of properties + * + * @return array + */ + public function getProperties() + { + return $this->_properties; + } + + /** + * Gets the number of properties + * + * @return int + */ + public function getNrOfProperties() + { + if ($this->_properties === null) { + return 0; + } + return count($this->_properties); + } + + /** + * Countable interface implementation. + * + * @return int + */ + public function count() + { + return $this->getNrOfProperties(); + } +} diff --git a/srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyItem.php b/srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyItem.php new file mode 100644 index 0000000..829f6d9 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyItem.php @@ -0,0 +1,136 @@ +_name = $name; + } + if ($text) { + $this->_text = $text; + } + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Sets the name + * + * @param string $name name + * + * @return void + */ + public function setName($name) + { + $this->_name = $name; + } + + /** + * Gets the text + * + * @return string + */ + public function getText() + { + return $this->_text; + } + + /** + * Sets the text + * + * @param string $text text + * + * @return void + */ + public function setText($text) + { + $this->_text = $text; + } + + /** + * Gets the force parameter + * + * @return string + */ + public function getForce() + { + return $this->_force; + } + + /** + * Sets the force parameter + * + * @param string $force force parameter + * + * @return void + */ + public function setForce($force) + { + $this->_force = $force; + } + + /** + * Returns the property type ( either "options", or "plugin" ). + * + * @return string + */ + public function getPropertyType() + { + return "options"; + } +} diff --git a/srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyOneItem.php b/srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyOneItem.php new file mode 100644 index 0000000..2ffca61 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Properties/Options/OptionsPropertyOneItem.php @@ -0,0 +1,161 @@ +_force_one; + } + + /** + * Sets the force parameter + * + * @param bool $force force parameter + * + * @return void + */ + public function setForce($force) + { + $this->_force_one = $force; + } + + /** + * Gets the values + * + * @return array + */ + public function getValues() + { + return $this->_values; + } + + /** + * Sets the values + * + * @param array $values values + * + * @return void + */ + public function setValues(array $values) + { + $this->_values = $values; + } + + /** + * Gets MySQL documentation pointer + * + * @return string + */ + public function getDoc() + { + return $this->_doc; + } + + /** + * Sets the doc + * + * @param string $doc MySQL documentation pointer + * + * @return void + */ + public function setDoc($doc) + { + $this->_doc = $doc; + } + + /** + * Gets the length + * + * @return int + */ + public function getLen() + { + return $this->_len; + } + + /** + * Sets the length + * + * @param int $len length + * + * @return void + */ + public function setLen($len) + { + $this->_len = $len; + } + + /** + * Gets the size + * + * @return int + */ + public function getSize() + { + return $this->_size; + } + + /** + * Sets the size + * + * @param int $size size + * + * @return void + */ + public function setSize($size) + { + $this->_size = $size; + } +} diff --git a/srcs/phpmyadmin/libraries/classes/Properties/Plugins/ExportPluginProperties.php b/srcs/phpmyadmin/libraries/classes/Properties/Plugins/ExportPluginProperties.php new file mode 100644 index 0000000..4ae4e03 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Properties/Plugins/ExportPluginProperties.php @@ -0,0 +1,64 @@ +_forceFile; + } + + /** + * Sets the force file parameter + * + * @param bool $forceFile the force file parameter + * + * @return void + */ + public function setForceFile($forceFile) + { + $this->_forceFile = $forceFile; + } +} diff --git a/srcs/phpmyadmin/libraries/classes/Properties/Plugins/ImportPluginProperties.php b/srcs/phpmyadmin/libraries/classes/Properties/Plugins/ImportPluginProperties.php new file mode 100644 index 0000000..b270951 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Properties/Plugins/ImportPluginProperties.php @@ -0,0 +1,33 @@ +_text; + } + + /** + * Sets the text + * + * @param string $text text + * + * @return void + */ + public function setText($text) + { + $this->_text = $text; + } + + /** + * Gets the extension + * + * @return string + */ + public function getExtension() + { + return $this->_extension; + } + + /** + * Sets the extension + * + * @param string $extension extension + * + * @return void + */ + public function setExtension($extension) + { + $this->_extension = $extension; + } + + /** + * Gets the options + * + * @return OptionsPropertyRootGroup + */ + public function getOptions() + { + return $this->_options; + } + + /** + * Sets the options + * + * @param OptionsPropertyRootGroup $options options + * + * @return void + */ + public function setOptions($options) + { + $this->_options = $options; + } + + /** + * Gets the options text + * + * @return string + */ + public function getOptionsText() + { + return $this->_optionsText; + } + + /** + * Sets the options text + * + * @param string $optionsText optionsText + * + * @return void + */ + public function setOptionsText($optionsText) + { + $this->_optionsText = $optionsText; + } + + /** + * Gets the MIME type + * + * @return string + */ + public function getMimeType() + { + return $this->_mimeType; + } + + /** + * Sets the MIME type + * + * @param string $mimeType MIME type + * + * @return void + */ + public function setMimeType($mimeType) + { + $this->_mimeType = $mimeType; + } + + /** + * Returns the property type ( either "options", or "plugin" ). + * + * @return string + */ + public function getPropertyType() + { + return "plugin"; + } +} diff --git a/srcs/phpmyadmin/libraries/classes/Properties/Plugins/SchemaPluginProperties.php b/srcs/phpmyadmin/libraries/classes/Properties/Plugins/SchemaPluginProperties.php new file mode 100644 index 0000000..28d187e --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/Properties/Plugins/SchemaPluginProperties.php @@ -0,0 +1,46 @@ +