• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • Examples
  • File List
  • File Members

CAS/PGTStorage/AbstractStorage.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003  * Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *
00009  *     * Redistributions of source code must retain the above copyright notice,
00010  *       this list of conditions and the following disclaimer.
00011  *     * Redistributions in binary form must reproduce the above copyright notice,
00012  *       this list of conditions and the following disclaimer in the documentation
00013  *       and/or other materials provided with the distribution.
00014  *     * Neither the name of the ESUP-Portail consortium & the JA-SIG
00015  *       Collaborative nor the names of its contributors may be used to endorse or
00016  *       promote products derived from this software without specific prior
00017  *       written permission.
00018 
00019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00020  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00021  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00022  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
00023  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00024  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00025  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00026  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00027  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00028  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  */
00045 abstract class CAS_PGTStorage_AbstractStorage
00046 {
00052         // ########################################################################
00053         //  CONSTRUCTOR
00054         // ########################################################################
00055 
00063         function __construct($cas_parent)
00064         {
00065                 phpCAS::traceBegin();
00066                 if ( !$cas_parent->isProxy() ) {
00067                         phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
00068                 }
00069                 phpCAS::traceEnd();
00070         }
00071 
00072         // ########################################################################
00073         //  DEBUGGING
00074         // ########################################################################
00075 
00082         function getStorageType()
00083         {
00084                 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
00085         }
00086 
00093         function getStorageInfo()
00094         {
00095                 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
00096         }
00097 
00098         // ########################################################################
00099         //  ERROR HANDLING
00100         // ########################################################################
00101 
00110         var $_error_message=FALSE;
00111 
00121         function setErrorMessage($error_message)
00122         {
00123                 $this->_error_message = $error_message;
00124         }
00125 
00135         function getErrorMessage()
00136         {
00137                 return $this->_error_message;
00138         }
00139 
00140         // ########################################################################
00141         //  INITIALIZATION
00142         // ########################################################################
00143 
00151         var $_initialized = FALSE;
00152 
00160         function isInitialized()
00161         {
00162                 return $this->_initialized;
00163         }
00164 
00170         function init()
00171         {
00172                 $this->_initialized = TRUE;
00173         }
00174 
00175         // ########################################################################
00176         //  PGT I/O
00177         // ########################################################################
00178 
00188         function write($pgt,$pgt_iou)
00189         {
00190                 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
00191         }
00192 
00202         function read($pgt_iou)
00203         {
00204                 phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
00205         }
00206 
00209 }
00210 
00211 // include specific PGT storage classes
00212 include_once(dirname(__FILE__).'/Db.php');
00213 include_once(dirname(__FILE__).'/File.php');
00214 
00215 ?>

Generated on Sun Jun 5 2011 19:05:26 for phpCAS by  doxygen 1.7.1