Welcome Guest, Not a member yet? Register   Sign In
Making auto detecting of base url to be compatible with composer
#1

(This post was last modified: 10-19-2019, 07:36 PM by Chivinsdev.)

Hello I love detecting my base url automatically which I discovered not compatible with composer base on http and at the same time not compatible to public file assets including such as:


PHP Code:
<img src="base_url('public/images/').'logo.png'" /> 

And here is my modification of app/Config/App.php

PHP Code:
public function __construct()
{
$root = (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS']) ? "https://" "http://") . $_SERVER['HTTP_HOST'];
$root .= str_replace(basename($_SERVER['SCRIPT_NAME']), ''$_SERVER['SCRIPT_NAME']);

$this->baseURL $root;



Please can you make this compatible with compser it is not working for
PHP Code:
php spark 
which is composer command
Reply


Messages In This Thread
Making auto detecting of base url to be compatible with composer - by Chivinsdev - 10-19-2019, 07:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB