backup du projet

This commit is contained in:
Yasder5
2026-02-26 00:19:11 +01:00
commit 4655c05be6
670 changed files with 87655 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
/templates_c/
/templates_c/**
.env

0
assests/.gitkeep Normal file
View File

115
assests/css/style.css Normal file
View File

@@ -0,0 +1,115 @@
*{
margin: 0;
padding: 0;
}
body {
background-color: #f5f5f5;
}
.navbar {
background-color: #ffffff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 0.8rem 2rem;
}
.navbar-brand {
font-size: 1.5rem;
font-weight: bold;
color: #0d6efd !important;
}
.navbar-brand span {
color: #6c757d;
}
.navbar-nav .nav-link {
color: #333;
font-weight: 500;
padding: 0.5rem 1rem;
margin: 0 0.2rem;
transition: color 0.3s;
}
.navbar-nav .nav-link:hover {
color: #0d6efd;
}
.btn-login {
color: #333;
background-color: transparent;
border: none;
font-weight: 500;
padding: 0.5rem 1rem;
}
.btn-login:hover {
color: #0d6efd;
}
.btn-signup {
background-color: #0d6efd;
color: white;
border: none;
border-radius: 25px;
padding: 0.5rem 2rem;
font-weight: 500;
transition: background-color 0.3s;
}
.btn-signup:hover {
background-color: #0b5ed7;
}
.notification-bell {
font-size: 1.2rem;
color: #6c757d;
margin-right: 1rem;
cursor: pointer;
transition: color 0.3s;
}
.notification-bell:hover {
color: #0d6efd;
}
.logo-image {
height: 30px;
width: auto;
margin-right: 0.5rem;
}
.logo{
font-size: 5rem;
font-weight: 700;
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.article-card {
height: 400px;
}
.article-img {
height: 50px;
width: 100%;
overflow: hidden;
}
.article-content {
height: 20%;
padding: 0.75rem;
}
.footer{
color: white;
background-color: #0000ff;
}
.footer ul{
list-style: none;
}
.footer a{
text-decoration: none;
color: white;
}

11243
assests/css/styles.css Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,89 @@
<svg width="2130" height="558" viewBox="0 0 2130 558" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M510.224 203.704C544.762 203.704 574.076 210.742 598.169 224.819C622.259 238.897 640.595 258.304 653.173 283.045C665.754 307.784 672.041 336.152 672.041 368.145V390.217C672.041 424.557 665.754 454.309 653.173 479.477C640.595 504.642 622.259 524.052 598.169 537.703C574.076 551.141 544.762 557.857 510.224 557.857C475.685 557.857 446.263 551.141 421.957 537.703C397.868 524.052 379.426 504.75 366.635 479.796C354.054 454.628 347.767 424.875 347.767 390.538V368.784C347.767 336.792 354.054 308.427 366.635 283.685C379.426 258.73 397.868 239.216 421.957 225.139C446.263 210.848 475.685 203.704 510.224 203.704ZM509.903 279.845C495.619 279.845 484.107 283.898 475.367 292.004C466.837 299.894 460.654 310.558 456.817 323.996C452.98 337.218 451.061 351.722 451.061 367.505V393.418C451.061 408.135 452.875 422.212 456.499 435.647C460.336 449.085 466.518 460.068 475.046 468.6C483.786 477.13 495.406 481.399 509.903 481.399C524.615 481.399 536.235 477.238 544.762 468.918C553.29 460.389 559.367 449.404 562.991 435.968C566.828 422.53 568.747 408.348 568.747 393.418V367.505C568.747 351.722 566.828 337.218 562.991 323.996C559.154 310.558 552.968 299.894 544.441 292.004C535.914 283.898 524.402 279.845 509.903 279.845ZM735.362 551.459V91.7314H837.378V551.459H735.362ZM917.648 551.459V91.7314H1019.66V551.459H917.648ZM1100.57 551.459V209.782H1202.59V551.459H1100.57ZM1096.42 123.723C1096.42 108.58 1101.85 96.5308 1112.73 87.5724C1123.6 78.6145 1136.6 74.1357 1151.74 74.1357C1166.88 74.1357 1179.78 78.6145 1190.44 87.5724C1201.31 96.5308 1206.75 108.58 1206.75 123.723C1206.75 138.867 1201.31 151.024 1190.44 160.195C1179.78 169.366 1166.88 173.951 1151.74 173.951C1136.6 173.951 1123.6 169.366 1112.73 160.195C1101.85 151.024 1096.42 138.867 1096.42 123.723ZM1429.33 203.704C1463.86 203.704 1493.18 210.742 1517.27 224.819C1541.36 238.897 1559.7 258.304 1572.28 283.045C1584.86 307.784 1591.15 336.152 1591.15 368.145V390.217C1591.15 424.557 1584.86 454.309 1572.28 479.477C1559.7 504.642 1541.36 524.052 1517.27 537.703C1493.18 551.141 1463.86 557.857 1429.33 557.857C1394.79 557.857 1365.36 551.141 1341.06 537.703C1316.97 524.052 1298.53 504.75 1285.74 479.796C1273.16 454.628 1266.87 424.875 1266.87 390.538V368.784C1266.87 336.792 1273.16 308.427 1285.74 283.685C1298.53 258.73 1316.97 239.216 1341.06 225.139C1365.36 210.848 1394.79 203.704 1429.33 203.704ZM1429 279.845C1414.72 279.845 1403.21 283.898 1394.47 292.004C1385.94 299.894 1379.76 310.558 1375.92 323.996C1372.08 337.218 1370.16 351.722 1370.16 367.505V393.418C1370.16 408.135 1371.98 422.212 1375.6 435.647C1379.44 449.085 1385.62 460.068 1394.15 468.6C1402.89 477.13 1414.51 481.399 1429 481.399C1443.72 481.399 1455.34 477.238 1463.86 468.918C1472.39 460.389 1478.47 449.404 1482.09 435.968C1485.93 422.53 1487.85 408.348 1487.85 393.418V367.505C1487.85 351.722 1485.93 337.218 1482.09 323.996C1478.26 310.558 1472.07 299.894 1463.54 292.004C1455.02 283.898 1443.5 279.845 1429 279.845ZM2130 209.782L2043.33 551.459H1935.25L1877.04 320.475H1873.52L1815.33 551.459H1706.28L1620.25 209.782H1723.23L1766.72 451.322H1770.87L1827.79 209.782H1923.41L1980.66 451.322H1984.81L2028.3 209.782H2130Z" fill="url(#paint0_linear_323_447)"/>
<path d="M0 139.789L208.446 0H348.766L139.032 139.789H0Z" fill="url(#paint1_linear_323_447)"/>
<path d="M139.137 139.548L348.755 0L313.88 139.548H139.137Z" fill="url(#paint2_linear_323_447)"/>
<path d="M209.253 0L0.000366211 139.548L0.000366216 0H209.253Z" fill="url(#paint3_linear_323_447)"/>
<path d="M0.000732422 418.644L0.000732613 279.096H140.987L0.000732422 418.644Z" fill="url(#paint4_linear_323_447)"/>
<path d="M0 418.639L137.27 279.004L279.013 278.968L138.779 418.639H0Z" fill="url(#paint5_linear_323_447)"/>
<path d="M278.909 279.096L244.683 418.644H138.754L278.909 279.096Z" fill="url(#paint6_linear_323_447)"/>
<path d="M0 139.458H138.76V279.006L0 139.458Z" fill="url(#paint7_linear_323_447)"/>
<path d="M0 418.452H138.76V558L0 418.452Z" fill="url(#paint8_linear_323_447)"/>
<path d="M0 420.379L135.518 282.525L275.453 282.489L137.008 420.379H0Z" fill="url(#paint9_linear_323_447)"/>
<path d="M0 145.086L205.787 7.08105H344.316L137.258 145.086H0Z" fill="url(#paint10_linear_323_447)"/>
<path d="M137.362 144.849L344.305 7.08105L309.875 144.849H137.362Z" fill="url(#paint11_linear_323_447)"/>
<path d="M206.584 7.08105L0.000732422 144.849L0.000732427 7.08105H206.584Z" fill="url(#paint12_linear_323_447)"/>
<path d="M0.000732422 420.384L0.00073261 282.616H139.188L0.000732422 420.384Z" fill="url(#paint13_linear_323_447)"/>
<path d="M275.351 282.616L241.561 420.384H136.983L275.351 282.616Z" fill="url(#paint14_linear_323_447)"/>
<path d="M0 144.76H136.99V282.527L0 144.76Z" fill="url(#paint15_linear_323_447)"/>
<path d="M0 420.193H136.99V557.961L0 420.193Z" fill="url(#paint16_linear_323_447)"/>
<defs>
<linearGradient id="paint0_linear_323_447" x1="1260.89" y1="1062.25" x2="2688.61" y2="-887.578" gradientUnits="userSpaceOnUse">
<stop stop-color="#0099FF"/>
<stop offset="1" stop-color="#0000FF"/>
</linearGradient>
<linearGradient id="paint1_linear_323_447" x1="174.383" y1="0" x2="174.383" y2="139.789" gradientUnits="userSpaceOnUse">
<stop stop-color="#91D3FF"/>
<stop offset="1" stop-color="#0099FF"/>
</linearGradient>
<linearGradient id="paint2_linear_323_447" x1="223.477" y1="1.83571" x2="264.403" y2="228.183" gradientUnits="userSpaceOnUse">
<stop stop-color="#28DBFF"/>
<stop offset="1" stop-color="#0000FF"/>
</linearGradient>
<linearGradient id="paint3_linear_323_447" x1="-175.546" y1="-231.311" x2="656.398" y2="312.107" gradientUnits="userSpaceOnUse">
<stop stop-color="#E1F7FF"/>
<stop offset="1" stop-color="#0E9FFF"/>
</linearGradient>
<linearGradient id="paint4_linear_323_447" x1="141.083" y1="306.265" x2="-193.82" y2="198.214" gradientUnits="userSpaceOnUse">
<stop stop-color="#45B5FF"/>
<stop offset="1" stop-color="#E1F7FF"/>
</linearGradient>
<linearGradient id="paint5_linear_323_447" x1="129.044" y1="268.506" x2="151.125" y2="424.265" gradientUnits="userSpaceOnUse">
<stop stop-color="#95D6FF"/>
<stop offset="1" stop-color="#0385FF"/>
</linearGradient>
<linearGradient id="paint6_linear_323_447" x1="182.521" y1="278.967" x2="208.823" y2="533.74" gradientUnits="userSpaceOnUse">
<stop stop-color="#29DAFF"/>
<stop offset="1" stop-color="#0000FF"/>
</linearGradient>
<linearGradient id="paint7_linear_323_447" x1="166.514" y1="313.303" x2="-66.2218" y2="39.4828" gradientUnits="userSpaceOnUse">
<stop stop-color="#0087E8"/>
<stop offset="1" stop-color="#000091"/>
</linearGradient>
<linearGradient id="paint8_linear_323_447" x1="166.514" y1="592.297" x2="-66.2218" y2="318.477" gradientUnits="userSpaceOnUse">
<stop stop-color="#0087E8"/>
<stop offset="1" stop-color="#000091"/>
</linearGradient>
<linearGradient id="paint9_linear_323_447" x1="127.397" y1="272.161" x2="149.197" y2="425.932" gradientUnits="userSpaceOnUse">
<stop stop-color="#95D6FF"/>
<stop offset="1" stop-color="#0385FF"/>
</linearGradient>
<linearGradient id="paint10_linear_323_447" x1="172.158" y1="7.08105" x2="172.158" y2="145.086" gradientUnits="userSpaceOnUse">
<stop stop-color="#91D3FF"/>
<stop offset="1" stop-color="#0099FF"/>
</linearGradient>
<linearGradient id="paint11_linear_323_447" x1="220.625" y1="8.89334" x2="261.03" y2="232.352" gradientUnits="userSpaceOnUse">
<stop stop-color="#28DBFF"/>
<stop offset="1" stop-color="#0000FF"/>
</linearGradient>
<linearGradient id="paint12_linear_323_447" x1="-173.306" y1="-221.278" x2="648.023" y2="315.206" gradientUnits="userSpaceOnUse">
<stop stop-color="#E1F7FF"/>
<stop offset="1" stop-color="#0E9FFF"/>
</linearGradient>
<linearGradient id="paint13_linear_323_447" x1="191.449" y1="282.521" x2="-191.351" y2="202.773" gradientUnits="userSpaceOnUse">
<stop stop-color="#45B5FF"/>
<stop offset="1" stop-color="#E1F7FF"/>
</linearGradient>
<linearGradient id="paint14_linear_323_447" x1="180.192" y1="282.49" x2="206.158" y2="534.011" gradientUnits="userSpaceOnUse">
<stop stop-color="#29DAFF"/>
<stop offset="1" stop-color="#0000FF"/>
</linearGradient>
<linearGradient id="paint15_linear_323_447" x1="164.389" y1="316.386" x2="-65.3768" y2="46.0602" gradientUnits="userSpaceOnUse">
<stop stop-color="#0087E8"/>
<stop offset="1" stop-color="#000091"/>
</linearGradient>
<linearGradient id="paint16_linear_323_447" x1="164.389" y1="591.82" x2="-65.3768" y2="321.494" gradientUnits="userSpaceOnUse">
<stop stop-color="#0087E8"/>
<stop offset="1" stop-color="#000091"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
assests/img/error403.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
assests/img/error404.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
assests/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

26
assests/js/scripts.js Normal file
View File

@@ -0,0 +1,26 @@
/*!
* Start Bootstrap - SB Admin v7.0.7 (https://startbootstrap.com/template/sb-admin)
* Copyright 2013-2023 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-sb-admin/blob/master/LICENSE)
*/
//
// Scripts
//
window.addEventListener('DOMContentLoaded', event => {
// Toggle the side navigation
const sidebarToggle = document.body.querySelector('#sidebarToggle');
if (sidebarToggle) {
// Uncomment Below to persist sidebar toggle between refreshes
// if (localStorage.getItem('sb|sidebar-toggle') === 'true') {
// document.body.classList.toggle('sb-sidenav-toggled');
// }
sidebarToggle.addEventListener('click', event => {
event.preventDefault();
document.body.classList.toggle('sb-sidenav-toggled');
localStorage.setItem('sb|sidebar-toggle', document.body.classList.contains('sb-sidenav-toggled'));
});
}
});

