Пример #1
0
 public function getListTablesFromConfig($sConfig)
 {
     if (_root::getConfigVar('db.' . $sConfig . '.sgbd') == 'xml') {
         if (!file_exists(_root::getConfigVar('db.' . $sConfig . '.database'))) {
             $sBuilderDbPath = _root::getConfigVar('path.data') . 'genere/' . _root::getParam('id') . '/public/' . _root::getConfigVar('db.' . $sConfig . '.database');
             if (file_exists($sBuilderDbPath)) {
                 _root::setConfigVar('db.' . $sConfig . '.database', $sBuilderDbPath);
             } else {
                 throw new Exception('Base inexistante ' . _root::getConfigVar('db.' . $sConfig . '.database') . ' ni ' . $sBuilderDbPath);
             }
         }
     } else {
         if (_root::getConfigVar('db.' . $sConfig . '.sgbd') == 'csv') {
             if (!file_exists(_root::getConfigVar('db.' . $sConfig . '.database'))) {
                 $sBuilderDbPath = _root::getConfigVar('path.data') . 'genere/' . _root::getParam('id') . '/public/' . _root::getConfigVar('db.' . $sConfig . '.database');
                 if (file_exists($sBuilderDbPath)) {
                     _root::setConfigVar('db.' . $sConfig . '.database', $sBuilderDbPath);
                 } else {
                     throw new Exception('Base inexistante ' . _root::getConfigVar('db.' . $sConfig . '.database') . ' ni ' . $sBuilderDbPath);
                 }
             }
         } else {
             if (_root::getConfigVar('db.' . $sConfig . '.sgbd') == 'json') {
                 if (!file_exists(_root::getConfigVar('db.' . $sConfig . '.database'))) {
                     $sBuilderDbPath = _root::getConfigVar('path.data') . 'genere/' . _root::getParam('id') . '/public/' . _root::getConfigVar('db.' . $sConfig . '.database');
                     if (file_exists($sBuilderDbPath)) {
                         _root::setConfigVar('db.' . $sConfig . '.database', $sBuilderDbPath);
                     } else {
                         throw new Exception('Base inexistante ' . _root::getConfigVar('db.' . $sConfig . '.database') . ' ni ' . $sBuilderDbPath);
                     }
                 }
             }
         }
     }
     $oModelFactory = new model_mkfbuilderfactory();
     $oModelFactory->setConfig($sConfig);
     return $oModelFactory->getListTable();
 }