Source for file Buffer.php
Documentation is available at Buffer.php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 fdm=marker encoding=utf8 :
* Pxxo - build self-supported and interoperable Web graphical components
* Copyright (c) 2008, Nicolas Thouvenin
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @copyright Copyright (c) 2008 Nicolas Thouvenin
* @license http://opensource.org/licenses/bsd-license.php
* Classe permet de gérer l'accès à des flux de données
* Un flux est par exemple une chaine de caractère, un fichier,
* mais cela pourait être une base de données, une zone mémoire, peu importe...
* @copyright Copyright (c) 2008 Nicolas Thouvenin
* @license http://opensource.org/licenses/bsd-license.php
* @var string identifiant unique du Buffer
* @var string localisation du flux
* @var array list de callback à appliquer en sortie du flux
* @var string type du contenu du flux
* @var string support pour le flux (url/file/buffer/...)
* @var integer importance du Buffer
* @param string localisation du flux
* Création d'un objet pour un type de flux spécifique
* @param string type du fichier
public static function factory($type, $uri)
include_once('Pxxo/Buffer/PHP.php');
include_once('Pxxo/Buffer/HTML.php');
include_once('Pxxo/Buffer/Resource/CSS.php');
include_once('Pxxo/Buffer/Resource/Javascript.php');
include_once('Pxxo/Buffer/Header/Title.php');
include_once('Pxxo/Buffer/Header/Meta.php');
include_once('Pxxo/Buffer/Header.php');
include_once('Pxxo/Buffer/Resource.php');
* On récupère le contenu du flux
* @return string le contenu du flux
* On rempli soit même le flux
// Reference vers un contenu
$this->uri =
md5(''.
$p); // Localization fictive, est-ce vraiment utile ????
* Merge un buffer avec le buffer courant
public function merge($o)
$this->set($this->get().
$o->get());
* Ajoute une fonction callback en sortie du flux
* @param string nom d'une function ou d'une méthode de l'objet Buffer (protected)
* @return boolean le filtre est-il actif
$this->_func[] =
array('method', $s);
* Application des Filtres
foreach($this->_func as $func) {
if (is_array($func) and $func[0] ===
'method') {
* Fixe l'identifiant unique du Buffer
public function setID($s)
if (isset
($s[0]) and $s[0] ==
'-') $s[0] =
'z';
* Renvoit un identifiant unique du Buffer
* Renvoi le type du Buffer
* Renvoi le type étendu du Buffer
* Teste le type du Buffer
return $this->type ===
$type ?
true :
false;
* Donne un poid au Buffer
* returne le poid duBuffer
Documentation generated on Thu, 13 Mar 2008 22:03:10 +0100 by phpDocumentor 1.4.1