You are here

README.html in Include 7

Same filename and directory in other branches
  1. 8 README.html
  2. 6 README.html

File

README.html
View source
<h2 id="include"><a href="http://drupal.org/project/include">Include</a></h2>
<p>Installs and manages files and packages that need to reside on the <a href="http://php.net">PHP</a> <a href="http://php.net/manual/ini.core.php#ini.include-path">include_path</a>.</p>
<p>Any file not found on the default <a href="http://php.net/manual/ini.core.php#ini.include-path">include_path</a> is added to the local repository, which is then added to the <a href="http://php.net/manual/ini.core.php#ini.include-path">include_path</a> on every page load. If an error occurs, the original <a href="http://php.net/manual/ini.core.php#ini.include-path">include_path</a> is restored and an error flag is set to prevent further damage.</p>
<p>This very simple module contains only one externally useful function:</p>
<dl>
  <dt><code>include_check_path($path, $source = NULL, $type = 'file')</code></dt>
  <dd>
    <p>Verifies or installs a file or directory into the include repository.</p>
    <dl>
      <dt><strong>Parameters</strong></dt>
      <dd>
        <p><code>$path</code> The target path to install, relative to the include file root. If <code>$path</code> is empty or ends in a trailing slash, it is interpreted as a directory name, and both <code>$source</code> and <code>$type</code> are ignored.</p>
      </dd>
      <dd>
        <p><code>$source</code> <em>(optional)</em> The file data, or a uri where it may be found. If unset or empty, then <code>$path</code> is a directory name, and <code>$type</code> is ignored.</p>
      </dd>
      <dd>
        <p><code>$type</code> <em>(optional)</em> A string which determines how <code>$source</code> is to be interpreted. Must be one of the following:</p>
        <ul>
          <li>
            <p><code>'dir'</code> : <code>$path</code> is a directory name, and <code>$source</code> is ignored.</p>
          </li>
          <li>
            <p><code>'file'</code> : <em>(Default)</em> drupal_realpath($source) is a local file.</p>
          </li>
          <li>
            <p><code>'url'</code> : <code>$source</code> is a string containing the file data.</p>
          </li>
        </ul>
      </dd>
      <dt><strong>Return value</strong></dt>
      <dd>
        <p><code>TRUE</code> if the file was found or installed; otherwise <code>FALSE</code>.</p>
      </dd>
    </dl>
  </dd>
</dl>