Skip to content
Snippets Groups Projects
Commit d2d74d6a authored by Aleksander Machniak's avatar Aleksander Machniak
Browse files

Improve setup of the schema cache location

1. Prevent from errors when the host is configured e.g. with ldap:// prefix
2. Use sys_get_temp_dir() to get the system tmp directory
parent 4c21bdeb
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2149,8 +2149,9 @@ class Net_LDAP3
);
 
$_ldap_schema_cache_cfg = array(
'path' => "/tmp/" . $host . ":" . ($port ? $port : '389') . "-Net_LDAP2_Schema.cache",
'max_age' => 86400,
'path' => sprintf('%s/%s:%d-Net_LDAP2_Schema.cache',
(sys_get_temp_dir() ?: '/tmp'), str_replace('://', ':', $host) . (strpos($host, ":$port") ? '' : ":$port")),
);
 
$_ldap = Net_LDAP2::connect($_ldap_cfg);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment