Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8c25c05
Added ll
CrochetFeve0251 Nov 25, 2024
7fba211
Added ll and removed contexts
CrochetFeve0251 Nov 25, 2024
b381637
Added base for context module
CrochetFeve0251 Dec 12, 2024
84c4281
Added base for context module
CrochetFeve0251 Dec 13, 2024
048547b
Added new logic to inject container
CrochetFeve0251 Dec 13, 2024
21c8762
Added logic for context
CrochetFeve0251 Dec 14, 2024
ff1b0fd
Added docblocks
CrochetFeve0251 Dec 14, 2024
7329578
Changed filter name
CrochetFeve0251 Dec 14, 2024
302e5fe
Changed the hook name
CrochetFeve0251 Dec 14, 2024
dd82178
Added ajax module
CrochetFeve0251 Dec 14, 2024
8afc75a
Added first base for the cron module
CrochetFeve0251 Dec 15, 2024
17a1faf
Added docblocks
CrochetFeve0251 Dec 15, 2024
8f7d34e
Added new packages to the ci
CrochetFeve0251 Dec 15, 2024
f18e259
Added base for mono repo
CrochetFeve0251 Dec 15, 2024
3aa8646
Fixed root composer
CrochetFeve0251 Dec 15, 2024
eed3703
Updated link
CrochetFeve0251 Dec 15, 2024
3ff7cd1
Updated custom lib
CrochetFeve0251 Dec 15, 2024
680529b
Changed to local
CrochetFeve0251 Dec 15, 2024
54c67b5
Added back link command
CrochetFeve0251 Dec 15, 2024
542d1b5
Updated branch
CrochetFeve0251 Dec 15, 2024
c0d0550
Updated branch
CrochetFeve0251 Dec 15, 2024
6e5dd90
Updated branch
CrochetFeve0251 Dec 15, 2024
c612482
Updated uninstaller
CrochetFeve0251 Dec 15, 2024
6c55491
Updated uninstaller
CrochetFeve0251 Dec 15, 2024
95522df
Updated uninstaller
CrochetFeve0251 Dec 15, 2024
b12e6a3
Updated uninstaller
CrochetFeve0251 Dec 15, 2024
055684d
Updated uninstaller
CrochetFeve0251 Dec 15, 2024
fd59822
Updated branches
CrochetFeve0251 Dec 15, 2024
cd69ab7
Added composer fixes
CrochetFeve0251 Dec 15, 2024
6cd9b28
Added fixes for tests
CrochetFeve0251 Dec 15, 2024
36071bd
Added fixes for tests
CrochetFeve0251 Dec 15, 2024
4491fb0
Removed tag
CrochetFeve0251 Dec 15, 2024
2b583a4
Removed tag
CrochetFeve0251 Dec 15, 2024
1f060f0
Removed tag
CrochetFeve0251 Dec 15, 2024
5fe7458
Removed tag
CrochetFeve0251 Dec 15, 2024
c967cff
Removed tag
CrochetFeve0251 Dec 15, 2024
aa8ecd6
Added reference
CrochetFeve0251 Dec 15, 2024
1705efe
Added reference
CrochetFeve0251 Dec 15, 2024
f7a0d11
Removed tag
CrochetFeve0251 Dec 15, 2024
79b08af
Removed tag
CrochetFeve0251 Dec 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI

on:
push:
pull_request:

concurrency:
Expand Down Expand Up @@ -39,6 +38,9 @@ jobs:
- wp-launchpad/phpunit-wp-hooks
- wp-launchpad/renderer-take-off
- wp-launchpad/take-off
- wp-launchpad/ajax
- wp-launchpad/cron
- wp-launchpad/context

name: ${{ matrix.component }} WP ${{ matrix.wp-versions }} with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}.

Expand Down Expand Up @@ -79,10 +81,9 @@ jobs:

- name: Run ${{ matrix.component }} install
run: |
composer global require soyuka/pmu
composer global config allow-plugins.soyuka/pmu true --no-interaction
composer i
composer link . --permanent
composer ${{matrix.component}} config allow-plugins.composer/installers false --no-interaction
composer global link . --permanent
composer ${{matrix.component}} update

