Example code for a sample Project...of PHP Code Hypdrater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
ProjectCodeHydrater/protected/cli/makeLicense.php

36 lines
1.1 KiB

<?php
/**
* Keep this file from the customer...
*/
use HydraterLicense\MakeLicense;
if (! class_exists("HydraterLicense\MakeLicense")) {
die("Sorry, this extenstion is not availiable!");
}
define("BaseDir", dirname(__DIR__));
// Using standard ISO 8601 format, and make it expire in 4 years
define('EXPIRES_DATE', (new DateTime('+4 years'))->format(DateTime::ATOM));
$license_maker = new MakeLicense();
define("PWD1", $license_maker->makePassword());
define("PWD2", $license_maker->makePassword());
// PHP Files to keep secure are in src/secret_php_files
const Array_For_Files = [
BaseDir. "/src/aes/testing.aes" =>
[ "feature" => "testing", "enabled" => true, "expires" => EXPIRES_DATE, "password" => PWD1 ],
BaseDir. "/src/aes/config.aes" =>
[ "feature" => "junk", "enabled" => false, "password" => PWD2 ],
];
const ALLOWED_DOMAINS = ["localhost", "sub.example.org"];
$license_maker->runSymlink(BaseDir. "/FWCodeHydrater", "src/classes/makeLicenseFiles.php");
/**
* use stars for unlimited access for domains and expires dates if desired!
*/