Skip to content

Commit

Permalink
Merge branch '5.1.x' into unittest_InstallationsService_installPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring authored Nov 29, 2024
2 parents c22e39e + 9ccb3a4 commit 126bece
Show file tree
Hide file tree
Showing 130 changed files with 2,623 additions and 297 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,8 @@ node_modules
# profiler
/profiler/*
# etc
LOCAL_TODO.md
LOCAL_Q&A.md
/LOCAL_TODO.md
/LOCAL_Q&A.md
/.cache
/docker/nginx/*
/docker/proxy/*
36 changes: 18 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,23 @@
}
},
"replace": {
"baserproject/baser-core": "5.1.3",
"baserproject/bc-admin-third": "5.1.3",
"baserproject/bc-blog": "5.1.3",
"baserproject/bc-column": "5.1.3",
"baserproject/bc-content-link": "5.1.3",
"baserproject/bc-custom-content": "5.1.3",
"baserproject/bc-editor-template": "5.1.3",
"baserproject/bc-favorite": "5.1.3",
"baserproject/bc-front": "5.1.3",
"baserproject/bc-installer": "5.1.3",
"baserproject/bc-mail": "5.1.3",
"baserproject/bc-plugin-sample": "5.1.3",
"baserproject/bc-search-index": "5.1.3",
"baserproject/bc-theme-config": "5.1.3",
"baserproject/bc-theme-file": "5.1.3",
"baserproject/bc-theme-sample": "5.1.3",
"baserproject/bc-uploader": "5.1.3",
"baserproject/bc-widget-area": "5.1.3"
"baserproject/baser-core": "5.1.4",
"baserproject/bc-admin-third": "5.1.4",
"baserproject/bc-blog": "5.1.4",
"baserproject/bc-column": "5.1.4",
"baserproject/bc-content-link": "5.1.4",
"baserproject/bc-custom-content": "5.1.4",
"baserproject/bc-editor-template": "5.1.4",
"baserproject/bc-favorite": "5.1.4",
"baserproject/bc-front": "5.1.4",
"baserproject/bc-installer": "5.1.4",
"baserproject/bc-mail": "5.1.4",
"baserproject/bc-plugin-sample": "5.1.4",
"baserproject/bc-search-index": "5.1.4",
"baserproject/bc-theme-config": "5.1.4",
"baserproject/bc-theme-file": "5.1.4",
"baserproject/bc-theme-sample": "5.1.4",
"baserproject/bc-uploader": "5.1.4",
"baserproject/bc-widget-area": "5.1.4"
}
}
22 changes: 21 additions & 1 deletion plugins/baser-core/VERSION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@
CHG: 変更内容 / BUG: バグフィックス / NEW: 機能追加


[2024-11-28] basercms-5.1.4
- CHG [BC] パーミッショングループ一覧の「有効」列を非表示に変更
- CHG [BG] ブログ記事 スラッグ バリデーション追加
- CHG [BC] プラグイン一覧の並び順を有効なものが上にくるに変更
- CHG [BC] サイト編集画面にBcFormTableイベントを追加
- CHG [BC] レイアウトテンプレートの選択欄の取得順序変更
- BUG [BC] URL形式以外の文字が入力できてしまう問題を改善
- BUG [BC] 独自プラグインの初期データが復元されない問題を改善
- BUG [BC] 【テーマプラグイン】テーマ適用時にエラーメッセージが表示されプラグインがインストールされない問題を改善
- BUG [BC] PagesTable 等の beforeSave や、afterSave が動作しない問題を改善
- BUG [BC] サイト編集画面にてデバイス・言語のアクセス設定の動作不良を修正
- BUG [BC] Themeの読み込み順変更。bc_form.phpをsetting.phpで変更できるように。
- BUG [BC] fileLinkメソッドの動作不良を修正
- BUG [BC] BcFreezeHelper にて、フリーズした際に、入力欄が表示されてしまう場合がある問題を改善
- BUG [BC] イベントのオンオフを行う際にグローバルイベントマネージャーを指定した場合に例外を投げるように変更(処理がループしてしまうため)
- BUG [BC] スキーマ書き出しの際にループしてしまう問題を改善
- BUG [BC] 【テーマ設定】リンク先URL欄にURL形式以外の文字が入力できてしまう問題を改善
- BUG [BG] 【blog】一覧表示でブログIDを指定する場合、IDが複数の場合エラーになる問題を解決
- BUG [CC] カスタムコンテンツで関連フィールドの説明文表示をサニタイズ
- BUG [ML] mailFormLinkメソッドの動作不良を修正

[2024-10-24] basercms-5.1.3
- NEW [BC] さくらのVPSのSSLに対応
- CHG [BC] baserCMS4系で使用していたときのパスワードが引き継げない問題を解決
Expand All @@ -32,7 +53,6 @@ CHG: 変更内容 / BUG: バグフィックス / NEW: 機能追加
- BUG [BC] 管理画面テーマの選択の不具合を改善 fix #3884
- BUG [UL] フロント側のログインユーザーに公開期間外のアップロードファイルが表示されてしまう問題を改善


[2024-09-26] basercms-5.1.2
- NEW [BC] JWTキー生成コマンド追加
- BUG [BC] BcUploadで作成したフォルダの権限が書き込み可能になっていない問題を改善
Expand Down
28 changes: 14 additions & 14 deletions plugins/baser-core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
"firebase/php-jwt": "6.1.0",
"mobiledetect/mobiledetectlib": "^3.74",
"ext-json": "*",
"baserproject/bc-admin-third": "5.1.x-dev",
"baserproject/bc-blog": "5.1.x-dev",
"baserproject/bc-content-link": "5.1.x-dev",
"baserproject/bc-custom-content": "5.1.x-dev",
"baserproject/bc-editor-template": "5.1.x-dev",
"baserproject/bc-favorite": "5.1.x-dev",
"baserproject/bc-front": "5.1.x-dev",
"baserproject/bc-installer": "5.1.x-dev",
"baserproject/bc-mail": "5.1.x-dev",
"baserproject/bc-search-index": "5.1.x-dev",
"baserproject/bc-theme-config": "5.1.x-dev",
"baserproject/bc-theme-file": "5.1.x-dev",
"baserproject/bc-uploader": "5.1.x-dev",
"baserproject/bc-widget-area": "5.1.x-dev",
"baserproject/bc-admin-third": "5.1.4",
"baserproject/bc-blog": "5.1.4",
"baserproject/bc-content-link": "5.1.4",
"baserproject/bc-custom-content": "5.1.4",
"baserproject/bc-editor-template": "5.1.4",
"baserproject/bc-favorite": "5.1.4",
"baserproject/bc-front": "5.1.4",
"baserproject/bc-installer": "5.1.4",
"baserproject/bc-mail": "5.1.4",
"baserproject/bc-search-index": "5.1.4",
"baserproject/bc-theme-config": "5.1.4",
"baserproject/bc-theme-file": "5.1.4",
"baserproject/bc-uploader": "5.1.4",
"baserproject/bc-widget-area": "5.1.4",
"ext-mbstring": "*",
"ext-zip": "*",
"ext-gd": "*"
Expand Down
10 changes: 10 additions & 0 deletions plugins/baser-core/config/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,16 @@
*/
'enableRootRoutes' => false,

