public void Init_by_wiki(Xow_wiki wiki) {
   if (init) return;
   try {
     init = true;
     //				if (wiki.File__fsdb_mode().Tid_v0()) return;
     this.url_bldr = Xof_url_bldr.new_v2();
     this.repo_mgr = wiki.File__repo_mgr();
     Fsdb_db_mgr fsdb_core = wiki.File__fsdb_core();
     // Fsdb_db_mgr fsdb_core = Fsdb_db_mgr_.new_detect(wiki, wiki.Fsys_mgr().Root_dir(),
     // wiki.Fsys_mgr().File_dir());
     if (fsdb_core == null) return;
     fsdb_enabled = true;
     mnt_mgr.Ctor_by_load(fsdb_core);
     this.bin_mgr =
         new Xof_bin_mgr(
             mnt_mgr,
             repo_mgr,
             wiki.App().File__img_mgr().Wkr_resize_img(),
             wiki.App().Wmf_mgr().Download_wkr().Download_xrg().Download_fmt());
     bin_mgr.Wkrs__add(Xof_bin_wkr__fsdb_sql.new_(mnt_mgr));
     bin_mgr.Wkrs__add(Xof_bin_wkr__http_wmf.new_(wiki));
   } catch (Exception e) {
     throw Err_.new_exc(e, "xo", "failed to initialize fsdb_mgr}", "wiki", wiki.Domain_str());
   }
 }
Esempio n. 2
0
 public void Init_by_wiki() {
   if (!init_needed) return;
   init_needed = false;
   if (String_.Eq(domain_str, "xowa"))
     return; // HACK: ignore "xowa" for now; WHEN:converting xowa to sqlitedb
   data_mgr__core_mgr = new Xow_db_mgr(this, fsys_mgr.Root_dir());
   data_mgr__core_mgr.Init_by_load(gplx.xowa.wikis.data.Xow_db_file__core_.Find_core_fil(this));
   app.Html__css_installer()
       .Install(this, Xowd_css_core_mgr.Key_mobile); // must init after data_mgr
   this.db_core_mgr = Fsdb_db_mgr_.new_detect(this, fsys_mgr.Root_dir(), fsys_mgr.File_dir());
   if (db_core_mgr
       == null) // no fsdb; occurs during merge; also, will be null for xowa_db; DATE:2016-05-31
   db_core_mgr = Fsdb_db_mgr__v2_bldr.Get_or_make(this, true);
   else // fsdb exists; load it
   fsdb_mgr.Mnt_mgr().Ctor_by_load(db_core_mgr);
   file_mgr__repo_mgr.Add_repo(
       app, fsys_mgr.File_dir(), Xow_domain_itm_.Bry__commons, Xow_domain_itm_.Bry__commons);
   file_mgr__repo_mgr.Add_repo(app, fsys_mgr.File_dir(), domain_bry, domain_bry);
   Xof_orig_tbl[] orig_tbls =
       db_core_mgr == null ? new Xof_orig_tbl[0] : db_core_mgr.File__orig_tbl_ary();
   orig_mgr.Init_by_wiki(this, file_mgr__fsdb_mode, orig_tbls, Xof_url_bldr.new_v2());
   fsdb_mgr.Init_by_wiki(this);
   data_mgr__core_mgr.Db__core().Tbl__ns().Select_all(ns_mgr);
   data_mgr__core_mgr.Db__core().Tbl__site_stats().Select(stats);
   html__hdump_mgr.Init_by_db(this);
   app.Addon_mgr().Load_by_wiki(this);
   ctg_pagebox_wtr.Init_by_wiki(this);
 }