diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-03-17 11:19:05 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-03-17 11:33:03 +0100 |
commit | 53a5f6b267b1deb8c5f10973c1a238ff74a33e5a (patch) | |
tree | d3d3611a6aa31023fd911fced4906e72188647b3 | |
download | wcms-53a5f6b267b1deb8c5f10973c1a238ff74a33e5a.tar.gz wcms-53a5f6b267b1deb8c5f10973c1a238ff74a33e5a.zip |
Commit initial
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | class/art.php | 12 | ||||
-rw-r--r-- | composer.json | 5 | ||||
-rw-r--r-- | composer.lock | 64 | ||||
-rw-r--r-- | config.sample.php | 11 | ||||
-rw-r--r-- | fn/fn.php | 28 | ||||
-rw-r--r-- | index.php | 0 | ||||
-rw-r--r-- | style.css | 0 | ||||
-rw-r--r-- | w/art.php | 0 | ||||
-rw-r--r-- | w/art_create.php | 0 | ||||
-rw-r--r-- | w/art_delete.php | 0 | ||||
-rw-r--r-- | w/art_display.php | 0 | ||||
-rw-r--r-- | w/art_edit.php | 0 | ||||
-rw-r--r-- | w/index.php | 20 |
14 files changed, 142 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19c393f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor/* +config.php
\ No newline at end of file diff --git a/class/art.php b/class/art.php new file mode 100644 index 0000000..6b126ea --- /dev/null +++ b/class/art.php @@ -0,0 +1,12 @@ +<?php +class Art +{ + public $id; + + public function createfrombdd($id, $bdd) + { + + } + +} +?>
\ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..74ec1b5 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "michelf/php-markdown": "^1.8" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..ddf48ac --- /dev/null +++ b/composer.lock @@ -0,0 +1,64 @@ +{ + "_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#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "32c0f24f10c2954c56607edd1e5f94e9", + "packages": [ + { + "name": "michelf/php-markdown", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "01ab082b355bf188d907b9929cd99b2923053495" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495", + "reference": "01ab082b355bf188d907b9929cd99b2923053495", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Michelf\\": "Michelf/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "https://michelf.ca/", + "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "https://daringfireball.net/" + } + ], + "description": "PHP Markdown", + "homepage": "https://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ], + "time": "2018-01-15T00:49:33+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/config.sample.php b/config.sample.php new file mode 100644 index 0000000..9238ddb --- /dev/null +++ b/config.sample.php @@ -0,0 +1,11 @@ +<?php + +return [ + 'host' => 'localhost', + 'dbname' => 'wiki', + 'user' => 'root', + 'password' => 'mdp', + 'domaine' => 'vincent.club1.fr' +] + +?>
\ No newline at end of file diff --git a/fn/fn.php b/fn/fn.php new file mode 100644 index 0000000..e64a9c4 --- /dev/null +++ b/fn/fn.php @@ -0,0 +1,28 @@ +secure + +session + +<?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 session() +{ + session_start(); +} + +function secure() +{ + if (!isset($_SESSION['id'])) { + header("location: /"); + } +} +?> + diff --git a/index.php b/index.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/index.php diff --git a/style.css b/style.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/style.css diff --git a/w/art.php b/w/art.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/w/art.php diff --git a/w/art_create.php b/w/art_create.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/w/art_create.php diff --git a/w/art_delete.php b/w/art_delete.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/w/art_delete.php diff --git a/w/art_display.php b/w/art_display.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/w/art_display.php diff --git a/w/art_edit.php b/w/art_edit.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/w/art_edit.php diff --git a/w/index.php b/w/index.php new file mode 100644 index 0000000..ebf7106 --- /dev/null +++ b/w/index.php @@ -0,0 +1,20 @@ +<?php + +//inw + +$root = $_SERVER["DOCUMENT_ROOT"]; +require($root . '/fn.php'); +require($root . '/class/art.php'); +$config = include($root . '/config.php'); +$domaine = $config['domaine']; + +session(); + +// fin de in + +$art = new Art; +$art->createfrombdd($id, bddconnect($config['host'], $config['dbname'], $config['user'], $config['password'])); + +include($root . '/head.php') + +?>
\ No newline at end of file |