mirror of
https://github.com/godotengine/godot-website.git
synced 2025-12-31 09:48:43 +03:00
Add a custom utility plugin
This commit is contained in:
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -45,6 +45,7 @@ jobs:
|
||||
|
||||
# Copy project files.
|
||||
cp -r ../themes/* themes
|
||||
cp -r ../plugins/* plugins
|
||||
cp -r ../docker/php/config/* config
|
||||
# Fix up the config for CI.
|
||||
sed -i "s/'host' => 'mariadb'/'host' => 'localhost'/g" config/database.php
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -21,6 +21,8 @@ node_modules
|
||||
# Winter CMS files
|
||||
# Themes
|
||||
!/themes
|
||||
# Custom plugins
|
||||
!/plugins
|
||||
|
||||
# Docker
|
||||
/docker/mariadb/init/*.sql
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
!/.github/
|
||||
!/docker/
|
||||
!/themes/
|
||||
!/plugins/
|
||||
!/ISSUE_TEMPLATE.md
|
||||
!/README.md
|
||||
!/lighthouserc.js
|
||||
|
||||
@@ -34,3 +34,4 @@ services:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ../themes/godotengine:/var/www/html/themes/godotengine
|
||||
- ../plugins/godotengine:/var/www/html/plugins/godotengine
|
||||
|
||||
@@ -21,6 +21,8 @@ if [ ! -e $CONTAINER_ALREADY_STARTED ]; then
|
||||
php artisan plugin:install "pikanji.agent"
|
||||
php artisan plugin:install "rainlab.blog"
|
||||
php artisan plugin:install "sobored.rss"
|
||||
# Make sure custom plugins are properly initialized.
|
||||
php artisan plugin:refresh "godotengine.utility"
|
||||
|
||||
echo "Updating file permissions for newly created files..."
|
||||
chown www-data:www-data -R .
|
||||
|
||||
21
plugins/godotengine/utility/Plugin.php
Normal file
21
plugins/godotengine/utility/Plugin.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace GodotEngine\Utility;
|
||||
|
||||
class Plugin extends \System\Classes\PluginBase
|
||||
{
|
||||
public function pluginDetails()
|
||||
{
|
||||
return [
|
||||
'name' => 'GodotEngine Utility',
|
||||
'description' => 'Provides utility functions for Godot Engine website.',
|
||||
'author' => 'Godot Engine',
|
||||
'icon' => 'icon-leaf',
|
||||
'homepage' => 'https://godotengine.org'
|
||||
];
|
||||
}
|
||||
|
||||
public function register()
|
||||
{
|
||||
$this->registerConsoleCommand('godotengine.ping', 'GodotEngine\Utility\Console\Ping');
|
||||
}
|
||||
}
|
||||
1
plugins/godotengine/utility/composer.json
Normal file
1
plugins/godotengine/utility/composer.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
45
plugins/godotengine/utility/console/Ping.php
Normal file
45
plugins/godotengine/utility/console/Ping.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php namespace GodotEngine\Utility\Console;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
class Ping extends Command
|
||||
{
|
||||
/**
|
||||
* @var string The console command name.
|
||||
*/
|
||||
protected $name = 'godotengine:ping';
|
||||
|
||||
/**
|
||||
* @var string The console command description.
|
||||
*/
|
||||
protected $description = 'Ping the plugin to make sure it is working.';
|
||||
|
||||
/**
|
||||
* Get the console command arguments.
|
||||
* @return array
|
||||
*/
|
||||
protected function getArguments()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the console command options.
|
||||
* @return array
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->output->writeln('GodotEngine.Utility pongs in response!');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user