コード例 #1
0
ファイル: Main.inc.php プロジェクト: alcexhim/PhoenixSNS
 foreach ($tables as $table) {
     if ($table->Exists()) {
         Message("Table '" . $table->Name . "' already exists, skipping creation");
     } else {
         $retval = $table->Create();
         if ($retval) {
             Success("Created table '" . $table->Name . "'");
         } else {
             Failure("Could not create table '" . $table->Name . "'");
             Message("Database returned error " . DataFX::$Errors->Items[0]->Code . ": " . DataFX::$Errors->Items[0]->Message);
             Message(DataFX::$Errors->Items[0]->Query);
             $failed = true;
         }
     }
 }
 $user = User::Create($_POST["TenantManager_UserName"], $_POST["TenantManager_Password"]);
 if ($user == null) {
     global $MySQL;
     Failure("Could not create user '" . $_POST["TenantManager_UserName"] . "'");
     Message("Database returned error " . $MySQL->errno . ": " . $MySQL->error);
     $failed = true;
 }
 $tenant = Tenant::Create($_POST["Application_DefaultTenant"], "The default tenant for PhoenixSNS.");
 $tablefilepath = dirname(__FILE__) . "/TenantObjects/*.inc.php";
 $tablefiles = glob($tablefilepath);
 foreach ($tablefiles as $tablefile) {
     $tenant = Tenant::GetByID(1);
     require $tablefile;
 }
 require dirname(__FILE__) . "/DefaultTenant.inc.php";
 ?>