2021-06-19 11:27:32 +02:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
|
2021-06-21 11:43:10 +02:00
|
|
|
include "utils.php";
|
2021-07-01 11:04:00 +02:00
|
|
|
include "graph.php";
|
2021-06-19 11:27:32 +02:00
|
|
|
|
2021-06-28 10:07:15 +02:00
|
|
|
function from_camel_case($input) {
|
|
|
|
preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);
|
|
|
|
$ret = $matches[0];
|
|
|
|
foreach ($ret as &$match) {
|
|
|
|
$match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);
|
|
|
|
}
|
|
|
|
return implode('_', $ret);
|
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
function getTokens($type)
|
2021-06-21 21:21:54 +02:00
|
|
|
{
|
2021-06-28 09:05:07 +02:00
|
|
|
$fn = fopen('src/templates/token.db', "r");
|
|
|
|
|
|
|
|
$tokens = [];
|
|
|
|
|
|
|
|
while (!feof($fn)) {
|
|
|
|
|
|
|
|
$line = fgets($fn);
|
|
|
|
|
|
|
|
$matches = [];
|
|
|
|
if (preg_match('/^(' . $type . '.*$)/', $line, $matches)) {
|
|
|
|
$tokens[$matches[1]] = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose($fn);
|
|
|
|
|
|
|
|
return $tokens;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @throws ErrorException
|
|
|
|
*/
|
|
|
|
function loadSaved($file, $tokens) {
|
|
|
|
|
|
|
|
$saveFile = $file . '.saved';
|
|
|
|
|
|
|
|
echo "loading file " . $saveFile . "\n";
|
2021-06-20 08:13:06 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$loadedTokens = [];
|
2021-06-20 08:13:06 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$fn = fopen($saveFile, "r");
|
2021-06-20 08:13:06 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
if (!$fn) {
|
|
|
|
throw new ErrorException('Could not open save file: ' . $saveFile . "\n");
|
|
|
|
}
|
2021-06-20 08:13:06 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$currentTokenKey = null;
|
2021-06-20 08:13:06 +02:00
|
|
|
|
2021-06-21 21:21:54 +02:00
|
|
|
while (!feof($fn)) {
|
|
|
|
|
|
|
|
$line = fgets($fn);
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$tokenFound = false;
|
|
|
|
|
|
|
|
foreach ($tokens as $key => $store) {
|
|
|
|
if (preg_match('/\b' . $key . '\b/', $line))
|
|
|
|
{
|
|
|
|
if (array_key_exists($key, $loadedTokens)) {
|
|
|
|
throw new ErrorException("TOKEN ALREADY EXISTS! : $key\n");
|
|
|
|
}
|
|
|
|
$tokenFound = true;
|
|
|
|
$loadedTokens[$key] = [];
|
|
|
|
$currentTokenKey = $key;
|
|
|
|
break;
|
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
if (!$tokenFound && $line != false) {
|
|
|
|
array_push($loadedTokens[$currentTokenKey], $line);
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fclose($fn);
|
|
|
|
|
|
|
|
return $loadedTokens;
|
|
|
|
}
|
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
function getFileData($file, &$tokens)
|
|
|
|
{
|
2021-06-28 09:05:07 +02:00
|
|
|
$currentTokens = [];
|
|
|
|
|
|
|
|
$fn = fopen($file, "r");
|
|
|
|
|
|
|
|
while (!feof($fn)) {
|
|
|
|
|
|
|
|
$line = fgets($fn);
|
|
|
|
|
|
|
|
foreach ($tokens as $key => $store) {
|
|
|
|
if (preg_match('/\b' . $key . '_END\b/', $line)) {
|
|
|
|
array_pop($currentTokens);
|
|
|
|
break;
|
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$size = sizeof($currentTokens);
|
|
|
|
|
|
|
|
if ($size > 0) {
|
|
|
|
array_push($tokens[$currentTokens[$size - 1]], $line);
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($tokens as $key => $store) {
|
|
|
|
if (preg_match('/\b' . $key . '_START\b/', $line)) {
|
|
|
|
array_push($currentTokens, $key);
|
|
|
|
break;
|
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fclose($fn);
|
2021-07-03 10:40:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function save($file, $tokens) {
|
|
|
|
|
|
|
|
echo "saving file " . $file . "\n";
|
|
|
|
|
|
|
|
getFileData($file, $tokens);
|
2021-06-28 09:05:07 +02:00
|
|
|
|
|
|
|
$saveFile =$file . '.saved';
|
|
|
|
|
|
|
|
$saved = [];
|
2021-06-21 10:51:57 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$stores = [];
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
foreach ($tokens as $key => $store) {
|
|
|
|
if (sizeof($store) > 0) {
|
|
|
|
$stores[$key] = $store;
|
|
|
|
array_push($saved, $key . "\n");
|
|
|
|
foreach ($store as $line) {
|
|
|
|
array_push($saved, $line);
|
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
file_put_contents($saveFile, $saved);
|
|
|
|
|
|
|
|
echo "saved file $saveFile\n";
|
|
|
|
|
|
|
|
return [
|
|
|
|
$saveFile,
|
|
|
|
$stores
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteSavedFile($saveFile)
|
|
|
|
{
|
2021-07-03 10:40:05 +02:00
|
|
|
if ($saveFile && file_exists($saveFile)) {
|
2021-06-28 09:05:07 +02:00
|
|
|
unlink($saveFile);
|
|
|
|
} else {
|
2021-07-03 10:40:05 +02:00
|
|
|
echo "Did not unlink file $saveFile because it did not exist.\n";
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function getWhitespace($contents, $token)
|
|
|
|
{
|
|
|
|
$matches = [];
|
|
|
|
|
2021-06-29 10:57:24 +02:00
|
|
|
if (preg_match('/^\n*(\s*)\b' . $token . '\b/m', $contents, $matches)) {
|
2021-06-28 09:05:07 +02:00
|
|
|
return [
|
|
|
|
'white-space' => $matches[1],
|
|
|
|
'inline-comment' => false
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
|
2021-06-29 10:57:24 +02:00
|
|
|
if (preg_match('/^\n*(\s*)\/\/\b' . $token . '\b/m', $contents, $matches)) {
|
2021-06-28 09:05:07 +02:00
|
|
|
return [
|
|
|
|
'white-space' => $matches[1],
|
|
|
|
'inline-comment' => true
|
|
|
|
];
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
return null;
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
function updateSection($file, $token, $updates, $separator = "") {
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
if (getType($updates) === 'array') {
|
|
|
|
$updates = implode($separator, $updates);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strlen($updates) <= 0) {
|
|
|
|
echo "No contents to be updated for token $token\n";
|
2021-06-28 10:07:15 +02:00
|
|
|
return false;
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (substr($updates, -1) !== "\n") {
|
|
|
|
$updates .= "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$contents = file_get_contents($file);
|
|
|
|
|
|
|
|
$whiteSpaceObject = getWhitespace($contents, $token . '_END');
|
|
|
|
|
|
|
|
if ($whiteSpaceObject === null) {
|
|
|
|
/**
|
|
|
|
* This file does not contain the token which requires an update - we can return here
|
|
|
|
*/
|
2021-06-28 10:07:15 +02:00
|
|
|
echo "Skipping token $token because it was not found but it could be generated soon...\n";
|
|
|
|
return $token;
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$endToken = $token . "_END";
|
|
|
|
|
|
|
|
if ($whiteSpaceObject['inline-comment']) {
|
|
|
|
$endToken = '//' . $endToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
$whiteSpace = $whiteSpaceObject['white-space'];
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$contents = preg_replace(
|
|
|
|
'/\b' . $token . '_START\b.*?\b' . $token . '_END\b/s',
|
|
|
|
$token . "_START\n" . $updates . $whiteSpace . $endToken,
|
|
|
|
$contents
|
|
|
|
);
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
file_put_contents($file, $contents);
|
2021-06-28 10:07:15 +02:00
|
|
|
|
|
|
|
return true;
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
function getPropertyListItems($store)
|
|
|
|
{
|
|
|
|
$propertyListItems = [];
|
|
|
|
|
|
|
|
foreach ($store as $item) {
|
|
|
|
|
|
|
|
$item = trim($item);
|
|
|
|
|
|
|
|
$result = preg_split('/=/', $item);
|
|
|
|
$propertyListItem = '- ' . $result[0]. ' (Default value ' . $result[1] . ")";
|
|
|
|
array_push($propertyListItems, $propertyListItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $propertyListItems;
|
|
|
|
}
|
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
function getMethodListItems($store)
|
|
|
|
{
|
|
|
|
$methodListItems = [];
|
|
|
|
|
|
|
|
foreach ($store as $item) {
|
|
|
|
$details = getMethodDetails($item);
|
|
|
|
$methodListItem = '- ' . $details['methodName'] . '(' . $details['args'] .")\n";
|
|
|
|
$methodListItem .= "\t\t\t\t" . wordwrap($details['comment'], 110, "\n\t\t\t\t") . "\n";
|
|
|
|
array_push($methodListItems, $methodListItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $methodListItems;
|
|
|
|
}
|
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
function doGetInheritedTemplateUpdates($node, $restoreTokens, $inherited = true)
|
2021-07-01 16:39:25 +02:00
|
|
|
{
|
|
|
|
try {
|
2021-07-03 10:40:05 +02:00
|
|
|
$saveFile = $node->file . '.saved';
|
|
|
|
|
|
|
|
if (!file_exists($saveFile)) {
|
|
|
|
$result = save($node->file, $restoreTokens);
|
|
|
|
}
|
|
|
|
|
2021-07-01 16:39:25 +02:00
|
|
|
$tokens = loadSaved($node->file, $restoreTokens);
|
|
|
|
} catch (ErrorException $e) {
|
|
|
|
echo $e->getMessage();
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
$updates = '';
|
|
|
|
|
|
|
|
if ($node->parent !== null && $node->parent->name !== "R3") {
|
2021-07-03 10:40:05 +02:00
|
|
|
$updates = rtrim(doGetInheritedTemplateUpdates($node->parent, $restoreTokens)) . "\n";
|
2021-07-01 16:39:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$template = file_get_contents('src/templates/generate_inherited.template');
|
|
|
|
|
|
|
|
$CLASS_NAME = $node->name;
|
2021-07-01 23:09:35 +02:00
|
|
|
|
|
|
|
$token = 'CUSTOM_OPTIONS';
|
|
|
|
$store = getTokenStore($token, $tokens);
|
|
|
|
if (sizeof($store) <= 0) {
|
2021-07-03 10:40:05 +02:00
|
|
|
if ($inherited) {
|
|
|
|
$PROPERTY_LIST = '<no inherited properties>';
|
|
|
|
} else {
|
|
|
|
$PROPERTY_LIST = '<no static properties>';
|
2021-07-01 23:09:35 +02:00
|
|
|
}
|
2021-07-03 10:40:05 +02:00
|
|
|
} else {
|
|
|
|
$propertyListItems = getPropertyListItems($store);
|
|
|
|
$PROPERTY_LIST = implode("\n ", $propertyListItems);
|
2021-07-01 23:09:35 +02:00
|
|
|
}
|
2021-07-03 10:40:05 +02:00
|
|
|
$PROPERTY_LIST = trim($PROPERTY_LIST);
|
2021-07-01 23:09:35 +02:00
|
|
|
|
|
|
|
$token = 'CUSTOM_METHODS';
|
|
|
|
$store = getTokenStore($token, $tokens);
|
|
|
|
|
|
|
|
if (sizeof($store) <= 0) {
|
2021-07-03 10:40:05 +02:00
|
|
|
if ($inherited) {
|
|
|
|
$METHOD_LIST = '<no inherited methods>';
|
|
|
|
} else {
|
|
|
|
$METHOD_LIST = '<no methods>';
|
|
|
|
}
|
2021-07-01 23:09:35 +02:00
|
|
|
} else {
|
|
|
|
$methodListItems = getMethodListItems($store);
|
2021-07-03 10:40:05 +02:00
|
|
|
$METHOD_LIST = implode("\n ", $methodListItems);
|
2021-07-01 23:09:35 +02:00
|
|
|
}
|
2021-07-03 10:40:05 +02:00
|
|
|
$METHOD_LIST = trim($METHOD_LIST);
|
2021-07-01 23:09:35 +02:00
|
|
|
|
|
|
|
$token = 'CUSTOM_STATIC_METHODS';
|
|
|
|
$store = getTokenStore($token, $tokens);
|
|
|
|
|
|
|
|
if (sizeof($store) <= 0) {
|
2021-07-03 10:40:05 +02:00
|
|
|
if ($inherited) {
|
|
|
|
$STATIC_METHOD_LIST = '<no inherited static methods>';
|
|
|
|
} else {
|
|
|
|
$STATIC_METHOD_LIST = '<no static methods>';
|
|
|
|
}
|
2021-07-01 23:09:35 +02:00
|
|
|
} else {
|
|
|
|
$methodListItems = getMethodListItems($store);
|
2021-07-03 10:40:05 +02:00
|
|
|
$STATIC_METHOD_LIST = implode("\n ", $methodListItems);
|
|
|
|
}
|
|
|
|
$STATIC_METHOD_LIST = trim($STATIC_METHOD_LIST);
|
|
|
|
|
|
|
|
if ($inherited) {
|
|
|
|
$description = 'Inherited from';
|
|
|
|
} else {
|
|
|
|
$description = 'Belonging to';
|
2021-07-01 23:09:35 +02:00
|
|
|
}
|
2021-07-01 16:39:25 +02:00
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
$updated = str_replace('DESCRIPTION', $description, $template);
|
|
|
|
$updated = str_replace('CLASS_NAME', $CLASS_NAME, $updated);
|
2021-07-01 16:39:25 +02:00
|
|
|
$updated = str_replace('PROPERTY_LIST', $PROPERTY_LIST, $updated);
|
|
|
|
$updated = str_replace('STATIC_METHOD_LIST', $STATIC_METHOD_LIST, $updated);
|
|
|
|
$updated = str_replace('METHOD_LIST', $METHOD_LIST, $updated);
|
|
|
|
$updates .= $updated;
|
|
|
|
|
|
|
|
return $updates;
|
|
|
|
}
|
|
|
|
|
|
|
|
function generateInherited($file, $restoreTokens)
|
|
|
|
{
|
|
|
|
|
|
|
|
echo "Generating inherited fields for $file\n";
|
|
|
|
|
|
|
|
global $graph;
|
|
|
|
|
|
|
|
$node = $graph->search('file', $file);
|
|
|
|
|
|
|
|
if ($node === null) {
|
|
|
|
/**
|
|
|
|
* This node is not part of R3
|
|
|
|
*/
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($node->parent === null) {
|
|
|
|
/**
|
|
|
|
* This node has no inherited properties
|
|
|
|
*/
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($node->parent->name === 'R3') {
|
|
|
|
/**
|
|
|
|
* This is a base class
|
|
|
|
*/
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
$updates = doGetInheritedTemplateUpdates($node, $restoreTokens, false);
|
2021-07-01 16:39:25 +02:00
|
|
|
|
|
|
|
updateSection($file, 'GENERATE_INHERITED' , $updates);
|
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
function generateInitOptions($file, $tokens)
|
|
|
|
{
|
|
|
|
$token = 'CUSTOM_OPTIONS';
|
|
|
|
$store = getTokenStore($token, $tokens);
|
|
|
|
|
|
|
|
if (sizeof($store) <= 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "Will be building options for $token\n";
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$header = file_get_contents('src/templates/generate_custom_options_init_header.template');
|
|
|
|
$template = file_get_contents('src/templates/generate_custom_options_init.template');
|
|
|
|
|
|
|
|
$updates = $header;
|
|
|
|
|
|
|
|
foreach ($store as $item) {
|
|
|
|
$item = trim($item);
|
|
|
|
$key_value = preg_split('/=/', $item);
|
|
|
|
if ($key_value === false) {
|
|
|
|
continue;
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
$key = $key_value[0];
|
|
|
|
$value = $key_value[1];
|
|
|
|
$updated = str_replace('KEY', $key, $template);
|
|
|
|
$updated = str_replace('VALUE', $value, $updated);
|
|
|
|
$updates .= $updated;
|
|
|
|
}
|
|
|
|
|
|
|
|
updateSection($file, 'GENERATE_OPTIONS_INIT' , $updates);
|
|
|
|
}
|
|
|
|
|
|
|
|
function getTokenStore($tokenName, $tokens)
|
|
|
|
{
|
|
|
|
if (array_key_exists($tokenName, $tokens)) {
|
|
|
|
return $tokens[$tokenName];
|
|
|
|
}
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
function getInstanceMappings($tokens)
|
|
|
|
{
|
|
|
|
$instanceMappings = [];
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
foreach (getTokenStore('CUSTOM_INSTANCE_OPTIONS_MAPPING', $tokens) as $mapping) {
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$mapping = trim($mapping);
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$key_value = preg_split('/=/', $mapping);
|
|
|
|
|
|
|
|
if ($key_value === false) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$key = $key_value[0];
|
|
|
|
$value = $key_value[1];
|
|
|
|
|
|
|
|
$instanceMappings[$key] = $value;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $instanceMappings;
|
|
|
|
}
|
|
|
|
|
|
|
|
function isExcluded($key, $tokens)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (array_key_exists('CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS', $tokens)) {
|
|
|
|
|
|
|
|
$excluded = [];
|
|
|
|
|
|
|
|
foreach ($tokens['CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS'] as $exclude) {
|
|
|
|
array_push($excluded, trim($exclude));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (in_array($key, $excluded)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function doInstanceUpdate($template, $tokens, $asArray = false)
|
|
|
|
{
|
|
|
|
$token = 'CUSTOM_OPTIONS';
|
|
|
|
$store = getTokenStore($token, $tokens);
|
|
|
|
|
|
|
|
if (sizeof($store) <= 0) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
$instanceMappings = getInstanceMappings($tokens);
|
|
|
|
|
|
|
|
$updates = '';
|
|
|
|
|
|
|
|
if ($asArray) {
|
|
|
|
$updates = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($store as $item) {
|
|
|
|
|
|
|
|
$item = trim($item);
|
|
|
|
|
|
|
|
$key_value = preg_split('/=/', $item);
|
|
|
|
|
|
|
|
if ($key_value === false) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$key = $key_value[0];
|
|
|
|
$value = $key_value[0];
|
|
|
|
|
|
|
|
if (array_key_exists($key, $instanceMappings)) {
|
|
|
|
$value = $instanceMappings[$key];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isExcluded($key, $tokens)){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$updated = str_replace('INSTANCE_KEY', $value, $template);
|
|
|
|
$updated = str_replace('KEY', $key, $updated);
|
|
|
|
if ($asArray) {
|
|
|
|
array_push($updates, $updated);
|
|
|
|
} else {
|
|
|
|
$updates .= $updated;
|
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
|
|
|
|
return $updates;
|
|
|
|
}
|
|
|
|
|
|
|
|
function generateCreateInstanceOptions($file, $tokens)
|
|
|
|
{
|
|
|
|
$template = file_get_contents('src/templates/generate_create_instance_options.template');
|
|
|
|
|
|
|
|
$updates = doInstanceUpdate($template, $tokens, true);
|
|
|
|
|
|
|
|
if ($updates) {
|
|
|
|
echo "Updating create instance options\n";
|
|
|
|
updateSection($file, 'GENERATE_CREATE_INSTANCE_OPTIONS', $updates, ",\n");
|
|
|
|
} else {
|
|
|
|
echo "No create instance options found to generate\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Process updateInstance options
|
|
|
|
*/
|
|
|
|
function generateUpdateInstanceOptions($file, $tokens)
|
|
|
|
{
|
|
|
|
$template = file_get_contents('src/templates/generate_update_instance_options.template');
|
|
|
|
|
|
|
|
$updates = doInstanceUpdate($template, $tokens);
|
|
|
|
|
|
|
|
if ($updates) {
|
|
|
|
echo "Updating update instance options\n";
|
|
|
|
updateSection($file, 'GENERATE_UPDATE_INSTANCE_OPTIONS', $updates);
|
|
|
|
} else {
|
|
|
|
echo "No update instance options found to generate\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Process updateFromInstance options
|
|
|
|
*/
|
|
|
|
function generateUpdateFromInstanceOptions($file, $tokens)
|
|
|
|
{
|
|
|
|
$template = file_get_contents('src/templates/generate_update_from_instance_options.template');
|
|
|
|
|
|
|
|
$updates = doInstanceUpdate($template, $tokens);
|
|
|
|
|
|
|
|
if ($updates) {
|
|
|
|
echo "Updating update from instance options\n";
|
|
|
|
updateSection($file, 'GENERATE_UPDATE_FROM_INSTANCE_OPTIONS', $updates);
|
|
|
|
} else {
|
|
|
|
echo "No update from instance options found to generate\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
/**
|
|
|
|
* @param $item
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
function getMethodDetails($item)
|
2021-06-28 09:05:07 +02:00
|
|
|
{
|
2021-07-01 23:09:35 +02:00
|
|
|
$item = trim($item);
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$methodName = $item;
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$matches = [];
|
|
|
|
$result = preg_match('/^(.*?)\(/', $item, $matches);
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
if ($result !== false && sizeof($matches) >= 2) {
|
|
|
|
$methodName = $matches[1];
|
|
|
|
}
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$args = '';
|
|
|
|
$result = preg_match('/\((.*?)\)/', $item, $matches);
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
if ($result !== false && sizeof($matches) >= 2) {
|
|
|
|
$args = $matches[1];
|
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$argsArray = preg_split('/,(\s*)/', $args);
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$comment = 'No comment';
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$result = preg_match('/.*?\).*?(\w.*$)/', $item, $matches);
|
|
|
|
if ($result !== false && sizeof($matches) >= 2) {
|
|
|
|
$comment = $matches[1];
|
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$returns = preg_split('/@return[s]*\s*/', $comment);
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
if (sizeof($returns) > 1) {
|
|
|
|
$comment = $returns[0];
|
|
|
|
$returns = $returns[1];
|
|
|
|
} else {
|
|
|
|
$returns = null;
|
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$methodTokenName = strtoupper(from_camel_case($methodName));
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
return [
|
|
|
|
'methodName' => $methodName,
|
|
|
|
'methodTokenName' => $methodTokenName,
|
|
|
|
'args' => $args,
|
|
|
|
'argsArray' => $argsArray,
|
|
|
|
'comment' => $comment,
|
|
|
|
'returns' => $returns
|
|
|
|
];
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
}
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
/**
|
|
|
|
* @param $template
|
|
|
|
* @param $tokens
|
|
|
|
* @param $token
|
|
|
|
* @return string|null
|
|
|
|
*/
|
|
|
|
function doMethodUpdate($template, $tokens, $token)
|
|
|
|
{
|
|
|
|
$store = getTokenStore($token, $tokens);
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
if (sizeof($store) <= 0) {
|
|
|
|
return null;
|
|
|
|
}
|
2021-06-29 11:09:25 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$updates = '';
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
foreach ($store as $item) {
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$detail = getMethodDetails($item);
|
|
|
|
$argsArray = $detail['argsArray'];
|
|
|
|
$args = $detail['args'];
|
|
|
|
$methodTokenName = $detail['methodTokenName'];
|
|
|
|
$methodName = $detail['methodName'];
|
|
|
|
$comment = $detail['comment'];
|
|
|
|
$returns = $detail['returns'];
|
2021-06-28 10:07:15 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
if (sizeof($argsArray) > 1) {
|
|
|
|
$args = implode(",\n ", $argsArray);
|
|
|
|
$args = "\n " . $args . "\n ";
|
|
|
|
$params = implode("\n * @param ", $argsArray);
|
2021-07-03 10:40:05 +02:00
|
|
|
$params = "\n * @param " . $params;
|
2021-07-01 23:09:35 +02:00
|
|
|
} else if (sizeof($argsArray) === 1) {
|
|
|
|
if ($args === '') {
|
|
|
|
$params = $args;
|
|
|
|
} else {
|
|
|
|
$params = "\n * @param " . $args;
|
|
|
|
}
|
2021-06-29 10:57:24 +02:00
|
|
|
}
|
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
if ($returns !== null) {
|
|
|
|
$returns = '\n * @returns ' . $returns;
|
|
|
|
}
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-01 23:09:35 +02:00
|
|
|
$comment = wordwrap($comment, 110, "\n * ");
|
2021-06-29 10:57:24 +02:00
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
$updated = $template;
|
|
|
|
|
|
|
|
$potentialTemplate = strtolower('src/templates/' . $methodTokenName . '.template');
|
|
|
|
if (file_exists($potentialTemplate)) {
|
|
|
|
$functionTemplate = file_get_contents($potentialTemplate);
|
|
|
|
$updated = preg_replace('/^\s*FUNCTION_TEMPLATE/m', $functionTemplate, $updated);
|
|
|
|
} else {
|
|
|
|
$updated = preg_replace('/^.*?FUNCTION_TEMPLATE.*\n/m', '', $updated);
|
|
|
|
}
|
|
|
|
|
|
|
|
$updated = str_replace('METHOD_ARGS', $args, $updated);
|
2021-06-28 10:07:15 +02:00
|
|
|
$updated = str_replace('METHOD_NAME_UPPERCASE', $methodTokenName, $updated);
|
2021-06-28 09:05:07 +02:00
|
|
|
$updated = str_replace('METHOD_NAME', $methodName, $updated);
|
2021-06-29 10:57:24 +02:00
|
|
|
$updated = str_replace('COMMENT', $comment, $updated);
|
|
|
|
$updated = str_replace('PARAMS', $params, $updated);
|
|
|
|
$updated = str_replace('RETURNS', $returns, $updated);
|
2021-06-28 09:05:07 +02:00
|
|
|
$updates .= $updated;
|
|
|
|
}
|
|
|
|
return $updates;
|
|
|
|
}
|
|
|
|
|
|
|
|
function generateStaticMethods($file, $tokens)
|
|
|
|
{
|
|
|
|
$token = 'CUSTOM_STATIC_METHODS';
|
|
|
|
|
|
|
|
$template = file_get_contents('src/templates/generate_static_methods.template');
|
|
|
|
|
|
|
|
$updates = doMethodUpdate($template, $tokens, $token);
|
|
|
|
|
|
|
|
if ($updates) {
|
|
|
|
echo "Updating static methods\n";
|
|
|
|
updateSection($file, 'GENERATE_STATIC_METHODS', $updates);
|
|
|
|
} else {
|
|
|
|
echo "No static methods found to generate\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function generateMethods($file, $tokens)
|
|
|
|
{
|
|
|
|
$token = 'CUSTOM_METHODS';
|
|
|
|
|
|
|
|
$template = file_get_contents('src/templates/generate_methods.template');
|
|
|
|
|
|
|
|
$updates = doMethodUpdate($template, $tokens, $token);
|
|
|
|
|
|
|
|
if ($updates) {
|
|
|
|
echo "Updating methods\n";
|
|
|
|
updateSection($file, 'GENERATE_METHODS', $updates);
|
|
|
|
} else {
|
|
|
|
echo "No methods found to generate\n";
|
|
|
|
}
|
|
|
|
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
|
|
|
|
2021-07-01 11:04:00 +02:00
|
|
|
$nodeList = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @throws ErrorException
|
|
|
|
*/
|
2021-07-01 16:39:25 +02:00
|
|
|
function buildNodeList($file)
|
2021-07-01 11:04:00 +02:00
|
|
|
{
|
|
|
|
echo "loading file $file\n";
|
|
|
|
|
|
|
|
global $nodeList;
|
|
|
|
|
|
|
|
$fn = fopen($file, "r");
|
|
|
|
|
|
|
|
$line = '';
|
|
|
|
$found = false;
|
|
|
|
|
|
|
|
while (!feof($fn) && !$found) {
|
|
|
|
$line = fgets($fn);
|
|
|
|
|
|
|
|
if (preg_match('/^class\s+/', $line)) {
|
|
|
|
$found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($found) {
|
|
|
|
// echo $line . "\n";
|
|
|
|
|
|
|
|
$matches = [];
|
|
|
|
|
|
|
|
$result = preg_match('/^class\s+(.*?)(\s+extends\s+(.*?)\s+|\s+?{)/', $line, $matches);
|
|
|
|
|
|
|
|
if ($result === false) {
|
|
|
|
throw new ErrorException('Could not match');
|
|
|
|
}
|
|
|
|
|
|
|
|
$extends = null;
|
|
|
|
|
|
|
|
if (sizeof($matches) === 4) {
|
|
|
|
$class = $matches[1];
|
|
|
|
$extends = $matches[3];
|
|
|
|
} else if (sizeof($matches) === 3) {
|
|
|
|
$class = $matches[1];
|
|
|
|
} else {
|
|
|
|
throw new ErrorException('Unhandled case');
|
|
|
|
}
|
|
|
|
|
|
|
|
$node = new Node(
|
|
|
|
$file,
|
|
|
|
$class,
|
|
|
|
$extends
|
|
|
|
);
|
|
|
|
|
|
|
|
array_push($nodeList, $node);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
echo "not found\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose($fn);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-06-21 21:21:54 +02:00
|
|
|
global $files;
|
|
|
|
|
|
|
|
foreach ($files as $file) {
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$saveFile = null;
|
2021-06-21 21:21:54 +02:00
|
|
|
|
|
|
|
if ($argv[2] == 'save') {
|
|
|
|
|
2021-06-28 10:07:15 +02:00
|
|
|
$saveFile = $file . '.saved';
|
|
|
|
|
|
|
|
if (file_exists($saveFile)) {
|
|
|
|
|
|
|
|
echo "A previous restore operation did not complete - please remove the saved file before trying this again\n";
|
|
|
|
echo "The save file is located at $saveFile\n";
|
|
|
|
echo "Remove easily with:\n";
|
|
|
|
echo "rm $saveFile\n";
|
|
|
|
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$tokens = getTokens('CUSTOM');
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$result = save($file, $tokens);
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
exit(0);
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
} else if ($argv[2] == 'restore') {
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 10:07:15 +02:00
|
|
|
$saveFile = $file . '.saved';
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$restoreTokens = getTokens('CUSTOM');
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
$restoreTokenKeys = array_keys($restoreTokens);
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-07-01 16:39:25 +02:00
|
|
|
try {
|
|
|
|
$tokens = loadSaved($file, $restoreTokens);
|
|
|
|
} catch (ErrorException $e) {
|
|
|
|
echo $e->getMessage();
|
|
|
|
exit(1);
|
|
|
|
}
|
2021-06-19 11:27:32 +02:00
|
|
|
|
2021-06-28 10:07:15 +02:00
|
|
|
$skipped = [];
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
foreach ($tokens as $token => $store) {
|
|
|
|
if (in_array($token, $restoreTokenKeys)) {
|
|
|
|
updateSection($file, $token, $store);
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
2021-06-20 08:13:06 +02:00
|
|
|
|
2021-07-03 10:40:05 +02:00
|
|
|
/**
|
|
|
|
* Check if we have no saved custom methods but introduced them
|
|
|
|
* from a template
|
|
|
|
*/
|
|
|
|
if (!in_array('CUSTOM_METHODS', array_keys($tokens))){
|
|
|
|
$methodTokens = getTokens('CUSTOM_METHODS');
|
|
|
|
getFileData($file, $methodTokens);
|
|
|
|
|
|
|
|
if (sizeof($methodTokens['CUSTOM_METHODS']) > 0) {
|
|
|
|
$tokens['CUSTOM_METHODS'] = $methodTokens['CUSTOM_METHODS'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
generateMethods($file, $tokens);
|
|
|
|
|
|
|
|
generateStaticMethods($file, $tokens);
|
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
generateInitOptions($file, $tokens);
|
2021-06-20 08:13:06 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
generateCreateInstanceOptions($file, $tokens);
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
generateUpdateInstanceOptions($file, $tokens);
|
|
|
|
|
|
|
|
generateUpdateFromInstanceOptions($file, $tokens);
|
|
|
|
|
2021-06-28 10:07:15 +02:00
|
|
|
/**
|
|
|
|
* Try to restore the rest of the old data because now methods were generated.
|
|
|
|
* If not all data restores now - a method name / token has changed and we need
|
|
|
|
* to notify the user
|
|
|
|
*/
|
2021-06-21 21:21:54 +02:00
|
|
|
|
2021-06-28 09:05:07 +02:00
|
|
|
foreach ($tokens as $token => $store) {
|
|
|
|
if (in_array($token, $restoreTokenKeys)) {
|
2021-06-28 10:07:15 +02:00
|
|
|
$result = updateSection($file, $token, $store);
|
|
|
|
if ($result !== true && $result !== false) {
|
|
|
|
array_push($skipped, $result);
|
|
|
|
}
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
2021-06-28 09:05:07 +02:00
|
|
|
}
|
|
|
|
|
2021-06-28 10:07:15 +02:00
|
|
|
if (sizeof($skipped) !== 0) {
|
|
|
|
echo "Some tokens could not be restored because they could not be found in the new version\n";
|
|
|
|
print_r($skipped);
|
|
|
|
echo "Please restore them manually from the saved file :$saveFile\n";
|
|
|
|
echo "If you do not do it now - on the next template update code will be overwritten and you could lose code!!!\n";
|
|
|
|
exit(1);
|
|
|
|
} else {
|
2021-07-03 10:40:05 +02:00
|
|
|
deleteSavedFile($saveFile);
|
|
|
|
exit(0);
|
2021-06-28 10:07:15 +02:00
|
|
|
}
|
2021-07-01 11:04:00 +02:00
|
|
|
} else if ($argv[2] == 'build-graph') {
|
2021-07-01 16:39:25 +02:00
|
|
|
buildNodeList($file);
|
2021-06-21 21:21:54 +02:00
|
|
|
}
|
2021-06-19 11:27:32 +02:00
|
|
|
}
|
|
|
|
|
2021-07-03 16:11:19 +02:00
|
|
|
function generateIndex($types)
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Graph $graph
|
|
|
|
*/
|
|
|
|
global $graph;
|
|
|
|
|
|
|
|
foreach ($types as $type) {
|
|
|
|
|
|
|
|
$systemNode = $graph->search('name', $type);
|
|
|
|
|
|
|
|
$template = file_get_contents('src/templates/index.template');
|
|
|
|
|
|
|
|
$imports = [];
|
|
|
|
$exports = [];
|
|
|
|
|
|
|
|
$nodes = array_merge([$systemNode], $systemNode->children);
|
|
|
|
|
|
|
|
foreach ($nodes as $child) {
|
|
|
|
|
|
|
|
if ($type === 'System') {
|
|
|
|
$file = str_replace('src/r3/r3-system', '.', $child->file);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($type === 'Component') {
|
|
|
|
$file = str_replace('src/r3/r3-component', '.', $child->file);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($type === 'R3') {
|
|
|
|
$file = str_replace('src/r3', '.', $child->file);
|
|
|
|
}
|
|
|
|
|
|
|
|
array_push($imports, "const " . $child->name . ' = require(\'' . $file . "');");
|
|
|
|
array_push($exports, $child->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
$indexFile = 'src/r3/index.js';
|
|
|
|
|
|
|
|
if ($type === 'System') {
|
|
|
|
$indexFile = 'src/r3/r3-system/index.js';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($type === 'Component') {
|
|
|
|
$indexFile = 'src/r3/r3-component/index.js';
|
|
|
|
}
|
|
|
|
|
|
|
|
file_put_contents($indexFile, $template);
|
|
|
|
|
|
|
|
updateSection($indexFile, 'GENERATE_IMPORTS', implode("\n", $imports));
|
|
|
|
updateSection($indexFile, 'GENERATE_EXPORTS', " " . implode(",\n ", $exports));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-01 11:04:00 +02:00
|
|
|
if ($argv[2] == 'build-graph') {
|
2021-07-01 16:39:25 +02:00
|
|
|
|
|
|
|
global $nodeList;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Now generate the graph based on the new classes
|
|
|
|
*/
|
2021-07-01 11:04:00 +02:00
|
|
|
$graph = new Graph(
|
|
|
|
$nodeList
|
|
|
|
);
|
2021-07-01 16:39:25 +02:00
|
|
|
|
|
|
|
$restoreTokens = getTokens('CUSTOM');
|
|
|
|
|
|
|
|
$restoreTokenKeys = array_keys($restoreTokens);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Now start processing the files again - this time generating linked objects / inherited properties / methods
|
|
|
|
*/
|
|
|
|
foreach ($files as $file) {
|
|
|
|
|
|
|
|
generateInherited($file, $restoreTokens);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-03 16:11:19 +02:00
|
|
|
generateIndex(
|
|
|
|
[
|
|
|
|
'System',
|
|
|
|
'Component',
|
|
|
|
'R3'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2021-07-01 16:39:25 +02:00
|
|
|
foreach ($files as $file) {
|
|
|
|
|
|
|
|
$saveFile = $file . '.saved';
|
|
|
|
|
|
|
|
deleteSavedFile($saveFile);
|
2021-07-03 10:40:05 +02:00
|
|
|
|
2021-07-01 16:39:25 +02:00
|
|
|
}
|
|
|
|
|
2021-07-01 11:04:00 +02:00
|
|
|
}
|
|
|
|
|
2021-07-01 16:39:25 +02:00
|
|
|
|
|
|
|
|
2021-06-19 11:27:32 +02:00
|
|
|
exit(0);
|
|
|
|
|
|
|
|
?>
|