Ignore:
Timestamp:
Jan 22, 2021, 12:04:30 AM (4 years ago)
Author:
chronos
Message:
  • Modified: Setup module is always installed and enabled to be executed as base system module. From Setup module all other system modules can be installed.
  • Added: Allow to install, uninstall, enable, disable and upgrade all user modules.
  • Added: Created ModuleManager app module for managing other modules.
  • Modified: Keep InstalledVersion for installed modules in ModulesConfig.php.
  • Added: Distinction between system, library and application module types.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Database.php

    r890 r897  
    4444  public bool $LogSQLQuery;
    4545  public string $LogFile;
     46  public string $Database;
    4647
    4748  function __construct()
     
    5657    $this->LogSQLQuery = false;
    5758    $this->LogFile = dirname(__FILE__).'/../../Query.log';
     59    $this->Database = '';
    5860  }
    5961
     
    6365      else if ($this->Type == 'pgsql') $ConnectionString = 'pgsql:dbname='.$Database.';host='.$Host;
    6466      else $ConnectionString = '';
     67    $this->Database = $Database;
    6568    try {
    6669      $this->PDO = new PDO($ConnectionString, $User, $Password);
    67 
    6870    } catch (Exception $E)
    6971    {
     
    235237    $this->PDO->commit();
    236238  }
     239
     240  public function TableExists(string $Name): bool
     241  {
     242    $DbResult = $this->query('SELECT * FROM information_schema.tables  WHERE table_schema = "'.$this->Database.
     243    '" AND table_name = "'.$Name.'" LIMIT 1');
     244    return $DbResult->num_rows != 0;
     245  }
    237246}
    238247
Note: See TracChangeset for help on using the changeset viewer.