Source for file Bcompile.php
Documentation is available at Bcompile.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* ScriptReorganizer Type Decorator :: Bcompile
* LICENSE: This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option) any
* @package ScriptReorganizer
* @subpackage Type_Decorator
* @author Stefano F. Rausch <stefano@rausch-e.net>
* @copyright 2005 Stefano F. Rausch <stefano@rausch-e.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version SVN: $Id: Bcompile.php 33 2005-11-06 22:05:46Z stefanorausch $
* @link http://pear.php.net/package/ScriptReorganizer
* @since File available since Release 0.3.0
* Depends on <kbd>ScriptReorganizer_Type</kbd>
require_once 'ScriptReorganizer/Type.php';
* Extends <kbd>ScriptReorganizer_Type_Decorator</kbd>
require_once 'ScriptReorganizer/Type/Decorator.php';
* Throws <kbd>ScriptReorganizer_Type_Decorator_Exception</kbd>
require_once 'ScriptReorganizer/Type/Decorator/Exception.php';
* Decorator/Adapter for encoding a PHP source file in byte-code
* If a script or a library is bcompiled, a non-ScriptReorganized source code tree
* should be shipped together with the optimized one, to enable third parties to
* track down undiscoverd bugs.
* ANN: Decoration of a directly sequencing Bcompile-Decorator or Pharize-Decorator
* @package ScriptReorganizer
* @subpackage Type_Decorator
* @author Stefano F. Rausch <stefano@rausch-e.net>
* @copyright 2005 Stefano F. Rausch <stefano@rausch-e.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/ScriptReorganizer
* @since Class available since Release 0.3.0
// {{{ public function __construct( ScriptReorganizer_Type $type )
* @param ScriptReorganizer_Type $type a <kbd>ScriptReorganizer_Type</kbd> to
* @throws {@link ScriptReorganizer_Type_Decorator_Exception ScriptReorganizer_Type_Decorator_Exception}
public function __construct( ScriptReorganizer_Type $type )
$constraint = 'Bcompile-Decorator';
} else if ( class_exists( 'ScriptReorganizer_Type_Decorator_Pharize', false ) ) {
$constraint = 'Pharize-Decorator';
'Decoration of a directly sequencing ' . $constraint . ' not allowed'
'PHP Extension bcompiler not loaded'
// {{{ public function save( $file )
* Saves the reorganized script's content as encoded byte-code to disk
* @param string $file a string representing the file's name to save
* @throws {@link ScriptReorganizer_Type_Decorator_Exception ScriptReorganizer_Type_Decorator_Exception}
public function save( $file )
$source = 'source.' . md5($file);
if ( $target = @fopen( $file, 'wb' ) ) {
'BCompiler file ' . $file . ' is not writable'
* c-hanging-comment-ender-p: nil
Documentation generated on Mon, 11 Mar 2019 14:10:29 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|