/**
* bc_formのテンプレートを指定
* config/bc_form.phpを差し替える
* プラグイン記法 (プラグイン名.テンプレート名)
*/
//basercms/plugins/baser-core/src/View/AppView.php
'AppFormTemplate' => 'BaserCore.bc_form',
//basercms/plugins/baser-core/src/View/BcAdminAppView.php
'AdminFormTemplate' => 'BaserCore.bc_form',

/**
* システムナビ
*
Expand Down
120 changes: 85 additions & 35 deletions plugins/baser-core/src/BaserCorePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function bootstrap(PluginApplicationInterface $app): void
}

/**
* プラグインロード
* テーマ・プラグインロード
*/
if (!filter_var(env('USE_DEBUG_KIT', true), FILTER_VALIDATE_BOOLEAN)) {
// 明示的に指定がない場合、DebugKitは重すぎるのでデバッグモードでも利用しない
Expand All @@ -164,19 +164,19 @@ public function bootstrap(PluginApplicationInterface $app): void
}

if (BcUtil::isTest()) $app->addPlugin('CakephpFixtureFactories');
$app->addPlugin('Authentication');
$app->addPlugin('Migrations');

$this->addTheme($app);

$plugins = BcUtil::getEnablePlugins();
if ($plugins) {
foreach($plugins as $plugin) {
if (BcUtil::includePluginClass($plugin->name)) {
$this->loadPlugin($app, $plugin->name, $plugin->priority);
}
}
}
// 利用可能なテーマを取得
$themes = $this->getAvailableThemes();
// プラグインを追加する前にテーマが保有するプラグインのパスをセット
$this->setupThemePlugin($themes);
// テーマが保有するプラグインも含めてプラグインを読み込む
$this->addPlugin($app);
// ======================================================
// テーマはプラグインの後に読み込む
// テーマもプラグインとして扱う場合があるため、
// その場合に、テーマでプラグインの設定等を上書きできるようにする
// ======================================================
$this->addTheme($app, $themes);

