Bits and bobs to help more packs pass validation.
authorCameron Ball <c.ball1729@gmail.com>
Sun, 21 Dec 2014 18:46:12 +0000 (02:46 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Sun, 21 Dec 2014 18:46:12 +0000 (02:46 +0800)
Controllers/SimfileController.php
Domain/VOs/StepMania/DanceMode.php
Domain/VOs/StepMania/Difficulty.php
Domain/VOs/StepMania/IDanceMode.php
Services/BannerExtracter.php
Services/SimfileParser.php
Services/Uploads/UploadManager.php
Services/ZipParser.php
divinelegy.sql
public_html/index.php

index 9ab78ad..582cfc0 100644 (file)
@@ -132,11 +132,13 @@ class SimfileController implements IDivineController
                                       ->setDestination('StepMania/')\r
                                       ->process();\r
 \r
+        //TODO: This should be in a try-catch and if it fails the file should\r
+        //be deleted from the filesystem and database.\r
         foreach($files as $file)\r
         {\r
             $zipParser = $this->_zipParser;\r
             $zipParser->parse($file);\r
-                   \r
+\r
             if(!$zipParser->simfiles()) $this->_statusReporter->error('That zip doesn\'t seem to have any simfiles in it.');\r
             \r
             //save the actual zip in the db\r
index c54efe1..34e0309 100644 (file)
@@ -9,11 +9,71 @@ class DanceMode implements IDanceMode
     protected $stepManiaName;\r
     protected $prettyName;\r
     \r
+    //XXX: Known step types, taken from https://github.com/stepmania/stepmania/blob/master/src/GameManager.cpp\r
     private $_nameMap = array(\r
         'dance-single' => 'Single',\r
-        'dance-double' => 'Double'\r
+        'dance-double' => 'Double',\r
+        'dance-couple' => 'Couple',\r
+        'dance-solo' => 'Solo',\r
+        'dance-threepanel' => 'Three Panel',\r
+        'dance-routine' => 'Routine',\r
+        'pump-single'  => 'Single',\r
+        'pump-double'  => 'Double',\r
+        'pump-couple' => 'Couple',\r
+        'pump-halfdouble' => 'Half Double',\r
+        'pump-routine' => 'Routine',\r
+        'kb7-single' => 'Single',\r
+        'ez2-single'  => 'Single',\r
+        'ez2-double'  => 'Double',\r
+        'ez2-real' => 'Real',\r
+        'para-single'  => 'Single',\r
+        'para-versus' => 'Versus', //Not in the list but I have seen it in files\r
+        'ds3ddx-single' => 'Single',\r
+        'bm-single' => 'Single', //Not in the list but I have seen it in files\r
+        'bm-single5' => 'Single 5 Key',\r
+        'bm-single7' => 'Single 7 Key',\r
+        'bm-double' => 'Double', //Not in the list, and I haven't seen it, but I feel like it must exist lol\r
+        'bm-double5' => 'Double 5 Key',\r
+        'bm-double7' => 'Double 7 Key',\r
+        'bm-versus5' => 'Versus 5 Key',\r
+        'bm-versus7' => 'Versus 7 Key',\r
+        //Seems like bm may have been called iidx or was changed to iidx at some point so...\r
+        'iidx-single' => 'Single', //Not in the list but I have seen it in files\r
+        'iidx-single5' => 'Single 5 Key',\r
+        'iidx-single7' => 'Single 7 Key',\r
+        'iidx-double' => 'Double', //Not in the list, and I haven't seen it, but I feel like it must exist lol\r
+        'iidx-double5' => 'Double 5 Key',\r
+        'iidx-double7' => 'Double 7 Key',\r
+        'iidx-versus5' => 'Versus 5 Key',\r
+        'iidx-versus7' => 'Versus 7 Key',\r
+        'maniax-single' => 'Single',\r
+        'maniax-double' => 'Double',\r
+        'techno-single4' => 'Single 4 Panel',\r
+        'techno-single5' => 'Single 5 Panel',\r
+        'techno-single8' => 'Single 8 Panel',\r
+        'techno-double4' => 'Double 4 Panel',\r
+        'techno-double5' => 'Double 5 Panel',\r
+        'techno-double8' => 'Double 8 Panel',\r
+        'pnm-five' => 'Five Key',\r
+        'pnm-nine' => 'Nine Key',\r
+        'lights-cabinet' => 'Cabinet Lights'\r
     );\r
     \r
+    private $_smGameNameToNiceName = array(\r
+        'dance' => 'In The Groove',\r
+        'pump' => 'Pump It Up',\r
+        'ez2' => 'EZ2Dancer',\r
+        'para' => 'ParaParaParadise',\r
+        'bm' => 'Beatmania',\r
+        'iidx' => 'Beatmania',\r
+        'maniax' => 'Dance Maniax',\r
+        'techno' => 'TechnoMotion',\r
+        'pnm' => 'Pop\'n Music',\r
+        'ds3ddx' => 'Dance Station 3DDX',\r
+        'kb7' => 'Keybeat',\r
+        'lights' => false\r
+    );\r
+            \r
     public function __construct($stepManiaName)\r
     {\r
         if(array_key_exists($stepManiaName, $this->_nameMap)) {\r
@@ -24,11 +84,19 @@ class DanceMode implements IDanceMode
         }        \r
     }\r
     \r
-    public function getStepManiaName() {\r
+    public function getStepManiaName()\r
+    {\r
         return $this->stepManiaName;\r
     }\r
     \r
-    public function getPrettyName() {\r
+    public function getPrettyName()\r
+    {\r
         return $this->prettyName;\r
     }\r
+    \r
+    public function getGame()\r
+    {\r
+        $game = explode('-', $this->stepManiaName)[0];\r
+        return $this->_smGameNameToNiceName[$game];\r
+    }\r
 }\r
index 500b0db..e59578d 100644 (file)
@@ -8,9 +8,31 @@ class Difficulty implements IDifficulty
 {\r
     protected $stepManiaName;\r
     protected $itgName;\r
+\r
+    //XXX: Common names used in simfiles. We'll map them to standard names.\r
+    //Taken from https://github.com/openitg/openitg/blob/master/src/Difficulty.cpp\r
+    private $_namesToSmNames = array(\r
+       "Beginner"  => 'Beginner',\r
+       "Easy"      => 'Easy',\r
+       "Basic"     => 'Easy',\r
+       "Light"     => 'Easy',\r
+       "Medium"    => 'Medium',\r
+       "Another"   => 'Medium',\r
+       "Trick"     => 'Medium',\r
+       "Standard"  => 'Medium',\r
+       "Difficult" => 'Medium',\r
+       "Hard"      => 'Hard',\r
+       "Ssr"       => 'Hard',\r
+       "Maniac"    => 'Hard',\r
+       "Heavy"     => 'Hard',\r
+       "Smaniac"   => 'Challenge',\r
+       "Challenge" => 'Challenge',\r
+       "Expert"    => 'Challenge',\r
+       "Oni"       => 'Challenge',\r
+       "Edit"      => 'Edit'\r
+    );\r
     \r
-    private $_nameMap = array(\r
-        'Light' => 'Novice',\r
+    private $_smNamesToItgNames = array(\r
         'Beginner' => 'Novice',\r
         'Easy' => 'Easy',\r
         'Medium' => 'Medium',\r
@@ -18,13 +40,14 @@ class Difficulty implements IDifficulty
         'Challenge' => 'Expert',\r
         'Edit' => 'Edit'\r
     );\r
-    \r
-    public function __construct($stepManiaName) {\r
-        if(array_key_exists($stepManiaName, $this->_nameMap)) {\r
-            $this->stepManiaName = $stepManiaName;\r
-            $this->itgName = $this->_nameMap[$stepManiaName];\r
+\r
+    public function __construct($name) {\r
+        $ucName = ucfirst($name);\r
+        if(array_key_exists($ucName, $this->_namesToSmNames)) {\r
+            $this->stepManiaName = $this->_namesToSmNames[$ucName];\r
+            $this->itgName = $this->_smNamesToItgNames[$this->stepManiaName];\r
         } else {\r
-            throw new InvalidDifficultyException(sprintf('Invalid difficulty: %s', $stepManiaName));\r
+            throw new InvalidDifficultyException(sprintf('Invalid difficulty: %s', $name));\r
         }  \r
     }\r
     \r
index a8c908c..f412699 100644 (file)
@@ -6,4 +6,5 @@ interface IDanceMode
 {\r
     public function getStepManiaName();\r
     public function getPrettyName();\r
+    public function getGame();\r
 }\r
index 63fce25..3b2928e 100644 (file)
@@ -31,7 +31,7 @@ class BannerExtracter implements IBannerExtracter
             $stat = $za->statIndex($i);
             if(basename($stat['name']) == $bannerName)
             {
-                $this->_hash = $this->randomFilename($bannerName);
+                $this->_hash = md5_file('zip://' . $zipfile . '#' . $stat['name']);
                 $this->_destinationFileName = $this->_hash . '.' . pathinfo($bannerName, PATHINFO_EXTENSION);
                 $result = copy('zip://' . $zipfile . '#' . $stat['name'], '../files/banners/' . $this->_destinationFileName);
                 break;
@@ -74,7 +74,7 @@ class BannerExtracter implements IBannerExtracter
                 //replace 3spooty with packname variable
                 if(count($pathComponents) == 2 && $pathComponents[0] == $packname)
                 {
-                    $this->_hash = $this->randomFilename($stat['name']);
+                    $this->_hash = md5_file('zip://' . realpath($zipfile) . '#' . $stat['name']);
                     $this->_destinationFileName = $this->_hash . '.' . pathinfo($stat['name'], PATHINFO_EXTENSION);
                     $bannerName = $pathComponents[1];
                     $result = copy('zip://' . realpath($zipfile) . '#' . $stat['name'], '../files/banners/' . $this->_destinationFileName);
index 1413acc..52608b1 100644 (file)
@@ -8,14 +8,6 @@ use Exception;
 class SimfileParser implements ISimfileParser
 {
     
-//        'light' => 'Novice',
-//        'beginner' => 'Novice',
-//        'easy' => 'Easy',
-//        'medium' => 'Medium',
-//        'hard' => 'Hard',
-//        'challenge' => 'Expert',
-//        'edit' => 'Edit'
-    
     private $_smFileLines;
         
     public function parse($simfileData)
@@ -33,7 +25,8 @@ class SimfileParser implements ISimfileParser
         $title = $this->extractKey('TITLE');
         if(!$title) throw new Exception ('Invalid SM file. TITLE missing');
         
-        return $title;
+        //XXX: UTF8 encode to deal with unusual character that crop up in weeaboo shit.
+        return utf8_encode($title);
     }
     
     public function artist()
@@ -41,13 +34,16 @@ class SimfileParser implements ISimfileParser
         $artist = $this->extractKey('ARTIST');
         if(!$artist) throw new Exception ('Invalid SM file. ARTIST missing');
         
-        return new \Domain\VOs\StepMania\Artist($artist);
+        //XXX: UTF8 encode to deal with unusual character that crop up in weeaboo shit.
+        return new \Domain\VOs\StepMania\Artist(utf8_encode($artist));
     }
     
     public function stops()
     {
         $stops = $this->extractKey('STOPS');
-        if($stops === false) throw new Exception ('Invalid SM file. STOPS missing');
+        
+        //XXX: SM files can be missing stops.
+        //if($stops === false) throw new Exception ('Invalid SM file. STOPS missing');
         
         return (bool)$stops;
     }
@@ -69,19 +65,26 @@ class SimfileParser implements ISimfileParser
         {
             $bpmRange = explode(":",$displayBpm);
             $bpmRange[1] = @$bpmRange[1] ?: $bpmRange[0];
-        } else {
+        }
+        
+        //XXX: Originally I had an else statement for this. But turns out some SM's have * as the display bpm
+        //so I just check if we don't have a displayBPM OR the displayBPM is not numeric.
+        if(!$displayBpm || !is_numeric($bpmRange[0]))
+        {
             $bpms = $this->extractKey('BPMS');
             $bpmRange = $this->parseBpms($bpms);
         }
         
-        //I have nfi why I made the BPM VO high-low instead of low-high in the constructor but yolo
+        //XXX: I have nfi why I made the BPM VO high-low instead of low-high in the constructor but yolo
         return new \Domain\VOs\StepMania\BPM($bpmRange[1], $bpmRange[0]);
     }
     
     public function bgChanges()
     {
         $bgChanges = $this->extractKey('BGCHANGES');
-        if($bgChanges === false) throw new Exception ('Invalid SM file. BGCHANGES missing');
+        
+        //XXX: BGChanges can be missing
+        //if($bgChanges === false) throw new Exception ('Invalid SM file. BGCHANGES missing');
         
         return (bool)$bgChanges;
     }
@@ -89,7 +92,9 @@ class SimfileParser implements ISimfileParser
     public function bpmChanges() 
     {
         $bpms = $this->extractKey('BPMS');
-        if(!$bpms) throw new Exception ('Invalid SM file. BPMS missing');
+        
+        //XXX: BPMS can be missing.
+        //if(!$bpms) throw new Exception ('Invalid SM file. BPMS missing');
         
         $bpmRange = $this->parseBpms($bpms);
         //XXX: We have bpm changes when the high and low bpms are different.
@@ -115,7 +120,11 @@ class SimfileParser implements ISimfileParser
             if ($pos !== false)
             {
                 $noteData = trim(substr($line, $pos + 9));
-                $allSteps[] = $this->stepchartFromNoteData($noteData);
+                $steps = $this->stepchartFromNoteData($noteData);
+                
+                //XXX: Sometimes we get a cabinet lights chart, those return false for getGame.
+                //We don't want to store cabinet lights, so just ignore it.
+                if($steps->getMode()->getGame()) $allSteps[] = $steps;
             }
         }
         
index 81c12c7..c1356ae 100644 (file)
@@ -65,7 +65,7 @@ class UploadManager implements IUploadManager{
     {
         if($this->_destination)
         {
-            $randomName = $this->randomFilename();
+            $randomName = md5_file($file->getTempName());
             $result = move_uploaded_file($file->getTempName(), $this->_basePath . '/' . $this->_destination . '/' . $randomName . '.' . $file->getExtension());
         }
         
index a8d5631..a669ffc 100644 (file)
@@ -99,8 +99,7 @@ class ZipParser implements IZipParser
         //or single, but to do that we simply check the number of found sm files. To overcome this
         //first populate the smFiles array with the raw sm data, then apply SmDataToSmClass on each
         //array element. This way the check is accurate and the array gets populated as expected.
-        //@ing it because when exceptions are thrown this still produces a warning and I dont want that.
-        $this->_smFiles = @array_map(array($this, 'SmDataToSmClass'), $this->_smFiles);
+        $this->_smFiles = array_map(array($this, 'SmDataToSmClass'), $this->_smFiles);
     }
     
     private function packNameFromFiles()
index 8df01c6..02024a7 100644 (file)
--- MySQL dump 10.13  Distrib 5.5.38, for debian-linux-gnu (i686)
---
--- Host: localhost    Database: divinelegy
--- ------------------------------------------------------
--- Server version      5.5.38-0ubuntu0.12.04.1
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
-/*!40103 SET TIME_ZONE='+00:00' */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
---
--- Table structure for table `artists`
---
-
-DROP TABLE IF EXISTS `artists`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `artists` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `name` varchar(255) NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=360 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `downloads`
---
-
-DROP TABLE IF EXISTS `downloads`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `downloads` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `file_id` mediumint(8) unsigned NOT NULL,
-  `user_id` mediumint(8) unsigned NOT NULL,
-  `timestamp` int(10) unsigned NOT NULL,
-  `ip` varchar(15) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `files`
---
-
-DROP TABLE IF EXISTS `files`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `files` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `filename` varchar(255) NOT NULL,
-  `hash` varchar(255) NOT NULL,
-  `path` varchar(255) NOT NULL,
-  `mimetype` varchar(255) NOT NULL,
-  `size` int(10) unsigned NOT NULL,
-  `uploaded` int(10) unsigned NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=291 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `mirrors`
---
-
-DROP TABLE IF EXISTS `mirrors`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `mirrors` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `uri` varchar(255) DEFAULT NULL,
-  `file_id` mediumint(8) unsigned NOT NULL,
-  `source` varchar(255) NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `packs`
---
-
-DROP TABLE IF EXISTS `packs`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `packs` (
-  `title` varchar(255) NOT NULL,
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `file_id` mediumint(8) unsigned DEFAULT NULL,
-  `user_id` mediumint(8) unsigned NOT NULL,
-  `banner_file_id` mediumint(8) unsigned DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `simfiles`
---
-
-DROP TABLE IF EXISTS `simfiles`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `simfiles` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `title` varchar(255) NOT NULL,
-  `artist_id` mediumint(8) unsigned NOT NULL,
-  `user_id` mediumint(8) unsigned NOT NULL,
-  `bpm_high` int(11) NOT NULL,
-  `bpm_low` int(11) NOT NULL,
-  `bpm_changes` int(1) DEFAULT NULL,
-  `stops` int(1) DEFAULT NULL,
-  `fg_changes` int(1) DEFAULT NULL,
-  `bg_changes` int(1) DEFAULT NULL,
-  `banner_file_id` mediumint(8) unsigned DEFAULT NULL,
-  `simfile_file_id` mediumint(8) unsigned DEFAULT NULL,
-  `pack_id` mediumint(8) unsigned DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=427 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `step_artists`
---
-
-DROP TABLE IF EXISTS `step_artists`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `step_artists` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `tag` varchar(255) NOT NULL,
-  `user_id` mediumint(8) unsigned DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `steps`
---
-
-DROP TABLE IF EXISTS `steps`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `steps` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `simfile_id` mediumint(8) unsigned NOT NULL,
-  `mode` enum('dance-single','dance-double') NOT NULL,
-  `rating` int(10) unsigned NOT NULL,
-  `difficulty` enum('Beginner','Easy','Medium','Hard','Challenge','Edit') NOT NULL,
-  `step_artist_id` mediumint(8) unsigned DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=481 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `users`
---
-
-DROP TABLE IF EXISTS `users`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `users` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `email` varchar(255) NOT NULL,
-  `display_name` varchar(255) NOT NULL,
-  `facebook_id` varchar(255) DEFAULT NULL,
-  `quota` int(10) unsigned NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Table structure for table `users_meta`
---
-
-DROP TABLE IF EXISTS `users_meta`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `users_meta` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `user_id` mediumint(8) unsigned NOT NULL,
-  `firstname` varchar(255) DEFAULT NULL,
-  `lastname` varchar(255) DEFAULT NULL,
-  `country` varchar(255) NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
--- Dump completed on 2014-12-05 14:59:50
+-- MySQL dump 10.13  Distrib 5.6.12, for Win64 (x86_64)\r
+--\r
+-- Host: localhost    Database: divinelegy\r
+-- ------------------------------------------------------\r
+-- Server version      5.6.12\r
+\r
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\r
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\r
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\r
+/*!40101 SET NAMES utf8 */;\r
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\r
+/*!40103 SET TIME_ZONE='+00:00' */;\r
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\r
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\r
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\r
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\r
+\r
+--\r
+-- Table structure for table `artists`\r
+--\r
+\r
+DROP TABLE IF EXISTS `artists`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `artists` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `name` varchar(255) NOT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=24930 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `downloads`\r
+--\r
+\r
+DROP TABLE IF EXISTS `downloads`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `downloads` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `file_id` mediumint(8) unsigned NOT NULL,\r
+  `user_id` mediumint(8) unsigned NOT NULL,\r
+  `timestamp` int(10) unsigned NOT NULL,\r
+  `ip` varchar(15) DEFAULT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `files`\r
+--\r
+\r
+DROP TABLE IF EXISTS `files`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `files` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `filename` varchar(255) NOT NULL,\r
+  `hash` varchar(255) NOT NULL,\r
+  `path` varchar(255) NOT NULL,\r
+  `mimetype` varchar(255) NOT NULL,\r
+  `size` int(10) unsigned NOT NULL,\r
+  `uploaded` int(10) unsigned NOT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=31153 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `mirrors`\r
+--\r
+\r
+DROP TABLE IF EXISTS `mirrors`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `mirrors` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `uri` varchar(255) DEFAULT NULL,\r
+  `file_id` mediumint(8) unsigned NOT NULL,\r
+  `source` varchar(255) NOT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=2637 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `packs`\r
+--\r
+\r
+DROP TABLE IF EXISTS `packs`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `packs` (\r
+  `title` varchar(255) NOT NULL,\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `file_id` mediumint(8) unsigned DEFAULT NULL,\r
+  `user_id` mediumint(8) unsigned NOT NULL,\r
+  `banner_file_id` mediumint(8) unsigned DEFAULT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=2638 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `simfiles`\r
+--\r
+\r
+DROP TABLE IF EXISTS `simfiles`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `simfiles` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `title` varchar(255) NOT NULL,\r
+  `artist_id` mediumint(8) unsigned NOT NULL,\r
+  `user_id` mediumint(8) unsigned NOT NULL,\r
+  `bpm_high` int(11) NOT NULL,\r
+  `bpm_low` int(11) NOT NULL,\r
+  `bpm_changes` int(1) DEFAULT NULL,\r
+  `stops` int(1) DEFAULT NULL,\r
+  `fg_changes` int(1) DEFAULT NULL,\r
+  `bg_changes` int(1) DEFAULT NULL,\r
+  `banner_file_id` mediumint(8) unsigned DEFAULT NULL,\r
+  `simfile_file_id` mediumint(8) unsigned DEFAULT NULL,\r
+  `pack_id` mediumint(8) unsigned DEFAULT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=56572 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `step_artists`\r
+--\r
+\r
+DROP TABLE IF EXISTS `step_artists`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `step_artists` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `tag` varchar(255) NOT NULL,\r
+  `user_id` mediumint(8) unsigned DEFAULT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=5697 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `steps`\r
+--\r
+\r
+DROP TABLE IF EXISTS `steps`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `steps` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `simfile_id` mediumint(8) unsigned NOT NULL,\r
+  `mode` enum('dance-single','dance-double','dance-couple','dance-solo','dance-threepanel','dance-routine','pump-single','pump-double','pump-couple','pump-halfdouble','pump-routine','kb7-single','ez2-single','ez2-double','ez2-real','para-single','para-versus','ds3ddx-single','bm-single','bm-single5','bm-single7','bm-double','bm-double5','bm-double7','bm-versus5','bm-versus7','iidx-single','iidx-single5','iidx-single7','iidx-double','iidx-double5','iidx-double7','iidx-versus5','iidx-versus7','maniax-single','maniax-double','techno-single4','techno-single5','techno-single8','techno-double4','techno-double5','techno-double8','pnm-five','pnm-nine') DEFAULT NULL,\r
+  `rating` int(10) unsigned NOT NULL,\r
+  `difficulty` enum('Beginner','Easy','Medium','Hard','Challenge','Edit') DEFAULT NULL,\r
+  `step_artist_id` mediumint(8) unsigned DEFAULT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=159447 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `users`\r
+--\r
+\r
+DROP TABLE IF EXISTS `users`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `users` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `display_name` varchar(255) NOT NULL,\r
+  `facebook_id` varchar(255) DEFAULT NULL,\r
+  `quota` int(10) unsigned NOT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+\r
+--\r
+-- Table structure for table `users_meta`\r
+--\r
+\r
+DROP TABLE IF EXISTS `users_meta`;\r
+/*!40101 SET @saved_cs_client     = @@character_set_client */;\r
+/*!40101 SET character_set_client = utf8 */;\r
+CREATE TABLE `users_meta` (\r
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r
+  `user_id` mediumint(8) unsigned NOT NULL,\r
+  `firstname` varchar(255) DEFAULT NULL,\r
+  `lastname` varchar(255) DEFAULT NULL,\r
+  `country` varchar(255) NOT NULL,\r
+  PRIMARY KEY (`id`)\r
+) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;\r
+/*!40101 SET character_set_client = @saved_cs_client */;\r
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\r
+\r
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\r
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\r
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\r
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\r
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\r
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\r
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\r
+\r
+-- Dump completed on 2014-12-22  2:44:50\r
index f6afb25..511beaa 100644 (file)
@@ -12,6 +12,9 @@ if($config['mode'] == 'production')
 {\r
     ini_set('display_errors', 0);\r
     set_exception_handler(array('\Services\StatusReporter', 'exception'));\r
+} else {\r
+    ini_set('display_errors', 1);\r
+    error_reporting(E_ALL);\r
 }\r
 \r
 // Everything time related should be UTC+0 based\r