Example #1
0
 public static function copy($style, $old, $new)
 {
     $gantry = Gantry::instance();
     /** @var UniformResourceLocator $locator */
     $locator = $gantry['locator'];
     $oldPath = $locator->findResource('gantry-config://' . $old, true, true);
     $newPath = $locator->findResource('gantry-config://' . $new, true, true);
     if (file_exists($oldPath)) {
         Folder::copy($oldPath, $newPath);
     }
     $installer = new TemplateInstaller($style->extension_id);
     $installer->updateStyle($new, ['configuration' => $new]);
 }