mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-29 12:22:19 +02:00
135 lines
3.1 KiB
XML
135 lines
3.1 KiB
XML
<?xml version='1.0' encoding='utf-8'?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: f5a5f5ae75cf140bd3dd65da52b70f6236b0e131 Maintainer: gui Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="phar.getstub">
|
|
<refnamediv>
|
|
<refname>Phar::getStub</refname>
|
|
<refpurpose>Retourne le chargeur PHP ou le conteneur de chargement d'une archive Phar</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>string</type><methodname>Phar::getStub</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
Les archives phar contiennent un chargeur, ou conteneur
|
|
(<literal>stub</literal>), écrit en PHP qui est exécuté
|
|
quand l'archive elle-même est exécutée soit par inclusion :
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
include 'monphar.phar';
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
soit par simple exécution :
|
|
<screen>
|
|
<![CDATA[
|
|
php monphar.phar
|
|
]]>
|
|
</screen>
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne une chaîne de caractères avec le contenu du conteneur
|
|
de chargement (<literal>stub</literal>) de l'archive phar courante.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Lève une exception <classname>RuntimeException</classname> s'il
|
|
n'est pas possible de lire le conteneur de chargement de l'archive Phar.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>Phar::getStub</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$p = new Phar('/chemin/vers/mon.phar', 0, 'mon.phar');
|
|
echo $p->getStub();
|
|
echo "==SUIVANT==\n";
|
|
$p->setStub("<?php
|
|
function __autoload($class)
|
|
{
|
|
include 'phar://' . str_replace('_', '/', $class);
|
|
}
|
|
Phar::mapPhar('monphar.phar');
|
|
include 'phar://monphar.phar/demarrage.php';
|
|
__HALT_COMPILER(); ?>");
|
|
echo $p->getStub();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
<?php __HALT_COMPILER(); ?>
|
|
==SUIVANT==
|
|
<?php
|
|
function __autoload($class)
|
|
{
|
|
include 'phar://' . str_replace('_', '/', $class);
|
|
}
|
|
Phar::mapPhar('monphar.phar');
|
|
include 'phar://monphar.phar/demarrage.php';
|
|
__HALT_COMPILER(); ?>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>Phar::setStub</function></member>
|
|
<member><function>Phar::createDefaultStub</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
</refentry>
|
|
|
|
<!-- 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:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|