pridana implementacia backend s composerom a kniznicami TPsoft/APIlite a TPsoft/DBmodel
This commit is contained in:
19
backend/scripts/buildTypeScript.php
Normal file
19
backend/scripts/buildTypeScript.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
ob_start();
|
||||
|
||||
$backend_api = new TPsoft\BugreportBackend\API('typescript', 'import.meta.env.VITE_BACKENDAPI_URL');
|
||||
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$ts_path = realpath(__DIR__ . '/../../frontend/src').'/backend.js';
|
||||
$suc = file_put_contents($ts_path, $output);
|
||||
if ($suc === false) {
|
||||
echo "✗ TypeScript store into file failed\n";
|
||||
exit(2);
|
||||
}
|
||||
|
||||
echo "✓ TypeScript backend script created\n";
|
||||
9
backend/scripts/createModel.php
Normal file
9
backend/scripts/createModel.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../src/Init.php';
|
||||
use \TPsoft\DBmodel\Creator;
|
||||
|
||||
global $dbh;
|
||||
$creator = new Creator($dbh);
|
||||
$creator->rootDir(realpath(__DIR__.'/../src/'));
|
||||
$creator->interact();
|
||||
Reference in New Issue
Block a user