3
require_once 'PEAR.php';
6
* VFS API for abstracted creation of ISO (CD-ROM) filesystems.
8
* $Horde: framework/VFS_ISOWriter/ISOWriter.php,v 1.1.8.1 2005/01/03 12:19:21 jan Exp $
10
* Copyright 2004-2005 Cronosys, LLC <http://www.cronosys.com/>
12
* See the enclosed file COPYING for license information (LGPL). If you
13
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
15
* @author Jason M. Felice <jfelice@cronosys.com>
16
* @version $Revision: 1.1.8.1 $
23
* A VFS object used for reading the source files
25
* @var object $_sourceVfs
27
var $_sourceVfs = null;
30
* A VFS object used for writing the ISO image
32
* @var object $_targetVfs
34
var $_targetVfs = null;
37
* Hash containing connection parameters.
41
var $_params = array();
44
* Constructs a new VFS_ISOWriter object
48
* @param array $params A hash containing parameters.
50
function VFS_ISOWriter(&$sourceVfs, &$targetVfs, $params)
52
$this->_sourceVfs = &$sourceVfs;
53
$this->_targetVfs = &$targetVfs;
54
$this->_params = $params;
58
* Create the ISO image
63
* @return mixed Null or PEAR_Error on failure.
67
return PEAR::raiseError(_("Not implemented."));
71
* Attempt to create a concrete VFS_ISOWriter subclass.
73
* This method uses its parameters and checks the system to determine
74
* the most appropriate subclass to use for building ISO images. If
75
* none is found, an error is raised.
79
* @param object &$sourceVfs Reference to the VFS object from which
80
* the files will be read to create the
82
* @param object &$targetVfs Reference to the VFS object to which the
83
* ISO image will be written.
84
* @param array $params Hash of parameters for creating the
86
* 'sourceRoot' => A directory in the source VFS for
87
* files to be read from for the image.
88
* 'targetFile' => Path and filename of the ISO file to
89
* write into the target VFS.
91
* @return object A newly created concrete VFS_ISOWriter
92
* subclass, or a PEAR_Error on an error.
94
function &factory(&$sourceVfs, &$targetVfs, $params)
96
if (empty($params['targetFile'])) {
97
return PEAR::raiseError(_("Cannot proceed without 'targetFile' parameter."));
99
if (empty($params['sourceRoot'])) {
100
$params['sourceRoot'] = '/';
103
/* Right now, mkisofs is the only driver, but make sure we can
105
require_once dirname(__FILE__) . '/ISOWriter/mkisofs.php';
106
if (VFS_ISOWriter_mkisofs::strategyAvailable()) {
107
return $ret = &new VFS_ISOWriter_mkisofs($sourceVfs, $targetVfs,
111
return PEAR::raiseError(_("No available strategy for making ISO images."));