0
I downloaded the site from the server and put it to run on localhost. However, it is not calling the files correctly. First, it calls "http://localhost" and then the folder path, with backslash.
There is a rule set to call all files:
<?php
define("MY_BASE_DIR", 'C:');
define("SITE_PATH", __DIR__ . '/');
define("SITE_VIRTUAL_DIR", str_replace($_SERVER["DOCUMENT_ROOT"], "", SITE_PATH));
define("ENGINE_PATH", SITE_PATH.'includes/fw/'); // caminho pro FW
define("CMS_ENGINE_PATH", SITE_PATH.'includes/cms/cms.php');
I tried to change that rule, but to no avail.
This backslash setting is some chunk in the code files you have either modified or is my local server configuration (I’m using Wampserver)?
----------------------------- UPDATE ------------------------------
This is the file that gives way to the files:
public function Setup()
{
parent::Setup();
if (\Browser::Obsolet())
{
$this->context->UpdateYourBrowser();
}
if(!defined("ADMIN_DIR")){
define("ADMIN_DIR", dirname($_SERVER["SCRIPT_NAME"]) . "/");
define("ADMIN_URL", DOMAIN . ADMIN_DIR );
}
if(!defined("ADMIN_PATH"))
{
throw new \Exception("Para acessar um módulo do backend você precisa esta no diretorio do admin/");
}
// configura a sessao do usuario
$this->context->set("USER.SESSION", $this->context->get("USER.SESSION") . ADMIN_PATH . "_ADMIN");
// configura o template do ADMIN
// checa se o usuario especificou algum caminho para o template do ADMIN
$templatePath = $this->context->get("CMS.ADMIN.TEMPLATE_PATH");
if(!$templatePath){
$templatePath = ADMIN_PATH;
}
$this->context->setTemplatePath($templatePath); //diretorio raiz de templates?
$this->context->setTemplate($this->context->get('CMS.ADMIN.TEMPLATE')); // seta o template configurado no config.php
// checa se o usuario especificou algum caminho para o template do ADMIN
$templateUrl = $this->context->get("CMS.ADMIN.TEMPLATE_URL");
if(!$templateUrl){
$templateUrl = ADMIN_DIR; // URI do admin: http://localhost/admin/
}
if(!defined("TEMPLATE_URL"))
define("TEMPLATE_URL", $templateUrl . $this->context->TemplateDir() . $this->context->getTemplate() . "/");
}
@Rafaelphp The files are being called through the TEMPLATE_URL
:
<link rel="stylesheet" href="<?php echo TEMPLATE_URL ?>static/css/bootstrap.min.css" rel="stylesheet">
I’m still trying to get him to call it straight, but to no avail.
Did that work on linux? What happens is that the substitution doesn’t happen.
– rray
The DIR takes the current file directory, soon will have the full Windows path, take a look at the $_SERVER array, it contains some alternatives to set SITE_PATH. Just give a
var_dump
in it. I think $_SERVER['REQUEST_URI'] should help you.– Leonardo
you have how to post what you have in the source code ex:
<link rel="stylesheet" type="text/css" href="<?php echo $obj->script_path" />
– rafaelphp
I updated my question, please see if possible.
– Zkk