当前位置: 首页>>代码示例>>PHP>>正文


PHP System::import方法代码示例

本文整理汇总了PHP中System::import方法的典型用法代码示例。如果您正苦于以下问题:PHP System::import方法的具体用法?PHP System::import怎么用?PHP System::import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System的用法示例。


在下文中一共展示了System::import方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Hashtable

 /**
  * @brief   Retourne une collection des paramètres du contexte
  * @return  Hashtable
  */
 public function &getParams()
 {
     System::import('System.ADT.Hashtable');
     $rv =& new Hashtable();
     foreach ($this->_params as $key => $value) {
         $rv->put($key, $this->_params[$key]);
     }
     return $rv;
 }
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:13,代码来源:Context.php

示例2: createNew

 /**
  * @brief   Instancie la classe concrête adéquate pour le driver fournit
  * @param   $driver   IDataSourceDriver   driver de connexion
  * @return  DbmsDataSource
  */
 private static function createNew(IDataSourceDriver &$driver)
 {
     $rv = null;
     if ('mysql' == $driver->getScheme()) {
         System::import('System.DataSource.Dbms.DbmsMysql');
         $rv =& new DbmsMysql($driver);
     } else {
         throw new Exception('Unsupported dbms driver scheme');
     }
     return $rv;
 }
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:16,代码来源:DbmsDataSource.php

示例3: createNew

 /**
  * @brief   Instancie et retourne un �l�ment de formulaire
  * @param   $enum_const   const     \ref FormInputType
  * @param   $input_name   string    Nom de l'�l�ment
  * @return  FormInput
  * @throw   Exception
  */
 public static function createNew($enum_const, $input_name)
 {
     $rv = null;
     if (FormInputEnumeration::TYPE_TEXT == $enum_const) {
         System::import('System.FormInput.Inputs.TextField');
         $rv =& new TextField($input_name);
     } elseif (FormInputEnumeration::TYPE_CHECKBOX == $enum_const) {
         System::import('System.FormInput.Inputs.Checkbox');
         $rv =& new Checkbox($input_name);
     }
     if (!is_null($rv)) {
         FormInput::registerItem($rv);
     }
     return $rv;
 }
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:22,代码来源:FormInputFabrication.php

示例4: XmlDataGridSource

 /**
  * @brief   Instancie la classe concrête correspondante à la signature de driver fournie
  * @param   $driverSignature   string   signature du driver
  * @return  DataGridSource
  * @throw   Exception
  */
 public final function &createNew($driverSignature)
 {
     $rv = null;
     $dgDriver =& DataSourceDriver::createNew($driverSignature);
     if ('xml' == $dgDriver->getScheme()) {
         System::import('System.DataGrid.DataSources.XmlDataGridSource');
         $rv =& new XmlDataGridSource($dgDriver);
         /**
          * @todo    Supprimer ce if = 'mysql' car on devrait pas avoir a connaitre le type de dbms
          *  modification du driver ?
          *  appel à une méthode statique de dbmsdatasource/dbmsdatagridsource ?
          */
     } elseif ('mysql' == $dgDriver->getScheme()) {
         System::import('System.DataGrid.DataSources.DbmsDataGridSource');
         $rv =& new DbmsDataGridSource($dgDriver);
     } else {
         throw new Exception('Unsupported datasource scheme');
     }
     return $rv;
 }
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:26,代码来源:DataGridSource.php

示例5: __construct

<?php

/**
 * @package       ADT.Iterators
 * @class         AbstractCollectionIterator
 * @author        Jimmy CHARLEBOIS
 * @date          21-02-2007
 * @brief         Classe abstraire pour iterateur de collection
 */
