@ -1,3 +1,3 @@
|
||||
RewriteEngine on
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteEngine on
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule . index.php [L]
|
@ -0,0 +1,2 @@
|
||||
#n:public
|
||||
!<md> [676280, 0, null, null, -2147483648, -2147483648]
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="-1562669c:19061473cbf:-7ffe" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,31 @@
|
||||
<?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="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/altorouter/altorouter" />
|
||||
<path value="$PROJECT_DIR$/vendor/twig/twig" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.3" />
|
||||
<component name="PhpStanOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PsalmOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -1,123 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="afa12d51-331f-4dbc-a297-7289ad4e396d" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Controleur/QuizController.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Controleur/QuizController.php" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ComposerSettings" synchronizationState="SYNCHRONIZE">
|
||||
<pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath>
|
||||
<execution />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<excluded-from-favorite>
|
||||
<branch-storage>
|
||||
<map>
|
||||
<entry type="LOCAL">
|
||||
<value>
|
||||
<list>
|
||||
<branch-info repo="$PROJECT_DIR$" source="master" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</branch-storage>
|
||||
</excluded-from-favorite>
|
||||
<favorite-branches>
|
||||
<branch-storage>
|
||||
<map>
|
||||
<entry type="LOCAL">
|
||||
<value>
|
||||
<list>
|
||||
<branch-info repo="$PROJECT_DIR$" source="reorganisation" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</branch-storage>
|
||||
</favorite-branches>
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="master" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="/opt/homebrew/Cellar/php/8.3.8/bin/php">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/composer" />
|
||||
<path value="$PROJECT_DIR$/vendor/altorouter/altorouter" />
|
||||
<path value="$PROJECT_DIR$/vendor/twig/twig" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php81" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"customColor": "",
|
||||
"associatedIndex": 4
|
||||
}</component>
|
||||
<component name="ProjectId" id="2oQGGlghI0ydDNgxjOeok3kwC7m" />
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="1" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "quizPart",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
},
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"postgresql"
|
||||
]
|
||||
}
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/vue/templates" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-PS-241.18034.69" />
|
||||
<option value="bundled-php-predefined-ba97393d7c68-48a1a656d44e-com.jetbrains.php.sharedIndexes-PS-241.18034.69" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="afa12d51-331f-4dbc-a297-7289ad4e396d" name="Changes" comment="" />
|
||||
<created>1730794293135</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1730794293135</updated>
|
||||
<workItem from="1730794294713" duration="2741000" />
|
||||
<workItem from="1730797544484" duration="43165000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin2.html.twig */
|
||||
class __TwigTemplate_487259351c054531e82d7ec374d515ee extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ S'inscrazeazeazeire ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" placeholder=\"Id\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required placeholder=\"Entrez votre mot de passe\"/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" placeholder=\"Confirmez votre mot de passe\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" value=\"Inscription\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin2.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin2.html.twig");
|
||||
}
|
||||
}
|
@ -1,167 +1,167 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* quiz.html.twig */
|
||||
class __TwigTemplate_eb15b3c7b3e1c48f1a2ebec5d9eb6685 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<title>Wiki Fantasy : Quiz</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link rel=\"stylesheet\" href=\"../../public/styles/styleQuiz.css\">
|
||||
<script defer src=\"../../public/script/theme-toggle.js\"></script>
|
||||
<script>
|
||||
// Timer pour 5 minutes
|
||||
var timeLeft = 300;
|
||||
function countdown() {
|
||||
var timerDisplay = document.getElementById(\"timer\");
|
||||
if (timeLeft <= 0) {
|
||||
document.getElementById(\"quizForm\").submit();
|
||||
} else {
|
||||
timerDisplay.innerHTML = timeLeft + \" seconds left\";
|
||||
timeLeft -= 1;
|
||||
setTimeout(countdown, 1000);
|
||||
}
|
||||
}
|
||||
window.onload = countdown;
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"../favorite.html\"><img src=\"../../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<img src=\"../../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<img src=\"../../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h1>▶ Quiz ◀</h1>
|
||||
<div class=\"quiz\">
|
||||
<h2> ";
|
||||
// line 44
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "question", [], "any", false, false, false, 44), "html", null, true);
|
||||
yield " </h2>
|
||||
<a id=\"timer\"> 300 seconds left .. </a>
|
||||
|
||||
<form id=\"quizForm\" method=\"POST\">
|
||||
<div class=\"answers\">
|
||||
<button class=\"answer\" name=\"answera\" value=\"A-";
|
||||
// line 49
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 50
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answera", [], "any", false, false, false, 50), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
<button class=\"answer\" name=\"answerb\" value=\"B-";
|
||||
// line 52
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 53
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answerb", [], "any", false, false, false, 53), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
<button class=\"answer\" name=\"answerc\" value=\"C-";
|
||||
// line 55
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 56
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answerc", [], "any", false, false, false, 56), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
<button class=\"answer\" name=\"answerd\" value=\"D-";
|
||||
// line 58
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 59
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answerd", [], "any", false, false, false, 59), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
</div>
|
||||
<input type=\"hidden\" name=\"action\" value=\"canswer\">
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "quiz.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 126 => 59, 122 => 58, 117 => 56, 113 => 55, 108 => 53, 104 => 52, 99 => 50, 95 => 49, 87 => 44, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "quiz.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/quiz.html.twig");
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* quiz.html.twig */
|
||||
class __TwigTemplate_eb15b3c7b3e1c48f1a2ebec5d9eb6685 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<title>Wiki Fantasy : Quiz</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link rel=\"stylesheet\" href=\"../../public/styles/styleQuiz.css\">
|
||||
<script defer src=\"../../public/script/theme-toggle.js\"></script>
|
||||
<script>
|
||||
// Timer pour 5 minutes
|
||||
var timeLeft = 300;
|
||||
function countdown() {
|
||||
var timerDisplay = document.getElementById(\"timer\");
|
||||
if (timeLeft <= 0) {
|
||||
document.getElementById(\"quizForm\").submit();
|
||||
} else {
|
||||
timerDisplay.innerHTML = timeLeft + \" seconds left\";
|
||||
timeLeft -= 1;
|
||||
setTimeout(countdown, 1000);
|
||||
}
|
||||
}
|
||||
window.onload = countdown;
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"../favorite.html\"><img src=\"../../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<img src=\"../../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<img src=\"../../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h1>▶ Quiz ◀</h1>
|
||||
<div class=\"quiz\">
|
||||
<h2> ";
|
||||
// line 44
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "question", [], "any", false, false, false, 44), "html", null, true);
|
||||
yield " </h2>
|
||||
<a id=\"timer\"> 300 seconds left .. </a>
|
||||
|
||||
<form id=\"quizForm\" method=\"POST\">
|
||||
<div class=\"answers\">
|
||||
<button class=\"answer\" name=\"answera\" value=\"A-";
|
||||
// line 49
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 50
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answera", [], "any", false, false, false, 50), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
<button class=\"answer\" name=\"answerb\" value=\"B-";
|
||||
// line 52
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 53
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answerb", [], "any", false, false, false, 53), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
<button class=\"answer\" name=\"answerc\" value=\"C-";
|
||||
// line 55
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 56
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answerc", [], "any", false, false, false, 56), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
<button class=\"answer\" name=\"answerd\" value=\"D-";
|
||||
// line 58
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["id"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
";
|
||||
// line 59
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["question"] ?? null), "answerd", [], "any", false, false, false, 59), "html", null, true);
|
||||
yield "
|
||||
</button>
|
||||
</div>
|
||||
<input type=\"hidden\" name=\"action\" value=\"canswer\">
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "quiz.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 126 => 59, 122 => 58, 117 => 56, 113 => 55, 108 => 53, 104 => 52, 99 => 50, 95 => 49, 87 => 44, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "quiz.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/quiz.html.twig");
|
||||
}
|
||||
}
|
||||
|
@ -1,115 +1,115 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin.html */
|
||||
class __TwigTemplate_d8d8ee303bb01e4f719db1d13398adc0 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield " <div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ S'inscrire ◀</h1>
|
||||
<form action=\"../script/signin.php\" method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"name\" name=\"name\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"pswd\" name=\"pswd\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"confpswd\" name=\"confpswd\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" value=\"Inscription\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin.html", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/signin.html");
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin.html */
|
||||
class __TwigTemplate_d8d8ee303bb01e4f719db1d13398adc0 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield " <div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ S'inscrire ◀</h1>
|
||||
<form action=\"../script/signin.php\" method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"name\" name=\"name\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"pswd\" name=\"pswd\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"confpswd\" name=\"confpswd\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" value=\"Inscription\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin.html", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/signin.html");
|
||||
}
|
||||
}
|
||||
|
@ -1,90 +1,90 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* head.html.twig */
|
||||
class __TwigTemplate_eb23fe14e9c99cb057475369e77b2ea7 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<title>";
|
||||
// line 6
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["title"] ?? null), "html", null, true);
|
||||
yield "</title>
|
||||
<link rel=\"stylesheet\" href=\"";
|
||||
// line 7
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["style"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../../public/images/iconeSombre.ico\" />
|
||||
<script src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "head.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 53 => 7, 49 => 6, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "head.html.twig", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/head.html.twig");
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* head.html.twig */
|
||||
class __TwigTemplate_eb23fe14e9c99cb057475369e77b2ea7 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<title>";
|
||||
// line 6
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["title"] ?? null), "html", null, true);
|
||||
yield "</title>
|
||||
<link rel=\"stylesheet\" href=\"";
|
||||
// line 7
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["style"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../../public/images/iconeSombre.ico\" />
|
||||
<script src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "head.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 53 => 7, 49 => 6, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "head.html.twig", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/head.html.twig");
|
||||
}
|
||||
}
|
||||
|
@ -1,78 +1,78 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* bandeau.html.twig */
|
||||
class __TwigTemplate_012dc2aef67e620d386f46e331598640 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<a href=\"profil.html\"><img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
</div>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "bandeau.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "bandeau.html.twig", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/bandeau.html.twig");
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* bandeau.html.twig */
|
||||
class __TwigTemplate_012dc2aef67e620d386f46e331598640 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<a href=\"profil.html\"><img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
</div>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "bandeau.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "bandeau.html.twig", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/bandeau.html.twig");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin4.html.twig */
|
||||
class __TwigTemplate_02d73cdfa663473648587454068306f0 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ ";
|
||||
// line 28
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield " ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" placeholder=\"Id\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required placeholder=\"";
|
||||
// line 43
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\"/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" placeholder=\"";
|
||||
// line 48
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" value=\"Inscription\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin4.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin4.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin4.html.twig");
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* login.html.twig */
|
||||
class __TwigTemplate_07a755596da3dba7ab89ea161b697e55 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleLogin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Connexion</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\">
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ Connexion ◀</h1>
|
||||
|
||||
<form class=\"login\" method=\"post\">
|
||||
<p> <strong>Identifiant *</strong></p>
|
||||
<input type=\"text\" class=\"connexion\" name=\"pseudo\" id=\"pseudo\" placeholder=\"Entrez votre pseudo ...\" required />
|
||||
|
||||
<p> <strong> Mot de passe *</strong></p>
|
||||
<input type=\"password\" class=\"connexion\" name=\"mdp\" id=\"mdp\" placeholder=\"Entrez votre mdp ...\" required />
|
||||
|
||||
<div class=\"createAccount\">
|
||||
<p class=\"createAccount\">Vous n'avez pas de compte?</p>
|
||||
<a href=\"signin.html.twig\" class=\"createAccount\">S'incrire</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=\"buttonSubmitDiv\">
|
||||
<button class=\"buttonSudmite\">Connexion</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "login.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "login.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/login.html.twig");
|
||||
}
|
||||
}
|
@ -1,150 +1,150 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* quote.html */
|
||||
class __TwigTemplate_e80b479dc855245ef0d42a4f64b1f83e extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<html>
|
||||
<body>
|
||||
<div class=\"Quote_container\">
|
||||
<img class=\"image_carac\" src=\"";
|
||||
// line 4
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["srcImg"] ?? null), "html", null, true);
|
||||
yield "\" alt=\"";
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nameCarac"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
<h1 class=\"quote_content\">
|
||||
<strong>
|
||||
";
|
||||
// line 7
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["quoteContent"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</strong>
|
||||
</h1>
|
||||
<ul>
|
||||
<li>
|
||||
";
|
||||
// line 12
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["sourceName"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</li>
|
||||
<li>
|
||||
";
|
||||
// line 15
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nameCarac"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</li>
|
||||
<li>
|
||||
";
|
||||
// line 18
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["dateSortie"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</li>
|
||||
</ul>
|
||||
<div class=\"like\">
|
||||
<p>
|
||||
";
|
||||
// line 23
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nbLike"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\"Comment_Container\">
|
||||
";
|
||||
// line 28
|
||||
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["comment"] ?? null)) > 0)) {
|
||||
yield " <div>
|
||||
";
|
||||
// line 29
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = CoreExtension::ensureTraversable(($context["comment"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["com"]) {
|
||||
// line 30
|
||||
yield " <p class=\"userCom\">";
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["com"], "user", [], "any", false, false, false, 30), "html", null, true);
|
||||
yield "</p>
|
||||
<p class=\"com\">";
|
||||
// line 31
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["com"], "content", [], "any", false, false, false, 31), "html", null, true);
|
||||
yield "</p>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_key'], $context['com'], $context['_parent']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 32
|
||||
yield " </div>
|
||||
";
|
||||
}
|
||||
// line 34
|
||||
yield " </div>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "quote.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 116 => 34, 112 => 32, 104 => 31, 99 => 30, 95 => 29, 91 => 28, 83 => 23, 75 => 18, 69 => 15, 63 => 12, 55 => 7, 47 => 4, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "quote.html", "/home/www/kekentin/public_html/WF/WF-Website/vue/templates/quote.html");
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* quote.html */
|
||||
class __TwigTemplate_e80b479dc855245ef0d42a4f64b1f83e extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<html>
|
||||
<body>
|
||||
<div class=\"Quote_container\">
|
||||
<img class=\"image_carac\" src=\"";
|
||||
// line 4
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["srcImg"] ?? null), "html", null, true);
|
||||
yield "\" alt=\"";
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nameCarac"] ?? null), "html", null, true);
|
||||
yield "\">
|
||||
<h1 class=\"quote_content\">
|
||||
<strong>
|
||||
";
|
||||
// line 7
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["quoteContent"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</strong>
|
||||
</h1>
|
||||
<ul>
|
||||
<li>
|
||||
";
|
||||
// line 12
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["sourceName"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</li>
|
||||
<li>
|
||||
";
|
||||
// line 15
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nameCarac"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</li>
|
||||
<li>
|
||||
";
|
||||
// line 18
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["dateSortie"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</li>
|
||||
</ul>
|
||||
<div class=\"like\">
|
||||
<p>
|
||||
";
|
||||
// line 23
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["nbLike"] ?? null), "html", null, true);
|
||||
yield "
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\"Comment_Container\">
|
||||
";
|
||||
// line 28
|
||||
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["comment"] ?? null)) > 0)) {
|
||||
yield " <div>
|
||||
";
|
||||
// line 29
|
||||
$context['_parent'] = $context;
|
||||
$context['_seq'] = CoreExtension::ensureTraversable(($context["comment"] ?? null));
|
||||
foreach ($context['_seq'] as $context["_key"] => $context["com"]) {
|
||||
// line 30
|
||||
yield " <p class=\"userCom\">";
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["com"], "user", [], "any", false, false, false, 30), "html", null, true);
|
||||
yield "</p>
|
||||
<p class=\"com\">";
|
||||
// line 31
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["com"], "content", [], "any", false, false, false, 31), "html", null, true);
|
||||
yield "</p>
|
||||
";
|
||||
}
|
||||
$_parent = $context['_parent'];
|
||||
unset($context['_seq'], $context['_key'], $context['com'], $context['_parent']);
|
||||
$context = array_intersect_key($context, $_parent) + $_parent;
|
||||
// line 32
|
||||
yield " </div>
|
||||
";
|
||||
}
|
||||
// line 34
|
||||
yield " </div>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "quote.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 116 => 34, 112 => 32, 104 => 31, 99 => 30, 95 => 29, 91 => 28, 83 => 23, 75 => 18, 69 => 15, 63 => 12, 55 => 7, 47 => 4, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "quote.html", "/home/www/kekentin/public_html/WF/WF-Website/vue/templates/quote.html");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin5.html.twig */
|
||||
class __TwigTemplate_b1f0b539b8066ca5a58d316472e062b0 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ ";
|
||||
// line 28
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
|
||||
yield " ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" placeholder=\"Id\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required placeholder=\"";
|
||||
// line 43
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\"/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" placeholder=\"";
|
||||
// line 48
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" value=\"Inscription\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin5.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin5.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin5.html.twig");
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin6.html.twig */
|
||||
class __TwigTemplate_7a4f39ed5cce012c6d4972b06e431782 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ ";
|
||||
// line 28
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
|
||||
yield " ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" placeholder=\"Id\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required placeholder=\"";
|
||||
// line 43
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\"/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" placeholder=\"";
|
||||
// line 48
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"hidden\" class=\"btn\" name=\"action\" value=\"validsignin\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin6.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin6.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin6.html.twig");
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin7.html.twig */
|
||||
class __TwigTemplate_179113c369ca1501764a939233b8ee58 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ ";
|
||||
// line 28
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
|
||||
yield " ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" placeholder=\"Id\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required placeholder=\"";
|
||||
// line 43
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\"/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" placeholder=\"";
|
||||
// line 48
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" name=\"action\" value=\"validsignin\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin7.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin7.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin7.html.twig");
|
||||
}
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin1.html.twig */
|
||||
class __TwigTemplate_c5ff4ebd3f89e0ca0a1643dfb2cba640 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ ";
|
||||
// line 28
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
|
||||
yield " ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" placeholder=\"Id\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required placeholder=\"";
|
||||
// line 43
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\"/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" placeholder=\"";
|
||||
// line 48
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" name=\"action\" value=\"validsignin\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin1.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin1.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin1.html.twig");
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin.html.twig */
|
||||
class __TwigTemplate_f3fb3bd89b84ec5439a034a1b7acb44e extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ S'inscrire ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" value=\"Inscription\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin.html.twig");
|
||||
}
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* signin3.html.twig */
|
||||
class __TwigTemplate_13f68f972002b997fce4f87301b50b63 extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield "<!DOCTYPE html>
|
||||
<html lang=\"fr\">
|
||||
<head>
|
||||
<meta charset=\"UTF-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
||||
<link rel=\"stylesheet\" type=\"text/css\" href=\"../public/styles/styleSignin.css\" media=\"screen\">
|
||||
<title>Wiki Fantasy : Inscription</title>
|
||||
<link id=\"favicon\" rel=\"icon\" href=\"../images/iconeSombre.ico\"> <!-- Par défaut sombre -->
|
||||
<link href=\"https://fonts.googleapis.com/css2?family=Lemon&display=swap\" rel=\"stylesheet\">
|
||||
<script defer src=\"../public/script/theme-toggle.js\"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<a href=\"favorite.html\"><img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\"></a>
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<a href=\"quiz.html\"><img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ lo ◀</h1>
|
||||
<form method=\"post\">
|
||||
<div class=\"signin\">
|
||||
<div class=\"DivId\">
|
||||
<p>Identifiant *</p>
|
||||
<input type=\"text\" class=\"champ\" id=\"pseudo\" name=\"pseudo\" placeholder=\"Id\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"DivEmail\">
|
||||
<p>Email *</p>
|
||||
<input type=\"email\" class=\"champ\" id=\"email\" name=\"email\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"mdp\">
|
||||
<p>Mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"mdp\" name=\"mdp\" required placeholder=\"";
|
||||
// line 43
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\"/>
|
||||
</div>
|
||||
|
||||
<div class=\"confmdp\">
|
||||
<p>Confirmer mot de passe *</p>
|
||||
<input type=\"password\" class=\"champ\" id=\"cmdp\" name=\"cmdp\" placeholder=\"";
|
||||
// line 48
|
||||
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
|
||||
yield "\" required/>
|
||||
</div>
|
||||
|
||||
<div class=\"imgprof\">
|
||||
<p>Image *</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=\"confirmer\">
|
||||
<input type=\"submit\" class=\"btn\" value=\"Inscription\" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "signin3.html.twig";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function isTraitable(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 94 => 48, 86 => 43, 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "signin3.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin3.html.twig");
|
||||
}
|
||||
}
|
@ -1,102 +1,102 @@
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* login.html */
|
||||
class __TwigTemplate_2cd0c955593f8f6da78deaca6452905d extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield " <div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\">
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ Connexion ◀</h1>
|
||||
|
||||
<div class=\"login\">
|
||||
<p> <strong>Identifiant *</strong></p>
|
||||
<input type=\"text\" class=\"connexion\" name=\"name\" required />
|
||||
|
||||
<p> <strong> Mot de passe *</strong></p>
|
||||
<input type=\"password\" class=\"connexion\" name=\"passwd\" required />
|
||||
|
||||
<div class=\"createAccount\">
|
||||
<p class=\"createAccount\">Vous n'avez pas de compte?</p>
|
||||
<a href=\"/signin\" class=\"createAccount\">S'incrire</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=\"buttonSudmiteDiv\">
|
||||
<button class=\"buttonSudmite\">Connexion</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "login.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "login.html", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/login.html");
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Extension\CoreExtension;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
use Twig\Markup;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use Twig\Sandbox\SecurityNotAllowedTagError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFilterError;
|
||||
use Twig\Sandbox\SecurityNotAllowedFunctionError;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
|
||||
/* login.html */
|
||||
class __TwigTemplate_2cd0c955593f8f6da78deaca6452905d extends Template
|
||||
{
|
||||
private Source $source;
|
||||
/**
|
||||
* @var array<string, Template>
|
||||
*/
|
||||
private array $macros = [];
|
||||
|
||||
public function __construct(Environment $env)
|
||||
{
|
||||
parent::__construct($env);
|
||||
|
||||
$this->source = $this->getSourceContext();
|
||||
|
||||
$this->parent = false;
|
||||
|
||||
$this->blocks = [
|
||||
];
|
||||
}
|
||||
|
||||
protected function doDisplay(array $context, array $blocks = []): iterable
|
||||
{
|
||||
$macros = $this->macros;
|
||||
// line 1
|
||||
yield " <div class=\"container\">
|
||||
<div class=\"header\">
|
||||
<div class=\"nav\">
|
||||
<img src=\"../images/coeur.svg\" alt=\"coeur\" width=\"67px\" height=\"67px\" onmousedown=\"return false\">
|
||||
<img id=\"theme-icon\" src=\"../images/light.svg\" alt=\"toggle theme\" width=\"72px\" height=\"37px\" onmousedown=\"return false\" onclick=\"toggleTheme()\">
|
||||
<img src=\"../images/quizz.svg\" alt=\"quizz\" width=\"51px\" height=\"82px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
<div class=\"logo\">
|
||||
<a href=\"accueil.html\"><img src=\"../images/WIKIFANTASY.png\" alt=\"Logo\" width=\"227px\" height=\"106px\" onmousedown=\"return false\"></a>
|
||||
</div>
|
||||
<div class=\"user\">
|
||||
<img src=\"../images/user_dark.png\" alt=\"user\" width=\"70px\" height=\"70px\" onmousedown=\"return false\">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h1>▶ Connexion ◀</h1>
|
||||
|
||||
<div class=\"login\">
|
||||
<p> <strong>Identifiant *</strong></p>
|
||||
<input type=\"text\" class=\"connexion\" name=\"name\" required />
|
||||
|
||||
<p> <strong> Mot de passe *</strong></p>
|
||||
<input type=\"password\" class=\"connexion\" name=\"passwd\" required />
|
||||
|
||||
<div class=\"createAccount\">
|
||||
<p class=\"createAccount\">Vous n'avez pas de compte?</p>
|
||||
<a href=\"/signin\" class=\"createAccount\">S'incrire</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=\"buttonSudmiteDiv\">
|
||||
<button class=\"buttonSudmite\">Connexion</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>";
|
||||
yield from [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getTemplateName(): string
|
||||
{
|
||||
return "login.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function getDebugInfo(): array
|
||||
{
|
||||
return array ( 42 => 1,);
|
||||
}
|
||||
|
||||
public function getSourceContext(): Source
|
||||
{
|
||||
return new Source("", "login.html", "/home/www/lebeaulato/public_html/WF-Website/vue/templates/login.html");
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
{
|
||||
"require": {
|
||||
"twig/twig": "^3.0",
|
||||
"ext-pdo": "*",
|
||||
"altorouter/altorouter": "^2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Controleur\\": "src/Controleur/",
|
||||
"Model\\": "src/Model/",
|
||||
"Gateway\\": "src/Gateway/",
|
||||
"Entity\\": "src/Entity/"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"require": {
|
||||
"twig/twig": "^3.0",
|
||||
"ext-pdo": "*",
|
||||
"altorouter/altorouter": "^2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Controleur\\": "src/Controleur/",
|
||||
"Model\\": "src/Model/",
|
||||
"Gateway\\": "src/Gateway/",
|
||||
"Entity\\": "src/Entity/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,462 +1,462 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "68804b2111cb6b8bf6edf66cb2b4669c",
|
||||
"packages": [
|
||||
{
|
||||
"name": "altorouter/altorouter",
|
||||
"version": "2.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dannyvankooten/AltoRouter.git",
|
||||
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
|
||||
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeclimate/php-test-reporter": "dev-master",
|
||||
"phpunit/phpunit": "5.7.*",
|
||||
"squizlabs/php_codesniffer": "3.4.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"AltoRouter.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Danny van Kooten",
|
||||
"email": "dannyvankooten@gmail.com",
|
||||
"homepage": "http://dannyvankooten.com/"
|
||||
},
|
||||
{
|
||||
"name": "Koen Punt",
|
||||
"homepage": "https://github.com/koenpunt"
|
||||
},
|
||||
{
|
||||
"name": "niahoo",
|
||||
"homepage": "https://github.com/niahoo"
|
||||
}
|
||||
],
|
||||
"description": "A lightning fast router for PHP",
|
||||
"homepage": "https://github.com/dannyvankooten/AltoRouter",
|
||||
"keywords": [
|
||||
"lightweight",
|
||||
"router",
|
||||
"routing"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/dannyvankooten/AltoRouter/issues",
|
||||
"source": "https://github.com/dannyvankooten/AltoRouter/tree/2.0.2"
|
||||
},
|
||||
"time": "2020-03-09T08:34:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v3.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
|
||||
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"function.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-04-18T09:32:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.31.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
|
||||
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-ctype": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-ctype": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Ctype\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Gert de Pagter",
|
||||
"email": "BackEndTea@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for ctype functions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"ctype",
|
||||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.31.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php81",
|
||||
"version": "v1.31.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php81.git",
|
||||
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
|
||||
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php81\\": ""
|
||||
},
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v3.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
|
||||
"reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.0.2",
|
||||
"symfony/deprecation-contracts": "^2.5|^3",
|
||||
"symfony/polyfill-ctype": "^1.8",
|
||||
"symfony/polyfill-mbstring": "^1.3",
|
||||
"symfony/polyfill-php81": "^1.29"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/container": "^1.0|^2.0",
|
||||
"symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/Resources/core.php",
|
||||
"src/Resources/debug.php",
|
||||
"src/Resources/escaper.php",
|
||||
"src/Resources/string_loader.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Twig\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Twig Team",
|
||||
"role": "Contributors"
|
||||
},
|
||||
{
|
||||
"name": "Armin Ronacher",
|
||||
"email": "armin.ronacher@active-4.com",
|
||||
"role": "Project Founder"
|
||||
}
|
||||
],
|
||||
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
||||
"homepage": "https://twig.symfony.com",
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/twigphp/Twig/issues",
|
||||
"source": "https://github.com/twigphp/Twig/tree/v3.14.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T17:55:12+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"ext-pdo": "*"
|
||||
},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "68804b2111cb6b8bf6edf66cb2b4669c",
|
||||
"packages": [
|
||||
{
|
||||
"name": "altorouter/altorouter",
|
||||
"version": "2.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dannyvankooten/AltoRouter.git",
|
||||
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
|
||||
"reference": "f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeclimate/php-test-reporter": "dev-master",
|
||||
"phpunit/phpunit": "5.7.*",
|
||||
"squizlabs/php_codesniffer": "3.4.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"AltoRouter.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Danny van Kooten",
|
||||
"email": "dannyvankooten@gmail.com",
|
||||
"homepage": "http://dannyvankooten.com/"
|
||||
},
|
||||
{
|
||||
"name": "Koen Punt",
|
||||
"homepage": "https://github.com/koenpunt"
|
||||
},
|
||||
{
|
||||
"name": "niahoo",
|
||||
"homepage": "https://github.com/niahoo"
|
||||
}
|
||||
],
|
||||
"description": "A lightning fast router for PHP",
|
||||
"homepage": "https://github.com/dannyvankooten/AltoRouter",
|
||||
"keywords": [
|
||||
"lightweight",
|
||||
"router",
|
||||
"routing"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/dannyvankooten/AltoRouter/issues",
|
||||
"source": "https://github.com/dannyvankooten/AltoRouter/tree/2.0.2"
|
||||
},
|
||||
"time": "2020-03-09T08:34:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v3.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
|
||||
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"function.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-04-18T09:32:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.31.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
|
||||
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-ctype": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-ctype": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Ctype\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Gert de Pagter",
|
||||
"email": "BackEndTea@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for ctype functions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"ctype",
|
||||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.31.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php81",
|
||||
"version": "v1.31.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php81.git",
|
||||
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
|
||||
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php81\\": ""
|
||||
},
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v3.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
|
||||
"reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.0.2",
|
||||
"symfony/deprecation-contracts": "^2.5|^3",
|
||||
"symfony/polyfill-ctype": "^1.8",
|
||||
"symfony/polyfill-mbstring": "^1.3",
|
||||
"symfony/polyfill-php81": "^1.29"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/container": "^1.0|^2.0",
|
||||
"symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/Resources/core.php",
|
||||
"src/Resources/debug.php",
|
||||
"src/Resources/escaper.php",
|
||||
"src/Resources/string_loader.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Twig\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Twig Team",
|
||||
"role": "Contributors"
|
||||
},
|
||||
{
|
||||
"name": "Armin Ronacher",
|
||||
"email": "armin.ronacher@active-4.com",
|
||||
"role": "Project Founder"
|
||||
}
|
||||
],
|
||||
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
||||
"homepage": "https://twig.symfony.com",
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/twigphp/Twig/issues",
|
||||
"source": "https://github.com/twigphp/Twig/tree/v3.14.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T17:55:12+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"ext-pdo": "*"
|
||||
},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
|
@ -1,62 +1,62 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI-pipeline
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
|
||||
|
||||
- name: code-inspection
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
|
||||
secrets: [ SECRET_SONAR_LOGIN ]
|
||||
settings:
|
||||
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||
sonar_token:
|
||||
from_secret: SECRET_SONAR_LOGIN
|
||||
commands:
|
||||
- dotnet sonarscanner begin /k:WF-Website /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="" /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||
|
||||
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
||||
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||
|
||||
# database container deployment
|
||||
- name: deploy-container-mysql-WIKI_FANTASY
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
environment:
|
||||
IMAGENAME: mysql:latest
|
||||
CONTAINERNAME: mysql
|
||||
COMMAND: create
|
||||
OVERWRITE: false
|
||||
PRIVATE: true
|
||||
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_ROOT_PASSWORD:
|
||||
from_secret: db_root_password
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_DATABASE:
|
||||
from_secret: db_database
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_USER:
|
||||
from_secret: db_user
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_PASSWORD:
|
||||
from_secret: db_password
|
||||
ADMINS: kentinbrongniart , kevinmondejar , lenibeaulaton , louisguichard-montguers , maximerocher , tommynguyen , matthieurestituito
|
||||
|
||||
|
||||
- name: generate-and-deploy-docs
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
|
||||
failure: ignore
|
||||
volumes:
|
||||
- name:
|
||||
path:
|
||||
commands:
|
||||
- /entrypoint.sh
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
depends_on: []
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI-pipeline
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
|
||||
|
||||
- name: code-inspection
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
|
||||
secrets: [ SECRET_SONAR_LOGIN ]
|
||||
settings:
|
||||
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||
sonar_token:
|
||||
from_secret: SECRET_SONAR_LOGIN
|
||||
commands:
|
||||
- dotnet sonarscanner begin /k:WF-Website /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="" /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||
|
||||
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
||||
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
|
||||
|
||||
# database container deployment
|
||||
- name: deploy-container-mysql-WIKI_FANTASY
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
environment:
|
||||
IMAGENAME: mysql:latest
|
||||
CONTAINERNAME: mysql
|
||||
COMMAND: create
|
||||
OVERWRITE: false
|
||||
PRIVATE: true
|
||||
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_ROOT_PASSWORD:
|
||||
from_secret: db_root_password
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_DATABASE:
|
||||
from_secret: db_database
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_USER:
|
||||
from_secret: db_user
|
||||
CODEFIRST_CLIENTDRONE_ENV_MYSQL_PASSWORD:
|
||||
from_secret: db_password
|
||||
ADMINS: kentinbrongniart , kevinmondejar , lenibeaulaton , louisguichard-montguers , maximerocher , tommynguyen , matthieurestituito
|
||||
|
||||
|
||||
- name: generate-and-deploy-docs
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
|
||||
failure: ignore
|
||||
volumes:
|
||||
- name:
|
||||
path:
|
||||
commands:
|
||||
- /entrypoint.sh
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
depends_on: []
|
||||
|
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@ -1,39 +1,39 @@
|
||||
// auth-check.js
|
||||
|
||||
// Vérifier si l'utilisateur est connecté
|
||||
function isUserLoggedIn() {
|
||||
// Vérifiez si 'isLoggedIn' est défini dans le localStorage ou par un cookie
|
||||
return localStorage.getItem('isLoggedIn') === 'true';
|
||||
}
|
||||
|
||||
// Redirection des liens en fonction de l'état de connexion
|
||||
function setupLinks() {
|
||||
const favoriteLink = document.querySelector('a[href="favorite.html"]');
|
||||
const quizLink = document.querySelector('a[href="quiz.html"]');
|
||||
const userIcon = document.querySelector('.user img');
|
||||
|
||||
if (!isUserLoggedIn()) {
|
||||
// Si l'utilisateur n'est pas connecté, rediriger vers la page de connexion
|
||||
if (favoriteLink) favoriteLink.href = "login.html";
|
||||
if (quizLink) quizLink.href = "login.html";
|
||||
if (userIcon) {
|
||||
userIcon.style.cursor = "pointer"; // Changer le curseur pour indiquer la cliquabilité
|
||||
userIcon.addEventListener('click', () => {
|
||||
window.location.href = "login.html";
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Si l'utilisateur est connecté, définir les liens vers les pages dédiées
|
||||
if (favoriteLink) favoriteLink.href = "favorite.html";
|
||||
if (quizLink) quizLink.href = "quiz.html";
|
||||
if (userIcon) {
|
||||
userIcon.style.cursor = "pointer"; // Changer le curseur pour indiquer la cliquabilité
|
||||
userIcon.addEventListener('click', () => {
|
||||
window.location.href = "user-profile.html";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialiser les liens lors du chargement de la page
|
||||
document.addEventListener('DOMContentLoaded', setupLinks);
|
||||
// auth-check.js
|
||||
|
||||
// Vérifier si l'utilisateur est connecté
|
||||
function isUserLoggedIn() {
|
||||
// Vérifiez si 'isLoggedIn' est défini dans le localStorage ou par un cookie
|
||||
return localStorage.getItem('isLoggedIn') === 'true';
|
||||
}
|
||||
|
||||
// Redirection des liens en fonction de l'état de connexion
|
||||
function setupLinks() {
|
||||
const favoriteLink = document.querySelector('a[href="favorite.html"]');
|
||||
const quizLink = document.querySelector('a[href="quiz.html"]');
|
||||
const userIcon = document.querySelector('.user img');
|
||||
|
||||
if (!isUserLoggedIn()) {
|
||||
// Si l'utilisateur n'est pas connecté, rediriger vers la page de connexion
|
||||
if (favoriteLink) favoriteLink.href = "login.html";
|
||||
if (quizLink) quizLink.href = "login.html";
|
||||
if (userIcon) {
|
||||
userIcon.style.cursor = "pointer"; // Changer le curseur pour indiquer la cliquabilité
|
||||
userIcon.addEventListener('click', () => {
|
||||
window.location.href = "login.html";
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Si l'utilisateur est connecté, définir les liens vers les pages dédiées
|
||||
if (favoriteLink) favoriteLink.href = "favorite.html";
|
||||
if (quizLink) quizLink.href = "quiz.html";
|
||||
if (userIcon) {
|
||||
userIcon.style.cursor = "pointer"; // Changer le curseur pour indiquer la cliquabilité
|
||||
userIcon.addEventListener('click', () => {
|
||||
window.location.href = "user-profile.html";
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialiser les liens lors du chargement de la page
|
||||
document.addEventListener('DOMContentLoaded', setupLinks);
|
||||
|
@ -1,169 +1,169 @@
|
||||
|
||||
function editFieldUsername(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
var currentValue = pElement.textContent.trim();// Obtenir le texte actuel du <p>
|
||||
|
||||
// Créer un champ de saisie <input> avec la valeur actuelle
|
||||
var input = document.createElement('input');
|
||||
input.type = 'text';
|
||||
input.value = currentValue
|
||||
input.class = 'changeValue';
|
||||
|
||||
input.setAttribute('onblur', 'saveFieldUsername("' + id + '", this.value)'); // Sauvegarde lors de la perte de focus
|
||||
|
||||
// Remplacer le <p> par le champ <input>
|
||||
pElement.innerHTML = '';
|
||||
pElement.appendChild(input);
|
||||
|
||||
input.focus(); // Mettre le focus sur le champ de saisie
|
||||
}
|
||||
|
||||
//Sauvegarder les changements sur la vue pour le username
|
||||
function saveFieldUsername(id, newValue) {
|
||||
if (id === 'username') {
|
||||
if (newValue.trim() === "") {
|
||||
alert('Le nom d\'utilisateur ne peut pas être vide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si le nom d'utilisateur est vide
|
||||
}
|
||||
}
|
||||
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
// Mettre à jour la valeur avec la nouvelle saisie
|
||||
pElement.innerHTML = '<strong>' + newValue + ' <img class="imgModify" src="../images/modify.svg" onclick="editFieldUsername(\'' + id + '\')"/></strong>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function editFieldEmail(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
var currentValue = pElement.textContent.trim();// Obtenir le texte actuel du <p>
|
||||
|
||||
// Créer un champ de saisie <input> avec la valeur actuelle
|
||||
var input = document.createElement('input');
|
||||
input.type = 'email';
|
||||
input.value = currentValue
|
||||
input.class = 'changeValue';
|
||||
|
||||
input.setAttribute('onblur', 'saveFieldEmail("' + id + '", this.value)'); // Sauvegarde lors de la perte de focus
|
||||
|
||||
// Remplacer le <p> par le champ <input>
|
||||
pElement.innerHTML = '';
|
||||
pElement.appendChild(input);
|
||||
|
||||
input.focus(); // Mettre le focus sur le champ de saisie
|
||||
}
|
||||
|
||||
//Sauvegarder les changements sur la vue pour l'email
|
||||
function saveFieldEmail(id, newValue) {
|
||||
if (id === 'email') {
|
||||
if (!validateEmail(newValue)) {
|
||||
alert('Adresse email invalide. Veuillez entrer un email valide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si l'email n'est pas valide
|
||||
}
|
||||
}
|
||||
if (id === 'username') {
|
||||
if (newValue.trim() === "") {
|
||||
alert('Le nom d\'utilisateur ne peut pas être vide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si le nom d'utilisateur est vide
|
||||
}
|
||||
}
|
||||
|
||||
var pElement = document.getElementById(id); // Récupérer l'élément <p> via son identifiant
|
||||
|
||||
// Mettre à jour la valeur avec la nouvelle saisie
|
||||
pElement.innerHTML = '<strong>' + newValue + ' <img class="imgModify" src="../images/modify.svg" onclick="editFieldEmail(\'' + id + '\')"/></strong>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Email valide
|
||||
function validateEmail(email) {
|
||||
var re = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;// Regex pour vérifier le format de l'email
|
||||
return re.test(String(email).toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function editFieldPassWd(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
pElement.innerHTML = '';// Effacer le contenu actuel de <p> pour insérer les inputs
|
||||
|
||||
// Créer le champ de saisie pour le nouveau mot de passe
|
||||
var inputNewPass = document.createElement('input');
|
||||
inputNewPass.type = 'password';
|
||||
inputNewPass.placeholder = 'Nouveau mot de passe'; // Un placeholder pour indiquer la fonction du champ
|
||||
inputNewPass.classList.add('changeValue'); // Ajouter une classe CSS pour styliser l'input
|
||||
inputNewPass.setAttribute('id', 'newPassword'); // Ajouter un ID pour la gestion
|
||||
inputNewPass.classList.add('inputPasswd'); // Ajouter une classe au input
|
||||
|
||||
|
||||
// Créer le champ de saisie pour la confirmation du mot de passe
|
||||
var inputConfirmPass = document.createElement('input');
|
||||
inputConfirmPass.type = 'password';
|
||||
inputConfirmPass.placeholder = 'Confirmer le mot de passe'; // Un placeholder pour indiquer la fonction du champ
|
||||
inputConfirmPass.classList.add('changeValue'); // Ajouter une classe CSS pour styliser l'input
|
||||
inputConfirmPass.setAttribute('id', 'confirmPassword'); // Ajouter un ID pour la gestion
|
||||
inputConfirmPass.classList.add('inputPasswd'); // Ajouter une classe au input
|
||||
|
||||
// Ajouter un bouton de sauvegarde
|
||||
var saveButton = document.createElement('button');
|
||||
saveButton.textContent = 'Sauvegarder le mot de passe';
|
||||
saveButton.classList.add('saveButtonPasswd'); // Ajouter une classe au bouton
|
||||
|
||||
saveButton.onclick = function() {
|
||||
savePasswordFields(id, inputNewPass.value, inputConfirmPass.value);
|
||||
|
||||
};
|
||||
|
||||
// Ajouter les deux champs de saisie et le bouton dans l'élément <p>
|
||||
pElement.appendChild(inputNewPass);
|
||||
pElement.appendChild(document.createElement('br')); // Saut de ligne pour espacer les champs
|
||||
pElement.appendChild(inputConfirmPass);
|
||||
pElement.appendChild(document.createElement('br')); // Saut de ligne pour espacer
|
||||
pElement.appendChild(saveButton);
|
||||
|
||||
inputNewPass.focus();// Mettre le focus sur le premier champ de saisie
|
||||
}
|
||||
|
||||
|
||||
|
||||
function savePasswordFields(id, newPassword, confirmPassword) {
|
||||
// Vérification si les champs sont vides
|
||||
if (newPassword.trim() === "" || confirmPassword.trim() === ""){
|
||||
alert("Les champs de mot de passe ne doivent pas être vides.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Vérification de la correspondance des deux mots de passe
|
||||
if (newPassword === confirmPassword) {
|
||||
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
if(newPassword.length >= 16){
|
||||
var maskedPassword = '*'.repeat(16); // Masquer le nouveau mot de passe pour l'affichage
|
||||
}
|
||||
else{
|
||||
var maskedPassword = "*".repeat(newPassword.length); // Masquer le nouveau mot de passe pour l'affichage
|
||||
}
|
||||
|
||||
// Remplacer les champs input par le texte masqué
|
||||
pElement.innerHTML = '<strong>' + maskedPassword + '</strong> <img class="imgModify" src="../images/modify.svg" onclick="editFieldPassWd(\'' + id + '\')"/></strong>';
|
||||
alert('Mot de passe mis à jour avec succès');
|
||||
|
||||
// Possibilité d'ajouter ici une fonction pour envoyer les nouveaux mots de passe au serveur
|
||||
|
||||
} else {
|
||||
alert('Les mots de passe ne correspondent pas.');
|
||||
}
|
||||
}
|
||||
|
||||
function editFieldUsername(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
var currentValue = pElement.textContent.trim();// Obtenir le texte actuel du <p>
|
||||
|
||||
// Créer un champ de saisie <input> avec la valeur actuelle
|
||||
var input = document.createElement('input');
|
||||
input.type = 'text';
|
||||
input.value = currentValue
|
||||
input.class = 'changeValue';
|
||||
|
||||
input.setAttribute('onblur', 'saveFieldUsername("' + id + '", this.value)'); // Sauvegarde lors de la perte de focus
|
||||
|
||||
// Remplacer le <p> par le champ <input>
|
||||
pElement.innerHTML = '';
|
||||
pElement.appendChild(input);
|
||||
|
||||
input.focus(); // Mettre le focus sur le champ de saisie
|
||||
}
|
||||
|
||||
//Sauvegarder les changements sur la vue pour le username
|
||||
function saveFieldUsername(id, newValue) {
|
||||
if (id === 'username') {
|
||||
if (newValue.trim() === "") {
|
||||
alert('Le nom d\'utilisateur ne peut pas être vide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si le nom d'utilisateur est vide
|
||||
}
|
||||
}
|
||||
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
// Mettre à jour la valeur avec la nouvelle saisie
|
||||
pElement.innerHTML = '<strong>' + newValue + ' <img class="imgModify" src="../images/modify.svg" onclick="editFieldUsername(\'' + id + '\')"/></strong>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function editFieldEmail(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
var currentValue = pElement.textContent.trim();// Obtenir le texte actuel du <p>
|
||||
|
||||
// Créer un champ de saisie <input> avec la valeur actuelle
|
||||
var input = document.createElement('input');
|
||||
input.type = 'email';
|
||||
input.value = currentValue
|
||||
input.class = 'changeValue';
|
||||
|
||||
input.setAttribute('onblur', 'saveFieldEmail("' + id + '", this.value)'); // Sauvegarde lors de la perte de focus
|
||||
|
||||
// Remplacer le <p> par le champ <input>
|
||||
pElement.innerHTML = '';
|
||||
pElement.appendChild(input);
|
||||
|
||||
input.focus(); // Mettre le focus sur le champ de saisie
|
||||
}
|
||||
|
||||
//Sauvegarder les changements sur la vue pour l'email
|
||||
function saveFieldEmail(id, newValue) {
|
||||
if (id === 'email') {
|
||||
if (!validateEmail(newValue)) {
|
||||
alert('Adresse email invalide. Veuillez entrer un email valide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si l'email n'est pas valide
|
||||
}
|
||||
}
|
||||
if (id === 'username') {
|
||||
if (newValue.trim() === "") {
|
||||
alert('Le nom d\'utilisateur ne peut pas être vide.');
|
||||
document.getElementById(id).querySelector('input').focus();
|
||||
return; // Ne pas sauvegarder si le nom d'utilisateur est vide
|
||||
}
|
||||
}
|
||||
|
||||
var pElement = document.getElementById(id); // Récupérer l'élément <p> via son identifiant
|
||||
|
||||
// Mettre à jour la valeur avec la nouvelle saisie
|
||||
pElement.innerHTML = '<strong>' + newValue + ' <img class="imgModify" src="../images/modify.svg" onclick="editFieldEmail(\'' + id + '\')"/></strong>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Email valide
|
||||
function validateEmail(email) {
|
||||
var re = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;// Regex pour vérifier le format de l'email
|
||||
return re.test(String(email).toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function editFieldPassWd(id) {
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
pElement.innerHTML = '';// Effacer le contenu actuel de <p> pour insérer les inputs
|
||||
|
||||
// Créer le champ de saisie pour le nouveau mot de passe
|
||||
var inputNewPass = document.createElement('input');
|
||||
inputNewPass.type = 'password';
|
||||
inputNewPass.placeholder = 'Nouveau mot de passe'; // Un placeholder pour indiquer la fonction du champ
|
||||
inputNewPass.classList.add('changeValue'); // Ajouter une classe CSS pour styliser l'input
|
||||
inputNewPass.setAttribute('id', 'newPassword'); // Ajouter un ID pour la gestion
|
||||
inputNewPass.classList.add('inputPasswd'); // Ajouter une classe au input
|
||||
|
||||
|
||||
// Créer le champ de saisie pour la confirmation du mot de passe
|
||||
var inputConfirmPass = document.createElement('input');
|
||||
inputConfirmPass.type = 'password';
|
||||
inputConfirmPass.placeholder = 'Confirmer le mot de passe'; // Un placeholder pour indiquer la fonction du champ
|
||||
inputConfirmPass.classList.add('changeValue'); // Ajouter une classe CSS pour styliser l'input
|
||||
inputConfirmPass.setAttribute('id', 'confirmPassword'); // Ajouter un ID pour la gestion
|
||||
inputConfirmPass.classList.add('inputPasswd'); // Ajouter une classe au input
|
||||
|
||||
// Ajouter un bouton de sauvegarde
|
||||
var saveButton = document.createElement('button');
|
||||
saveButton.textContent = 'Sauvegarder le mot de passe';
|
||||
saveButton.classList.add('saveButtonPasswd'); // Ajouter une classe au bouton
|
||||
|
||||
saveButton.onclick = function() {
|
||||
savePasswordFields(id, inputNewPass.value, inputConfirmPass.value);
|
||||
|
||||
};
|
||||
|
||||
// Ajouter les deux champs de saisie et le bouton dans l'élément <p>
|
||||
pElement.appendChild(inputNewPass);
|
||||
pElement.appendChild(document.createElement('br')); // Saut de ligne pour espacer les champs
|
||||
pElement.appendChild(inputConfirmPass);
|
||||
pElement.appendChild(document.createElement('br')); // Saut de ligne pour espacer
|
||||
pElement.appendChild(saveButton);
|
||||
|
||||
inputNewPass.focus();// Mettre le focus sur le premier champ de saisie
|
||||
}
|
||||
|
||||
|
||||
|
||||
function savePasswordFields(id, newPassword, confirmPassword) {
|
||||
// Vérification si les champs sont vides
|
||||
if (newPassword.trim() === "" || confirmPassword.trim() === ""){
|
||||
alert("Les champs de mot de passe ne doivent pas être vides.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Vérification de la correspondance des deux mots de passe
|
||||
if (newPassword === confirmPassword) {
|
||||
|
||||
var pElement = document.getElementById(id);// Récupérer l'élément <p> via son identifiant
|
||||
|
||||
if(newPassword.length >= 16){
|
||||
var maskedPassword = '*'.repeat(16); // Masquer le nouveau mot de passe pour l'affichage
|
||||
}
|
||||
else{
|
||||
var maskedPassword = "*".repeat(newPassword.length); // Masquer le nouveau mot de passe pour l'affichage
|
||||
}
|
||||
|
||||
// Remplacer les champs input par le texte masqué
|
||||
pElement.innerHTML = '<strong>' + maskedPassword + '</strong> <img class="imgModify" src="../images/modify.svg" onclick="editFieldPassWd(\'' + id + '\')"/></strong>';
|
||||
alert('Mot de passe mis à jour avec succès');
|
||||
|
||||
// Possibilité d'ajouter ici une fonction pour envoyer les nouveaux mots de passe au serveur
|
||||
|
||||
} else {
|
||||
alert('Les mots de passe ne correspondent pas.');
|
||||
}
|
||||
}
|
||||
|
@ -1,51 +1,51 @@
|
||||
// Quand le document est prêt
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const themeIcon = document.getElementById('theme-icon');
|
||||
const favicon = document.getElementById('favicon'); // Sélectionne la favicon
|
||||
|
||||
// Vérifie si les éléments existent bien avant d'y accéder
|
||||
if (themeIcon && favicon) {
|
||||
const currentTheme = localStorage.getItem('theme') || 'dark'; // Par défaut, sombre
|
||||
|
||||
// Applique le bon thème au chargement de la page
|
||||
if (currentTheme === 'light') {
|
||||
document.body.classList.remove('dark-mode');
|
||||
document.body.classList.add('light-mode');
|
||||
themeIcon.src = 'images/light.svg'; // Affiche l'icône pour basculer vers le mode sombre
|
||||
favicon.href = 'images/iconeClaire.ico'; // Favicon pour le mode clair
|
||||
} else {
|
||||
document.body.classList.add('dark-mode');
|
||||
themeIcon.src = 'images/dark.svg'; // Affiche l'icône pour basculer vers le mode clair
|
||||
favicon.href = 'images/iconeSombre.ico'; // Favicon pour le mode sombre
|
||||
}
|
||||
} else {
|
||||
console.error("Élément(s) manquant(s) : icône du thème ou favicon.");
|
||||
}
|
||||
});
|
||||
|
||||
// Fonction pour basculer entre les thèmes
|
||||
function toggleTheme() {
|
||||
const body = document.body;
|
||||
const themeIcon = document.getElementById('theme-icon');
|
||||
const favicon = document.getElementById('favicon'); // Sélectionne la favicon
|
||||
|
||||
if (themeIcon && favicon) {
|
||||
if (body.classList.contains('dark-mode')) {
|
||||
// Si on est en mode sombre, on passe en mode clair
|
||||
body.classList.remove('dark-mode');
|
||||
body.classList.add('light-mode');
|
||||
themeIcon.src = 'images/light.svg'; // Change vers le logo sombre
|
||||
favicon.href = 'images/iconeClaire.ico'; // Favicon pour le mode clair
|
||||
localStorage.setItem('theme', 'light'); // Enregistre le thème clair dans localStorage
|
||||
} else {
|
||||
// Sinon, on repasse en mode sombre
|
||||
body.classList.remove('light-mode');
|
||||
body.classList.add('dark-mode');
|
||||
themeIcon.src = 'images/dark.svg'; // Change vers le logo clair
|
||||
favicon.href = 'images/iconeSombre.ico'; // Favicon pour le mode sombre
|
||||
localStorage.setItem('theme', 'dark'); // Enregistre le thème sombre dans localStorage
|
||||
}
|
||||
} else {
|
||||
console.error("Impossible de trouver l'icône ou le favicon.");
|
||||
}
|
||||
}
|
||||
// Quand le document est prêt
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const themeIcon = document.getElementById('theme-icon');
|
||||
const favicon = document.getElementById('favicon'); // Sélectionne la favicon
|
||||
|
||||
// Vérifie si les éléments existent bien avant d'y accéder
|
||||
if (themeIcon && favicon) {
|
||||
const currentTheme = localStorage.getItem('theme') || 'dark'; // Par défaut, sombre
|
||||
|
||||
// Applique le bon thème au chargement de la page
|
||||
if (currentTheme === 'light') {
|
||||
document.body.classList.remove('dark-mode');
|
||||
document.body.classList.add('light-mode');
|
||||
themeIcon.src = 'images/light.svg'; // Affiche l'icône pour basculer vers le mode sombre
|
||||
favicon.href = 'images/iconeClaire.ico'; // Favicon pour le mode clair
|
||||
} else {
|
||||
document.body.classList.add('dark-mode');
|
||||
themeIcon.src = 'images/dark.svg'; // Affiche l'icône pour basculer vers le mode clair
|
||||
favicon.href = 'images/iconeSombre.ico'; // Favicon pour le mode sombre
|
||||
}
|
||||
} else {
|
||||
console.error("Élément(s) manquant(s) : icône du thème ou favicon.");
|
||||
}
|
||||
});
|
||||
|
||||
// Fonction pour basculer entre les thèmes
|
||||
function toggleTheme() {
|
||||
const body = document.body;
|
||||
const themeIcon = document.getElementById('theme-icon');
|
||||
const favicon = document.getElementById('favicon'); // Sélectionne la favicon
|
||||
|
||||
if (themeIcon && favicon) {
|
||||
if (body.classList.contains('dark-mode')) {
|
||||
// Si on est en mode sombre, on passe en mode clair
|
||||
body.classList.remove('dark-mode');
|
||||
body.classList.add('light-mode');
|
||||
themeIcon.src = 'images/light.svg'; // Change vers le logo sombre
|
||||
favicon.href = 'images/iconeClaire.ico'; // Favicon pour le mode clair
|
||||
localStorage.setItem('theme', 'light'); // Enregistre le thème clair dans localStorage
|
||||
} else {
|
||||
// Sinon, on repasse en mode sombre
|
||||
body.classList.remove('light-mode');
|
||||
body.classList.add('dark-mode');
|
||||
themeIcon.src = 'images/dark.svg'; // Change vers le logo clair
|
||||
favicon.href = 'images/iconeSombre.ico'; // Favicon pour le mode sombre
|
||||
localStorage.setItem('theme', 'dark'); // Enregistre le thème sombre dans localStorage
|
||||
}
|
||||
} else {
|
||||
console.error("Impossible de trouver l'icône ou le favicon.");
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const quoteElements = document.querySelectorAll('.citation-container .quote');
|
||||
|
||||
quoteElements.forEach(quote => {
|
||||
let maxLength = 135; // Nombre max de caractères avant la coupure
|
||||
if (quote.textContent.length > maxLength) {
|
||||
let displayedText = quote.textContent.slice(0, maxLength) + '...\"';
|
||||
quote.textContent = displayedText;
|
||||
}
|
||||
});
|
||||
});
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const quoteElements = document.querySelectorAll('.citation-container .quote');
|
||||
|
||||
quoteElements.forEach(quote => {
|
||||
let maxLength = 135; // Nombre max de caractères avant la coupure
|
||||
if (quote.textContent.length > maxLength) {
|
||||
let displayedText = quote.textContent.slice(0, maxLength) + '...\"';
|
||||
quote.textContent = displayedText;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,145 +1,166 @@
|
||||
/* header.css */
|
||||
|
||||
/* Styles généraux */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #120b1d;
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 200px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.header {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
background-color: #000000;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
gap: 30px;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.user {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
gap: 30px;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
/* Mode sombre */
|
||||
body.dark-mode {
|
||||
background-color: #120B1D;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
body.dark-mode .header {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
body.dark-mode .header img {
|
||||
filter: invert(0%);
|
||||
}
|
||||
|
||||
body.dark-mode .nav img:hover {
|
||||
filter: invert(59%) sepia(96%) saturate(6733%) hue-rotate(275deg) brightness(112%) contrast(122%);
|
||||
}
|
||||
|
||||
/* Mode clair */
|
||||
body.light-mode {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
body.light-mode .header {
|
||||
background-color: #F7F7EB;
|
||||
}
|
||||
|
||||
body.light-mode .header img {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
body.light-mode .nav img:hover {
|
||||
filter: invert(22%) sepia(6%) saturate(2269%) hue-rotate(193deg) brightness(98%) contrast(106%);
|
||||
}
|
||||
|
||||
/* Media queries for responsiveness */
|
||||
|
||||
/* For tablets and small devices */
|
||||
@media (max-width: 768px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav, .logo, .user {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* For mobile phones */
|
||||
@media (max-width: 480px) {
|
||||
body {
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
.nav img, .logo img {
|
||||
width: 50px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
form input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Banner images should be responsive */
|
||||
.header img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Media queries for different screen sizes */
|
||||
@media (max-width: 768px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
}
|
||||
.header img {
|
||||
width: 80px;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
/* header.css */
|
||||
|
||||
/* Styles généraux */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #120b1d;
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 200px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.header {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
background-color: #000000;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
gap: 30px;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.user {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
gap: 30px;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.search {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
vertical-align: center;
|
||||
margin: 10px;
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
||||
/* Mode sombre */
|
||||
body.dark-mode {
|
||||
background-color: #120B1D;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
body.dark-mode .header {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
body.dark-mode .header img {
|
||||
filter: invert(0%);
|
||||
}
|
||||
|
||||
body.dark-mode .nav img:hover {
|
||||
filter: invert(59%) sepia(96%) saturate(6733%) hue-rotate(275deg) brightness(112%) contrast(122%);
|
||||
}
|
||||
|
||||
body.dark-mode .search {
|
||||
background: linear-gradient(to right, #4a148c, #7b1fa2);
|
||||
}
|
||||
|
||||
/* Mode clair */
|
||||
body.light-mode {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
body.light-mode .header {
|
||||
background-color: #F7F7EB;
|
||||
}
|
||||
|
||||
body.light-mode .header img {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
body.light-mode .nav img:hover {
|
||||
filter: invert(22%) sepia(6%) saturate(2269%) hue-rotate(193deg) brightness(98%) contrast(106%);
|
||||
}
|
||||
|
||||
body.light-mode .search {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
}
|
||||
|
||||
/* Media queries for responsiveness */
|
||||
|
||||
/* For tablets and small devices */
|
||||
@media (max-width: 768px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav, .logo, .user {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* For mobile phones */
|
||||
@media (max-width: 480px) {
|
||||
body {
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
.nav img, .logo img {
|
||||
width: 50px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
form input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Banner images should be responsive */
|
||||
.header img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Media queries for different screen sizes */
|
||||
@media (max-width: 768px) {
|
||||
.header {
|
||||
flex-direction: column;
|
||||
}
|
||||
.header img {
|
||||
width: 80px;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
@ -1,226 +1,226 @@
|
||||
@import url(./style.css);
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1{
|
||||
color : white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 35px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
body.dark-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : white;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .buttonSudmite{
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 5%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
body.dark-mode .createQuote{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: white;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.dark-mode .login{
|
||||
background-color: black;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 9%;
|
||||
border-radius: 25px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1%;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .imgModify{
|
||||
width: 3%;
|
||||
margin-left: 5%;
|
||||
margin-top: 5%;
|
||||
filter: invert(100%) brightness(1000%) contrast(1000%);
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .infoProfil > input {
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: none;
|
||||
font-size: 15px;
|
||||
font-family: "Lemon", serif;
|
||||
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .inputPasswd{
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 40%;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.dark-mode .saveButtonPasswd {
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 1%;
|
||||
border-radius: 25px;
|
||||
width: 55%;
|
||||
font-size: 15px;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1{
|
||||
color : black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 35px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
body.light-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : black;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .buttonSudmite{
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 5%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
body.light-mode .createQuote{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.light-mode .login{
|
||||
background-color: white;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 9%;
|
||||
border-radius: 25px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1%;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .imgModify{
|
||||
width: 3%;
|
||||
margin-left: 5%;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .infoProfil > input {
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: 1px solid black;
|
||||
background-color: #fff1f1;
|
||||
font-size: 15px;
|
||||
font-family: "Lemon", serif;
|
||||
color : black;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .inputPasswd{
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 40%;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.light-mode .saveButtonPasswd {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 1%;
|
||||
border-radius: 25px;
|
||||
width: 55%;
|
||||
font-size: 15px;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.buttonSudmiteDiv{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.changeValue{
|
||||
color: red;
|
||||
}
|
||||
|
||||
|
||||
.imageProfil{
|
||||
width: 25%;
|
||||
border-radius: 25px;
|
||||
display:block;
|
||||
margin-left: 38%;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
.infoProfil{
|
||||
margin-left: 10%;
|
||||
text-align: center;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
|
||||
.languageDiv{
|
||||
margin-left: 25%;
|
||||
}
|
||||
.languageTitle{
|
||||
text-align: left;
|
||||
font-size: 100%;
|
||||
}
|
||||
.languageImage{
|
||||
width: 300px;
|
||||
height: 40px;
|
||||
margin-left: 25%;
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
||||
@import url(./style.css);
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1{
|
||||
color : white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 35px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
|
||||
body.dark-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : white;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .buttonSudmite{
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 5%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
body.dark-mode .createQuote{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: white;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.dark-mode .login{
|
||||
background-color: black;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 9%;
|
||||
border-radius: 25px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1%;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .imgModify{
|
||||
width: 3%;
|
||||
margin-left: 5%;
|
||||
margin-top: 5%;
|
||||
filter: invert(100%) brightness(1000%) contrast(1000%);
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .infoProfil > input {
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: none;
|
||||
font-size: 15px;
|
||||
font-family: "Lemon", serif;
|
||||
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .inputPasswd{
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 40%;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.dark-mode .saveButtonPasswd {
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 1%;
|
||||
border-radius: 25px;
|
||||
width: 55%;
|
||||
font-size: 15px;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1{
|
||||
color : black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
font-size: 35px;
|
||||
margin-top: 10%;
|
||||
}
|
||||
body.light-mode p{
|
||||
margin-top: 6%;
|
||||
margin-bottom: 2%;
|
||||
color : black;
|
||||
font-size: 20px;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .buttonSudmite{
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 5%;
|
||||
border-radius: 25px;
|
||||
width: 75%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
body.light-mode .createQuote{
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
padding-top: 1%;
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
}
|
||||
|
||||
body.light-mode .login{
|
||||
background-color: white;
|
||||
width: 30%;
|
||||
margin-left: 35%;
|
||||
margin-top: 9%;
|
||||
border-radius: 25px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1%;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .imgModify{
|
||||
width: 3%;
|
||||
margin-left: 5%;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .infoProfil > input {
|
||||
width:90%;
|
||||
height: 40px;
|
||||
padding-left: 3%;
|
||||
margin-left: 1%;
|
||||
margin-top: -1%;
|
||||
border-radius: 25px;
|
||||
border: 1px solid black;
|
||||
background-color: #fff1f1;
|
||||
font-size: 15px;
|
||||
font-family: "Lemon", serif;
|
||||
color : black;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .inputPasswd{
|
||||
font-family: "Lemon", serif;
|
||||
margin-top: 40%;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.light-mode .saveButtonPasswd {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 1%;
|
||||
border-radius: 25px;
|
||||
width: 55%;
|
||||
font-size: 15px;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.buttonSudmiteDiv{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.changeValue{
|
||||
color: red;
|
||||
}
|
||||
|
||||
|
||||
.imageProfil{
|
||||
width: 25%;
|
||||
border-radius: 25px;
|
||||
display:block;
|
||||
margin-left: 38%;
|
||||
margin-top: 5%;
|
||||
}
|
||||
|
||||
.infoProfil{
|
||||
margin-left: 10%;
|
||||
text-align: center;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
|
||||
.languageDiv{
|
||||
margin-left: 25%;
|
||||
}
|
||||
.languageTitle{
|
||||
text-align: left;
|
||||
font-size: 100%;
|
||||
}
|
||||
.languageImage{
|
||||
width: 300px;
|
||||
height: 40px;
|
||||
margin-left: 25%;
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,154 +1,154 @@
|
||||
@import url(./style.css);
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Lemon&display=swap');
|
||||
|
||||
body, html {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1, body.dark-mode h2, body.dark-mode p {
|
||||
color: white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.dark-mode .quiz {
|
||||
background-color: black;
|
||||
height: 60%;
|
||||
width: 80%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
|
||||
row-gap: 80px;
|
||||
}
|
||||
|
||||
body.dark-mode .answer {
|
||||
background-color: #1b0048;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
width: 35%;
|
||||
padding: 35px;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.dark-mode .answer:hover {
|
||||
background-color: #6100ff;
|
||||
}
|
||||
|
||||
body.dark-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 80px;
|
||||
|
||||
}
|
||||
|
||||
body.dark-mode .buttonSudmite {
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1, body.light-mode h2, body.light-mode p {
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.light-mode .quiz {
|
||||
background-color: white;
|
||||
width: 50%;
|
||||
height: 90%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
gap: 1000px;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
body.light-mode .answer {
|
||||
background-color: #fff1f1;
|
||||
color: black;
|
||||
border: 1px solid black;
|
||||
border-radius: 25px;
|
||||
width: 45%;
|
||||
padding: 10px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.light-mode .answer:hover {
|
||||
background-color: #c7f6c4;
|
||||
}
|
||||
|
||||
body.light-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
body.light-mode .buttonSudmite {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav img {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.user img {
|
||||
margin-left: 10px;
|
||||
@import url(./style.css);
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Lemon&display=swap');
|
||||
|
||||
body, html {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode h1, body.dark-mode h2, body.dark-mode p {
|
||||
color: white;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.dark-mode .quiz {
|
||||
background-color: black;
|
||||
height: 60%;
|
||||
width: 80%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
body.dark-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
|
||||
row-gap: 80px;
|
||||
}
|
||||
|
||||
body.dark-mode .answer {
|
||||
background-color: #1b0048;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
width: 35%;
|
||||
padding: 35px;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.dark-mode .answer:hover {
|
||||
background-color: #6100ff;
|
||||
}
|
||||
|
||||
body.dark-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 80px;
|
||||
|
||||
}
|
||||
|
||||
body.dark-mode .buttonSudmite {
|
||||
background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 30px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
body.light-mode h1, body.light-mode h2, body.light-mode p {
|
||||
color: black;
|
||||
font-family: "Lemon", serif;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body.light-mode .quiz {
|
||||
background-color: white;
|
||||
width: 50%;
|
||||
height: 90%;
|
||||
margin: 3% auto;
|
||||
padding: 2%;
|
||||
border-radius: 25px;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .answers {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
gap: 1000px;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
body.light-mode .answer {
|
||||
background-color: #fff1f1;
|
||||
color: black;
|
||||
border: 1px solid black;
|
||||
border-radius: 25px;
|
||||
width: 45%;
|
||||
padding: 10px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.light-mode .answer:hover {
|
||||
background-color: #c7f6c4;
|
||||
}
|
||||
|
||||
body.light-mode .submit-button {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
body.light-mode .buttonSudmite {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
font-family: "Lemon", serif;
|
||||
border: none;
|
||||
color: black;
|
||||
padding: 10px 20px;
|
||||
border-radius: 25px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== OTHER ====== */
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav img {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.user img {
|
||||
margin-left: 10px;
|
||||
}
|
@ -1,110 +1,110 @@
|
||||
@import url(./style.css);
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode .card {
|
||||
position: relative;
|
||||
background-color: black;
|
||||
border-radius: 15px;
|
||||
width: 60%;
|
||||
display: flex;
|
||||
margin-left: 5%;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .card-content {
|
||||
color: white;
|
||||
margin-left: 20px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .likes {
|
||||
margin-left: 85%;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
body.dark-mode .like-icon {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.dark-mode .share-icon {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
|
||||
body.light-mode .card {
|
||||
position: relative;
|
||||
background-color: white;
|
||||
border-radius: 15px;
|
||||
width: 60%;
|
||||
display: flex;
|
||||
margin-left: 5%;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .card-content {
|
||||
color: black;
|
||||
margin-left: 20px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .likes {
|
||||
margin-left: 85%;
|
||||
font-size: 20px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.light-mode .like-icon {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.light-mode .share-icon {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== DEFAULT ====== */
|
||||
.infoQuote {
|
||||
list-style: none;
|
||||
font-size: 25px;
|
||||
line-height: 40px;
|
||||
margin-top: 35%;
|
||||
margin-left: -45%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.card-image {
|
||||
border-radius: 10px;
|
||||
width: 310px;
|
||||
height: 270px;
|
||||
}
|
||||
|
||||
.quote {
|
||||
margin-top: 10px;
|
||||
font-size: 35px;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
margin-bottom: 15px;
|
||||
@import url(./style.css);
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
body.dark-mode .card {
|
||||
position: relative;
|
||||
background-color: black;
|
||||
border-radius: 15px;
|
||||
width: 60%;
|
||||
display: flex;
|
||||
margin-left: 5%;
|
||||
border: 2px solid transparent;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .card-content {
|
||||
color: white;
|
||||
margin-left: 20px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
body.dark-mode .likes {
|
||||
margin-left: 85%;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
body.dark-mode .like-icon {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.dark-mode .share-icon {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
|
||||
body.light-mode .card {
|
||||
position: relative;
|
||||
background-color: white;
|
||||
border-radius: 15px;
|
||||
width: 60%;
|
||||
display: flex;
|
||||
margin-left: 5%;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
body.light-mode .card-content {
|
||||
color: black;
|
||||
margin-left: 20px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
body.light-mode .likes {
|
||||
margin-left: 85%;
|
||||
font-size: 20px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body.light-mode .like-icon {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body.light-mode .share-icon {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
right: 10px;
|
||||
font-size: 35px;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* ====== DEFAULT ====== */
|
||||
.infoQuote {
|
||||
list-style: none;
|
||||
font-size: 25px;
|
||||
line-height: 40px;
|
||||
margin-top: 35%;
|
||||
margin-left: -45%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.card-image {
|
||||
border-radius: 10px;
|
||||
width: 310px;
|
||||
height: 270px;
|
||||
}
|
||||
|
||||
.quote {
|
||||
margin-top: 10px;
|
||||
font-size: 35px;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
margin-bottom: 15px;
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
/* Conteneur pour les suggestions en deux colonnes */
|
||||
.quotes-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* Citations */
|
||||
.citation-container {
|
||||
background: linear-gradient(to right, #4a148c, #7b1fa2);
|
||||
border-radius: 12px;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
width: 49%; /* Chaque citation occupe 45% de la largeur pour laisser 5% d'espace */
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
height: 150px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 20px;
|
||||
word-wrap: break-word; /* Permet de couper les mots trop longs */
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* Fixe la taille pour s'assurer que toutes les citations restent cohérentes */
|
||||
.citation-container .text-content {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
height: 150px;
|
||||
}
|
||||
.quote {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.citation-image {
|
||||
width: 150px;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.text-content {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center; /* Centre verticalement le texte */
|
||||
word-wrap: break-word; /* Permet de couper les mots trop longs */
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.quoteContent {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.movie, .character, .year {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* Mode sombre */
|
||||
body.dark-mode .quote {
|
||||
background: linear-gradient(to right, #4a148c, #7b1fa2);
|
||||
color:white;
|
||||
}
|
||||
|
||||
/* Mode clair */
|
||||
body.light-mode .quote {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
color:black; /* Changer le texte en noir pour le mode clair */
|
||||
}
|
||||
|
||||
body.light-mode .quote,
|
||||
body.light-mode .movie,
|
||||
body.light-mode .character,
|
||||
body.light-mode .year {
|
||||
color: black; /* Forcer le texte en noir pour le mode clair */
|
||||
}
|
||||
|
||||
/* Responsive design */
|
||||
@media (max-width: 768px) {
|
||||
.suggestions-container {
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.citation-container {
|
||||
width: 100%; /* Chaque citation prend toute la largeur sur mobile */
|
||||
max-width: 100%;
|
||||
height: 100px; /* Supprimer la hauteur fixe sur mobile */
|
||||
}
|
||||
|
||||
.citation-image {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.quote {
|
||||
font-size: 1em;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
@import url(./style.css);
|
||||
@import url(./styleQuoteLittle.css);
|
||||
|
||||
/* ====== DEFAULT ====== */
|
||||
|
||||
|
||||
.search-container {
|
||||
margin-left: 5%;
|
||||
width: 90%;
|
||||
|
||||
height: 60px;
|
||||
border-radius: 40px;
|
||||
}
|
||||
|
||||
.search-container .searchButton {
|
||||
float: right;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.searchButton img{
|
||||
width: 70%;
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
.search-container input[type="search"] {
|
||||
margin: 10px ;
|
||||
border:none;
|
||||
background: none;
|
||||
float:left;
|
||||
padding: 0;
|
||||
color: #00f;
|
||||
font-size: 16px;
|
||||
line-height: 40px;
|
||||
width:auto;
|
||||
}
|
||||
|
||||
.filtre{
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
/* ====== DARK MODE ====== */
|
||||
/*body.dark-mode */
|
||||
body.dark-mode .search-container {
|
||||
background: #fff;
|
||||
}
|
||||
body.dark-mode .search-container input[type="search"] {
|
||||
color: #000;
|
||||
}
|
||||
body.dark-mode .search-container .searchButton {
|
||||
background: linear-gradient(to right, #4a148c, #7b1fa2);
|
||||
}
|
||||
|
||||
/* ====== LIGHT MODE ====== */
|
||||
/*body.light-mode*/
|
||||
body.light-mode .search-container {
|
||||
background: #ccc;
|
||||
}
|
||||
body.light-mode .search-container input[type="search"] {
|
||||
color: #000;
|
||||
}
|
||||
body.light-mode .search-container .searchButton {
|
||||
background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
|
||||
}
|
@ -1,53 +1,53 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class FavoriteEntity
|
||||
{
|
||||
private int $id_user;
|
||||
private int $id_quote;
|
||||
|
||||
/**
|
||||
* @param int $id_user
|
||||
* @param int $id_quote
|
||||
*/
|
||||
public function __construct(int $id_user, int $id_quote)
|
||||
{
|
||||
$this->id_user = $id_user;
|
||||
$this->id_quote = $id_quote;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdUser(): int
|
||||
{
|
||||
return $this->id_user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_user
|
||||
*/
|
||||
public function setIdUser(int $id_user): void
|
||||
{
|
||||
$this->id_user = $id_user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuote(): int
|
||||
{
|
||||
return $this->id_quote;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_quote
|
||||
*/
|
||||
public function setIdQuote(int $id_quote): void
|
||||
{
|
||||
$this->id_quote = $id_quote;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class FavoriteEntity
|
||||
{
|
||||
private int $id_user;
|
||||
private int $id_quote;
|
||||
|
||||
/**
|
||||
* @param int $id_user
|
||||
* @param int $id_quote
|
||||
*/
|
||||
public function __construct(int $id_user, int $id_quote)
|
||||
{
|
||||
$this->id_user = $id_user;
|
||||
$this->id_quote = $id_quote;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdUser(): int
|
||||
{
|
||||
return $this->id_user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_user
|
||||
*/
|
||||
public function setIdUser(int $id_user): void
|
||||
{
|
||||
$this->id_user = $id_user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuote(): int
|
||||
{
|
||||
return $this->id_quote;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_quote
|
||||
*/
|
||||
public function setIdQuote(int $id_quote): void
|
||||
{
|
||||
$this->id_quote = $id_quote;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,53 +1,53 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class ImageEntity
|
||||
{
|
||||
private int $idImg;
|
||||
private string $imgPath;
|
||||
private string $isImgProfile;
|
||||
|
||||
/**
|
||||
* @param int $idImg
|
||||
* @param string $imgPath
|
||||
* @param string $isImgProfile
|
||||
*/
|
||||
public function __construct(int $idImg, string $imgPath, string $isImgProfile)
|
||||
{
|
||||
$this->idImg = $idImg;
|
||||
$this->imgPath = $imgPath;
|
||||
$this->isImgProfile = $isImgProfile;
|
||||
}
|
||||
|
||||
public function getIdImg(): int
|
||||
{
|
||||
return $this->idImg;
|
||||
}
|
||||
|
||||
public function setIdImg(int $idImg): void
|
||||
{
|
||||
$this->idImg = $idImg;
|
||||
}
|
||||
|
||||
public function getImgPath(): string
|
||||
{
|
||||
return $this->imgPath;
|
||||
}
|
||||
|
||||
public function setImgPath(string $imgPath): void
|
||||
{
|
||||
$this->imgPath = $imgPath;
|
||||
}
|
||||
|
||||
public function getIsImgProfile(): string
|
||||
{
|
||||
return $this->isImgProfile;
|
||||
}
|
||||
|
||||
public function setIsImgProfile(string $isImgProfile): void
|
||||
{
|
||||
$this->isImgProfile = $isImgProfile;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class ImageEntity
|
||||
{
|
||||
private int $idImg;
|
||||
private string $imgPath;
|
||||
private string $isImgProfile;
|
||||
|
||||
/**
|
||||
* @param int $idImg
|
||||
* @param string $imgPath
|
||||
* @param string $isImgProfile
|
||||
*/
|
||||
public function __construct(int $idImg, string $imgPath, string $isImgProfile)
|
||||
{
|
||||
$this->idImg = $idImg;
|
||||
$this->imgPath = $imgPath;
|
||||
$this->isImgProfile = $isImgProfile;
|
||||
}
|
||||
|
||||
public function getIdImg(): int
|
||||
{
|
||||
return $this->idImg;
|
||||
}
|
||||
|
||||
public function setIdImg(int $idImg): void
|
||||
{
|
||||
$this->idImg = $idImg;
|
||||
}
|
||||
|
||||
public function getImgPath(): string
|
||||
{
|
||||
return $this->imgPath;
|
||||
}
|
||||
|
||||
public function setImgPath(string $imgPath): void
|
||||
{
|
||||
$this->imgPath = $imgPath;
|
||||
}
|
||||
|
||||
public function getIsImgProfile(): string
|
||||
{
|
||||
return $this->isImgProfile;
|
||||
}
|
||||
|
||||
public function setIsImgProfile(string $isImgProfile): void
|
||||
{
|
||||
$this->isImgProfile = $isImgProfile;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,54 +1,54 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
|
||||
class QuizQuestionEntity
|
||||
{
|
||||
private int $id_question;
|
||||
private int $id_quiz;
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
* @param int $id_quiz
|
||||
*/
|
||||
public function __construct(int $id_question, int $id_quiz)
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
$this->id_quiz = $id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuestion(): int
|
||||
{
|
||||
return $this->id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
*/
|
||||
public function setIdQuestion(int $id_question): void
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuiz(): int
|
||||
{
|
||||
return $this->id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_quiz
|
||||
*/
|
||||
public function setIdQuiz(int $id_quiz): void
|
||||
{
|
||||
$this->id_quiz = $id_quiz;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
|
||||
class QuizQuestionEntity
|
||||
{
|
||||
private int $id_question;
|
||||
private int $id_quiz;
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
* @param int $id_quiz
|
||||
*/
|
||||
public function __construct(int $id_question, int $id_quiz)
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
$this->id_quiz = $id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuestion(): int
|
||||
{
|
||||
return $this->id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
*/
|
||||
public function setIdQuestion(int $id_question): void
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuiz(): int
|
||||
{
|
||||
return $this->id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_quiz
|
||||
*/
|
||||
public function setIdQuiz(int $id_quiz): void
|
||||
{
|
||||
$this->id_quiz = $id_quiz;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,168 +1,168 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class Quote{
|
||||
|
||||
private int $id;
|
||||
private string $content;
|
||||
private string $carac;
|
||||
private string $imgPath;
|
||||
private string $titleSrc;
|
||||
private string $dateSrc;
|
||||
private int $like;
|
||||
private string $langue;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param string $content
|
||||
* @param string $carac
|
||||
* @param string $imgPath
|
||||
* @param string $titleSrc
|
||||
* @param string $dateSrc
|
||||
* @param int $like
|
||||
* @param string $langue
|
||||
*/
|
||||
public function __construct(int $id, string $content, string $carac, string $imgPath, string $titleSrc, string $dateSrc, int $like, string $langue)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->content = $content;
|
||||
$this->carac = $carac;
|
||||
$this->imgPath = $imgPath;
|
||||
$this->titleSrc = $titleSrc;
|
||||
$this->dateSrc = $dateSrc;
|
||||
$this->like = $like;
|
||||
$this->langue = $langue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*/
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
*/
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCarac(): string
|
||||
{
|
||||
return $this->carac;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $carac
|
||||
*/
|
||||
public function setCarac(string $carac): void
|
||||
{
|
||||
$this->carac = $carac;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImgPath(): string
|
||||
{
|
||||
return $this->imgPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $imgPath
|
||||
*/
|
||||
public function setImgPath(string $imgPath): void
|
||||
{
|
||||
$this->imgPath = $imgPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitleSrc(): string
|
||||
{
|
||||
return $this->titleSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $titleSrc
|
||||
*/
|
||||
public function setTitleSrc(string $titleSrc): void
|
||||
{
|
||||
$this->titleSrc = $titleSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDateSrc(): string
|
||||
{
|
||||
return $this->dateSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $dateSrc
|
||||
*/
|
||||
public function setDateSrc(string $dateSrc): void
|
||||
{
|
||||
$this->dateSrc = $dateSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLike(): int
|
||||
{
|
||||
return $this->like;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $like
|
||||
*/
|
||||
public function setLike(int $like): void
|
||||
{
|
||||
$this->like = $like;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLangue(): string
|
||||
{
|
||||
return $this->langue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $langue
|
||||
*/
|
||||
public function setLangue(string $langue): void
|
||||
{
|
||||
$this->langue = $langue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class Quote{
|
||||
|
||||
private int $id;
|
||||
private string $content;
|
||||
private string $carac;
|
||||
private string $imgPath;
|
||||
private string $titleSrc;
|
||||
private string $dateSrc;
|
||||
private int $like;
|
||||
private string $langue;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param string $content
|
||||
* @param string $carac
|
||||
* @param string $imgPath
|
||||
* @param string $titleSrc
|
||||
* @param string $dateSrc
|
||||
* @param int $like
|
||||
* @param string $langue
|
||||
*/
|
||||
public function __construct(int $id, string $content, string $carac, string $imgPath, string $titleSrc, string $dateSrc, int $like, string $langue)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->content = $content;
|
||||
$this->carac = $carac;
|
||||
$this->imgPath = $imgPath;
|
||||
$this->titleSrc = $titleSrc;
|
||||
$this->dateSrc = $dateSrc;
|
||||
$this->like = $like;
|
||||
$this->langue = $langue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*/
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
*/
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCarac(): string
|
||||
{
|
||||
return $this->carac;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $carac
|
||||
*/
|
||||
public function setCarac(string $carac): void
|
||||
{
|
||||
$this->carac = $carac;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImgPath(): string
|
||||
{
|
||||
return $this->imgPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $imgPath
|
||||
*/
|
||||
public function setImgPath(string $imgPath): void
|
||||
{
|
||||
$this->imgPath = $imgPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitleSrc(): string
|
||||
{
|
||||
return $this->titleSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $titleSrc
|
||||
*/
|
||||
public function setTitleSrc(string $titleSrc): void
|
||||
{
|
||||
$this->titleSrc = $titleSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDateSrc(): string
|
||||
{
|
||||
return $this->dateSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $dateSrc
|
||||
*/
|
||||
public function setDateSrc(string $dateSrc): void
|
||||
{
|
||||
$this->dateSrc = $dateSrc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLike(): int
|
||||
{
|
||||
return $this->like;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $like
|
||||
*/
|
||||
public function setLike(int $like): void
|
||||
{
|
||||
$this->like = $like;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLangue(): string
|
||||
{
|
||||
return $this->langue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $langue
|
||||
*/
|
||||
public function setLangue(string $langue): void
|
||||
{
|
||||
$this->langue = $langue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
@ -1,69 +1,69 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class ResultsEntity
|
||||
{
|
||||
private int $idQuiz;
|
||||
|
||||
public function getIdUser(): int
|
||||
{
|
||||
return $this->idUser;
|
||||
}
|
||||
|
||||
public function setIdUser(int $idUser): void
|
||||
{
|
||||
$this->idUser = $idUser;
|
||||
}
|
||||
|
||||
public function getIdQuiz(): int
|
||||
{
|
||||
return $this->idQuiz;
|
||||
}
|
||||
|
||||
public function setIdQuiz(int $idQuiz): void
|
||||
{
|
||||
$this->idQuiz = $idQuiz;
|
||||
}
|
||||
|
||||
public function getTime(): int
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
public function setTime(int $time): void
|
||||
{
|
||||
$this->time = $time;
|
||||
}
|
||||
|
||||
public function getNbPts(): int
|
||||
{
|
||||
return $this->nbPts;
|
||||
}
|
||||
|
||||
public function setNbPts(int $nbPts): void
|
||||
{
|
||||
$this->nbPts = $nbPts;
|
||||
}
|
||||
|
||||
private int $idUser;
|
||||
|
||||
private int $nbPts;
|
||||
|
||||
private int $time;
|
||||
|
||||
/**
|
||||
* @param int $idQuiz
|
||||
* @param int $idUser
|
||||
* @param int $time
|
||||
* @param int $nbPts
|
||||
*/
|
||||
public function __construct(int $idQuiz, int $idUser, int $time, int $nbPts)
|
||||
{
|
||||
$this -> idQuiz = $idQuiz;
|
||||
$this -> idUser = $idUser;
|
||||
$this -> time = $time;
|
||||
$this -> nbPts = $nbPts;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class ResultsEntity
|
||||
{
|
||||
private int $idQuiz;
|
||||
|
||||
public function getIdUser(): int
|
||||
{
|
||||
return $this->idUser;
|
||||
}
|
||||
|
||||
public function setIdUser(int $idUser): void
|
||||
{
|
||||
$this->idUser = $idUser;
|
||||
}
|
||||
|
||||
public function getIdQuiz(): int
|
||||
{
|
||||
return $this->idQuiz;
|
||||
}
|
||||
|
||||
public function setIdQuiz(int $idQuiz): void
|
||||
{
|
||||
$this->idQuiz = $idQuiz;
|
||||
}
|
||||
|
||||
public function getTime(): int
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
public function setTime(int $time): void
|
||||
{
|
||||
$this->time = $time;
|
||||
}
|
||||
|
||||
public function getNbPts(): int
|
||||
{
|
||||
return $this->nbPts;
|
||||
}
|
||||
|
||||
public function setNbPts(int $nbPts): void
|
||||
{
|
||||
$this->nbPts = $nbPts;
|
||||
}
|
||||
|
||||
private int $idUser;
|
||||
|
||||
private int $nbPts;
|
||||
|
||||
private int $time;
|
||||
|
||||
/**
|
||||
* @param int $idQuiz
|
||||
* @param int $idUser
|
||||
* @param int $time
|
||||
* @param int $nbPts
|
||||
*/
|
||||
public function __construct(int $idQuiz, int $idUser, int $time, int $nbPts)
|
||||
{
|
||||
$this -> idQuiz = $idQuiz;
|
||||
$this -> idUser = $idUser;
|
||||
$this -> time = $time;
|
||||
$this -> nbPts = $nbPts;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,77 +1,77 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class CharacterEntity
|
||||
{
|
||||
|
||||
private int $id_character;
|
||||
|
||||
private string $name;
|
||||
|
||||
private string $img_path;
|
||||
|
||||
/**
|
||||
* @param int $id_character
|
||||
* @param string $name
|
||||
* @param string $img_path
|
||||
*/
|
||||
public function __construct(int $id_character, string $name, string $img_path)
|
||||
{
|
||||
$this->id_character = $id_character;
|
||||
$this->name = $name;
|
||||
$this->img_path = $img_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdCharacter(): int
|
||||
{
|
||||
return $this->id_character;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_character
|
||||
*/
|
||||
public function setIdCharacter(int $id_character): void
|
||||
{
|
||||
$this->id_character = $id_character;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name): void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImgPath(): string
|
||||
{
|
||||
return $this->img_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $img_path
|
||||
*/
|
||||
public function setImgPath(string $img_path): void
|
||||
{
|
||||
$this->img_path = $img_path;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class CharacterEntity
|
||||
{
|
||||
|
||||
private int $id_character;
|
||||
|
||||
private string $name;
|
||||
|
||||
private string $img_path;
|
||||
|
||||
/**
|
||||
* @param int $id_character
|
||||
* @param string $name
|
||||
* @param string $img_path
|
||||
*/
|
||||
public function __construct(int $id_character, string $name, string $img_path)
|
||||
{
|
||||
$this->id_character = $id_character;
|
||||
$this->name = $name;
|
||||
$this->img_path = $img_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdCharacter(): int
|
||||
{
|
||||
return $this->id_character;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_character
|
||||
*/
|
||||
public function setIdCharacter(int $id_character): void
|
||||
{
|
||||
$this->id_character = $id_character;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name): void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImgPath(): string
|
||||
{
|
||||
return $this->img_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $img_path
|
||||
*/
|
||||
public function setImgPath(string $img_path): void
|
||||
{
|
||||
$this->img_path = $img_path;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,148 +1,148 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class QuestionEntity
|
||||
{
|
||||
private int $id_question;
|
||||
private string $question;
|
||||
private string $answerA;
|
||||
private string $answerB;
|
||||
private string $answerC;
|
||||
private string $answerD;
|
||||
private string $cAnswer;
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
* @param string $question
|
||||
* @param string $answerA
|
||||
* @param string $answerB
|
||||
* @param string $answerC
|
||||
* @param string $answerD
|
||||
* @param string $cAnswer
|
||||
*/
|
||||
public function __construct(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer)
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
$this->question = $question;
|
||||
$this->answerA = $answerA;
|
||||
$this->answerB = $answerB;
|
||||
$this->answerC = $answerC;
|
||||
$this->answerD = $answerD;
|
||||
$this->cAnswer = $cAnswer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuestion(): int
|
||||
{
|
||||
return $this->id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
*/
|
||||
public function setIdQuestion(int $id_question): void
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getQuestion(): string
|
||||
{
|
||||
return $this->question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $question
|
||||
*/
|
||||
public function setQuestion(string $question): void
|
||||
{
|
||||
$this->question = $question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerA(): string
|
||||
{
|
||||
return $this->answerA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerA
|
||||
*/
|
||||
public function setAnswerA(string $answerA): void
|
||||
{
|
||||
$this->answerA = $answerA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerB(): string
|
||||
{
|
||||
return $this->answerB;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerB
|
||||
*/
|
||||
public function setAnswerB(string $answerB): void
|
||||
{
|
||||
$this->answerB = $answerB;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerC(): string
|
||||
{
|
||||
return $this->answerC;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerC
|
||||
*/
|
||||
public function setAnswerC(string $answerC): void
|
||||
{
|
||||
$this->answerC = $answerC;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerD(): string
|
||||
{
|
||||
return $this->answerD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerD
|
||||
*/
|
||||
public function setAnswerD(string $answerD): void
|
||||
{
|
||||
$this->answerD = $answerD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCAnswer(): string
|
||||
{
|
||||
return $this->cAnswer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $cAnswer
|
||||
*/
|
||||
public function setCAnswer(string $cAnswer): void
|
||||
{
|
||||
$this->cAnswer = $cAnswer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class QuestionEntity
|
||||
{
|
||||
private int $id_question;
|
||||
private string $question;
|
||||
private string $answerA;
|
||||
private string $answerB;
|
||||
private string $answerC;
|
||||
private string $answerD;
|
||||
private string $cAnswer;
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
* @param string $question
|
||||
* @param string $answerA
|
||||
* @param string $answerB
|
||||
* @param string $answerC
|
||||
* @param string $answerD
|
||||
* @param string $cAnswer
|
||||
*/
|
||||
public function __construct(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer)
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
$this->question = $question;
|
||||
$this->answerA = $answerA;
|
||||
$this->answerB = $answerB;
|
||||
$this->answerC = $answerC;
|
||||
$this->answerD = $answerD;
|
||||
$this->cAnswer = $cAnswer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuestion(): int
|
||||
{
|
||||
return $this->id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_question
|
||||
*/
|
||||
public function setIdQuestion(int $id_question): void
|
||||
{
|
||||
$this->id_question = $id_question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getQuestion(): string
|
||||
{
|
||||
return $this->question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $question
|
||||
*/
|
||||
public function setQuestion(string $question): void
|
||||
{
|
||||
$this->question = $question;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerA(): string
|
||||
{
|
||||
return $this->answerA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerA
|
||||
*/
|
||||
public function setAnswerA(string $answerA): void
|
||||
{
|
||||
$this->answerA = $answerA;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerB(): string
|
||||
{
|
||||
return $this->answerB;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerB
|
||||
*/
|
||||
public function setAnswerB(string $answerB): void
|
||||
{
|
||||
$this->answerB = $answerB;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerC(): string
|
||||
{
|
||||
return $this->answerC;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerC
|
||||
*/
|
||||
public function setAnswerC(string $answerC): void
|
||||
{
|
||||
$this->answerC = $answerC;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAnswerD(): string
|
||||
{
|
||||
return $this->answerD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $answerD
|
||||
*/
|
||||
public function setAnswerD(string $answerD): void
|
||||
{
|
||||
$this->answerD = $answerD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCAnswer(): string
|
||||
{
|
||||
return $this->cAnswer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $cAnswer
|
||||
*/
|
||||
public function setCAnswer(string $cAnswer): void
|
||||
{
|
||||
$this->cAnswer = $cAnswer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,56 +1,56 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class QuizEntity
|
||||
{
|
||||
|
||||
private int $id_quiz;
|
||||
|
||||
private int $nb_questions;
|
||||
|
||||
/**
|
||||
* @param int $id_quiz
|
||||
* @param int $nb_questions
|
||||
*/
|
||||
public function __construct(int $id_quiz, int $nb_questions)
|
||||
{
|
||||
$this->id_quiz = $id_quiz;
|
||||
$this->nb_questions = $nb_questions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuiz(): int
|
||||
{
|
||||
return $this->id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_quiz
|
||||
*/
|
||||
public function setIdQuiz(int $id_quiz): void
|
||||
{
|
||||
$this->id_quiz = $id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getNbQuestions(): int
|
||||
{
|
||||
return $this->nb_questions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $nb_questions
|
||||
*/
|
||||
public function setNbQuestions(int $nb_questions): void
|
||||
{
|
||||
$this->nb_questions = $nb_questions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class QuizEntity
|
||||
{
|
||||
|
||||
private int $id_quiz;
|
||||
|
||||
private int $nb_questions;
|
||||
|
||||
/**
|
||||
* @param int $id_quiz
|
||||
* @param int $nb_questions
|
||||
*/
|
||||
public function __construct(int $id_quiz, int $nb_questions)
|
||||
{
|
||||
$this->id_quiz = $id_quiz;
|
||||
$this->nb_questions = $nb_questions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdQuiz(): int
|
||||
{
|
||||
return $this->id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_quiz
|
||||
*/
|
||||
public function setIdQuiz(int $id_quiz): void
|
||||
{
|
||||
$this->id_quiz = $id_quiz;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getNbQuestions(): int
|
||||
{
|
||||
return $this->nb_questions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $nb_questions
|
||||
*/
|
||||
public function setNbQuestions(int $nb_questions): void
|
||||
{
|
||||
$this->nb_questions = $nb_questions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,77 +1,77 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class SourceEntity
|
||||
{
|
||||
private int $id_source;
|
||||
|
||||
private string $title;
|
||||
|
||||
private string $date;
|
||||
|
||||
/**
|
||||
* @param int $id_source
|
||||
* @param string $title
|
||||
* @param string $date
|
||||
*/
|
||||
public function __construct(int $id_source, string $title, string $date)
|
||||
{
|
||||
$this->id_source = $id_source;
|
||||
$this->title = $title;
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdSource(): int
|
||||
{
|
||||
return $this->id_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_source
|
||||
*/
|
||||
public function setIdSource(int $id_source): void
|
||||
{
|
||||
$this->id_source = $id_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
*/
|
||||
public function setTitle(string $title): void
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDate(): string
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate(string $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class SourceEntity
|
||||
{
|
||||
private int $id_source;
|
||||
|
||||
private string $title;
|
||||
|
||||
private string $date;
|
||||
|
||||
/**
|
||||
* @param int $id_source
|
||||
* @param string $title
|
||||
* @param string $date
|
||||
*/
|
||||
public function __construct(int $id_source, string $title, string $date)
|
||||
{
|
||||
$this->id_source = $id_source;
|
||||
$this->title = $title;
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIdSource(): int
|
||||
{
|
||||
return $this->id_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id_source
|
||||
*/
|
||||
public function setIdSource(int $id_source): void
|
||||
{
|
||||
$this->id_source = $id_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
*/
|
||||
public function setTitle(string $title): void
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDate(): string
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate(string $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,175 +1,158 @@
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class User{
|
||||
|
||||
private int $id;
|
||||
private string $username;
|
||||
private string $passwd;
|
||||
private string $hidenPasswd;
|
||||
private int $img;
|
||||
private string $email;
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param string $username
|
||||
* @param string $passwd
|
||||
* @param string $hidenPasswd
|
||||
* @param int $img
|
||||
* @param string $email
|
||||
*/
|
||||
public function __construct(int $id, string $username, string $passwd, int $img, string $email)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->username = $username;
|
||||
$this->passwd = $passwd;
|
||||
$this->hidenPasswd = hidenPasswd($passwd);
|
||||
$this->img = $img;
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
*/
|
||||
public function setUsername(string $username): void
|
||||
{
|
||||
$this->username = $username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImg(): int
|
||||
{
|
||||
return $this->img;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $img
|
||||
*/
|
||||
public function setImg(int $img): void
|
||||
{
|
||||
$this->img = $img;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail(): string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail(string $email): void
|
||||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPasswd(): string
|
||||
{
|
||||
return $this->passwd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getHidenPasswd(): string
|
||||
{
|
||||
return $this->hidenPasswd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $passwd
|
||||
*/
|
||||
public function setPasswd(string $passwd): void
|
||||
{
|
||||
$this->passwd = $passwd;
|
||||
$this->hidenPassWd = hidenPassWd($passwd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
// ============================================ En attente du Model ============================================
|
||||
/*$dsn = "pgsql:host=londres;dbname=dblebeaulato";
|
||||
$username = "lebeaulato";
|
||||
$password = "";
|
||||
|
||||
$con = new Connection($dsn,$username,$password);
|
||||
|
||||
$query = 'SELECT * FROM Users WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
|
||||
$u = new User($result[0]['id_user'],$result[0]['username'], $result[0]['pssword'], '../images/imageProfil.png', $result[0]['email']);
|
||||
|
||||
|
||||
|
||||
|
||||
//UPDATE username User
|
||||
$query = 'UPDATE Users SET username=:newUsername WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newUsername'=> array('Hello', PDO::PARAM_STR)));
|
||||
$queryReponse = 'SELECT username FROM Users WHERE id_user=:idUser';
|
||||
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->setUsername($result[0]['username']);
|
||||
|
||||
|
||||
//UPDATE email User
|
||||
$query = 'UPDATE Users SET email=:newEmail WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newEmail'=> array('hello@gmail.com', PDO::PARAM_STR)));
|
||||
$queryReponse = 'SELECT email FROM Users WHERE id_user=:idUser';
|
||||
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->setEmail($result[0]['email']);
|
||||
|
||||
//UPDATE passwd User
|
||||
$query = 'UPDATE Users SET pssword=:newPassWd WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newPassWd'=> array('TestMotDePasssse', PDO::PARAM_STR)));
|
||||
|
||||
$queryReponse = 'SELECT pssword FROM Users WHERE id_user=:idUser';
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->setPasswd($result[0]['pssword']); /*Test*/
|
||||
|
||||
// ================================================================================================================
|
||||
|
||||
|
||||
|
||||
function hidenPassWd(string $passwd){
|
||||
if(strlen($passwd) >= 16) return str_repeat('*', 16);
|
||||
return str_repeat('*', strlen($passwd));
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
namespace Entity;
|
||||
|
||||
class UserEntity {
|
||||
|
||||
private int $id;
|
||||
private string $pseudo;
|
||||
private string $password;
|
||||
private string $email;
|
||||
private string $date;
|
||||
private bool $isAdmin;
|
||||
private int $imgPrfl;
|
||||
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getPseudo(): string
|
||||
{
|
||||
return $this->pseudo;
|
||||
}
|
||||
|
||||
public function setPseudo(string $pseudo): void
|
||||
{
|
||||
$this->pseudo = $pseudo;
|
||||
}
|
||||
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): void
|
||||
{
|
||||
$this->password = $password;
|
||||
}
|
||||
|
||||
public function getEmail(): string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): void
|
||||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
public function getDate(): string
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(string $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return $this->isAdmin;
|
||||
}
|
||||
|
||||
public function setIsAdmin(bool $isAdmin): void
|
||||
{
|
||||
$this->isAdmin = $isAdmin;
|
||||
}
|
||||
|
||||
public function getImgPrfl(): int
|
||||
{
|
||||
return $this->imgPrfl;
|
||||
}
|
||||
|
||||
public function setImgPrfl(int $imgPrfl): void
|
||||
{
|
||||
$this->imgPrfl = $imgPrfl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param string $pseudo
|
||||
* @param string $password
|
||||
* @param string $email
|
||||
* @param int $imgPrfl
|
||||
* @param bool $isAdmin
|
||||
* @param string $date
|
||||
*/
|
||||
public function __construct(int $id, string $pseudo, string $password, string $email, int $imgPrfl, bool $isAdmin, string $date)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->pseudo = $pseudo;
|
||||
$this->password = $password;
|
||||
$this->email = $email;
|
||||
$this->imgPrfl = $imgPrfl;
|
||||
$this->isAdmin = $isAdmin;
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// ============================================ En attente du Model ============================================
|
||||
/*$dsn = "pgsql:host=londres;dbname=dblebeaulato";
|
||||
$username = "lebeaulato";
|
||||
$password = "";
|
||||
|
||||
$con = new Connection($dsn,$username,$password);
|
||||
|
||||
$query = 'SELECT * FROM Users WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
|
||||
$u = new User($result[0]['id_user'],$result[0]['username'], $result[0]['pssword'], '../images/imageProfil.png', $result[0]['email']);
|
||||
|
||||
|
||||
|
||||
|
||||
//UPDATE username User
|
||||
$query = 'UPDATE Users SET username=:newUsername WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newUsername'=> array('Hello', PDO::PARAM_STR)));
|
||||
$queryReponse = 'SELECT username FROM Users WHERE id_user=:idUser';
|
||||
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->setUsername($result[0]['username']);
|
||||
|
||||
|
||||
//UPDATE email User
|
||||
$query = 'UPDATE Users SET email=:newEmail WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newEmail'=> array('hello@gmail.com', PDO::PARAM_STR)));
|
||||
$queryReponse = 'SELECT email FROM Users WHERE id_user=:idUser';
|
||||
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->setEmail($result[0]['email']);
|
||||
|
||||
//UPDATE passwd User
|
||||
$query = 'UPDATE Users SET pssword=:newPassWd WHERE id_user=:idUser';
|
||||
$con->executeQuery($query, array(':idUser'=>array('U003', PDO::PARAM_STR), ':newPassWd'=> array('TestMotDePasssse', PDO::PARAM_STR)));
|
||||
|
||||
$queryReponse = 'SELECT pssword FROM Users WHERE id_user=:idUser';
|
||||
$con->executeQuery($queryReponse, array(':idUser'=>array('U003', PDO::PARAM_STR)));
|
||||
$result = $con->getResults();
|
||||
$u->setPasswd($result[0]['pssword']); /*Test*/
|
||||
|
||||
// ================================================================================================================
|
||||
|
||||
|
||||
|
||||
function hidenPassWd(string $passwd){
|
||||
if(strlen($passwd) >= 16) return str_repeat('*', 16);
|
||||
return str_repeat('*', strlen($passwd));
|
||||
}
|
||||
?>
|
||||
|
@ -1,75 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use Connection;
|
||||
use PDO;
|
||||
|
||||
|
||||
class CharacterGateway
|
||||
{
|
||||
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(int $id_character, string $name , string $img_char) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Characters
|
||||
VALUES(:id_char, :name, :img_char)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_char' => array($id_character, PDO::PARAM_INT),
|
||||
'name' => array($name, PDO::PARAM_STR),
|
||||
'img_char' => array($img_char, PDO::PARAM_STR)
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function findById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Characters WHERE id_char = :id_c";
|
||||
$this -> co -> executeQuery($query, ["id_c" => array($id, PDO::PARAM_INT)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findByName(string $name) : array
|
||||
{
|
||||
$query = "SELECT * FROM Characters WHERE name = :n";
|
||||
$this -> co -> executeQuery($query, ["n" => array($name, PDO::PARAM_STR)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Characters";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Characters WHERE id_char = :id_c";
|
||||
return $this -> co -> executeQuery($query, ["id_c" => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function update(int $id_char, string $name, string $img_char) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Characters
|
||||
SET name = :n, img_char = :i
|
||||
WHERE id_char = :id_c
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
"id_c" => array($id_char, PDO::PARAM_INT),
|
||||
"name" => array($name, PDO::PARAM_STR),
|
||||
"i" => array($img_char, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use Connection;
|
||||
use PDO;
|
||||
|
||||
|
||||
class CharacterGateway
|
||||
{
|
||||
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(int $id_character, string $name , string $img_char) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Characters
|
||||
VALUES(:id_char, :name, :img_char)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_char' => array($id_character, PDO::PARAM_INT),
|
||||
'name' => array($name, PDO::PARAM_STR),
|
||||
'img_char' => array($img_char, PDO::PARAM_STR)
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function findById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Characters WHERE id_char = :id_c";
|
||||
$this -> co -> executeQuery($query, ["id_c" => array($id, PDO::PARAM_INT)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findByName(string $name) : array
|
||||
{
|
||||
$query = "SELECT * FROM Characters WHERE name = :n";
|
||||
$this -> co -> executeQuery($query, ["n" => array($name, PDO::PARAM_STR)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Characters";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Characters WHERE id_char = :id_c";
|
||||
return $this -> co -> executeQuery($query, ["id_c" => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function update(int $id_char, string $name, string $img_char) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Characters
|
||||
SET name = :n, img_char = :i
|
||||
WHERE id_char = :id_c
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
"id_c" => array($id_char, PDO::PARAM_INT),
|
||||
"name" => array($name, PDO::PARAM_STR),
|
||||
"i" => array($img_char, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
@ -1,35 +1,35 @@
|
||||
<?php
|
||||
namespace Gateway;
|
||||
|
||||
use PDO;
|
||||
|
||||
class Connection extends \PDO {
|
||||
|
||||
private $stmt;
|
||||
|
||||
public function __construct(string $dsn, string $username, string $password) {
|
||||
parent::__construct($dsn,$username,$password);
|
||||
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
}
|
||||
|
||||
|
||||
/** * @param string $query
|
||||
* @param array $parameters *
|
||||
* @return bool Returns `true` on success, `false` otherwise
|
||||
*/
|
||||
|
||||
public function executeQuery(string $query, array $parameters = []) : bool{
|
||||
$this->stmt = parent::prepare($query);
|
||||
foreach ($parameters as $name => $value) {
|
||||
$this->stmt->bindValue($name, $value[0], $value[1]);
|
||||
}
|
||||
|
||||
return $this->stmt->execute();
|
||||
}
|
||||
|
||||
public function getResults() : array {
|
||||
return $this->stmt->fetchall();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
namespace Gateway;
|
||||
|
||||
use PDO;
|
||||
|
||||
class Connection extends \PDO {
|
||||
|
||||
private $stmt;
|
||||
|
||||
public function __construct(string $dsn, string $username, string $password) {
|
||||
parent::__construct($dsn,$username,$password);
|
||||
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
}
|
||||
|
||||
|
||||
/** * @param string $query
|
||||
* @param array $parameters *
|
||||
* @return bool Returns `true` on success, `false` otherwise
|
||||
*/
|
||||
|
||||
public function executeQuery(string $query, array $parameters = []) : bool{
|
||||
$this->stmt = parent::prepare($query);
|
||||
foreach ($parameters as $name => $value) {
|
||||
$this->stmt->bindValue($name, $value[0], $value[1]);
|
||||
}
|
||||
|
||||
return $this->stmt->execute();
|
||||
}
|
||||
|
||||
public function getResults() : array {
|
||||
return $this->stmt->fetchall();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -1,77 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use PDO;
|
||||
|
||||
class FavoriteGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function createFavoriteGateway(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Favorite
|
||||
VALUES (:user, :quote)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'user' => array($idUser, PDO::PARAM_INT),
|
||||
'quote' => array($idQuote, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findFavoriteById(int $idUser, int $idQuote) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Favorite
|
||||
WHERE user_f = :user AND quote_f = :quote
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, [
|
||||
'user' => array($idUser, PDO::PARAM_INT),
|
||||
'quote' => array($idQuote, PDO::PARAM_INT)
|
||||
]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findFavoriteByUser(int $idUser) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Favorite
|
||||
WHERE user_f = :user
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['user' => array($idUser, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllFavorite() : array
|
||||
{
|
||||
$query = "SELECT * FROM Favorite";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function deleteFavoriteGateway(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
$query = "
|
||||
DELETE FROM Favorite
|
||||
WHERE user_f = :user AND quote_f = :quote
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'user' => array($idUser, PDO::PARAM_INT),
|
||||
'quote' => array($idQuote, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use PDO;
|
||||
|
||||
class FavoriteGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function createFavoriteGateway(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Favorite
|
||||
VALUES (:user, :quote)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'user' => array($idUser, PDO::PARAM_INT),
|
||||
'quote' => array($idQuote, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findFavoriteById(int $idUser, int $idQuote) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Favorite
|
||||
WHERE user_f = :user AND quote_f = :quote
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, [
|
||||
'user' => array($idUser, PDO::PARAM_INT),
|
||||
'quote' => array($idQuote, PDO::PARAM_INT)
|
||||
]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findFavoriteByUser(int $idUser) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Favorite
|
||||
WHERE user_f = :user
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['user' => array($idUser, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllFavorite() : array
|
||||
{
|
||||
$query = "SELECT * FROM Favorite";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function deleteFavoriteGateway(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
$query = "
|
||||
DELETE FROM Favorite
|
||||
WHERE user_f = :user AND quote_f = :quote
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'user' => array($idUser, PDO::PARAM_INT),
|
||||
'quote' => array($idQuote, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
@ -1,87 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use PDO;
|
||||
|
||||
class ImageGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function createImgGateway(int $idImg, string $imgPath, bool $isImgProfile) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Images
|
||||
VALUES (:id_img, :img_path, :is_img_profile)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_img' => array($idImg, PDO::PARAM_INT),
|
||||
'img_path' => array($imgPath, PDO::PARAM_STR),
|
||||
'is_img_profile' => array($isImgProfile, PDO::PARAM_BOOL),
|
||||
]);
|
||||
}
|
||||
|
||||
public function findImgById(int $idImg) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Images
|
||||
WHERE id_image = :id_img
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_img' => array($idImg, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllImg() : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Images
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllImgProfile() : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Images
|
||||
WHERE is_img_prfl
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function deleteImgGateway(int $idImg) : bool
|
||||
{
|
||||
$query = "
|
||||
DELETE FROM Images
|
||||
WHERE id_image = :id_img
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, ['id_img' => array($idImg, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function updateImgGateway(int $idImg, string $imgPath) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Images
|
||||
SET img_path = :img_path
|
||||
WHERE id_image = :id_img
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_img' => array($idImg, PDO::PARAM_INT),
|
||||
'img_path' => array($imgPath, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use PDO;
|
||||
|
||||
class ImageGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function createImgGateway(int $idImg, string $imgPath, bool $isImgProfile) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Images
|
||||
VALUES (:id_img, :img_path, :is_img_profile)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_img' => array($idImg, PDO::PARAM_INT),
|
||||
'img_path' => array($imgPath, PDO::PARAM_STR),
|
||||
'is_img_profile' => array($isImgProfile, PDO::PARAM_BOOL),
|
||||
]);
|
||||
}
|
||||
|
||||
public function findImgById(int $idImg) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Images
|
||||
WHERE id_image = :id_img
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_img' => array($idImg, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllImg() : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Images
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllImgProfile() : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Images
|
||||
WHERE is_img_prfl
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function deleteImgGateway(int $idImg) : bool
|
||||
{
|
||||
$query = "
|
||||
DELETE FROM Images
|
||||
WHERE id_image = :id_img
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, ['id_img' => array($idImg, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function updateImgGateway(int $idImg, string $imgPath) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Images
|
||||
SET img_path = :img_path
|
||||
WHERE id_image = :id_img
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_img' => array($idImg, PDO::PARAM_INT),
|
||||
'img_path' => array($imgPath, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,107 +1,107 @@
|
||||
<?php
|
||||
namespace Gateway;
|
||||
use Gateway\Connection;
|
||||
use PDO;
|
||||
|
||||
class QuestionGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer): bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Question
|
||||
VALUES (:id_q, :question, :answerA, :answerB, :answerC, :answerD, :cAnswer)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
array('id_q' => $id_question, PDO::PARAM_INT),
|
||||
array('question' => $question, PDO::PARAM_STR),
|
||||
array('answerA' => $answerA, PDO::PARAM_STR),
|
||||
array('answerB' => $answerB, PDO::PARAM_STR),
|
||||
array('answerC' => $answerC, PDO::PARAM_STR),
|
||||
array('answerD' => $answerD, PDO::PARAM_STR),
|
||||
array('cAnswer' => $cAnswer, PDO::PARAM_STR),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function findById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Question WHERE id_question = :id_q";
|
||||
$this -> co -> executeQuery($query, ['id_q' => array($id, PDO::PARAM_INT)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
|
||||
public function updateText(int $id_q, string $newQuestion) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Question
|
||||
SET question = :question
|
||||
WHERE id_question = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_q' => array($id_q, PDO::PARAM_INT),
|
||||
'question' => array($newQuestion, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAnswers(int $id_q, string $newA, string $newB, string $newC, string $newD, string $newCorrect): bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Question
|
||||
SET answerA = :answerA, answerB = :answerB,
|
||||
answerC = :answerC, answerD = :answerD, cAnswer = :cAnswer
|
||||
WHERE id_question = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_q' => array($id_q, PDO::PARAM_INT),
|
||||
'answerA' => array($newA, PDO::PARAM_STR),
|
||||
'answerB' => array($newB, PDO::PARAM_STR),
|
||||
'answerC' => array($newC, PDO::PARAM_STR),
|
||||
'answerD' => array($newD, PDO::PARAM_STR),
|
||||
'cAnswer' => array($newCorrect, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a question from the database by its ID
|
||||
*
|
||||
* @param int $id The ID of the question
|
||||
* @return bool
|
||||
*/
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Question WHERE id_question = :id_q";
|
||||
|
||||
return $this -> co -> executeQuery($query, ['id_q' => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all quizzes from the database
|
||||
*
|
||||
* @return QuestionEntity[] An array of `Question` objects
|
||||
*/
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Question";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findRdmQuestion() : array
|
||||
{
|
||||
$query = "SELECT * FROM Question ORDER BY RANDOM() LIMIT 1";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Gateway;
|
||||
use Gateway\Connection;
|
||||
use PDO;
|
||||
|
||||
class QuestionGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer): bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Question
|
||||
VALUES (:id_q, :question, :answerA, :answerB, :answerC, :answerD, :cAnswer)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
array('id_q' => $id_question, PDO::PARAM_INT),
|
||||
array('question' => $question, PDO::PARAM_STR),
|
||||
array('answerA' => $answerA, PDO::PARAM_STR),
|
||||
array('answerB' => $answerB, PDO::PARAM_STR),
|
||||
array('answerC' => $answerC, PDO::PARAM_STR),
|
||||
array('answerD' => $answerD, PDO::PARAM_STR),
|
||||
array('cAnswer' => $cAnswer, PDO::PARAM_STR),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function findById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Question WHERE id_question = :id_q";
|
||||
$this -> co -> executeQuery($query, ['id_q' => array($id, PDO::PARAM_INT)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
|
||||
public function updateText(int $id_q, string $newQuestion) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Question
|
||||
SET question = :question
|
||||
WHERE id_question = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_q' => array($id_q, PDO::PARAM_INT),
|
||||
'question' => array($newQuestion, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateAnswers(int $id_q, string $newA, string $newB, string $newC, string $newD, string $newCorrect): bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Question
|
||||
SET answerA = :answerA, answerB = :answerB,
|
||||
answerC = :answerC, answerD = :answerD, cAnswer = :cAnswer
|
||||
WHERE id_question = :id_q
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_q' => array($id_q, PDO::PARAM_INT),
|
||||
'answerA' => array($newA, PDO::PARAM_STR),
|
||||
'answerB' => array($newB, PDO::PARAM_STR),
|
||||
'answerC' => array($newC, PDO::PARAM_STR),
|
||||
'answerD' => array($newD, PDO::PARAM_STR),
|
||||
'cAnswer' => array($newCorrect, PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a question from the database by its ID
|
||||
*
|
||||
* @param int $id The ID of the question
|
||||
* @return bool
|
||||
*/
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Question WHERE id_question = :id_q";
|
||||
|
||||
return $this -> co -> executeQuery($query, ['id_q' => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all quizzes from the database
|
||||
*
|
||||
* @return QuestionEntity[] An array of `Question` objects
|
||||
*/
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Question";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findRdmQuestion() : array
|
||||
{
|
||||
$query = "SELECT * FROM Question ORDER BY RANDOM() LIMIT 1";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,50 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use Gateway\Connection;
|
||||
use PDO;
|
||||
|
||||
|
||||
class QuizGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(int $id_quiz, int $nb_questions) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Quiz
|
||||
VALUES (:id_q, :nb_q)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
':id_q' => array($id_quiz, PDO::PARAM_INT),
|
||||
':nb_q' => array($nb_questions, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findQuizById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Quiz WHERE id_quiz = :id_q";
|
||||
$this -> co -> executeQuery($query, [':id_q' => array($id, PDO::PARAM_INT)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Quiz WHERE id_quiz = :id_q";
|
||||
return $this -> co -> executeQuery($query, [':id_q' => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Quiz";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use Gateway\Connection;
|
||||
use PDO;
|
||||
|
||||
|
||||
class QuizGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(int $id_quiz, int $nb_questions) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Quiz
|
||||
VALUES (:id_q, :nb_q)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
':id_q' => array($id_quiz, PDO::PARAM_INT),
|
||||
':nb_q' => array($nb_questions, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findQuizById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Quiz WHERE id_quiz = :id_q";
|
||||
$this -> co -> executeQuery($query, [':id_q' => array($id, PDO::PARAM_INT)]);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Quiz WHERE id_quiz = :id_q";
|
||||
return $this -> co -> executeQuery($query, [':id_q' => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Quiz";
|
||||
$this -> co -> executeQuery($query);
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
}
|
@ -1,73 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use PDO;
|
||||
|
||||
class QuizQuestionGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function createQuizQuestionGateway(int $idQuiz, int $idQuestion): bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO QuizQuestions
|
||||
VALUES (:id_quiz, :id_question)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_question' => array($idQuestion, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findQuizQuestionById(int $idQuiz, int $idQuestion) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM QuizQuestions
|
||||
WHERE quiz_qq = :id_quiz AND question_qq = :id_question
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_question' => array($idQuestion, PDO::PARAM_INT)
|
||||
]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findQuestionsFromQuiz(int $idQuiz) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM QuizQuestions
|
||||
WHERE quiz_qq = :id_quiz
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_quiz' => array($idQuiz, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function deleteQuizQuestionGateway(int $idQuiz, int $idQuestion) : bool
|
||||
{
|
||||
$query = "
|
||||
DELETE FROM QuizQuestions
|
||||
WHERE quiz_qq = :id_quiz AND question_qq = :id_question
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_question' => array($idQuestion, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
# To do :
|
||||
# Method that deletes all questions related to a quiz
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
use PDO;
|
||||
|
||||
class QuizQuestionGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function createQuizQuestionGateway(int $idQuiz, int $idQuestion): bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO QuizQuestions
|
||||
VALUES (:id_quiz, :id_question)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_question' => array($idQuestion, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findQuizQuestionById(int $idQuiz, int $idQuestion) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM QuizQuestions
|
||||
WHERE quiz_qq = :id_quiz AND question_qq = :id_question
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_question' => array($idQuestion, PDO::PARAM_INT)
|
||||
]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findQuestionsFromQuiz(int $idQuiz) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM QuizQuestions
|
||||
WHERE quiz_qq = :id_quiz
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_quiz' => array($idQuiz, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function deleteQuizQuestionGateway(int $idQuiz, int $idQuestion) : bool
|
||||
{
|
||||
$query = "
|
||||
DELETE FROM QuizQuestions
|
||||
WHERE quiz_qq = :id_quiz AND question_qq = :id_question
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_question' => array($idQuestion, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
# To do :
|
||||
# Method that deletes all questions related to a quiz
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,131 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
|
||||
use PDO;
|
||||
|
||||
class ResultsGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co ;
|
||||
}
|
||||
|
||||
public function createResultsGateway(int $idQuiz, int $idUser, int $nbPts, int $time) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Results
|
||||
VALUES (:id_quiz, :id_user, :nb_pts, :time)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'nb_pts' => array($nbPts, PDO::PARAM_INT),
|
||||
'time' => array($time, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findResultsByQuiz(int $idQuiz) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Results
|
||||
WHERE quiz_r = :id_quiz
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_quiz' => array($idQuiz, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findResultsByUser(int $idUser) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Results
|
||||
WHERE user_r = :id_user
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_user' => array($idUser, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findResultsById(int $idQuiz, int $idUser) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Results
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, [
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT)
|
||||
]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllResults() : array
|
||||
{
|
||||
$query = "SELECT * FROM Results";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function updateResults(int $idQuiz, int $idUser, ?int $score, ?int $time) : bool
|
||||
{
|
||||
if ($score && !$time)
|
||||
{
|
||||
$query = "
|
||||
UPDATE Results
|
||||
SET score = :score
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'score' => array($score, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
else if (!$score && $time)
|
||||
{
|
||||
$query = "
|
||||
UPDATE Results
|
||||
SET time = :time
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'time' => array($time, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$query = "
|
||||
UPDATE Results
|
||||
SET score = :score AND time = :time
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'score' => array($score, PDO::PARAM_INT),
|
||||
'time' => array($time, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
namespace Gateway;
|
||||
|
||||
use PDO;
|
||||
|
||||
class ResultsGateway
|
||||
{
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co ;
|
||||
}
|
||||
|
||||
public function createResultsGateway(int $idQuiz, int $idUser, int $nbPts, int $time) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Results
|
||||
VALUES (:id_quiz, :id_user, :nb_pts, :time)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'nb_pts' => array($nbPts, PDO::PARAM_INT),
|
||||
'time' => array($time, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findResultsByQuiz(int $idQuiz) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Results
|
||||
WHERE quiz_r = :id_quiz
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_quiz' => array($idQuiz, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findResultsByUser(int $idUser) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Results
|
||||
WHERE user_r = :id_user
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, ['id_user' => array($idUser, PDO::PARAM_INT)]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findResultsById(int $idQuiz, int $idUser) : array
|
||||
{
|
||||
$query = "
|
||||
SELECT * FROM Results
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
$this -> co -> executeQuery($query, [
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT)
|
||||
]);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findAllResults() : array
|
||||
{
|
||||
$query = "SELECT * FROM Results";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
|
||||
return $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function updateResults(int $idQuiz, int $idUser, ?int $score, ?int $time) : bool
|
||||
{
|
||||
if ($score && !$time)
|
||||
{
|
||||
$query = "
|
||||
UPDATE Results
|
||||
SET score = :score
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'score' => array($score, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
else if (!$score && $time)
|
||||
{
|
||||
$query = "
|
||||
UPDATE Results
|
||||
SET time = :time
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'time' => array($time, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$query = "
|
||||
UPDATE Results
|
||||
SET score = :score AND time = :time
|
||||
WHERE quiz_r = :id_quiz AND user_r = :id_user
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
'id_quiz' => array($idQuiz, PDO::PARAM_INT),
|
||||
'id_user' => array($idUser, PDO::PARAM_INT),
|
||||
'score' => array($score, PDO::PARAM_INT),
|
||||
'time' => array($time, PDO::PARAM_INT)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,108 +1,108 @@
|
||||
<?php
|
||||
namespace Gateway;
|
||||
use Connection;
|
||||
|
||||
class SourceGateway {
|
||||
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(sourceEntity $s) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Source
|
||||
VALUES(:id_source, :title, :date)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
"id_source" => array($s->getIdSource(), PDO::PARAM_INT),
|
||||
"title" => array($s->getTitle(), PDO::PARAM_STR),
|
||||
"date" => array($s->getDate(), PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Source WHERE id_source = :id";
|
||||
|
||||
$this -> co -> executeQuery($query, array("id_source" => array($id, PDO::PARAM_INT)));
|
||||
return $res = $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findByTitle(string $t) : array
|
||||
{
|
||||
$query = "SELECT * FROM Source WHERE title = :t";
|
||||
|
||||
$this -> co -> executeQuery($query, ["title" => array($t, PDO::PARAM_STR)]);
|
||||
return $res = $this -> co -> getResults();
|
||||
|
||||
// if ($res)
|
||||
// return new sourceEntity(
|
||||
// $res["id_source"],
|
||||
// $res["title"],
|
||||
// $res["date"]
|
||||
// );
|
||||
// return null;
|
||||
}
|
||||
|
||||
public function findByDate(string $d) : array
|
||||
{
|
||||
$query = "SELECT * FROM Source WHERE date = :d";
|
||||
|
||||
$this -> co -> executeQuery($query, ["date" => array($d, PDO::PARAM_STR)]);
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
if ($res)
|
||||
return new sourceEntity(
|
||||
$res["id_source"],
|
||||
$res["title"],
|
||||
$res["date"]
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Source";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
$sources = [];
|
||||
|
||||
foreach ($res as $source) {
|
||||
$sources[] = new sourceEntity(
|
||||
$source["id_source"],
|
||||
$source["title"],
|
||||
$source["date"]
|
||||
);
|
||||
}
|
||||
return $sources;
|
||||
}
|
||||
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Source WHERE id_source = :id_s";
|
||||
|
||||
$this -> co -> executeQuery($query, ["id_s" => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function update(sourceEntity $s) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Source
|
||||
SET title = :t, date = :d
|
||||
WHERE id_source = :id_s
|
||||
";
|
||||
return $this->co->executeQuery($query, [
|
||||
"id_s" => array($s -> getIdSource(), PDO::PARAM_INT),
|
||||
"t" => array($s -> getTitle(), PDO::PARAM_STR),
|
||||
"d" => array($s -> getDate(), PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
namespace Gateway;
|
||||
use Connection;
|
||||
|
||||
class SourceGateway {
|
||||
|
||||
private Connection $co;
|
||||
|
||||
public function __construct(Connection $co)
|
||||
{
|
||||
$this -> co = $co;
|
||||
}
|
||||
|
||||
public function create(sourceEntity $s) : bool
|
||||
{
|
||||
$query = "
|
||||
INSERT INTO Source
|
||||
VALUES(:id_source, :title, :date)
|
||||
";
|
||||
|
||||
return $this -> co -> executeQuery($query, [
|
||||
"id_source" => array($s->getIdSource(), PDO::PARAM_INT),
|
||||
"title" => array($s->getTitle(), PDO::PARAM_STR),
|
||||
"date" => array($s->getDate(), PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
public function findById(int $id) : array
|
||||
{
|
||||
$query = "SELECT * FROM Source WHERE id_source = :id";
|
||||
|
||||
$this -> co -> executeQuery($query, array("id_source" => array($id, PDO::PARAM_INT)));
|
||||
return $res = $this -> co -> getResults();
|
||||
}
|
||||
|
||||
public function findByTitle(string $t) : array
|
||||
{
|
||||
$query = "SELECT * FROM Source WHERE title = :t";
|
||||
|
||||
$this -> co -> executeQuery($query, ["title" => array($t, PDO::PARAM_STR)]);
|
||||
return $res = $this -> co -> getResults();
|
||||
|
||||
// if ($res)
|
||||
// return new sourceEntity(
|
||||
// $res["id_source"],
|
||||
// $res["title"],
|
||||
// $res["date"]
|
||||
// );
|
||||
// return null;
|
||||
}
|
||||
|
||||
public function findByDate(string $d) : array
|
||||
{
|
||||
$query = "SELECT * FROM Source WHERE date = :d";
|
||||
|
||||
$this -> co -> executeQuery($query, ["date" => array($d, PDO::PARAM_STR)]);
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
if ($res)
|
||||
return new sourceEntity(
|
||||
$res["id_source"],
|
||||
$res["title"],
|
||||
$res["date"]
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function findAll() : array
|
||||
{
|
||||
$query = "SELECT * FROM Source";
|
||||
|
||||
$this -> co -> executeQuery($query);
|
||||
$res = $this -> co -> getResults();
|
||||
|
||||
$sources = [];
|
||||
|
||||
foreach ($res as $source) {
|
||||
$sources[] = new sourceEntity(
|
||||
$source["id_source"],
|
||||
$source["title"],
|
||||
$source["date"]
|
||||
);
|
||||
}
|
||||
return $sources;
|
||||
}
|
||||
|
||||
public function delete(int $id) : bool
|
||||
{
|
||||
$query = "DELETE FROM Source WHERE id_source = :id_s";
|
||||
|
||||
$this -> co -> executeQuery($query, ["id_s" => array($id, PDO::PARAM_INT)]);
|
||||
}
|
||||
|
||||
public function update(sourceEntity $s) : bool
|
||||
{
|
||||
$query = "
|
||||
UPDATE Source
|
||||
SET title = :t, date = :d
|
||||
WHERE id_source = :id_s
|
||||
";
|
||||
return $this->co->executeQuery($query, [
|
||||
"id_s" => array($s -> getIdSource(), PDO::PARAM_INT),
|
||||
"t" => array($s -> getTitle(), PDO::PARAM_STR),
|
||||
"d" => array($s -> getDate(), PDO::PARAM_STR)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,74 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
use Entity\CharacterEntity;
|
||||
use Gateway\CharacterGateway;
|
||||
|
||||
|
||||
class CharacterModel
|
||||
{
|
||||
|
||||
private CharacterGateway $gateway;
|
||||
|
||||
public function __construct(characterGateway $gw)
|
||||
{
|
||||
$this -> gateway = $gw;
|
||||
}
|
||||
|
||||
public function createCharacter(int $id_character, string $name , string $img_char) : bool
|
||||
{
|
||||
return $this -> gateway -> create($id_character, $name, $img_char);
|
||||
}
|
||||
|
||||
public function getCharacterById(int $id_character) : ?CharacterEntity
|
||||
{
|
||||
$c = $this -> gateway -> findById($id_character);
|
||||
if ($c)
|
||||
return new CharacterEntity(
|
||||
$c['id_character'],
|
||||
$c['name'],
|
||||
$c['img_path']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getCharacterByName(string $name) : ?CharacterEntity
|
||||
{
|
||||
$c = $this -> gateway -> findByName($name);
|
||||
if ($c)
|
||||
return new CharacterEntity(
|
||||
$c[0]['id_character'],
|
||||
$c[0]['name'],
|
||||
$c[0]['img_path']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllCharacters() : array
|
||||
{
|
||||
$c = $this -> gateway -> findAll();
|
||||
|
||||
$characters = [];
|
||||
|
||||
foreach ($c as $character)
|
||||
{
|
||||
$characters[] = new CharacterEntity(
|
||||
$character['id_character'],
|
||||
$character['name'],
|
||||
$character['img_path']
|
||||
);
|
||||
}
|
||||
return $characters;
|
||||
}
|
||||
|
||||
public function deleteCharacter(int $id_character) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_character);
|
||||
}
|
||||
|
||||
public function updateCharacter(int $id_character, string $name, string $img_char) : bool
|
||||
{
|
||||
return $this -> gateway -> update($id_character, $name, $img_char);
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
use Entity\CharacterEntity;
|
||||
use Gateway\CharacterGateway;
|
||||
|
||||
|
||||
class CharacterModel
|
||||
{
|
||||
|
||||
private CharacterGateway $gateway;
|
||||
|
||||
public function __construct(characterGateway $gw)
|
||||
{
|
||||
$this -> gateway = $gw;
|
||||
}
|
||||
|
||||
public function createCharacter(int $id_character, string $name , string $img_char) : bool
|
||||
{
|
||||
return $this -> gateway -> create($id_character, $name, $img_char);
|
||||
}
|
||||
|
||||
public function getCharacterById(int $id_character) : ?CharacterEntity
|
||||
{
|
||||
$c = $this -> gateway -> findById($id_character);
|
||||
if ($c)
|
||||
return new CharacterEntity(
|
||||
$c['id_character'],
|
||||
$c['name'],
|
||||
$c['img_path']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getCharacterByName(string $name) : ?CharacterEntity
|
||||
{
|
||||
$c = $this -> gateway -> findByName($name);
|
||||
if ($c)
|
||||
return new CharacterEntity(
|
||||
$c[0]['id_character'],
|
||||
$c[0]['name'],
|
||||
$c[0]['img_path']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllCharacters() : array
|
||||
{
|
||||
$c = $this -> gateway -> findAll();
|
||||
|
||||
$characters = [];
|
||||
|
||||
foreach ($c as $character)
|
||||
{
|
||||
$characters[] = new CharacterEntity(
|
||||
$character['id_character'],
|
||||
$character['name'],
|
||||
$character['img_path']
|
||||
);
|
||||
}
|
||||
return $characters;
|
||||
}
|
||||
|
||||
public function deleteCharacter(int $id_character) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_character);
|
||||
}
|
||||
|
||||
public function updateCharacter(int $id_character, string $name, string $img_char) : bool
|
||||
{
|
||||
return $this -> gateway -> update($id_character, $name, $img_char);
|
||||
}
|
||||
|
||||
}
|
@ -1,71 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
use Gateway\FavoriteGateway;
|
||||
use Entity\FavoriteEntity;
|
||||
|
||||
class FavoriteModel
|
||||
{
|
||||
private FavoriteGateway $gw;
|
||||
|
||||
public function __construct(FavoriteGateway $gw)
|
||||
{
|
||||
$this -> gw = $gw;
|
||||
}
|
||||
|
||||
public function createFavoriteModel(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
return $this -> gw -> createFavoriteGateway($idUser, $idQuote);
|
||||
}
|
||||
|
||||
public function getFavoriteById(int $idUser, int $idQuote) : ?FavoriteEntity
|
||||
{
|
||||
$res = $this -> gw -> findFavoriteById($idUser, $idQuote);
|
||||
|
||||
if ($res)
|
||||
{
|
||||
return new FavoriteEntity (
|
||||
$res[0]['user_f'],
|
||||
$res[0]['quote_f'],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getFavoriteByUser(int $idUser) : array
|
||||
{
|
||||
$res = $this -> gw -> findFavoriteByUser($idUser);
|
||||
|
||||
$favorites = [];
|
||||
|
||||
foreach ($res as $favorite)
|
||||
{
|
||||
$favorites = new FavoriteEntity (
|
||||
$favorite['user_f'],
|
||||
$favorite['quote_f']
|
||||
);
|
||||
}
|
||||
return $favorites;
|
||||
}
|
||||
|
||||
public function getAllFavorite() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllFavorite();
|
||||
|
||||
$favorites = [];
|
||||
|
||||
foreach ($res as $favorite)
|
||||
{
|
||||
$favorites = new FavoriteEntity (
|
||||
$favorite['user_f'],
|
||||
$favorite['quote_f']
|
||||
);
|
||||
}
|
||||
return $favorites;
|
||||
}
|
||||
|
||||
public function removeFavorite(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
return $this -> gw -> deleteFavoriteGateway($idUser, $idQuote);
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
use Gateway\FavoriteGateway;
|
||||
use Entity\FavoriteEntity;
|
||||
|
||||
class FavoriteModel
|
||||
{
|
||||
private FavoriteGateway $gw;
|
||||
|
||||
public function __construct(FavoriteGateway $gw)
|
||||
{
|
||||
$this -> gw = $gw;
|
||||
}
|
||||
|
||||
public function createFavoriteModel(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
return $this -> gw -> createFavoriteGateway($idUser, $idQuote);
|
||||
}
|
||||
|
||||
public function getFavoriteById(int $idUser, int $idQuote) : ?FavoriteEntity
|
||||
{
|
||||
$res = $this -> gw -> findFavoriteById($idUser, $idQuote);
|
||||
|
||||
if ($res)
|
||||
{
|
||||
return new FavoriteEntity (
|
||||
$res[0]['user_f'],
|
||||
$res[0]['quote_f'],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getFavoriteByUser(int $idUser) : array
|
||||
{
|
||||
$res = $this -> gw -> findFavoriteByUser($idUser);
|
||||
|
||||
$favorites = [];
|
||||
|
||||
foreach ($res as $favorite)
|
||||
{
|
||||
$favorites = new FavoriteEntity (
|
||||
$favorite['user_f'],
|
||||
$favorite['quote_f']
|
||||
);
|
||||
}
|
||||
return $favorites;
|
||||
}
|
||||
|
||||
public function getAllFavorite() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllFavorite();
|
||||
|
||||
$favorites = [];
|
||||
|
||||
foreach ($res as $favorite)
|
||||
{
|
||||
$favorites = new FavoriteEntity (
|
||||
$favorite['user_f'],
|
||||
$favorite['quote_f']
|
||||
);
|
||||
}
|
||||
return $favorites;
|
||||
}
|
||||
|
||||
public function removeFavorite(int $idUser, int $idQuote) : bool
|
||||
{
|
||||
return $this -> gw -> deleteFavoriteGateway($idUser, $idQuote);
|
||||
}
|
||||
}
|
@ -1,80 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
|
||||
use Entity\ImageEntity;
|
||||
use Gateway\ImageGateway;
|
||||
|
||||
class ImageModel
|
||||
{
|
||||
private ImageGateway $gw;
|
||||
|
||||
public function __construct(ImageGateway $gw)
|
||||
{
|
||||
$this -> gw = $gw;
|
||||
}
|
||||
|
||||
public function createImgModel(int $idImg, string $imgPath, bool $isImgProfile) : bool
|
||||
{
|
||||
return $this -> gw -> createImgGateway($idImg, $imgPath, $isImgProfile);
|
||||
}
|
||||
|
||||
public function getImgById(int $idImg) : ?ImageEntity
|
||||
{
|
||||
$res = $this -> gw -> findImgById($idImg);
|
||||
|
||||
if ($res)
|
||||
{
|
||||
return new ImageEntity(
|
||||
$res[0]['id_image'],
|
||||
$res[0]['img_path'],
|
||||
$res[0]['is_img_prfl']
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllImg() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllImg();
|
||||
|
||||
$images = [];
|
||||
|
||||
foreach ($res as $img)
|
||||
{
|
||||
$images[] = new ImageEntity(
|
||||
$img['id_image'],
|
||||
$img['img_path'],
|
||||
$img['is_img_prfl']
|
||||
);
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
|
||||
public function getAllImgProfile() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllImgProfile();
|
||||
|
||||
$images = [];
|
||||
|
||||
foreach ($res as $img)
|
||||
{
|
||||
$images[] = new ImageEntity(
|
||||
$img['id_image'],
|
||||
$img['img_path'],
|
||||
$img['is_img_prfl']
|
||||
);
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
|
||||
public function deleteImgModel(int $idImg) : bool
|
||||
{
|
||||
return $this -> gw -> deleteImgGateway($idImg);
|
||||
}
|
||||
|
||||
public function updateImgModel(int $idImg, string $imgPath) : bool
|
||||
{
|
||||
return $this -> gw -> updateImgGateway($idImg, $imgPath);
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
|
||||
use Entity\ImageEntity;
|
||||
use Gateway\ImageGateway;
|
||||
|
||||
class ImageModel
|
||||
{
|
||||
private ImageGateway $gw;
|
||||
|
||||
public function __construct(ImageGateway $gw)
|
||||
{
|
||||
$this -> gw = $gw;
|
||||
}
|
||||
|
||||
public function createImgModel(int $idImg, string $imgPath, bool $isImgProfile) : bool
|
||||
{
|
||||
return $this -> gw -> createImgGateway($idImg, $imgPath, $isImgProfile);
|
||||
}
|
||||
|
||||
public function getImgById(int $idImg) : ?ImageEntity
|
||||
{
|
||||
$res = $this -> gw -> findImgById($idImg);
|
||||
|
||||
if ($res)
|
||||
{
|
||||
return new ImageEntity(
|
||||
$res[0]['id_image'],
|
||||
$res[0]['img_path'],
|
||||
$res[0]['is_img_prfl']
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllImg() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllImg();
|
||||
|
||||
$images = [];
|
||||
|
||||
foreach ($res as $img)
|
||||
{
|
||||
$images[] = new ImageEntity(
|
||||
$img['id_image'],
|
||||
$img['img_path'],
|
||||
$img['is_img_prfl']
|
||||
);
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
|
||||
public function getAllImgProfile() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllImgProfile();
|
||||
|
||||
$images = [];
|
||||
|
||||
foreach ($res as $img)
|
||||
{
|
||||
$images[] = new ImageEntity(
|
||||
$img['id_image'],
|
||||
$img['img_path'],
|
||||
$img['is_img_prfl']
|
||||
);
|
||||
}
|
||||
return $images;
|
||||
}
|
||||
|
||||
public function deleteImgModel(int $idImg) : bool
|
||||
{
|
||||
return $this -> gw -> deleteImgGateway($idImg);
|
||||
}
|
||||
|
||||
public function updateImgModel(int $idImg, string $imgPath) : bool
|
||||
{
|
||||
return $this -> gw -> updateImgGateway($idImg, $imgPath);
|
||||
}
|
||||
}
|
@ -1,88 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
use Gateway\QuestionGateway;
|
||||
use Entity\QuestionEntity;
|
||||
|
||||
class QuestionModel
|
||||
{
|
||||
private QuestionGateway $gateway;
|
||||
|
||||
public function __construct(QuestionGateway $gw)
|
||||
{
|
||||
$this -> gateway = $gw;
|
||||
}
|
||||
|
||||
public function createQuestion(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer): bool
|
||||
{
|
||||
return $this -> gateway -> create($id_question, $question, $answerA, $answerB, $answerC, $answerD, $cAnswer);
|
||||
|
||||
}
|
||||
|
||||
public function getQuestion(int $id_question) : ?QuestionEntity
|
||||
{
|
||||
$q = $this -> gateway -> findById($id_question);
|
||||
if ($q)
|
||||
return new QuestionEntity(
|
||||
$q[0]['id_question'],
|
||||
$q[0]['question'],
|
||||
$q[0]['answera'],
|
||||
$q[0]['answerb'],
|
||||
$q[0]['answerc'],
|
||||
$q[0]['answerd'],
|
||||
$q[0]['canswer']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function updateTextQuestion(int $id_question, string $question) : bool
|
||||
{
|
||||
return $this -> gateway -> updateText($id_question, $question);
|
||||
}
|
||||
|
||||
public function updateAnswersQuestion(int $id_question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer): bool
|
||||
{
|
||||
return $this -> gateway -> updateAnswers($id_question, $answerA, $answerB, $answerC, $answerD, $cAnswer);
|
||||
}
|
||||
|
||||
public function deleteQuestion(int $id_question) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_question);
|
||||
}
|
||||
|
||||
public function getAllQuestions() : array
|
||||
{
|
||||
$q = $this -> gateway -> findAll();
|
||||
|
||||
$questions = [];
|
||||
|
||||
foreach ($q as $question) {
|
||||
$questions[] = new QuestionEntity(
|
||||
$question['id_question'],
|
||||
$question['question'],
|
||||
$question['answerA'],
|
||||
$question['answerB'],
|
||||
$question['answerC'],
|
||||
$question['answerD'],
|
||||
$question['cAnswer']
|
||||
);
|
||||
}
|
||||
return $questions;
|
||||
}
|
||||
|
||||
public function getRdmQuestion() : ?QuestionEntity
|
||||
{
|
||||
$q = $this -> gateway -> findRdmQuestion();
|
||||
if ($q)
|
||||
return new QuestionEntity(
|
||||
$q['id_question'],
|
||||
$q['question'],
|
||||
$q['answerA'],
|
||||
$q['answerB'],
|
||||
$q['answerC'],
|
||||
$q['answerD'],
|
||||
$q['cAnswer']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
use Gateway\QuestionGateway;
|
||||
use Entity\QuestionEntity;
|
||||
|
||||
class QuestionModel
|
||||
{
|
||||
private QuestionGateway $gateway;
|
||||
|
||||
public function __construct(QuestionGateway $gw)
|
||||
{
|
||||
$this -> gateway = $gw;
|
||||
}
|
||||
|
||||
public function createQuestion(int $id_question, string $question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer): bool
|
||||
{
|
||||
return $this -> gateway -> create($id_question, $question, $answerA, $answerB, $answerC, $answerD, $cAnswer);
|
||||
|
||||
}
|
||||
|
||||
public function getQuestion(int $id_question) : ?QuestionEntity
|
||||
{
|
||||
$q = $this -> gateway -> findById($id_question);
|
||||
if ($q)
|
||||
return new QuestionEntity(
|
||||
$q[0]['id_question'],
|
||||
$q[0]['question'],
|
||||
$q[0]['answera'],
|
||||
$q[0]['answerb'],
|
||||
$q[0]['answerc'],
|
||||
$q[0]['answerd'],
|
||||
$q[0]['canswer']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function updateTextQuestion(int $id_question, string $question) : bool
|
||||
{
|
||||
return $this -> gateway -> updateText($id_question, $question);
|
||||
}
|
||||
|
||||
public function updateAnswersQuestion(int $id_question, string $answerA, string $answerB, string $answerC, string $answerD, string $cAnswer): bool
|
||||
{
|
||||
return $this -> gateway -> updateAnswers($id_question, $answerA, $answerB, $answerC, $answerD, $cAnswer);
|
||||
}
|
||||
|
||||
public function deleteQuestion(int $id_question) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_question);
|
||||
}
|
||||
|
||||
public function getAllQuestions() : array
|
||||
{
|
||||
$q = $this -> gateway -> findAll();
|
||||
|
||||
$questions = [];
|
||||
|
||||
foreach ($q as $question) {
|
||||
$questions[] = new QuestionEntity(
|
||||
$question['id_question'],
|
||||
$question['question'],
|
||||
$question['answerA'],
|
||||
$question['answerB'],
|
||||
$question['answerC'],
|
||||
$question['answerD'],
|
||||
$question['cAnswer']
|
||||
);
|
||||
}
|
||||
return $questions;
|
||||
}
|
||||
|
||||
public function getRdmQuestion() : ?QuestionEntity
|
||||
{
|
||||
$q = $this -> gateway -> findRdmQuestion();
|
||||
if ($q)
|
||||
return new QuestionEntity(
|
||||
$q['id_question'],
|
||||
$q['question'],
|
||||
$q['answerA'],
|
||||
$q['answerB'],
|
||||
$q['answerC'],
|
||||
$q['answerD'],
|
||||
$q['cAnswer']
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,80 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
|
||||
use Entity\QuestionEntity;
|
||||
use Entity\QuizEntity;
|
||||
use Entity\QuizQuestionEntity;
|
||||
use Gateway\Connection;
|
||||
use Gateway\QuestionGateway;
|
||||
use Gateway\QuizGateway;
|
||||
use Gateway\QuizQuestionGateway;
|
||||
|
||||
class QuizQuestionModel
|
||||
{
|
||||
private QuizQuestionGateway $gw;
|
||||
|
||||
/**
|
||||
* @param QuizGateway $gw
|
||||
*/
|
||||
public function __construct(QuizQuestionGateway $gw)
|
||||
{
|
||||
$this->gw = $gw;
|
||||
}
|
||||
|
||||
public function createQuizQuestion(int $idQuiz, int $idQuestion): bool
|
||||
{
|
||||
return $this->gw->create($idQuiz,$idQuestion);
|
||||
}
|
||||
|
||||
public function findQuizQuestionByIdQuiz(int $id): ?QuizQuestionEntity
|
||||
{
|
||||
$q = $this ->gw->findQuizQuestionByIdQuiz($id);
|
||||
if ($q) {
|
||||
return new QuizQuestionEntity(
|
||||
$q['idQuiz'],
|
||||
$q['idQuestion'],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllQuestionByQuiz(int $id, Connection $co): array
|
||||
{
|
||||
$q = $this->gw->findQuestionsFromQuiz($id);
|
||||
|
||||
$questions = [];
|
||||
$gw = new QuestionGateway($co);
|
||||
$qmdl = new QuestionModel($gw);
|
||||
|
||||
foreach ($q as $question){
|
||||
$questions [] = $qmdl->getQuestion($question[1]);
|
||||
}
|
||||
|
||||
return $questions;
|
||||
}
|
||||
|
||||
public function findAll(): array
|
||||
{
|
||||
$q = $this -> gw -> findAll();
|
||||
|
||||
$quizzes = [];
|
||||
|
||||
foreach ($q as $quiz) {
|
||||
$quizzes[] = new QuizQuestionEntity(
|
||||
$quiz['idQuiz'],
|
||||
$quiz['idQuestion']
|
||||
);
|
||||
}
|
||||
return $quizzes;
|
||||
}
|
||||
|
||||
public function deleteQuizQuestion(int $id): bool
|
||||
{
|
||||
return $this -> gw -> delete($id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
|
||||
use Entity\QuestionEntity;
|
||||
use Entity\QuizEntity;
|
||||
use Entity\QuizQuestionEntity;
|
||||
use Gateway\Connection;
|
||||
use Gateway\QuestionGateway;
|
||||
use Gateway\QuizGateway;
|
||||
use Gateway\QuizQuestionGateway;
|
||||
|
||||
class QuizQuestionModel
|
||||
{
|
||||
private QuizQuestionGateway $gw;
|
||||
|
||||
/**
|
||||
* @param QuizGateway $gw
|
||||
*/
|
||||
public function __construct(QuizQuestionGateway $gw)
|
||||
{
|
||||
$this->gw = $gw;
|
||||
}
|
||||
|
||||
public function createQuizQuestion(int $idQuiz, int $idQuestion): bool
|
||||
{
|
||||
return $this->gw->create($idQuiz,$idQuestion);
|
||||
}
|
||||
|
||||
public function findQuizQuestionByIdQuiz(int $id): ?QuizQuestionEntity
|
||||
{
|
||||
$q = $this ->gw->findQuizQuestionByIdQuiz($id);
|
||||
if ($q) {
|
||||
return new QuizQuestionEntity(
|
||||
$q['idQuiz'],
|
||||
$q['idQuestion'],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllQuestionByQuiz(int $id, Connection $co): array
|
||||
{
|
||||
$q = $this->gw->findQuestionsFromQuiz($id);
|
||||
|
||||
$questions = [];
|
||||
$gw = new QuestionGateway($co);
|
||||
$qmdl = new QuestionModel($gw);
|
||||
|
||||
foreach ($q as $question){
|
||||
$questions [] = $qmdl->getQuestion($question[1]);
|
||||
}
|
||||
|
||||
return $questions;
|
||||
}
|
||||
|
||||
public function findAll(): array
|
||||
{
|
||||
$q = $this -> gw -> findAll();
|
||||
|
||||
$quizzes = [];
|
||||
|
||||
foreach ($q as $quiz) {
|
||||
$quizzes[] = new QuizQuestionEntity(
|
||||
$quiz['idQuiz'],
|
||||
$quiz['idQuestion']
|
||||
);
|
||||
}
|
||||
return $quizzes;
|
||||
}
|
||||
|
||||
public function deleteQuizQuestion(int $id): bool
|
||||
{
|
||||
return $this -> gw -> delete($id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,96 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
|
||||
use Entity\ResultsEntity;
|
||||
use Gateway\ResultsGateway;
|
||||
|
||||
class ResultsModel
|
||||
{
|
||||
private ResultsGateway $gw;
|
||||
|
||||
public function __construct(ResultsGateway $gw)
|
||||
{
|
||||
$this -> gw = $gw;
|
||||
}
|
||||
|
||||
public function createResultsModel(int $idQuiz, int $idUser, int $score, int $time) : bool
|
||||
{
|
||||
return $this -> gw -> createResultsGateway($idQuiz, $idUser, $score, $time);
|
||||
}
|
||||
|
||||
public function getResultsByQuiz(int $idQuiz) : array
|
||||
{
|
||||
$res = $this -> gw -> findResultsByQuiz($idQuiz);
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ($res as $result)
|
||||
{
|
||||
$results[] = new ResultsEntity (
|
||||
$result['user_r'],
|
||||
$result['quiz_r'],
|
||||
$result['score'],
|
||||
$result['time']
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function getResultsByUser(int $idUser) : array
|
||||
{
|
||||
$res = $this -> gw -> findResultsByUser($idUser);
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ($res as $result)
|
||||
{
|
||||
$results[] = new ResultsEntity (
|
||||
$result['user_r'],
|
||||
$result['quiz_r'],
|
||||
$result['score'],
|
||||
$result['time']
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function getResultsById(int $idQuiz, int $idUser) : ?ResultsEntity
|
||||
{
|
||||
$res = $this -> gw -> findResultsById($idQuiz, $idUser);
|
||||
|
||||
if ($res)
|
||||
{
|
||||
return new ResultsEntity (
|
||||
$res['user_r'],
|
||||
$res['quiz_r'],
|
||||
$res['score'],
|
||||
$res['time']
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllResults() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllResults();
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ($res as $result)
|
||||
{
|
||||
$results[] = new ResultsEntity (
|
||||
$result['user_r'],
|
||||
$result['quiz_r'],
|
||||
$result['score'],
|
||||
$result['time']
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function updateResultsModel(int $idQuiz, int $idUser, ?int $score, ?int $time) : bool
|
||||
{
|
||||
return $this -> gw -> updateResults($idQuiz, $idUser, $score, $time);
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Model;
|
||||
|
||||
use Entity\ResultsEntity;
|
||||
use Gateway\ResultsGateway;
|
||||
|
||||
class ResultsModel
|
||||
{
|
||||
private ResultsGateway $gw;
|
||||
|
||||
public function __construct(ResultsGateway $gw)
|
||||
{
|
||||
$this -> gw = $gw;
|
||||
}
|
||||
|
||||
public function createResultsModel(int $idQuiz, int $idUser, int $score, int $time) : bool
|
||||
{
|
||||
return $this -> gw -> createResultsGateway($idQuiz, $idUser, $score, $time);
|
||||
}
|
||||
|
||||
public function getResultsByQuiz(int $idQuiz) : array
|
||||
{
|
||||
$res = $this -> gw -> findResultsByQuiz($idQuiz);
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ($res as $result)
|
||||
{
|
||||
$results[] = new ResultsEntity (
|
||||
$result['user_r'],
|
||||
$result['quiz_r'],
|
||||
$result['score'],
|
||||
$result['time']
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function getResultsByUser(int $idUser) : array
|
||||
{
|
||||
$res = $this -> gw -> findResultsByUser($idUser);
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ($res as $result)
|
||||
{
|
||||
$results[] = new ResultsEntity (
|
||||
$result['user_r'],
|
||||
$result['quiz_r'],
|
||||
$result['score'],
|
||||
$result['time']
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function getResultsById(int $idQuiz, int $idUser) : ?ResultsEntity
|
||||
{
|
||||
$res = $this -> gw -> findResultsById($idQuiz, $idUser);
|
||||
|
||||
if ($res)
|
||||
{
|
||||
return new ResultsEntity (
|
||||
$res['user_r'],
|
||||
$res['quiz_r'],
|
||||
$res['score'],
|
||||
$res['time']
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAllResults() : array
|
||||
{
|
||||
$res = $this -> gw -> findAllResults();
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ($res as $result)
|
||||
{
|
||||
$results[] = new ResultsEntity (
|
||||
$result['user_r'],
|
||||
$result['quiz_r'],
|
||||
$result['score'],
|
||||
$result['time']
|
||||
);
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function updateResultsModel(int $idQuiz, int $idUser, ?int $score, ?int $time) : bool
|
||||
{
|
||||
return $this -> gw -> updateResults($idQuiz, $idUser, $score, $time);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Model;
|
||||
use Entity\Quote;
|
||||
use Gateway\QuoteGateway;
|
||||
|
||||
class SearchModel
|
||||
{
|
||||
private QuoteGateway $gateway;
|
||||
|
||||
public function __construct(QuoteGateway $gate){
|
||||
$this->gateway = $gate;
|
||||
}
|
||||
|
||||
public function searchQuote(?string $type,?string $search,array $filtre): array{
|
||||
|
||||
$res = $this->gateway->search($type,$search,$filtre);
|
||||
$tabQ=[];
|
||||
|
||||
foreach($res as $q ){
|
||||
$tabQ[]= new Quote($q["id_quote"],$q["content"],$q["caracter"],$q["imgpath"],$q["title"],$q["dates"],$q["likes"],$q["langue"]) ;
|
||||
}
|
||||
return $tabQ;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,85 +1,85 @@
|
||||
<?php
|
||||
namespace Model;
|
||||
use Entity\SourceEntity;
|
||||
use Gateway\SourceGateway;
|
||||
|
||||
class SourceModel
|
||||
{
|
||||
|
||||
private sourceGateway $gateway;
|
||||
|
||||
public function __construct(SourceGateway $gateway)
|
||||
{
|
||||
$this -> gateway = $gateway;
|
||||
}
|
||||
|
||||
public function createSource(int $id_source, string $title, string $date) : bool
|
||||
{
|
||||
$q = new SourceEntity($id_source , $title, $date);
|
||||
|
||||
return $this -> gateway -> create($q);
|
||||
}
|
||||
|
||||
public function getSourceById(int $id_source) : ?SourceEntity
|
||||
{
|
||||
$res = $this -> gateway -> findById($id_source);
|
||||
|
||||
if ($res)
|
||||
return new sourceEntity(
|
||||
$res[0]["id_source"],
|
||||
$res[0]["title"],
|
||||
$res[0]["date"]
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getSourceByTitle(string $title) : array
|
||||
{
|
||||
$res = $this->gateway->findByTitle($title);
|
||||
foreach ($res as $sources) {
|
||||
$src[] = new sourceEntity(
|
||||
$sources["id_source"],
|
||||
$sources["title"],
|
||||
$sources["date"]
|
||||
);
|
||||
}
|
||||
return $src;
|
||||
}
|
||||
|
||||
public function getSourceByDate(string $date) : array
|
||||
{
|
||||
$res = $this->gateway->findByDate($date);
|
||||
foreach ($res as $sources) {
|
||||
$src[] = new sourceEntity(
|
||||
$sources["id_source"],
|
||||
$sources["title"],
|
||||
$sources["date"]
|
||||
);
|
||||
}
|
||||
return $src;
|
||||
}
|
||||
|
||||
public function getSources() : array
|
||||
{
|
||||
return $this -> gateway -> findAll();
|
||||
}
|
||||
|
||||
public function deleteSource(int $id_source) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_source);
|
||||
}
|
||||
|
||||
public function updateSource(int $id_source, string $title, string $date) : bool
|
||||
{
|
||||
$q = $this -> getSourceById($id_source);
|
||||
|
||||
if ($q){
|
||||
$q -> setTitle($title);
|
||||
$q -> setDate($date);
|
||||
return $this -> gateway -> update($q);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
namespace Model;
|
||||
use Entity\SourceEntity;
|
||||
use Gateway\SourceGateway;
|
||||
|
||||
class SourceModel
|
||||
{
|
||||
|
||||
private sourceGateway $gateway;
|
||||
|
||||
public function __construct(SourceGateway $gateway)
|
||||
{
|
||||
$this -> gateway = $gateway;
|
||||
}
|
||||
|
||||
public function createSource(int $id_source, string $title, string $date) : bool
|
||||
{
|
||||
$q = new SourceEntity($id_source , $title, $date);
|
||||
|
||||
return $this -> gateway -> create($q);
|
||||
}
|
||||
|
||||
public function getSourceById(int $id_source) : ?SourceEntity
|
||||
{
|
||||
$res = $this -> gateway -> findById($id_source);
|
||||
|
||||
if ($res)
|
||||
return new sourceEntity(
|
||||
$res[0]["id_source"],
|
||||
$res[0]["title"],
|
||||
$res[0]["date"]
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getSourceByTitle(string $title) : array
|
||||
{
|
||||
$res = $this->gateway->findByTitle($title);
|
||||
foreach ($res as $sources) {
|
||||
$src[] = new sourceEntity(
|
||||
$sources["id_source"],
|
||||
$sources["title"],
|
||||
$sources["date"]
|
||||
);
|
||||
}
|
||||
return $src;
|
||||
}
|
||||
|
||||
public function getSourceByDate(string $date) : array
|
||||
{
|
||||
$res = $this->gateway->findByDate($date);
|
||||
foreach ($res as $sources) {
|
||||
$src[] = new sourceEntity(
|
||||
$sources["id_source"],
|
||||
$sources["title"],
|
||||
$sources["date"]
|
||||
);
|
||||
}
|
||||
return $src;
|
||||
}
|
||||
|
||||
public function getSources() : array
|
||||
{
|
||||
return $this -> gateway -> findAll();
|
||||
}
|
||||
|
||||
public function deleteSource(int $id_source) : bool
|
||||
{
|
||||
return $this -> gateway -> delete($id_source);
|
||||
}
|
||||
|
||||
public function updateSource(int $id_source, string $title, string $date) : bool
|
||||
{
|
||||
$q = $this -> getSourceById($id_source);
|
||||
|
||||
if ($q){
|
||||
$q -> setTitle($title);
|
||||
$q -> setDate($date);
|
||||
return $this -> gateway -> update($q);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,302 +1,302 @@
|
||||
<?php
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
class AltoRouter
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array Array of all routes (incl. named routes).
|
||||
*/
|
||||
protected $routes = [];
|
||||
|
||||
/**
|
||||
* @var array Array of all named routes.
|
||||
*/
|
||||
protected $namedRoutes = [];
|
||||
|
||||
/**
|
||||
* @var string Can be used to ignore leading part of the Request URL (if main file lives in subdirectory of host)
|
||||
*/
|
||||
protected $basePath = '';
|
||||
|
||||
/**
|
||||
* @var array Array of default match types (regex helpers)
|
||||
*/
|
||||
protected $matchTypes = [
|
||||
'i' => '[0-9]++',
|
||||
'a' => '[0-9A-Za-z]++',
|
||||
'h' => '[0-9A-Fa-f]++',
|
||||
'*' => '.+?',
|
||||
'**' => '.++',
|
||||
'' => '[^/\.]++'
|
||||
];
|
||||
|
||||
/**
|
||||
* Create router in one call from config.
|
||||
*
|
||||
* @param array $routes
|
||||
* @param string $basePath
|
||||
* @param array $matchTypes
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct(array $routes = [], $basePath = '', array $matchTypes = [])
|
||||
{
|
||||
$this->addRoutes($routes);
|
||||
$this->setBasePath($basePath);
|
||||
$this->addMatchTypes($matchTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all routes.
|
||||
* Useful if you want to process or display routes.
|
||||
* @return array All routes.
|
||||
*/
|
||||
public function getRoutes()
|
||||
{
|
||||
return $this->routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple routes at once from array in the following format:
|
||||
*
|
||||
* $routes = [
|
||||
* [$method, $route, $target, $name]
|
||||
* ];
|
||||
*
|
||||
* @param array $routes
|
||||
* @return void
|
||||
* @author Koen Punt
|
||||
* @throws Exception
|
||||
*/
|
||||
public function addRoutes($routes)
|
||||
{
|
||||
if (!is_array($routes) && !$routes instanceof Traversable) {
|
||||
throw new RuntimeException('Routes should be an array or an instance of Traversable');
|
||||
}
|
||||
foreach ($routes as $route) {
|
||||
call_user_func_array([$this, 'map'], $route);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base path.
|
||||
* Useful if you are running your application from a subdirectory.
|
||||
* @param string $basePath
|
||||
*/
|
||||
public function setBasePath($basePath)
|
||||
{
|
||||
$this->basePath = $basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add named match types. It uses array_merge so keys can be overwritten.
|
||||
*
|
||||
* @param array $matchTypes The key is the name and the value is the regex.
|
||||
*/
|
||||
public function addMatchTypes(array $matchTypes)
|
||||
{
|
||||
$this->matchTypes = array_merge($this->matchTypes, $matchTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map a route to a target
|
||||
*
|
||||
* @param string $method One of 5 HTTP Methods, or a pipe-separated list of multiple HTTP Methods (GET|POST|PATCH|PUT|DELETE)
|
||||
* @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
|
||||
* @param mixed $target The target where this route should point to. Can be anything.
|
||||
* @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function map($method, $route, $target, $name = null)
|
||||
{
|
||||
|
||||
$this->routes[] = [$method, $route, $target, $name];
|
||||
|
||||
if ($name) {
|
||||
if (isset($this->namedRoutes[$name])) {
|
||||
throw new RuntimeException("Can not redeclare route '{$name}'");
|
||||
}
|
||||
$this->namedRoutes[$name] = $route;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reversed routing
|
||||
*
|
||||
* Generate the URL for a named route. Replace regexes with supplied parameters
|
||||
*
|
||||
* @param string $routeName The name of the route.
|
||||
* @param array @params Associative array of parameters to replace placeholders with.
|
||||
* @return string The URL of the route with named parameters in place.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function generate($routeName, array $params = [])
|
||||
{
|
||||
|
||||
// Check if named route exists
|
||||
if (!isset($this->namedRoutes[$routeName])) {
|
||||
throw new RuntimeException("Route '{$routeName}' does not exist.");
|
||||
}
|
||||
|
||||
// Replace named parameters
|
||||
$route = $this->namedRoutes[$routeName];
|
||||
|
||||
// prepend base path to route url again
|
||||
$url = $this->basePath . $route;
|
||||
|
||||
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $index => $match) {
|
||||
list($block, $pre, $type, $param, $optional) = $match;
|
||||
|
||||
if ($pre) {
|
||||
$block = substr($block, 1);
|
||||
}
|
||||
|
||||
if (isset($params[$param])) {
|
||||
// Part is found, replace for param value
|
||||
$url = str_replace($block, $params[$param], $url);
|
||||
} elseif ($optional && $index !== 0) {
|
||||
// Only strip preceding slash if it's not at the base
|
||||
$url = str_replace($pre . $block, '', $url);
|
||||
} else {
|
||||
// Strip match block
|
||||
$url = str_replace($block, '', $url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Match a given Request Url against stored routes
|
||||
* @param string $requestUrl
|
||||
* @param string $requestMethod
|
||||
* @return array|boolean Array with route information on success, false on failure (no match).
|
||||
*/
|
||||
public function match($requestUrl = null, $requestMethod = null)
|
||||
{
|
||||
|
||||
$params = [];
|
||||
|
||||
// set Request Url if it isn't passed as parameter
|
||||
if ($requestUrl === null) {
|
||||
$requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
|
||||
}
|
||||
|
||||
// strip base path from request url
|
||||
$requestUrl = substr($requestUrl, strlen($this->basePath));
|
||||
|
||||
// Strip query string (?a=b) from Request Url
|
||||
if (($strpos = strpos($requestUrl, '?')) !== false) {
|
||||
$requestUrl = substr($requestUrl, 0, $strpos);
|
||||
}
|
||||
|
||||
$lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';
|
||||
|
||||
// set Request Method if it isn't passed as a parameter
|
||||
if ($requestMethod === null) {
|
||||
$requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
|
||||
}
|
||||
|
||||
foreach ($this->routes as $handler) {
|
||||
list($methods, $route, $target, $name) = $handler;
|
||||
|
||||
$method_match = (stripos($methods, $requestMethod) !== false);
|
||||
|
||||
// Method did not match, continue to next route.
|
||||
if (!$method_match) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($route === '*') {
|
||||
// * wildcard (matches all)
|
||||
$match = true;
|
||||
} elseif (isset($route[0]) && $route[0] === '@') {
|
||||
// @ regex delimiter
|
||||
$pattern = '`' . substr($route, 1) . '`u';
|
||||
$match = preg_match($pattern, $requestUrl, $params) === 1;
|
||||
} elseif (($position = strpos($route, '[')) === false) {
|
||||
// No params in url, do string comparison
|
||||
$match = strcmp($requestUrl, $route) === 0;
|
||||
} else {
|
||||
// Compare longest non-param string with url before moving on to regex
|
||||
// Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)
|
||||
if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$regex = $this->compileRoute($route);
|
||||
$match = preg_match($regex, $requestUrl, $params) === 1;
|
||||
}
|
||||
|
||||
if ($match) {
|
||||
if ($params) {
|
||||
foreach ($params as $key => $value) {
|
||||
if (is_numeric($key)) {
|
||||
unset($params[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'target' => $target,
|
||||
'params' => $params,
|
||||
'name' => $name
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile the regex for a given route (EXPENSIVE)
|
||||
* @param $route
|
||||
* @return string
|
||||
*/
|
||||
protected function compileRoute($route)
|
||||
{
|
||||
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||
$matchTypes = $this->matchTypes;
|
||||
foreach ($matches as $match) {
|
||||
list($block, $pre, $type, $param, $optional) = $match;
|
||||
|
||||
if (isset($matchTypes[$type])) {
|
||||
$type = $matchTypes[$type];
|
||||
}
|
||||
if ($pre === '.') {
|
||||
$pre = '\.';
|
||||
}
|
||||
|
||||
$optional = $optional !== '' ? '?' : null;
|
||||
|
||||
//Older versions of PCRE require the 'P' in (?P<named>)
|
||||
$pattern = '(?:'
|
||||
. ($pre !== '' ? $pre : null)
|
||||
. '('
|
||||
. ($param !== '' ? "?P<$param>" : null)
|
||||
. $type
|
||||
. ')'
|
||||
. $optional
|
||||
. ')'
|
||||
. $optional;
|
||||
|
||||
$route = str_replace($block, $pattern, $route);
|
||||
}
|
||||
}
|
||||
return "`^$route$`u";
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
class AltoRouter
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array Array of all routes (incl. named routes).
|
||||
*/
|
||||
protected $routes = [];
|
||||
|
||||
/**
|
||||
* @var array Array of all named routes.
|
||||
*/
|
||||
protected $namedRoutes = [];
|
||||
|
||||
/**
|
||||
* @var string Can be used to ignore leading part of the Request URL (if main file lives in subdirectory of host)
|
||||
*/
|
||||
protected $basePath = '';
|
||||
|
||||
/**
|
||||
* @var array Array of default match types (regex helpers)
|
||||
*/
|
||||
protected $matchTypes = [
|
||||
'i' => '[0-9]++',
|
||||
'a' => '[0-9A-Za-z]++',
|
||||
'h' => '[0-9A-Fa-f]++',
|
||||
'*' => '.+?',
|
||||
'**' => '.++',
|
||||
'' => '[^/\.]++'
|
||||
];
|
||||
|
||||
/**
|
||||
* Create router in one call from config.
|
||||
*
|
||||
* @param array $routes
|
||||
* @param string $basePath
|
||||
* @param array $matchTypes
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct(array $routes = [], $basePath = '', array $matchTypes = [])
|
||||
{
|
||||
$this->addRoutes($routes);
|
||||
$this->setBasePath($basePath);
|
||||
$this->addMatchTypes($matchTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all routes.
|
||||
* Useful if you want to process or display routes.
|
||||
* @return array All routes.
|
||||
*/
|
||||
public function getRoutes()
|
||||
{
|
||||
return $this->routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple routes at once from array in the following format:
|
||||
*
|
||||
* $routes = [
|
||||
* [$method, $route, $target, $name]
|
||||
* ];
|
||||
*
|
||||
* @param array $routes
|
||||
* @return void
|
||||
* @author Koen Punt
|
||||
* @throws Exception
|
||||
*/
|
||||
public function addRoutes($routes)
|
||||
{
|
||||
if (!is_array($routes) && !$routes instanceof Traversable) {
|
||||
throw new RuntimeException('Routes should be an array or an instance of Traversable');
|
||||
}
|
||||
foreach ($routes as $route) {
|
||||
call_user_func_array([$this, 'map'], $route);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base path.
|
||||
* Useful if you are running your application from a subdirectory.
|
||||
* @param string $basePath
|
||||
*/
|
||||
public function setBasePath($basePath)
|
||||
{
|
||||
$this->basePath = $basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add named match types. It uses array_merge so keys can be overwritten.
|
||||
*
|
||||
* @param array $matchTypes The key is the name and the value is the regex.
|
||||
*/
|
||||
public function addMatchTypes(array $matchTypes)
|
||||
{
|
||||
$this->matchTypes = array_merge($this->matchTypes, $matchTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map a route to a target
|
||||
*
|
||||
* @param string $method One of 5 HTTP Methods, or a pipe-separated list of multiple HTTP Methods (GET|POST|PATCH|PUT|DELETE)
|
||||
* @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
|
||||
* @param mixed $target The target where this route should point to. Can be anything.
|
||||
* @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function map($method, $route, $target, $name = null)
|
||||
{
|
||||
|
||||
$this->routes[] = [$method, $route, $target, $name];
|
||||
|
||||
if ($name) {
|
||||
if (isset($this->namedRoutes[$name])) {
|
||||
throw new RuntimeException("Can not redeclare route '{$name}'");
|
||||
}
|
||||
$this->namedRoutes[$name] = $route;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reversed routing
|
||||
*
|
||||
* Generate the URL for a named route. Replace regexes with supplied parameters
|
||||
*
|
||||
* @param string $routeName The name of the route.
|
||||
* @param array @params Associative array of parameters to replace placeholders with.
|
||||
* @return string The URL of the route with named parameters in place.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function generate($routeName, array $params = [])
|
||||
{
|
||||
|
||||
// Check if named route exists
|
||||
if (!isset($this->namedRoutes[$routeName])) {
|
||||
throw new RuntimeException("Route '{$routeName}' does not exist.");
|
||||
}
|
||||
|
||||
// Replace named parameters
|
||||
$route = $this->namedRoutes[$routeName];
|
||||
|
||||
// prepend base path to route url again
|
||||
$url = $this->basePath . $route;
|
||||
|
||||
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $index => $match) {
|
||||
list($block, $pre, $type, $param, $optional) = $match;
|
||||
|
||||
if ($pre) {
|
||||
$block = substr($block, 1);
|
||||
}
|
||||
|
||||
if (isset($params[$param])) {
|
||||
// Part is found, replace for param value
|
||||
$url = str_replace($block, $params[$param], $url);
|
||||
} elseif ($optional && $index !== 0) {
|
||||
// Only strip preceding slash if it's not at the base
|
||||
$url = str_replace($pre . $block, '', $url);
|
||||
} else {
|
||||
// Strip match block
|
||||
$url = str_replace($block, '', $url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Match a given Request Url against stored routes
|
||||
* @param string $requestUrl
|
||||
* @param string $requestMethod
|
||||
* @return array|boolean Array with route information on success, false on failure (no match).
|
||||
*/
|
||||
public function match($requestUrl = null, $requestMethod = null)
|
||||
{
|
||||
|
||||
$params = [];
|
||||
|
||||
// set Request Url if it isn't passed as parameter
|
||||
if ($requestUrl === null) {
|
||||
$requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
|
||||
}
|
||||
|
||||
// strip base path from request url
|
||||
$requestUrl = substr($requestUrl, strlen($this->basePath));
|
||||
|
||||
// Strip query string (?a=b) from Request Url
|
||||
if (($strpos = strpos($requestUrl, '?')) !== false) {
|
||||
$requestUrl = substr($requestUrl, 0, $strpos);
|
||||
}
|
||||
|
||||
$lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';
|
||||
|
||||
// set Request Method if it isn't passed as a parameter
|
||||
if ($requestMethod === null) {
|
||||
$requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
|
||||
}
|
||||
|
||||
foreach ($this->routes as $handler) {
|
||||
list($methods, $route, $target, $name) = $handler;
|
||||
|
||||
$method_match = (stripos($methods, $requestMethod) !== false);
|
||||
|
||||
// Method did not match, continue to next route.
|
||||
if (!$method_match) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($route === '*') {
|
||||
// * wildcard (matches all)
|
||||
$match = true;
|
||||
} elseif (isset($route[0]) && $route[0] === '@') {
|
||||
// @ regex delimiter
|
||||
$pattern = '`' . substr($route, 1) . '`u';
|
||||
$match = preg_match($pattern, $requestUrl, $params) === 1;
|
||||
} elseif (($position = strpos($route, '[')) === false) {
|
||||
// No params in url, do string comparison
|
||||
$match = strcmp($requestUrl, $route) === 0;
|
||||
} else {
|
||||
// Compare longest non-param string with url before moving on to regex
|
||||
// Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)
|
||||
if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$regex = $this->compileRoute($route);
|
||||
$match = preg_match($regex, $requestUrl, $params) === 1;
|
||||
}
|
||||
|
||||
if ($match) {
|
||||
if ($params) {
|
||||
foreach ($params as $key => $value) {
|
||||
if (is_numeric($key)) {
|
||||
unset($params[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'target' => $target,
|
||||
'params' => $params,
|
||||
'name' => $name
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile the regex for a given route (EXPENSIVE)
|
||||
* @param $route
|
||||
* @return string
|
||||
*/
|
||||
protected function compileRoute($route)
|
||||
{
|
||||
if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
|
||||
$matchTypes = $this->matchTypes;
|
||||
foreach ($matches as $match) {
|
||||
list($block, $pre, $type, $param, $optional) = $match;
|
||||
|
||||
if (isset($matchTypes[$type])) {
|
||||
$type = $matchTypes[$type];
|
||||
}
|
||||
if ($pre === '.') {
|
||||
$pre = '\.';
|
||||
}
|
||||
|
||||
$optional = $optional !== '' ? '?' : null;
|
||||
|
||||
//Older versions of PCRE require the 'P' in (?P<named>)
|
||||
$pattern = '(?:'
|
||||
. ($pre !== '' ? $pre : null)
|
||||
. '('
|
||||
. ($param !== '' ? "?P<$param>" : null)
|
||||
. $type
|
||||
. ')'
|
||||
. $optional
|
||||
. ')'
|
||||
. $optional;
|
||||
|
||||
$route = str_replace($block, $pattern, $route);
|
||||
}
|
||||
}
|
||||
return "`^$route$`u";
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -1,56 +1,56 @@
|
||||
# AltoRouter [](https://travis-ci.org/dannyvankooten/AltoRouter) [](https://packagist.org/packages/altorouter/altorouter) [](https://packagist.org/packages/altorouter/altorouter) [](https://codeclimate.com/github/dannyvankooten/AltoRouter) [](https://codeclimate.com/github/dannyvankooten/AltoRouter)
|
||||
AltoRouter is a small but powerful routing class, heavily inspired by [klein.php](https://github.com/chriso/klein.php/).
|
||||
|
||||
```php
|
||||
$router = new AltoRouter();
|
||||
|
||||
// map homepage
|
||||
$router->map('GET', '/', function() {
|
||||
require __DIR__ . '/views/home.php';
|
||||
});
|
||||
|
||||
// dynamic named route
|
||||
$router->map('GET|POST', '/users/[i:id]/', function($id) {
|
||||
$user = .....
|
||||
require __DIR__ . '/views/user/details.php';
|
||||
}, 'user-details');
|
||||
|
||||
// echo URL to user-details page for ID 5
|
||||
echo $router->generate('user-details', ['id' => 5]); // Output: "/users/5"
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* Can be used with all HTTP Methods
|
||||
* Dynamic routing with named route parameters
|
||||
* Reversed routing
|
||||
* Flexible regular expression routing (inspired by [Sinatra](http://www.sinatrarb.com/))
|
||||
* Custom regexes
|
||||
|
||||
## Getting started
|
||||
|
||||
You need PHP >= 5.6 to use AltoRouter, although we highly recommend you [use an officially supported PHP version](https://secure.php.net/supported-versions.php) that is not EOL.
|
||||
|
||||
- [Install AltoRouter](http://altorouter.com/usage/install.html)
|
||||
- [Rewrite all requests to AltoRouter](http://altorouter.com/usage/rewrite-requests.html)
|
||||
- [Map your routes](http://altorouter.com/usage/mapping-routes.html)
|
||||
- [Match requests](http://altorouter.com/usage/matching-requests.html)
|
||||
- [Process the request your preferred way](http://altorouter.com/usage/processing-requests.html)
|
||||
|
||||
## Contributors
|
||||
- [Danny van Kooten](https://github.com/dannyvankooten)
|
||||
- [Koen Punt](https://github.com/koenpunt)
|
||||
- [John Long](https://github.com/adduc)
|
||||
- [Niahoo Osef](https://github.com/niahoo)
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
# AltoRouter [](https://travis-ci.org/dannyvankooten/AltoRouter) [](https://packagist.org/packages/altorouter/altorouter) [](https://packagist.org/packages/altorouter/altorouter) [](https://codeclimate.com/github/dannyvankooten/AltoRouter) [](https://codeclimate.com/github/dannyvankooten/AltoRouter)
|
||||
AltoRouter is a small but powerful routing class, heavily inspired by [klein.php](https://github.com/chriso/klein.php/).
|
||||
|
||||
```php
|
||||
$router = new AltoRouter();
|
||||
|
||||
// map homepage
|
||||
$router->map('GET', '/', function() {
|
||||
require __DIR__ . '/views/home.php';
|
||||
});
|
||||
|
||||
// dynamic named route
|
||||
$router->map('GET|POST', '/users/[i:id]/', function($id) {
|
||||
$user = .....
|
||||
require __DIR__ . '/views/user/details.php';
|
||||
}, 'user-details');
|
||||
|
||||
// echo URL to user-details page for ID 5
|
||||
echo $router->generate('user-details', ['id' => 5]); // Output: "/users/5"
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* Can be used with all HTTP Methods
|
||||
* Dynamic routing with named route parameters
|
||||
* Reversed routing
|
||||
* Flexible regular expression routing (inspired by [Sinatra](http://www.sinatrarb.com/))
|
||||
* Custom regexes
|
||||
|
||||
## Getting started
|
||||
|
||||
You need PHP >= 5.6 to use AltoRouter, although we highly recommend you [use an officially supported PHP version](https://secure.php.net/supported-versions.php) that is not EOL.
|
||||
|
||||
- [Install AltoRouter](http://altorouter.com/usage/install.html)
|
||||
- [Rewrite all requests to AltoRouter](http://altorouter.com/usage/rewrite-requests.html)
|
||||
- [Map your routes](http://altorouter.com/usage/mapping-routes.html)
|
||||
- [Match requests](http://altorouter.com/usage/matching-requests.html)
|
||||
- [Process the request your preferred way](http://altorouter.com/usage/processing-requests.html)
|
||||
|
||||
## Contributors
|
||||
- [Danny van Kooten](https://github.com/dannyvankooten)
|
||||
- [Koen Punt](https://github.com/koenpunt)
|
||||
- [John Long](https://github.com/adduc)
|
||||
- [Niahoo Osef](https://github.com/niahoo)
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2012 Danny van Kooten <hi@dannyvankooten.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
@ -1,36 +1,36 @@
|
||||
{
|
||||
"name": "altorouter/altorouter",
|
||||
"description": "A lightning fast router for PHP",
|
||||
"keywords": ["router", "routing", "lightweight"],
|
||||
"homepage": "https://github.com/dannyvankooten/AltoRouter",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Danny van Kooten",
|
||||
"email": "dannyvankooten@gmail.com",
|
||||
"homepage": "http://dannyvankooten.com/"
|
||||
},
|
||||
{
|
||||
"name": "Koen Punt",
|
||||
"homepage": "https://github.com/koenpunt"
|
||||
},
|
||||
{
|
||||
"name": "niahoo",
|
||||
"homepage": "https://github.com/niahoo"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "5.7.*",
|
||||
"codeclimate/php-test-reporter": "dev-master",
|
||||
"squizlabs/php_codesniffer": "3.4.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["AltoRouter.php"]
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/phpunit"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "altorouter/altorouter",
|
||||
"description": "A lightning fast router for PHP",
|
||||
"keywords": ["router", "routing", "lightweight"],
|
||||
"homepage": "https://github.com/dannyvankooten/AltoRouter",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Danny van Kooten",
|
||||
"email": "dannyvankooten@gmail.com",
|
||||
"homepage": "http://dannyvankooten.com/"
|
||||
},
|
||||
{
|
||||
"name": "Koen Punt",
|
||||
"homepage": "https://github.com/koenpunt"
|
||||
},
|
||||
{
|
||||
"name": "niahoo",
|
||||
"homepage": "https://github.com/niahoo"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "5.7.*",
|
||||
"codeclimate/php-test-reporter": "dev-master",
|
||||
"squizlabs/php_codesniffer": "3.4.2"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["AltoRouter.php"]
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vendor/bin/phpunit"
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="rules">
|
||||
<description>rules</description>
|
||||
<rule ref="PSR2"/>
|
||||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
||||
<file>tests</file>
|
||||
<file>AltoRouter.php</file>
|
||||
<file>examples/</file>
|
||||
<arg name="colors"/>
|
||||
</ruleset>
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="rules">
|
||||
<description>rules</description>
|
||||
<rule ref="PSR2"/>
|
||||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
||||
<file>tests</file>
|
||||
<file>AltoRouter.php</file>
|
||||
<file>examples/</file>
|
||||
<arg name="colors"/>
|
||||
</ruleset>
|
||||
|
@ -1,25 +1,25 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit68804b2111cb6b8bf6edf66cb2b4669c::getLoader();
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit68804b2111cb6b8bf6edf66cb2b4669c::getLoader();
|
||||
|
@ -1,359 +1,359 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,21 @@
|
||||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'AltoRouter' => $vendorDir . '/altorouter/altorouter/AltoRouter.php',
|
||||
'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
|
||||
);
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'AltoRouter' => $vendorDir . '/altorouter/altorouter/AltoRouter.php',
|
||||
'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
|
||||
);
|
||||
|
@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php',
|
||||
'89efb1254ef2d1c5d80096acd12c4098' => $vendorDir . '/twig/twig/src/Resources/core.php',
|
||||
'ffecb95d45175fd40f75be8a23b34f90' => $vendorDir . '/twig/twig/src/Resources/debug.php',
|
||||
'c7baa00073ee9c61edf148c51917cfb4' => $vendorDir . '/twig/twig/src/Resources/escaper.php',
|
||||
'f844ccf1d25df8663951193c3fc307c8' => $vendorDir . '/twig/twig/src/Resources/string_loader.php',
|
||||
);
|
||||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php',
|
||||
'89efb1254ef2d1c5d80096acd12c4098' => $vendorDir . '/twig/twig/src/Resources/core.php',
|
||||
'ffecb95d45175fd40f75be8a23b34f90' => $vendorDir . '/twig/twig/src/Resources/debug.php',
|
||||
'c7baa00073ee9c61edf148c51917cfb4' => $vendorDir . '/twig/twig/src/Resources/escaper.php',
|
||||
'f844ccf1d25df8663951193c3fc307c8' => $vendorDir . '/twig/twig/src/Resources/string_loader.php',
|
||||
);
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
|