Open mgutt opened 6 years ago
Absolute paths are still a part of the osCommerce configuration and will still need to be changed if the install is moved to a different server. It would be better to solve this problem for all fixed paths and not just for cache.
1.) Then please make DIR_FS_DOCUMENT_ROOT . '/includes/work/'
the default path.
2.) It should, fine, but it isn't. For example every time you open the admin panel it sends requests to the rss feeds apis. And it displays everytime that no version check was done. No matter how often the user performed it. And you forget extensions. I'm using a file based sql query cache. So there must be a default cache folder. And of course it shouldn't be an absolute path in my opinion.
Absolute paths are still a part of the osCommerce configuration Yes, but only if you use the install wizard:
$dir_fs_document_root = $HTTP_POST_VARS['DIR_FS_DOCUMENT_ROOT']; ... ' define(\'DIR_FS_CATALOG\', \'' . $dir_fs_document_root . '\');' . "\n" .
This could be easily solved by making this setting in the wizard optional and changing it to the same line that is already part of the default configure.php:
define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/');
Thats how I use it. And I wish to have the same option for the cache path.
osC 2.3.4
1.) The installation pack should contain a
catalog/cache/
folder including the following .htaccess:deny from all
2.) The default value of
USE_CACHE
should be true or better remove this constant as it does not make sense to disable the cache. Instead you could leave theDIR_FS_CACHE
value empty.3.) The default value of
DIR_FS_CACHE
should beDIR_FS_DOCUMENT_ROOT . '/cache/'
. Add an explanation how to set this path or better move those values to configure.php (yes, delete them from the configuration database table) so it can not be changed through the admin panel. Instead it makes more sense to have a "reset cache" option in the admin panel.4.) Add a "cache dir exists" and "cache is writable" check to the security checks
Reasons:
a) The
USE_CACHE
constant is not used very well. For example you can setUSE_CACHE
to false and ifDIR_FS_CACHE
exists it nevertheless writes multiple cache files in this dir like the last version check date, rss feed in admin, etc.b) And if you move your shop to another host, the cache path is wrong as it contains an absolute path.