System::import('System.Interfaces.Iteration.IDynamicIterator');
System::import('System.Exceptions.IllegalArgumentException');
abstract class AbstractCollectionIterator implements IDynamicIterator
{
    private $_collection;
    private $_pointeur;
    public function __construct(ICollection &$collection)
    {
        $this->_collection =& $collection;
        $this->_pointeur = -1;
    }
    public function __clone()
    {
        $this->_collection = clone $this->_collection;
        $this->rewind();
    }
    public function rewind()
    {
        $this->_pointeur = -1;
    }
    public function hasNext()
    {
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:AbstractCollectionIterator.php

示例6: __construct

<?php

/**
 * @package       ADT
 * @class         AbstractScalar
 * @author        Jimmy CHARLEBOIS
 * @date          21-02-2007
 * @brief         Classe abstraite pour les objets ADT scalaire
 */
System::import('System.Interfaces.ADT.IADT');
System::import('System.Interfaces.Comparator.IComparable');
abstract class AbstractScalar implements IADT, IComparable
{
    private $_value;
    protected function __construct($value)
    {
        $this->_value = $value;
    }
    public function getValue()
    {
        return $this->_value;
    }
    public function toString()
    {
        return (string) $this;
    }
    public function compareTo(IComparable $o)
    {
        $rv = 0;
        if ($this->getValue() < $o->getValue()) {
            $rv = -1;
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:AbstractScalar.php

示例7: getColumnCount

<?php

/**
 * @package     	Table
 * @interface     ITableModel
 * @author      	Jimmy CHARLEBOIS
 * @date        	28-02-2007
 * @brief       	
 */
System::import('System.Interfaces.MVC.IModel');
interface ITableModel extends IModel
{
    //    public function addTableModelListener( ITableListener &$listener );
    //    public function removeTableModelListener( ITableListener &$listener );
    /**
     * @brief   Retourne le nombre de colonne pr�sentes dans le mod�le
     * @return  integer
     */
    public function getColumnCount();
    /**
     * @brief   Retourne le libell� associ�e � une colonne
     * @param   $columnIndex    integer   le num�ro de la colonne
     * @return  string
     */
    public function getColumnName($columnIndex);
    /**
     * @brief   Retourne le nombre de lignes pr�sentes dans le mod�le
     * @return  integer
     */
    public function getRowCount();
    /**
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:ITableModel.php

示例8: Caddy

System::export($caddyId, '-- Caddy ID --');
/*
System::export( $s->delete( $caddyId ), '-- Delete caddy --' );
*/
$caddy =& $s->loadById($caddyId);
if (is_null($caddy)) {
    $caddy =& new Caddy();
}
System::export($s->getDateUpdate(), '-- Last update time --');
$t =& new CaddyItem('AZERTY', 1, 0);
$caddy->removeCaddyItem($t);
$s->save();
$db->dispose();
System::export('-- saving to caddies.xml --');
System::import('System.DataSource.XmlDataSource');
System::import('System.Caddy.Storage.CaddyXmlBlobStorage');
$xml =& new XmlDataSource(DataSourceDriver::createNew('xml://caddies.xml/'));
$s =& new CaddyXmlBlobStorage($xml, $caddy);
$xml->connect();
System::export($s->save($caddyId));
$caddy =& $s->loadById($caddyId);
if (is_null($caddy)) {
    $caddy =& new Caddy();
}
$xml->dispose();
System::export($caddy->size(), '-- caddy\' size --');
System::export('-- iterate items --');
$iterator =& $caddy->getIterator();
while ($iterator->hasNext()) {
    $caddyItem =& $iterator->next();
    System::export($caddyItem, 'élément n°' . $iterator->key());
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:component-caddy-loader.php

示例9: __construct

<?php

/**
 * @package     	IO
 * @class       	SysFile
 * @author      	Jimmy CHARLEBOIS
 * @date        	24-01-2007
 * @brief       	Manipulation de fichier
 */
System::import('System.Interfaces.IResource');
System::import('System.Exceptions.IOException');
class SysFile implements IResource
{
    private $_filename;
    private $_path;
    private $_extension;
    protected $_filepath;
    protected $_resource;
    /** @defgroup   FileAccessType   Constantes pour définir le type d'accès au log */
    /*@{*/
    /** @brief  Accès en écriture seule (mode écrasement) */
    const WRITE_ACCESS = 1;
    /** @brief  Accès en lecture seule */
    const READ_ACCESS = 2;
    /** @brief  Accès en écriture seule (mode ajout) */
    const APPEND_ACCESS = 4;
    /** @brief  Permet l'écriture de données binaires */
    const BINARY_ACCESS = 8;
    /*@}*/
    public function __construct($filepath)
    {
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:SysFile.php

示例10: __construct

<?php

/**
 * @package   	Context
 * @class   		RuntimeContext
 * @author        Jimmy CHARLEBOIS
 * @date          04-12-2006
 * @brief         Décoration de contexte pour contexte d'exécution
 */
System::import('System.Interfaces.Context.IContext');
class RuntimeContext implements IContext
{
    private $_context;
    private $_runtime_vars;
    public function __construct(IContext $context)
    {
        $this->_context =& $context;
        $this->_runtime_vars = array();
    }
    public function __call($methodName, $args)
    {
        if (is_callable(array($this->_context, $methodName))) {
            return call_user_func_array(array($this->_context, $methodName), $args);
        }
    }
    public function &getParams()
    {
        return $this->_context->getParams();
    }
    public function hasParam($key)
    {
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:RuntimeContext.php

示例11: __construct

<?php

/**
 * @package       Form
 * @class         FormChecker
 * @author        Jimmy CHARLEBOIS
 * @date          13-06-2006
 * @brief         Représentation d'un formulaire à vérifier
 */
System::import('System.Interfaces.MVC.IModel');
System::import('System.Form.FormChecker.Field');
System::import('System.Form.FormChecker.Helper.*');
System::import('System.Form.FormChecker.Modifier.*');
class FormChecker implements IModel
{
    private $_ItsFields;
    private $_ItsErrors;
    /** @brief    Contexte d'exécution partagé par tous les éléments */
    private static $_context = null;
    const REQUIRED = true;
    const TYPE_TEXT = 1;
    const TYPE_SELECT = 2;
    const TYPE_NUMERIC = 4;
    const TYPE_FLOAT = 8;
    const TYPE_RADIO = 16;
    const TYPE_CHECKBOX = 32;
    const TYPE_UPLOAD = 64;
    public function __construct()
    {
        if (is_null(self::$_context)) {
            throw new Exception('Context must be defined');
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:FormChecker.php

示例12: __construct

<?php

/**
 * @package       ADT
 * @class         AbstractTypedList
 * @author        Jimmy CHARLEBOIS
 * @date          21-02-2007
 * @brief         Classe abstraite pour gérer des List avec des éléments typés
 * @example       adt-typedlist-loader.php
 */
System::import('System.Interfaces.ADT.IList');
System::import('System.ADT.AbstractTypedCollection');
System::import('System.Exceptions.TypeMismatchException');
abstract class AbstractTypedList extends AbstractTypedCollection implements IList
{
    protected function __construct($type, IList &$list)
    {
        parent::__construct($type, $list);
    }
    public function set($index, $o)
    {
        if (!is_a($o, $this->_type)) {
            throw new TypeMismatchException(sprintf('Argument must be an instance of %s object', $this->_type));
        }
        $this->_collection->set($index, $o);
    }
    public function &get($index)
    {
        return $this->_collection->get($index);
    }
    public function indexOf($o)
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:AbstractTypedList.php

示例13: __construct

<?php

/**
 * @package     	DataSource
 * @class       	DbmsMysql
 * @author      	Jimmy CHARLEBOIS
 * @date        	02-01-2007
 * @brief       	Implémentation concrête de DbmsDataSource pour MySQL
 */
System::import('System.DataSource.Dbms.ResultSets.ResultSetMysql');
class DbmsMysql extends DbmsDataSource
{
    public function __construct(IDataSourceDriver $driver)
    {
        parent::__construct($driver);
    }
    public function connect()
    {
        if (is_resource($this->getResource())) {
            return true;
        }
        $driver =& $this->getDriver();
        $res = @mysql_connect($driver->getHost(), $driver->getUsername(), $driver->getPassword());
        if (!$res) {
            throw new Exception('Unable to connect with ' . $driver->toString());
        }
        $this->setResource($res);
        return @mysql_select_db($driver->getDbName(), $res);
    }
    public function close()
    {
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:DbmsMysql.php

示例14:

<?php

/**
 * @package       Network.Http
 * @class         HttpMessage
 * @author        Jimmy CHARLEBOIS
 * @date          14-02-2007
 * @brief         Classe sous jacente encapsulant un message HTTP (requête ou réponse)
 */
System::import('System.Interfaces.Network.IHttpMessage');
class HttpMessage implements IHttpMessage
{
    private $_type;
    private $_url;
    private $_method;
    private $_version;
    private $_raw;
    private $_headers;
    private $_body;
    private $_querystring;
    private $_response_code;
    private $_response_statut;
    const EOL = "\r\n";
    /** @defgroup   HttpMessageType   Constantes pour les méthodes d'envoi d'un message Http */
    /*@{*/
    const REQUEST = 1;
    const RESPONSE = 2;
    /*@}*/
    /** @defgroup   HttpMessageMethod   Constantes pour les méthodes d'envoi d'un message Http */
    /*@{*/
    const METHOD_POST = 'post';
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:HttpMessage.php

示例15: __construct

<?php

/**
 * @package     	Log
 * @class       	FileLog
 * @author      	Jimmy CHARLEBOIS
 * @date        	24-01-2007
 * @brief       	Fichier de journalisation
 * @code
 *   $log =& new FileLog( 'test.log' );
 *   $log->write( 'Un message à logguer !' );
 *   $log->dispose();
 * @endcode
 */
System::import('System.Interfaces.Log.ILog');
System::import('System.IO.SysFile');
class FileLog implements ILog, IResource
{
    private $_resource;
    public function __construct($filename)
    {
        $this->_resource = new SysFile($filename);
        $this->_resource->open(SysFile::APPEND_ACCESS);
    }
    public function write($data)
    {
        $data = sprintf('[%s] %s%s', date('Y-m-d H:i:s'), $data, System::crlf);
        return $this->_resource->write($data);
    }
    public function dispose()
    {
开发者ID:gotnospirit,项目名称:php-dpat,代码行数:31,代码来源:FileLog.php


注:本文中的System::import方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。