feat: add videodb media index with Docker stack

- Add videodb PHP/MySQL media collection manager (Blu-ray, DVD, CD)
- Dockerfile: PHP 8.1 + Apache with GD/mysqli/exif extensions
- docker-compose.yml: app on port 6761 + MySQL 8.0 with health checks
- docker-entrypoint.sh: auto-generates config.inc.php from env vars,
  waits for MySQL, initializes DB schema idempotently
- init-db.php: CLI schema installer using app's own prefix_query() logic
- Persistent volumes for DB, cache, and cover images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 09:49:52 +02:00
commit f55c91276e
1230 changed files with 252321 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Debug with: git archive --format=tar HEAD | tar t
/tests export-ignore

View File

@@ -0,0 +1,60 @@
# yamllint disable rule:line-length
# yamllint disable rule:braces
name: Continuous Integration
on:
pull_request:
push:
branches:
- main
- master
jobs:
tests:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
name: CI on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.composer-flags }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-
- name: Install dependencies
run: |
composer update --no-interaction --prefer-dist --no-progress ${{ matrix.composer-flags }}
- name: Run tests
run: |
vendor/bin/phpunit
- name: Lint code
run: |
find OLE* -type f -name \*.php | xargs -n1 php -l

View File

@@ -0,0 +1,38 @@
name: Coding Standards
on:
pull_request:
push:
branches:
- main
- master
jobs:
coding-standards:
name: Coding Standards
runs-on: ubuntu-latest
env:
PHP_CS_FIXER_VERSION: v2.17.3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: php-cs-fixer:${{ env.PHP_CS_FIXER_VERSION }}
- name: Restore PHP-CS-Fixer cache
uses: actions/cache@v2
with:
path: .php_cs.cache
key: "php-cs-fixer"
restore-keys: "php-cs-fixer"
- name: Run PHP-CS-Fixer, version ${{ env.PHP_CS_FIXER_VERSION }}
run: |
php-cs-fixer fix --diff --diff-format=udiff --dry-run --verbose

4
videodb/vendor/pear/ole/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# composer related
composer.lock
composer.phar
vendor

11
videodb/vendor/pear/ole/.php_cs.dist vendored Normal file
View File

@@ -0,0 +1,11 @@
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR1' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
)
;

43
videodb/vendor/pear/ole/.travis.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
sudo: false
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- nightly
stages:
- analyze
- test
jobs:
fast_finish: true
allow_failures:
- php: nightly
include:
- stage: analyze
php: 7.4
install:
- composer install --prefer-dist
script:
- php vendor/bin/php-cs-fixer fix --dry-run --diff
- composer validate
- find OLE* -type f -name \*.php | xargs -n1 php -l
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/cache
install:
- composer remove --no-update --dev
friendsofphp/php-cs-fixer
- composer install --prefer-dist
script:
- vendor/bin/phpunit --verbose

616
videodb/vendor/pear/ole/OLE.php vendored Normal file
View File

