Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f137dbe73 | |||
| 7fdf4d32d5 | |||
| ff5663282f |
@ -60,15 +60,15 @@ 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\'] ?? \'localhost\';
|
||||
$uri = $_SERVER[\'REQUEST_URI\'] ?? \'\'; // obsahuje aj query string
|
||||
|
||||
define(\'URL_PREFIX\', $protocol.$host.str_replace(basename($_SERVER[\'SCRIPT_NAME\']), \'\', $_SERVER[\'SCRIPT_NAME\']));
|
||||
');
|
||||
|
||||
copyFile($source_dir . 'Maintenance.php', '<' . '?php
|
||||
|
||||
namespace ' . $namespace . ';
|
||||
namespace ' . rtrim($namespace, '\\') . ';
|
||||
|
||||
class Maintenance extends \TPsoft\DBmodel\Maintenance
|
||||
{
|
||||
@ -130,7 +130,6 @@ copyFile($source_dir . 'Init.php', '<' . '?php
|
||||
|
||||
require __DIR__ . \'/../vendor/autoload.php\';
|
||||
|
||||
use \Exception;
|
||||
use \TPsoft\DBmodel\DBmodel;
|
||||
use \\' . $namespace . 'Maintenance;
|
||||
|
||||
@ -191,9 +190,9 @@ if ($suc) {
|
||||
function findProjectRoot(string $startDir): ?string
|
||||
{
|
||||
$dir = realpath($startDir);
|
||||
|
||||
if (!$dir) return null;
|
||||
while ($dir && $dir !== dirname($dir)) {
|
||||
if (file_exists($dir . '/composer.json')) {
|
||||
if (is_file($dir . '/vendor/autoload.php')) {
|
||||
return $dir;
|
||||
}
|
||||
$dir = dirname($dir);
|
||||
|
||||
Reference in New Issue
Block a user