/**
* デフォルトテンプレートを設定する
Expand All @@ -194,50 +194,100 @@ public function bootstrap(PluginApplicationInterface $app): void
$event->on(new BcAuthenticationEventListener());
}

/**
* プラグインを追加する
* @param PluginApplicationInterface $app
* @return void
* @checked
* @noTodo
*/
public function addPlugin(PluginApplicationInterface $app): void
{
$app->addPlugin('Authentication');
$app->addPlugin('Migrations');

$plugins = BcUtil::getEnablePlugins();
if(!$plugins) return;
foreach($plugins as $plugin) {
if (!BcUtil::includePluginClass($plugin->name)) continue;
$this->loadPlugin($app, $plugin->name, $plugin->priority);
}
}

/**
* テーマを追加する
*
* テーマ内のプラグインも追加する
*
* @param PluginApplicationInterface $application
* @noTodo
* @checked
*/
public function addTheme(PluginApplicationInterface $application)
public function addTheme(PluginApplicationInterface $application, array $themes): void
{
$application->addPlugin(Inflector::camelize(Configure::read('BcApp.coreAdminTheme'), '-'));
$application->addPlugin(Inflector::camelize(Configure::read('BcApp.coreFrontTheme'), '-'));
if (!BcUtil::isInstalled()) return;
$sitesTable = TableRegistry::getTableLocator()->get('BaserCore.Sites');
try {
$sites = $sitesTable->find()->where(['Sites.status' => true]);
} catch (MissingConnectionException) {
return;

foreach($themes as $theme) {
if(!BcUtil::includePluginClass($theme)) continue;
try {
$application->addPlugin($theme);
} catch (MissingPluginException $e) {
$this->log($e->getMessage());
}
}
}

/**
* テーマが保有するプラグインのパスを追加する
* @param array $themes
* @return void
* @checked
* @noTodo
*/
public function setupThemePlugin(array $themes): void
{
if (!BcUtil::isInstalled()) return;
if(!$themes) return;
$path = [];
foreach($sites as $site) {
if ($site->theme) {
if(!BcUtil::includePluginClass($site->theme)) continue;
try {
$application->addPlugin($site->theme);
$pluginPath = CorePlugin::path($site->theme) . 'plugins' . DS;
if (!is_dir($pluginPath)) continue;
$path[] = $pluginPath;
} catch (MissingPluginException $e) {
$this->log($e->getMessage());
}
}
foreach($themes as $theme) {
$pluginsPath = CorePlugin::path($theme) . 'plugins' . DS;
if (!is_dir($pluginsPath)) continue;
$path[] = $pluginsPath;
}
// テーマプラグインを追加
if($path) {
if(isset($path) && $path) {
Configure::write('App.paths.plugins', array_merge(
Configure::read('App.paths.plugins'),
$path
));
}
}

/**
* 利用可能なテーマを取得する
* @return array
* @checked
* @noTodo
*/
public function getAvailableThemes(): array
{
if (!BcUtil::isInstalled()) return [];
$sitesTable = TableRegistry::getTableLocator()->get('BaserCore.Sites');
try {
$sites = $sitesTable->find()->where(['Sites.status' => true]);
} catch (MissingConnectionException) {
return [];
}
$themes = [];
foreach($sites as $site) {
if ($site->theme) {
if (!is_dir(CorePlugin::path($site->theme))) continue;
if(in_array($site->theme, $themes)) continue;
$themes[] = $site->theme;
}
}
return $themes;
}

/**
* デフォルトテンプレートを設定する
* @checked
Expand Down
4 changes: 4 additions & 0 deletions plugins/baser-core/src/BcPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function initialize(): void
* @param PluginApplicationInterface $app
* @checked
* @noTodo
* @unitTest
*/
public function bootstrap(PluginApplicationInterface $app): void
{
Expand Down Expand Up @@ -465,6 +466,7 @@ public function routes(RouteBuilder $routes): void
* @return RouteBuilder
* @checked
* @noTodo
* @unitTest
*/
public function contentsRoutingForReverse(RouteBuilder $routes, string $plugin)
{
Expand Down Expand Up @@ -493,6 +495,7 @@ function(RouteBuilder $routes) {
* @return RouteBuilder
* @checked
* @noTodo
* @unitTest
*/
public function frontPageRouting(RouteBuilder $routes, string $plugin)
{
Expand Down Expand Up @@ -569,6 +572,7 @@ function(RouteBuilder $routes) use($isApi) {
* @return RouteBuilder
* @checked
* @noTodo
* @unitTest
*/
public function siteRouting(RouteBuilder $routes, string $plugin)
{
Expand Down
1 change: 1 addition & 0 deletions plugins/baser-core/src/Command/ComposerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ComposerCommand extends Command
* @return \Cake\Console\ConsoleOptionParser
* @checked
* @noTodo
* @unitTest
*/
protected function buildOptionParser(\Cake\Console\ConsoleOptionParser $parser): \Cake\Console\ConsoleOptionParser
{
Expand Down
2 changes: 2 additions & 0 deletions plugins/baser-core/src/Command/CreateReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ protected function buildOptionParser(\Cake\Console\ConsoleOptionParser $parser):
* @return int|void|null
* @checked
* @noTodo
* @unitTest
*/
public function execute(Arguments $args, ConsoleIo $io)
{
Expand Down Expand Up @@ -109,6 +110,7 @@ public function execute(Arguments $args, ConsoleIo $io)
* @param string $packagePath
* @checked
* @noTodo
* @unitTest
*/
public function clonePackage(string $packagePath, string $branch)
{
Expand Down
1 change: 1 addition & 0 deletions plugins/baser-core/src/Command/SetupInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class SetupInstallCommand extends Command
* @return int|void|null
* @checked
* @noTodo
* @unitTest
*/
public function execute(Arguments $args, ConsoleIo $io)
{
Expand Down
1 change: 1 addition & 0 deletions plugins/baser-core/src/Command/SetupTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class SetupTestCommand extends Command
* @return int|void|null
* @checked
* @noTodo
* @unitTest
*/
public function execute(Arguments $args, ConsoleIo $io)
{
Expand Down
1 change: 1 addition & 0 deletions plugins/baser-core/src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public function beforeFilter(EventInterface $event)
* @return bool
* @noTodo
* @checked
* @unitTest
*/
private function checkPermission()
{
Expand Down
Loading

0 comments on commit 126bece

Please sign in to comment.