This commit is contained in:
Bashy 2026-05-03 20:56:15 +03:00
commit 60ca58f5ba
80 changed files with 9458 additions and 0 deletions

View file

@ -0,0 +1,9 @@
<?php
require_once __DIR__ . '/ProjectTypeBase.php';
class GenericProject extends ProjectTypeBase {
public static function typeSlug(): string { return 'generic'; }
public static function typeName(): string { return 'Generic'; }
public static function typeIcon(): string { return 'bi-folder'; }
public static function description(): string { return 'Generic project directory'; }
}

View file

@ -0,0 +1,29 @@
<?php
require_once __DIR__ . '/ProjectTypeBase.php';
class HexoProject extends ProjectTypeBase {
public static function typeSlug(): string { return 'hexo'; }
public static function typeName(): string { return 'Hexo'; }
public static function typeIcon(): string { return 'bi-hexagon-fill'; }
public static function description(): string { return 'Hexo static site generator'; }
public static function tabs(): array {
return ['dashboard', 'analytics', 'posts', 'config', 'files',
'run', 'themes', 'plugins', 'git',
'notes', 'settings'];
}
public static function commands(): array {
return [
['id' => 'generate', 'label' => 'Generate', 'cmd' => 'hexo generate'],
['id' => 'clean', 'label' => 'Clean', 'cmd' => 'hexo clean'],
['id' => 'deploy', 'label' => 'Deploy', 'cmd' => 'hexo deploy'],
['id' => 'version', 'label' => 'Hexo version','cmd' => 'hexo version'],
];
}
public static function detectFromPath(string $path): bool {
return file_exists($path . '/_config.yml')
&& (is_dir($path . '/source') || is_dir($path . '/themes'));
}
}

View file

@ -0,0 +1,25 @@
<?php
abstract class ProjectTypeBase {
abstract public static function typeSlug(): string;
abstract public static function typeName(): string;
abstract public static function typeIcon(): string;
/** Tabs shown on the project page, in order */
public static function tabs(): array {
return ['dashboard', 'analytics', 'files', 'notes', 'settings'];
}
/** Whitelisted commands available in the command runner */
public static function commands(): array {
return [];
}
/** Return true if this type can be auto-detected from the given path */
public static function detectFromPath(string $path): bool {
return false;
}
public static function description(): string {
return '';
}
}

View file

@ -0,0 +1,17 @@
<?php
require_once __DIR__ . '/ProjectTypeBase.php';
class StorageProject extends ProjectTypeBase {
public static function typeSlug(): string { return 'storage'; }
public static function typeName(): string { return 'Storage'; }
public static function typeIcon(): string { return 'bi-hdd'; }
public static function description(): string { return 'File storage directory'; }
public static function tabs(): array {
return ['dashboard', 'analytics', 'media', 'files', 'notes', 'settings'];
}
public static function detectFromPath(string $path): bool {
return is_dir($path . '/uploads') || is_dir($path . '/files') || is_dir($path . '/storage');
}
}

View file

@ -0,0 +1,17 @@
<?php
require_once __DIR__ . '/ProjectTypeBase.php';
class WebsiteProject extends ProjectTypeBase {
public static function typeSlug(): string { return 'website'; }
public static function typeName(): string { return 'Website'; }
public static function typeIcon(): string { return 'bi-globe'; }
public static function description(): string { return 'Static or PHP website'; }
public static function tabs(): array {
return ['dashboard', 'analytics', 'files', 'git', 'notes', 'settings'];
}
public static function detectFromPath(string $path): bool {
return file_exists($path . '/index.html') || file_exists($path . '/index.php');
}
}