@@ -0,0 +1,616 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Xavier Noguer <xnoguer@php.net> |
// | Based on OLE::Storage_Lite by Kawai, Takanori |
// +----------------------------------------------------------------------+
//
// $Id$
/**
* Constants for OLE package
*/
define('OLE_PPS_TYPE_ROOT', 0x05);
define('OLE_PPS_TYPE_DIR', 0x01);
define('OLE_PPS_TYPE_FILE', 0x02);
define('OLE_DATA_SIZE_SMALL', 0x1000);
define('OLE_LONG_INT_SIZE', 4);
define('OLE_PPS_SIZE', 0x80);
define('OLE_DIFSECT', 0xFFFFFFFC);
define('OLE_FATSECT', 0xFFFFFFFD);
define('OLE_ENDOFCHAIN', 0xFFFFFFFE);
define('OLE_FREESECT', 0xFFFFFFFF);
define('OLE_LITTLE_ENDIAN', 0xFFFE);
define('OLE_VERSION_MAJOR_3', 0x0003);
define('OLE_VERSION_MINOR', 0x003E);
define('OLE_SECTOR_SHIFT_3', 0x0009);
define('OLE_MINI_SECTOR_SHIFT', 0x0006);
define('OLE_CFB_SIGNATURE', "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1");
if (!class_exists('PEAR')) {
require_once 'PEAR.php';
}
/**
* Array for storing OLE instances that are accessed from
* OLE_ChainedBlockStream::stream_open().
* @var array
*/
$GLOBALS['_OLE_INSTANCES'] = array();
/**
* OLE package base class.
*
* @category Structures
* @package OLE
* @author Xavier Noguer <xnoguer@php.net>
* @author Christian Schmidt <schmidt@php.net>
*/
class OLE extends PEAR
{
/**
* The file handle for reading an OLE container
* @var resource
*/
var $_file_handle;
/**
* Reference to the sbat stream
* @var resource
*/
var $_small_handle;
/**
* Array of PPS's found on the OLE container
* @var array
*/
var $_list;
/**
* Root directory of OLE container
* @var OLE_PPS_Root
*/
var $root;
/**
* Big Block Allocation Table
* @var array (blockId => nextBlockId)
*/
var $bbat;
/**
* Short Block Allocation Table
* @var array (blockId => nextBlockId)
*/
var $sbat;
/**
* Size of big blocks. This is usually 512.
* @var int number of octets per block.
*/
var $bigBlockSize;
/**
* Size of small blocks. This is usually 64.
* @var int number of octets per block
*/
var $smallBlockSize;
/**
* Creates a new OLE object
* @access public
*/
function __construct()
{
$this->_list = array();
}
/**
* Destructor (using PEAR)
* Just closes the file handle on the OLE file.
*
* @access private
*/
function _OLE()
{
fclose($this->_file_handle);
}
/**
* Reads an OLE container from the contents of the file given.
*
* @access public
* @param string $file
* @return mixed true on success, PEAR_Error on failure
*/
function read($file)
{
$fh = @fopen($file, "r");
if (!$fh) {
return $this->raiseError("Can't open file $file");
}
return $this->readStream($fh);
}
/**
* Reads an OLE container from the contents of the stream given.
*
* @access public
* @param resource $fh
* @return mixed true on success, PEAR_Error on failure
*/
function readStream($fh)
{
$this->_file_handle = $fh;
$signature = fread($fh, 8);
if (OLE_CFB_SIGNATURE != $signature) {
return $this->raiseError("File doesn't seem to be an OLE container.");
}
fseek($fh, 28);
if ($this->_readInt2($fh) != OLE_LITTLE_ENDIAN) {
// This shouldn't be a problem in practice
return $this->raiseError("Only Little-Endian encoding is supported.");
}
// Size of blocks and short blocks in bytes
$this->bigBlockSize = pow(2, $this->_readInt2($fh));
$this->smallBlockSize = pow(2, $this->_readInt2($fh));
// Skip UID, revision number and version number
fseek($fh, 44);
// Number of blocks in Big Block Allocation Table
$bbatBlockCount = $this->_readInt4($fh);
// Root chain 1st block
$directoryFirstBlockId = $this->_readInt4($fh);
// Skip unused bytes
fseek($fh, 56);
// Streams shorter than this are stored using small blocks
$this->bigBlockThreshold = $this->_readInt4($fh);
// Block id of first sector in Short Block Allocation Table
$sbatFirstBlockId = $this->_readInt4($fh);
// Number of blocks in Short Block Allocation Table
$sbbatBlockCount = $this->_readInt4($fh);
// Block id of first sector in Master Block Allocation Table
$mbatFirstBlockId = $this->_readInt4($fh);
// Number of blocks in Master Block Allocation Table
$mbbatBlockCount = $this->_readInt4($fh);
$this->bbat = array();
// Remaining 4 * 109 bytes of current block is beginning of Master
// Block Allocation Table
$mbatBlocks = array();
for ($i = 0; $i < 109; $i++) {
$mbatBlocks[] = $this->_readInt4($fh);
}
// Read rest of Master Block Allocation Table (if any is left)
$pos = $this->_getBlockOffset($mbatFirstBlockId);
for ($i = 0; $i < $mbbatBlockCount; $i++) {
fseek($fh, $pos);
for ($j = 0; $j < $this->bigBlockSize / 4 - 1; $j++) {
$mbatBlocks[] = $this->_readInt4($fh); // ffix - invalid block address check
}
// Last block id in each block points to next block
$chainBlock = $this->_readInt4($fh);
if ($chainBlock === OLE_ENDOFCHAIN) { // ENDOFCHAIN
break;
}
$pos = $this->_getBlockOffset($chainBlock);
}
// Read Big Block Allocation Table according to chain specified by
// $mbatBlocks
for ($i = 0; $i < $bbatBlockCount; $i++) {
$pos = $this->_getBlockOffset($mbatBlocks[$i]);
fseek($fh, $pos);
for ($j = 0 ; $j < $this->bigBlockSize / 4; $j++) {
$this->bbat[] = $this->_readInt4($fh);
}
}
// Read short block allocation table (SBAT)
$this->sbat = array();
$shortBlockCount = $sbbatBlockCount * $this->bigBlockSize / 4;
$sbatFh = $this->getStream($sbatFirstBlockId);
if (!$sbatFh) {
// Avoid an infinite loop if ChainedBlockStream.php somehow is
// missing
return false;
}
for ($blockId = 0; $blockId < $shortBlockCount; $blockId++) {
$this->sbat[$blockId] = $this->_readInt4($sbatFh);
}
fclose($sbatFh);
$this->_readPpsWks($directoryFirstBlockId);
return true;
}
/**
* @param int $blockId block id
* @return int byte offset from beginning of file
* @access private
*/
function _getBlockOffset($blockId)
{
return 512 + $blockId * $this->bigBlockSize;
}
/**
* Returns a stream for use with fread() etc. External callers should
* use OLE_PPS_File::getStream().
* @param int|PPS $blockIdOrPps block id or PPS
* @return resource read-only stream
*/
function getStream($blockIdOrPps)
{
include_once 'OLE/ChainedBlockStream.php';
static $isRegistered = false;
if (!$isRegistered) {
stream_wrapper_register('ole-chainedblockstream',
'OLE_ChainedBlockStream');
$isRegistered = true;
}
// Store current instance in global array, so that it can be accessed
// in OLE_ChainedBlockStream::stream_open().
// Object is removed from self::$instances in OLE_Stream::close().
$GLOBALS['_OLE_INSTANCES'][] = $this;
$keys = array_keys($GLOBALS['_OLE_INSTANCES']);
$instanceId = end($keys);
$path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId;
if (is_a($blockIdOrPps, 'OLE_PPS')) {
$path .= '&blockId=' . $blockIdOrPps->_StartBlock;
$path .= '&size=' . $blockIdOrPps->Size;
} else {
$path .= '&blockId=' . $blockIdOrPps;
}
return fopen($path, 'r');
}
/**
* Reads a signed char.
* @param resource $fh file handle
* @return int
* @access private
*/
function _readInt1($fh)
{
list(, $tmp) = unpack("c", fread($fh, 1));
return $tmp;
}
/**
* Reads an unsigned short (2 octets).
* @param resource $fh file handle
* @return int
* @access private
*/
function _readInt2($fh)
{
list(, $tmp) = unpack("v", fread($fh, 2));
return $tmp;
}
/**
* Reads an unsigned long (4 octets).
* @param resource file handle
* @return int
* @access private
*/
function _readInt4($fh)
{
list(, $tmp) = unpack("V", fread($fh, 4));
return $tmp;
}
/**
* Gets information about all PPS's on the OLE container from the PPS WK's
* creates an OLE_PPS object for each one.
*
* @access private
* @param integer $blockId the block id of the first block
* @return mixed true on success, PEAR_Error on failure
*/
function _readPpsWks($blockId)
{
$fh = $this->getStream($blockId);
for ($pos = 0; ; $pos += 128) {
fseek($fh, $pos, SEEK_SET);
$nameUtf16 = fread($fh, 64);
$nameLength = $this->_readInt2($fh);
$nameUtf16 = substr($nameUtf16, 0, $nameLength - 2);
// Simple conversion from UTF-16LE to ISO-8859-1
$name = str_replace("\x00", "", $nameUtf16);
$type = $this->_readInt1($fh);
switch ($type) {
case OLE_PPS_TYPE_ROOT:
require_once 'OLE/PPS/Root.php';
$pps = new OLE_PPS_Root(null, null, array());
$this->root = $pps;
break;
case OLE_PPS_TYPE_DIR:
$pps = new OLE_PPS(null, null, null, null, null,
null, null, null, null, array());
break;
case OLE_PPS_TYPE_FILE:
require_once 'OLE/PPS/File.php';
$pps = new OLE_PPS_File($name);
break;
default:
continue 2;
}
fseek($fh, 1, SEEK_CUR); // skip Color Flag
$pps->Type = $type;
$pps->Name = $name;
$pps->PrevPps = $this->_readInt4($fh); // Left Sibling ID
$pps->NextPps = $this->_readInt4($fh); // Right Sibling ID
$pps->DirPps = $this->_readInt4($fh); // Child ID
fseek($fh, 20, SEEK_CUR); // skip CLSID (16 bytes) + State Bits
$pps->Time1st = OLE::OLE2LocalDate(fread($fh, 8));
$pps->Time2nd = OLE::OLE2LocalDate(fread($fh, 8));
$pps->_StartBlock = $this->_readInt4($fh);
$pps->Size = $this->_readInt4($fh);
$pps->No = count($this->_list);
$this->_list[] = $pps;
if ($type == OLE_PPS_TYPE_ROOT) {
$this->_small_handle = $this->getStream($pps->_StartBlock);
}
// check if the PPS tree (starting from root) is complete
if (isset($this->root) &&
$this->_ppsTreeComplete($this->root->No)) {
break;
}
}
fclose($fh);
// Initialize $pps->children on directories
foreach ($this->_list as $pps) {
if ($pps->Type == OLE_PPS_TYPE_DIR || $pps->Type == OLE_PPS_TYPE_ROOT) {
$nos = array($pps->DirPps);
$pps->children = array();
while ($nos) {
$no = array_pop($nos);
if ($no != OLE_FREESECT) {
$childPps = $this->_list[$no];
$nos[] = $childPps->PrevPps;
$nos[] = $childPps->NextPps;
$pps->children[] = $childPps;
}
}
}
}
return true;
}
/**
* It checks whether the PPS tree is complete (all PPS's read)
* starting with the given PPS (not necessarily root)
*
* @access private
* @param integer $index The index of the PPS from which we are checking
* @return boolean Whether the PPS tree for the given PPS is complete
*/
function _ppsTreeComplete($index)
{
return isset($this->_list[$index]) &&
($pps = $this->_list[$index]) &&
($pps->PrevPps == OLE_FREESECT ||
$this->_ppsTreeComplete($pps->PrevPps)) &&
($pps->NextPps == OLE_FREESECT ||
$this->_ppsTreeComplete($pps->NextPps)) &&
($pps->DirPps == OLE_FREESECT ||
$this->_ppsTreeComplete($pps->DirPps));
}
/**
* Checks whether a PPS is a File PPS or not.
* If there is no PPS for the index given, it will return false.
* @param integer $index The index for the PPS
* @return bool true if it's a File PPS, false otherwise
* @access public
*/
function isFile($index)
{
if (isset($this->_list[$index])) {
return ($this->_list[$index]->Type == OLE_PPS_TYPE_FILE);
}
return false;
}
/**
* Checks whether a PPS is a Root PPS or not.
* If there is no PPS for the index given, it will return false.
* @param integer $index The index for the PPS.
* @return bool true if it's a Root PPS, false otherwise
* @access public
*/
function isRoot($index)
{
if (isset($this->_list[$index])) {
return ($this->_list[$index]->Type == OLE_PPS_TYPE_ROOT);
}
return false;
}
/**
* Gives the total number of PPS's found in the OLE container.
* @return integer The total number of PPS's found in the OLE container
* @access public
*/
function ppsTotal()
{
return count($this->_list);
}
/**
* Gets data from a PPS
* If there is no PPS for the index given, it will return an empty string.
* @param integer $index The index for the PPS
* @param integer $position The position from which to start reading
* (relative to the PPS)
* @param integer $length The amount of bytes to read (at most)
* @return string The binary string containing the data requested
* @access public
* @see OLE_PPS_File::getStream()
*/
function getData($index, $position, $length)
{
// if position is not valid return empty string
if (!isset($this->_list[$index]) ||
$position >= $this->_list[$index]->Size ||
$position < 0) {
return '';
}
$fh = $this->getStream($this->_list[$index]);
$data = stream_get_contents($fh, $length, $position);
fclose($fh);
return $data;
}
/**
* Gets the data length from a PPS
* If there is no PPS for the index given, it will return 0.
* @param integer $index The index for the PPS
* @return integer The amount of bytes in data the PPS has
* @access public
*/
function getDataLength($index)
{
if (isset($this->_list[$index])) {
return $this->_list[$index]->Size;
}
return 0;
}
/**
* Utility function to transform ASCII text to Unicode
*
* @access public
* @static
* @param string $ascii The ASCII string to transform
* @return string The string in Unicode
*/
static function Asc2Ucs($ascii)
{
$rawname = '';
for ($i = 0; $i < strlen($ascii); $i++) {
$rawname .= $ascii[$i] . "\x00";
}
return $rawname;
}
/**
* Utility function
* Returns a string for the OLE container with the date given
*
* @access public
* @static
* @param integer $date A timestamp
* @return string The string for the OLE container
*/
static function LocalDate2OLE($date = null)
{
if (!isset($date)) {
return "\x00\x00\x00\x00\x00\x00\x00\x00";
}
// factor used for separating numbers into 4 bytes parts
$factor = pow(2, 32);
// days from 1-1-1601 until the beggining of UNIX era
$days = 134774;
// calculate seconds
$big_date = $days * 24 * 3600 +
gmmktime(date("H",$date),date("i",$date),date("s",$date),
date("m",$date),date("d",$date),date("Y",$date));
// multiply just to make MS happy
$big_date *= 10000000;
$high_part = floor($big_date / $factor);
// lower 4 bytes
$low_part = floor((($big_date / $factor) - $high_part) * $factor);
// Make HEX string
$res = '';
for ($i = 0; $i < 4; $i++) {
$hex = $low_part % 0x100;
$res .= pack('c', $hex);
$low_part /= 0x100;
}
for ($i = 0; $i < 4; $i++) {
$hex = $high_part % 0x100;
$res .= pack('c', $hex);
$high_part /= 0x100;
}
return $res;
}
/**
* Returns a timestamp from an OLE container's date
* @param integer $string A binary string with the encoded date
* @return string The timestamp corresponding to the string
* @access public
* @static
*/
static function OLE2LocalDate($string)
{
if (strlen($string) != 8) {
return new PEAR_Error("Expecting 8 byte string");
}
// factor used for separating numbers into 4 bytes parts
$factor = pow(2,32);
$high_part = 0;
for ($i = 0; $i < 4; $i++) {
list(, $high_part) = unpack('C', $string[(7 - $i)]);
if ($i < 3) {
$high_part *= 0x100;
}
}
$low_part = 0;
for ($i = 4; $i < 8; $i++) {
list(, $low_part) = unpack('C', $string[(7 - $i)]);
if ($i < 7) {
$low_part *= 0x100;
}
}
$big_date = ($high_part * $factor) + $low_part;
// translate to seconds
$big_date /= 10000000;
// days from 1-1-1601 until the beggining of UNIX era
$days = 134774;
// translate to seconds from beggining of UNIX era
$big_date -= $days * 24 * 3600;
return floor($big_date);
}
}

