config.inc.php 804 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. // site root path
  3. define('__TYPECHO_ROOT_DIR__', dirname(__FILE__));
  4. // plugin directory (relative path)
  5. define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins');
  6. // theme directory (relative path)
  7. define('__TYPECHO_THEME_DIR__', '/usr/themes');
  8. // admin directory (relative path)
  9. define('__TYPECHO_ADMIN_DIR__', '/admin/');
  10. // register autoload
  11. require_once __TYPECHO_ROOT_DIR__ . '/var/Typecho/Common.php';
  12. // init
  13. \Typecho\Common::init();
  14. // config db
  15. $db = new \Typecho\Db('Pdo_Mysql', 'typecho_');
  16. $db->addServer(array (
  17. 'host' => 'localhost',
  18. 'port' => 3306,
  19. 'user' => 'root',
  20. 'password' => '123456',
  21. 'charset' => 'utf8mb4',
  22. 'database' => 'typecho',
  23. 'engine' => 'InnoDB',
  24. 'sslCa' => '',
  25. 'sslVerify' => false,
  26. ), \Typecho\Db::READ | \Typecho\Db::WRITE);
  27. \Typecho\Db::set($db);