Server IP : 85.214.239.14 / Your IP : 18.118.28.31 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/wordpress/phpMyAdmin/libraries/classes/ |
Upload File : |
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * hold the ListAbstract base class * * @package PhpMyAdmin */ declare(strict_types=1); namespace PhpMyAdmin; use ArrayObject; /** * Generic list class * * @todo add caching * @abstract * @package PhpMyAdmin * @since phpMyAdmin 2.9.10 */ abstract class ListAbstract extends ArrayObject { /** * @var mixed empty item */ protected $item_empty = ''; /** * defines what is an empty item (0, '', false or null) * * @return mixed an empty item */ public function getEmpty() { return $this->item_empty; } /** * checks if the given db names exists in the current list, if there is * missing at least one item it returns false otherwise true * * @param mixed[] ...$params params * @return bool true if all items exists, otherwise false */ public function exists(...$params) { $this_elements = $this->getArrayCopy(); foreach ($params as $result) { if (! in_array($result, $this_elements)) { return false; } } return true; } /** * returns HTML <option>-tags to be used inside <select></select> * * @param mixed $selected the selected db or true for * selecting current db * @param boolean $include_information_schema whether include information schema * * @return string HTML option tags */ public function getHtmlOptions( $selected = '', $include_information_schema = true ) { if (true === $selected) { $selected = $this->getDefault(); } $options = ''; foreach ($this as $each_item) { if (false === $include_information_schema && $GLOBALS['dbi']->isSystemSchema($each_item) ) { continue; } $options .= '<option value="' . htmlspecialchars($each_item) . '"'; if ($selected === $each_item) { $options .= ' selected="selected"'; } $options .= '>' . htmlspecialchars($each_item) . '</option>' . "\n"; } return $options; } /** * returns default item * * @return string default item */ public function getDefault() { return $this->getEmpty(); } /** * builds up the list * * @return void */ abstract public function build(); }