mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Added examples to take into account OS, including use of PHP_SHLIB_SUFFIX.
Also, windows -> Windows. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@132998 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fe9d49faa6
commit
f2df30ddca
1 changed files with 17 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- splitted from ./en/functions/info.xml, last change in rev 1.29 -->
|
||||
<refentry id="function.dl">
|
||||
<refnamediv>
|
||||
|
@ -20,7 +20,7 @@
|
|||
linkend="ref.sockets">sockets</link> extension (if compiled as a shared
|
||||
module, not the default!) would be called <filename>sockets.so</filename>
|
||||
on unix platforms whereas it is called
|
||||
<filename>php_sockets.dll</filename> on the windows platform.
|
||||
<filename>php_sockets.dll</filename> on the Windows platform.
|
||||
</para>
|
||||
<para>
|
||||
&return.success; If the functionality of loading modules is not available
|
||||
|
@ -38,14 +38,25 @@
|
|||
or <function>dl</function>).
|
||||
</para>
|
||||
<example>
|
||||
<title><function>dl</function> example</title>
|
||||
<title><function>dl</function> examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
if (!extension_loaded('gd')) {
|
||||
if (!dl('gd.so')) {
|
||||
exit;
|
||||
<?php
|
||||
// Example loading an extension based on OS
|
||||
if (!extension_loaded('sqlite')) {
|
||||
if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) {
|
||||
dl('php_sqlite.dll');
|
||||
} else {
|
||||
dl('sqlite.so');
|
||||
}
|
||||
}
|
||||
|
||||
// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
|
||||
if (!extension_loaded('sqlite')) {
|
||||
$prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
|
||||
dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue