Exemple #1
0
<?php

// Namespace
$tagsToQuestion = new \Anax\Tags\TagToQuestion();
$question = new \Anax\Questions\Questions();
$tag = new \Anax\Tags\Tags();
$user = new \Anax\User\User();
$answer = new \Anax\Answers\Answers();
$comments = new \Anax\Comments\Comments();
// Setup DI
$tag->setDI($di);
$question->setDI($di);
$user->setDI($di);
$answer->setDI($di);
$comments->setDI($di);
$tagsToQuestion->setDI($di);
$tagsToQuestion->dropTable();
$tag->setup();
$question->setup();
$user->setup();
$answer->setup();
$comments->setup();
$tagsToQuestion->setup();
Exemple #2
0
// Set up db
$app->router->add('setup', function () use($di) {
    $t2q = new \Anax\Tags\TagToQuestion();
    $q = new \Anax\Questions\Questions();
    $t = new \Anax\Tags\Tags();
    $u = new \Anax\User\User();
    $a = new \Anax\Answers\Answers();
    $c = new \Anax\Comments\Comments();
    $t->setDI($di);
    $q->setDI($di);
    $u->setDI($di);
    $a->setDI($di);
    $c->setDI($di);
    $t2q->setDI($di);
    $t2q->dropTable();
    $t->setup();
    $q->setup();
    $u->setup();
    $a->setup();
    $c->setup();
    $t2q->setup();
    /*$app->TagsController->dropTable();
      $app->UserController->setupAction();
      $app->QuestionsController->setupAction();
      $app->AnswersController->setupAction();
      $app->CommentsController->setupAction();
      $app->TagsController->setupAction();*/
    //$app->QuestionsController->listAction();
});
// Get pages
// Start page