Added config option 'php-censor.build.writer_buffer_size' for configuring BuildErrorWriter buffer_size property (Count of inserts in the one SQL query).

This commit is contained in:
Dmitry Khomutov 2017-07-06 19:51:15 +07:00
parent a9309a1feb
commit 6fe5c78179
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
3 changed files with 8 additions and 4 deletions

View file

@ -42,7 +42,8 @@ php-censor:
commit: false # This option allow/deny to post comments to Github commit commit: false # This option allow/deny to post comments to Github commit
pull_request: false # This option allow/deny to post comments to Github Pull Request pull_request: false # This option allow/deny to post comments to Github Pull Request
build: build:
remove_builds: true # This option allow/deny build cleaning remove_builds: true # This option allow/deny build cleaning
writer_buffer_size: 500 # BuildErrorWriter buffer size (count of inserts in one SQL query)
security: security:
disable_auth: false # This option allows/deny you to disable authentication for PHP Censor disable_auth: false # This option allows/deny you to disable authentication for PHP Censor
default_user_id: 1 # Default user when authentication disabled default_user_id: 1 # Default user when authentication disabled

View file

@ -269,7 +269,8 @@ class InstallCommand extends Command
], ],
], ],
'build' => [ 'build' => [
'remove_builds' => true, 'remove_builds' => true,
'writer_buffer_size' => 500,
], ],
'security' => [ 'security' => [
'disable_auth' => false, 'disable_auth' => false,

View file

@ -2,6 +2,7 @@
namespace PHPCensor\Store; namespace PHPCensor\Store;
use b8\Config;
use b8\Database; use b8\Database;
/** /**
@ -19,7 +20,7 @@ class BuildErrorWriter
* @var int * @var int
* @see https://stackoverflow.com/questions/40361164/pdoexception-sqlstatehy000-general-error-7-number-of-parameters-must-be-bet * @see https://stackoverflow.com/questions/40361164/pdoexception-sqlstatehy000-general-error-7-number-of-parameters-must-be-bet
*/ */
protected $buffer_size = 5000; protected $buffer_size;
/** /**
* BuildErrorWriter constructor. * BuildErrorWriter constructor.
@ -28,7 +29,8 @@ class BuildErrorWriter
*/ */
public function __construct($build_id) public function __construct($build_id)
{ {
$this->build_id = $build_id; $this->buffer_size = (integer)Config::getInstance()->get('php-censor.build.writer_buffer_size', 500);
$this->build_id = $build_id;
} }
/** /**