first beta release of the migration chapter :)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@152165 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2004-02-23 16:31:34 +00:00
parent d8c260fe0d
commit f49bf988c5

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<!-- $Revision: 1.9 $ -->
<appendix id="migration5">
<title>Migrating from PHP 4 to PHP 5</title>
@ -70,6 +70,45 @@
Classes must be declared before used.
</simpara></listitem>
</itemizedlist>
<para>
<example>
<title><function>strrpos</function> and <function>strripos</function> now
use the entire string as a needle</title>
<programlisting role="php">
<![CDATA[
<?php
var_dump(strrpos('ABCDEF','DEF')); //int(3)
var_dump(strrpos('ABCDEF','DAF')); //bool(false)
?>
]]>
</programlisting>
</example>
</para>
<para>
The following example was valid in PHP 4, although it will produce a fatal
error in PHP 5.
</para>
<para>
<example>
<title>Classes must be declared before used</title>
<programlisting role="php">
<![CDATA[
<?php
$test = new fubar();
$test->barfu();
class fubar {
function barfu() {
echo 'fubar';
}
}
?>
]]>
</programlisting>
</example>
</para>
</section>
<section id="migration5.cli-cgi">
@ -188,6 +227,10 @@ Action application/x-httpd-php "/php/php-cgi.exe"
<function>ibase_commit_ret</function> - Commit a transaction without
closing it
</simpara></listitem>
<listitem><simpara>
<function>ibase_db_info</function> - Request statistics about a
database
</simpara></listitem>
<listitem><simpara>
<function>ibase_drop_db</function> - Drops a database
</simpara></listitem>
@ -202,6 +245,10 @@ Action application/x-httpd-php "/php/php-cgi.exe"
<function>ibase_gen_id</function> - Increments the named generator and
returns its new value
</simpara></listitem>
<listitem><simpara>
<function>ibase_maintain_db</function> - Execute a maintenance command
on the database server
</simpara></listitem>
<listitem><simpara>
<function>ibase_name_result</function> - Assigns a name to a result set
</simpara></listitem>
@ -217,6 +264,14 @@ Action application/x-httpd-php "/php/php-cgi.exe"
<function>ibase_restore</function> - Initiates a restore task in the
service manager and returns immediately
</simpara></listitem>
<listitem><simpara>
<function>ibase_rollback_ret</function> - Rollback transaction and
retain the transaction context
</simpara></listitem>
<listitem><simpara>
<function>ibase_server_info</function> - Request statistics about a
database
</simpara></listitem>
<listitem><simpara>
<function>ibase_service_attach</function> - Connect to the service manager
</simpara></listitem>
@ -314,6 +369,10 @@ Action application/x-httpd-php "/php/php-cgi.exe"
<function>dbase_get_header_info</function> - Get the header info of a
dBase database
</simpara></listitem>
<listitem><simpara>
<function>dbx_fetch_row</function> - Fetches rows from a query-result
that had the DBX_RESULT_UNBUFFERED flag set
</simpara></listitem>
<listitem><simpara>
<function>file_put_contents</function> - Write a string to a file
</simpara></listitem>
@ -346,6 +405,10 @@ Action application/x-httpd-php "/php/php-cgi.exe"
<function>exif_thumbnail</function>,
<function>exif_imagetype</function>
</simpara></listitem>
<listitem><simpara>
<function>imagefilter</function> - Applies Filter an image using a
custom angle
</simpara></listitem>
<listitem><simpara>
<function>imap_getacl</function> - Gets the ACL for a given mailbox
</simpara></listitem>
@ -376,6 +439,14 @@ Action application/x-httpd-php "/php/php-cgi.exe"
<function>proc_nice</function> - Change the priority of the current
process
</simpara></listitem>
<listitem><simpara>
<function>pspell_config_data_dir</function> - Change location of
language data files
</simpara></listitem>
<listitem><simpara>
<function>pspell_config_dict_dir</function> - Change location of the
main word list
</simpara></listitem>
<listitem><simpara>
<function>setrawcookie</function> - Send a cookie with no url encoding
of the value
@ -438,6 +509,39 @@ Action application/x-httpd-php "/php/php-cgi.exe"
</itemizedlist>
</section>
<section id="migration5.databases">
<title>Databases</title>
<para>
There were some changes in PHP 5 regarding databases (MySQL and SQLite).
</para>
<para>
In PHP 5 the MySQL client libraries are not bundled, because of licence
problems and some others. For more information, read the <link
linkend="faq.databases.mysql.php5">FAQ entry</link>.
</para>
<para>
There is also a new extension, <link linkend="ref.mysqli">MySQLi (Improved
MySQL)</link>, which is designed to work with MySQL 4.1 and above.
</para>
<para>
Since PHP 5, the <link linkend="ref.sqlite">SQLite</link> extension is
built-in PHP. SQLite is embeddable SQL database engine and is not a
client library used to connect to a big database server (like MySQL or
PostgreSQL). The SQLite library reads and writes directly to and from the
database files on disk.
</para>
</section>
<section id='migration5.oop'>
<title>New Object Model</title>
<para>
In PHP 5 there is a new Object Model. PHP's handling of objects has been
completely rewritten, allowing for better performance and more features.
Please read <ulink
url="http://www.php.net/zend-engine-2.php">http://www.php.net/zend-engine-2.php</ulink>
for more info.
</para>
</section>
</appendix>