Piwik\DbHelper::createTables PHP Method

createTables() public static method

Create all tables
public static createTables ( )
    public static function createTables()
    {
        Schema::getInstance()->createTables();
    }

Usage Example

Esempio n. 1
0
 /**
  * Installation Step 4: Table Creation
  */
 function tablesCreation()
 {
     $this->checkPiwikIsNotInstalled();
     $view = new View('@Installation/tablesCreation', $this->getInstallationSteps(), __FUNCTION__);
     if ($this->getParam('deleteTables')) {
         Manager::getInstance()->clearPluginsInstalledConfig();
         Db::dropAllTables();
         $view->existingTablesDeleted = true;
     }
     $tablesInstalled = DbHelper::getTablesInstalled();
     $view->tablesInstalled = '';
     if (count($tablesInstalled) > 0) {
         // we have existing tables
         $view->tablesInstalled = implode(', ', $tablesInstalled);
         $view->someTablesInstalled = true;
         Access::getInstance();
         Piwik::setUserHasSuperUserAccess();
         if ($this->hasEnoughTablesToReuseDb($tablesInstalled) && count(APISitesManager::getInstance()->getAllSitesId()) > 0 && count(APIUsersManager::getInstance()->getUsers()) > 0) {
             $view->showReuseExistingTables = true;
         }
     } else {
         DbHelper::createTables();
         DbHelper::createAnonymousUser();
         $this->updateComponents();
         Updater::recordComponentSuccessfullyUpdated('core', Version::VERSION);
         $view->tablesCreated = true;
         $view->showNextStep = true;
     }
     return $view->render();
 }
All Usage Examples Of Piwik\DbHelper::createTables