PHP Classes

File: src/Updates/1.3.0/symlinks.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   CMS Airship   src/Updates/1.3.0/symlinks.php   Download  
File: src/Updates/1.3.0/symlinks.php
Role: Example script
Content type: text/plain
Description: Example script
Class: CMS Airship
Content management system with security features
Author: By
Last change: Begin Psalm integration.
Date: 7 years ago
Size: 597 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);

use
Airship\Engine\State;

/**
 * This script runs when upgrading to v1.3.0 from an earlier version.
 * It deletes the old symlinks used for resolving Motif templates.
 * The bootstrapping process is sufficient to restore them.
 */

$state = State::instance();

foreach (
$state->cabins as $cabin) {
   
$cabinName = (string) ($cabin['namespace'] ?? $cabin['name']);
    foreach (\
glob(ROOT . '/Cabin/' . $cabinName . '/View/motif/*') as $f) {
       
$endPiece = \Airship\path_to_filename($f);
        if (\
is_link($f)) {
            \
unlink($f);
        }
    }
}