この色 |
外部で使用可な関数(PXBASE_SAVEクラスの関数) | |
この色 |
ユーティリティ関数(PXBASE_SAVEクラスの関数では無い) | |
この色 |
内部で使用するサブ関数(PXBASE_SAVEクラスの関数) | |
戻り値 | 関数名 | パラメーター |
---|---|---|
オブジェクト |
PXBASE_PRESS |
(String dbname,string table,int linkid) |
コンストラクタ。 データベース名、テーブル名をセットする。 例 $link = new mysqli($host,$user,$pass,$dbname); $base = new PXBASE_PRESS("test","test_table",$link); | ||
戻り値 | 関数名 | パラメーター |
ResultSet |
do_query |
(string sql,string func) |
SQL文を実行する。 失敗した場合はロールバックを行う。 例 $result = $base->do_query("select * from $base->table","get_elements"); | ||
戻り値 | 関数名 | パラメーター |
begin |
() | |
トランザクション処理の開始。InnoDB用。 例 $base->begin(); | ||
戻り値 | 関数名 | パラメーター |
commit |
() | |
トランザクション処理の終了。InnoDB用。 例 $base->commit(); | ||
戻り値 | 関数名 | パラメーター |
lock |
() | |
テーブルをwrite Lockする。 例 $base->lock(); | ||
戻り値 | 関数名 | パラメーター |
unlock |
() | |
テーブルロックを解除する。 例 $base->unlock(); | ||
戻り値 | 関数名 | パラメーター |
free_result |
(ResultSet result) | |
結果保持用メモリを開放する。 例 $base->free_result($result); | ||
戻り値 | 関数名 | パラメーター |
int(num) |
num_rows |
(ResultSet result) |
ResultSetの行数を返す。 例 $num = $base->num_rows($result); | ||
戻り値 | 関数名 | パラメーター |
mix |
result |
(ResultSet result,int row,mix field) |
row行目のfieldの値またはfield番目の値を返す。 例 $value = $base->result($result,0,0); 例 $value = $base->result($result,0,"value"); | ||
戻り値 | 関数名 | パラメーター |
make_table |
(string db,int flg) | |
テーブル名のテーブルを作成する。 テーブル名はコンストラクタでセットする。 db="InnoDB"の場合はInnoDBのテーブルを作成する。 db=""の場合は通常のMySQLのテーブルを作成する。 flg=1:既存のテーブルを削除する。 例 $base->make_table("InnoDB",1); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
get_root |
() |
ルートのid番号を取得する。 例 $root = $base->get_root(); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
get_doc_root |
() |
ドキュメントルートのid番号を取得する。 例 $doc_root = $base->get_doc_root(); | ||
戻り値 | 関数名 | パラメーター |
boolean |
is_exist |
(int id) |
id番のノードが存在するかどうかチェックする。 例 $check = $base->is_exist($id); | ||
戻り値 | 関数名 | パラメーター |
boolean |
is_element |
(int id) |
id番のノードが要素かどうかチェックする。 例 $check = $base->is_element($id); | ||
戻り値 | 関数名 | パラメーター |
boolean |
is_attrib |
(int id) |
id番のノードが属性ノードかどうかチェックする。 例 $check = $base->is_attrib($id); | ||
戻り値 | 関数名 | パラメーター |
boolean |
is_comment |
(int id) |
id番のノードがコメントノードかどうかチェックする。 例 $check = $base->is_comment($id); | ||
戻り値 | 関数名 | パラメーター |
boolean |
is_dtd |
(int id) |
id番のノードがDTDノードかどうかチェックする。 例 $check = $base->is_dtd($id); | ||
戻り値 | 関数名 | パラメーター |
boolean |
is_pi |
(int id) |
id番のノードがPIノードかどうかチェックする。 例 $check = $base->is_pi($id); | ||
戻り値 | 関数名 | パラメーター |
boolean |
is_xml |
(int id) |
id番のノードがXML宣言ノードかどうかチェックする。 例 $check = $base->is_xml($id); | ||
戻り値 | 関数名 | パラメーター |
Array(id) |
get_elements |
(int id,string path) |
id番の要素からの相対パス(path)に相当する要素の集合を配列に返す。 例 $node_array = $base->get_elements($id,"child1"); | ||
戻り値 | 関数名 | パラメーター |
Array(id) |
get_elements_ns |
(int id,string path,string ns) |
id番の要素からの相対パス(path)に相当する要素(ネームスペースns)の集合を配列に返す。 例 $node_array = $base->get_elements_ns($id,"child1","ns1"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
get_first_element |
(int id,string path) |
id番の要素からの相対パス(path)に相当する最初の要素を返す。 例 $element = $base->get_first_element($id,"child1/grandchild1"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
get_first_element_ns |
(int id,string path,string ns) |
id番の要素からの相対パス(path)に相当する最初の要素(ネームスペースns)を返す。 例 $element = $base->get_first_element_ns($id,"child1/grandchild1","ns1"); | ||
戻り値 | 関数名 | パラメーター |
Array(id) |
get_child_elements |
(int id,string child_name) |
id番の要素のchild_nameという名前の子要素の集合を配列に返す。 child_nameが*の場合全ての子要素の集合を配列に返す。 例 $node_array = $base->get_child_elements($id,"*"); | ||
戻り値 | 関数名 | パラメーター |
Array(id) |
get_child_elements_ns |
(int id,string child_name,string ns) |
id番の要素のchild_nameという名前の子要素(ネームスペースns)の集合を配列に返す。 child_nameが*の場合全ての子要素(ネームスペースns)の集合を配列に返す。 例 $node_array = $base->get_child_elements_ns($id,"*","ns1"); | ||
戻り値 | 関数名 | パラメーター |
Array(id) |
get_comments |
(int id) |
親がid番の要素のコメントノードのidの集合を配列に返す。 例 $node_array = $base->get_comments($parent); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
get_parent |
(int id) |
id番のノードの親のidを返す。 例 $parent = $base->get_parent($element); | ||
戻り値 | 関数名 | パラメーター |
string |
get_value |
(int id) |
id番の要素の子テキストノードの値を結合して返す。 結合時にtrimを行いnを挿入する。 例 $value = $base->get_value($id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_child_value |
(int id,string child_name) |
id番の要素のchild_nameの名前の子要素の値を返す。 値はget_value関数を用いて取ってくる。 例 $value = $base->get_child_value($id,$child_name); | ||
戻り値 | 関数名 | パラメーター |
string |
get_child_value_ns |
(int id,string child_name,string ns) |
id番の要素のns:child_nameの名前の子要素の値を返す。 値はget_value関数を用いて取ってくる。 例 $value = $base->get_child_value_ns($id,"child_name","ns1"); | ||
戻り値 | 関数名 | パラメーター |
string |
get_comment |
(int id) |
id番のコメントノードの値を返す。 例 $comment = $base->get_comment($id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_pi |
(int id) |
id番のPIノードの値を返す。 例 $pi = $base->get_pi($id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_xml |
(int id) |
id番のXML宣言ノードの値を返す。 例 $xml = $base->get_xml($id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_dtd |
(int id) |
id番のDTDノードの値を返す。 例 $dtd = $base->get_dtd($id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_ns |
(int id) |
id番の要素のネームスペース返す。 例 $ns = $base->get_ns($id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_uri |
(string ns,int id) |
ネームスペースnsのURIを返す。 デフォルトのネームスペース("")の場合はid要素のURIを返す。 例 $uri = $base->get_uri("",$id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_node_name |
(int id) |
id番のノードのnameを返す。 例 $name = $base->get_node_name($id); | ||
戻り値 | 関数名 | パラメーター |
int |
get_node_type |
(int id) |
id番のノードのtypeを返す。 例 $type = $base->get_node_type($id); | ||
戻り値 | 関数名 | パラメーター |
string |
get_node_value |
(int id) |
id番のノードの値を返す。 例 $value = $base->get_node_value($id); | ||
戻り値 | 関数名 | パラメーター |
int(pos) |
get_node_pos |
(int id) |
id番のノードのposを返す。 例 $pos = $base->get_node_pos($id); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
get_node_parent |
(int id) |
id番のノードの親ノードのidを返す。 例 $parent = $base->get_node_parent($id); | ||
戻り値 | 関数名 | パラメーター |
Array(id) |
get_nodes |
(int type) |
typeのtypeを持つノードのidの集合を配列に返す。 例 $node_array = $base->get_nodes($type); $ELEMENT_TYPE = 1; $ATTR_TYPE = 2; $TEXT_TYPE = 3; $DTD_TYPE = 4; $PI_TYPE = 5; $COMMENT_TYPE = 6; $XML_TYPE = 7; | ||
戻り値 | 関数名 | パラメーター |
string |
get_attrib |
(int id,string attrib_name) |
id番の要素のattrib_nameの属性ノードの値を返す。 例 $attrib_value = $base->get_attrib($id,"attrib_name"); | ||
戻り値 | 関数名 | パラメーター |
Array(id) |
get_attribs |
(int id) |
id番の要素の子属性ノードのidの集合を配列に返す。 例 $node_array = $base->get_attribs($id); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
del_child |
(int id) |
id番のノードを分離する。 id番のparentをnullに、posを1にする。 idを返す。 例 $base->del_child($id); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
del_child_element |
(int id,string child_name) |
id番の要素のchild_nameの名前をもつ子要素を分離する。 分離したノードのidを返す。 分離にはdel_child関数を使用する。 例 $child = $base->del_child_element($id,"child_name"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
del_child_element_ns |
(int id,string child_name,string ns) |
id番の要素のns:child_nameの名前をもつ子要素を分離する。 分離したノードのidを返す。 分離にはdel_child関数を使用する。 例 $child = $base->del_child_element_ns($id,"child_name","ns1"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
del_attrib |
(int id,string attrib_name) |
id番の要素のattrib_nameの子属性ノードを分離する。 分離したノードのidを返す。 分離にはdel_child関数を使用する。 例 $attrib = $base->del_attrib($id,"attrib_name"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
del_comment |
(int id) |
id番のコメントノードを分離する。 分離したノードのidを返す。 分離にはdel_child関数を使用する。 例 $comment = $base->del_comment($id); | ||
戻り値 | 関数名 | パラメーター |
del_element_value |
(int id) | |
id番の要素の子テキストノードを全て削除する。 例 $base->del_element_value($id); | ||
戻り値 | 関数名 | パラメーター |
del_node |
(int id,int flg) | |
flg=1の場合:id番のノード以下全ての子孫ノード(id番も含む)を削除する。 flg=1以外の場合:id番のノードを削除する。 例 $base->del_node($id,0); | ||
戻り値 | 関数名 | パラメーター |
add_child |
(int id,int child_id) | |
id番の要素にchild_idの要素を子要素として加える。 例 $base->add_child($id,$child); | ||
戻り値 | 関数名 | パラメーター |
add_attrib |
(int id,int attrib_id) | |
id番の要素の属性としてattrib_idのノードを加える。 例 $base->add_attrib($id,$attrib_id); | ||
戻り値 | 関数名 | パラメーター |
add_comment |
(int id,int comment_id) | |
id番の要素の子としてcomment_idのノードを加える。 例 $base->add_comment($id,$comment_id); | ||
戻り値 | 関数名 | パラメーター |
insert_child |
(int id,int child_id,int ref_id) | |
id番の要素の子要素としてchild_idの要素をref_idの要素の前に挿入する。 例 $base->insert_child($id,$child,$ref); | ||
戻り値 | 関数名 | パラメーター |
insert_attrib |
(int id,int child_id,int ref_id) | |
id番の要素の子属性ノードとしてchild_idのノードをref_idのノードの前に挿入する。 例 $base->insert_attrib($id,$child,$ref); | ||
戻り値 | 関数名 | パラメーター |
insert_comment |
(int id,int child_id,int ref_id) | |
id番の要素の子コメントノードとしてchild_idのノードをref_idのノードの前に挿入する。 例 $base->insert_comment($id,$child,$ref); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_element |
(string name,string value) |
要素名name、値valueの要素ノードを作成する。 要素ノードのidを返す。 例 $element = $base->make_element("name","value"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_element_ns |
(string name,string value,string ns) |
要素名ns:name、値valueの要素ノードを作成する。 要素ノードのidを返す。 例 $element = $base->make_element("name","value","ns1"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_attrib |
(string name,string value) |
属性名name、値valueの属性ノードを作成する。 例 $attrib = $base->make_attrib("attrib_name","attrib_value"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_comment |
(string comment) |
値がcommentのコメントノードを作成する。 例 $comment = $base->make_comment("<!-- コメント -->"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_doc_root |
(string name,string value) |
名前がname、値がvalueのドキュメントルート要素を作成する。 例 $doc_root = $base->make_doc_root("node_name","node_value"); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_dtd |
(string dtd) |
値がdtdのDTDノードを作成する。 例 $dtd = $base->make_dtd($dtd); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_xml |
(string xml) |
値がxmlのXML宣言ノードを作成する。 例 $xml = $base->make_xml($xml); | ||
戻り値 | 関数名 | パラメーター |
int(id) |
make_pi |
(string target,string data) |
ターゲットがtargetでプログラムがdataのPIノードを作成する。 例 $xml = $base->make_pi("php","print "test";"); | ||
戻り値 | 関数名 | パラメーター |
set_value |
(int id,string value) | |
id番の要素の値としてvalueをセットする。 例 $base->set_value($id,"value"); | ||
戻り値 | 関数名 | パラメーター |
set_attrib |
(int id,string name,string value) | |
id番の要素に属性名name、値valueをせっとする。 属性名nameの属性がない場合は作成する。 例 $base->set_attrib($id,"attrib_name","attrib_value"); | ||
戻り値 | 関数名 | パラメーター |
set_node_name |
(int id,string name) | |
id番のノードの名前をnameにセットする。 例 $base->set_node_name("new_name"); | ||
戻り値 | 関数名 | パラメーター |
set_ns |
(int id,string ns) | |
id番の要素ノードのネームスペースをnsにセットする。 例 $base->set_ns($id,"ns1"); | ||
戻り値 | 関数名 | パラメーター |
set_uri |
(string ns,string uri) | |
ネームスペースnsのURIをuriにセットする。 例 $base->set_uri("ns1","uri1"); | ||
戻り値 | 関数名 | パラメーター |
write_attribs |
(int id) | |
id番の要素の属性を内部バッファに出力する。 例 $base->write_attribs($id); | ||
戻り値 | 関数名 | パラメーター |
write_comment |
(int id) | |
id番のコメントノードを内部バッファに出力する。 例 $base->write_comment($id); | ||
戻り値 | 関数名 | パラメーター |
write_node |
(int id,int level) | |
id番のノード以下の子孫ノードを内部バッファに出力する。 行の始めにlevelの数だけタブを挿入する。 例 $base->write_node($doc_root,0); | ||
戻り値 | 関数名 | パラメーター |
write_document |
(file fp,int flg) | |
ドキュメントを書き出す。 fp=""の場合はXML文書を返す。 flg=1の場合はDTD、PIも書き出す。 例 $fp = fopen("sample.xml","w"); $base->write_document($fp,1); | ||
戻り値 | 関数名 | パラメーター |
press |
() | |
データーベースを圧縮する。 圧縮後はpxbase_press.incを使用して処理する。 例 $base->press(); |