コード例 #1
0
ファイル: dbsetup.php プロジェクト: emanuelzone/audiobox
<?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();
コード例 #2
0
ファイル: index.php プロジェクト: aa222di/phpmvc-bth
$app->session();
// Set link style
$app->url->setUrlType(\Anax\Url\CUrl::URL_CLEAN);
$app->theme->configure(ANAX_APP_PATH . 'config/theme_aab.php');
$app->navbar->configure(ANAX_APP_PATH . 'config/navbar_aab.php');
if ($app->session->has(\Anax\User\User::$loginSession)) {
    $app->topnav->configure(ANAX_APP_PATH . 'config/topnav_logout.php');
}
//var_dump($di);
// 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();