Bitrix Site Manager

CModule::IsInstalled

mixed
CModule::IsInstalled()

The method IsInstalled determines whether the module is installed. Returns true if the module is installed, false otherwise.

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

Parameters


No parameters.

See Also

Example



<?
// 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();
    }
}
?>