mirror of
https://github.com/php/doc-ja.git
synced 2026-03-25 15:42:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@297032 c90b9560-bf6c-de11-be94-00142212c4b1
142 lines
3.7 KiB
XML
142 lines
3.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: hirokawa Status: ready -->
|
|
<!-- CREDITS: shimooka -->
|
|
<refentry xml:id="function.sqlite-udf-decode-binary" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>sqlite_udf_decode_binary</refname>
|
|
<refpurpose>
|
|
<acronym>UDF</acronym>にパラメータとして渡されたバイナリデータをデコードする
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>sqlite_udf_decode_binary</methodname>
|
|
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
パラメータで渡されたバイナリデータを <acronym>UDF</acronym>
|
|
にデコードします。
|
|
</para>
|
|
<para>
|
|
バイナリデータをUDFにより処理させる必要がある場合、UDFに渡されたパ
|
|
ラメータに関してこの関数をコールする必要があります。
|
|
これは、PHPにより適用されたバイナリエンコーディングが内容と元のパラ
|
|
メータを隠蔽するためです。
|
|
</para>
|
|
<para>
|
|
PHP は、自動的にエンコード/デコード処理を行いません。これは、これを
|
|
行うと著しい性能劣化を生じる可能性があるためです。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
デコード対象となる、エンコードされたデータ。これは
|
|
<function>sqlite_udf_encode_binary</function> あるいは
|
|
<function>sqlite_escape_string</function> で作成したものです。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
デコードされた文字列を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>バイナリ対応 max_length 集約関数の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$data = array(
|
|
'one',
|
|
'two',
|
|
'three',
|
|
'four',
|
|
'five',
|
|
'six',
|
|
'seven',
|
|
'eight',
|
|
'nine',
|
|
'ten',
|
|
);
|
|
$db = sqlite_open(':memory:');
|
|
sqlite_query($db, "CREATE TABLE strings(a)");
|
|
foreach ($data as $str) {
|
|
$str = sqlite_escape_string($str);
|
|
sqlite_query($db, "INSERT INTO strings VALUES ('$str')");
|
|
}
|
|
|
|
function max_len_step(&$context, $string)
|
|
{
|
|
$string = sqlite_udf_decode_binary($string);
|
|
if (strlen($string) > $context) {
|
|
$context = strlen($string);
|
|
}
|
|
}
|
|
|
|
function max_len_finalize(&$context)
|
|
{
|
|
return $context;
|
|
}
|
|
|
|
sqlite_create_aggregate($db, 'max_len', 'max_len_step', 'max_len_finalize');
|
|
|
|
var_dump(sqlite_array_query($db, 'SELECT max_len(a) from strings'));
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>sqlite_udf_encode_binary</function></member>
|
|
<member><function>sqlite_create_function</function></member>
|
|
<member><function>sqlite_create_aggregate</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|