Changeset 91 for trunk/UCore.pas


Ignore:
Timestamp:
Sep 7, 2012, 8:36:13 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Modulární systém přepracován tak, aby podporoval metody Install, Uninstall a Upgrade použitelné pro persistentní data. Původní metody Install a Uninstall přejmenovýny na Start a Stop.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r89 r91  
    5151    procedure RegisterModules;
    5252  public
     53    CommonDatabase: TSqlDatabase;
    5354    ModuleManager: TModuleManager;
    5455    Load: string;
     
    110111  SessionStorage.Free;
    111112  Database.Free;
    112   inherited Destroy;
     113  inherited;
    113114end;
    114115
     
    173174  ModuleManager := TModuleManager.Create(nil);
    174175  Pages := TPageList.Create;
    175 
    176   RegisterModules;
    177   ModuleManager.InstallMarked;
     176  CommonDatabase := TSqlDatabase.Create(nil);
    178177
    179178  LoadFromRegistry;
     
    188187    RegisterPage(TServerInfoPage, ServerInfoPage, 'serverinfo');
    189188    RegisterPage(TWebCamPage, WebCamPage, 'kamery');
    190     //RegisterPage(TUserControlPage, UserControlPage, 'uzivatel');
    191189    RegisterPage(TPlansPage, PlansPage, 'plany');
    192190    RegisterPage(TNetworkPage, NetworkPage, 'sit');
    193191    RegisterPage(TProjectsPage, ProjectsPage, 'projekty');
    194192    RegisterPage(TAboutPage, AboutPage, '');
    195     //RegisterPage(TUserControlPage, UserControlPage, '');
    196193  end;
    197194  with WebApp1 do begin
     
    207204begin
    208205  //SaveToRegistry;
    209   Pages.Free;
    210   inherited Destroy;
     206  FreeAndNil(CommonDatabase);
     207  FreeAndNil(ModuleManager);
     208  FreeAndNil(Pages);
     209  inherited;
    211210end;
    212211
     
    419418procedure TCore.Run;
    420419begin
     420  CommonDatabase.UserName := DatabaseUserName;
     421  CommonDatabase.HostName := DatabaseHostname;
     422  CommonDatabase.Database := DatabaseSchema;
     423  CommonDatabase.Password := DatabasePassword;
     424  CommonDatabase.Connect;
     425
     426  RegisterModules;
     427  ModuleManager.StartInstalled;
     428
    421429  WebApp1.HTTPServer.DocumentRoot := ExtractFileDir(ParamStrUTF8(0));
    422430  WebApp1.Run;
Note: See TracChangeset for help on using the changeset viewer.