PMA\libraries\Theme::load PHP Метод

load() публичный статический Метод

returns theme object loaded from given folder or false if theme is invalid
public static load ( string $folder ) : Theme | false
$folder string path to theme
Результат Theme | false
    public static function load($folder)
    {
        $theme = new Theme();
        $theme->setPath($folder);
        if (!$theme->loadInfo()) {
            return false;
        }
        $theme->checkImgPath();
        return $theme;
    }

Usage Example

 /**
  * Prepares environment for the test.
  *
  * @return void
  */
 public function setUp()
 {
     //$_REQUEST
     $_REQUEST['log'] = "index1";
     $_REQUEST['pos'] = 3;
     $_REQUEST['mr_adduser'] = "******";
     //$GLOBALS
     $GLOBALS['cfg']['MaxRows'] = 10;
     $GLOBALS['cfg']['ServerDefault'] = "server";
     $GLOBALS['cfg']['RememberSorting'] = true;
     $GLOBALS['cfg']['SQP'] = array();
     $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000;
     $GLOBALS['cfg']['ShowSQL'] = true;
     $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
     $GLOBALS['cfg']['LimitChars'] = 100;
     $GLOBALS['cfg']['DBG']['sql'] = false;
     $GLOBALS['cfg']['ShowHint'] = true;
     $GLOBALS['table'] = "table";
     $GLOBALS['url_params'] = array();
     $GLOBALS['pmaThemeImage'] = 'image';
     //$_SESSION
     $_SESSION['PMA_Theme'] = Theme::load('./themes/pmahomme');
     $_SESSION['PMA_Theme'] = new Theme();
     //Mock DBI
     $slave_host = array(array('Server_id' => 'Server_id1', 'Host' => 'Host1'), array('Server_id' => 'Server_id2', 'Host' => 'Host2'));
     $fetchResult = array(array("SHOW SLAVE HOSTS", null, null, null, 0, $slave_host));
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->any())->method('fetchResult')->will($this->returnValueMap($fetchResult));
     $fields_info = array("Host" => array("Field" => "host", "Type" => "char(60)", "Null" => "NO"));
     $dbi->expects($this->any())->method('getColumns')->will($this->returnValue($fields_info));
     $GLOBALS['dbi'] = $dbi;
 }
All Usage Examples Of PMA\libraries\Theme::load