a php interface for wrapper
<?php
interface WrapperInterface
{
/**
* resource context
*
* @var resource
*/
//public $context;
/**
* constructor
*
*/
public function __construct();
/**
*
*
* @return bool
*/
public function dir_closedir();
/**
* Enter description here...
*
* @param string $path
* @param int $options
* @return bool
*/
public function dir_opendir($path , $options);
/**
* Enter description here...
*
* @return string
*/
public function dir_readdir();
/**
* Enter description here...
*
* @return bool
*/
public function dir_rewinddir();
/**
* Enter description here...
*
* @param string $path
* @param int $mode
* @param int $options
* @return bool
*/
public function mkdir($path , $mode , $options);
/**
* Enter description here...
*
* @param string $path_from
* @param string $path_to
* @return bool
*/
public function rename($path_from , $path_to);
/**
* Enter description here...
*
* @param string $path
* @param int $options
* @return bool
*/
public function rmdir($path , $options);
/**
* Enter description here...
*
* @param int $cast_as
* @return resource
*/
public function stream_cast($cast_as);
/**
* Enter description here...
*
*/
public function stream_close();
/**
* Enter description here...
*
* @return bool
*/
public function stream_eof();
/**
* Enter description here...
*
* @return bool
*/
public function stream_flush();
/**
* Enter description here...
*
* @param mode $operation
* @return bool
*/
public function stream_lock($operation);
/**
* Enter description here...
*
* @param string $path
* @param string $mode
* @param int $options
* @param string &$opened_path
* @return bool
*/
public function stream_open($path , $mode , $options , &$opened_path);
/**
* Enter description here...
*
* @param int $count
* @return string
*/
public function stream_read($count);
/**
* Enter description here...
*
* @param int $offset
* @param int $whence = SEEK_SET
* @return bool
*/
public function stream_seek($offset , $whence = SEEK_SET);
/**
* Enter description here...
*
* @param int $option
* @param int $arg1
* @param int $arg2
* @return bool
*/
public function stream_set_option($option , $arg1 , $arg2);
/**
* Enter description here...
*
* @return array
*/
public function stream_stat();
/**
* Enter description here...
*
* @return int
*/
public function stream_tell();
/**
* Enter description here...
*
* @param string $data
* @return int
*/
public function stream_write($data);
/**
* Enter description here...
*
* @param string $path
* @return bool
*/
public function unlink($path);
/**
* Enter description here...
*
* @param string $path
* @param int $flags
* @return array
*/
public function url_stat($path , $flags);
}
?>
La classe streamWrapper
Introduction
Permet la création de gestionnaires de protocoles et de flux, à utiliser avec toutes les fonctions système, telles que fopen(), fread() etc.).
Note: Cette classe n'est pas une classe concrète : c'est juste un prototype d'une classe qui définirait son propre protocole.
Note: Implémenter les méthodes d'une manière qui n'est pas décrite dans la documentation peut mener à des comportements indéfinis.
Une instance de cette classe est initialisée aussitôt que les fonctions de flux tentent d'accéder à une ressource avec un protocole.
Synopsis de la classe
Propriétés
- resource context
-
Le contexte courant, ou NULL si aucun contexte n'a été passé à la fonction.
Utilisez la fonction stream_context_get_options() pour analyser le contexte.
Note: Cette propriété doit être public, pour que PHP puisse la remplir avec la ressource de contexte.
Historique
| Version | Description |
|---|---|
| 5.0.0 | Ajout de la propriété context. |
Sommaire
- streamWrapper::__construct — Construit un nouveau gestionnaire de flux
- streamWrapper::dir_closedir — Ferme une ressource de dossier
- streamWrapper::dir_opendir — Ouvre un dossier en lecture
- streamWrapper::dir_readdir — Lit un fichier dans un dossier
- streamWrapper::dir_rewinddir — Remet au début une ressource de dossier
- streamWrapper::mkdir — Crée un dossier
- streamWrapper::rename — Renomme un fichier ou un dossier
- streamWrapper::rmdir — Supprime un dossier
- streamWrapper::stream_cast — Lit la ressource sous-jacente de flux
- streamWrapper::stream_close — Ferme une ressource de flux
- streamWrapper::stream_eof — Tests for end-of-file on a file pointer
- streamWrapper::stream_flush — Expédie le contenu
- streamWrapper::stream_lock — Verrouillage logique de fichiers
- streamWrapper::stream_open — Opens file or URL
- streamWrapper::stream_read — Lit dans le flux
- streamWrapper::stream_seek — Place le pointeur de flux à une position
- streamWrapper::stream_set_option — Change les options du flux
- streamWrapper::stream_stat — Lit les informations sur une ressource de fichier
- streamWrapper::stream_tell — Lit la position courante dans un flux
- streamWrapper::stream_write — Écrit dans un flux
- streamWrapper::unlink — Efface un fichier
- streamWrapper::url_stat — Lit les informations sur un fichier
streamWrapper
17-Jul-2009 09:38
