<?php switch ($action) { case 'index': /*création des tables*/ $pipeManager = new PipeManager($bdd); $pipeManager->createTable(); $pipeoptionManager = new PipeoptionManager($bdd); $pipeoptionManager->createTable(); $pageManager = new PageManager($bdd); $pageManager->createTable(); $userManager = new UserManager($bdd); $userManager->createTable(); $tokenManager = new TokenManager($bdd); $tokenManager->createTable(); /*redirection*/ header('Location: ?controler=install&action=firstuser'); break; case 'firstuser': $userManager = new UserManager($bdd); if ($userManager->count() > 0) { header('Location: ?controler=index'); } else { header('Location: ?controler=user&action=add'); } break; default: break; }
$content = ob_get_contents(); ob_end_clean(); require_once 'view/layout/layout.php'; } else { ob_start(); require_once 'view/pipe/pipeexecnext.php'; echo '404'; $content = ob_get_contents(); ob_end_clean(); require_once 'view/layout/layout.php'; } } break; case 'getnextpage': if (!empty($_GET['id']) && !empty($_GET['lastvalue'])) { $pipeManager = new PipeManager($bdd); $pipe = $pipeManager->get($_GET['id']); $url = $pipe->baseurl() . $_GET['lastvalue']++; header('Location: ?controler=pipeexec&action=getallhtmlpage&url=' . $url . '&value=' . $_GET['lastvalue'] . '&pipeid=' . $_GET['id']); } else { echo 'fail'; } break; case 'getby': //bddmanager $pageManager = new PageManager($bdd); $bddpage = new Page(array()); $page = new DOMDocument(); $urlbase = 'http://www.thingiverse.com/thing:'; if (!empty($_GET['lastvalue']) && !empty($_GET['nb'])) { $_GET['lastvalue'] = (int) $_GET['lastvalue'];