This repository was archived by the owner on Feb 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSqlDataConnectorApp.php
More file actions
38 lines (32 loc) · 1.71 KB
/
SqlDataConnectorApp.php
File metadata and controls
38 lines (32 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace exface\SqlDataConnector;
use exface\Core\CommonLogic\Model\Object;
use exface\Core\CommonLogic\NameResolver;
use exface\Core\Exceptions\UnexpectedValueException;
use exface\Core\Interfaces\InstallerInterface;
use exface\SqlDataConnector\SqlExplorer\OracleSQLExplorer;
use exface\SqlDataConnector\SqlExplorer\MySQLExplorer;
use exface\SqlDataConnector\SqlExplorer\MSSQLExplorer;
use exface\SqlDataConnector\SqlExplorer\AbstractSQLExplorer;
use exface\Core\CommonLogic\Model\App;
class SqlDataConnectorApp extends App
{
const FOLDER_WITH_MODEL_SOURCE_SQL = 'ModelSource';
const FOLDER_WITH_MODEL_SOURCE_SQL_UPDATES = 'updates';
public function getInstaller(InstallerInterface $injected_installer = null)
{
$installer = parent::getInstaller($injected_installer);
// First of all update the meta model source schema if the model is stored in SQL (= if the connector
// used by the model loader is an SQL connector). This needs to be done before any other installers are run -
// in particular before the model installer, because the model installer will attempt to write to the new
// SQL schema already!
// Although the core app will update it's model schema by itself, this step is also needed here, because the
// schema updates or fixes may come asynchronously to core app updates. If the core app already udated the
// schema, the installer won't do anything, so we will not run into conflicts.
if ($this->containsClass($this->getWorkbench()->model()->getModelLoader())) {
$installer->addInstaller($this->getWorkbench()->model()->getModelLoader()->getInstaller(), true);
}
return $installer;
}
}
?>