Documentation

IsInstalled

mixed
CModule::IsInstalled()

The method determines whether the module is installed. Returns true if the module is installed, false otherwise. Non-static method.

Note. Before using functions and classes of any module, include it using the CModule::IncludeModule method.

Parameters

No parameters.

See Also

Examples of use

<?
// if "Install" or "Uninstall" is clicked...
if(strlen($uninstall)>0 || strlen($install)>0)
{
    // check if the required file exists in the module directory
    if(@file_exists($DOCUMENT_ROOT."/bitrix/modules/".$module_id."/install/index.php"))
    {
        include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$module_id."/install/index.php");
        $obModule = new $module_id;
        if($obModule->IsInstalled() && strlen($uninstall)>0) $obModule->DoUninstall();
        elseif(!$obModule->IsInstalled() && strlen($install)>0) $obModule->DoInstall();
    }
}
?>


© «Bitrix24», 2001-2022
Up