11
assests/styles.css Normal file
View File

@@ -0,0 +1,11 @@
/* Style général appliqué à toute la page */
body{
/* Couleur de fond claire pour améliorer la lisibilité */
background: #f7f8fb;
}
/* Style de base des cartes Bootstrap */
.card{
/* Fond blanc pour mettre en valeur le contenu */
background: #fff;
}

20
composer.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "yasse/projetphp",
"description": "le projet php de ces mort",
"require": {
"smarty/smarty": "^5.7",
"phpmailer/phpmailer": "^7.0",
"vlucas/phpdotenv": "^5.6"
},
"autoload": {
"psr-4": {
"Guill\\Guillaume\\": "src/"
}
},
"authors": [
{
"name": "GuillaumeH-Cci",
"email": "guillaume.hess@ccicampus.fr"
}
]
}

650
composer.lock generated Normal file
View File

@@ -0,0 +1,650 @@
{
"_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": "d2f573a5d0618ae6d7627bef30d78eb9",
"packages": [
{
"name": "graham-campbell/result-type",
"version": "v1.1.4",
"source": {
"type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.5"
},
"require-dev": {
"phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
},
"type": "library",
"autoload": {
"psr-4": {
"GrahamCampbell\\ResultType\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "An Implementation Of The Result Type",
"keywords": [
"Graham Campbell",
"GrahamCampbell",
"Result Type",
"Result-Type",
"result"
],
"support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
"type": "tidelift"
}
],
"time": "2025-12-27T19:43:20+00:00"
},
{
"name": "phpmailer/phpmailer",
"version": "v7.0.2",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088",
"reference": "ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-filter": "*",
"ext-hash": "*",
"php": ">=5.5.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"doctrine/annotations": "^1.2.6 || ^1.13.3",
"php-parallel-lint/php-console-highlighter": "^1.0.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^10.0.0@dev",
"squizlabs/php_codesniffer": "^3.13.5",
"yoast/phpunit-polyfills": "^1.0.4"
},
"suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"directorytree/imapengine": "For uploading sent messages via IMAP, see gmail example",
"ext-imap": "Needed to support advanced email address parsing according to RFC822",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
},
"type": "library",
"autoload": {
"psr-4": {
"PHPMailer\\PHPMailer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-only"
],
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v7.0.2"
},
"funding": [
{
"url": "https://github.com/Synchro",
"type": "github"
}
],
"time": "2026-01-09T18:02:33+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.9.5",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34"
},
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"PhpOption\\": "src/PhpOption/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh"
},
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "Option Type for PHP",
"keywords": [
"language",
"option",
"php",
"type"
],
"support": {
"issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.5"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"time": "2025-12-27T19:41:33+00:00"
},
{
"name": "smarty/smarty",
"version": "v5.8.0",
"source": {
"type": "git",
"url": "https://github.com/smarty-php/smarty.git",
"reference": "78d259d3b971c59a0cd719c270cc5cbb740c36a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smarty-php/smarty/zipball/78d259d3b971c59a0cd719c270cc5cbb740c36a7",
"reference": "78d259d3b971c59a0cd719c270cc5cbb740c36a7",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"symfony/polyfill-mbstring": "^1.27"
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^7.5",
"smarty/smarty-lexer": "^4.0.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0.x-dev"
}
},
"autoload": {
"files": [
"src/functions.php"
],
"psr-4": {
"Smarty\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Monte Ohrt",
"email": "monte@ohrt.com"
},
{
"name": "Uwe Tews",
"email": "uwe.tews@googlemail.com"
},
{
"name": "Rodney Rehm",
"email": "rodney.rehm@medialize.de"
},
{
"name": "Simon Wisselink",
"homepage": "https://www.iwink.nl/"
}
],
"description": "Smarty - the compiling PHP template engine",
"homepage": "https://smarty-php.github.io/smarty/",
"keywords": [
"templating"
],
"support": {
"forum": "https://github.com/smarty-php/smarty/discussions",
"issues": "https://github.com/smarty-php/smarty/issues",
"source": "https://github.com/smarty-php/smarty/tree/v5.8.0"
},
"funding": [
{
"url": "https://github.com/wisskid",
"type": "github"
}
],
"time": "2026-02-15T14:27:15+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.33.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": {
"url": "https://github.com/symfony/polyfill",
"name": "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.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"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.33.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": ">=7.2"
},
"provide": {
"ext-mbstring": "*"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "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.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-12-23T08:48:59+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.33.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2025-01-02T08:10:11+00:00"
},
{
"name": "vlucas/phpdotenv",
"version": "v5.6.3",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "955e7815d677a3eaa7075231212f2110983adecc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc",
"reference": "955e7815d677a3eaa7075231212f2110983adecc",
"shasum": ""
},
"require": {
"ext-pcre": "*",
"graham-campbell/result-type": "^1.1.4",
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.5",
"symfony/polyfill-ctype": "^1.26",
"symfony/polyfill-mbstring": "^1.26",
"symfony/polyfill-php80": "^1.26"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"ext-filter": "*",
"phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
},
"suggest": {
"ext-filter": "Required to use the boolean validator."
},
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "5.6-dev"
}
},
"autoload": {
"psr-4": {
"Dotenv\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "https://github.com/vlucas"
}
],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
"keywords": [
"dotenv",
"env",
"environment"
],
"support": {
"issues": "https://github.com/vlucas/phpdotenv/issues",
"source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"time": "2025-12-27T19:49:13+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {},
"platform-dev": {},
"plugin-api-version": "2.9.0"
}

0
controllers/.gitkeep Normal file
View File

View File

@@ -0,0 +1,112 @@
<?php
require("./models/project_model.php");
require("./entities/project_entity.php");
require("./models/category_model.php");
require("./entities/category_entity.php");
require("./models/image_model.php");
require("./entities/image_entity.php");
require("./models/user_model.php");
require("./entities/user_entity.php");
require("./models/authorisation_model.php");
require("./entities/authorisation_entity.php");
require("mother_controller.php");
/**
* Le controller de la partie accessible uniquement par l'admin
* @author Laura
*/
class AdminCtrl extends MotherCtrl{
public function admin(){
if (!isset($_SESSION['user']) && ($_SESSION['user']['user_status'] != 1 )){
header("Location:index.php?ctrl=error&action=error_403");
exit;
}
//gestion de l'user
$objCategoryModel = new CategoryModel;
if (!empty($_POST['new_category'])) {
$newCat = new Category();
$newCat->setName($_POST['new_category']);
$objCategoryModel->insertCategory($newCat);
$_SESSION['success'] = "La catégorie a bien été ajoutée";
header('Location: index.php?ctrl=admin&action=admin');
exit;
}
if (!empty($_POST['id_to_edit']) && !empty($_POST['new_name'])) {
$editCat = new Category();
$editCat->setId($_POST['id_to_edit']);
$editCat->setName($_POST['new_name']);
$objCategoryModel->editCategory($editCat);
$_SESSION['success'] = "La catégorie a bien été modifiée";
header('Location: index.php?ctrl=admin&action=admin');
exit;
}
//affichage select des catégories
$arrCategory = $objCategoryModel->findAllCategory();
$arrCategoryToDisplay = array();
foreach($arrCategory as $arrDetCategory){
$objCategory = new Category;
$objCategory->hydrate($arrDetCategory);
$arrCategoryToDisplay[] = $objCategory;
}
//gestion de l'user
$objUserModel = new UserModel;
if (!empty($_POST['action'])) {
$intUserId = (int)$_POST['user_id'];
if ($intUserId > 0) {
if ($_POST['action'] === 'update_status' && !empty($_POST['new_status'])) {
$objUser = new User();
$objUser->setId($intUserId);
$objUser->setStatus((int)$_POST['new_status']);
if ($objUserModel->editStatus($objUser)) {
$_SESSION['success'] = "Le statut a bien été modifié !";
}
}
elseif ($_POST['action'] === 'delete_user') {
$objUserModel->delete_soft($intUserId);
$_SESSION['success'] = "L'utilisateur a été supprimé.";
}
header("Location: index.php?ctrl=admin&action=admin");
exit;
}
}
//affichage select des users
$arrUser = $objUserModel->findAllUsers();
$arrUserToDisplay = array();
foreach($arrUser as $arrDetUser){
$objUser = new User;
$objUser->hydrate($arrDetUser);
$arrUserToDisplay[] = $objUser;
}
//affichage select des authorisations
$objAuthorisationModel = new AuthorisationModel;
$arrAuthorisation = $objAuthorisationModel->findAllAuthorisation();
$arrAuthorisationToDisplay = array();
foreach($arrAuthorisation as $arrDetAuthorisation){
$objAuthorisation = new Authorisation;
$objAuthorisation->hydrate($arrDetAuthorisation);
$arrAuthorisationToDisplay[] = $objAuthorisation;
}
//gérer l'affichage
$this->_arrData['arrCategoryToDisplay'] = $arrCategoryToDisplay;
$this->_arrData['arrUserToDisplay'] = $arrUserToDisplay;
$this->_arrData['arrAuthorisationToDisplay'] = $arrAuthorisationToDisplay;
$this->_display("admin");
}
}

View File

@@ -0,0 +1,24 @@
<?php
require("mother_controller.php");
/**
* Le contrôleur des erreurs
* @author Laura (largement inspiré de Christel)
*/
class ErrorCtrl extends MotherCtrl{
/**
* Page erreur 404
*/
public function error_404(){
$this->_display("error_404");
}
/**
* Page erreur 403
*/
public function error_403(){
$this->_display("error_403");
}
}

View File

@@ -0,0 +1,56 @@
<?php
use Smarty\Smarty;
class MotherCtrl {
protected array $_arrData = array(); // ou = []
/**
* Méthode d'affichage des pages
*/
protected function _display($strView, bool $boolDisplay = true){
// Création de l'objet Smarty
$objSmarty = new Smarty();
// Ajouter le var_dump au modificateur de smarty : vardump est le nom appelé après le |
$objSmarty->registerPlugin('modifier', 'vardump', 'var_dump');
// Désactiver la mise en cache
$objSmarty->caching = false;
// Forcer la recompilation des templates
$objSmarty->force_compile = true;
// Vérifier si les templates ont été modifiés
$objSmarty->compile_check = true;
// Récupérer les variables
foreach($this->_arrData as $key=>$value){
//$$key = $value;
$objSmarty->assign($key, $value);
}
// Message de succès
$objSmarty->assign("success_message", $_SESSION['success']??'');
unset($_SESSION['success']);
if (isset($_SESSION['error'])){
$objSmarty->assign("arrError", array($_SESSION['error']));
unset($_SESSION['error']);
}
if ($boolDisplay){
$objSmarty->display("views/".$strView.".tpl");
}else{
return $objSmarty->fetch("views/".$strView.".tpl");
}
// inclusion du header
/*include("views/_partial/header.php");
include("views/".$strView.".php");
include("views/_partial/footer.php");*/
}
}

