Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
panlatent committed Jun 12, 2024
1 parent 13be0da commit 2fab086
Show file tree
Hide file tree
Showing 44 changed files with 798 additions and 252 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]
### Added
- Static schedules in config file
- Verification conditions before schedule execution
- Response actions after the schedule is completed
- A scheduler based on ReactPHP

### Updated
- Decoupled logging components and only depend on PSR Log

### Fixed
### Removed
- Remove schedule savable components.


## [0.6.1] -2024-05-15
## Updated
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
Schedule
========
[![Build Status](https://travis-ci.org/panlatent/schedule.svg)](https://travis-ci.org/panlatent/schedule)
[![Coverage Status](https://coveralls.io/repos/github/panlatent/schedule/badge.svg?branch=master)](https://coveralls.io/github/panlatent/schedule?branch=master)
[![Latest Stable Version](https://poser.pugx.org/panlatent/schedule/v/stable.svg)](https://packagist.org/packages/panlatent/schedule)
[![Total Downloads](https://poser.pugx.org/panlatent/schedule/downloads.svg)](https://packagist.org/packages/panlatent/schedule)
[![Latest Unstable Version](https://poser.pugx.org/panlatent/schedule/v/unstable.svg)](https://packagist.org/packages/panlatent/schedule)
[![License](https://poser.pugx.org/panlatent/schedule/license.svg)](https://packagist.org/packages/panlatent/schedule)
[![Craft CMS](https://img.shields.io/badge/Powered_by-Craft_CMS-orange.svg?style=flat)](https://craftcms.com/)
[![Yii2](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)

Manage your CraftCMS application schedules in Cp. Run a command, trigger an event,
push a queue task, or send HTTP requests at a specified time. You can flexibly customize
Expand Down
10 changes: 10 additions & 0 deletions abstract/Action.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace panlatent\craft\actions\abstract;

use craft\base\SavableComponent;

abstract class Action extends SavableComponent implements ActionInterface
{

}
10 changes: 10 additions & 0 deletions abstract/ActionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace panlatent\craft\actions\abstract;

use craft\base\SavableComponentInterface;

interface ActionInterface extends SavableComponentInterface
{
public function execute(ContextInterface $context): bool;
}
8 changes: 8 additions & 0 deletions abstract/Condition.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace panlatent\craft\actions\abstract;

class Condition
{

}
10 changes: 10 additions & 0 deletions abstract/Context.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace panlatent\craft\actions\abstract;

use yii\base\Component;

abstract class Context extends Component implements ContextInterface
{

}
18 changes: 18 additions & 0 deletions abstract/ContextInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace panlatent\craft\actions\abstract;

use Psr\Log\LoggerInterface;

interface ContextInterface
{
public function getErrors(): array;

public function getLogger(): LoggerInterface;

public function getInput(): InputInterface;

public function getOutput(): OutputInterface;

public function setOutput(OutputInterface $output): void;
}
8 changes: 8 additions & 0 deletions abstract/InputInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace panlatent\craft\actions\abstract;

interface InputInterface
{

}
10 changes: 10 additions & 0 deletions abstract/OutputInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace panlatent\craft\actions\abstract;

interface OutputInterface
{
public function canStored(): bool;

public function getSettings(): array;
}
8 changes: 8 additions & 0 deletions abstract/TriggerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace panlatent\craft\actions\abstract;

interface TriggerInterface
{
public function trigger(): bool;
}
26 changes: 15 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,34 @@
}
],
"require": {
"php": "^8.0.2",
"craftcms/cms": "^4.0|^5.0",
"php": ">=8.2",
"craftcms/cms": "^5.0",
"dragonmantank/cron-expression": "^3.3",
"nesbot/carbon": "^1.22 || ^2.10 || ^3.0",
"symfony/process": "^4.2 || ^5.0 || ^6.0 || ^7.0",
"guzzlehttp/guzzle": "^7.2",
"panlatent/cron-expression-descriptor": "^1.1"
"nesbot/carbon": "^1.22 || ^2.10 || ^3.0",
"panlatent/craft-action-abstract": "@dev",
"panlatent/cron-expression-descriptor": "^1.1",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"react/event-loop": "^1.5",
"symfony/process": "^6.0 || ^7.0"
},
"replace": {
"panlatent/craft-action-abstract": "self.version"
},
"suggest": {
"ext-intl": "Help translate cron express description"
},
"autoload": {
"psr-4": {
"panlatent\\schedule\\": "src/"
"panlatent\\schedule\\": "src/",
"panlatent\\craft\\actions\\abstract\\": "abstract/"
}
},
"extra": {
"name": "Schedule",
"handle": "schedule",
"changelogUrl": "https://raw.githubusercontent.com/panlatent/schedule/master/CHANGELOG.md",
"class": "panlatent\\schedule\\Plugin",
"branch-alias": {
"dev-master": "0.4.x-dev"
}
"class": "panlatent\\schedule\\Plugin"
},
"require-dev": {
"codeception/codeception": "^4.1",
Expand All @@ -56,7 +60,7 @@
},
"config": {
"platform": {
"php": "8.0.2"
"php": "8.2"
},
"allow-plugins": {
"yiisoft/yii2-composer": true,
Expand Down
12 changes: 12 additions & 0 deletions config/schedule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use panlatent\schedule\builder\Schedule;

return [
'schedules' => [
Schedule::request('')->hourly()->onSuccess(function() {

}),

],
];
1 change: 1 addition & 0 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*
* @package panlatent\schedule
* @author Panlatent <[email protected]>
* @deprecated since 1.0.0
*/
class Builder extends Component
{
Expand Down
1 change: 1 addition & 0 deletions src/BuilderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/**
* @property-read ScheduleInterface $schedule
* @deprecated since 1.0.0
*/
class BuilderEvent extends Component
{
Expand Down
8 changes: 8 additions & 0 deletions src/Gc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace panlatent\schedule;

class Gc
{

}
8 changes: 8 additions & 0 deletions src/Performance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace panlatent\schedule;

class Performance
{

}
Loading

0 comments on commit 2fab086

Please sign in to comment.