PHP Classes

File: src/CommandLine/continuum.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   CMS Airship   src/CommandLine/continuum.php   Download  
File: src/CommandLine/continuum.php
Role: Example script
Content type: text/plain
Description: Example script
Class: CMS Airship
Content management system with security features
Author: By
Last change: Less IDE Hacks.
Date: 7 years ago
Size: 885 bytes
 

Contents

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

use
Airship\Engine\{
   
Continuum,
   
Gears,
   
Hail,
   
State
};

/**
 * @global State $state
 * @global Hail $hail
 */

// Always check for changes to channel keys before initiating update
require_once __DIR__.'/channel.php';

/**
 * Initialize the automatic updater service
 * @var \Airship\Engine\Continuum
 */
$autoUpdater = Gears::get('AutoUpdater', $hail);
if (!(
$autoUpdater instanceof Continuum)) {
    throw new \
TypeError(
        \
trk('errors.type.wrong_class', Continuum::class)
    );
}

$state->logger->info('Automatic update started');
try {
   
$autoUpdater->doUpdateCheck();
} catch (\
Throwable $ex) {
   
$state->logger->critical(
       
'Tree update failed: ' . \get_class($ex),
        \
Airship\throwableToArray($ex)
    );
    exit(
255);
}
$state->logger->info('Automatic update concluded');
\
Airship\clear_cache();

exit(
0);