当前位置: 首页>>代码示例>>PHP>>正文


PHP Import::getInstance方法代码示例

本文整理汇总了PHP中Import::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Import::getInstance方法的具体用法?PHP Import::getInstance怎么用?PHP Import::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Import的用法示例。


在下文中一共展示了Import::getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     $this->bootstrap = Bootstrap::getInstance();
     $this->import = Import::getInstance();
     $this->resolver = Resolver::getInstance();
     foreach ($this->bootstrap->appSettings->wpbootstrap->menus as $menu => $locations) {
         $dir = BASEPATH . "/bootstrap/menus/{$menu}";
         $newMenu = new \stdClass();
         $newMenu->slug = $menu;
         $newMenu->locations = $locations;
         $newMenu->items = array();
         foreach ($this->getFiles($dir) as $file) {
             $menuItem = new \stdClass();
             $menuItem->done = false;
             $menuItem->id = 0;
             $menuItem->parentId = 0;
             $menuItem->slug = $file;
             $menuItem->menu = unserialize(file_get_contents($dir . '/' . $file));
             $newMenu->items[] = $menuItem;
         }
         usort($newMenu->items, function ($a, $b) {
             return (int) $a->menu->menu_order - (int) $b->menu->menu_order;
         });
         $this->menus[] = $newMenu;
     }
     $baseUrl = get_option('siteurl');
     $neutralUrl = Bootstrap::NETURALURL;
     $this->resolver->fieldSearchReplace($this->menus, Bootstrap::NETURALURL, $this->import->baseUrl);
     $this->process();
 }
开发者ID:eriktorsner,项目名称:wp-bootstrap-ui,代码行数:30,代码来源:Pushmenus.php

示例2: __construct

 public function __construct()
 {
     $this->bootstrap = Bootstrap::getInstance();
     $this->import = Import::getInstance();
     $this->resolver = Resolver::getInstance();
     $dir = BASEPATH . '/bootstrap/sidebars';
     foreach ($this->bootstrap->getFiles($dir) as $sidebar) {
         $subdir = BASEPATH . "/bootstrap/sidebars/{$sidebar}";
         $newSidebar = new \stdClass();
         $newSidebar->slug = $sidebar;
         $newSidebar->items = array();
         $newSidebar->meta = unserialize(file_get_contents($subdir . '/meta'));
         foreach ($newSidebar->meta as $key => $widgetRef) {
             $widget = new \stdClass();
             $parts = explode('-', $widgetRef);
             $ord = end($parts);
             $type = substr($widgetRef, 0, -1 * strlen('-' . $ord));
             $widget->type = $type;
             $widget->ord = $ord;
             $widget->meta = unserialize(file_get_contents($subdir . '/' . $widgetRef));
             $newSidebar->items[] = $widget;
         }
         $this->sidebars[] = $newSidebar;
     }
     $baseUrl = get_option('siteurl');
     $neutralUrl = Bootstrap::NETURALURL;
     $this->resolver->fieldSearchReplace($this->sidebars, Bootstrap::NETURALURL, $this->import->baseUrl);
     $this->process();
 }
开发者ID:eriktorsner,项目名称:wp-bootstrap-ui,代码行数:29,代码来源:Pushsidebars.php

示例3: __construct

 public function __construct()
 {
     $this->bootstrap = Bootstrap::getInstance();
     $this->import = Import::getInstance();
     $this->resolver = Resolver::getInstance();
     $dir = BASEPATH . '/bootstrap/posts';
     foreach ($this->bootstrap->getFiles($dir) as $postType) {
         foreach ($this->bootstrap->getFiles($dir . '/' . $postType) as $slug) {
             $newPost = new \stdClass();
             $newPost->done = false;
             $newPost->id = 0;
             $newPost->parentId = 0;
             $newPost->slug = $slug;
             $file = BASEPATH . "/bootstrap/posts/{$postType}/{$slug}";
             $newPost->post = unserialize(file_get_contents($file));
             $this->posts[] = $newPost;
         }
     }
     $this->resolver->fieldSearchReplace($this->posts, Bootstrap::NETURALURL, $this->import->baseUrl);
     $this->process();
 }
开发者ID:eriktorsner,项目名称:wp-bootstrap-ui,代码行数:21,代码来源:Pushposts.php

示例4: __construct

 public function __construct()
 {
     $this->import = Import::getInstance();
 }
开发者ID:eriktorsner,项目名称:wp-bootstrap-ui,代码行数:4,代码来源:Resolver.php


注:本文中的Import::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。