original_string: public function getTablesInstalled($forceReload = true)
      {
          if (is_null($this->tablesInstalled)
              || $forceReload === true
          ) {
              $db = $this->getDb();
              $prefixTables = $this->getTablePrefixEscaped();
  
              $allTables = $this->getAllExistingTables($prefixTables);
  
              // all the tables to be installed
              $allMyTables = $this->getTablesNames();
  
              // we get the intersection between all the tables in the DB and the tables to be installed
              $tablesInstalled = array_intersect($allMyTables, $allTables);
  
              // at this point we have the static list of core tables, but let's add the monthly archive tables
              $allArchiveNumeric = $db->fetchCol("SHOW TABLES LIKE '" . $prefixTables . "archive_numeric%'");
              $allArchiveBlob    = $db->fetchCol("SHOW TABLES LIKE '" . $prefixTables . "archive_blob%'");
  
              $allTablesReallyInstalled = array_merge($tablesInstalled, $allArchiveNumeric, $allArchiveBlob);
  
              $this->tablesInstalled = $allTablesReallyInstalled;
          }
  
          return $this->tablesInstalled;
      }
code: public function getTablesInstalled($forceReload = true)
      {
          if (is_null($this->tablesInstalled)
              || $forceReload === true
          ) {
              $db = $this->getDb();
              $prefixTables = $this->getTablePrefixEscaped();
  
              $allTables = $this->getAllExistingTables($prefixTables);
  
              // all the tables to be installed
              $allMyTables = $this->getTablesNames();
  
              // we get the intersection between all the tables in the DB and the tables to be installed
              $tablesInstalled = array_intersect($allMyTables, $allTables);
  
              // at this point we have the static list of core tables, but let's add the monthly archive tables
              $allArchiveNumeric = $db->fetchCol("SHOW TABLES LIKE '" . $prefixTables . "archive_numeric%'");
              $allArchiveBlob    = $db->fetchCol("SHOW TABLES LIKE '" . $prefixTables . "archive_blob%'");
  
              $allTablesReallyInstalled = array_merge($tablesInstalled, $allArchiveNumeric, $allArchiveBlob);
  
              $this->tablesInstalled = $allTablesReallyInstalled;
          }
  
          return $this->tablesInstalled;
      }
code_tokens: public function getTablesInstalled ( $ forceReload = true ) { if ( is_null ( $ this -> tablesInstalled ) || $ forceReload === true ) { $ db = $ this -> getDb ( ) ; $ prefixTables = $ this -> getTablePrefixEscaped ( ) ; $ allTables = $ this -> getAllExistingTables ( $ prefixTables ) ; // all the tables to be installed $ allMyTables = $ this -> getTablesNames ( ) ; // we get the intersection between all the tables in the DB and the tables to be installed $ tablesInstalled = array_intersect ( $ allMyTables , $ allTables ) ; // at this point we have the static list of core tables, but let's add the monthly archive tables $ allArchiveNumeric = $ db -> fetchCol ( "SHOW TABLES LIKE '" . $ prefixTables . "archive_numeric%'" ) ; $ allArchiveBlob = $ db -> fetchCol ( "SHOW TABLES LIKE '" . $ prefixTables . "archive_blob%'" ) ; $ allTablesReallyInstalled = array_merge ( $ tablesInstalled , $ allArchiveNumeric , $ allArchiveBlob ) ; $ this -> tablesInstalled = $ allTablesReallyInstalled ; } return $ this -> tablesInstalled ; }
docstring: Get list of tables installed
  
  @param bool $forceReload Invalidate cache
  @return array  installed Tables
docstring_tokens: Get list of tables installed