View File

@@ -0,0 +1,17 @@
<?php
require("mother_controller.php");
/**
* Le controller de la page d'aide utilisateur
* @author Laura
*/
class PageCtrl extends MotherCtrl{
public function help(){
$this->_display("help");
}
}

View File

@@ -0,0 +1,631 @@
<?php
require("./models/project_model.php");
require("./entities/project_entity.php");
require("./models/category_model.php");
require("./entities/category_entity.php");
require("./models/image_model.php");
require("./entities/image_entity.php");
require("./models/user_model.php");
require("./entities/user_entity.php");
require("mother_controller.php");
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;
/**
* Le controler des Project
* @author Yasser & Laura
*/
class ProjectCtrl extends MotherCtrl{
/**
* Fonction d'affichage de la page d'acceuil
*/
public function home(){
if (!isset($_SESSION['user']) && isset($_COOKIE['remember_me'])) {
$token_du_cookie = $_COOKIE['remember_me'];
$hash_a_verifier = hash('sha256', $token_du_cookie);
$objUserModel = new UserModel;
// 2. On cherche le jeton dans TA table "tokens" (avec token_user_id)
$row = $objUserModel->getTokenUser($hash_a_verifier);
if ($row) {
// 3. Jeton trouvé ! On récupère les infos de l'utilisateur
$user = $objUserModel->findUserById($row['token_user_id']);
if ($user) {
// 4. On recrée la session comme lors d'un login normal
$_SESSION['user'] = $user;
}
}
}
$intCategory = 0;
if (!empty($_GET['filter_cat'])) {
$intCategory = (int) $_GET['filter_cat'];
}
$boolOld = false;
if (!empty($_GET['filter_old']) && $_GET['filter_old'] == 'true') {
$boolOld = true;
}
$objProjectModel = new ProjectModel;
$arrProject = $objProjectModel->findAll(0,'',0,0,'','','',$intCategory,$boolOld);
$arrProjectToDisplay = array();
foreach($arrProject as $arrDetProject){
$objProject = new Project;
$objProject->hydrate($arrDetProject);
$arrProjectToDisplay[] = $objProject;
}
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
$this->_display("home");
}
/**
* Fonction d'affichage de la barre de recherche
*/
public function search(){
//Récupérer les informations du formulaire
$strKeywords = $_POST['keywords']??'';
$intAuthor = $_POST['author']??0;
$intPeriod = $_POST['period']??0;
$strDate = $_POST['date']??'';
$strStartDate = $_POST['startdate']??'';
$strEndDate = $_POST['enddate']??'';
$intCategory = $_POST['category']??0;
// Récupération des projets
$objProjectModel = new ProjectModel;
$arrProject = $objProjectModel->findAll(intAuthor:$intAuthor, intPeriod:$intPeriod, strDate:$strDate,
strKeywords:$strKeywords, strStartDate:$strStartDate, strEndDate:$strEndDate, intCategory:$intCategory);
$arrProjectToDisplay = array();
foreach($arrProject as $arrDetProject){
$objProject = new Project;
$objProject->hydrate($arrDetProject);
$arrProjectToDisplay[] = $objProject;
}
// Récupération des utilisateurs
$objUserModel = new UserModel;
$arrUser = $objUserModel->findAllUsers();
// Récupération des catégories
$objCategoryModel = new CategoryModel;
$arrCategory = $objCategoryModel->findAllCategory();
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
$this->_arrData['arrCategory'] = $arrCategory;
$this->_arrData['arrProject'] = $arrProject;
$this->_arrData['arrUser'] = $arrUser;
$this->_display("search");
}
/**
* Fonction d'affichage de la page projet
* @author Christel adapter par Guillaume
*/
public function addedit_project(){
if (!isset($_SESSION['user'])){ // Pas d'utilisateur connecté
header("Location:index.php?ctrl=error&action=error_403");
exit;
}
$objProject = new Project;
$objProjectModel = new ProjectModel;
$objCategoryModel = new CategoryModel;
// Dans la cas de modif
if (isset($_GET['id'])){
$arrProject = $objProjectModel->findOne($_GET['id']);
$objProject->hydrate($arrProject); // BDD
$this->_arrData['arrImages'] = $objProjectModel->getImagesByProjectId($objProject->getId());
}
// Tester le formulaire
$arrError = [];
if (count($_POST) > 0) {
$objProject->hydrate($_POST); // Formulaire
if ($objProject->getTitle() == ""){
$arrError['title'] = "Le titre est obligatoire";
}
if ($objProject->getDescription() == ""){
$arrError['description'] = "La description est obligatoire";
}
if ($objProject->getContent() == ""){
$arrError['content'] = "Le contenu est obligatoire";
}
// Vérification de l'image (Thumbnail)
$arrTypeAllowed = array('image/jpeg', 'image/png', 'image/webp');
if ($_FILES['thumbnail']['error'] != 4){
if (!in_array($_FILES['thumbnail']['type'], $arrTypeAllowed)){
$arrError['thumbnail'] = "Le type de fichier n'est pas autorisé";
}else{
switch ($_FILES['thumbnail']['error']){
case 0 :
$strImageName = uniqid().".webp";
$strOldImg = $objProject->getThumbnail();
$objProject->setThumbnail($strImageName);
break;
case 1 :
$arrError['thumbnail'] = "Le fichier est trop volumineux";
break;
case 2 :
$arrError['thumbnail'] = "Le fichier est trop volumineux";
break;
case 3 :
$arrError['thumbnail'] = "Le fichier a été partiellement téléchargé";
break;
case 6 :
$arrError['thumbnail'] = "Le répertoire temporaire est manquant";
break;
default :
$arrError['thumbnail'] = "Erreur sur l'image";
break;
}
}
}else{
if (is_null($objProject->getThumbnail())){
$arrError['thumbnail'] = "L'image est obligatoire";
}
}
// SI pas d'erreur : on traite l'image principale
if (count($arrError) == 0){
$boolImageOk = true;
// On peux changer ces dimensions si on veux que la miniature soit plus grande/petite
if (isset($strImageName)){
$strDest = $_ENV['IMG_PROJECT_PATH'].$strImageName;
$strSource = $_FILES['thumbnail']['tmp_name'];
list($intWidth, $intHeight) = getimagesize($strSource);
// Redimensionnement de la Thumbnail
$intDestWidth = 200; $intDestHeight = 250;
$fltDestRatio = $intDestWidth / $intDestHeight;
$fltSourceRatio = $intWidth / $intHeight;
if ($fltSourceRatio > $fltDestRatio) {
$intCropHeight = $intHeight;
$intCropWidth = (int)round($intHeight * $fltDestRatio);
$intCropX = (int)(($intWidth - $intCropWidth) / 2);
$intCropY = 0;
} else {
$intCropWidth = $intWidth;
$intCropHeight = (int)round($intWidth / $fltDestRatio);
$intCropX = 0;
$intCropY = (int)(($intHeight - $intCropHeight) / 2);
}
$objDest = imagecreatetruecolor($intDestWidth, $intDestHeight);
switch ($_FILES['thumbnail']['type']) {
case 'image/jpeg' :
$objSource = imagecreatefromjpeg($strSource);
break;
case 'image/png' :
$objSource = imagecreatefrompng($strSource);
break;
case 'image/webp' :
$objSource = imagecreatefromwebp($strSource);
break;
}
imagecopyresampled($objDest, $objSource, 0, 0, $intCropX, $intCropY, $intDestWidth, $intDestHeight, $intCropWidth, $intCropHeight);
$boolImageOk = imagewebp($objDest, $strDest);
//Suppression des doublons pour la mémoire vive
imagedestroy($objDest);
imagedestroy($objSource);
}
// SI image ok, on balance tout dans la bdd
if ($boolImageOk){
if (!isset($_GET['id'])){
$objProject->setUser_id($_SESSION['user']['user_id']);
$boolOk = $objProjectModel->insert($objProject);
} else {
$boolOk = $objProjectModel->updateProject($objProject);
}
// Gestion des 20 Images après l'envoie de la Thumbnail en BDD
if ($boolOk){
//Si pas d'erreur
if (isset($_FILES['imageProject']) && $_FILES['imageProject']['error'][0] != 4) {
$files = $_FILES['imageProject'];
$maxPhotos = 20;
// 1. On compte combien d'images le projet possède déjà en BDD
$currentImages = $objProjectModel->getImagesByProjectId($objProject->getId());
$totalExisting = count($currentImages);
// 2. On calcule combien de photos on peut encore ajouter
$remainingSlots = $maxPhotos - $totalExisting;
// Si on a déjà atteint ou dépassé la limite, on ne traite même pas les fichiers
if ($remainingSlots <= 0) {
$_SESSION['error'] = "Limite de $maxPhotos photos atteinte. Supprimez-en pour en ajouter de nouvelles.";
} else {
$uploadedCount = 0;
foreach ($files['name'] as $key => $name) {
// 3. On utilise le quota restant comme condition d'arrêt
if ($uploadedCount >= $remainingSlots) break;
if ($files['error'][$key] === 0 && in_array($files['type'][$key], $arrTypeAllowed)) {
$galleryName = uniqid() . "_gallery.webp";
$strDestGallery = $_ENV['IMG_PROJECT_PATH'].$galleryName;
$strSourceGallery = $files['tmp_name'][$key];
// Reprise de la logique de redimensionnement
list($intW, $intH) = getimagesize($strSourceGallery);
// On peux changer ces dimensions si on veux que la galerie soit plus grande/petite
$intDestW = 150; $intDestH = 150;
$fltDestR = $intDestW / $intDestH;
$fltSourceR = $intW / $intH;
if ($fltSourceR > $fltDestR) {
$intCropH = $intH;
$intCropW = (int)round($intH * $fltDestR);
$intCropX = (int)(($intW - $intCropW) / 2);
$intCropY = 0;
} else {
$intCropW = $intW;
$intCropH = (int)round($intW / $fltDestR);
$intCropX = 0;
$intCropY = (int)(($intH - $intCropH) / 2);
}
$objDestGallery = imagecreatetruecolor($intDestW, $intDestH);
// Création de la source selon le type de chaque image de la boucle
switch ($files['type'][$key]) {
case 'image/jpeg' :
$objSourceGallery = imagecreatefromjpeg($strSourceGallery);
break;
case 'image/png' :
$objSourceGallery = imagecreatefrompng($strSourceGallery);
break;
case 'image/webp' :
$objSourceGallery = imagecreatefromwebp($strSourceGallery);
break;
}
if ($objSourceGallery) {
imagecopyresampled($objDestGallery, $objSourceGallery, 0, 0, $intCropX, $intCropY, $intDestW, $intDestH, $intCropW, $intCropH);
if (imagewebp($objDestGallery, $strDestGallery)) {
// Insertion en BDD
$objProjectModel->addImageInProject($galleryName, $objProject->getId());
$uploadedCount++;
}
imagedestroy($objDestGallery);
imagedestroy($objSourceGallery);
}
}
}
if ($uploadedCount > 0) {
$_SESSION['success'] = "$uploadedCount image(s) ajoutée(s) à la galerie !";
}
}
}
// Suppression de l'ancienne miniature
if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){
$strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg;
if (file_exists($strOldFile)) unlink($strOldFile);
}
$_SESSION['success'] = (!isset($_GET['id'])) ? "Le projet a bien été créé" : "Le projet a bien été modifié";
header("Location:index.php");
exit;
} else {
$arrError[] = "Erreur lors de l'enregistrement en base de données";
}
} else {
$arrError['thumbnail'] = "Erreur dans le traitement de l'image";
}
}
}
// Données pour la vue
$this->_arrData['arrCategory'] = $objCategoryModel->findAllCategory();
$this->_arrData['objProject'] = $objProject;
$this->_arrData['arrError'] = $arrError;
// Si on est en modifications de projet, on récupère les images pour les afficher dans le formulaire
if ($objProject->getId()) {
// On récupère les images via le modèle et on les stocke dans le tableau de données
$this->_arrData['arrImages'] = $objProjectModel->getImagesByProjectId($objProject->getId());
} else {
// Sinon on initialise un tableau vide pour éviter que Smarty ne râle
$this->_arrData['arrImages'] = [];
}
$this->_display('addedit_project');
}
/**
* Fonction d'affichage de projet
*/
public function display() {
$intId = $_GET['id'] ?? null;
if ($intId) {
$objProjectModel = new ProjectModel();
$arrProject = $objProjectModel->findOne((int)$intId);
// CORRECTION ICI : on utilise $intId (pas $id)
$arrImages = $objProjectModel->getImagesByProjectId((int)$intId);
if ($arrProject) {
$objProject = new Project();
$objProject->hydrate($arrProject);
$this->_arrData["objProject"] = $objProject;
$this->_arrData["arrImages"] = $arrImages;
$this->_display("project_display");
} else {
header("Location: index.php?ctrl=project&action=home");
exit;
}
} else {
header("Location: index.php?ctrl=project&action=home");
exit;
}
}
/**
* Fonction de partage de projet
*/
public function shareProject(){
if (count($_POST) > 0)
{
$projectId = (int)($_POST['project_id'] ?? 0);
$toEmail = trim($_POST['to_email'] ?? '');
$objProjectModel = new ProjectModel();
$arrProject = $objProjectModel->findOne($projectId);
if (!$arrProject) {
header("Location: index.php?ctrl=project&action=home");
exit;
}
$objProject = new Project();
$objProject->hydrate($arrProject);
$objMail = new PHPMailer();
$objMail->IsSMTP();
$objMail->Mailer = "smtp";
$objMail->CharSet = PHPMailer::CHARSET_UTF8;
$objMail->SMTPDebug = 0;
$objMail->SMTPAuth = true;
$objMail->SMTPSecure = "tls";
$objMail->Port = 587;
$objMail->Host = 'smtp-relay.brevo.com';
$objMail->Username = 'a2a67e001@smtp-brevo.com';
$objMail->Password = 'xsmtpsib-f2af87e12d3db6f1b99802a92c1acda32d45fc32a8446eeed7e49ec91c4ec7ef-AX8Y7YkRWYSmKHwS';
// Désactive la vérification du certificat SSL
// Cela permet d'éviter les erreurs liées au certificat, mais réduit la sécurité de la connexion.
$objMail->SMTPOptions = [
'ssl' => [
'verify_peer' => false,
],
];
$objMail->IsHTML(true);
$objMail->setFrom('projet.folliow@hotmail.com', 'Folliow');
$objMail->addAddress($toEmail);
$objMail->Subject = "Projet : " . $objProject->getTitle();
$url = "https://php.boulayoune.com/index.php?ctrl=project&action=display&id=" . $projectId;
$this->_arrData['projectTitle'] = $objProject->getTitle();
$this->_arrData['projectDescription'] = $objProject->getDescription();
$this->_arrData['projectUrl'] = $url;
$objMail->Body = $this->_display("mail_message", false);
if ($objMail->Send()) {
header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=ok");
} else {
header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=fail");
}
exit;
}
header("Location: index.php?ctrl=project&action=home");
exit;
}
/**
* Fonction de modération de projet = accepté
* @author Guillaume
*/
public function accept(){
//Récupéré l'id dans l'url
$intId = $_GET['id'];
//Je créer un nouveau model pour exec la commande SQL
$objProjectModel = new ProjectModel;
$objProjectModel->accept($intId);
//Redirection vers la page
header("Location: index.php");
exit;
}
/**
* Fonction de modération de projet = refusé
* @author Guillaume
*/
public function refuse(){
//Récupéré l'id dans l'url
$intId = $_GET['id'];
//Je créer un nouveau model pour exec la commande SQL
$objProjectModel = new ProjectModel;
$objProjectModel->refuse($intId);
//Redirection vers la page
header("Location: index.php");
exit;
}
/**
* Fonction de suppression de projet
* @author Guillaume
*/
public function delete(){
//Récupéré l'id dans l'url
$intId = $_GET['id'];
//Je créer un nouveau model pour exec la commande SQL
$objProjectModel = new ProjectModel;
$objProjectModel->delete($intId);
//Redirection vers la page
header("Location: index.php");
exit;
}
/**
* Fonction de changement de statut (Approuvé, Refusé, En attente)
* @author Guillaume
*/
public function change_image_status() {
if (isset($_GET['id_img']) && isset($_GET['status'])) {
$idImg = (int)$_GET['id_img'];
$status = $_GET['status']; // "en_attente" passage à "approuvé"
$objProjectModel = new ProjectModel();
// On passe le statut texte directement à ta méthode de modèle
if ($objProjectModel->updateImageStatus($idImg, $status)) {
$_SESSION['success'] = "Le statut de l'image est désormais : " . ucfirst($status);
}
}
// La redirection : Si on sait d'où on vient, on y retourne, sinon index
$urlRedirect = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "index.php";
header("Location: " . $urlRedirect);
exit;
}
/**
* Fonction de validation de l'image de projet
* @author Guillaume
*/
public function delete_image() {
// Vérifier l'id de l'image
$idImg = $_GET['id_img'];
$objProjectModel = new ProjectModel();
// Récupérer le nom du fichier pour le supprimer physiquement
$image = $objProjectModel->findImage($idImg);
if ($image) {
$filePath = $_ENV['IMG_PROJECT_PATH'] . $image['image_name'];
if (file_exists($filePath)) unlink($filePath);
$objProjectModel->deleteImage($idImg);
$_SESSION['success'] = "Image supprimée !";
}
// La redirection : Si on sait d'où on vient, on y retourne, sinon index
$url = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : "index.php";
header("Location: " . $url);
exit;
}
/**
* Fonction d'ajout des 20 images max du projet
* @author Guillaume
* @param string $fileName = le nom de l'image, int $projectId = L'Id du projet que l'on veut afficher, string $alt = qui affichera pars défaut "Image de projet"
* @return bool Est-ce que la requête s'est bien passée
*/
public function addImageInProject(string $fileName, int $projectId, string $alt = "Image de projet"): bool {
$strRq = "INSERT INTO image (
image_name,
image_alt,
image_status,
image_project
)
VALUES (:name, :alt, :status, :project)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR);
$rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR);
$rqPrep->bindValue(":status", "en_attente", PDO::PARAM_STR); // Valeur string en brute
$rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT);
return $rqPrep->execute();
}
/**
* Fonction d'affichage des 20 images max du projet
* @author Guillaume
* @param array $ProjectId L'Id du projet que l'on veut afficher
* @return bool Est-ce que la requête s'est bien passée
*/
public function getImagesByProjectId(int $projectId): array {
$strRq = "SELECT image_id, image_name, image_alt, image_status
FROM image
WHERE image_project = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $projectId, PDO::PARAM_INT);
$rqPrep->execute();
return $rqPrep->fetchAll(PDO::FETCH_ASSOC);
}
/**
* Page mentions légales
*/
public function mentions(){
// Afficher
$this->_display("mentions");
}
/**
* Page à propos
*/
public function about(){
// Afficher
$this->_display("about");
}
}

