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


PHP IPSSetUp::fetchNextApplication方法代码示例

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


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

示例1: rebuildFromXml

 /**
  * Rebuilds language from XML files
  *
  * @return @e void
  */
 public function rebuildFromXml()
 {
     //-----------------------------------------
     // Init
     //-----------------------------------------
     $apps = array();
     $previous = trim($this->request['previous']);
     $type = trim($this->request['type']);
     $id = intval($this->request['id']);
     $_word = $type == 'admin' ? 'admin' : 'public';
     //-----------------------------------------
     // Verify writable
     //-----------------------------------------
     if (!is_writeable(IPS_CACHE_PATH . 'cache/lang_cache/' . $id)) {
         $this->registry->output->global_error = $this->lang->words['cannot_write_to_cache'] ? sprintf($this->lang->words['cannot_write_to_cache'], $id) : "Cannot write to cache/lang_cache/" . $id;
         $this->languagesList();
         return;
     }
     //-----------------------------------------
     // Get setup class
     //-----------------------------------------
     require_once IPS_ROOT_PATH . "setup/sources/base/setup.php";
     /*noLibHook*/
     //-----------------------------------------
     // Get apps
     //-----------------------------------------
     foreach (ipsRegistry::$applications as $appDir => $appData) {
         $apps[] = $appDir;
     }
     //-----------------------------------------
     // Klude for setup class
     //-----------------------------------------
     IPSSetUp::setSavedData('install_apps', implode(',', $apps));
     //-----------------------------------------
     // Get next app
     //-----------------------------------------
     $next = IPSSetUp::fetchNextApplication($previous, '', $this->settings['gb_char_set']);
     if ($next['key']) {
         $msg = $next['title'] . sprintf($this->lang->words['importing_x_langs'], $_word);
         $_PATH = IPSLib::getAppDir($next['key']) . '/xml/';
         //-----------------------------------------
         // Try to import all the lang packs
         //-----------------------------------------
         try {
             foreach (new DirectoryIterator($_PATH) as $f) {
                 if (preg_match("#" . $_word . "_(.+?)_language_pack.xml#", $f->getFileName())) {
                     $this->request['file_location'] = $_PATH . $f->getFileName();
                     $this->imprtFromXML(1, true, true, $next['key']);
                 }
             }
         } catch (Exception $e) {
         }
         //-----------------------------------------
         // Off to next setp
         //-----------------------------------------
         $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect($this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&amp;id={$id}&amp;type={$type}&amp;previous=" . $next['key'], $msg . '<br>' . $this->registry->output->global_message);
         $this->registry->output->global_message = '';
         return;
     } else {
         if ($type == 'public') {
             //-----------------------------------------
             // Onto admin languages
             //-----------------------------------------
             $this->registry->output->html .= $this->registry->output->global_template->temporaryRedirect($this->settings['base_url'] . $this->form_code . "do=rebuildFromXml&amp;id={$id}&amp;type=admin", $this->lang->words['starting_admin_import']);
             return;
         } else {
             //-----------------------------------------
             // And we're done
             //-----------------------------------------
             $this->registry->output->redirect($this->settings['base_url'] . $this->form_code, $this->lang->words['lang_reimport_done']);
         }
     }
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:78,代码来源:manage_languages.php

示例2: install_caches

 /**
  * Install Caches
  *
  * @return void
  */
 public function install_caches()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $this->settings['base_url'] = IPSSetUp::getSavedData('install_url');
     $this->settings['ipb_reg_number'] = IPSSetUp::getSavedData('lkey');
     $previous = $_REQUEST['previous'];
     //-----------------------------------------
     // Fetch next 'un
     //-----------------------------------------
     $next = IPSSetUp::fetchNextApplication($previous, '', $this->settings['gb_char_set']);
     /* Set up DB driver */
     $extra_install = $this->_setUpDBDriver(FALSE);
     //-----------------------------------------
     // Install SYSTEM Templates on first cycle
     //-----------------------------------------
     if (!$previous) {
         //-----------------------------------------
         // Global caches...
         //-----------------------------------------
         # Grab cache master file
         require_once IPS_ROOT_PATH . 'extensions/coreVariables.php';
         /*noLibHook*/
         /* Add handle */
         $_tmp = new coreVariables();
         $_cache = $_tmp->fetchCaches();
         $CACHE = $_cache['caches'];
         //-----------------------------------------
         // Adjust the table?
         //-----------------------------------------
         if ($extra_install and method_exists($extra_install, 'before_inserts_run')) {
             $q = $extra_install->before_inserts_run('caches');
         }
         //-----------------------------------------
         // Continue
         //-----------------------------------------
         if (is_array($CACHE)) {
             foreach ($CACHE as $cs_key => $cs_data) {
                 $output[] = "Обновление {$cs_key}...";
                 ipsRegistry::cache()->rebuildCache($cs_key, 'global');
             }
         }
         //-------------------------------------------------------------
         // Systemvars
         //-------------------------------------------------------------
         $output[] = "Обновление кеша системных переменных";
         $cache = array('mail_queue' => 0, 'task_next_run' => time() + 3600);
         ipsRegistry::cache()->setCache('systemvars', $cache, array('array' => 1));
         //-------------------------------------------------------------
         // Stats
         //-------------------------------------------------------------
         $output[] = "Обновление кеша статистики";
         $cache = array('total_replies' => 0, 'total_topics' => 1, 'mem_count' => 1, 'last_mem_name' => IPSSetUp::getSavedData('admin_user'), 'last_mem_id' => 1);
         ipsRegistry::cache()->setCache('stats', $cache, array('array' => 1));
         //-----------------------------------------
         // Adjust the table?
         //-----------------------------------------
         if ($extra_install and method_exists($extra_install, 'after_inserts_run')) {
             $q = $extra_install->after_inserts_run('caches');
         }
         $output[] = "Все кеши обновлены";
         //-----------------------------------------
         // Recache skins: Moved here so they are
         // build after hooks are added
         //-----------------------------------------
         /* Load skin classes */
         require_once IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php';
         /*noLibHook*/
         require_once IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php';
         /*noLibHook*/
         require_once IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php';
         /*noLibHook*/
         $skinFunctions = new skinImportExport($this->registry);
         /* Grab skin data */
         $this->DB->build(array('select' => '*', 'from' => 'skin_collections'));
         $this->DB->execute();
         while ($row = $this->DB->fetch()) {
             /* Bit of jiggery pokery... */
             if ($row['set_key'] == 'default') {
                 $row['set_key'] = 'root';
                 $row['set_id'] = 0;
             }
             $skinSets[$row['set_key']] = $row;
         }
         foreach ($skinSets as $skinKey => $skinData) {
             /* Bit of jiggery pokery... */
             if ($skinData['set_key'] == 'root') {
                 $skinData['set_key'] = 'default';
                 $skinData['set_id'] = 1;
                 $skinKey = 'default';
             }
             $skinFunctions->rebuildPHPTemplates($skinData['set_id']);
             if ($skinFunctions->fetchErrorMessages() !== FALSE) {
                 $this->registry->output->addWarning(implode("<br />", $skinFunctions->fetchErrorMessages()));
//.........这里部分代码省略.........
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:101,代码来源:install.php

示例3: install_caches

 /**
  * Install Caches
  *
  * @return void
  */
 public function install_caches()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $this->settings['base_url'] = IPSSetUp::getSavedData('install_url');
     $previous = $_REQUEST['previous'];
     //-----------------------------------------
     // Fetch next 'un
     //-----------------------------------------
     $next = IPSSetUp::fetchNextApplication($previous, '', $this->settings['gb_char_set']);
     //-----------------------------------------
     // Install SYSTEM Templates
     //-----------------------------------------
     if ($next['key']) {
         $_PATH = IPSLib::getAppDir($next['key']) . '/extensions/';
         if (is_file($_PATH . 'coreVariables.php')) {
             # Grab cache master file
             $CACHE = array();
             require_once $_PATH . 'coreVariables.php';
             /*noLibHook*/
             if (is_array($CACHE) && count($CACHE)) {
                 foreach ($CACHE as $cs_key => $cs_data) {
                     if (empty($cs_data['skip_rebuild_when_upgrading'])) {
                         $output[] = $next['title'] . ": Обновление {$cs_key}...";
                         ipsRegistry::cache()->rebuildCache($cs_key, $next['key']);
                     }
                 }
             } else {
                 $output[] = $next['title'] . ": Нет кешей для обновления";
             }
         } else {
             $output[] = $next['title'] . ": Нет кешей для обновления";
         }
         //-----------------------------------------
         // Done.. so get some more!
         //-----------------------------------------
         $this->_finishStep($output, "Обновление: Кеш", 'upgrade&do=caches&previous=' . $next['key']);
     } else {
         //-----------------------------------------
         // Global caches...
         //-----------------------------------------
         # Grab cache master file
         require_once IPS_ROOT_PATH . 'extensions/coreVariables.php';
         /*noLibHook*/
         /* Add handle */
         $_tmp = new coreVariables();
         $_cache = $_tmp->fetchCaches();
         $CACHE = $_cache['caches'];
         //-----------------------------------------
         // Continue
         //-----------------------------------------
         if (is_array($CACHE)) {
             foreach ($CACHE as $cs_key => $cs_data) {
                 if (empty($cs_data['skip_rebuild_when_upgrading'])) {
                     $output[] = "Обновление {$cs_key}...";
                     ipsRegistry::cache()->rebuildCache($cs_key, 'global');
                 }
             }
         }
         //-------------------------------------------------------------
         // Systemvars
         //-------------------------------------------------------------
         $output[] = "Обновление кеша системных переменных";
         $cache = ipsRegistry::cache()->getCache('systemvars');
         $cache['task_next_run'] = time() + 3600;
         $cache['mail_queue'] = 0;
         ipsRegistry::cache()->setCache('systemvars', $cache, array('array' => 1));
         /* Reset IPSNews cache */
         ipsRegistry::cache()->setCache('ipsNewsData', array(), array('array' => 1));
         //-----------------------------------------
         // Output
         //-----------------------------------------
         $output[] = "Весь кеш обновлен";
         $this->_finishStep($output, "Обновление: Кеш", 'upgrade&do=templatecache');
     }
 }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:82,代码来源:upgrade.php

示例4: install_caches

 /**
  * Install Caches
  *
  * @return void
  */
 public function install_caches()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $this->settings['base_url'] = IPSSetUp::getSavedData('install_url');
     $previous = $_REQUEST['previous'];
     //-----------------------------------------
     // Fetch next 'un
     //-----------------------------------------
     $next = IPSSetUp::fetchNextApplication($previous);
     //-----------------------------------------
     // Install SYSTEM Templates
     //-----------------------------------------
     if ($next['key']) {
         $_PATH = IPS_ROOT_PATH . 'applications/' . $next['key'] . '/extensions/';
         if (file_exists($_PATH . 'coreVariables.php')) {
             # Grab cache master file
             require_once $_PATH . 'coreVariables.php';
             if (is_array($CACHE)) {
                 foreach ($CACHE as $cs_key => $cs_data) {
                     $output[] = $next['title'] . ": Building {$cs_key}...";
                     ipsRegistry::cache()->rebuildCache($cs_key, $next['key']);
                 }
             } else {
                 $output[] = $next['title'] . ": No caches to build...";
             }
         } else {
             $output[] = $next['title'] . ": No caches to build...";
         }
         //-----------------------------------------
         // Done.. so get some more!
         //-----------------------------------------
         $this->_finishStep($output, "Upgrade: Caches", 'upgrade&do=caches&previous=' . $next['key']);
     } else {
         //-----------------------------------------
         // Global caches...
         //-----------------------------------------
         # Grab cache master file
         require_once IPS_ROOT_PATH . 'extensions/coreVariables.php';
         /* Add handle */
         $_tmp = new coreVariables();
         $_cache = $_tmp->fetchCaches();
         $CACHE = $_cache['caches'];
         //-----------------------------------------
         // Continue
         //-----------------------------------------
         if (is_array($CACHE)) {
             foreach ($CACHE as $cs_key => $cs_data) {
                 $output[] = "System Building {$cs_key}...";
                 ipsRegistry::cache()->rebuildCache($cs_key, 'global');
             }
         }
         //-------------------------------------------------------------
         // Systemvars
         //-------------------------------------------------------------
         $output[] = "Rebuilding system variables cache...";
         $cache = array('mail_queue' => 0, 'task_next_run' => time() + 3600);
         ipsRegistry::cache()->setCache('systemvars', $cache, array('array' => 1, 'deletefirst' => 1));
         $output[] = "Global: All caches upgraded";
         $this->_finishStep($output, "Upgrade: Caches", 'upgrade&do=templatecache');
     }
 }
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:68,代码来源:upgrade.php


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