Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code, add phpunit.xml and codesniffer
- Loading branch information
1 parent
9ccc460
commit 61db48e
Showing
32 changed files
with
587 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ before_script: | |
- composer install -n | ||
|
||
script: | ||
- composer test | ||
- vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<?php | ||
if (!file_exists(__DIR__ . "/servers.ini")) { | ||
die("Please set config/servers.ini first"); | ||
} | ||
if (!file_exists(__DIR__ . "/servers.ini")) { | ||
die("Please set config/servers.ini first"); | ||
} | ||
|
||
return [ | ||
/* Monit-Graph display information */ | ||
'default_time_range' => 3600, // Amount in seconds of the default view should be (0 equals all available data) | ||
'default_chart_type' => "LineChart", // Default chart type | ||
'default_refresh_seconds' => 120, // Default amount of seconds before data is reloaded (0 equals never) | ||
'default_specific_service' => "", // Default service to be displayed (none is equal to all services) | ||
'default_dont_show_alerts' => "on", | ||
'limit_records_shown' => 750, | ||
return [ | ||
/* Monit-Graph display information */ | ||
'default_time_range' => 3600, // Amount in seconds of the default view should be (0 equals all available data) | ||
'default_chart_type' => "LineChart", // Default chart type | ||
'default_refresh_seconds' => 120, // Default amount of seconds before data is reloaded (0 equals never) | ||
'default_specific_service' => "", // Default service to be displayed (none is equal to all services) | ||
'default_dont_show_alerts' => "on", | ||
'limit_records_shown' => 750, | ||
|
||
/* Monit-Graph history handling */ | ||
'chunk_size' => 1024*1024, // Maximum size in bytes for each service history chunk (0 equals unlimited, remember to set php.ini so the scripts can handle it as well) | ||
'limit_number_of_chunks' => 14, // Maximum number of chunks saved per service records, will delete all above this (0 equals unlimited) | ||
/* Monit-Graph history handling */ | ||
'chunk_size' => 1024*1024, // Maximum size in bytes for each service history chunk (0 equals unlimited, remember to set php.ini so the scripts can handle it as well) | ||
'limit_number_of_chunks' => 14, // Maximum number of chunks saved per service records, will delete all above this (0 equals unlimited) | ||
|
||
'server_configs' => parse_ini_file(__DIR__ . "/servers.ini", true), | ||
'server_configs' => parse_ini_file(__DIR__ . "/servers.ini", true), | ||
|
||
'slimconfig' => [ | ||
'displayErrorDetails' => true, // set to false in production | ||
'addContentLengthHeader' => false, // Allow the web server to send the content-length header | ||
], | ||
'slimconfig' => [ | ||
'displayErrorDetails' => true, // set to false in production | ||
'addContentLengthHeader' => false, // Allow the web server to send the content-length header | ||
], | ||
|
||
// Basic authentication can be enabled. By default, ADMIN_PASSWORD environment variables | ||
// is used. You can generate your own hashed password by running `htpasswd -nbBC 10 username password` | ||
// 'basic_auth_users' => ['admin' => getenv('ADMIN_PASSWORD')] | ||
]; | ||
// Basic authentication can be enabled. By default, ADMIN_PASSWORD environment variables | ||
// is used. You can generate your own hashed password by running `htpasswd -nbBC 10 username password` | ||
// 'basic_auth_users' => ['admin' => getenv('ADMIN_PASSWORD')] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="MonitGraph coding standard"> | ||
<description>MonitGraph coding standard</description> | ||
|
||
<!-- display progress --> | ||
<arg value="p"/> | ||
<!-- use colors in output --> | ||
<arg name="colors"/> | ||
|
||
<!-- inherit rules from: --> | ||
<rule ref="PSR2"/> | ||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/> | ||
|
||
<!-- Paths to check --> | ||
<file>config</file> | ||
<file>src</file> | ||
<file>tests</file> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
<phpunit bootstrap="vendor/autoload.php"> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.7/phpunit.xsd" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutChangesToGlobalState="true" | ||
beStrictAboutOutputDuringTests="true" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="tests/bootstrap.php"> | ||
<testsuites> | ||
<testsuite name="MonitGraph"> | ||
<directory>tests</directory> | ||
<testsuite name="MonitGraph Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
Oops, something went wrong.