aboutsummaryrefslogtreecommitdiff
path: root/app/fn
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-11-11 18:37:36 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-11-11 18:37:36 +0100
commit45903fe3960b65d63f70188640630c895dbbe222 (patch)
treeba0b0f9ba0615cd46214eeab236031c062664d6d /app/fn
parentd7f3313ff4514e38c9f53439cd1a1287e56e45f7 (diff)
downloadwcms-45903fe3960b65d63f70188640630c895dbbe222.tar.gz
wcms-45903fe3960b65d63f70188640630c895dbbe222.zip
cleaning
Diffstat (limited to 'app/fn')
-rw-r--r--app/fn/fn.php43
1 files changed, 2 insertions, 41 deletions
diff --git a/app/fn/fn.php b/app/fn/fn.php
index 8bfdee8..029e9d3 100644
--- a/app/fn/fn.php
+++ b/app/fn/fn.php
@@ -1,52 +1,13 @@
<?php
-function bddconnect($host, $bdname, $user, $password)
-{
- try {
- $bdd = new PDO('mysql:host=' . $host . ';dbname=' . $dbname . ';charset=utf8', $user, $password);
- } catch (Exeption $e) {
- die('Erreur : ' . $e->getMessage());
- }
- return $bdd;
-}
-function secure()
+function class_autoloader($class)
{
- if (!isset($_SESSION['id'])) {
- header("location: ./");
- }
+ require('.'. DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR . strtolower($class) . '.php');
}
-function head($title)
-{
- ?>
- <head>
- <meta charset="utf8" />
- <meta name="viexport" content="width=device-width" />
- <link href="./css/style.css" rel="stylesheet" />
- <title><?= $title ?></title>
- </head>
- <?php
-}
-function search($haystack, $debut, $fin)
-{
- $list = [];
-
- $indexdebut = strpos($haystack, $debut);
- if ($indexdebut !== false) {
- $indexdebut += strlen($debut);
- $indexfin = strpos($haystack, $fin, $indexdebut);
- if ($indexfin !== false) {
- array_push($list, substr($haystack, $indexdebut, $indexfin - $indexdebut));
- $haystack = substr($haystack, $indexfin);
- $list = array_merge($list, search($haystack, $debut, $fin));
- }
- }
- return $list;
-
-}
function readablesize($bytes)
{