- name: Require phpcov for coverage reporting
Expand Down
33 changes: 22 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
{
"name": "wp-launchpad/launchpad-develop",
"minimum-stability": "dev",
"require": {
"wp-launchpad/launchpad": "@dev",
"wp-launchpad/logger": "@dev",
"wp-launchpad/renderer": "@dev",
"wp-launchpad/bus": "@dev",
"wp-launchpad/options": "@dev",
"wp-launchpad/uninstaller": "@dev"
},
"require-dev": {
"soyuka/pmu": "^0.0.15"
"soyuka/pmu": "v0.0.16"
},
"repositories": [
{
"type": "git",
"url": "git@github.com:CrochetFeve0251/pmu.git"
}
],
"extra": {
"pmu": {
"projects": ["./packages/*/composer.json"]
"projects": ["packages/*/composer.json"]
}
},
"replace": {
"wp-launchpad/core": "self.version",
"wp-launchpad/build": "self.version",
"wp-launchpad/cli": "self.version",
"wp-launchpad/constants": "self.version",
"wp-launchpad/logger": "self.version",
"wp-launchpad/bus": "self.version",
"wp-launchpad/renderer": "self.version",
"wp-launchpad/filesystem": "self.version",
"wp-launchpad/uninstaller": "self.version",
"wp-launchpad/dispatcher": "self.version"
},
"config": {
"allow-plugins": {
"soyuka/pmu": true
"soyuka/pmu": true,
"composer/installers": true
}
}
}
79 changes: 39 additions & 40 deletions packages/action-scheduler-take-off/composer.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
{
"name": "wp-launchpad/action-scheduler-take-off",
"description": "Initialisation library for Action Scheduler from Launchpad framework",
"minimum-stability": "stable",
"license": "proprietary",
"type": "library",
"authors": [
{
"name": "coquardcyr",
"email": "coquardcyr@gmail.com"
"name": "wp-launchpad/action-scheduler-take-off",
"description": "Initialisation library for Action Scheduler from Launchpad framework",
"license": "proprietary",
"type": "library",
"authors": [
{
"name": "coquardcyr",
"email": "coquardcyr@gmail.com"
}
],
"require": {
"wp-launchpad/cli": "^3.1",
"woocommerce/action-scheduler": "^3.4",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8 || ^9",
"wp-media/phpunit": "^3.0"
},
"autoload": {
"psr-4": {
"LaunchpadActionSchedulerTakeOff\\": "inc/"
}
},
"autoload-dev": {
"psr-4": {
"LaunchpadActionSchedulerTakeOff\\Tests\\": "tests/"
}
},
"extra": {
"launchpad": {
"provider": "LaunchpadActionSchedulerTakeOff\\ServiceProvider",
"command": "action-scheduler:initialize",
"install": true,
"clean": true,
"libraries": {
"wp-launchpad/action-scheduler": "^0.0.2"
}
}
}
],
"require": {
"wp-launchpad/cli": "1.0.*",
"woocommerce/action-scheduler": "^3.4",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8 || ^9",
"wp-media/phpunit": "^3.0"
},
"autoload": {
"psr-4": {
"LaunchpadActionSchedulerTakeOff\\": "inc/"
}
},
"autoload-dev": {
"psr-4": {
"LaunchpadActionSchedulerTakeOff\\Tests\\": "tests/"
}
},
"extra": {
"launchpad": {
"provider" : "LaunchpadActionSchedulerTakeOff\\ServiceProvider",
"command": "action-scheduler:initialize",
"install": true,
"clean": true,
"libraries" : {
"wp-launchpad/action-scheduler": "^0.0.2"
}
}
}
}
53 changes: 26 additions & 27 deletions packages/action-scheduler/composer.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@

{
"name": "wp-launchpad/action-scheduler",
"description": "Action Scheduler library for Launchpad framework",
"license": "proprietary",
"type": "library",
"authors": [
{
"name": "coquardcyr",
"email": "coquardcyr@gmail.com"
"name": "wp-launchpad/action-scheduler",
"description": "Action Scheduler library for Launchpad framework",
"license": "proprietary",
"type": "library",
"authors": [
{
"name": "coquardcyr",
"email": "coquardcyr@gmail.com"
}
],
"require": {
"woocommerce/action-scheduler": "^3.4"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8 || ^9",
"wp-media/phpunit": "^3.0"
},
"autoload": {
"psr-4": {
"LaunchpadActionScheduler\\": "inc/"
}
},
"autoload-dev": {
"psr-4": {
"LaunchpadActionScheduler\\Tests\\": "tests/"
}
}
],
"require": {
"woocommerce/action-scheduler": "^3.4"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8 || ^9",
"wp-media/phpunit": "^3.0"
},
"autoload": {
"psr-4": {
"LaunchpadActionScheduler\\": "inc/"
}
},
"autoload-dev": {
"psr-4": {
"LaunchpadActionScheduler\\Tests\\": "tests/"
}
}
}
35 changes: 35 additions & 0 deletions packages/ajax/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "wp-launchpad/ajax",
"description": "Ajax module for Launchpad",
"keywords": [
"wordpress"
],
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "CrochetFeve0251"
}
],
"autoload": {
"psr-4": {
"LaunchpadAjax\\": "inc/"
}
},
"autoload-dev": {
"psr-4": {
"LaunchpadAjax\\Tests\\": "tests/"
}
},
"require": {
"wp-launchpad/core": "^3.1"
},
"require-dev": {
"wp-media/phpunit": "^3.0"
},
"scripts": {
"test-integration": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --exclude-group AdminOnly",
"run-tests": [
"@test-integration"
]
}
}
11 changes: 11 additions & 0 deletions packages/ajax/inc/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace LaunchpadAjax;

