cvs: peardoc /en/package/authentication/auth intro-storage.xml
| From: | Yavor Shahpasov | Date: | Fri, 25 Jun 2004 00:24:28 +0000 |
| Subject: | cvs: peardoc /en/package/authentication/auth intro-storage.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-4488@lists.php.net to get a copy of this message | ||
yavo Thu Jun 24 20:24:28 2004 EDT
Modified files:
/peardoc/en/package/authentication/auth intro-storage.xml
Log:
Add example for using custom auth containers
http://cvs.php.net/diff.php/peardoc/en/package/authentication/auth/intro-storage.xml?r1=1.13&r2=1.14&ty=u
Index: peardoc/en/package/authentication/auth/intro-storage.xml
diff -u peardoc/en/package/authentication/auth/intro-storage.xml:1.13
peardoc/en/package/authentication/auth/intro-storage.xml:1.14
--- peardoc/en/package/authentication/auth/intro-storage.xml:1.13 Tue Jun 8 07:33:25 2004
+++ peardoc/en/package/authentication/auth/intro-storage.xml Thu Jun 24 20:24:27 2004
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.13 $ -->
+<!-- $Revision: 1.14 $ -->
<refentry id="package.authentication.auth.intro-storage">
<refnamediv>
<refname>Storage drivers</refname>
@@ -17,7 +17,7 @@
<refsect1 id="package.authentication.auth.intro-storage.db">
<title>Database</title>
<para>
- <classname>PEAR:Auth</classname> uses the
+ <classname>PEAR::Auth</classname> uses the
<link
linkend="package.database.db"><classname>PEAR::DB</classname></link>
abstraction layer for database access. That means that you can
use all databases that are supported by the DB abstraction layer
@@ -462,6 +462,55 @@
</para>
</refsect1>
+ <refsect1 id="package.authentication.auth.intro-storage.custom">
+ <title>Custom Storage Containers</title>
+ <para>
+ Example for using your own storage container
+ </para>
+ <para>
+ Here is a skeleton for a custom Auth storage container
+ </para>
+ <example>
+ <title>CustomAuthContainer.php</title>
+ <programlisting role="php">
+ <![CDATA[
+include_once('Auth/Container.php');
+class CustomAuthContainer extends Auth_Container {
+ /** Constructor */
+ function AuthContainerDatabase($params){
+ // Init Here
+ }
+ function fetchData($username, $password){
+ // Check If valid etc
+ if($isvalid){
+ // Perform Some Actions
+ return(true);
+ }
+ return(false);
+ }
+}
+ ]]>
+ </programlisting>
+ <example>
+ <para>
+ And here is how to use it.
+ </para>
+
+ <example>
+ <title>authcustom.php</title>
+ <programlisting role="php">
+ <![CDATA[
+include_once('CustomAuthContainer.php');
+include_once('Auth/Auth.php');
+
+$auth_container = new CustomAuthContainer($params);
+$myauth = new Auth($auth_container);
+
+$myauth->start();
+]]>
+ </programlisting>
+ <example>
+ </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables: