-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build configuration to .readthedocs.yml
- Loading branch information
Showing
71 changed files
with
1,908 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Do not export those files in the Composer archive | ||
/.github/ export-ignore | ||
/docs/ export-ignore | ||
/tests/ export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.readthedocs.yml export-ignore | ||
/CHANGELOG.md export-ignore | ||
/codeception.yml export-ignore | ||
/mkdocs.yml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ | |
|
||
abstract class Action extends SavableComponent implements ActionInterface | ||
{ | ||
|
||
public ?string $uid = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace panlatent\craft\actions\abstract; | ||
|
||
class ConditionAction extends Action | ||
{ | ||
public function __construct(private readonly ActionInterface $action, $config = []) | ||
{ | ||
parent::__construct($config); | ||
} | ||
|
||
public function getConditions(): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function getAction(): ActionInterface | ||
{ | ||
return $this->action; | ||
} | ||
|
||
public function validateConditions(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function execute(ContextInterface $context): bool | ||
{ | ||
|
||
|
||
|
||
return $this->action->execute($context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace panlatent\craft\actions\abstract; | ||
|
||
interface RunnerInterface | ||
{ | ||
public static function run(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ | |
|
||
interface TriggerInterface | ||
{ | ||
public function trigger(): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,10 @@ | |
], | ||
"homepage": "https://github.com/panlatent/schedule", | ||
"support": { | ||
"docs": "https://docs.panlatent.com/schedule", | ||
"docs": "https://docs.panlatent.com/projects/schedule", | ||
"issues": "https://github.com/panlatent/schedule/issues" | ||
}, | ||
"license": "MIT", | ||
"license": "proprietary", | ||
"authors": [ | ||
{ | ||
"name": "[email protected]", | ||
|
@@ -31,9 +31,11 @@ | |
"nesbot/carbon": "^1.22 || ^2.10 || ^3.0", | ||
"panlatent/craft-action-abstract": "@dev", | ||
"panlatent/cron-expression-descriptor": "^1.1", | ||
"psr/container": "^1.0 || ^2.0", | ||
"psr/log": "^1.0 || ^2.0 || ^3.0", | ||
"react/event-loop": "^1.5", | ||
"symfony/process": "^6.0 || ^7.0" | ||
"symfony/process": "^6.0 || ^7.0", | ||
"alexanderpas/http-enum": "^1.0" | ||
}, | ||
"replace": { | ||
"panlatent/craft-action-abstract": "self.version" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
mkdocs-material | ||
mkdocs-material | ||
mkdocs-git-revision-date-localized-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
use craft\web\UrlManager; | ||
use panlatent\schedule\console\SchedulesController; | ||
use panlatent\schedule\models\Settings; | ||
use panlatent\schedule\services\Actions; | ||
use panlatent\schedule\services\Logs; | ||
use panlatent\schedule\services\Schedules; | ||
use panlatent\schedule\services\Timers; | ||
|
@@ -33,14 +34,15 @@ | |
* | ||
* @package panlatent\schedule | ||
* @method Settings getSettings() | ||
* @property-read Actions $actions | ||
* @property-read Schedules $schedules | ||
* @property-read Timers $timers | ||
* @property-read Settings $settings | ||
* @author Panlatent <[email protected]> | ||
*/ | ||
class Plugin extends \craft\base\Plugin | ||
{ | ||
public const EDITION_STANDARD = 'standard'; | ||
public const EDITION_LITE = 'lite'; | ||
public const EDITION_PRO = 'pro'; | ||
|
||
// Properties | ||
|
@@ -63,6 +65,7 @@ public static function config(): array | |
{ | ||
return [ | ||
'components' => [ | ||
'actions' => Actions::class, | ||
'schedules' => Schedules::class, | ||
'timers' => Timers::class, | ||
'logs' => Logs::class, | ||
|
@@ -73,7 +76,7 @@ public static function config(): array | |
public static function editions(): array | ||
{ | ||
return [ | ||
self::EDITION_STANDARD, | ||
self::EDITION_LITE, | ||
self::EDITION_PRO, | ||
]; | ||
} | ||
|
@@ -94,6 +97,10 @@ public function init(): void | |
$this->_registerProjectConfigEvents(); | ||
$this->_registerUserPermissions(); | ||
$this->_registerVariables(); | ||
|
||
if ($this->settings->enabledWebCron) { | ||
$this->_registerWebCron(); | ||
} | ||
}); | ||
} | ||
|
||
|
@@ -229,4 +236,11 @@ private function _registerVariables(): void | |
$variable->attachBehavior('schedule', CraftVariableBehavior::class); | ||
}); | ||
} | ||
|
||
private function _registerWebCron() | ||
{ | ||
Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_SITE_URL_RULES, function (RegisterUrlRulesEvent $event) { | ||
$event->rules[$this->settings->endpoint] = 'schedule/web-cron/trigger'; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace panlatent\schedule\actions; | ||
|
||
use panlatent\craft\actions\abstract\Action; | ||
use panlatent\craft\actions\abstract\ContextInterface; | ||
|
||
class Closure extends Action | ||
{ | ||
public ?\Closure $closure = null; | ||
|
||
public function execute(ContextInterface $context): bool | ||
{ | ||
return true; | ||
} | ||
|
||
} |
Oops, something went wrong.