loadIni($path); } } return $config; } $config = configFactory(); R::setup('sqlite:' . $config->main->dbPath); R::dependencies(['tag' => ['post'], 'favoritee' => ['post', 'user'], 'comment' => ['post', 'user']]); //wire models \Chibi\AutoLoader::init([__DIR__ . '/../' . $config->chibi->userCodeDir, __DIR__]); foreach (\Chibi\AutoLoader::getAllIncludablePaths() as $path) if (preg_match('/Model/', $path)) \Chibi\AutoLoader::safeInclude($path); function queryLogger() { static $queryLogger = null; if ($queryLogger === null) $queryLogger = RedBean_Plugin_QueryLogger::getInstanceAndAttach(R::getDatabaseAdapter()); return $queryLogger; } queryLogger();