mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.8.1.1
This commit is contained in:
@@ -35,7 +35,7 @@ public class Xoa_app_type {
|
||||
}
|
||||
private static final int Uid_cmd = 1, Uid_gui = 2, Uid_tcp = 3, Uid_http = 4, Uid_file = 5;
|
||||
private static final byte[] Key_cmd = Bry_.new_a7("cmd"), Key_gui = Bry_.new_a7("gui"), Key_tcp = Bry_.new_a7("server"), Key_http = Bry_.new_a7("http_server"), Key_file = Bry_.new_a7("file");
|
||||
private static final Hash_adp_bry type_hash = Hash_adp_bry.cs_()
|
||||
private static final Hash_adp_bry type_hash = Hash_adp_bry.cs()
|
||||
.Add_bry_int(Key_cmd , Uid_cmd)
|
||||
.Add_bry_int(Key_gui , Uid_gui)
|
||||
.Add_bry_int(Key_http , Uid_http)
|
||||
|
||||
@@ -74,7 +74,7 @@ public class Xoa_gfs_php_mgr {
|
||||
)
|
||||
throw Err_.new_wo_type("invalid gfs; num_end not found", "src", String_.new_u8(src));
|
||||
bfr.Add_byte(Byte_ascii.Dollar);
|
||||
int arg_idx = Bry_.Xto_int_or(src, num_bgn, num_end, -1);
|
||||
int arg_idx = Bry_.To_int_or(src, num_bgn, num_end, -1);
|
||||
if (arg_idx == -1) {
|
||||
throw Err_.new_wo_type("invalid int");
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class Xoa_gfs_php_mgr {
|
||||
break;
|
||||
case Byte_ascii.Dollar:
|
||||
int end_pos = Php_text_itm_parser.Find_fwd_non_int(raw, i + 1, raw_len);
|
||||
int int_val = Bry_.Xto_int_or(raw, i + 1, end_pos, -1);
|
||||
int int_val = Bry_.To_int_or(raw, i + 1, end_pos, -1);
|
||||
bfr.Add_byte(Bry_fmtr.char_escape).Add_byte(Bry_fmtr.char_arg_bgn).Add_int_variable(int_val - 1).Add_byte(Bry_fmtr.char_arg_end);
|
||||
i = end_pos - 1;
|
||||
break;
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.apps.caches; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
|
||||
import gplx.xowa.xtns.wdatas.*;
|
||||
public class Wdata_doc_cache {
|
||||
private Hash_adp_bry hash = Hash_adp_bry.cs_();
|
||||
private Hash_adp_bry hash = Hash_adp_bry.cs();
|
||||
public void Add(byte[] qid, Wdata_doc doc) {hash.Add(qid, doc);}
|
||||
public Wdata_doc Get_or_null(byte[] qid) {return (Wdata_doc)hash.Get_by_bry(qid);}
|
||||
public void Free_mem_all() {this.Clear();}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Xoa_fsys_eval implements Bry_fmtr_eval_mgr {
|
||||
}
|
||||
}
|
||||
private static final byte Tid_bin_plat_dir = 0, Tid_user_temp_dir = 1, Tid_xowa_root_dir = 2, Tid_user_cfg_dir = 3;
|
||||
private static final Hash_adp_bry hash = Hash_adp_bry.ci_ascii_()
|
||||
private static final Hash_adp_bry hash = Hash_adp_bry.ci_a7()
|
||||
.Add_str_byte("bin_plat_dir" , Tid_bin_plat_dir)
|
||||
.Add_str_byte("user_temp_dir" , Tid_user_temp_dir)
|
||||
.Add_str_byte("xowa_root_dir" , Tid_xowa_root_dir)
|
||||
|
||||
24
400_xowa/src/gplx/xowa/apps/metas/Xoa_meta_mgr.java
Normal file
24
400_xowa/src/gplx/xowa/apps/metas/Xoa_meta_mgr.java
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.metas; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
|
||||
public class Xoa_meta_mgr {
|
||||
public Xoa_meta_mgr(Xoa_app app) {
|
||||
this.ns_mgr = new Xoa_ns_mgr(app);
|
||||
}
|
||||
public Xoa_ns_mgr Ns_mgr() {return ns_mgr;} private final Xoa_ns_mgr ns_mgr;
|
||||
}
|
||||
49
400_xowa/src/gplx/xowa/apps/metas/Xoa_ns_mgr.java
Normal file
49
400_xowa/src/gplx/xowa/apps/metas/Xoa_ns_mgr.java
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.apps.metas; import gplx.*; import gplx.xowa.*; import gplx.xowa.apps.*;
|
||||
import gplx.dbs.*;
|
||||
import gplx.xowa.langs.cases.*;
|
||||
import gplx.xowa.wmfs.data.*;
|
||||
public class Xoa_ns_mgr {
|
||||
private final Xoa_app app;
|
||||
private final Hash_adp_bry hash = Hash_adp_bry.cs();
|
||||
private Xowmf_site_tbl wmf_site_tbl; private Xowmf_ns_tbl wmf_ns_tbl;
|
||||
public Xoa_ns_mgr(Xoa_app app) {
|
||||
this.app = app;
|
||||
}
|
||||
public void Add(byte[] wiki_domain, Xow_ns_mgr ns_mgr) {hash.Add(wiki_domain, ns_mgr);} // TEST:
|
||||
public Xow_ns_mgr Get_or_load(byte[] wiki_domain) {
|
||||
Xow_ns_mgr rv = (Xow_ns_mgr)hash.Get_by_bry(wiki_domain);
|
||||
if (rv == null) {
|
||||
rv = Load(wiki_domain);
|
||||
Add(wiki_domain, rv);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
private Xow_ns_mgr Load(byte[] wiki_domain) {
|
||||
Xow_ns_mgr rv = new Xow_ns_mgr(Xol_case_mgr_.U8());
|
||||
if (wmf_site_tbl == null) {
|
||||
Db_conn conn = Xowmf_site_tbl.Get_conn_or_new(app.Fsys_mgr().Root_dir());
|
||||
wmf_site_tbl = new Xowmf_site_tbl(conn);
|
||||
wmf_ns_tbl = new Xowmf_ns_tbl(conn);
|
||||
}
|
||||
int site_id = wmf_site_tbl.Select_id(String_.new_u8(wiki_domain));
|
||||
wmf_ns_tbl.Select_all(rv, site_id);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user