Checks: Difference between revisions

From Sunhill Framework Documentation
The check command: +Artisan commands
-incomplete
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Incomplete}}
'''Checks''' are an unified way to perform sanity checks on the installed system. Initially developed to check if the database tables are consistent you can check all kinds of sanity.
Checks are an unified way to perform sanity checks on the installed system. Initially developed to check if the database tables are consistent you can check all kinds of sanity.


== The check command ==
== The check command ==
Line 11: Line 10:
This tells the check not just to report an inconsistency but also to try to repair it.
This tells the check not just to report an inconsistency but also to try to repair it.


<!--
<code>./artisan check --group=[groupname]</code>
<code>./artisan check --group=[groupname]</code>
This tells the check command only to run checks with the given group id
This tells the check command only to run checks with the given group id
-->


Also see [[Artisan commands]].
Also see [[Artisan commands]].
== The Checks facade ==
=== purge() ===
=== installChecker(string $class_name) ===
=== check(bool $repair = false, string $group = '', $callback = null): array ===
=== getTotalTests(): int ===
=== getTestsPerformed() : int ===
=== getTestsFailed() : int ===
=== getTestsRepaired() : int ===
=== getTestsUnrepairable() : int ===
=== getTestsMessages() : int ===


== Writing own checks ==
== Writing own checks ==
To write your own check just create a class with <code>Sunhill\Basic\Checker\Checker</code> as ancestor.
For more information about writing your own checks see [[Writing your own checks|here]].  


<?php
[[Category:Checks]]
use Sunhill\Basic\Checker\Checker;
class MyCheck extends Checker
{
...
}

Latest revision as of 07:40, 7 October 2024

Checks are an unified way to perform sanity checks on the installed system. Initially developed to check if the database tables are consistent you can check all kinds of sanity.

The check command

The framework defines a artisan command called check. It is called via

./artisan check

Note that you have to replace artisan with the name of your artisan application.

The check command has one parameter:

./artisan check --repair 

This tells the check not just to report an inconsistency but also to try to repair it.

./artisan check --group=[groupname] This tells the check command only to run checks with the given group id

Also see Artisan commands.

The Checks facade

purge()

installChecker(string $class_name)

check(bool $repair = false, string $group = , $callback = null): array

getTotalTests(): int

getTestsPerformed() : int

getTestsFailed() : int

getTestsRepaired() : int

getTestsUnrepairable() : int

getTestsMessages() : int

Writing own checks

For more information about writing your own checks see here.