View File

@@ -0,0 +1,246 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Stream wrapper for reading data stored in an OLE file.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category Structures
* @package OLE
* @author Christian Schmidt <schmidt@php.net>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id$
* @link http://pear.php.net/package/OLE
* @since File available since Release 0.6.0
*/
if (!class_exists('PEAR')) {
require_once 'PEAR.php';
}
if (!class_exists('OLE')) {
require_once 'OLE.php';
}
/**
* Stream wrapper for reading data stored in an OLE file. Implements methods
* for PHP's stream_wrapper_register(). For creating streams using this
* wrapper, use OLE_PPS_File::getStream().
*
* @category Structures
* @package OLE
* @author Christian Schmidt <schmidt@php.net>
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: @package_version@
* @link http://pear.php.net/package/OLE
* @since Class available since Release 0.6.0
*/
class OLE_ChainedBlockStream extends PEAR
{
/**
* The OLE container of the file that is being read.
* @var OLE
*/
var $ole;
/**
* Parameters specified by fopen().
* @var array
*/
var $params;
/**
* The binary data of the file.
* @var string
*/
var $data;
/**
* The file pointer.
* @var int byte offset
*/
var $pos;
/**
* Implements support for fopen().
* For creating streams using this wrapper, use OLE_PPS_File::getStream().
* @param string resource name including scheme, e.g.
* ole-chainedblockstream://oleInstanceId=1
* @param string only "r" is supported
* @param int mask of STREAM_REPORT_ERRORS and STREAM_USE_PATH
* @param string absolute path of the opened stream (out parameter)
* @return bool true on success
*/
function stream_open($path, $mode, $options, &$openedPath)
{
if ($mode != 'r') {
if ($options & STREAM_REPORT_ERRORS) {
trigger_error('Only reading is supported', E_USER_WARNING);
}
return false;
}
// 25 is length of "ole-chainedblockstream://"
parse_str(substr($path, 25), $this->params);
if (!isset($this->params['oleInstanceId'],
$this->params['blockId'],
$GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']])) {
if ($options & STREAM_REPORT_ERRORS) {
trigger_error('OLE stream not found', E_USER_WARNING);
}
return false;
}
$this->ole = $GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']];
$blockId = $this->params['blockId'];
$this->data = '';
if (isset($this->params['size']) &&
$this->params['size'] < $this->ole->bigBlockThreshold &&
$blockId != $this->ole->root->_StartBlock) {
// Block id refers to small blocks
$rootPos = 0;
while ($blockId != OLE_ENDOFCHAIN) {
$pos = $rootPos + $blockId * $this->ole->smallBlockSize;
$blockId = $this->ole->sbat[$blockId];
fseek($this->ole->_small_handle, $pos);
$this->data .= fread($this->ole->_small_handle, $this->ole->smallBlockSize);
}
} else {
// Block id refers to big blocks
while ($blockId != OLE_ENDOFCHAIN) {
$pos = $this->ole->_getBlockOffset($blockId);
fseek($this->ole->_file_handle, $pos);
$this->data .= fread($this->ole->_file_handle, $this->ole->bigBlockSize);
$blockId = $this->ole->bbat[$blockId];
}
}
if (isset($this->params['size'])) {
$this->data = substr($this->data, 0, $this->params['size']);
}
if ($options & STREAM_USE_PATH) {
$openedPath = $path;
}
return true;
}
/**
* Implements support for fclose().
*/
function stream_close()
{
$this->ole = null;
// $GLOBALS is not always defined in stream_close
if (isset($GLOBALS['_OLE_INSTANCES'])) {
unset($GLOBALS['_OLE_INSTANCES']);
}
}
/**
* Implements support for fread(), fgets() etc.
* @param int maximum number of bytes to read
* @return string
*/
function stream_read($count)
{
if ($this->stream_eof()) {
return false;
}
$s = substr($this->data, $this->pos, $count);
$this->pos += $count;
return $s;
}
/**
* Implements support for feof().
* @return bool TRUE if the file pointer is at EOF; otherwise FALSE
*/
function stream_eof()
{
$eof = $this->pos >= strlen($this->data);
// Workaround for bug in PHP 5.0.x: http://bugs.php.net/27508
if (version_compare(PHP_VERSION, '5.0', '>=') &&
version_compare(PHP_VERSION, '5.1', '<')) {
$eof = !$eof;
}
return $eof;
}
/**
* Returns the position of the file pointer, i.e. its offset into the file
* stream. Implements support for ftell().
* @return int
*/
function stream_tell()
{
return $this->pos;
}
/**
* Implements support for fseek().
* @param int byte offset
* @param int SEEK_SET, SEEK_CUR or SEEK_END
* @return bool
*/
function stream_seek($offset, $whence)
{
if ($whence == SEEK_SET && $offset >= 0) {
$this->pos = $offset;
} elseif ($whence == SEEK_CUR && -$offset <= $this->pos) {
$this->pos += $offset;
} elseif ($whence == SEEK_END && -$offset <= strlen($this->data)) {
$this->pos = strlen($this->data) + $offset;
} else {
return false;
}
return true;
}
/**
* Implements support for fstat(). Currently the only supported field is
* "size".
* @return array
*/
function stream_stat()
{
return array(
'size' => strlen($this->data),
);
}
/**
* PHP 5.6 for some reason wants this to be implemented. Currently returning false as if it wasn't implemented.
* @return boolean
*/
function stream_flush()
{
// If not implemented, FALSE is assumed as the return value.
return false;
}
// Methods used by stream_wrapper_register() that are not implemented:
// int stream_write ( string data )
// bool rename ( string path_from, string path_to )
// bool mkdir ( string path, int mode, int options )
// bool rmdir ( string path, int options )
// bool dir_opendir ( string path, int options )
// array url_stat ( string path, int flags )
// string dir_readdir ( void )
// bool dir_rewinddir ( void )
// bool dir_closedir ( void )
}

244
videodb/vendor/pear/ole/OLE/PPS.php vendored Normal file
View File

@@ -0,0 +1,244 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Xavier Noguer <xnoguer@php.net> |
// | Based on OLE::Storage_Lite by Kawai, Takanori |
// +----------------------------------------------------------------------+
//
// $Id$
if (!class_exists('PEAR')) {
require_once 'PEAR.php';
}
if (!class_exists('OLE')) {
require_once 'OLE.php';
}
/**
* Class for creating PPS's for OLE containers
*
* @author Xavier Noguer <xnoguer@php.net>
* @category Structures
* @package OLE
*/
class OLE_PPS extends PEAR
{
/**
* The PPS index
* @var integer
*/
var $No;
/**
* The PPS name (in Unicode)
* @var string
*/
var $Name;
/**
* The PPS type. Dir, Root or File
* @var integer
*/
var $Type;
/**
* The index of the previous PPS
* @var integer
*/
var $PrevPps;
/**
* The index of the next PPS
* @var integer
*/
var $NextPps;
/**
* The index of it's first child if this is a Dir or Root PPS
* @var integer
*/
var $DirPps;
/**
* A timestamp
* @var integer
*/
var $Time1st;
/**
* A timestamp
* @var integer
*/
var $Time2nd;
/**
* Starting block (small or big) for this PPS's data inside the container
* @var integer
*/
var $_StartBlock;
/**
* The size of the PPS's data (in bytes)
* @var integer
*/
var $Size;
/**
* The PPS's data (only used if it's not using a temporary file)
* @var string
*/
var $_data;
/**
* Array of child PPS's (only used by Root and Dir PPS's)
* @var array
*/
var $children = array();
/**
* Pointer to OLE container
* @var OLE
*/
var $ole;
/**
* The constructor
*
* @access public
* @param integer $No The PPS index
* @param string $name The PPS name
* @param integer $type The PPS type. Dir, Root or File
* @param integer $prev The index of the previous PPS
* @param integer $next The index of the next PPS
* @param integer $dir The index of it's first child if this is a Dir or Root PPS
* @param integer $time_1st A timestamp
* @param integer $time_2nd A timestamp
* @param string $data The (usually binary) source data of the PPS
* @param array $children Array containing children PPS for this PPS
*/
function __construct($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
{
$this->No = $No;
$this->Name = $name;
$this->Type = $type;
$this->PrevPps = $prev;
$this->NextPps = $next;
$this->DirPps = $dir;
$this->Time1st = $time_1st;
$this->Time2nd = $time_2nd;
$this->_data = $data;
$this->children = $children;
if ($data != '') {
$this->Size = strlen($data);
} else {
$this->Size = 0;
}
}
/**
* Returns the amount of data saved for this PPS
*
* @access private
* @return integer The amount of data (in bytes)
*/
function _DataLen()
{
if (!isset($this->_data)) {
return 0;
}
if (isset($this->_PPS_FILE)) {
fseek($this->_PPS_FILE, 0);
$stats = fstat($this->_PPS_FILE);
return $stats[7];
} else {
return strlen($this->_data);
}
}
/**
* Returns a string with the PPS's WK (What is a WK?)
*
* @access private
* @return string The binary string
*/
function _getPpsWk()
{
$ret = $this->Name;
for ($i = 0; $i < (64 - strlen($this->Name)); $i++) {
$ret .= "\x00";
}
$ret .= pack("v", strlen($this->Name) + 2) // 66
. pack("c", $this->Type) // 67
. pack("c", 0x00) //UK // 68
. pack("V", $this->PrevPps) //Prev // 72
. pack("V", $this->NextPps) //Next // 76
. pack("V", $this->DirPps) //Dir // 80
. "\x00\x09\x02\x00" // 84
. "\x00\x00\x00\x00" // 88
. "\xc0\x00\x00\x00" // 92
. "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root
. "\x00\x00\x00\x00" // 100
. OLE::LocalDate2OLE($this->Time1st) // 108
. OLE::LocalDate2OLE($this->Time2nd) // 116
. pack("V", isset($this->_StartBlock)?
$this->_StartBlock:0) // 120
. pack("V", $this->Size) // 124
. pack("V", 0); // 128
return $ret;
}
/**
* Updates index and pointers to previous, next and children PPS's for this
* PPS. I don't think it'll work with Dir PPS's.
*
* @access private
* @param array &$pps_array Reference to the array of PPS's for the whole OLE
* container
* @return integer The index for this PPS
*/
static function _savePpsSetPnt(&$raList, $to_save, $depth = 0)
{
if ( !is_array($to_save) || (count($to_save) == 0) ) {
return OLE_FREESECT;
}
elseif( count($to_save) == 1 ) {
$cnt = count($raList);
// If the first entry, it's the root... Don't clone it!
$raList[$cnt] = ( $depth == 0 ) ? $to_save[0] : clone $to_save[0];
$raList[$cnt]->No = $cnt;
$raList[$cnt]->PrevPps = OLE_FREESECT;
$raList[$cnt]->NextPps = OLE_FREESECT;
$raList[$cnt]->DirPps = self::_savePpsSetPnt($raList, @$raList[$cnt]->children, $depth++);
return $cnt;
}
else {
$iPos = floor(count($to_save) / 2);
$aPrev = array_slice($to_save, 0, $iPos);
$aNext = array_slice($to_save, $iPos + 1);
$cnt = count($raList);
// If the first entry, it's the root... Don't clone it!
$raList[$cnt] = ( $depth == 0 ) ? $to_save[$iPos] : clone $to_save[$iPos];
$raList[$cnt]->No = $cnt;
$raList[$cnt]->PrevPps = self::_savePpsSetPnt($raList, $aPrev, $depth++);
$raList[$cnt]->NextPps = self::_savePpsSetPnt($raList, $aNext, $depth++);
$raList[$cnt]->DirPps = self::_savePpsSetPnt($raList, @$raList[$cnt]->children, $depth++);
return $cnt;
}
}
}

130
videodb/vendor/pear/ole/OLE/PPS/File.php vendored Normal file
View File

@@ -0,0 +1,130 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Xavier Noguer <xnoguer@php.net> |
// | Based on OLE::Storage_Lite by Kawai, Takanori |
// +----------------------------------------------------------------------+
//
// $Id$
if (!class_exists('OLE_PPS')) {
require_once 'OLE/PPS.php';
}
if (!class_exists('System')) {
require_once 'System.php';
}
/**
* Class for creating File PPS's for OLE containers
*
* @author Xavier Noguer <xnoguer@php.net>
* @category Structures
* @package OLE
*/
class OLE_PPS_File extends OLE_PPS
{
/**
* The temporary dir for storing the OLE file
* @var string
*/
var $_tmp_dir;
/**
* The constructor
*
* @access public
* @param string $name The name of the file (in Unicode)
* @see OLE::Asc2Ucs()
*/
function __construct($name)
{
$system = new System();
$this->_tmp_dir = $system->tmpdir();
parent::__construct(
null,
$name,
OLE_PPS_TYPE_FILE,
null,
null,
null,
null,
null,
'',
array());
}
/**
* Sets the temp dir used for storing the OLE file
*
* @access public
* @param string $dir The dir to be used as temp dir
* @return boolean true if given dir is valid, false otherwise
*/
function setTempDir($dir)
{
if (is_dir($dir)) {
$this->_tmp_dir = $dir;
return true;
}
return false;
}
/**
* Initialization method. Has to be called right after OLE_PPS_File().
*
* @access public
* @return mixed true on success. PEAR_Error on failure
*/
function init()
{
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_File");
$fh = @fopen($this->_tmp_filename, "w+b");
if ($fh == false) {
return $this->raiseError("Can't create temporary file");
}
$this->_PPS_FILE = $fh;
if ($this->_PPS_FILE) {
fseek($this->_PPS_FILE, 0);
}
return true;
}
/**
* Append data to PPS
*
* @access public
* @param string $data The data to append
*/
function append($data)
{
if ($this->_PPS_FILE) {
fwrite($this->_PPS_FILE, $data);
} else {
$this->_data .= $data;
}
}
/**
* Returns a stream for reading this file using fread() etc.
* @return resource a read-only stream
*/
function getStream()
{
$this->ole->getStream($this);
}
}

724
videodb/vendor/pear/ole/OLE/PPS/Root.php vendored Normal file
View File

@@ -0,0 +1,724 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Xavier Noguer <xnoguer@php.net> |
// | Based on OLE::Storage_Lite by Kawai, Takanori |
// +----------------------------------------------------------------------+
//
// $Id$
if (!class_exists('OLE_PPS')) {
require_once 'OLE/PPS.php';
}
if (!class_exists('System')) {
require_once 'System.php';
}
/**
* Class for creating Root PPS's for OLE containers
*
* @author Xavier Noguer <xnoguer@php.net>
* @category Structures
* @package OLE
*/
class OLE_PPS_Root extends OLE_PPS
{
/**
* Flag to enable new logic
* @var bool
*/
var $new_func = true;
/**
* The temporary dir for storing the OLE file
* @var string
*/
var $_tmp_dir;
/**
* Constructor
*
* @access public
* @param integer $time_1st A timestamp
* @param integer $time_2nd A timestamp
*/
function __construct($time_1st, $time_2nd, $raChild)
{
$system = new System();
$this->_tmp_dir = $system->tmpdir();
parent::__construct(
null,
OLE::Asc2Ucs('Root Entry'),
OLE_PPS_TYPE_ROOT,
null,
null,
null,
$time_1st,
$time_2nd,
null,
$raChild);
}
/**
* Sets the temp dir used for storing the OLE file
*
* @access public
* @param string $dir The dir to be used as temp dir
* @return true if given dir is valid, false otherwise
*/
function setTempDir($dir)
{
if (is_dir($dir)) {
$this->_tmp_dir = $dir;
return true;
}
return false;
}
/**
* Method for saving the whole OLE container (including files).
* In fact, if called with an empty argument (or '-'), it saves to a
* temporary file and then outputs it's contents to stdout.
*
* @param string $filename The name of the file where to save the OLE container
* @access public
* @return mixed true on success, PEAR_Error on failure
*/
function save($filename)
{
// Initial Setting for saving
$this->_BIG_BLOCK_SIZE = pow(2,
((isset($this->_BIG_BLOCK_SIZE))? $this->_adjust2($this->_BIG_BLOCK_SIZE) : 9));
$this->_SMALL_BLOCK_SIZE= pow(2,
((isset($this->_SMALL_BLOCK_SIZE))? $this->_adjust2($this->_SMALL_BLOCK_SIZE): 6));
// Open temp file if we are sending output to stdout
if (($filename == '-') || ($filename == '')) {
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
$this->_FILEH_ = @fopen($this->_tmp_filename,"w+b");
if ($this->_FILEH_ == false) {
return $this->raiseError("Can't create temporary file.");
}
} else {
$this->_FILEH_ = @fopen($filename, "wb");
if ($this->_FILEH_ == false) {
return $this->raiseError("Can't open $filename. It may be in use or protected.");
}
}
// Make an array of PPS's (for Save)
$aList = array();
OLE_PPS_Root::_savePpsSetPnt($aList, array($this));
// calculate values for header
list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo);
// Save Header
$this->_saveHeader($iSBDcnt, $iBBcnt, $iPPScnt);
// Make Small Data string (write SBD)
$this->_data = $this->_makeSmallData($aList);
// Write BB
$this->_saveBigData($iSBDcnt, $aList);
// Write PPS
$this->_savePps($aList);
// Write Big Block Depot and BDList and Adding Header informations
$this->_saveBbd($iSBDcnt, $iBBcnt, $iPPScnt);
// Close File, send it to stdout if necessary
if (($filename == '-') || ($filename == '')) {
fseek($this->_FILEH_, 0);
fpassthru($this->_FILEH_);
@fclose($this->_FILEH_);
// Delete the temporary file.
@unlink($this->_tmp_filename);
} else {
@fclose($this->_FILEH_);
}
return true;
}
/**
* Calculate some numbers
*
* @access private
* @param array $raList Reference to an array of PPS's
* @return array The array of numbers
*/
function _calcSize(&$raList)
{
// Calculate Basic Setting
$iBBcnt = 0;
$iSBcnt = 0;
for ($i = 0; $i < count($raList); $i++) {
if ($raList[$i]->Type == OLE_PPS_TYPE_FILE) {
$raList[$i]->Size = $raList[$i]->_DataLen();
if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) {
$iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
+ (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
} else {
$iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) +
(($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0));
}
}
}
$iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE;
$iSlCnt = floor($this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE);
$iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0);
$iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) +
(( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0));
$iCnt = count($raList);
$iBdCnt = $this->_BIG_BLOCK_SIZE / OLE_PPS_SIZE;
$iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0));
return array($iSBDcnt, $iBBcnt, $iPPScnt);
}
/**
* Helper function for caculating a magic value for block sizes
*
* @access private
* @param integer $i2 The argument
* @see save()
* @return integer
*/
function _adjust2($i2)
{
$iWk = log($i2)/log(2);
return ($iWk > floor($iWk))? floor($iWk)+1:$iWk;
}
/**
* Save OLE header
*
* @access private
* @param integer $iSBDcnt
* @param integer $iBBcnt
* @param integer $iPPScnt
*/
function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt)
{
$FILE = $this->_FILEH_;
if($this->new_func)
return $this->_create_header($iSBDcnt, $iBBcnt, $iPPScnt);
// Calculate Basic Setting
$iBlCnt = $this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE;
$i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / OLE_LONG_INT_SIZE;
$iBdExL = 0;
$iAll = $iBBcnt + $iPPScnt + $iSBDcnt;
$iAllW = $iAll;
$iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
$iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
// Calculate BD count
if ($iBdCnt > $i1stBdL) {
while (1) {
$iBdExL++;
$iAllW++;
$iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
$iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) {
break;
}
}
}
// Save Header
fwrite($FILE,
OLE_CFB_SIGNATURE // Header Signature (8 bytes)
. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // Header CLSID (16 bytes)
. pack("v", OLE_VERSION_MINOR) // Minor Version (2 bytes)
. pack("v", OLE_VERSION_MAJOR_3) // Major Version (2 bytes)
. pack("v", OLE_LITTLE_ENDIAN) // Byte Order (2 bytes)
. pack("v", OLE_SECTOR_SHIFT_3) // Sector Shift (2 bytes)
. pack("v", OLE_MINI_SECTOR_SHIFT) // Mini Sector Shift (2 bytes)
. "\x00\x00\x00\x00\x00\x00" // Reserved (6 bytes)
. "\x00\x00\x00\x00" // Number of Directory Sectors (4 bytes)
. pack("V", $iBdCnt) // Number of FAT Sectors (4 bytes)
. pack("V", $iBBcnt+$iSBDcnt) //ROOT START, First Directory Sector Location (4 bytes)
. pack("V", 0) // Transaction Signature Number (4 bytes)
. pack("V", 0x00001000) // Mini Stream Cutoff Size (4 bytes)
. pack("V", $iSBDcnt ? 0 : OLE_ENDOFCHAIN) // First Mini FAT Sector Location (4 bytes)
. pack("V", $iSBDcnt) // Number of Mini FAT Sectors (4 bytes)
);
// Extra BDList Start, Count
if ($iBdCnt < $i1stBdL) {
fwrite($FILE,
pack("V", OLE_ENDOFCHAIN). // Extra BDList Start
pack("V", 0) // Extra BDList Count
);
} else {
fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL));
}
// BDList
for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; $i++) {
fwrite($FILE, pack("V", $iAll+$i));
}
if ($i < $i1stBdL) { // free sectors
for ($j = 0; $j < ($i1stBdL-$i); $j++) {
fwrite($FILE, (pack("V", OLE_FREESECT)));
}
}
}
/**
* Saving big data (PPS's with data bigger than OLE_DATA_SIZE_SMALL)
*
* @access private
* @param integer $iStBlk
* @param array &$raList Reference to array of PPS's
*/
function _saveBigData($iStBlk, &$raList)
{
$FILE = $this->_FILEH_;
// cycle through PPS's
for ($i = 0; $i < count($raList); $i++) {
if ($raList[$i]->Type != OLE_PPS_TYPE_DIR) {
$raList[$i]->Size = $raList[$i]->_DataLen();
if (($raList[$i]->Size >= OLE_DATA_SIZE_SMALL) ||
(($raList[$i]->Type == OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data)))
{
// Write Data
if (isset($raList[$i]->_PPS_FILE)) {
$iLen = 0;
fseek($raList[$i]->_PPS_FILE, 0); // To The Top
while($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
$iLen += strlen($sBuff);
fwrite($FILE, $sBuff);
}
} else {
fwrite($FILE, $raList[$i]->_data);
}
if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) {
for ($j = 0; $j < ($this->_BIG_BLOCK_SIZE - ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)); $j++) {
fwrite($FILE, "\x00");
}
}
// Set For PPS
$raList[$i]->_StartBlock = $iStBlk;
$iStBlk +=
(floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) +
(($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0));
}
// Close file for each PPS, and unlink it
if (isset($raList[$i]->_PPS_FILE)) {
@fclose($raList[$i]->_PPS_FILE);
$raList[$i]->_PPS_FILE = null;
@unlink($raList[$i]->_tmp_filename);
}
}
}
}
/**
* get small data (PPS's with data smaller than OLE_DATA_SIZE_SMALL)
*
* @access private
* @param array &$raList Reference to array of PPS's
*/
function _makeSmallData(&$raList)
{
$sRes = '';
$FILE = $this->_FILEH_;
$iSmBlk = 0;
for ($i = 0; $i < count($raList); $i++) {
// Make SBD, small data string
if ($raList[$i]->Type == OLE_PPS_TYPE_FILE) {
if ($raList[$i]->Size <= 0) {
continue;
}
if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) {
$iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
+ (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
// Add to SBD
for ($j = 0; $j < ($iSmbCnt-1); $j++) {
fwrite($FILE, pack("V", $j+$iSmBlk+1));
}
fwrite($FILE, pack("V", OLE_ENDOFCHAIN));
// Add to Data String(this will be written for RootEntry)
if ($raList[$i]->_PPS_FILE) {
fseek($raList[$i]->_PPS_FILE, 0); // To The Top
while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
$sRes .= $sBuff;
}
} else {
$sRes .= $raList[$i]->_data;
}
if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) {
for ($j = 0; $j < ($this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)); $j++) {
$sRes .= "\x00";
}
}
// Set for PPS
$raList[$i]->_StartBlock = $iSmBlk;
$iSmBlk += $iSmbCnt;
}
}
}
$iSbCnt = floor($this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE);
if ($iSmBlk % $iSbCnt) {
for ($i = 0; $i < ($iSbCnt - ($iSmBlk % $iSbCnt)); $i++) {
fwrite($FILE, pack("V", OLE_FREESECT));
}
}
return $sRes;
}
/**
* Saves all the PPS's WKs
*
* @access private
* @param array $raList Reference to an array with all PPS's
*/
function _savePps(&$raList)
{
// Save each PPS WK
for ($i = 0; $i < count($raList); $i++) {
fwrite($this->_FILEH_, $raList[$i]->_getPpsWk());
}
// Adjust for Block
$iCnt = count($raList);
$iBCnt = $this->_BIG_BLOCK_SIZE / OLE_PPS_SIZE;
if ($iCnt % $iBCnt) {
for ($i = 0; $i < (($iBCnt - ($iCnt % $iBCnt)) * OLE_PPS_SIZE); $i++) {
fwrite($this->_FILEH_, "\x00");
}
}
}
/**
* Saving Big Block Depot
*
* @access private
* @param integer $iSbdSize
* @param integer $iBsize
* @param integer $iPpsCnt
*/
function _saveBbd($iSbdSize, $iBsize, $iPpsCnt)
{
if($this->new_func)
return $this->_create_big_block_chain($iSbdSize, $iBsize, $iPpsCnt);
$FILE = $this->_FILEH_;
// Calculate Basic Setting
$iBbCnt = $this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE;
$i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / OLE_LONG_INT_SIZE;
$iBdExL = 0;
$iAll = $iBsize + $iPpsCnt + $iSbdSize;
$iAllW = $iAll;
$iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0);
$iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0);
// Calculate BD count
if ($iBdCnt >$i1stBdL) {
while (1) {
$iBdExL++;
$iAllW++;
$iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0);
$iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0);
if ($iBdCnt <= ($iBdExL*$iBbCnt+ $i1stBdL)) {
break;
}
}
}
// Making BD
// Set for SBD
if ($iSbdSize > 0) {
for ($i = 0; $i < ($iSbdSize - 1); $i++) {
fwrite($FILE, pack("V", $i+1));
}
fwrite($FILE, pack("V", OLE_ENDOFCHAIN));
}
// Set for B
for ($i = 0; $i < ($iBsize - 1); $i++) {
fwrite($FILE, pack("V", $i+$iSbdSize+1));
}
fwrite($FILE, pack("V", OLE_ENDOFCHAIN));
// Set for PPS
for ($i = 0; $i < ($iPpsCnt - 1); $i++) {
fwrite($FILE, pack("V", $i+$iSbdSize+$iBsize+1));
}
fwrite($FILE, pack("V", OLE_ENDOFCHAIN));
// Set for BBD itself ( 0xFFFFFFFD : BBD)
for ($i = 0; $i < $iBdCnt; $i++) {
fwrite($FILE, pack("V", OLE_FATSECT));
}
// Set for ExtraBDList
for ($i = 0; $i < $iBdExL; $i++) {
fwrite($FILE, pack("V", OLE_DIFSECT));
}
// Adjust for Block
if (($iAllW + $iBdCnt) % $iBbCnt) {
for ($i = 0; $i < ($iBbCnt - (($iAllW + $iBdCnt) % $iBbCnt)); $i++) {
fwrite($FILE, pack("V", OLE_FREESECT));
}
}
// Extra BDList
if ($iBdCnt > $i1stBdL) {
$iN=0;
$iNb=0;
for ($i = $i1stBdL;$i < $iBdCnt; $i++, $iN++) {
if ($iN >= ($iBbCnt - 1)) {
$iN = 0;
$iNb++;
fwrite($FILE, pack("V", $iAll+$iBdCnt+$iNb));
}
fwrite($FILE, pack("V", $iBsize+$iSbdSize+$iPpsCnt+$i));
}
if (($iBdCnt-$i1stBdL) % ($iBbCnt-1)) {
for ($i = 0; $i < (($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1))); $i++) {
fwrite($FILE, pack("V", OLE_FREESECT));
}
}
fwrite($FILE, pack("V", OLE_ENDOFCHAIN));
}
}
/**
* New method to store Bigblock chain
*
* @access private
* @param integer $num_sb_blocks - number of Smallblock depot blocks
* @param integer $num_bb_blocks - number of Bigblock depot blocks
* @param integer $num_pps_blocks - number of PropertySetStorage blocks
*/
function _create_big_block_chain($num_sb_blocks, $num_bb_blocks, $num_pps_blocks)
{
$FILE = $this->_FILEH_;
$bbd_info = $this->_calculate_big_block_chain($num_sb_blocks, $num_bb_blocks, $num_pps_blocks);
$data = "";
if($num_sb_blocks > 0)
{
for($i = 0; $i<($num_sb_blocks-1); $i++)
$data .= pack("V", $i+1);
$data .= pack("V", OLE_ENDOFCHAIN);
}
for($i = 0; $i<($num_bb_blocks-1); $i++)
$data .= pack("V", $i + $num_sb_blocks + 1);
$data .= pack("V", OLE_ENDOFCHAIN);
for($i = 0; $i<($num_pps_blocks-1); $i++)
$data .= pack("V", $i + $num_sb_blocks + $num_bb_blocks + 1);
$data .= pack("V", OLE_ENDOFCHAIN);
for($i = 0; $i < $bbd_info["0xFFFFFFFD_blockchain_entries"]; $i++)
$data .= pack("V", OLE_FATSECT);
for($i = 0; $i < $bbd_info["0xFFFFFFFC_blockchain_entries"]; $i++)
$data .= pack("V", OLE_DIFSECT);
// Adjust for Block
$all_entries = $num_sb_blocks + $num_bb_blocks + $num_pps_blocks + $bbd_info["0xFFFFFFFD_blockchain_entries"] + $bbd_info["0xFFFFFFFC_blockchain_entries"];
if($all_entries % $bbd_info["entries_per_block"])
{
$rest = $bbd_info["entries_per_block"] - ($all_entries % $bbd_info["entries_per_block"]);
for($i = 0; $i < $rest; $i++)
$data .= pack("V", OLE_FREESECT);
}
// Extra BDList
if($bbd_info["blockchain_list_entries"] > $bbd_info["header_blockchain_list_entries"])
{
$iN=0;
$iNb=0;
for($i = $bbd_info["header_blockchain_list_entries"]; $i < $bbd_info["blockchain_list_entries"]; $i++, $iN++)
{
if($iN >= ($bbd_info["entries_per_block"]-1))
{
$iN = 0;
$iNb++;
$data .= pack("V", $num_sb_blocks + $num_bb_blocks + $num_pps_blocks + $bbd_info["0xFFFFFFFD_blockchain_entries"] + $iNb);
}
$data .= pack("V", $num_bb_blocks + $num_sb_blocks + $num_pps_blocks + $i);
}
$all_entries = $bbd_info["blockchain_list_entries"] - $bbd_info["header_blockchain_list_entries"];
if(($all_entries % ($bbd_info["entries_per_block"] - 1)))
{
$rest = ($bbd_info["entries_per_block"] - 1) - ($all_entries % ($bbd_info["entries_per_block"] - 1));
for($i = 0; $i < $rest; $i++)
$data .= pack("V", OLE_FREESECT);
}
$data .= pack("V", OLE_ENDOFCHAIN);
}
/*
$this->dump($data, 0, strlen($data));
die;
*/
fwrite($FILE, $data);
}
/**
* New method to store Header
*
* @access private
* @param integer $num_sb_blocks - number of Smallblock depot blocks
* @param integer $num_bb_blocks - number of Bigblock depot blocks
* @param integer $num_pps_blocks - number of PropertySetStorage blocks
*/
function _create_header($num_sb_blocks, $num_bb_blocks, $num_pps_blocks)
{
$FILE = $this->_FILEH_;
$bbd_info = $this->_calculate_big_block_chain($num_sb_blocks, $num_bb_blocks, $num_pps_blocks);
// Save Header
fwrite($FILE,
OLE_CFB_SIGNATURE // Header Signature (8 bytes)
. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // Header CLSID (16 bytes)
. pack("v", OLE_VERSION_MINOR) // Minor Version (2 bytes)
. pack("v", OLE_VERSION_MAJOR_3) // Major Version (2 bytes)
. pack("v", OLE_LITTLE_ENDIAN) // Byte Order (2 bytes)
. pack("v", OLE_SECTOR_SHIFT_3) // Sector Shift (2 bytes)
. pack("v", OLE_MINI_SECTOR_SHIFT) // Mini Sector Shift (2 bytes)
. "\x00\x00\x00\x00\x00\x00" // Reserved (6 bytes)
. "\x00\x00\x00\x00" // Number of Directory Sectors (4 bytes)
. pack("V", $bbd_info["blockchain_list_entries"]) // Number of FAT Sectors (4 bytes)
. pack("V", $num_sb_blocks + $num_bb_blocks) //ROOT START, First Directory Sector Location (4 bytes)
. pack("V", 0) // Transaction Signature Number (4 bytes)
. pack("V", 0x00001000) // Mini Stream Cutoff Size (4 bytes)
. pack("V", $num_sb_blocks > 0 ? 0 : OLE_ENDOFCHAIN) // First Mini FAT Sector Location (4 bytes)
. pack("V", $num_sb_blocks) // Number of Mini FAT Sectors (4 bytes)
);
// Extra BDList Start, Count
if($bbd_info["blockchain_list_entries"] < $bbd_info["header_blockchain_list_entries"])
{
fwrite($FILE,
pack("V", OLE_ENDOFCHAIN). // Extra BDList Start
pack("V", 0) // Extra BDList Count
);
}
else
{
fwrite($FILE, pack("V", $num_sb_blocks + $num_bb_blocks + $num_pps_blocks + $bbd_info["0xFFFFFFFD_blockchain_entries"]) . pack("V", $bbd_info["0xFFFFFFFC_blockchain_entries"]));
}
// BDList
for ($i=0; $i < $bbd_info["header_blockchain_list_entries"] and $i < $bbd_info["blockchain_list_entries"]; $i++)
{
fwrite($FILE, pack("V", $num_bb_blocks + $num_sb_blocks + $num_pps_blocks + $i));
}
if($i < $bbd_info["header_blockchain_list_entries"])
{
for($j = 0; $j < ($bbd_info["header_blockchain_list_entries"]-$i); $j++)
{
fwrite($FILE, (pack("V", OLE_FREESECT)));
}
}
}
/**
* New method to calculate Bigblock chain
*
* @access private
* @param integer $num_sb_blocks - number of Smallblock depot blocks
* @param integer $num_bb_blocks - number of Bigblock depot blocks
* @param integer $num_pps_blocks - number of PropertySetStorage blocks
*/
function _calculate_big_block_chain($num_sb_blocks, $num_bb_blocks, $num_pps_blocks)
{
$bbd_info["entries_per_block"] = $this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE;
$bbd_info["header_blockchain_list_entries"] = ($this->_BIG_BLOCK_SIZE - 0x4C) / OLE_LONG_INT_SIZE;
$bbd_info["blockchain_entries"] = $num_sb_blocks + $num_bb_blocks + $num_pps_blocks;
$bbd_info["0xFFFFFFFD_blockchain_entries"] = $this->get_number_of_pointer_blocks($bbd_info["blockchain_entries"]);
$bbd_info["blockchain_list_entries"] = $this->get_number_of_pointer_blocks($bbd_info["blockchain_entries"] + $bbd_info["0xFFFFFFFD_blockchain_entries"]);
// do some magic
$bbd_info["ext_blockchain_list_entries"] = 0;
$bbd_info["0xFFFFFFFC_blockchain_entries"] = 0;
if($bbd_info["blockchain_list_entries"] > $bbd_info["header_blockchain_list_entries"])
{
do
{
$bbd_info["blockchain_list_entries"] = $this->get_number_of_pointer_blocks($bbd_info["blockchain_entries"] + $bbd_info["0xFFFFFFFD_blockchain_entries"] + $bbd_info["0xFFFFFFFC_blockchain_entries"]);
$bbd_info["ext_blockchain_list_entries"] = $bbd_info["blockchain_list_entries"] - $bbd_info["header_blockchain_list_entries"];
$bbd_info["0xFFFFFFFC_blockchain_entries"] = $this->get_number_of_pointer_blocks($bbd_info["ext_blockchain_list_entries"]);
$bbd_info["0xFFFFFFFD_blockchain_entries"] = $this->get_number_of_pointer_blocks($num_sb_blocks + $num_bb_blocks + $num_pps_blocks + $bbd_info["0xFFFFFFFD_blockchain_entries"] + $bbd_info["0xFFFFFFFC_blockchain_entries"]);
}
while($bbd_info["blockchain_list_entries"] < $this->get_number_of_pointer_blocks($bbd_info["blockchain_entries"] + $bbd_info["0xFFFFFFFD_blockchain_entries"] + $bbd_info["0xFFFFFFFC_blockchain_entries"]));
}
return $bbd_info;
}
/**
* Calculates number of pointer blocks
*
* @access public
* @param integer $num_pointers - number of pointers
*/
function get_number_of_pointer_blocks($num_pointers)
{
$pointers_per_block = $this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE;
return floor($num_pointers / $pointers_per_block) + (($num_pointers % $pointers_per_block)? 1: 0);
}
/**
* Support method for some hexdumping
*
* @access public
* @param string $data - Binary data
* @param integer $from - Start offset of data to dump
* @param integer $to - Target offset of data to dump
*/
function dump($data, $from, $to)
{
$chars = array();
for($i = $from; $i < $to; $i++)
{
if(sizeof($chars) == 16)
{
printf("%08X (% 12d) |", $i-16, $i-16);
foreach($chars as $char)
printf(" %02X", $char);
print " |\n";
$chars = array();
}
$chars[] = ord($data[$i]);
}
if(sizeof($chars))
{
printf("%08X (% 12d) |", $i-sizeof($chars), $i-sizeof($chars));
foreach($chars as $char)
printf(" %02X", $char);
print " |\n";
}
}
}

