1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.31 $ -->
<reference id="ref.info">
<title>PHP オプションと情報(info)</title>
<titleabbrev>PHP オプション/情報</titleabbrev>
<refentry id="function.assert">
<refnamediv>
<refname>assert</refname>
<refpurpose>assertion が &false; であるかどうかを調べる</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>assert</methodname>
<methodparam><type>string|bool</type><parameter>assertion</parameter></methodparam>
</methodsynopsis>
<para>
<function>assert</function> は、指定した
<parameter>assertion</parameter>を調べて、結果が
&false;の場合に適当な動作をします。
</para>
<para>
<parameter>assertion</parameter> が文字列として指定された場合、
<function>assert</function>によりPHPコードとして評価されます。
文字列 <parameter>assertion</parameter>が優れているところは、
assertion のチェックがオフになった場合のオーバーヘッドがより少な
いことであり、assertionが失敗した場合のメッセージを式
<parameter>assertion</parameter>に有しています。
</para>
<para>
assertion は、デバッグ目的にのみ使用するべきです。
assertion を常に&true;となる条件を調べる不具合診断に使用し、&true;でな
い場合に何らかのプログラミングエラーを示したり、extension 関数ま
たは特定のシステム制限や機能といった特定の機能の存在をチェックす
るために使用することが可能です。
</para>
<para>
assersion は、入力パラメータのチェックのような通常の実行動作に使
用するべきではありません。一般的には、assertion のチェックが有効
でない場合に自分のコードを常に正常に動作することができる必要があり
ます。
</para>
<para>
<function>assert</function> の動作は、
<function>assert_options</function> またはマニュアルの関数の部分
に記述された .ini の設定により設定することが可能です。
</para>
<para>
関数 <function>assert_options</function> かつ/または
ASSERT_CALLBACK 設定ディレクティブにより失敗したassertionを
処理するコールバック関数を設定することが可能です。
</para>
<para>
<function>assert</function> のコールバックは、assertionが発生
した場所に関する情報と共にassertionに渡されたコードを容易にキャ
プチャーできるため、特に自動テストセットを構築する際に便利です。
この情報は他の手法でもキャプチャー可能ですが、assertionを使用
することにより、より簡単かつ容易に行なうことが可能です!
</para>
<para>
コールバック関数は、3つの引数を受ける必要があります。最初の引数
は、assertionが失敗したファイルが含まれます。2番目の引数には、
assertionが失敗した行が含まれ、3番目の引数には失敗した式が含ま
れます。(もしある場合のみ。1または"two"のようなリテラルの値はこ
の引数に渡されません)
</para>
<para>
<example>
<title>カスタムハンドラで失敗したassertionを処理する</title>
<programlisting role="php">
<![CDATA[
<?php
// assertを有効にし、出力を抑制する
assert_options (ASSERT_ACTIVE, 1);
assert_options (ASSERT_WARNING, 0);
assert_options (ASSERT_QUIET_EVAL, 1);
// ハンドラ関数を作成する
function my_assert_handler ($file, $line, $code) {
echo "<hr>Assertion Failed:
File '$file'<br>
Line '$line'<br>
Code '$code'<br><hr>";
}
// コールバックを設定する
assert_options (ASSERT_CALLBACK, 'my_assert_handler');
// 失敗するassertionを作成
assert ('mysql_query ("")');
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.assert-options">
<refnamediv>
<refname>assert_options</refname>
<refpurpose>様々な assert フラグを設定/取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>mixed</type><methodname>assert_options</methodname>
<methodparam><type>int</type><parameter>what</parameter></methodparam>
<methodparam><type>mixed</type><parameter>
<replaceable><optional>value</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
<function>assert_options</function> を使用して、種々の
<function>assert</function>制御オプションを設定したり、
単にカレントの設定を調べたりすることが可能です。
</para>
<table>
<title>assert オプション</title>
<tgroup cols="4">
<thead>
<row>
<entry>オプション</entry>
<entry>iniパラメータ</entry>
<entry>デフォルト</entry>
<entry>説明</entry>
</row>
</thead>
<tbody>
<row>
<entry>ASSERT_ACTIVE</entry>
<entry>assert.active</entry>
<entry>1</entry>
<entry><function>assert</function>による評価を有効にする</entry>
</row>
<row>
<entry>ASSERT_WARNING</entry>
<entry>assert.warning</entry>
<entry>1</entry>
<entry>assersionに失敗した場合にPHP警告を発生する</entry>
</row>
<row>
<entry>ASSERT_BAIL</entry>
<entry>assert.bail</entry>
<entry>0</entry>
<entry>assersionに失敗した場合に実行を終了する</entry>
</row>
<row>
<entry>ASSERT_QUIET_EVAL</entry>
<entry>assert.quiet_eval</entry>
<entry>0</entry>
<entry>
assersion式についてはerror_reportingを無効にする
</entry>
</row>
<row>
<entry>ASSERT_CALLBACK</entry>
<entry>assert_callback</entry>
<entry>(&null;)</entry>
<entry>assertionに失敗した場合にコールされるユーザ関数</entry>
</row>
</tbody>
</tgroup>
</table>
<para>
<function>assert_options</function> は、指定したオプションの元の
設定値またはエラーの場合に&false;を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.extension-loaded">
<refnamediv>
<refname>extension_loaded</refname>
<refpurpose>ある拡張機能がロードされているかどうかを調べる</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>bool</type><methodname>extension_loaded</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
<simpara>
<parameter>name</parameter> で指定する拡張機能がロードされている
場合に&true;を返します。<function>phpinfo</function> を用いて種々
の拡張機能の名前を知ることができます。
</simpara>
<para>
<function>phpinfo</function> も参照下さい。
<note>
<para>
この関数は、3.0.10 で追加されました。
</para>
</note>
</para>
</refsect1>
</refentry>
<refentry id="function.dl">
<refnamediv>
<refname>dl</refname>
<refpurpose>実行時にPHP拡張モジュールをロードする</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>dl</methodname>
<methodparam><type>string</type><parameter>library</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>library</parameter>にあるPHP拡張モジュールをロードしま
す。設定ディレクティブ<link
linkend="ini.extension-dir">extension_dir</link>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.getenv">
<refnamediv>
<refname>getenv</refname>
<refpurpose>環境変数の値を取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>getenv</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>varname</parameter> が示す環境変数の値を返し、
エラーの場合は&false;を返します。
<informalexample>
<programlisting role="php">
<![CDATA[
$ip = getenv("REMOTE_ADDR"); // ユーザーのIPアドレスを得ます
]]>
</programlisting>
</informalexample>
</para>
<para>
<function>phpinfo</function> を使用して全ての環境変数の一覧を見る
ことができます。
<ulink url="&url.cgispecs;">CGI specification</ulink> 、特に
<ulink url="&url.cgispec;">環境変数のページ</ulink>を参照すること
により、それらの参照する環境変数の役割の多くを知ることができます。
<note>
<para>
この関数は、ISAPIモードでは動作しません。
</para>
</note>
</para>
<para>
<function>putenv</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.get-cfg-var">
<refnamediv>
<refname>get_cfg_var</refname>
<refpurpose>PHP 設定オプションの値を取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>get_cfg_var</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
</methodsynopsis>
<simpara>
<parameter>varname</parameter> で指定された PHP 設定オプション
の現在の値を返し、エラーの場合は&false;を返します。
</simpara>
<simpara>
この関数は、
PHP がコンパイルされた際にセットされた設定情報や
Apache の設定ファイルから(php3_configuration_option 命令により)
読んだ設定情報は返しません。
</simpara>
<simpara>
システムが <link linkend="configuration.file">設定ファイル</link>
を使用しているかどうかを確認するには、cfg_file_path の設定値を
取得してみて下さい。
この値が利用可能なら、設定ファイルが使用されています。
</simpara>
<simpara>
<function>ini_get</function>も参照下さい。
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-current-user">
<refnamediv>
<refname>get_current_user</refname>
<refpurpose>現在の PHP スクリプトの所有者の名前を取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>get_current_user</methodname>
<void/>
</methodsynopsis>
<simpara>
現在の PHP スクリプトの所有者の名前を返します。
</simpara>
<simpara>
<function>getmyuid</function>,
<function>getmypid</function>,
<function>getmyinode</function>,
<function>getlastmod</function> も参照して下さい。
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-defined-constants">
<refnamediv>
<refname>get_defined_constants</refname>
<refpurpose>
全ての定数の名前とその値を連想配列として返す
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>get_defined_constants</methodname>
<void/>
</methodsynopsis>
<para>
この関数は、現在定義されている全ての定数の名前と値を返します。返
される値には、拡張モジュールにより作成された定数や
<function>define</function>関数で作成された定数も含まれます。
</para>
<para>
例えば、以下の行を見てみましょう。
<informalexample>
<programlisting>
<![CDATA[
print_r (get_defined_constants());
]]>
</programlisting>
</informalexample>
この例の出力は以下のようになります。
<informalexample>
<programlisting>
<![CDATA[
Array
(
[E_ERROR] => 1
[E_WARNING] => 2
[E_PARSE] => 4
[E_NOTICE] => 8
[E_CORE_ERROR] => 16
[E_CORE_WARNING] => 32
[E_COMPILE_ERROR] => 64
[E_COMPILE_WARNING] => 128
[E_USER_ERROR] => 256
[E_USER_WARNING] => 512
[E_USER_NOTICE] => 1024
[E_ALL] => 2047
[TRUE] => 1
)
]]>
</programlisting>
</informalexample>
</para>
<para>
<function>get_loaded_extensions</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.get-extension-funcs">
<refnamediv>
<refname>get_extension_funcs</refname>
<refpurpose>
あるモジュールの関数名を配列として返す
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>get_extension_funcs</methodname>
<methodparam><type>string</type><parameter>module_name</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、<parameter>module_name</parameter>で示したモジュール
で定義された全ての関数の名前を返します。
</para>
<para>
例えば以下のようになります。
<informalexample>
<programlisting>
<![CDATA[
print_r (get_extension_funcs ("xml"));
print_r (get_extension_funcs ("gd"));
]]>
</programlisting>
</informalexample>
この例は、モジュール<varname>xml</varname>および
<varname>gd</varname>の関数のリストをそれぞれ表示します。
</para>
<para>
<function>get_loaded_extensions</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.getmygid">
<refnamediv>
<refname>getmygid</refname>
<refpurpose>PHPスクリプトの所有者のGIDを得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>getmygid</methodname>
<void/>
</methodsynopsis>
<simpara>
カレントのスクリプトのグループIDを返します。またはエラー時に
&false;を返します。
</simpara>
<simpara>
<function>getmyuid</function>,
<function>getmypid</function>,
<function>get_current_user</function>,
<function>getmyinode</function>,
<function>getlastmod</function>も参照下さい。
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-included-files">
<refnamediv>
<refname>get_included_files</refname>
<refpurpose>
includeまたはrequireで読み込まれたファイルの名前を配列として返す
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>get_included_files</methodname>
<void/>
</methodsynopsis>
<para>
この関数は、<function>include</function>,
<function>include_once</function>, <function>require</function>,
<function>require_once</function>によりスクリプトにロードされた
全てのファイルの名前を配列として返します。
</para>
<para>
複数回読み込まれたファイルも返される配列には一度しかあらわれませ
ん。
</para>
<note>
<para>
設定ディレクティブ<literal>auto_prepend_file</literal>により読み
込まれたファイルは、返される配列には含まれません。
</para>
</note>
<para>
<example>
<title><function>get_included_files</function>の例</title>
<programlisting role="php">
<![CDATA[
<?php
include("test1.php");
include_once("test2.php");
require("test3.php");
require_once("test4.php");
$included_files = get_included_files();
foreach($included_files as $filename) {
echo "$filename\n";
}
?>
]]>
</programlisting>
</example>
は以下の出力を生成します。
<informalexample>
<programlisting>
<![CDATA[
test1.php
test2.php
test3.php
test4.php
]]>
</programlisting>
</informalexample>
</para>
<note>
<para>
PHP 4.0.1pl2および以前のバージョンにおいて、
<function>get_included_files</function>は、読み込まれるファイル
が拡張子<literal>.php</literal>で終ることを仮定しており、他の拡
張子のファイルは返されませんでした。
<function>get_included_files</function>により返される配列は、連
想配列であり、<function>include</function>および
<function>include_once</function>で読み込まれたファイルのみが一
覧に含まれていました。
</para>
</note>
<para>
<function>include</function>,
<function>include_once</function>, <function>require</function>,
<function>require_once</function>,
<function>get_required_files</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.get-loaded-extensions">
<refnamediv>
<refname>get_loaded_extensions</refname>
<refpurpose>
コンパイル/ロードされている全てのモジュールの名前を配列として返す
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>get_loaded_extensions</methodname>
<void/>
</methodsynopsis>
<para>
この関数は、PHPインタプリタにコンパイル、ロードされている全てのモ
ジュールの名前を返します。
</para>
<para>
例えば以下のようになります。
<informalexample>
<programlisting role="php">
<![CDATA[
print_r (get_loaded_extensions());
]]>
</programlisting>
</informalexample>
この例の出力は以下のようになります。
<informalexample>
<programlisting>
<![CDATA[
Array
(
[0] => xml
[1] => wddx
[2] => standard
[3] => session
[4] => posix
[5] => pgsql
[6] => pcre
[7] => gd
[8] => ftp
[9] => db
[10] => Calendar
[11] => bcmath
)
]]>
</programlisting>
</informalexample>
</para>
<para>
<function>get_extension_funcs</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.get-magic-quotes-gpc">
<refnamediv>
<refname>get_magic_quotes_gpc</refname>
<refpurpose>magic quotes gpc の現在アクティブな設定を得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>long</type><methodname>get_magic_quotes_gpc</methodname>
<void/>
</methodsynopsis>
<simpara>
<link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link>
の現在アクティブな設定を返します。(オフの場合 0、オンの場合 1)
</simpara>
<simpara>
<function>get_magic_quotes_runtime</function>,
<function>set_magic_quotes_runtime</function>も参照下さい。
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-magic-quotes-runtime">
<refnamediv>
<refname>get_magic_quotes_runtime</refname>
<refpurpose>
magic_quotes_runtime の現在アクティブな設定値を得ます
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>long</type><methodname>get_magic_quotes_runtime</methodname>
<void/>
</methodsynopsis>
<simpara>
<link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link>
の現在アクティブな値を返します。
(オフの場合 0、オンの場合 1)
</simpara>
<simpara>
<function>get_magic_quotes_gpc</function>,
<function>set_magic_quotes_runtime</function> も参照下さい。
</simpara>
</refsect1>
</refentry>
<refentry id="function.getlastmod">
<refnamediv>
<refname>getlastmod</refname>
<refpurpose>最終ページ更新時刻を取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>getlastmod</methodname>
<void/>
</methodsynopsis>
<para>
現在のページが最後に更新された時刻を返します。返される
値は Unix のタイムスタンプで、そのまま <function>date
</function>に渡す事ができます。エラーの場合は&false;を返します。
<example>
<title><function>getlastmod</function>の例</title>
<programlisting role="php">
<![CDATA[
// たとえば、'最終更新時刻:March 04 1998 20:43:59.' を出力する
echo "最終更新時刻:".date( "F d Y H:i:s.", getlastmod() );
]]>
</programlisting>
</example>
</para>
<para>
<function>date</function>,
<function>getmyuid</function>,
<function>get_current_user</function>,
<function>getmyinode</function>,
<function>getmypid</function> も参照して下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.getmyinode">
<refnamediv>
<refname>getmyinode</refname>
<refpurpose>現在のスクリプトの i ノードを取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>getmyinode</methodname>
<void/>
</methodsynopsis>
<para>
現在のスクリプトのiノードを返し、エラーの場合は&false;を返しま
す。
</para>
<para>
<function>getmygid</function>,
<function>getmyuid</function>,
<function>get_current_user</function>,
<function>getmypid</function>,
<function>getlastmod</function> も参照下さい。
</para>
¬e.no-windows;
</refsect1>
</refentry>
<refentry id="function.getmypid">
<refnamediv>
<refname>getmypid</refname>
<refpurpose>PHP のプロセス ID を取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>getmypid</methodname>
<void/>
</methodsynopsis>
<para>
現在の PHP のプロセス ID を返し、エラーの場合は&false;を返します。
</para>
<warning>
<para>
プロセスIDはユニークではないため、エントロピ源として優れたもので
はありません。セキュリティが重要なコンテンツの場合、PIDに基づく
設計は推奨されません。
</para>
</warning>
<para>
<function>getmygid</function>,
<function>getmyuid</function>,
<function>get_current_user</function>,
<function>getmyinode</function>,
<function>getlastmod</function> も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.getmyuid">
<refnamediv>
<refname>getmyuid</refname>
<refpurpose>PHP スクリプト所有者のユーザ ID を取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>getmyuid</methodname>
<void/>
</methodsynopsis>
<simpara>
現在のスクリプトのユーザ ID を返し、エラーの場合は &false; を返します。
</simpara>
<simpara>
<function>getmygid</function>,
<function>getmypid</function>,
<function>get_current_user</function>,
<function>getmyinode</function>,
<function>getlastmod</function> も参照下さい。
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-required-files">
<refnamediv>
<refname>get_required_files</refname>
<refpurpose>
includeまたはrequireで読み込まれたファイルの名前を配列として返す
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>get_required_files</methodname>
<void/>
</methodsynopsis>
<para>
PHP 4.0.4以降、この関数は<function>get_included_files</function>
のエイリアスです。
</para>
<para>
PHP 4.0.1pl2および以前のバージョンにおいて、
<function>get_required_files</function>は、読み込まれるファイル
が拡張子<literal>.php</literal>で終ることを仮定しており、他の拡
張子のファイルは返されませんでした。
<function>get_required_files</function>により返される配列は、連
想配列であり、<function>require</function>および
<function>require_once</function>で読み込まれたファイルのみが一
覧に含まれていました。
</para>
<para>
<function>require</function>,
<function>require_once</function>, <function>include</function>,
<function>include_once</function>,
<function>get_included_files</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.getrusage">
<refnamediv>
<refname>getrusage</refname>
<refpurpose>カレントリソースの使用に関する情報を得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>getrusage</methodname>
<methodparam><type>int</type><parameter>
<replaceable><optional>who</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、getrusage(2)へのインターフェースです。
システムコールから返されたデータを有する連想配列を返します。
<parameter>who</parameter>が 1 の場合、getrusageはRUSAGE_CHILDREN
を付けてコールされます。
</para>
<para>
全てのエントリは、記述されたフィールド名を用いてアクセス可能です。
<example>
<title><function>getrusage</function> の例</title>
<programlisting role="php">
<![CDATA[
$dat = getrusage();
echo $dat["ru_nswap"]; # スワップの数
echo $dat["ru_majflt"]; # ページフォルトの数
echo $dat["ru_utime.tv_sec"]; # 使用するユーザー時間 (秒)
echo $dat["ru_utime.tv_usec"]; # 使用するユーザー時間 (マイクロ秒)
]]>
</programlisting>
</example>
更に詳細な情報は、getrusage(2)に関するシステムのmanページを参照下
さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ini-alter">
<refnamediv>
<refname>ini_alter</refname>
<refpurpose>設定オプションの値を変更する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>ini_alter</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
<methodparam><type>string</type><parameter>newvalue</parameter></methodparam>
</methodsynopsis>
<para>
設定オプションの値を変更し、失敗した際に &false;、
成功時にその設定オプションの元の値を返します。
</para>
<note>
<para>
この関数は、<function>ini_set</function>へのエイリアスです。
</para>
</note>
<para>
<function>ini_get</function>,<function>ini_get_all</function>,
<function>ini_restore</function>,<function>ini_set</function>も参
照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ini-get">
<refnamediv>
<refname>ini_get</refname>
<refpurpose>設定オプションの値を得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>ini_get</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
</methodsynopsis>
<para>
成功時に設定オプションの値を返し、失敗時に空の文字列を返します。
</para>
<para>
<function>get_cfg_var</function>,<function>ini_get_all</function>,
<function>ini_alter</function>,<function>ini_restore</function>,
<function>ini_set</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ini-get-all">
<refnamediv>
<refname>ini_get_all</refname>
<refpurpose>全ての設定オプションを得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>ini_get_all</methodname>
<methodparam choice="opt"><type>string</type><parameter>extension</parameter></methodparam>
</methodsynopsis>
<para>
全ての登録された設定オプションを連想配列として返します。オプショ
ン<parameter>extension</parameter>パラメータが設定された場合、こ
の拡張子に関するオプションのみが返されます。
</para>
<para>
<function>ini_alter</function>,
<function>ini_restore</function>,
<function>ini_get</function>,
<function>ini_set</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ini-restore">
<refnamediv>
<refname>ini_restore</refname>
<refpurpose>設定オプションの値を元に戻す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>ini_restore</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
</methodsynopsis>
<para>
指定した設定オプションを元の値に戻します。
</para>
<para>
<function>ini_alter</function>,
<function>ini_get</function>,
<function>ini_get_all</function>,
<function>ini_set</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ini-set">
<refnamediv>
<refname>ini_set</refname>
<refpurpose>設定オプションの値を設定する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>ini_set</methodname>
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
<methodparam><type>string</type><parameter>newvalue</parameter></methodparam>
</methodsynopsis>
<para>
指定した設定オプションの値を設定します。成功時に元の値を、失敗し
た際に&false;を返します。設定オプションは、スクリプトの実行中新し
い値を保持し、スクリプト終了時に元の値へ戻されます。
</para>
<para>
全てのオプションが <function>ini_set</function> を使用して変更す
ることが可能なわけではありません。以下にユーザのレベル毎に変更/設
定可能な(PHP 4.0.5-devにおける)全てのオプションのリストを示します。
<table>
<title>設定オプション</title>
<tgroup cols="3">
<thead>
<row>
<entry>名前</entry>
<entry>デフォルト</entry>
<entry>変更の可否</entry>
</row>
</thead>
<tbody>
<row>
<entry>define_syslog_variables</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>highlight.bg</entry>
<entry>HL_BG_COLOR</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>highlight.comment</entry>
<entry>HL_COMMENT_COLOR</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>highlight.default</entry>
<entry>HL_DEFAULT_COLOR</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>highlight.html</entry>
<entry>HL_HTML_COLOR</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>highlight.keyword</entry>
<entry>HL_KEYWORD_COLOR</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>highlight.string</entry>
<entry>HL_STRING_COLOR</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>allow_call_time_pass_reference</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry>
</row>
<row>
<entry>asp_tags</entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry>
</row>
<row>
<entry>display_errors</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>display_startup_errors</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>enable_dl</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>error_append_string</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>error_prepend_string</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>expose_php</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>html_errors</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>ignore_user_abort</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>implicit_flush</entry>
<entry>"0"</entry>
<entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>log_errors</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>magic_quotes_gpc</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>magic_quotes_runtime</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>magic_quotes_sybase</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>output_buffering</entry>
<entry>"0"</entry>
<entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>output_handler</entry>
<entry>&null;</entry>
<entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>register_argc_argv</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>register_globals</entry>
<entry>"1"</entry>
<entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>safe_mode</entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>short_open_tag</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry>
</row>
<row>
<entry>sql.safe_mode</entry>
<entry>"0"</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>track_errors</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>y2k_compliance</entry>
<entry>"0"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>arg_separator</entry>
<entry>"&"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>auto_append_file</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>auto_prepend_file</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>doc_root</entry>
<entry>&null;</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>default_charset</entry>
<entry>SAPI_DEFAULT_CHARSET</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>default_mimetype</entry>
<entry>SAPI_DEFAULT_MIMETYPE</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>error_log</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>extension_dir</entry>
<entry>PHP_EXTENSION_DIR</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>gpc_order</entry>
<entry>"GPC"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>include_path</entry>
<entry>PHP_INCLUDE_PATH</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>max_execution_time</entry>
<entry>"30"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>open_basedir</entry>
<entry>&null;</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>safe_mode_exec_dir</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>upload_max_filesize</entry>
<entry>"2M"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>file_uploads</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>post_max_size</entry>
<entry>"8M"</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>upload_tmp_dir</entry>
<entry>&null;</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>user_dir</entry>
<entry>&null;</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>variables_order</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>SMTP</entry>
<entry>"localhost"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>browscap</entry>
<entry>&null;</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>error_reporting</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>memory_limit</entry>
<entry>"8M"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>precision</entry>
<entry>"14"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>sendmail_from</entry>
<entry>&null;</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry>sendmail_path</entry>
<entry>DEFAULT_SENDMAIL_PATH</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>disable_functions</entry>
<entry>""</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry>allow_url_fopen</entry>
<entry>"1"</entry>
<entry>PHP_INI_ALL</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<table>
<title>PHP_INI_* 定数の説明</title>
<tgroup cols="3">
<thead>
<row>
<entry>定数</entry>
<entry>値</entry>
<entry>意味</entry>
</row>
</thead>
<tbody>
<row>
<entry>PHP_INI_USER</entry>
<entry>1</entry>
<entry>
このエントリは、ユーザスクリプトから設定可能
</entry>
</row>
<row>
<entry>PHP_INI_PERDIR</entry>
<entry>2</entry>
<entry>
このエントリは、<filename>.htaccess</filename>から設定可能
</entry>
</row>
<row>
<entry>PHP_INI_SYSTEM</entry>
<entry>4</entry>
<entry>
このエントリは、<filename>php.ini</filename> または
<filename>httpd.conf</filename> で設定可能
</entry>
</row>
<row>
<entry>PHP_INI_ALL</entry>
<entry>7</entry>
<entry>
このエントリはどこでも設定可能
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<function>ini_alter</function>,
<function>ini_get</function>,
<function>ini_restore</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.phpcredits">
<refnamediv>
<refname>phpcredits</refname>
<refpurpose>PHPに関するクレジットを出力する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>phpcredits</methodname>
<methodparam><type>int</type><parameter>flag</parameter></methodparam>
</methodsynopsis>
<para>
この関数は、PHP開発者、モジュール等のリストを有するクレジットを出
力します。ページに情報を挿入するために適当なHTMLコードが生成され
ます。出力方法を指定するパラメータ(定義済の定数フラグ、下記の表を
参照)を渡す必要があります。例えば、一般的なクレジットを生成するに
は次のようにします。
<informalexample>
<programlisting role="php">
<![CDATA[
...
phpcredits(CREDITS_GENERAL);
...
]]>
</programlisting>
</informalexample>
そして、コア開発者とドキュメントグループを一つのページに表示する
には次のようにします。
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
phpcredits(CREDITS_GROUP + CREDITS_DOCS + CREDITS_FULLPAGE);
?>
]]>
</programlisting>
</informalexample>
そして、全てのクレジットをページに埋め込みたいというような場合に
は、以下のようなコードで実行することが可能です。
<informalexample>
<programlisting role="php">
<![CDATA[
<html>
<head>
<title>My credits page</title>
</head>
<body>
<?php
// some code of your own
phpcredits(CREDITS_ALL);
// some more code
?>
</body>
</html>
]]>
</programlisting>
</informalexample>
</para>
<para>
</para>
<para>
<table>
<title>定義済の<function>phpcredits</function>フラグ</title>
<tgroup cols="2">
<thead>
<row>
<entry>名前</entry>
<entry>説明</entry>
</row>
</thead>
<tbody>
<row>
<entry>CREDITS_ALL</entry>
<entry>
このフラグは、次のフラグを使用した場合と等価です。
CREDITS_DOCS + CREDITS_GENERAL +
CREDITS_GROUP + CREDITS_MODULES + CREDITS_FULLPAGE
このフラグは、適当なタグを有する完全に独立したHTMLページを生
成します。
</entry>
</row>
<row>
<entry>CREDITS_DOCS</entry>
<entry>ドキュメントチームのクレジット</entry>
</row>
<row>
<entry>CREDITS_FULLPAGE</entry>
<entry>
通常、他のフラグと組み合わせて使用されます。他のフラグで指定
した情報を含む完全に独立したHTMLページを出力することを指定し
ます。
</entry>
</row>
<row>
<entry>CREDITS_GENERAL</entry>
<entry>
一般的なクレジット: 言語の設計およびコンセプト、PHP 4.0 の作
者、SAPIモジュール
</entry>
</row>
<row>
<entry>CREDITS_GROUP</entry>
<entry>コア開発者のリスト</entry>
</row>
<row>
<entry>CREDITS_MODULES</entry>
<entry>PHPの拡張モジュールのリスト、およびこれらの作者</entry>
</row>
<row>
<entry>CREDITS_SAPI</entry>
<entry>PHPのサーバAPIモジュールのリストとその作者</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<function>phpinfo</function>,<function>phpversion</function>,
<function>php_logo_guid</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.phpinfo">
<refnamediv>
<refname>phpinfo</refname>
<refpurpose>いろいろな PHP 情報を出力する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>phpinfo</methodname>
<methodparam><type>int</type><parameter>
<replaceable><optional>what</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
現在のPHPの状態に関する、多くの情報を出力します。出力される
情報には、PHPコンパイルオプションと拡張機能、PHPのバージョン、
サーバ情報と環境(モジュールとしてコンパイルされた場合)、
PHP の環境、OS バージョン情報、パス、構成オプションのマスター
およびローカルの値、HTTP ヘッダ、PHP Licenseなどが
あります。
</para>
<para>
オプションのパラメータ <parameter>what</parameter> に以下の値を一
つまたは複数指定することにより出力をカスタマイズすることが可能です。
(<link linkend="language.operators.bitwise">or</link>演算子により
これらを組み合わせることが可能です。)
<itemizedlist>
<listitem><simpara>INFO_GENERAL</simpara></listitem>
<listitem><simpara>INFO_CREDITS</simpara></listitem>
<listitem><simpara>INFO_CONFIGURATION</simpara></listitem>
<listitem><simpara>INFO_MODULES</simpara></listitem>
<listitem><simpara>INFO_ENVIRONMENT</simpara></listitem>
<listitem><simpara>INFO_VARIABLES</simpara></listitem>
<listitem><simpara>INFO_LICENSE</simpara></listitem>
<listitem><simpara>INFO_ALL</simpara></listitem>
</itemizedlist>
</para>
<note>
<para>
<literal>expose_php</literal>設定が<literal>off</literal>に設定
された場合、情報の一部が表示されます。これには、PHP及びZendのロ
ゴとクレジットが含まれます。
</para>
</note>
<para>
<function>phpversion</function>,<function>phpcredits</function>,
<function>php_logo_guid</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.phpversion">
<refnamediv>
<refname>phpversion</refname>
<refpurpose>現在のPHPバージョンを取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>phpversion</methodname>
<void/>
</methodsynopsis>
<para>
現在動作中のPHPパーサのバージョンを表す文字列を返します。
</para>
<note>
<para>
この情報は、定義済みの定数<constant>PHP_VERSION</constant>でも取
得可能です。
</para>
</note>
<para>
<example>
<title><function>phpversion</function>の例</title>
<programlisting role="php">
<![CDATA[
// たとえば、'現在のPHPバージョン:3.0rel-dev'と表示する
echo "現在のPHPバージョン:".phpversion();
]]>
</programlisting>
</example>
</para>
<para>
<function>version_compare</function>,
<function>phpinfo</function>,<function>phpcredits</function>,
<function>php_logo_guid</function>,<function>zend_version</function>
も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.php-logo-guid">
<refnamediv>
<refname>php_logo_guid</refname>
<refpurpose>ロゴのguidを取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>php_logo_guid</methodname>
<void/>
</methodsynopsis>
<para>
<note>
<para>
この機能は、PHP 4.0.0で追加されました。
</para>
</note>
</para>
<para>
<function>phpinfo</function>.
<function>phpversion</function>,
<function>phpcredits</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.php-sapi-name">
<refnamediv>
<refname>php_sapi_name</refname>
<refpurpose>
WebサーバーとPHPの間のインターフェースの型を返す
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>php_sapi_name</methodname>
<void/>
</methodsynopsis>
<simpara>
<function>php_sapi_name</function>は、WebサーバーとPHP(サーバーAPI、
SAPI)の間のインターフェースの型を記述する文字列を返します。
CGI版のPHPでは、この文字列は"cgi"となり、Apacheのmod_php版では、
この文字列は"apache"となるといったようになります。
</simpara>
<para>
<example>
<title><function>php_sapi_name</function>の例</title>
<programlisting role="php">
<![CDATA[
$sapi_type = php_sapi_name();
if ($sapi_type == "cgi")
print "CGI版のPHPを使用しています\n";
else
print "CGI版のPHPを使用していません\n";
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.php-uname">
<refnamediv>
<refname>php_uname</refname>
<refpurpose>
PHPが構築されたオペレーションシステムに関する情報を返す
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>php_uname</methodname>
<void/>
</methodsynopsis>
<simpara>
<function>php_uname</function> は、PHPが構築されたオペレーティン
グシステムに関する説明を文字列で返します。
</simpara>
<para>
<example>
<title><function>php_uname</function>の例</title>
<programlisting role="php">
<![CDATA[
if (substr(php_uname(), 0, 7) == "Windows") {
die("Sorry, this script doesn't run on Windows.\n");
}
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.putenv">
<refnamediv>
<refname>putenv</refname>
<refpurpose>環境変数の値を設定する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>putenv</methodname>
<methodparam><type>string</type><parameter>setting</parameter></methodparam>
</methodsynopsis>
<para>
サーバーの環境変数に <parameter>setting</parameter> を追加します。
この環境変数は、カレントのリクエストを実行している間のみ存在します。
リクエスト終了時、環境変数は元の状態に戻されます。
</para>
<para>
ある種の環境変数が変更されることは潜在的なセキュリティリスクとなる
可能性があります。<literal>safe_mode_allowed_env_vars</literal>
ディレクティブには接頭辞のカンマ区切りのリストが含まれます。セーフ
モードでは、ユーザはこのディレクティブで指定された接頭辞で始まる名前
を有する環境変数のみを変更可能となります。
デフォルトでは、ユーザは<literal>PHP_</literal> で始まる環境変数
(例えば<literal>PHP_FOO=BAR</literal>)のみを変更可能です。注意:この
ディレクティブが空の場合、PHPはユーザに全ての環境変数を修正できる許可
を与えてしまいます!
</para>
<para>
<literal>safe_mode_protected_env_vars</literal> ディレクティブには、
カンマ区切りの環境変数のリストが含まれます。ユーザは、この環境変数
を<function>putenv</function>により変更することができません。これら
の変数は、<literal>safe_mode_allowed_env_vars</literal>が変更するこ
とを許可している場合でも保護されます。
</para>
<warning>
<para>
これらのディレクティブは、
<link linkend="features.safe-mode">セーフモード</link> が有効な場合に
のみ効果があります!
</para>
</warning>
<para>
<example>
<title>環境変数の設定</title>
<programlisting role="php">
<![CDATA[
putenv ("UNIQID=$uniqid");
]]>
</programlisting>
</example>
</para>
<para>
<function>getenv</function>も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.set-magic-quotes-runtime">
<refnamediv>
<refname>set_magic_quotes_runtime</refname>
<refpurpose>magic_quotes_runtime の現在アクティブな設定を設定します。
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>long</type><methodname>set_magic_quotes_runtime</methodname>
<methodparam><type>int</type><parameter>new_setting</parameter></methodparam>
</methodsynopsis>
<simpara>
<link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link>
の現在アクティブな設定をセットします。(オフの場合 0、オンの場合 1)
</simpara>
<simpara>
<function>get_magic_quotes_gpc</function>,
<function>get_magic_quotes_runtime</function> も参照下さい。
</simpara>
</refsect1>
</refentry>
<refentry id="function.set-time-limit">
<refnamediv>
<refname>set_time_limit</refname>
<refpurpose>実行時間の最大値を制限します</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>set_time_limit</methodname>
<methodparam><type>int</type><parameter>seconds</parameter></methodparam>
</methodsynopsis>
<simpara>
スクリプトが実行可能な秒数を設定します。
この制限にかかるとスクリプトは致命的エラーを返します。
デフォルトの制限値は 30 秒です。
なお、<link linkend="configuration.file">設定ファイル</link>で
max_execution_time の値が定義されている場合にはそれを用います。
secondsにゼロをセットした場合、時間制限は行われません。
</simpara>
<simpara>
<function>set_time_limit</function> がコールされた場合、
タイムアウトカウンターをゼロから再スタートします。
言いかえると、タイムアウトがデフォルトの 30 秒で
スクリプト実行までに 25 秒かかる場合に、
set_time_limit( 20 ) を実行すると、スクリプトは、
タイムアウトまでに全体で 45 s の間実行されます。
</simpara>
<simpara>
<function>set_time_limit</function> は、PHPがセーフモードで実行さ
れている場合には実効がないことに注意して下さい。セーフモードをオ
フにするか、<link linkend="configuration.file">設定フィ¤ル
</link>の時間制限を変更する以外に対策はありません。
</simpara>
<note>
<para>
関数<function>set_time_limit</function>と設定ディレクティブ<link
linkend="ini.max-execution-time">max_execution_time</link>は、こ
のスクリプト自体の実行時間にのみ影響を与えます。
<function>system</function>, <function>sleep</function>関数、デー
タベースクエリ等のシステムコールのようなスクリプト実行以外で発生
する処理にかかった時間はスクリプトが実行される最大時間を定義する
際には含まれません。
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.version-compare">
<refnamediv>
<refname>version_compare</refname>
<refpurpose>
二つの"PHP標準"バージョン番号文字列を比較する
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>version_compare</methodname>
<methodparam><type>string</type><parameter>version1</parameter></methodparam>
<methodparam><type>string</type><parameter>version2</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>
operator
</parameter></methodparam>
</methodsynopsis>
<para>
<function>version_compare</function>は、二の"PHP標準"バージョン番
号文字列を比較します。この関数は、いくつかのバージョンのPHPでのみ
動作するプログラムを書きたい場合に有用です。
</para>
<para>
<function>version_compare</function>は、最初のバージョンが2番目
よりも小さい場合に-1、等しい場合に0、2番目が小さい場合に+1を返し
ます。
</para>
<para>
3番目のオプション引数<parameter>operator</parameter>を指定した場
合、特定の関係を調べることが可能です。指定可能な演算子を以下に示
します。
<literal><</literal>,
<literal>lt</literal>, <literal><=</literal>,
<literal>le</literal>, <literal>></literal>,
<literal>gt</literal>, <literal>>=</literal>,
<literal>ge</literal>, <literal>==</literal>,
<literal>=</literal>, <literal>eq</literal>,
<literal>!=</literal>, <literal><></literal>,
<literal>ne</literal>
この引数を用いると、この関数はこの演算子により指定された関係が成
り立つ場合に1、そうでない場合に0を返します。
</para>
<para>
<example>
<title><function>version_compare</function>の例</title>
<programlisting role="php">
<![CDATA[
// prints -1
echo version_compare("4.0.4", "4.0.6");
// these all print 1
echo version_compare("4.0.4", "4.0.6", "<");
echo version_compare("4.0.6", "4.0.6", "eq");
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.zend-logo-guid">
<refnamediv>
<refname>zend_logo_guid</refname>
<refpurpose>zend guid を取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>zend_logo_guid</methodname>
<void/>
</methodsynopsis>
<para>
<note>
<para>
この機能は、PHP 4.0.0で追加されました。
</para>
</note>
</para>
</refsect1>
</refentry>
<refentry id="function.zend-version">
<refnamediv>
<refname>zend_version</refname>
<refpurpose>カレントのZendエンジンのバージョンを取得する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>zend_version</methodname>
<void/>
</methodsynopsis>
<para>
PHPパーサを現在実行中のZendのバージョンを文字列として返します。
<example>
<title><function>zend_version</function>の例</title>
<programlisting role="php">
<![CDATA[
// 例えば、'Zend engine version: 1.0.4' を出力
echo "Zend engine version: ".zend_version();
]]>
</programlisting>
</example>
</para>
<para>
<function>phpinfo</function>,
<function>phpcredits</function>,
<function>php_logo_guid</function>
<function>phpversion</function>も参照下さい。
</para>
</refsect1>
</refentry>
</reference>
<!-- 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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|