View File

@@ -0,0 +1,69 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 08:21:14
from 'file:views/home.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6985a47abcda40_19846426',
'has_nocache_code' => false,
'file_dependency' =>
array (
'299f75d7692a19207f23bf5795a2721f507c3fc6' =>
array (
0 => 'views/home.tpl',
1 => 1770365364,
2 => 'file',
),
),
'includes' =>
array (
'file:views/_partial/preview.tpl' => 1,
),
))) {
function content_6985a47abcda40_19846426 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, false);
?>
<?php
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_3150142016985a47abb6c29_00747518', "content");
?>
<?php }
/* {block "content"} */
class Block_3150142016985a47abb6c29_00747518 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views';
?>
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
<h1 class="logo">Folliow</h1>
<h2>Là où les talents rencontrent leur avenir</h2>
<p class="col-6">Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises.
Créer un portfolio réellement pertinent aux exigences du marché et rentrez
directement en contact avec les entreprises.</p>
</section>
<section class="container" aria-label="Articles récents">
<h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2">
<?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('arrProjectToDisplay'), 'objProject');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('objProject')->value) {
$foreach0DoElse = false;
?>
<?php $_smarty_tpl->renderSubTemplate("file:views/_partial/preview.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
?>
<?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>
</section>
<?php
}
}
/* {/block "content"} */
}

View File

@@ -0,0 +1,66 @@
<?php
/* Smarty version 5.7.0, created on 2026-02-06 08:21:14
from 'file:views/_partial/preview.tpl' */
/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
'version' => '5.7.0',
'unifunc' => 'content_6985a47ad585d5_25749521',
'has_nocache_code' => false,
'file_dependency' =>
array (
'c724044e55872f26030b02de6dcd14dc34a20b16' =>
array (
0 => 'views/_partial/preview.tpl',
1 => 1770365554,
2 => 'file',
),
),
'includes' =>
array (
),
))) {
function content_6985a47ad585d5_25749521 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = 'C:\\wamp64\\www\\projetphp\\views\\_partial';
?><article class="col-md-3 mb-4">
<div class="card h-100 shadow-sm article-card">
<div class="ratio ratio-16x9">
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getThumbnail();?>
"
class="w-100 h-100 object-fit-cover"
alt=""
loading="lazy">
</div>
<div class="d-flex align-items-start gap-3">
<img src=".<?php echo $_smarty_tpl->getValue('objProject')->getUser_image();?>
"
class="rounded-circle flex-shrink-0 mt-2 ml-5"
style="width: 48px; height: 48px; object-fit: cover;"
alt="Photo de profil">
<div class="flex-grow-1 card-body p-3">
<h3 class="h6 mb-1"><?php echo $_smarty_tpl->getValue('objProject')->getTitle();?>
</h3>
<small class="text-body-secondary d-block mb-1">
<time><?php echo $_smarty_tpl->getValue('objProject')->getCreation_date();?>
</time>
<?php echo $_smarty_tpl->getValue('objProject')->getCreatorname();?>
</small>
<a href="?id=<?php echo $_smarty_tpl->getValue('objProject')->getId();?>
"
class="stretched-link small">
Lire la suite →
</a>
</div>
</div>
</div>
</article><?php }
}

View File

