Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 14 additions & 70 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,23 @@
name: PHP Tests
name: CI

on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main

jobs:
lint:
name: Static analysis for php ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
os: ['ubuntu-latest']

steps:
- name: Checkout code base
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpcs

- name: Setup dependencies
run: composer require -n --no-progress overtrue/phplint

- name: PHP Lint
if: ${{ ! cancelled() }}
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .

- name: PHP CodeSniffer
if: ${{ ! cancelled() }}
run: phpcs -wps --colors

test:
name: Unit tests with php ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

env:
phpunit-version: 8.5

strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
os: ['ubuntu-latest']

steps:
- name: Checkout code base
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpunit:${{ matrix.phpunit-version || env.phpunit-version }}

- name: Setup Icinga Web
run: |
git clone --depth 1 https://github.com/Icinga/icingaweb2.git _icingaweb2
ln -s `pwd` _icingaweb2/modules/icingadb

- name: Setup Libraries
run: |
mkdir _libraries
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git _libraries/ipl
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git _libraries/vendor

- name: PHPUnit
env:
ICINGAWEB_LIBDIR: _libraries
run: phpunit --verbose --bootstrap _icingaweb2/test/php/bootstrap.php
php:
name: PHP
uses: Icinga/github-actions/.github/workflows/php.yml@php-workflows
with:
php-extensions: ldap
dependencies: |
{
"./vendor/icingaweb2-modules/x509" : "https://github.com/Icinga/icingaweb2-module-x509.git",
"./vendor/icingaweb2-modules/pdfexport" : "https://github.com/Icinga/icingaweb2-module-pdfexport.git",
"./vendor/icingaweb2-modules/reporting" : "https://github.com/Icinga/icingaweb2-module-reporting.git"
}
17 changes: 0 additions & 17 deletions .github/workflows/phpstan.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .phpcs.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class ToggleObjectFeaturesForm extends CommandForm
{
const LEAVE_UNCHANGED = 'noop';
public const LEAVE_UNCHANGED = 'noop';

protected $features;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@ class ToggleInstanceFeatureCommand extends IcingaCommand
/**
* Feature for enabling or disabling active host checks on an Icinga instance
*/
const FEATURE_ACTIVE_HOST_CHECKS = 'active_host_checks_enabled';
public const FEATURE_ACTIVE_HOST_CHECKS = 'active_host_checks_enabled';

/**
* Feature for enabling or disabling active service checks on an Icinga instance
*/
const FEATURE_ACTIVE_SERVICE_CHECKS = 'active_service_checks_enabled';
public const FEATURE_ACTIVE_SERVICE_CHECKS = 'active_service_checks_enabled';

/**
* Feature for enabling or disabling host and service event handlers on an Icinga instance
*/
const FEATURE_EVENT_HANDLERS = 'event_handlers_enabled';
public const FEATURE_EVENT_HANDLERS = 'event_handlers_enabled';

/**
* Feature for enabling or disabling host and service flap detection on an Icinga instance
*/
const FEATURE_FLAP_DETECTION = 'flap_detection_enabled';
public const FEATURE_FLAP_DETECTION = 'flap_detection_enabled';

/**
* Feature for enabling or disabling host and service notifications on an Icinga instance
*/
const FEATURE_NOTIFICATIONS = 'notifications_enabled';
public const FEATURE_NOTIFICATIONS = 'notifications_enabled';

/**
* Feature for enabling or disabling the processing of host and service performance data on an Icinga instance
*/
const FEATURE_PERFORMANCE_DATA = 'process_performance_data';
public const FEATURE_PERFORMANCE_DATA = 'process_performance_data';

/**
* Feature that is to be enabled or disabled
Expand Down
12 changes: 6 additions & 6 deletions library/Icingadb/Command/Object/ProcessCheckResultCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@ class ProcessCheckResultCommand extends ObjectsCommand
/**
* Host up
*/
const HOST_UP = 0;
public const HOST_UP = 0;

/**
* Host down
*/
const HOST_DOWN = 1;
public const HOST_DOWN = 1;

/**
* Service ok
*/
const SERVICE_OK = 0;
public const SERVICE_OK = 0;

/**
* Service warning
*/
const SERVICE_WARNING = 1;
public const SERVICE_WARNING = 1;

/**
* Service critical
*/
const SERVICE_CRITICAL = 2;
public const SERVICE_CRITICAL = 2;

/**
* Service unknown
*/
const SERVICE_UNKNOWN = 3;
public const SERVICE_UNKNOWN = 3;

/**
* Status code of the host or service check result
Expand Down
10 changes: 5 additions & 5 deletions library/Icingadb/Command/Object/ToggleObjectFeatureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ class ToggleObjectFeatureCommand extends ObjectsCommand
/**
* Feature for enabling or disabling active checks of a host or service
*/
const FEATURE_ACTIVE_CHECKS = 'active_checks_enabled';
public const FEATURE_ACTIVE_CHECKS = 'active_checks_enabled';

/**
* Feature for enabling or disabling passive checks of a host or service
*/
const FEATURE_PASSIVE_CHECKS = 'passive_checks_enabled';
public const FEATURE_PASSIVE_CHECKS = 'passive_checks_enabled';

/**
* Feature for enabling or disabling notifications for a host or service
*
* Notifications will be sent out only if notifications are enabled on a program-wide basis as well.
*/
const FEATURE_NOTIFICATIONS = 'notifications_enabled';
public const FEATURE_NOTIFICATIONS = 'notifications_enabled';

/**
* Feature for enabling or disabling event handler for a host or service
*/
const FEATURE_EVENT_HANDLER = 'event_handler_enabled';
public const FEATURE_EVENT_HANDLER = 'event_handler_enabled';

/**
* Feature for enabling or disabling flap detection for a host or service.
*
* In order to enable flap detection flap detection must be enabled on a program-wide basis as well.
*/
const FEATURE_FLAP_DETECTION = 'flapping_enabled';
public const FEATURE_FLAP_DETECTION = 'flapping_enabled';

/**
* Feature that is to be enabled or disabled
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Command/Transport/ApiCommandTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ApiCommandTransport implements CommandTransportInterface
/**
* Transport identifier
*/
const TRANSPORT = 'api';
public const TRANSPORT = 'api';

/**
* API host
Expand Down
6 changes: 3 additions & 3 deletions library/Icingadb/Common/HostStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/
class HostStates
{
const UP = 0;
public const UP = 0;

const DOWN = 1;
public const DOWN = 1;

const PENDING = 99;
public const PENDING = 99;

/**
* Get the integer value of the given textual host state
Expand Down
24 changes: 12 additions & 12 deletions library/Icingadb/Common/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@

class Icons
{
const COMMENT = 'comment';
public const COMMENT = 'comment';

const HOST_DOWN = 'sitemap';
public const HOST_DOWN = 'sitemap';

const UNREACHABLE = 'sitemap';
public const UNREACHABLE = 'sitemap';

const IN_DOWNTIME = 'plug';
public const IN_DOWNTIME = 'plug';

const IS_ACKNOWLEDGED = 'check';
public const IS_ACKNOWLEDGED = 'check';

const IS_FLAPPING = 'bolt';
public const IS_FLAPPING = 'bolt';

const IS_PERSISTENT = 'thumbtack';
public const IS_PERSISTENT = 'thumbtack';

const NOTIFICATION = 'bell';
public const NOTIFICATION = 'bell';

const REMOVE = 'trash';
public const REMOVE = 'trash';

const USER = 'user';
public const USER = 'user';

const USERGROUP = 'users';
public const USERGROUP = 'users';

const WARNING = 'exclamation-triangle';
public const WARNING = 'exclamation-triangle';
}
10 changes: 5 additions & 5 deletions library/Icingadb/Common/ServiceStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
class ServiceStates
{
const OK = 0;
public const OK = 0;

const WARNING = 1;
public const WARNING = 1;

const CRITICAL = 2;
public const CRITICAL = 2;

const UNKNOWN = 3;
public const UNKNOWN = 3;

const PENDING = 99;
public const PENDING = 99;

/**
* Get the integer value of the given textual service state
Expand Down
12 changes: 6 additions & 6 deletions library/Icingadb/Compat/UrlMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

class UrlMigrator
{
const NO_YES = ['n', 'y'];
const USE_EXPR = 'use-expr';
const SORT_ONLY = 'sort-only';
const LOWER_EXPR = 'lower-expr';
const DROP = 'drop';
public const NO_YES = ['n', 'y'];
public const USE_EXPR = 'use-expr';
public const SORT_ONLY = 'sort-only';
public const LOWER_EXPR = 'lower-expr';
public const DROP = 'drop';

const SUPPORTED_PATHS = [
public const SUPPORTED_PATHS = [
'monitoring/list/hosts' => ['hosts', 'icingadb/hosts'],
'monitoring/hosts/show' => ['multipleHosts', 'icingadb/hosts/details'],
'monitoring/host/show' => ['host', 'icingadb/host'],
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Data/PivotTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class PivotTable
{
const SORT_ASC = 'asc';
public const SORT_ASC = 'asc';

/**
* The query to fetch as pivot table
Expand Down
Loading
Loading