PHP Classes

File: src/cabin_gears.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   CMS Airship   src/cabin_gears.php   Download  
File: src/cabin_gears.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: CMS Airship
Content management system with security features
Author: By
Last change: Merge remote-tracking branch 'origin/master'
Date: 7 years ago
Size: 727 bytes
 

Contents

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

use
Airship\Engine\Gears;

/**
 * Let's gearify the current cabin:
 *
 * e.g. Controller__IndexPage => \Airship\Cabin\Hull\Controller\IndexPage
 *
 */
$cabinGearsClosure = function() {
    foreach ([
'Controller', 'Model'] as $dir) {
        foreach (\
glob(CABIN_DIR . '/' . $dir . '/*.php') as $landing) {
           
$filename = \Airship\path_to_filename($landing, true);
            if (
$filename === 'init_gear') {
                continue;
            }
           
Gears::lazyForge(
               
$dir . '__' . $filename,
               
'\\Airship\\Cabin\\' . CABIN_NAME . '\\' . $dir . '\\' . $filename
           
);
        }
    }
};
$cabinGearsClosure();
unset(
$cabinGearsClosure);