Skip to content

Commit 8acdacc

Browse files
authored
Update readme and add license (#143)
* update readme * add license * remove notes
1 parent 0eff3c1 commit 8acdacc

2 files changed

Lines changed: 55 additions & 42 deletions

File tree

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020-2021 Lonnie Ezell
4+
Copyright (c) 2021-2023 CodeIgniter Foundation
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,50 @@
1-
# CodeIgniter 4 Tasks
1+
# CodeIgniter Tasks
22

3-
A task scheduler for CodeIgniter 4.
3+
A task scheduler for CodeIgniter 4.
44

5-
**NOTE: Just starting development. Not for active consumption or it WILL make your app sick.**
5+
## Installation
66

7-
My "to-do list" for this module:
7+
Install via Composer:
88

9-
- provides commands to view when tasks are scheduled to run. Can list all for this week, or on a specific day.
10-
- command to run any job manually
11-
- command to disable/enable a job
12-
- should have a variety of ways to notify when done, like logging, email, etc
13-
- must be able to call shell commands
14-
- must be able to run closures
15-
- must be able to run commands
16-
- restrict by environment
17-
- can specify the timezone
18-
- should collect performance information (in writeable as csv)
19-
- command to view performance (https://github.com/codestudiohq/laravel-totem)
20-
- provide a debug toolbar pane
9+
composer require codeigniter4/tasks
2110

22-
## How to Try
11+
Migrate the database:
2312

24-
1. Add the following in your project's `composer.json`:
13+
php spark migrate --all
2514

26-
```
27-
"require": {
28-
"codeigniter4/tasks": "dev-develop"
29-
},
30-
```
31-
32-
```
33-
"repositories": [
34-
{
35-
"type": "vcs",
36-
"url": "https://github.com/codeigniter4/tasks.git"
37-
}
38-
],
39-
```
40-
41-
2. Run `composer update`.
15+
## Configuration
4216

43-
3. Run `php spark migrate --all`.
17+
Publish the config file:
4418

45-
4. Copy `vendor/codeigniter4/settings/src/Config/Tasks.php` into `app/Config/`.
19+
php spark tasks:publish
4620

47-
5. Update the namespace in `app/Config/Tasks.php`.
21+
## Defining tasks
4822

49-
```php
50-
<?php
23+
Define your tasks in the `init()` method:
5124

52-
namespace CodeIgniter\Tasks\Config;
53-
```
54-
5525
```php
26+
// app/Config/Tasks.php
5627
<?php
5728

5829
namespace Config;
30+
31+
use CodeIgniter\Tasks\Config\Tasks as BaseTasks;
32+
use CodeIgniter\Tasks\Scheduler;
33+
34+
class Tasks extends BaseTasks
35+
{
36+
/**
37+
* Register any tasks within this method for the application.
38+
*
39+
* @param Scheduler $schedule
40+
*/
41+
public function init(Scheduler $schedule)
42+
{
43+
$schedule->command('demo:refresh --all')->mondays('11:00 pm');
44+
}
45+
}
5946
```
47+
48+
## Docs
49+
50+
Read the full documentation: https://codeigniter4.github.io/tasks/

0 commit comments

Comments
 (0)