@@ -0,0 +1,343 @@
<?php
require("models/user_model.php");
require("entities/user_entity.php");
require("mother_controller.php");
require("./models/project_model.php");
require("./entities/project_entity.php");
class UserCtrl extends MotherCtrl {
public function login(){
$strMail = $_POST['user_mail']??"";
$strPwd = $_POST['user_password']??"";
// Tester le formulaire
$arrError = [];
if (count($_POST) > 0) {
// Vérifier le formulaire
if ($strMail == ""){
$arrError['mail'] = "Le mail est obligatoire";
}
if ($strPwd == ""){
$arrError['pwd'] = "Le mot de passe est obligatoire";
}
// Si le formulaire est rempli correctement
if (count($arrError) == 0){
// Vérifier l'utilisateur en BDD
$objUserModel = new UserModel;
$arrResult = $objUserModel->verifUser($strMail, $strPwd);
//var_dump($arrResult);
if ($arrResult === false){ // Si la base de données ne renvoie rien
$arrError[] = "Mail ou mot de passe invalide";
}else{
// Ajoute l'utilisateur en session
$_SESSION['user'] = $arrResult;
$_SESSION['success'] = "Bienvenue, vous êtes bien connecté";
if (isset($_POST['remember_me'])) {
$token = bin2hex(random_bytes(32));
$token_hash = hash('sha256', $token);
$objUserModel->remember($_SESSION['user']['user_id'],$token_hash);
setcookie('remember_me', $token, time() + (15*24*60*60), "/", "", true, true);
}
header("Location:index.php");
exit;
}
}
}
$this->_arrData['arrError'] = $arrError;
$this->_display("login");
}
public function logout(){
if (isset($_COOKIE['remember_me'])) {
$hash = hash('sha256', $_COOKIE['remember_me']);
$objUserModel = new UserModel;
$objUserModel->deleteToken($hash);
setcookie('remember_me', '', time() - 3600, "/");
}
unset($_SESSION['user']);
$_SESSION['success'] = "Vous êtes bien déconnecté";
header("Location:index.php");
exit;
}
/**
* Fonction d'inscription d'un utilisateur
* Effectue les validations du formulaire,
* vérifie l'unicité du mail et du pseudo,
* puis insère l'utilisateur en base de données
* @return void
*/
public function signup(){
// Entité pour réafficher les valeurs dans le formulaire
$objUser = new User();
// Récupération des champs
$strPwdConfirm = $_POST['pwd_confirm'] ?? "";
// Tableau d'erreurs
$arrError = [];
// Traitement du formulaire uniquement si POST
if (!empty($_POST)) {
// Hydratation
$objUser->setName($_POST['user_name'] ?? "");
$objUser->setFirstname($_POST['user_firstname'] ?? "");
$objUser->setMail($_POST['user_mail'] ?? "");
$objUser->setPseudo($_POST['user_pseudo'] ?? "");
$objUser->setPwd($_POST['user_password'] ?? "");
// Champs optionnels : on les stocke aussi même si ils sont vides
$objUser->setPhone($_POST['user_phone'] ?? "");
$objUser->setWork($_POST['user_work'] ?? "");
$objUser->setLocation($_POST['user_location'] ?? "");
$objUser->setDescription($_POST['user_description'] ?? "");
// --- VALIDATIONS (obligatoires) ---
if (trim($objUser->getName()) === "") {
$arrError['user_name'] = "Le nom est obligatoire";
}
if (trim($objUser->getFirstname()) === "") {
$arrError['user_firstname'] = "Le prénom est obligatoire";
}
if (trim($objUser->getMail()) === "") {
$arrError['user_mail'] = "L'adresse e-mail est obligatoire";
} elseif (!filter_var($objUser->getMail(), FILTER_VALIDATE_EMAIL)) {
$arrError['user_mail'] = "Le format de l'adresse e-mail est invalide";
}
if (trim($objUser->getPseudo()) === "") {
$arrError['user_pseudo'] = "Le pseudo est obligatoire";
}
$strRegex = "/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{15,}$/";
if ($objUser->getPwd() == ""){
$arrError['user_password'] = "Le mot de passe est obligatoire";
}else if (!preg_match($strRegex, $objUser->getPwd())){
$arrError['user_password'] = "Le mot de passe ne respecte pas les critères";
}else if($objUser->getPwd() != $strPwdConfirm){
$arrError['pwd_confirm'] = "La confirmation du mot de passe ne correspond pas";
}
// Si pas d'erreurs => insertion
if (count($arrError) === 0) {
$objUserModel = new UserModel();
// Vérif mail
if ($objUserModel->mailExists($objUser->getMail())) {
$arrError['user_mail'] = "Impossible de créer le compte avec ces informations";
}
// Vérif pseudo
if ($objUserModel->pseudoExists($objUser->getPseudo())) {
$arrError['user_pseudo'] = "Ce pseudo existe déjà";
}
// Si aucune erreur => insert
if (count($arrError) === 0) {
$boolInsert = $objUserModel->insert($objUser);
if ($boolInsert === true) {
$_SESSION['success'] = "Compte créé avec succès";
header("Location:index.php?ctrl=user&action=login");
exit;
} else {
$arrError['global'] = "Erreur lors de l'ajout";
}
}
}
}
// Affichage de la vue inscription
$this->_arrData['objUser'] = $objUser;
$this->_arrData['arrError'] = $arrError;
$this->_display("signup");
}
/**
* le controlleur affichage de la page user
*/
public function user(){
/**$intId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
if ($intId <= 0) {
header("Location: index.php");
exit;
}
//affichage info utilisateur
$objUserModel = new UserModel;
$arrUserData = $objUserModel->findUserById($intId);
if ($arrUserData === false) {
header("Location: index.php");
exit;
}*/
$strPseudo = $_GET['pseudo']??'';
$objUserModel = new UserModel;
$arrUserData = $objUserModel->findUserByPseudo($strPseudo);
if ($arrUserData === false) {
header("Location: index.php");
exit;
}
$objUser = new User;
$objUser->hydrate($arrUserData);
//affichage projet de l'utilisateur
$objProjectModel = new ProjectModel;
$arrProjects = $objProjectModel->findAll(0,'',$objUser->getId());
$arrProjectToDisplay = array();
foreach($arrProjects as $projectData) {
$objProject = new Project();
$objProject->hydrate($projectData);
$arrProjectToDisplay[] = $objProject;
}
$this->_arrData['user'] = $objUser;
$this->_arrData['arrProjectToDisplay'] = $arrProjectToDisplay;
$this->_display("user");
}
public function edit(){
if(!isset($_SESSION['user'])){
header("Location: index.php");
exit;
}
$objUserModel = new UserModel;
$arrError = [];
$objUser = new User;
$arrUserData = $objUserModel->findUserById($_SESSION['user']['user_id']);
$objUser->hydrate($arrUserData);
if (!empty($_POST)) {
if ($objUserModel->mailExists($_POST['user_mail']) && ($_POST['user_mail'] != $objUser->getMail())) {
$arrError['user_mail'] = "Ce mail est déjà associé";
} else {
if ($objUserModel->pseudoExists($_POST['user_pseudo']) && ($_POST['user_pseudo'] != $objUser->getPseudo())){
$arrError['user_pseudo'] = "Ce pseudo est déjà utiliser";
}else{
$objUser->hydrate($_POST);
$objUser->setId($_SESSION['user']['user_id']);
// Vérification de l'image
$arrTypeAllowed = array('image/jpeg', 'image/png', 'image/webp');
$boolImageOk = true;
if ($_FILES['image']['error'] != 4) {
if (!in_array($_FILES['image']['type'], $arrTypeAllowed)) {
$arrError['image'] = "Le type de fichier n'est pas autorisé";
} else {
switch ($_FILES['image']['error']) {
case 0:
$strImageName = uniqid() . ".webp";
$strOldImg = $objUser->getImage();
$objUser->setImage($strImageName);
break;
case 1:
case 2:
$arrError['image'] = "Le fichier est trop volumineux";
break;
case 3:
$arrError['image'] = "Le fichier a été partiellement téléchargé";
break;
case 6:
$arrError['image'] = "Le répertoire temporaire est manquant";
break;
default:
$arrError['image'] = "Erreur sur l'image";
break;
}
}
}
// Traitement de l'image si pas d'erreur
if (count($arrError) == 0 && isset($strImageName)) {
$strDest = $_ENV['IMG_USER_PATH'] . $strImageName;
$strSource = $_FILES['image']['tmp_name'];
list($intWidth, $intHeight) = getimagesize($strSource);
$intDestWidth = 200; $intDestHeight = 200;
$fltDestRatio = $intDestWidth / $intDestHeight;
$fltSourceRatio = $intWidth / $intHeight;
if ($fltSourceRatio > $fltDestRatio) {
$intCropHeight = $intHeight;
$intCropWidth = (int)round($intHeight * $fltDestRatio);
$intCropX = (int)(($intWidth - $intCropWidth) / 2);
$intCropY = 0;
} else {
$intCropWidth = $intWidth;
$intCropHeight = (int)round($intWidth / $fltDestRatio);
$intCropX = 0;
$intCropY = (int)(($intHeight - $intCropHeight) / 2);
}
$objDest = imagecreatetruecolor($intDestWidth, $intDestHeight);
switch ($_FILES['image']['type']) {
case 'image/jpeg': $objSource = imagecreatefromjpeg($strSource); break;
case 'image/png': $objSource = imagecreatefrompng($strSource); break;
case 'image/webp': $objSource = imagecreatefromwebp($strSource); break;
}
imagecopyresampled($objDest, $objSource, 0, 0, $intCropX, $intCropY, $intDestWidth, $intDestHeight, $intCropWidth, $intCropHeight);
$boolImageOk = imagewebp($objDest, $strDest);
imagedestroy($objDest);
imagedestroy($objSource);
}
$boolInsert = $objUserModel->update($objUser);
if ($boolInsert === true) {
if (isset($strOldImg) && !empty($strOldImg) && isset($strImageName)) {
$strOldFile = $_ENV['IMG_USER_PATH'] . $strOldImg;
if (file_exists($strOldFile)) unlink($strOldFile);
}
$arrNewInfo = $objUserModel->findUserByPseudo($objUser->getPseudo());
$_SESSION['user'] = $arrNewInfo;
$_SESSION['success'] = "Compte modifier avec succès";
header("Location:?ctrl=user&action=user&pseudo=".$objUser->getPseudo());
exit;
} else {
$arrError['global'] = "Erreur lors de l'update";
}
}
}
}
$this->_arrData["arrError"] = $arrError;
$this->_arrData['objUser'] = $objUser;
$this->_display("useredit");
}
}

7
coucou.txt Normal file
View File

@@ -0,0 +1,7 @@
coucou
coucou depuis le cci
hehehe
coucoucoucoucou
encore un teste, y'en a trop wwsh

View File

@@ -0,0 +1,28 @@
<?php
require_once("mother_entity.php");
class Authorisation extends Entity{
private int $_id;
private string $_name = '';
public function __construct(){
$this->_prefix = 'authorisation_';
}
public function getId():int{
return $this->_id;
}
public function setId(int $id){
$this->_id = $id;
}
public function getName():string{
return $this->_name;
}
public function setName(string $name){
$this->_name = $name;
}
}

View File

@@ -0,0 +1,81 @@
<?php
require_once("mother_entity.php");
/**
* Classe d'un objet Projet
* @author Laura
*/
class Category extends Entity{
private ?int $_id = null;
protected string $_name = '';
protected ?int $_parent = null;
/**
* Constructeur (j'ai toujours pas compris à quoi ça sert)
*/
public function __construct(){
$this->_prefix = 'category_';
}
// Méthode Getter et Setter
/**
* Récuperation de l'id de la catégorie
* @return int l'id de la catégorie
*/
public function getId(): ?int{
return $this->_id;
}
/**
* Mise à jour de l'id de la catégorie
* @param int le nouvelle id
*/
public function setId($id){
if (empty($id)) {
$this->_id = null;
} else {
$this->_id = (int) $id;
}
}
/**
* Récuperation du nom de la catégorie
* @return string nom de la catégorie
*/
public function getName(){
return $this->_name;
}
/**
* Mise à jour du nom de la catégorie
* @param string le nouveau nom de la catégorie
*/
public function setName($name){
$this->_name = $name;
}
/**
* Récuperation du nom du parent de la catégorie
* @return int nom de la catégorie
*/
public function getParent():?int{
return $this->_parent;
}
/**
* Mise à jour du nom du parent de la catégorie
* @param int le nouveau nom de la catégorie
*/
public function setParent($parent){
if (empty($parent)) {
$this->_parent = null;
} else {
$this->_parent = (int) $parent;
}
}
}

91
entities/image_entity.php Normal file
View File

