https://github.com/firesphere/sentry-cron
PHP Cron jobs pushing to Sentry
https://github.com/firesphere/sentry-cron
Last synced: over 1 year ago
JSON representation
PHP Cron jobs pushing to Sentry
- Host: GitHub
- URL: https://github.com/firesphere/sentry-cron
- Owner: Firesphere
- Created: 2023-02-09T03:32:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T03:38:31.000Z (over 3 years ago)
- Last Synced: 2025-02-01T14:29:59.527Z (over 1 year ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Sentry-cron
Installation:
`composer require firesphere/sentry-cron`
# Usage
Create a cronjob in Sentry, and get its key.
Get your Sentry DSN key
In your PHP task that is supposed to run periodically, include the Sentry Trait:
```php
class MyPeriodicClass
{
use \Firesphere\SentryCron\SentryTrait;
public function doTheThing()
{
$this->start($dsn, $cronjob_id);
// Your code actions here
$error = false; // Or true if an error happened in your code.
$this->end($error);
}
}
```
That's pretty much all there's to it :)
# Cow?
Cow!
```
/( ,,,,, )\
_\,;;;;;;;,/_
.-"; ;;;;;;;;; ;"-.
'.__/`_ / \ _`\__.'
| (')| |(') |
| .--' '--. |
|/ o o \|
| |
/ \ _..=.._ / \
/:. '._____.' \
;::' / \ .;
| _|_ _|_ ::|
.-| '==o==' '|-.
/ | . / \ | \
| | ::| | | .|
| ( ') (. )::|
|: | |; U U ;|:: | `|
|' | | \ U U / |' | |
##V| |_/`"""`\_| |V##
##V## ##V##
```