zmena generovania backend.js na JavaScript lebo Vue projekt nie je typescript,
pridany deploy.bat skript pre nasadenie na produkciu,
This commit is contained in:
@ -29,10 +29,10 @@ if (!$loaded) {
|
||||
}
|
||||
|
||||
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://";
|
||||
$host = $_SERVER['HTTP_HOST'];
|
||||
$uri = $_SERVER['REQUEST_URI']; // obsahuje aj query string
|
||||
$host = $_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? 'localhost');
|
||||
$script_name = $_SERVER['SCRIPT_NAME'] ?? '';
|
||||
|
||||
define('URL_PREFIX', $protocol.$host.str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']));
|
||||
define('URL_PREFIX', $protocol.$host.str_replace(basename($script_name), '', $script_name));
|
||||
|
||||
define('UPLOAD_DIR_ATTACHMENTS', __DIR__.'/../../data/attachments/');
|
||||
if (!file_exists(UPLOAD_DIR_ATTACHMENTS)) {
|
||||
|
||||
@ -1,19 +1,25 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
$display_errors = ini_get('display_errors');
|
||||
ini_set('display_errors', '0');
|
||||
|
||||
ob_start();
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
ob_end_clean();
|
||||
|
||||
$backend_api = new TPsoft\BugreportBackend\API('typescript', 'import.meta.env.VITE_BACKENDAPI_URL', 'backend');
|
||||
ob_start();
|
||||
$backend_api = new TPsoft\BugreportBackend\API('javascript', 'import.meta.env.VITE_BACKENDAPI_URL', 'backend');
|
||||
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$ts_path = realpath(__DIR__ . '/../../frontend/src').'/backend.js';
|
||||
$suc = file_put_contents($ts_path, $output);
|
||||
ini_set('display_errors', $display_errors);
|
||||
|
||||
$js_path = realpath(__DIR__ . '/../../frontend/src').'/backend.js';
|
||||
$suc = file_put_contents($js_path, $output);
|
||||
if ($suc === false) {
|
||||
echo "✗ TypeScript store into file failed\n";
|
||||
echo "✗ JavaScript store into file failed\n";
|
||||
exit(2);
|
||||
}
|
||||
|
||||
echo "✓ TypeScript backend script created\n";
|
||||
echo "✓ JavaScript backend script created\n";
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use \Exception;
|
||||
use \TPsoft\DBmodel\DBmodel;
|
||||
use \TPsoft\BugreportBackend\Maintenance;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user