Location: PHPKode > projects > Aukyla Platform > doc/html/a00120.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>Aukyla PHP Framework</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="StyleSheet" href="auton.css" type="text/css" media="screen">
  </head>

  <body>
    <div id="mainmenu">
      <a href="http://www.auton.nl/" class="home">Home</a>
    </div>
    <div id="submenu">
      <a class="logo" href="http://www.auton.nl/"></a>

      <div class="head">Ads</div>
      <a href="http://sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=116358&amp;type=1" alt="SourceForge.net Logo" style="padding: 2px 4px; width: 88px; height: 31px; border: 0px"></a>
      <a href="http://getfirefox.com/" title="Get Firefox - The Browser, Reloaded."><img src="http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png" alt="Get Firefox" style="width: 110px; height: 32px; border: 0px"></a>
    </div>
    <div id="main">
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>LocalURIManager Class Reference</h1><a href="a00071.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Class for managing relocation of local URI's. 
<p>
The Aukyla Framework consists of many different modules and multiple applications can be run on it simultaniously. In many cases it is useful to access documents or other data from other modules and applications, but they should not need to know where and how in the local filesystem other modules store their documents. Therefore, they can pass local URI's to each other using namespaces much in the same way protocols in regular URI's are specified. You can access documents specified through a local <a class="el" href="a00163.html">URI</a> through the <a class="el" href="a00163.html">URI</a> class, but all regular PHP file operations will work with them as well. If you use the <a class="el" href="a00163.html">URI</a> class for operating on said URI's, the <a class="el" href="a00163.html">URI</a> class will pass the request to the LocalURIManager which will use the correct <a class="el" href="a00121.html">LocalURINamespace</a> to process the request. Furthermore, the <a class="el" href="a00163.html">URI</a> class will check for you whether the currently logged in user actually has permissions to perform the requested operation. Now, because the <a class="el" href="a00163.html">URI</a> class will transparently check all permissions and the LocalURIManager will only forward requests to registered namespaces and not to the local filesystem, you can safely perform all actions from the <a class="el" href="a00163.html">URI</a> class on user-specified URI's. If you are using standard PHP file operations on URI's however, you will need to check yourself whether the user has the right access permissions to the given <a class="el" href="a00163.html">URI</a>.<p>
<b>Example:</b> The application ADMS can register the "ADMS" namespace. If ADMS then has a document called "Bar.txt" in a "Foo" directory, other modules can access this document through the local <a class="el" href="a00163.html">URI</a> "ADMS://Foo/Bar.txt". This path might in reality resolve to something like "/opt/aukyla/data/Applications/ADMS/docs/Foo/Bar.txt", but it might even not exist at all and be generated when the file is opened. Even if the file is generated real-time however, all PHP file operations will work normally on the <a class="el" href="a00163.html">URI</a>.<p>
<dl compact><dt><b>Note:</b></dt><dd>The LocalURIManager will only use <em>registered</em> namespaces to forward requests to. But, the LocalURIManager can also automatically register namespaces when they are needed. Let's consider a namespace called "Foo", you should then have a namespace class <code>Foo_URINamespace</code> which must inherit <a class="el" href="a00121.html">LocalURINamespace</a>. This namespace class should then be put in a file <code>Foo_URINamespace.php</code> in the directory <code>plugins/URINamespaces</code>. Every time the LocalURIManager then finds it needs a handler for the "Foo" namespace, but it is not yet registered, it will open the said file and register the said class in it.</dd></dl>
<dl compact><dt><b>Warning:</b></dt><dd>The file in which an URIHandler is defined is included from this class, meaning you can't declare global variables in the file (because of a limitation in PHP all global variables you declare will become local to this class). To help you out there's an exception so that you can use the global variable <code>Foo_URIManager</code>, which is referenced for you here, and which you may use globally. Of course, the name "Foo" should be replaced by the name of your namespace. </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a00237.html#l00090">90</a> of file <a class="el" href="a00237.html">URI.php</a>.<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00120.html#a0">__construct</a> ()</td></tr>

<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00120.html#e0">registerURINamespace</a> ($namespace, $className)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00120.html#e2">loadNamespace</a> ($namespace)</td></tr>

</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a0" doxytag="LocalURIManager::__construct"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">LocalURIManager::__construct           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor.<p>
You do not have to instantiate this class yourself, instead you can use the static functions provided by this class.
<p>
Definition at line <a class="el" href="a00237.html#l00098">98</a> of file <a class="el" href="a00237.html">URI.php</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e2" doxytag="LocalURIManager::loadNamespace"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">LocalURIManager::loadNamespace           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>namespace</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Loads the plugin for a namespace.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>namespace</em>&nbsp;</td><td>The namespace to find the plugin for. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The class name of the loaded plugin or <code>false</code> if no plugin could be found.</dd></dl>
<dl compact><dt><b>Since:</b></dt><dd>Aukyla 1.1</dd></dl>

<p>
Definition at line <a class="el" href="a00237.html#l00192">192</a> of file <a class="el" href="a00237.html">URI.php</a>.
<p>
Referenced by <a class="el" href="a00237.html#l00294">URI::isLocalURI()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e0" doxytag="LocalURIManager::registerURINamespace"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">LocalURIManager::registerURINamespace           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">$&nbsp;</td>
          <td class="mdname" nowrap> <em>namespace</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>$&nbsp;</td>
          <td class="mdname" nowrap> <em>className</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Registers the given namespace.<p>
You only need to register a namespace yourself if the class can't be found under the <code>plugins/URINamespaces</code> directory, as explained with the LocalURIManager.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>namespace</em>&nbsp;</td><td>The namespace to register. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>className</em>&nbsp;</td><td>Classname of the namespace to register. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><code>true</code> on success, <code>false</code> on error.</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00121.html">LocalURINamespace</a></dd></dl>

<p>
Definition at line <a class="el" href="a00237.html#l00125">125</a> of file <a class="el" href="a00237.html">URI.php</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a00237.html">URI.php</a></ul>
    </div>
  </body>
</html>
Return current item: Aukyla Platform