Skip to content

Commit

Permalink
webpath fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sroehrl committed Aug 8, 2022
1 parent 3e335d4 commit 5b074fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NeoanApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public function __construct(string $appPath, string $publicPath)
Env::initialize($appPath);
$this->appPath = $appPath;
$this->publicPath = $publicPath;
$this->webPath = $this->findWebPath();
if(isset($_SERVER["SERVER_PROTOCOL"])){
$protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,strpos( $_SERVER["SERVER_PROTOCOL"],'/'))).'://';
if(!defined('base')){
define('base',$protocol . $_SERVER['HTTP_HOST']);
}
}
$this->webPath = $this->findWebPath();


}
Expand All @@ -44,7 +44,7 @@ private function findWebPath(): string
unset($publicPathParts[$i]);
}
}
return '/' . implode('/', $publicPathParts);
return base . '/' . implode('/', $publicPathParts);

}
public function run(): void
Expand Down

0 comments on commit 5b074fe

Please sign in to comment.