Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .github/workflows/deploy-vendors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
ftp-username: ${{ secrets.SFTP_USER }}
ftp-password: ${{ secrets.SFTP_PASSWORD }}
local-dir: plugins/bifrost-framework/vendor/
<<<<<<< feature/theme
git-ftp-args: --all
=======
>>>>>>> trunk
known-hosts: ${{ secrets.SFTP_KNOWN_HOSTS }}

- name: Install plugin dependencies (bifrost-music)
Expand Down
43 changes: 43 additions & 0 deletions plugins/bifrost-framework/inc/Autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Autoloader.
*
* @author Bifrost
* @copyright Copyright (c) 2026, WordPress
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL-3.0-or-later
* @link https://github.com/wptrainingteam/developer-showcase
*/

namespace Bifrost\Framework;

class Autoload
{
/**
* Register the autoloader.
*/
public static function register(): bool
{
return spl_autoload_register([__CLASS__, 'autoload'], true, true);
}

/**
* Autoloads class if it's in the theme's namespace.
*/
public static function autoload(string $class): void
{
// Bail if the class is not in our namespace.
if (! str_starts_with($class, __NAMESPACE__)) {
return;
}

$filename = __DIR__ . sprintf('/%s.php', str_replace(
[__NAMESPACE__ . '\\', '\\'],
['', DIRECTORY_SEPARATOR],
$class
));

if (file_exists($filename)) {
require_once $filename;
}
}
}
10 changes: 8 additions & 2 deletions plugins/bifrost-framework/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@
use Bifrost\Framework\Core\Application;

# Load the autoloader.
if (! class_exists(Application::class) && is_file(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
if (! class_exists(Application::class)) {
if (is_file(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
} elseif (is_file(__DIR__ . '/inc/Autoload.php')) {
require_once __DIR__ . '/inc/Autoload.php';
require_once __DIR__ . '/inc/functions-helpers.php';
Autoload::register();
}
}

# Plugin phase: allow consumers to register providers, then boot.
Expand Down
5 changes: 1 addition & 4 deletions plugins/bifrost-music/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
"autoload": {
"psr-4": {
"Bifrost\\Music\\": "inc/"
},
"files" : [
"inc/functions-helpers.php"
]
}
},
"require": {
"php": ">=8.1"
Expand Down
52 changes: 0 additions & 52 deletions plugins/bifrost-music/inc/Container/Container.php

This file was deleted.

247 changes: 0 additions & 247 deletions plugins/bifrost-music/inc/Container/ServiceContainer.php

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/bifrost-music/inc/Content/Album.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Bifrost\Music\Content;

use WP_Post;
use Bifrost\Music\Contracts\Bootable;
use Bifrost\Framework\Contracts\Bootable;
use Bifrost\Music\Support\Definitions;

final class Album implements Bootable
Expand Down
Loading
Loading