bizproc :: UnInstallDB: Bitrix method

      
<?php 
//  bizproc :: UnInstallDB()
//  /dist/bitrix/modules/bizproc/install/index.php:69

    
function UnInstallDB($arParams = Array())
    {
        global 
$DB$DBType$APPLICATION;

        
$errors null;
        if(
array_key_exists("savedata"$arParams) && $arParams["savedata"] != "Y")
        {
            
$errors $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bizproc/install/db/".$DBType."/uninstall.sql");

            if (!empty(
$errors))
            {
                
$APPLICATION->ThrowException(implode(""$errors));
                return 
false;
            }
        }

        
UnRegisterModuleDependences("iblock""OnAfterIBlockElementDelete""bizproc""CBPVirtualDocument""OnAfterIBlockElementDelete");
        
UnRegisterModuleDependences("main""OnAdminInformerInsertItems""bizproc""CBPAllTaskService""OnAdminInformerInsertItems");
        
UnRegisterModuleDependences('rest''OnRestServiceBuildDescription''bizproc''\Bitrix\Bizproc\RestService''onRestServiceBuildDescription');
        
UnRegisterModuleDependences('rest''OnRestAppDelete''bizproc''\Bitrix\Bizproc\RestService''onRestAppDelete');
        
UnRegisterModuleDependences('rest''OnRestAppUpdate''bizproc''\Bitrix\Bizproc\RestService''onRestAppUpdate');
        
UnRegisterModuleDependences('timeman''OnAfterTMDayStart''bizproc''CBPDocument''onAfterTMDayStart');
        
UnRegisterModule("bizproc");

        
$eventManager = \Bitrix\Main\EventManager::getInstance();
        
$eventManager->unRegisterEventHandler('rest''OnRestApplicationConfigurationImport''bizproc''\Bitrix\Bizproc\Integration\Rest\AppConfiguration''onEventImportController');
        
$eventManager->unRegisterEventHandler('rest''OnRestApplicationConfigurationExport''bizproc''\Bitrix\Bizproc\Integration\Rest\AppConfiguration''onEventExportController');
        
$eventManager->unRegisterEventHandler('rest''OnRestApplicationConfigurationClear''bizproc''\Bitrix\Bizproc\Integration\Rest\AppConfiguration''onEventClearController');
        
$eventManager->unRegisterEventHandler('rest''OnRestApplicationConfigurationEntity''bizproc''\Bitrix\Bizproc\Integration\Rest\AppConfiguration''getEntityList');

        return 
true;
    }