PHP Classes

File: src/CommandLine/lock_installs.php

Recommend this page to a friend!
  Classes of Scott Arciszewski   CMS Airship   src/CommandLine/lock_installs.php   Download  
File: src/CommandLine/lock_installs.php
Role: Example script
Content type: text/plain
Description: Example script
Class: CMS Airship
Content management system with security features
Author: By
Last change: Change `use \Foo` to `use Foo`. The backslash here
is unnecessary.
Date: 7 years ago
Size: 495 bytes
 

Contents

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

use
ParagonIE\Halite\Password;
use
Airship\Engine\State;

/**
 * This script saves a password hash to the
 */

require_once \dirname(__DIR__).'/bootstrap.php';

if (
$argc > 1) {
   
$state = State::instance();
   
$save = Password::hash(
       
$argv[1],
       
$state->keyring['auth.password_key']
    );
} else {
   
$save = (new \DateTime('now'))
        ->
format(\AIRSHIP_DATE_FORMAT);
}

\
file_put_contents(
   
ROOT . '/config/install.lock',
   
$save
);