Ignore:
Timestamp:
Jun 12, 2012, 6:41:12 PM (13 years ago)
Author:
chronos
Message:
  • Opraveno: Odinstalování nyní respektuje závislé moduly, které odinstaluje dříve než samotný modul.
  • Přidáno: Modul system obsahuje rozhraní pro zobrazení seznamu modulů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Modular/Common/Module.php

    r403 r404  
    3232    DebugLog('Installing module '.$this->Name.'...');
    3333    $this->Installed = true;
     34
     35    // Install dependencies first
    3436    foreach($this->Dependencies as $Dependency) 
    3537      $this->System->Modules[$Dependency]->Install();
     38
    3639    $this->LoadModels();
    3740    foreach($this->Models as $Index => $Module)
     
    4548  {
    4649    DebugLog('Uninstalling module '.$this->Name.'...');
     50    $this->Installed = false;
     51   
     52    // Remove dependent modules first
     53    foreach($this->System->Modules as $Module) 
     54      foreach($Module->Dependencies as $Dependency)
     55        if(($Dependency == $this->Name) and ($Module->Installed)) $this->System->Modules[$Module->Name]->UnInstall();
     56       
    4757    $this->LoadModels();
    4858    foreach(array_reverse($this->Models, true) as $Index => $Model)
     
    5161    }
    5262    $this->Database->query('UPDATE SystemModule SET Installed=0 WHERE Name="'.$this->Name.'"');
    53     $this->Installed = false;
    5463  }
    5564 
     
    115124    $this->LoadModules();
    116125    foreach($this->Modules as $Index => $Module)
     126    {
     127      //DebugLog('Init module '.$Module->Name);
    117128      $this->Modules[$Index]->Init();
     129    }
    118130  }
    119131 
     
    171183    $this->ReloadList();
    172184    $this->LoadModules(false);
    173     //$this->Modules['System']->Install();
    174     foreach($this->Modules as $Index => $Module)
     185    $this->Modules['System']->Install();
     186    /*foreach($this->Modules as $Index => $Module)
    175187    {     
    176188      $this->Modules[$Index]->Install();
    177     }
     189    }*/
    178190  }
    179191 
Note: See TracChangeset for help on using the changeset viewer.