Fixed examples, for both parse and deprecated errors

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@277448 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2009-03-18 21:30:26 +00:00
parent 1194962f3e
commit 886d5315d2
28 changed files with 65 additions and 69 deletions

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry xml:id="function.com-event-sink" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>com_event_sink</refname>
@ -93,10 +93,10 @@ class IEEventSinker {
}
$ie = new COM("InternetExplorer.Application");
// note that you don't need the & for PHP 5!
$sink =& new IEEventSinker();
$sink = new IEEventSinker();
com_event_sink($ie, $sink, "DWebBrowserEvents2");
$ie->Visible = true;
$ie->Navigate("http://www.php.net");
$ie->Navigate("http://www.example.org");
while(!$sink->terminated) {
com_message_pump(4000);
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry xml:id="function.ingres-error" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ingres_error</refname>
@ -72,7 +72,7 @@ $error_text = ingres_error();
if (!is_null($error_text)) {
echo "An error occured - " . $error_text;
}
>
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.ingres-escape-string" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ingres_escape_string</refname>
@ -68,7 +68,7 @@ $result = ingres_query($link, $sql);
while ($user = ingres_fetch_object($result))
{
echo $user->up_first . <BR/>;
echo $user->up_first . '<BR/>';
}
ingres_commit($link);

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.ingres-execute" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ingres_execute</refname>
@ -99,7 +99,7 @@ while ($row = ingres_fetch_row($result)) {
$link = ingres_connect("demodb");
$params[] = "Emma";
$query = "select * from user_profile where up_first = ?"
$query = "select * from user_profile where up_first = ?";
$result = ingres_query($link, $query, $params);
while ($row = ingres_fetch_row($result)) {
echo $row[1];

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="function.ingres-prepare" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ingres_prepare</refname>
@ -108,7 +108,7 @@ while ($row = ingres_fetch_row($result)) {
$link = ingres_connect("demodb");
$params[] = "Emma";
$query = "select * from user_profile where up_first = ?"
$query = "select * from user_profile where up_first = ?";
$result = ingres_query($link, $query, $params);
while ($row = ingres_fetch_row($result)) {
echo $row[1];

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<refentry xml:id="collator.compare" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>Collator::compare</refname>
@ -119,6 +119,7 @@ if ($res === false) {
echo "s1 is less than s2\n";
} else {
echo "s1 is equal to s2\n";
}
?>
]]>
</programlisting>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry xml:id="intldateformatter.islenient" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>IntlDateFormatter::isLenient</refname>
@ -58,8 +58,7 @@
<programlisting role="php">
<![CDATA[
<?php
$fmt = datefmt_create( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGO
RIAN ,"dd/mm/yyyy");
$fmt = datefmt_create( "en_US", IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, "dd/mm/yyyy");
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
@ -95,8 +94,7 @@ if( intl_get_error_code() !=0 ){
<programlisting role="php">
<![CDATA[
<?php
$fmt = new IntlDateFormatter( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GRE
GORIAN,"dd/mm/yyyy" );
$fmt = new IntlDateFormatter("en_US", IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, "dd/mm/yyyy" );
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry xml:id="intldateformatter.setlenient" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>IntlDateFormatter::setLenient</refname>
@ -70,8 +70,7 @@
<programlisting role="php">
<![CDATA[
<?php
$fmt = datefmt_create( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGO
RIAN ,"dd/mm/yyyy");
$fmt = datefmt_create("en_US", IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, "dd/mm/yyyy");
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
@ -107,8 +106,7 @@ if( intl_get_error_code() !=0 ){
<programlisting role="php">
<![CDATA[
<?php
$fmt = new IntlDateFormatter( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GRE
GORIAN,"dd/mm/yyyy" );
$fmt = new IntlDateFormatter("en_US", IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, "dd/mm/yyyy");
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<refentry xml:id="memcached.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
@ -106,7 +106,7 @@ if (!($ip = $m->get('ip_block'))) {
$m->set('ip_block', $ip);
} else {
/* log error */
...
/* ... */
}
}
?>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<refentry xml:id="memcached.getresultcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
@ -45,7 +45,7 @@ $m->addServer('localhost', 11211);
$m->add('foo', 'bar');
if ($m->getResultCode() == Memcached::RES_NOTSTORED) {
...
/* ... */
}
?>
]]>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry xml:id="function.mqseries-get" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mqseries_get</refname>
@ -145,7 +145,7 @@
// $obj now holds the reference to the object (TESTQ)
// setup empty message descriptor.
mdg = array();
$mdg = array();
// setup get message options
$gmo = array('Options' => MQSERIES_MQGMO_FAIL_IF_QUIESCING | MQSERIES_MQGMO_WAIT, 'WaitInterval' => 3000);

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<refentry xml:id="function.mqseries-open" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mqseries_open</refname>
@ -98,7 +98,7 @@
<programlisting role="php">
<![CDATA[
<?php
mqods = array('ObjectName' => 'TESTQ');
$mqods = array('ObjectName' => 'TESTQ');
mqseries_open(
$conn,
$mqods,

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry xml:id="function.ncurses-getmouse" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ncurses_getmouse</refname>
@ -80,7 +80,7 @@
<?php
switch (ncurses_getch()){
case NCURSES_KEY_MOUSE:
if (!ncurses_getmouse(&$mevent)){
if (!ncurses_getmouse($mevent)){
if ($mevent["mmask"] & NCURSES_MOUSE_BUTTON1_PRESSED){
$mouse_x = $mevent["x"]; // Save mouse position
$mouse_y = $mevent["y"];

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<refentry xml:id="function.ncurses-mousemask" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ncurses_mousemask</refname>
@ -95,7 +95,7 @@
<![CDATA[
<?php
$newmask = NCURSES_BUTTON1_CLICKED + NCURSES_BUTTON1_RELEASED;
$mask = ncurses_mousemask($newmask, &$oldmask);
$mask = ncurses_mousemask($newmask, $oldmask);
if ($mask & $newmask){
printf("All specified mouse options will be supported\n");
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry xml:id="function.ovrimos-fetch-into" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ovrimos_fetch_into</refname>
@ -131,10 +131,10 @@ if ($conn!=0) {
$res=ovrimos_exec($conn, "select table_id, table_name from sys.tables");
if ($res != 0) {
echo "Statement ok!";
if (ovrimos_fetch_into($res, &$row)) {
if (ovrimos_fetch_into($res, $row)) {
list($table_id, $table_name) = $row;
echo "table_id=" . $table_id . ", table_name=" . $table_name . "\n";
if (ovrimos_fetch_into($res, &$row)) {
if (ovrimos_fetch_into($res, $row)) {
list($table_id, $table_name) = $row;
echo "table_id=" . $table_id . ", table_name=" . $table_name . "\n";
} else {

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<refentry xml:id='function.samconnection-isconnected' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SAMConnection->isConnected</refname>
@ -43,9 +43,9 @@
<?php
if ($conn->isConnected()) {
echo 'Connection is active.'
echo 'Connection is active.';
} else {
echo 'No active connection!'
echo 'No active connection!';
}
?>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry xml:id='function.samconnection-peekall' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SAMConnection->peekAll</refname>
@ -115,8 +115,7 @@ if ($msgArray) {
foreach ( $msgArray as $key => $msg) {
echo "Message $key: body = $msg->body\n";
}
}
else
} else {
echo "PeekAll failed ($conn->errno) $conn->error";
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry xml:id='function.sammessage-header' xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SAMMessage->header</refname>
@ -251,10 +251,10 @@ $msg->header->myDoubleProp = array(3.14159265358979, SAM_DOUBLE);
<?php
// accessing an application specific property
$intProp = $msg->header->'MyIntProp';
$intProp = $msg->header->MyIntProp;
// accessing a messaging system specific property
$encoding = $msg->header->'JMS_IBM_Msgtype';
$encoding = $msg->header->JMS_IBM_Msgtype;
?>
]]>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<refentry xml:id="soapclient.setsoapheaders" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
@ -59,7 +59,7 @@ $client = new SoapClient(null, array('location' => "http://localhost/soap.php",
'uri' => "http://test-uri/"));
$header = new SoapHeader('http://soapinterop.org/echoheader/',
'echoMeStringRequest',
'hello world'));
'hello world');
$client->__setSoapHeaders($header);
@ -82,11 +82,11 @@ $headers = array();
$headers[] = new SoapHeader('http://soapinterop.org/echoheader/',
'echoMeStringRequest',
'hello world'));
'hello world');
$headers[] = new SoapHeader('http://soapinterop.org/echoheader/',
'echoMeStringRequest',
'hello world again'));
'hello world again');
$client->__setSoapHeaders($headers);

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.17 $ -->
<!-- $Revision: 1.18 $ -->
<refentry xml:id="function.serialize" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>serialize</refname>
@ -85,10 +85,10 @@ $conn = odbc_connect("webdb", "php", "chicken");
$stmt = odbc_prepare($conn,
"UPDATE sessions SET data = ? WHERE id = ?");
$sqldata = array (serialize($session_data), $_SERVER['PHP_AUTH_USER']);
if (!odbc_execute($stmt, &$sqldata)) {
if (!odbc_execute($stmt, $sqldata)) {
$stmt = odbc_prepare($conn,
"INSERT INTO sessions (id, data) VALUES(?, ?)");
if (!odbc_execute($stmt, &$sqldata)) {
if (!odbc_execute($stmt, $sqldata)) {
/* Something went wrong.. */
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.23 $ -->
<!-- $Revision: 1.24 $ -->
<refentry xml:id="function.unserialize" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>unserialize</refname>
@ -116,7 +116,7 @@
$conn = odbc_connect("webdb", "php", "chicken");
$stmt = odbc_prepare($conn, "SELECT data FROM sessions WHERE id = ?");
$sqldata = array($_SERVER['PHP_AUTH_USER']);
if (!odbc_execute($stmt, &$sqldata) || !odbc_fetch_into($stmt, &$tmp)) {
if (!odbc_execute($stmt, $sqldata) || !odbc_fetch_into($stmt, $tmp)) {
// if the execute or fetch fails, initialize to empty array
$session_data = array();
} else {

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.14 $ -->
<!-- $Revision: 1.15 $ -->
<refentry xml:id="function.yaz-scan" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>yaz_scan</refname>
@ -100,7 +100,7 @@ function scan_titles($id, $startterm)
yaz_wait();
$errno = yaz_errno($id);
if ($errno == 0) {
$ar = yaz_scan_result($id, &$options);
$ar = yaz_scan_result($id, $options);
echo 'Scan ok; ';
foreach ($options as $key => $val) {
echo "$key = $val &nbsp;";

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry xml:id="function.ziparchive-getarchivecomment" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ZipArchive::getArchiveComment</refname>
@ -29,7 +29,7 @@
<![CDATA[
<?php
$zip = new ZipArchive;
$res = $zip->open('test_with_comment.zip')
$res = $zip->open('test_with_comment.zip');
if ($res === TRUE) {
var_dump($zip->getArchiveComment());
/* Or using the archive property */

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry xml:id="function.ziparchive-getcommentindex" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ZipArchive::getCommentIndex</refname>
@ -54,7 +54,7 @@
<![CDATA[
<?php
$zip = new ZipArchive;
$res = $zip->open('test1.zip')
$res = $zip->open('test1.zip');
if ($res === TRUE) {
var_dump($zip->getCommentIndex(1));
} else {

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry xml:id="function.ziparchive-getcommentname" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ZipArchive::getCommentName</refname>
@ -54,7 +54,7 @@
<![CDATA[
<?php
$zip = new ZipArchive;
$res = $zip->open('test1.zip')
$res = $zip->open('test1.zip');
if ($res === TRUE) {
var_dump($zip->getCommentName('test/entry1.txt'));
} else {

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry xml:id="function.ziparchive-renameindex" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ZipArchive::renameIndex</refname>
@ -53,7 +53,7 @@
<![CDATA[
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip')
$res = $zip->open('test.zip');
if ($res === TRUE) {
$zip->renameIndex(2,'newname.txt');
$zip->close();

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry xml:id="function.ziparchive-statindex" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ZipArchive::statIndex</refname>
@ -56,7 +56,7 @@
<![CDATA[
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip')
$res = $zip->open('test.zip');
if ($res === TRUE) {
print_r($zip->statIndex(3));
$zip->close();

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry xml:id="function.ziparchive-statname" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ZipArchive::statName</refname>
@ -74,7 +74,7 @@
<![CDATA[
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip')
$res = $zip->open('test.zip');
if ($res === TRUE) {
print_r($zip->statName('foobar/baz'));
$zip->close();