class ServiceProvider extends \LaunchpadCore\Container\AbstractServiceProvider
{
protected function define()
{
$this->register_init_subscriber(Subscriber::class);
}
}
59 changes: 59 additions & 0 deletions packages/ajax/inc/Subscriber.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace LaunchpadAjax;

use LaunchpadCore\Container\PrefixAware;
use LaunchpadCore\Container\PrefixAwareInterface;
use LaunchpadCore\Dispatcher\DispatcherAwareInterface;
use LaunchpadCore\Dispatcher\DispatcherAwareTrait;
use ReflectionClass;

class Subscriber implements PrefixAwareInterface, DispatcherAwareInterface
{
use PrefixAware, DispatcherAwareTrait;

/**
* @hook $prefixcore_subscriber_events
*/
public function parse_ajax_annotations($events, $classname) {

if(! is_array($events)) {
return $events;
}

$methods = get_class_methods( $classname );
$reflection_class = new ReflectionClass( $classname );

foreach ( $methods as $method ) {
$method_reflection = $reflection_class->getMethod( $method );
$doc_comment = $method_reflection->getDocComment();
if ( ! $doc_comment ) {
continue;
}
$pattern = '#@ajax\s(?<name>[a-zA-Z\\\-_$/]+)(\s(?<priority>[0-9]+))?(\s(?<private>no-private))?#';

preg_match_all( $pattern, $doc_comment, $matches, PREG_PATTERN_ORDER );
if ( ! $matches ) {
continue;
}


foreach ( $matches[0] as $index => $match ) {

$base_hook = $matches['private'][$index] ? 'wp_ajax_nopriv_': 'wp_ajax_';

$hook = "{$base_hook}{$matches['name'][ $index ]}";
$hook = str_replace( '$prefix', $this->prefix, $hook );
$hook = $this->dispatcher->apply_string_filters("{$this->prefix}core_subscriber_event_hook", $hook, $classname);

$events[ $hook ][] = [
$method,
key_exists( 'priority', $matches ) && key_exists( $index, $matches['priority'] ) && '' !== $matches['priority'][ $index ] ? (int) $matches['priority'][ $index ] : 10,
$method_reflection->getNumberOfParameters(),
];
}
}

return $events;
}
}
13 changes: 13 additions & 0 deletions packages/ajax/tests/Fixtures/inc/data/AjaxAnnotationSubscriber.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace LaunchpadAjax\Tests\Fixtures\inc\data;

class AjaxAnnotationSubscriber
{
/**
* @ajax event
*/
public static function save_admin() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace LaunchpadAjax\Tests\Fixtures\inc\data;

class AjaxNoPrivateAnnotationSubscriber
{
/**
* @ajax event no-private
*/
public static function save_admin() {

}
}
Loading
Loading