forked from tom.biard/ScienceQuest
commit
c1b10a7b88
@ -1,7 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/exception" isTestSource="false" packagePrefix="model" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/gateways" isTestSource="false" packagePrefix="model" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/mdl" isTestSource="false" packagePrefix="model" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/project/src/model/metier" isTestSource="false" packagePrefix="model" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
|
||||
<serverData>
|
||||
<paths name="ProjetPHP">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping local="$PROJECT_DIR$" web="/" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
</serverData>
|
||||
</component>
|
||||
</project>
|
@ -1,6 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MessDetectorOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCSFixerOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||
<option name="highlightLevel" value="WARNING" />
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.4">
|
||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
||||
</component>
|
||||
<component name="PhpStanOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PsalmOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace controller;
|
||||
|
||||
use config\Validation;
|
||||
use Exception;
|
||||
use model\ValidationException;
|
||||
|
||||
class JouerController{
|
||||
|
||||
public function __construct(){
|
||||
global $twig, $config;
|
||||
$dVue = [];
|
||||
$dVueErreur = [];
|
||||
|
||||
if(isset($_SESSION["configuration"]) && isset($_SESSION['role'])){
|
||||
try{
|
||||
$role = $_SESSION['role'];
|
||||
$role = Validation::valRole($role, $dVueErreur);
|
||||
$configurationJeu = $_SESSION['configuration'];
|
||||
$configurationJeu = Validation::valConfigurationJeu($configurationJeu, $dVueErreur);
|
||||
}catch(ValidationException $e){
|
||||
header('Location: .');
|
||||
}
|
||||
|
||||
if(count($dVueErreur) == 0){
|
||||
$idJeu = $configurationJeu->getJeu()->getId();
|
||||
switch($idJeu){
|
||||
case 3:
|
||||
new PenduController($role, $configurationJeu);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Jeu non défini !");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
header("Location: .");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue