⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phar.using.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Using Phar Archives</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="phar.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="phar.using.stream.html">Using Phar Archives: the phar stream wrapper</a></div> <div class="up"><a href="book.phar.html">Phar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Using Phar Archives</h1><h2>Table of Contents</h2><ul class="chunklist chunklist_chapter"><li><a href="phar.using.stream.html">Using Phar Archives: the phar stream wrapper</a></li><li><a href="phar.using.object.html">Using Phar Archives: the Phar and PharData class</a></li></ul> <div id="phar.using.intro" class="section"> <h2 class="title">Using Phar Archives: Introduction</h2> <p class="para">  Phar archives are similar in concept to Java JAR archives, but are  tailored to the needs and to the flexibility of PHP applications.  A  Phar archive is used to distribute a complete PHP application  or library in a single file.  Unlike Java&#039;s implementation of JAR archives,  no external tool is required to process or run a PHP Phar archive.  A  Phar archive application is used exactly like any other PHP application: </p> <div class="example-contents"><pre>  <div class="cdata"><pre>php coolapplication.phar  </pre></div> </pre></div> <p class="para">  Using a Phar archive library is identical to using any other PHP library: </p> <p class="para">  <div class="informalexample">   <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">include&nbsp;</span><span style="color: #DD0000">'coollibrary.phar'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>   </div>  </div> </p> <p class="para">  The <i>phar</i> stream wrapper provides the core of the phar extension, and  is explained in detail <a href="phar.using.stream.html" class="link">here</a>.  The phar stream wrapper allows accessing the files within a phar archive using  PHP&#039;s standard file functions <a href="function.fopen.html" class="function">fopen()</a>, <a href="function.opendir.html" class="function">opendir()</a>, and  others that work on regular files.  The <i>phar</i> stream wrapper supports all  read/write operations on both files and directories. </p> <p class="para">  <div class="informalexample">   <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">include&nbsp;</span><span style="color: #DD0000">'phar://coollibrary.phar/internal/file.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type:&nbsp;image/jpeg'</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">//&nbsp;phars&nbsp;can&nbsp;be&nbsp;accessed&nbsp;by&nbsp;full&nbsp;path&nbsp;or&nbsp;by&nbsp;alias<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">'phar:///fullpath/to/coollibrary.phar/images/wow.jpg'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>   </div>  </div> </p> <p class="para">  The <a href="class.Phar.html" class="classname">Phar</a> class implements advanced functionality for accessing  files and for creating phar archives.  The Phar class is explained in detail  <a href="phar.using.object.html" class="link">here</a>. </p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -