Skip to content

Commit

Permalink
Merge pull request #17 from sanmai/pr/fix-5.6-build
Browse files Browse the repository at this point in the history
Fix build on PHP 5.6
  • Loading branch information
sanmai authored Nov 19, 2018
2 parents dd51ded + bd572cb commit 6dc7508
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 15 additions & 2 deletions OLE/ChainedBlockStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ function stream_open($path, $mode, $options, &$openedPath)
function stream_close()
{
$this->ole = null;
unset($GLOBALS['_OLE_INSTANCES']);

// $GLOBALS is not always defined in stream_close
if (isset($GLOBALS['_OLE_INSTANCES'])) {
unset($GLOBALS['_OLE_INSTANCES']);
}
}

/**
Expand Down Expand Up @@ -220,8 +224,17 @@ function stream_stat()
);
}

/**
* 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:
// bool stream_flush ( void )
// int stream_write ( string data )
// bool rename ( string path_from, string path_to )
// bool mkdir ( string path, int mode, int options )
Expand Down
4 changes: 3 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php" verbose="true" colors="true">
<phpunit bootstrap="vendor/autoload.php" verbose="true" colors="true"
convertNoticesToExceptions="true"
>
<testsuites>
<testsuite>
<directory>tests/</directory>
Expand Down

0 comments on commit 6dc7508

Please sign in to comment.