Sophie

Sophie

distrib > PLD > ac > amd64 > media > dist > by-pkgid > dd8ef74e7a184506d40e4328053fb785 > files > 544

php-manual-ro-20051028-1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>dl</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="PHP Options&Information"
HREF="ref.info.html"><LINK
REL="PREVIOUS"
TITLE="assert"
HREF="function.assert.html"><LINK
REL="NEXT"
TITLE="extension_loaded"
HREF="function.extension-loaded.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-2"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.assert.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.extension-loaded.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.dl"
></A
>dl</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN90596"
></A
><P
>    (PHP 3, PHP 4 , PHP 5)</P
>dl&nbsp;--&nbsp;Loads a PHP extension at runtime</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN90599"
></A
><H2
>Description</H2
>int <B
CLASS="methodname"
>dl</B
> ( string library)<BR
></BR
><P
>&#13;     Loads the PHP extension given by the parameter
     <VAR
CLASS="parameter"
>library</VAR
>. The <VAR
CLASS="parameter"
>library</VAR
>
     parameter is <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>only</I
></SPAN
> the filename of the extension to
     load which also depends on your platform. For example, the <A
HREF="ref.sockets.html"
>sockets</A
> extension (if compiled as a shared
     module, not the default!) would be called <TT
CLASS="filename"
>sockets.so</TT
>
     on Unix platforms whereas it is called
     <TT
CLASS="filename"
>php_sockets.dll</TT
> on the Windows platform.
    </P
><P
>&#13;     Returneazã <TT
CLASS="constant"
><B
>TRUE</B
></TT
> în caz de succes, <TT
CLASS="constant"
><B
>FALSE</B
></TT
> în caz contrar. If the functionality of loading modules is not available
     (see Note) or has been disabled (either by turning it off
     <VAR
CLASS="literal"
>enable_dl</VAR
> or by enabling <A
HREF="features.safe-mode.html#ini.safe-mode"
>safe mode</A
>
     in <TT
CLASS="filename"
>php.ini</TT
>) an <TT
CLASS="constant"
><B
>E_ERROR</B
></TT
> is emitted
     and execution is stopped. If <B
CLASS="function"
>dl()</B
> fails because the
     specified library couldn't be loaded, in addition to <TT
CLASS="constant"
><B
>FALSE</B
></TT
> an
     <TT
CLASS="constant"
><B
>E_WARNING</B
></TT
> message is emitted.
    </P
><P
>&#13;     Use <A
HREF="function.extension-loaded.html"
><B
CLASS="function"
>extension_loaded()</B
></A
> to test whether a given
     extension is already available or not. This works on both built-in
     extensions and dynamically loaded ones (either through <TT
CLASS="filename"
>php.ini</TT
>
     or <B
CLASS="function"
>dl()</B
>).
    </P
><P
>&#13;    The <B
CLASS="function"
>dl()</B
> function is dperecated as of PHP 5.
    Use <A
HREF="ini.sect.path-directory.html#ini.extension"
>Extension Loading Directives</A
> 
    method instead.
    </P
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN90631"
></A
><P
><B
>Exemplu 1. <B
CLASS="function"
>dl()</B
> examples</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#FF8000">// Example loading an extension based on OS<br /></font><font color="#007700">if (!</font><font color="#0000BB">extension_loaded</font><font color="#007700">(</font><font color="#DD0000">'sqlite'</font><font color="#007700">)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;if (</font><font color="#0000BB">strtoupper</font><font color="#007700">(</font><font color="#0000BB">substr</font><font color="#007700">(</font><font color="#0000BB">PHP_OS</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">3</font><font color="#007700">) == </font><font color="#DD0000">'WIN'</font><font color="#007700">)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">dl</font><font color="#007700">(</font><font color="#DD0000">'php_sqlite.dll'</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;} else {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">dl</font><font color="#007700">(</font><font color="#DD0000">'sqlite.so'</font><font color="#007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br /></font><font color="#FF8000">// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0<br /></font><font color="#007700">if (!</font><font color="#0000BB">extension_loaded</font><font color="#007700">(</font><font color="#DD0000">'sqlite'</font><font color="#007700">)) {<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$prefix </font><font color="#007700">= (</font><font color="#0000BB">PHP_SHLIB_SUFFIX </font><font color="#007700">== </font><font color="#DD0000">'dll'</font><font color="#007700">) ? </font><font color="#DD0000">'php_' </font><font color="#007700">: </font><font color="#DD0000">''</font><font color="#007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">dl</font><font color="#007700">(</font><font color="#0000BB">$prefix </font><font color="#007700">. </font><font color="#DD0000">'sqlite.' </font><font color="#007700">. </font><font color="#0000BB">PHP_SHLIB_SUFFIX</font><font color="#007700">);<br />}<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
><P
>&#13;     The directory where the extension is loaded from depends on your
     platform:
    </P
><P
>&#13;     Windows - If not explicitly set in the <TT
CLASS="filename"
>php.ini</TT
>, the extension is
     loaded from <TT
CLASS="filename"
>c:\php4\extensions\</TT
> by default.
    </P
><P
>&#13;     Unix - If not explicitly set in the <TT
CLASS="filename"
>php.ini</TT
>, the default extension
     directory depends on
     <P
></P
><UL
><LI
><P
>&#13;        whether PHP has been built with <VAR
CLASS="literal"
>--enable-debug</VAR
> or
        not
       </P
></LI
><LI
><P
>&#13;        whether PHP has been built with (experimental) ZTS (Zend Thread Safety)
        support or not
       </P
></LI
><LI
><P
>&#13;        the current internal <VAR
CLASS="literal"
>ZEND_MODULE_API_NO</VAR
> (Zend
        internal module API number, which is basically the date on which a
        major module API change happened, e.g. <VAR
CLASS="literal"
>20010901</VAR
>)
       </P
></LI
></UL
>
     Taking into account the above, the directory then defaults to
     <VAR
CLASS="literal"
>&#60;install-dir&#62;/lib/php/extensions/ &#60;debug-or-not&#62;-&#60;zts-or-not&#62;-ZEND_MODULE_API_NO</VAR
>,
     e.g.
     <TT
CLASS="filename"
>/usr/local/php/lib/php/extensions/debug-non-zts-20010901</TT
>
     or
     <TT
CLASS="filename"
>/usr/local/php/lib/php/extensions/no-debug-zts-20010901</TT
>.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Not&#227;: </B
>
      <B
CLASS="function"
>dl()</B
> is <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>not</I
></SPAN
> supported in
      multithreaded Web servers. Use the <VAR
CLASS="literal"
>extensions</VAR
>
      statement in your <TT
CLASS="filename"
>php.ini</TT
> when operating under such
      an environment. However, the <VAR
CLASS="literal"
>CGI</VAR
> and
      <VAR
CLASS="literal"
>CLI</VAR
> build are <SPAN
CLASS="strong"
><B
CLASS="emphasis"
>not</B
></SPAN
>
      affected !
     </P
></BLOCKQUOTE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Not&#227;: </B
>
      <B
CLASS="function"
>dl()</B
> is case sensitive on Unix platforms.
     </P
></BLOCKQUOTE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Not&#227;: </B
>Aceastã funcþie e dezactivatã în
<A
HREF="features.safe-mode.html"
>safe-mode</A
>.</P
></BLOCKQUOTE
></DIV
><P
>&#13;     See also
     <A
HREF="ini.sect.path-directory.html#ini.extension"
>Extension Loading Directives</A
>
     and <A
HREF="function.extension-loaded.html"
><B
CLASS="function"
>extension_loaded()</B
></A
>.
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.assert.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Acas&#227;</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.extension-loaded.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>assert</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.info.html"
ACCESSKEY="U"
>Sus</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>extension_loaded</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>