Skip to content

Commit

Permalink
removed recompress feature from the output::flush() method because it…
Browse files Browse the repository at this point in the history
… is also removed from the underlying c++ library
  • Loading branch information
EmielBruijntjes committed Nov 6, 2016
1 parent 773296a commit e65806c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ extern "C" {
Php::ByVal("value", Php::Type::Null)
}).method<&Output::name>("name", {
}).method<&Output::flush>("flush", {
Php::ByVal("recompress", Php::Type::Bool, false)
}).method<&Output::size>("size");

// register input methods
Expand Down
17 changes: 2 additions & 15 deletions output.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,12 @@ class Output : public Php::Base

/**
* Flush the output log
*
* This will enforce that all bytes still in memory buffers are
* flushed to disk
*
* @note Recompressing may lead to a smaller filesize when previous
* flushes were done, but may be costly in terms of CPU and I/O
*
* @param params Array of parameters, the first (optional) parameter can for recompression
* @return PHP value wrapping the same object, for chaining
*/
Php::Value flush(Php::Parameters &params)
Php::Value flush()
{
// should we recompress? by default we don't do this, because
// this can be a pretty hefty operation, both in terms of CPU
// and in terms of I/O (the whole file is rewritten!)
bool recompress = !params.empty() && params[0];

// flush the file, optionally recompressing it
_impl->flush(recompress);
_impl->flush();

// allow chaining
return this;
Expand Down

0 comments on commit e65806c

Please sign in to comment.