mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
run hooks before and after initiaizing the dms
This commit is contained in:
parent
8cb8c2fb27
commit
1c327c65c0
|
@ -18,14 +18,33 @@
|
|||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
if(!empty($settings->_coreDir))
|
||||
require_once($settings->_coreDir.'/Core.php');
|
||||
else
|
||||
require_once('SeedDMS/Core.php');
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDB'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['initDB'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'pretInitDB')) {
|
||||
$hookObj->preInitDB(array('settings'=>$settings));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db = new SeedDMS_Core_DatabaseAccess($settings->_dbDriver, $settings->_dbHostname, $settings->_dbUser, $settings->_dbPass, $settings->_dbDatabase);
|
||||
$db->connect() or die ("Could not connect to db-server \"" . $settings->_dbHostname . "\"");
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDB'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['initDB'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postInitDB')) {
|
||||
$hookObj->postInitDB(array('db'=>$db, 'settings'=>$settings));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'pretInitDMS')) {
|
||||
$hookObj->preInitDMS(array('db'=>$db, 'settings'=>$settings));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dms = new SeedDMS_Core_DMS($db, $settings->_contentDir.$settings->_contentOffsetDir);
|
||||
|
||||
if(!$dms->checkVersion()) {
|
||||
|
@ -37,4 +56,13 @@ $dms->setRootFolderID($settings->_rootFolderID);
|
|||
$dms->setMaxDirID($settings->_maxDirID);
|
||||
$dms->setEnableConverting($settings->_enableConverting);
|
||||
$dms->setViewOnlineFileTypes($settings->_viewOnlineFileTypes);
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postInitDMS')) {
|
||||
$hookObj->postInitDMS(array('dms'=>$dms, 'settings'=>$settings));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user