Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vanilla Web UI support #503

Merged
merged 4 commits into from
Jun 13, 2021
Merged

Vanilla Web UI support #503

merged 4 commits into from
Jun 13, 2021

Conversation

itsgoingd
Copy link
Owner

  • added Web UI support to the Vanilla integration
  • new Clockwork::returnWeb api is used for serving the Web UI
    • on the first run the Web UI assets are installed into the configured public directory
    • the Clockwork App is linked in an iframe to work around relative asset URLs and with a javascript snippet overriding the metadata api path
  • the Clockwork App was updated to allow overriding of the metadata api path via settings
  • note, installed Web UI assets are not automatically updated

Example usage:

// clockwork-web.php

$clockwork = Clockwork\Support\Vanilla\Clockwork::init([
    'api' => '/clockwork.php?request=',
    'web' => [
        'enable' => true,
        'path' => __DIR__ . '/vendor/clockwork',
        'uri' => '/vendor/clockwork'
    ]
]);

$clockwork->returnWeb();

A PSR-7 application using a router:

$router->get('/clockwork', function ($request) {
    $clockwork = Clockwork\Support\Vanilla\Clockwork::init([
        'web' => [
            'enable' => true,
            'path' => __DIR__ . '/public/vendor/clockwork',
            'uri' => '/vendor/clockwork'
        ]
    ]);

    return $clockwork->usePsrMessage($request, new Response)->returnWeb();
}};

@itsgoingd itsgoingd mentioned this pull request May 23, 2021
22 tasks
@itsgoingd itsgoingd merged commit 4db786a into master Jun 13, 2021
@itsgoingd itsgoingd deleted the vanilla-web branch June 13, 2021 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant