[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/ezutils/classes/ -> ezprocess.php (source)

   1  <?php
   2  //
   3  // Definition of eZProcess class
   4  //
   5  // Created on: <16-Apr-2002 10:53:33 amos>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*!
  30    \class eZProcess ezprocess.php
  31    \ingroup eZUtils
  32    \brief Executes php scripts with parameters safely
  33  
  34  */
  35  
  36  include_once ( "lib/ezutils/classes/ezdebug.php" );
  37  
  38  class eZProcess
  39  {
  40      function eZProcess()
  41      {
  42      }
  43  
  44      function run( $file, $Params = array(), $params_as_var = false )
  45      {
  46          if ( isset( $this ) and
  47               get_class( $this ) == "ezprocess" )
  48              $instance =& $this;
  49          else
  50              $instance =& eZProcess::instance();
  51          return $instance->runFile( $Params, $file, $params_as_var );
  52      }
  53  
  54      /*!
  55       Helper function, executes the file.
  56       */
  57      function &runFile( &$Params, $file, $params_as_var )
  58      {
  59          if ( $params_as_var )
  60          {
  61              foreach ( $Params as $key => $dummy )
  62              {
  63                  if ( $key != "Params" and
  64                       $key != "this" and
  65                       $key != "file" and
  66                       !is_numeric( $key ) )
  67                      ${$key} =& $Params[$key];
  68              }
  69          }
  70  
  71          if ( file_exists( $file ) )
  72          {
  73  
  74              $includeResult = include( $file );
  75              if ( !isset( $Result ) and $includeResult != 1 )
  76                  $Result = $includeResult;
  77          }
  78          else
  79              eZDebug::writeWarning( "PHP script $file does not exist, cannot run.",
  80                                     "eZProcess" );
  81          return $Result;
  82      }
  83  
  84      function &instance()
  85      {
  86          $instance =& $GLOBALS["eZProcessInstance"];
  87          if ( get_class( $instance ) != "ezprocess" )
  88          {
  89              $instance = new eZProcess();
  90          }
  91          return $instance;
  92      }
  93  }
  94  
  95  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7