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


PHP Gantry::restart方法代码示例

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


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

示例1: cleanup

 public function cleanup()
 {
     $name = $this->extension->name;
     $path = JPATH_SITE . '/templates/' . $name;
     // Remove compiled CSS files if they exist.
     $cssPath = $path . '/custom/css-compiled';
     if (is_dir($cssPath)) {
         \JFolder::delete($cssPath);
     } elseif (is_file($cssPath)) {
         \JFile::delete($cssPath);
     }
     // Remove wrongly named file if it exists.
     $md5path = $path . '/MD5SUM';
     if (is_file($md5path)) {
         \JFile::delete($md5path);
     }
     // Restart Gantry and initialize it.
     $gantry = Gantry::restart();
     $gantry['theme.name'] = $name;
     $gantry['streams']->register();
     // Only add error service if debug mode has been enabled.
     if ($gantry->debug()) {
         $gantry->register(new ErrorServiceProvider());
     }
     /** @var Platform $patform */
     $patform = $gantry['platform'];
     /** @var UniformResourceLocator $locator */
     $locator = $gantry['locator'];
     // Initialize theme stream.
     $details = new ThemeDetails($name);
     $locator->addPath('gantry-theme', '', $details->getPaths(), false, true);
     // Initialize theme cache stream and clear theme cache.
     $cachePath = $patform->getCachePath() . '/' . $name;
     if (is_dir($cachePath)) {
         Folder::delete($cachePath);
     }
     Folder::create($cachePath);
     $locator->addPath('gantry-cache', 'theme', [$cachePath], true, true);
     $gantry['file.yaml.cache.path'] = $locator->findResource('gantry-cache://theme/compiled/yaml', true, true);
     /** @var Outlines $outlines */
     $outlines = $gantry['configurations'];
     // Update positions in manifest file.
     $positions = $outlines->positions();
     $manifest = new Manifest($name);
     $manifest->setPositions(array_keys($positions));
     $manifest->save();
 }
开发者ID:legutierr,项目名称:gantry5,代码行数:47,代码来源:TemplateInstaller.php


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