Originally Posted by
mc12345678
What do you mean by being in a loop?
As far as before and after in deleting, did any of the original 6 log files get deleted? Was this supersized file there before attempting to delete or was it caused by attempting to delete?
As for determining the plugin information, there are some global/class like variables that have that information or can readily make it available. It may be helpful to understand more about at what point in operation/install this information is being gathered and/or being used. I mean think about it, the way attempted basically already assumes that the current directory is within the plugin, so there must have been some amount of information available at that point to get to that subdirectory.
Out of curiosity what language information is so generic that it depends on plugin "path" like information instead of being hard coded?
Btw, in my opinion, running at least some level of risk by exploding on "\n" without either forcing or verifying that the line ending is or is only "\n".
The Firefox browser working arrow kept spinning after I attempted the file open code (in my plugin) mentioned previously. Stopping the browser (X) enabled me to return to DisplayLogs...where I attempted to delete the 6 files. It deleted the 6 files but new error log entries immediately appeared within the Display Logs screen. I tried deleting the files multiple times but kept getting more new log files. I had to uninstall DisplayLogs and shut down my server completely to stop the loop.
Needless to say, I abandoned my approach to getting the directory path from the manifest file.
The supersized files were not there before I attempted to run my custom code.
As far as needing the plugin path is concerned, I need it to improve the portability of my plugin. At the moment, MyPlugin_filenames.php has my admin base directory identified like this:
PHP Code:
define('DIR_EZ_FEEDS_TOP', DIR_FS_CATALOG . 'zc_plugins/EZ-Feeds/v1.5.7c/admin/includes/');
Every time I need to copy the plugin to another shop, this line of code will have to be edited to make it work...clear as muddy water?
I was able to find a variable, $filePath, that gives me the path I need:
/var/www/jestcountry.com/zc_plugins/EZ-Feeds/v1.5.7c/
I put the following code in init_MyPlugin.php thinking that would solve my problem.
PHP Code:
//use Zencart\FileSystem\FileSystem;
if ($current_page == FILENAME_EZFEEDS . '.php') {
define('DIR_EZ_FEEDS_ZC_PLUGINS', $filePath);
print_r('defined in init_ezfeeds.php but not following to ezfeeds_filenames ... ' . DIR_EZ_FEEDS_ZC_PLUGINS);
}
The define is working within init_MyPlugin.php and even prints when my base admin file is loaded.
However, using the new define, DIR_EZ_FEEDS_ZC_PLUGINS, in MyPlugin_filenames.php is not working...
I do not understand this behavior because the Zencart Docs program flow help page indicates init is loaded before defines. What am I missing?
I tried moving the init code into extra_configures but the variable, $filePath, is not available in extra_configures.
I'll keep looking....
Thanks for your help.
Bookmarks