So the "interesting" thing about this condition and the data that I have so far found available is that once a plugin is installed there is data/variables assigned that help out with accessing information about the plugin; however, before the plugin is installed, well there is not the same data available about the plugin going through installation. There is some data that might be able to be put together, but the way I got around it was to use a reference from the file's current location to then refer to the admin directory within the plugin.
So, I worked this by first performing a file check (with attempt to provide feedback if the file was missing, though accessibility to built in notifications is missing other than good ole $messageStack) then if it existed to load it by any of the following:
Code:
require_once dirname(__FILE__) . '/../admin/includes/extra_datafiles/filename.php';
Though, I guess could more generically could use the below to get all files associated which would make the installation file easier to use:
Code:
$GLOBALS['fs']->loadFilesFromDirectory(dirname(__FILE__) . '/../admin/includes/extra_datafiles', '~^[^\._].*\.php$~i');
or from some data collection while executing an install:
Code:
$GLOBALS['fs']->loadFilesFromPluginsDirectory([['unique_key' => $_REQUEST['colKey'], 'version' =>$_REQUEST['version'],]], 'admin/includes/extra_datafiles', '~^[^\._].*\.php$~i');
or also more specifically based on from what path the data is available.
Code:
$GLOBALS['fs']->loadFilesFromPluginsDirectory([['unique_key' => $_GET['colKey'], 'version' => $_POST['version'],]], 'admin/includes/extra_datafiles', '~^[^\._].*\.php$~i');
Bookmarks