krgm.so-manager-dev.com/app/Providers/LegacyServiceProvider.php

45 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* 旧システム互換用サービスプロバイダ
* 目的旧Blade/旧コードが参照する FQCN例: \App\OperatorQueを新プロジェクトで解決可能にする
*/
class LegacyServiceProvider extends ServiceProvider
{
/**
* アプリ起動時の登録処理
* - 旧FQCNと互換レイヤApp\Legacy\*)のエイリアスを貼る
*/
public function register(): void
{
// \App\OperatorQue → \App\Legacy\OperatorQue
if (!class_exists(\App\OperatorQue::class) && class_exists(\App\Legacy\OperatorQue::class)) {
class_alias(\App\Legacy\OperatorQue::class, \App\OperatorQue::class);
}
// \App\User → \App\Legacy\User
if (!class_exists(\App\User::class) && class_exists(\App\Legacy\User::class)) {
class_alias(\App\Legacy\User::class, \App\User::class);
}
// \App\Park → \App\Legacy\Park
if (!class_exists(\App\Park::class) && class_exists(\App\Legacy\Park::class)) {
class_alias(\App\Legacy\Park::class, \App\Park::class);
}
}
/**
* アプリ起動後(ブート時)の処理
*/
public function boot(): void
{
// 現時点では何もしない(必要に応じて追加)
}
}