@@ -0,0 +1,91 @@
<?php
require_once("mother_entity.php");
/**
* Classe d'un objet Projet
* @author Laura
*/
class Image extends Entity{
private int $_id;
private string $_name = '';
private string $_alt = '';
private string $_status ='';
private int $_project = 0;
//le construc habituel
public function __construct(){
$this->_prefix = 'image_';
}
// Méthode Getter et Setter
/**
* Récuperation de l'id de l'image
* @return int l'id de l'image
*/
public function getId():int{
return $this->_id;
}
/**
* Mise à jour de l'id de l'image
* @param int le nouvelle id
*/
public function setId($id){
$this->_id = $id;
}
/**
* Récuperation du nom de l'image
* @return string nom de l'image
*/
public function getName(){
return $this->_name;
}
/**
* Mise à jour du nom de l'image
* @param string le nouveau nom de l'image
*/
public function setName($name){
$this->_name = $name;
}
/**
* Récuperation de l'alt
* @return string contenu de l'alt
*/
public function getAlt(){
return $this->_alt;
}
/**
* Mise à jour de l'alt
* @param string le nouveau contenu de l'alt
*/
public function setAlt($alt){
$this->_alt = $alt;
}
/**
* Récuperation du statut de la photo
* @return string du statut
*/
public function getStatus(){
return $this->_status;
}
/**
* Mise à jour du statut de la photo
* @param string le nouveau statut de la photo
*/
public function setStatus($status){
$this->_status = $status;
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Classe d'un Mere de tout objet
* @author Yass & Laura
*/
class Entity{
protected string $_prefix = '';
public function hydrate(array $arrData){
foreach($arrData as $key=>$value){
$strMethodName = "set".ucfirst(str_replace($this->_prefix,'',$key));
if (method_exists($this,$strMethodName)){
$this->$strMethodName($value);
}
}
}
protected function nettoyer(string $strText){
$strText = trim($strText);
$strText = str_replace("<script>", "", $strText);
$strText = str_replace("</script>", "", $strText);
return $strText;
}
}

221
entities/project_entity.php Normal file
View File

@@ -0,0 +1,221 @@
<?php
require_once("mother_entity.php");
/**
* Classe d'un objet Projet
* @author Yass
*/
class Project extends Entity{
private ?int $_id = null;
private string $_title = "";
private string $_description = "";
private ?string $_thumbnail = null;
private string $_content = "";
private string $_creation_date;
private string $_status = "en_attente";
private int $_user;
private int $_category = 0;
private string $_creatorname;
private ?string $_user_image = null;
/**
* Constructeur (logique mdrr)
*/
public function __construct(){
$this->_prefix = 'project_';
}
// Méthode Getter et Setter
/**
* Récuperation de l'id du Projet
* @return int l'id du projet
*/
public function getId():?int{
return $this->_id;
}
/**
* Mise à jour de l'id du projet
* @param int le nouvelle id
*/
public function setId(int $id){
$this->_id = $id;
return $this;
}
/**
* Récuperation du titre
* @return string tite du projet
*/
public function getTitle(){
return $this->_title;
}
/**
* Mise à jour du titre
* @param string le nouveau titre
*/
public function setTitle($title){
$this->_title = $title;
}
/**
* Récuperation de la description
* @return string description du projet
*/
public function getDescription(){
return $this->_description;
}
/**
* Mise à jour de la description
* @param string la nouvelle description
*/
public function setDescription($description){
$this->_description = $description;
}
/**
* Récuperation de l'image
* @return string chemin vers l'image
*/
public function getThumbnail(){
return $this->_thumbnail;
}
/**
* Mise à jour de l'image
* @param string chemin vers nouvelle image
*/
public function setThumbnail($thumbnail){
$this->_thumbnail = $thumbnail;
}
/**
* Récuperation du contenue
* @return string contenue du projet
*/
public function getContent(){
return $this->_content;
}
/**
* Mise à jour du contenue
* @param string le nouveau contenue
*/
public function setContent($content){
$this->_content = $content;
}
/**
* Récupération de la date de création
* @param string lang de formatage de la date (par défaut = "fr_FR")
* @return string date de création formatter
*/
public function getCreation_date(string $strFormat = "fr_FR"){
$objDate = new DateTime($this->_creation_date);
$objDateFormatter = new IntlDateFormatter(
$strFormat,
IntlDateFormatter::LONG,
IntlDateFormatter::NONE,
);
$strFormat = $objDateFormatter->format($objDate);
return $strFormat;
}
/**
* Mise à jour de la date de création
* @param string la nouvelle date de création
*/
public function setCreation_date($creation_date){
$this->_creation_date = $creation_date;
}
/**
* Récupération du statut
* @return string statut
*/
public function getStatus(){
return $this->_status;
}
/**
* Mise à jour du statut
* @param string le nouveau statut
*/
public function setStatus($status){
$this->_status = $status;
}
/**
* Récupération de l'utilisateur
* @return int id de l'utilisateur
*/
public function getUser_id(){
return $this->_user;
}
/**
* Mise à jour de l'utilisateur
* @param int id de l'utilisateur
*/
public function setUser_id($user){
$this->_user = $user;
}
/**
* Récupération de la catégorie
* @return int id de la catégorie
*/
public function getCategory():?int{
return $this->_category;
}
/**
* Mise à jour de la catégorie
* @param int id de la catégorie
*/
public function setCategory($category){
$this->_category = $category;
}
/**
* Récupération du nom du créateur
* @return string nom du créateur
*/
public function getCreatorName(){
return $this->_creatorname;
}
/**
* Mise à jour du nom du créateur
* @param string le nom du créateur
*/
public function setCreatorName($creatorname){
$this->_creatorname = $creatorname;
}
/**
* Récupération du chemin photo profil
* @return string nom du chemin photo profil
*/
public function getUser_image(){
return $this->_user_image;
}
/**
* Mise à jour du chemin photo profil
* @param string chemin photo profil
*/
public function setUser_image($user_image){
$this->_user_image = $user_image;
}
}

124
entities/user_entity.php Normal file
View File

@@ -0,0 +1,124 @@
<?php
require_once("mother_entity.php");
class User extends Entity{
private int $_id;
private string $_name = '';
private string $_firstname = '';
private string $_pseudo = '';
private ?string $_image = null;
private string $_mail = '';
private string $_pwd;
private string $_phone = '';
private string $_work = '';
private ?string $_birth = null;
private string $_location = '';
private string $_description = '';
private string $_account_creation = '';
private int $_status;
public function __construct(){
$this->_prefix = 'user_';
}
public function getId():int{
return $this->_id;
}
public function setId(int $id){
$this->_id = $id;
}
public function getName():string{
return $this->_name;
}
public function setName(string $name){
$this->_name = $name;
}
public function getFirstname():string{
return $this->_firstname;
}
public function setFirstname(string $firstname){
$this->_firstname = $firstname;
}
public function getPseudo():string{
return $this->_pseudo;
}
public function setPseudo(string $pseudo){
$this->_pseudo = $pseudo;
}
public function getImage():?string{
return $this->_image;
}
public function setImage(?string $image){
$this->_image = $image;
}
public function getMail():string{
return $this->_mail;
}
public function setMail(string $mail){
$this->_mail = strtolower($mail);
}
public function getPwd():string{
return $this->_pwd;
}
public function getPwdHash():string{
return password_hash($this->_pwd, PASSWORD_DEFAULT);
}
public function setPwd(string $pwd){
$this->_pwd = $pwd;
}
public function getPhone():string{
return $this->_phone;
}
public function setPhone(string $phone){
$this->_phone = $phone;
}
public function getWork():string{
return $this->_work;
}
public function setWork(string $work){
$this->_work = $work;
}
public function getBirth():?string{
return $this->_birth;
}
public function setBirth(?string $birth){
$this->_birth = $birth;
}
public function getLocation():string{
return $this->_location;
}
public function setLocation(string $location){
$this->_location = $location;
}
public function getDescription():string{
return $this->_description;
}
public function setDescription(string $description){
$this->_description = $description;
}
public function getAccountCreation():string{
return $this->_account_creation;
}
public function setAccountCreation(string $account_creation){
$this->_account_creation = $account_creation;
}
public function getStatus():int{
return $this->_status;
}
public function setStatus(int $status){
$this->_status = $status;
}
}

11
env Normal file
View File

@@ -0,0 +1,11 @@
# config BDD
DB_CONNECTION=mysql
DB_HOSTNAME=boulayoune.com
DB_DATABASE=projet_folliow
DB_USERNAME=
DB_PASSWORD=
# image path
IMG_PROJECT_PATH = uploads/projects/
IMG_USER_PATH = uploads/profiles/

36
index.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
session_start();
require(__DIR__ . "/vendor/autoload.php");
//environnement
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->safeLoad();
$strCtrl = $_GET['ctrl']??'project';
$strMethod = $_GET['action']??'home';
$boolError = false;
$strFileName = "./controllers/".$strCtrl."_controller.php";
if(file_exists($strFileName)){
require($strFileName);
$strClassName = ucfirst($strCtrl)."Ctrl";
if(class_exists($strClassName)){
$objController = new $strClassName();
if(method_exists($objController,$strMethod)){
$objController->$strMethod ();
}else{
$boolError = true;
}
}else{
$boolError = true;
}
}else{
$boolError = true;
}
if($boolError){
header("Location:index.php?ctrl=error&action=error_404");
}

0
models/.gitkeep Normal file
View File

View File

@@ -0,0 +1,28 @@
<?php
require_once('mother_model.php');
/**
* Traitement des requêtes pour le status de l'utilisateur
* @author : Laura
*/
class AuthorisationModel extends Connect{
public function __construct(){
parent::__construct();
}
/**
* fonction de récupération des infos d'authorisation
* @return array
*/
public function findAllAuthorisation():array{
$strRq = "SELECT *
FROM authorisation";
return $this->_db->query($strRq)->fetchAll();
}
}

83
models/category_model.php Normal file
View File

@@ -0,0 +1,83 @@
<?php
require_once('mother_model.php');
/**
* Traitement des requêtes pour les catégories
* @author : Laura
*/
class CategoryModel extends Connect{
/**
* Fonction de récupération des catégories
* @param int $intLimit
* @return array
*/
public function findAllCategory(int $intLimit=0):array{
$strRq = "SELECT category.*
FROM category";
if ($intLimit > 0){
$strRq .= " LIMIT ".$intLimit;
}
return $this->_db->query($strRq)->fetchAll();
}
/**
* fonction d'insertion d'une nouvelle catégorie dans la bdd
* @param object $objCategory l'objet catégorie
* @return bool Est-ce que la requête s'est bien passée
*/
public function insertCategory(object $objCategory):bool{
$strRq = "INSERT INTO category (category_name)
VALUES (:name)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
return $rqPrep->execute();
}
/**
* fonction de suppression d'une catégorie dans la bdd
* @param object $objCategory l'objet catégorie
* @return bool Est-ce que la requête s'est bien passée
*/
public function deleteCategory(object $objCategory):bool{
$strRq = "DELETE FROM category
WHERE category_id= :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT);
return $rqPrep->execute();
}
/**
* fonction de modification d'une catégorie dans la bdd
* @param object $objCategory l'objet catégorie
* @return bool Est-ce que la requête s'est bien passée
*/
public function editCategory(object $objCategory):bool{
$strRq = "UPDATE category
SET category_name = :name
WHERE category_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $objCategory->getId(), PDO::PARAM_INT);
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
return $rqPrep->execute();
}
}

30
models/image_model.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
require_once('mother_model.php');
/**
* Traitement de la requête pour les images
* @author Laura
*/
class ImageModel extends Connect{
/**
* Fonction de récupération des images
* @param int $intLimit
* @return array
*/
public function findAllImage(int $intLimit=0):array{
$strRq = "SELECT image.*
FROM image";
if ($intLimit > 0){
$strRq .= " LIMIT ".$intLimit;
}
return $this->_db->query($strRq)->fetchAll();
}
}

36
models/mother_model.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
class Connect {
protected $_db;
public function __construct(){
try{
// Connexion à la base de données
$this->_db = new PDO(
"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD "mysql:host=localhost;dbname=projet_folliow",
"projet_user", //Nom d'utilisateur de la base de données root
"F0lliowRules!",// Mot de passe de la base de données
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) // Mode de renvoi
);
// Pour résoudre les problèmes dencodage
$this->_db->exec("SET CHARACTER SET utf8");
// Configuration des exceptions
$this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException$e) {
echo "Échec : " . $e->getMessage();
}
}
}
/**
*Pour passer sur le serveur de YASS:
*"mysql:host=boulayoune.com;dbname=projet_folliow", // Serveur et BDD
"projet_user", //Nom d'utilisateur de la base de données
"F0lliowRules!",// Mot de passe de la base de données
Site pour BDD: https://phpmyadmin.boulayoune.com/index.php?route=/sql&pos=0&db=projet_folliow&table=project
*Pour passer en local:
*"mysql:host=localhost;dbname=projet_folliow", // Serveur et BDD
*"root", //Nom d'utilisateur de la base de données
*"",// Mot de passe de la base de données
*/

315
models/project_model.php Normal file
View File

@@ -0,0 +1,315 @@
<?php
require_once('mother_model.php');
/**
* Traitement des requêtes pour les projets
* @author : Laura
*/
class ProjectModel extends Connect{
/**
* Fonction de recherche des projets
* @param type string, int et bool
* @return array
*/
public function findAll(int $intLimit=0, string $strKeywords='', int $intAuthor=0,
int $intPeriod=0, string $strDate='', string $strStartDate='',
string $strEndDate='', int $intCategory=0, bool $boolOlderThan6Months=false): array {
$strRq = "SELECT project.*,
user_pseudo AS 'project_creatorname',
user_image
FROM project
INNER JOIN users ON user_id = project_user_id
WHERE 1=1";
if ($strKeywords != '') {
$strRq .= " AND (project_title LIKE :keywords OR project_content LIKE :keywords)";
}
if ($intAuthor > 0){
$strRq .= " AND project_user_id = :author";
}
if ($intCategory > 0){
$strRq .= " AND project_category = :category";
}
if ($boolOlderThan6Months === true) {
$strRq .= " AND project_creation_date <= DATE_SUB(NOW(), INTERVAL 6 MONTH)";
}
if ($intPeriod == 0){
if ($strDate != ''){
$strRq .= " AND project_creation_date = :date_exacte";
}
} else {
if ($strStartDate != '' && $strEndDate != ''){
$strRq .= " AND project_creation_date BETWEEN :date_debut AND :date_fin";
} else {
if ($strStartDate != ''){
$strRq .= " AND project_creation_date >= :date_debut";
} else if ($strEndDate != ''){
$strRq .= " AND project_creation_date <= :date_fin";
}
}
}
$strRq .= " ORDER BY project_creation_date DESC";
if ($intLimit > 0){
$strRq .= " LIMIT :limit";
}
$rqPrep = $this->_db->prepare($strRq);
if ($strKeywords != '') {
$rqPrep->bindValue(':keywords', '%' . $strKeywords . '%', PDO::PARAM_STR);
}
if ($intAuthor > 0){
$rqPrep->bindValue(':author', $intAuthor, PDO::PARAM_INT);
}
if ($intCategory > 0){
$rqPrep->bindValue(':category', $intCategory, PDO::PARAM_INT);
}
if ($intPeriod == 0){
if ($strDate != ''){
$rqPrep->bindValue(':date_exacte', $strDate, PDO::PARAM_STR);
}
} else {
if ($strStartDate != '' && $strEndDate != ''){
$rqPrep->bindValue(':date_debut', $strStartDate, PDO::PARAM_STR);
$rqPrep->bindValue(':date_fin', $strEndDate, PDO::PARAM_STR);
} else {
if ($strStartDate != ''){
$rqPrep->bindValue(':date_debut', $strStartDate, PDO::PARAM_STR);
} else if ($strEndDate != ''){
$rqPrep->bindValue(':date_fin', $strEndDate, PDO::PARAM_STR);
}
}
}
if ($intLimit > 0){
$rqPrep->bindValue(':limit', $intLimit, PDO::PARAM_INT);
}
$rqPrep->execute();
return $rqPrep->fetchAll();
}
/**
* Fonction d'insertion d'un nouveau projet dans la bdd
* @param object $objProject l'objet projet
* @return bool Est-ce que la requête s'est bien passée
*/
public function insert(object $objProject):bool{
$strRq = "INSERT INTO project (project_title, project_description, project_thumbnail, project_content, project_status, project_creation_date, project_user_id, project_category)
VALUES (:title, :description, :thumbnail, :content, :status, DATE(NOW()), :project_user_id, :project_category)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
$rqPrep->bindValue(":thumbnail", $objProject->getThumbnail(), PDO::PARAM_STR);
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
$rqPrep->bindValue(":status", $objProject->getStatus(), PDO::PARAM_STR);
$rqPrep->bindValue(":project_user_id", $objProject->getUser_id(), PDO::PARAM_STR);
$rqPrep->bindValue(":project_category", $objProject->getCategory(), PDO::PARAM_STR);
// On met une variable boolOk pour récupérer l'id du projet
$boolOk = $rqPrep->execute();
// Si boolOk est remplis
if ($boolOk) {
// On récupère l'ID auto-incrémenté et on l'injecte dans l'objet
$objProject->setId($this->_db->lastInsertId());
}
return $boolOk;
}
/**
* Fonction de recherche d'un seul projet
* @param int $intId
* @return array
*/
public function findOne(int $intId) :array{
$strRq = "SELECT project.*,
users.user_pseudo AS 'project_creatorname',
users.user_image,
category.category_name
FROM project
INNER JOIN users ON users.user_id = project.project_user_id
LEFT JOIN category ON category.category_id = project.project_category
WHERE project.project_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $intId, PDO::PARAM_INT);
$rqPrep->execute();
return $rqPrep->fetch();
}
/**
* Fonction de changement de status (accepter) d'un projet en BDD
* @author Guillaume
* @param int $id l'id du projet
* @return bool Est-ce que la requête s'est bien passée
*/
public function accept(int $id){
$strRq = "UPDATE project
SET project_status= 'publié'
WHERE project_id =".$id;
return $this->_db->query($strRq);
}
/**
* Fonction de changement de status (refusé) d'un projet en BDD
* @author Guillaume
* @param int $id l'id du projet
* @return bool Est-ce que la requête s'est bien passée
*/
public function refuse(int $id){
$strRq = "UPDATE project
SET project_status= 'refusé'
WHERE project_id =".$id;
return $this->_db->query($strRq);
}
/**
* Fonction de suppression d'un projet en BDD
* @author Guillaume
* @param int $id l'id du projet
* @return bool Est-ce que la requête s'est bien passée
*/
public function delete(int $id){
$strRq = "DELETE FROM project
WHERE project_id =".$id;
return $this->_db->query($strRq);
}
/**
* Fonction de mise à jour d'un projet en BDD
* @author Guillaume
* @param object $objProject L'objet utilisateur
* @return bool Est-ce que la requête s'est bien passée
*/
public function updateProject(object $objProject):bool{
$strRq = "UPDATE project
SET project_title = :title,
project_description = :description,
project_content = :content,
project_thumbnail = :thumbnail
WHERE project_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":title", $objProject->getTitle(), PDO::PARAM_STR);
$rqPrep->bindValue(":description", $objProject->getDescription(), PDO::PARAM_STR);
$rqPrep->bindValue(":content", $objProject->getContent(), PDO::PARAM_STR);
$rqPrep->bindValue(":thumbnail", $objProject->getThumbnail(), PDO::PARAM_STR);
$rqPrep->bindValue(":id", $objProject->getId(), PDO::PARAM_INT);
return $rqPrep->execute();
}
/**
* Fonction de récupération d'image d'un projet en BDD
* @author Guillaume
* @param int $objProject L'Id du projet choisit
* @return array Un tableau avec les informations de la bdd
*/
public function getImagesByProjectId(int $projectId): array {
$strRq = "SELECT image_id, image_name, image_alt, image_status
FROM image
WHERE image_project = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $projectId, PDO::PARAM_INT);
$rqPrep->execute();
return $rqPrep->fetchAll(PDO::FETCH_ASSOC);
}
/**
* Fonction de récupération d'image d'un projet en BDD
* @author Guillaume
* @param int $id L'Id de l'image choisit
* @return array Un tableau avec les informations de la bdd
*/
public function deleteImage(int $id): bool {
$strRq = "DELETE FROM image WHERE image_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(':id', $id, PDO::PARAM_INT);
return $rqPrep->execute();
}
/**
* Fonction de modifications de status de l'image d'un projet en BDD
* @author Guillaume
* @param int $id L'Id de l'image choisit, string $status le status choisit
* @return array Un tableau avec les informations de la bdd
*/
public function updateImageStatus(int $id, string $status): bool {
$strRq = "UPDATE image SET image_status = :status WHERE image_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(':status', $status, PDO::PARAM_STR);
$rqPrep->bindValue(':id', $id, PDO::PARAM_INT);
return $rqPrep->execute();
}
/**
* Fonction de récupération d'image d'un projet en BDD
* @author Guillaume
* @param int $id L'Id de l'image choisit
* @return array Un tableau avec les informations de la bdd
*/
public function findImage(int $id): array|bool {
$strRq = "SELECT * FROM image WHERE image_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(':id', $id, PDO::PARAM_INT);
$rqPrep->execute();
return $rqPrep->fetch(PDO::FETCH_ASSOC);
}
/**
* Ajoute une image liée à un projet dans la table 'image'
* @author Guillaume
* @param string $fileName Nom du fichier image
* @param int $projectId ID du projet parent
* @param string $alt Texte alternatif
* @return bool
*/
public function addImageInProject(string $fileName, int $projectId, string $alt = "Image projet"): bool {
$strRq = "INSERT INTO image (
image_name,
image_alt,
image_status,
image_project
)
VALUES (:name, :alt, :status, :project)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":name", $fileName, PDO::PARAM_STR);
$rqPrep->bindValue(":alt", $alt, PDO::PARAM_STR);
// On met le statut par défaut en "en_attente" pour la modération
$rqPrep->bindValue(":status", "en_attente", PDO::PARAM_STR);
$rqPrep->bindValue(":project", $projectId, PDO::PARAM_INT);
return $rqPrep->execute();
}
}

213
models/user_model.php Normal file
View File

@@ -0,0 +1,213 @@
<?php
require_once('mother_model.php');
/**
* Traitement des requêtes pour les utilisateurs
* @author : meilleurGroup
*/
class UserModel extends Connect{
public function __construct(){
parent::__construct();
}
/**
* Fonction de recherche des utilisateurs et leur niveau d'autorisation
* @return array
*/
public function findAllUsers():array{
$strRq = "SELECT user_id, user_firstname, user_name, user_image, user_status, authorisation_name, user_pseudo
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
WHERE user_deleted_at IS NULL";
return $this->_db->query($strRq)->fetchAll();
}
/**
* Fonction de vérification des utilisateurs
* @param string $strMail
* @param string $strPwd
* @return array|bool
*/
public function verifUser(string $strMail, string $strPwd):array|bool{
$strRq = "SELECT user_id, user_name, user_firstname, user_password, user_image, user_status, authorisation_name, user_pseudo
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
WHERE user_mail = '".$strMail."'";
$arrUser = $this->_db->query($strRq)->fetch();
if (password_verify($strPwd, $arrUser['user_password'])){
unset($arrUser['user_password']);
return $arrUser;
}else{
return false;
}
}
/**
* Fonction d'insertion d'un utilisateur en BDD
* @param object $objUser L'objet utilisateur
* @return bool Est-ce que la requête s'est bien passée
*/
public function insert(object $objUser):bool{
$strRq = "INSERT INTO users (user_name, user_firstname, user_pseudo, user_mail, user_password, user_phone, user_work, user_location, user_description)
VALUES (:name, :firstname, :pseudo,:mail, :pwd, :phone, :work, :location,:description)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR);
$rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR);
$rqPrep->bindValue(":pseudo", $objUser->getPseudo(), PDO::PARAM_STR);
$rqPrep->bindValue(":mail", $objUser->getMail(), PDO::PARAM_STR);
$rqPrep->bindValue(":pwd", $objUser->getPwdHash(), PDO::PARAM_STR);
$rqPrep->bindValue(':phone', $objUser->getPhone() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':work', $objUser->getWork() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':location', $objUser->getLocation() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':description', $objUser->getDescription() ?? "", PDO::PARAM_STR);
return $rqPrep->execute();
}
public function remember(int $userId, string $token):bool{
$strRq = "INSERT INTO tokens (token_user_id, token_hash, token_created_at, token_expire_at) VALUES (:id, :token, NOW(), :exp)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $userId, PDO::PARAM_INT);
$rqPrep->bindValue(":token", $token, PDO::PARAM_STR);
$rqPrep->bindValue(":exp",
//pour faire que le cookies soit valable 15 jours
date('Y-m-d H:i:s', time() + (15*24*60*60))
, PDO::PARAM_STR);
return $rqPrep->execute();
}
public function getTokenUser(string $hash){
$strRq = $this->_db->prepare("SELECT token_user_id FROM tokens WHERE token_hash = :hash AND token_expire_at > NOW()");
$strRq->execute(['hash' => $hash]);
return $strRq->fetch();
}
public function deleteToken(string $hash){
$strRq = $this->_db->prepare("DELETE FROM tokens WHERE token_hash = :hash");
return $strRq->execute(['hash' => $hash]);
}
public function update(object $objUser):bool{
$strRq = "UPDATE users SET
user_name = :name,
user_firstname = :firstname,
user_pseudo = :pseudo,
user_mail = :mail,
user_phone = :phone,
user_work = :work,
user_location = :location,
user_description = :description,
user_image = :image
WHERE user_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $objUser->getId(), PDO::PARAM_INT);
$rqPrep->bindValue(":name", $objUser->getName(), PDO::PARAM_STR);
$rqPrep->bindValue(":firstname", $objUser->getFirstname(), PDO::PARAM_STR);
$rqPrep->bindValue(":pseudo", $objUser->getPseudo(), PDO::PARAM_STR);
$rqPrep->bindValue(":mail", $objUser->getMail(), PDO::PARAM_STR);
$rqPrep->bindValue(':phone', $objUser->getPhone() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':work', $objUser->getWork() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':location', $objUser->getLocation() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':description', $objUser->getDescription() ?? "", PDO::PARAM_STR);
$rqPrep->bindValue(':image', $objUser->getImage() ?? "", PDO::PARAM_STR);
return $rqPrep->execute();
}
/**
* Fonction de vérification de mail
* @param string $mail
* @return bool Est-ce que la requête s'est bien passée
*/
public function mailExists(string $mail): bool{
$rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_mail = :mail LIMIT 1");
$rq->bindValue(":mail", $mail);
$rq->execute();
return (bool)$rq->fetchColumn();
}
/**
* Fonction de changement de status d'un utilisateur
* @param object $objUser L'objet utilisateur
* @return bool Est-ce que la requête s'est bien passée
*/
public function editStatus(object $objUser):bool{
$strRq = "UPDATE users
SET user_status = :status
WHERE user_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $objUser->getId(), PDO::PARAM_INT);
$rqPrep->bindValue(":status", $objUser->getStatus(), PDO::PARAM_INT);
return $rqPrep->execute();
}
/**
* Fonction permettant de supprimer un utilisateur avec une date de suppression
* @param int $intId L'identifiant de l'utilisateur
* @return bool Est-ce que la requête s'est bien passée
*/
public function delete_soft(int $intId):bool{
$strRq = "UPDATE users
SET user_deleted_at = NOW()
WHERE user_id = :id";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":id", $intId, PDO::PARAM_INT);
return $rqPrep->execute();
}
/**
* Récupère les informations d'un utilisateur par son ID
* @param int $intId L'identifiant de l'utilisateur
* @return array Tableau associatif (ou false si pas trouvé)
*/
public function findUserById(int $intId): array|bool {
$strRq = "SELECT user_id,user_status ,user_image ,user_name, user_firstname, user_pseudo, user_mail, user_phone, user_work, user_location, user_description, authorisation_name
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
WHERE user_id = :id";
$prep = $this->_db->prepare($strRq);
$prep->bindValue(':id', $intId, PDO::PARAM_INT);
$prep->execute();
return $prep->fetch();
}
public function findUserByPseudo(string $strPseudo): array|bool {
$strRq = "SELECT user_id,user_image, user_status ,user_name, user_firstname, user_pseudo, user_mail, user_phone, user_work, user_location, user_description, authorisation_name
FROM users INNER JOIN authorisation ON authorisation.authorisation_id = users.user_status
WHERE user_pseudo = :pseudo";
$prep = $this->_db->prepare($strRq);
$prep->bindValue(':pseudo', $strPseudo, PDO::PARAM_STR);
$prep->execute();
return $prep->fetch();
}
public function pseudoExists(string $pseudo): bool{
$rq = $this->_db->prepare("SELECT 1 FROM users WHERE user_pseudo = :pseudo LIMIT 1");
$rq->bindValue(":pseudo", $pseudo, PDO::PARAM_STR);
$rq->execute();
return $rq->fetchColumn();
}
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
uploads/profiles/Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

