Quote Originally Posted by Dave224 View Post
I have several custom functions that I need on both the store side and admin side. To date, I've been duplicating the functions on both sides creating problems with maintenance and taking up extra memory. So I put all the shared functions in a shared functions file on the store side and tried to auto-load the file in the admin. The code I used is:
Code:
if (!defined ('IS_ADMIN_FLAG')) { 
    die ('Illegal Access'); 
}
$autoLoadConfig[0][] = array(
    'autoType' => 'require',
    'loadFile' => DIR_WS_FUNCTIONS . 'extra_functions/shared_functions.php',
);
which is placed in a file named config.shared_functions.php located in admin/includes/auto_loaders/.

But it doesn't work. I still get call to undefined function fatal error. The undefined function is in the shared_functions.php file located in includes/functions/extra_functions/. There are no other errors. I followed the instructions in the docs.

What am I doing wrong?

Dave
If that's the admin auto-loader, you need to use
Code:
$autoLoadConfig[0][] = array(
    'autoType' => 'require',
    'loadFile' => DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'extra_functions/shared_functions.php',
);