25
videodb/vendor/pear/ole/README.md vendored Normal file
View File

@@ -0,0 +1,25 @@
[![Build Status](https://travis-ci.org/pear/OLE.svg?branch=master)](https://travis-ci.org/pear/OLE)
[![Latest Stable Version](https://poser.pugx.org/pear/ole/v/stable)](https://packagist.org/packages/pear/ole)
This package is http://pear.php.net/package/OLE and has been migrated from https://svn.php.net/repository/pear/packages/OLE
Please report all new issues via the PEAR bug tracker.
If this package is marked as unmaintained and you have fixes, please submit your pull requests and start discussion on the pear-qa mailing list.
To test, run
$ composer install
$ vendor/bin/phpunit
To build, simply
$ pear package
To install from scratch
$ pear install package.xml
To upgrade
$ pear upgrade -f package.xml

45
videodb/vendor/pear/ole/composer.json vendored Normal file
View File

@@ -0,0 +1,45 @@
{
"name": "pear/ole",
"type": "library",
"description": "This package allows reading and writing of OLE (Object Linking and Embedding) compound documents. This format is used as container for Excel (.xls), Word (.doc) and other Microsoft file formats.",
"license": "PHP-3.01",
"authors": [
{
"name": "Christian Schmidt",
"email": "schmidt@php.net",
"role": "Lead"
},
{
"name": "Xavier Noguer",
"email": "xnoguer@php.net",
"role": "Lead"
}
],
"require": {
"php": ">=5.6",
"pear/pear_exception": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2",
"pear/pear-core-minimal": "^1.10",
"phpunit/phpunit": ">=5 <10",
"sanmai/phpunit-legacy-adapter": "^6 || ^8"
},
"autoload": {
"psr-0": {
"OLE": "./"
}
},
"autoload-dev": {
"psr-0": {
"OLE": "tests/"
}
},
"include-path": [
"./"
],
"support": {
"issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=OLE",
"source": "https://github.com/pear/OLE"
}
}

212
videodb/vendor/pear/ole/package.xml vendored Normal file
View File

@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>OLE</name>
<channel>pear.php.net</channel>
<summary>Package for reading and writing OLE containers</summary>
<description>This package allows reading and writing of OLE (Object Linking and Embedding) compound documents. This format is used as container for Excel (.xls), Word (.doc) and other Microsoft file formats.</description>
<lead>
<name>Christian Schmidt</name>
<user>schmidt</user>
<email>schmidt@php.net</email>
<active>yes</active>
</lead>
<lead>
<name>Xavier Noguer</name>
<user>xnoguer</user>
<email>xnoguer@php.net</email>
<active>no</active>
</lead>
<date>2017-06-20</date>
<version>
<release>1.0.0RC3</release>
<api>1.0.0RC3</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
Bug #19284: RC2 breaks header in excel files from Spreadsheet_Excel_Writer
Bug #21216: Call to undefined method PEAR::OLE_PPS()
</notes>
<contents>
<dir baseinstalldir="/" name="/">
<file baseinstalldir="/" name="OLE/ChainedBlockStream.php" role="php" />
<file baseinstalldir="/" name="OLE/PPS.php" role="php" />
<file baseinstalldir="/" name="OLE/PPS/File.php" role="php" />
<file baseinstalldir="/" name="OLE/PPS/Root.php" role="php" />
<file baseinstalldir="/" name="OLE.php" role="php" />
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.0.0</min>
</php>
<pearinstaller>
<min>1.4.0b1</min>
</pearinstaller>
</required>
</dependencies>
<phprelease />
<changelog>
<release>
<version>
<release>0.2.1</release>
<api>0.2.1</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2003-05-12</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
Fixing install dir
</notes>
</release>
<release>
<version>
<release>0.3</release>
<api>0.3</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2003-08-21</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
-added OLE_PPS_File::init() initialization method.
-better error handling.
</notes>
</release>
<release>
<version>
<release>0.4</release>
<api>0.4</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2003-09-25</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
-deleting tmp files (Herman Kuiper).
-fixed hardcoded tmp dir (Herman Kuiper).
-fixed pass by reference warning (Herman Kuiper).
</notes>
</release>
<release>
<version>
<release>0.5</release>
<api>0.5</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2003-12-14</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- BC break!!! OLE/OLE.php file moved to OLE.php to comply with PEAR
standards. You will have to change your require(&apos;OLE/OLE.php&apos;)&apos;s
for require(&apos;OLE.php&apos;)&apos;s
- If you are using Spreadsheet_Excel_Writer, do not upgrade to this
version yet. A new version of Spreadsheet_Excel_Writer will be
released soon so the BC break won&apos;t affect you.
- allowing setting of temp dir for OLE_PPS_File and OLE_PPS_Root objects
- fixed problem when reading files (not reading the whole OLE tree)
</notes>
</release>
<release>
<version>
<release>0.6.0</release>
<api>0.6.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2007-12-09</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
Rewrite of parser (no change to writer):
- Files inside OLE container are now saved in directory structure.
- Parser now properly uses Big Block, Small Block and Master Block Allocation Tables.
- Added stream interface for reading files inside OLE container.
- Bug #6516. Fix &quot;PPS at 1 has unknown type&quot; errors. (Christian Schmidt)
- Coding Standard cleanups (by helgi)
- Bug #3951 OLE_PPS_File::init() does not return true on success (by helgi)
- Bug #3955 OLE::_readPpsWks() does not return true on success (by helgi)
</notes>
</release>
<release>
<version>
<release>0.6.1</release>
<api>0.6.1</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2007-12-18</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- fixed bug #12693: wrong order of require_once
- added missing file to package: ChainedBlockStream.php
</notes>
</release>
<release>
<version>
<release>0.6.2</release>
<api>0.6.2</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2012-01-26</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- fixed bug #12944: Incompatibility open_basedir restriction.
</notes>
</release>
<release>
<version>
<release>1.0.0RC2</release>
<api>1.0.0RC2</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2012-01-26</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
QA release
Bug #15904 Invalid Bigblock chain with files &gt; 200MB
Bug #17685 OLE doesn&apos;t save multistreams
</notes>
</release>
<release>
<version>
<release>1.0.0RC3</release>
<api>1.0.0RC3</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2017-06-20</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>
Bug #19284: RC2 breaks header in excel files from Spreadsheet_Excel_Writer
Bug #21216: Call to undefined method PEAR::OLE_PPS()
</notes>
</release>
</changelog>
</package>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" verbose="true" colors="true"
convertNoticesToExceptions="true"
>
<testsuites>
<testsuite>
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">OLE/</directory>
<file>OLE.php</file>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-text" target="php://stdout"/>
</logging>
</phpunit>