BIN
uploads/profiles/images.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
uploads/profiles/marie.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
uploads/profiles/sophie.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
uploads/projects/Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

22
vendor/autoload.php vendored Normal file
View File

@@ -0,0 +1,22 @@
<?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;
}
}
throw new RuntimeException($err);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit68f8d029d347b4c0c8cdbe33eeb96101::getLoader();

579
vendor/composer/ClassLoader.php vendored Normal file
View File

@@ -0,0 +1,579 @@
<?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\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var array<string, bool>
*/
private $missingClasses = array();
/** @var string|null */
private $apcuPrefix;
/**
* @var array<string, self>
*/
private static $registeredLoaders = array();
/**
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return list<string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
$paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array<string, self>
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}

396
vendor/composer/InstalledVersions.php vendored Normal file
View File

@@ -0,0 +1,396 @@
<?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 string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;
/**
* @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
*/
private static $installedIsLocalDir;
/**
* @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();
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}
/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}
return self::$selfDir;
}
/**
* @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();
$copiedLocalDir = false;
if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
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';
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}
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() && !$copiedLocalDir) {
$installed[] = self::$installed;
}
return $installed;
}
}

21
vendor/composer/LICENSE vendored Normal file
View File

@@ -0,0 +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.

15
vendor/composer/autoload_classmap.php vendored Normal file
View File

@@ -0,0 +1,15 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);

13
vendor/composer/autoload_files.php vendored Normal file
View File

@@ -0,0 +1,13 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'c15d4a1253e33e055d05e547c61dcb71' => $vendorDir . '/smarty/smarty/src/functions.php',
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
);

18
vendor/composer/autoload_psr4.php vendored Normal file
View File

@@ -0,0 +1,18 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
'Smarty\\' => array($vendorDir . '/smarty/smarty/src'),
'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'),
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
'Guill\\Guillaume\\' => array($baseDir . '/src'),
'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'),
'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'),
);

50
vendor/composer/autoload_real.php vendored Normal file
View File

@@ -0,0 +1,50 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit68f8d029d347b4c0c8cdbe33eeb96101
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit68f8d029d347b4c0c8cdbe33eeb96101', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit68f8d029d347b4c0c8cdbe33eeb96101', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101::getInitializer($loader));
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}, null, null);
foreach ($filesToLoad as $fileIdentifier => $file) {
$requireFile($fileIdentifier, $file);
}
return $loader;
}
}

97
vendor/composer/autoload_static.php vendored Normal file
View File

@@ -0,0 +1,97 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'c15d4a1253e33e055d05e547c61dcb71' => __DIR__ . '/..' . '/smarty/smarty/src/functions.php',
);
public static $prefixLengthsPsr4 = array (
'S' =>
array (
'Symfony\\Polyfill\\Php80\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Polyfill\\Ctype\\' => 23,
'Smarty\\' => 7,
),
'P' =>
array (
'PhpOption\\' => 10,
'PHPMailer\\PHPMailer\\' => 20,
),
'G' =>
array (
'Guill\\Guillaume\\' => 16,
'GrahamCampbell\\ResultType\\' => 26,
),
'D' =>
array (
'Dotenv\\' => 7,
),
);
public static $prefixDirsPsr4 = array (
'Symfony\\Polyfill\\Php80\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
),
'Symfony\\Polyfill\\Ctype\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
),
'Smarty\\' =>
array (
0 => __DIR__ . '/..' . '/smarty/smarty/src',
),
'PhpOption\\' =>
array (
0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption',
),
'PHPMailer\\PHPMailer\\' =>
array (
0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
),
'Guill\\Guillaume\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
'GrahamCampbell\\ResultType\\' =>
array (
0 => __DIR__ . '/..' . '/graham-campbell/result-type/src',
),
'Dotenv\\' =>
array (
0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src',
),
);
public static $classMap = array (
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit68f8d029d347b4c0c8cdbe33eeb96101::$classMap;
}, null, ClassLoader::class);
}
}

661
vendor/composer/installed.json vendored Normal file
View File

@@ -0,0 +1,661 @@
{
"packages": [
{
"name": "graham-campbell/result-type",
"version": "v1.1.4",
"version_normalized": "1.1.4.0",
"source": {
"type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.5"
},
"require-dev": {
"phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
},
"time": "2025-12-27T19:43:20+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"GrahamCampbell\\ResultType\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "An Implementation Of The Result Type",
"keywords": [
"Graham Campbell",
"GrahamCampbell",
"Result Type",
"Result-Type",
"result"
],
"support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
"type": "tidelift"
}
],
"install-path": "../graham-campbell/result-type"
},
{
"name": "phpmailer/phpmailer",
"version": "v7.0.2",
"version_normalized": "7.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088",
"reference": "ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-filter": "*",
"ext-hash": "*",
"php": ">=5.5.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"doctrine/annotations": "^1.2.6 || ^1.13.3",
"php-parallel-lint/php-console-highlighter": "^1.0.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^10.0.0@dev",
"squizlabs/php_codesniffer": "^3.13.5",
"yoast/phpunit-polyfills": "^1.0.4"
},
"suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"directorytree/imapengine": "For uploading sent messages via IMAP, see gmail example",
"ext-imap": "Needed to support advanced email address parsing according to RFC822",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
},
"time": "2026-01-09T18:02:33+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"PHPMailer\\PHPMailer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-only"
],
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v7.0.2"
},
"funding": [
{
"url": "https://github.com/Synchro",
"type": "github"
}
],
"install-path": "../phpmailer/phpmailer"
},
{
"name": "phpoption/phpoption",
"version": "1.9.5",
"version_normalized": "1.9.5.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34"
},
"time": "2025-12-27T19:41:33+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"PhpOption\\": "src/PhpOption/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh"
},
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
}
],
"description": "Option Type for PHP",
"keywords": [
"language",
"option",
"php",
"type"
],
"support": {
"issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.5"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"install-path": "../phpoption/phpoption"
},
{
"name": "smarty/smarty",
"version": "v5.8.0",
"version_normalized": "5.8.0.0",
"source": {
"type": "git",
"url": "https://github.com/smarty-php/smarty.git",
"reference": "78d259d3b971c59a0cd719c270cc5cbb740c36a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smarty-php/smarty/zipball/78d259d3b971c59a0cd719c270cc5cbb740c36a7",
"reference": "78d259d3b971c59a0cd719c270cc5cbb740c36a7",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"symfony/polyfill-mbstring": "^1.27"
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^7.5",
"smarty/smarty-lexer": "^4.0.2"
},
"time": "2026-02-15T14:27:15+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"files": [
"src/functions.php"
],
"psr-4": {
"Smarty\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Monte Ohrt",
"email": "monte@ohrt.com"
},
{
"name": "Uwe Tews",
"email": "uwe.tews@googlemail.com"
},
{
"name": "Rodney Rehm",
"email": "rodney.rehm@medialize.de"
},
{
"name": "Simon Wisselink",
"homepage": "https://www.iwink.nl/"
}
],
"description": "Smarty - the compiling PHP template engine",
"homepage": "https://smarty-php.github.io/smarty/",
"keywords": [
"templating"
],
"support": {
"forum": "https://github.com/smarty-php/smarty/discussions",
"issues": "https://github.com/smarty-php/smarty/issues",
"source": "https://github.com/smarty-php/smarty/tree/v5.8.0"
},
"funding": [
{
"url": "https://github.com/wisskid",
"type": "github"
}
],
"install-path": "../smarty/smarty"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.33.0",
"version_normalized": "1.33.0.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"
},
"time": "2024-09-09T11:45:10+00:00",
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"installation-source": "dist",
"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.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"install-path": "../symfony/polyfill-ctype"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.33.0",
"version_normalized": "1.33.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": ">=7.2"
},
"provide": {
"ext-mbstring": "*"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"time": "2024-12-23T08:48:59+00:00",
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"installation-source": "dist",
"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.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"install-path": "../symfony/polyfill-mbstring"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.33.0",
"version_normalized": "1.33.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"time": "2025-01-02T08:10:11+00:00",
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"installation-source": "dist",
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"install-path": "../symfony/polyfill-php80"
},
{
"name": "vlucas/phpdotenv",
"version": "v5.6.3",
"version_normalized": "5.6.3.0",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "955e7815d677a3eaa7075231212f2110983adecc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc",
"reference": "955e7815d677a3eaa7075231212f2110983adecc",
"shasum": ""
},
"require": {
"ext-pcre": "*",
"graham-campbell/result-type": "^1.1.4",
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.5",
"symfony/polyfill-ctype": "^1.26",
"symfony/polyfill-mbstring": "^1.26",
"symfony/polyfill-php80": "^1.26"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"ext-filter": "*",
"phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
},
"suggest": {
"ext-filter": "Required to use the boolean validator."
},
"time": "2025-12-27T19:49:13+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "5.6-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Dotenv\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "https://github.com/vlucas"
}
],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
"keywords": [
"dotenv",
"env",
"environment"
],
"support": {
"issues": "https://github.com/vlucas/phpdotenv/issues",
"source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"install-path": "../vlucas/phpdotenv"
}
],
"dev": true,
"dev-package-names": []
}

95
vendor/composer/installed.php vendored Normal file
View File

@@ -0,0 +1,95 @@
<?php return array(
'root' => array(
'name' => 'yasse/projetphp',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '18301190fcc0a817bf05ee42b03b5e9388fd9429',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'graham-campbell/result-type' => array(
'pretty_version' => 'v1.1.4',
'version' => '1.1.4.0',
'reference' => 'e01f4a821471308ba86aa202fed6698b6b695e3b',
'type' => 'library',
'install_path' => __DIR__ . '/../graham-campbell/result-type',
'aliases' => array(),
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v7.0.2',
'version' => '7.0.2.0',
'reference' => 'ebf1655bd5b99b3f97e1a3ec0a69e5f4cd7ea088',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),
'dev_requirement' => false,
),
'phpoption/phpoption' => array(
'pretty_version' => '1.9.5',
'version' => '1.9.5.0',
'reference' => '75365b91986c2405cf5e1e012c5595cd487a98be',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoption/phpoption',
'aliases' => array(),
'dev_requirement' => false,
),
'smarty/smarty' => array(
'pretty_version' => 'v5.8.0',
'version' => '5.8.0.0',
'reference' => '78d259d3b971c59a0cd719c270cc5cbb740c36a7',
'type' => 'library',
'install_path' => __DIR__ . '/../smarty/smarty',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
'pretty_version' => 'v1.33.0',
'version' => '1.33.0.0',
'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.33.0',
'version' => '1.33.0.0',
'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.33.0',
'version' => '1.33.0.0',
'reference' => '0cc9dd0f17f61d8131e7df6b84bd344899fe2608',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
'dev_requirement' => false,
),
'vlucas/phpdotenv' => array(
'pretty_version' => 'v5.6.3',
'version' => '5.6.3.0',
'reference' => '955e7815d677a3eaa7075231212f2110983adecc',
'type' => 'library',
'install_path' => __DIR__ . '/../vlucas/phpdotenv',
'aliases' => array(),
'dev_requirement' => false,
),
'yasse/projetphp' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '18301190fcc0a817bf05ee42b03b5e9388fd9429',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
),
);

Some files were not shown because too many files have changed in this diff Show More