Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: new config way is possible only for not changed folders name? #5323

Open
Jimmi08 opened this issue Aug 22, 2024 · 1 comment
Open
Labels
type: question An ask about behavior that is not found documented anywhere

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Aug 22, 2024

Question

Is it intentional or a bug?

in class2.php

$config = include(e_ROOT.'e107_config.php');

    'plugins'    => 'eplugins/',
    'handlers'   => 'ehandlers/',

if(empty($HANDLERS_DIRECTORY))
{
	$HANDLERS_DIRECTORY = 'e107_handlers/';
}

if(empty($PLUGINS_DIRECTORY))
{
	$PLUGINS_DIRECTORY = 'e107_plugins/';
}

only then are set e107 constants correctly

With the new way of config, $HANDLERS_DIRECTORY is not set and if you use a different folder, this fails.

Thanks

Expected Source

source code

Additional Context

No response

@Jimmi08 Jimmi08 added the type: question An ask about behavior that is not found documented anywhere label Aug 22, 2024
@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Aug 22, 2024

I would recommend testing core (not for using in code by default, just test) with install.php

$ret = array(
'ADMIN_DIRECTORY' => 'customadmin/',
'IMAGES_DIRECTORY' => 'customimages/',
'THEMES_DIRECTORY' => 'customthemes/',
'PLUGINS_DIRECTORY' => 'customplugins/',
'FILES_DIRECTORY' => 'customfiles/', // DEPRECATED!!!
'HANDLERS_DIRECTORY' => 'customhandlers/',
'LANGUAGES_DIRECTORY' => 'customlanguages/',
'DOCS_DIRECTORY' => 'customdocs/',
'MEDIA_DIRECTORY' => 'custommedia/',
'SYSTEM_DIRECTORY' => 'customsystem/',
'CORE_DIRECTORY' => 'customcore/',
'WEB_DIRECTORY' => 'customweb/',
);

$e107_paths = $e107->defaultDirs($ret);

Then you will find that there is an issue with the site hash, I fixed it by setting:

$e107->site_path = (isset($tmp['paths']) && isset($tmp['paths']['hash'])) ? $tmp['paths']['hash'] : "[hash]"; // placeholder 
- $override was not working 
$e107_paths = $e107->defaultDirs($ret);  

and that you have mistypo in

		$this->e107->e107_dirs['SYSTEM_DIRECTORY'] = str_replace("[hash]",$this->e107->site_path,$this->e107->e107_dirs['SYSTEM_DIRECTORY']);	
		$this->e107->e107_dirs['CACHE_DIRECTORY']  = str_replace("[hash]",$this->e107->site_path,$this->e107->e107_dirs['CACHE_DIRECTORY']);
		$this->e107->e107_dirs['SYSTEM_DIRECTORY'] = str_replace("/".$this->e107->site_path,"",$this->e107->e107_dirs['SYSTEM_DIRECTORY']);
		$this->e107->e107_dirs['MEDIA_DIRECTORY']  = str_replace("/".$this->e107->site_path,"",$this->e107->e107_dirs['MEDIA_DIRECTORY']);

CACHE_DIRECTORY is not used in the config file, it should be MEDIA_DIRECTORY

The point is not to use custom folders, the point is that there are hidden issues that can backfire anytime.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question An ask about behavior that is not found documented anywhere
Projects
None yet
Development

No branches or pull requests

1 participant