mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Add dummy driver, clean up loose ends and start writing admin page
This commit is contained in:
parent
09fa4778c0
commit
d8370ff59b
6 changed files with 102 additions and 7 deletions
|
|
@ -10,12 +10,6 @@ use Rhymix\Framework\Drivers\QueueInterface;
|
|||
*/
|
||||
class DB implements QueueInterface
|
||||
{
|
||||
/**
|
||||
* The Redis connection is stored here.
|
||||
*/
|
||||
protected $_conn;
|
||||
protected $_key;
|
||||
|
||||
/**
|
||||
* Create a new instance of the current Queue driver, using the given settings.
|
||||
*
|
||||
|
|
@ -90,7 +84,7 @@ class DB implements QueueInterface
|
|||
$oDB = RFDB::getInstance();
|
||||
$stmt = $oDB->prepare('INSERT INTO task_queue (handler, args, options) VALUES (?, ?, ?)');
|
||||
$result = $stmt->execute([$handler, serialize($args), serialize($options)]);
|
||||
return $result ? $oDB->getInsertID() : false;
|
||||
return $result ? $oDB->getInsertID() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
96
common/framework/drivers/queue/dummy.php
Normal file
96
common/framework/drivers/queue/dummy.php
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Framework\Drivers\Queue;
|
||||
|
||||
use Rhymix\Framework\Drivers\QueueInterface;
|
||||
|
||||
/**
|
||||
* The Dummy queue driver.
|
||||
*/
|
||||
class Dummy implements QueueInterface
|
||||
{
|
||||
/**
|
||||
* Create a new instance of the current Queue driver, using the given settings.
|
||||
*
|
||||
* @param array $config
|
||||
* @return void
|
||||
*/
|
||||
public static function getInstance(array $config): self
|
||||
{
|
||||
return new self($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the human-readable name of this Queue driver.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'Dummy';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of configuration fields required by this Queue driver.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getRequiredConfig(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of configuration fields optionally used by this Queue driver.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getOptionalConfig(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this driver is supported on this server.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isSupported(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct(array $config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a task.
|
||||
*
|
||||
* @param string $handler
|
||||
* @param ?object $args
|
||||
* @param ?object $options
|
||||
* @return int
|
||||
*/
|
||||
public function addTask(string $handler, ?object $args = null, ?object $options = null): int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first task.
|
||||
*
|
||||
* @param int $blocking
|
||||
* @return ?object
|
||||
*/
|
||||
public function getTask(int $blocking = 0): ?object
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
<action name="procAdminUpdateDebug" class="Controllers\SystemConfig\Debug" />
|
||||
<action name="dispAdminConfigSEO" class="Controllers\SystemConfig\SEO" menu_name="adminConfigurationGeneral" />
|
||||
<action name="procAdminUpdateSEO" class="Controllers\SystemConfig\SEO" />
|
||||
<action name="dispAdminConfigQueue" class="Controllers\SystemConfig\Queue" menu_name="adminConfigurationGeneral" />
|
||||
<action name="procAdminUpdateQueue" class="Controllers\SystemConfig\Queue" />
|
||||
<action name="dispAdminConfigSitelock" class="Controllers\SystemConfig\SiteLock" menu_name="adminConfigurationGeneral" />
|
||||
<action name="procAdminUpdateSitelock" class="Controllers\SystemConfig\SiteLock" />
|
||||
<!-- Admin Interface Config -->
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ $lang->subtitle_security = 'Security';
|
|||
$lang->subtitle_advanced = 'Advanced';
|
||||
$lang->subtitle_domains = 'Domains';
|
||||
$lang->subtitle_debug = 'Debug';
|
||||
$lang->subtitle_queue = 'Async Queue';
|
||||
$lang->subtitle_seo = 'SEO Settings';
|
||||
$lang->subtitle_etc = 'Other Settings';
|
||||
$lang->current_state = 'Current state';
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ $lang->subtitle_notification = '알림 설정';
|
|||
$lang->subtitle_security = '보안 설정';
|
||||
$lang->subtitle_advanced = '고급 설정';
|
||||
$lang->subtitle_debug = '디버그 설정';
|
||||
$lang->subtitle_queue = '비동기 작업';
|
||||
$lang->subtitle_seo = 'SEO 설정';
|
||||
$lang->subtitle_etc = '기타';
|
||||
$lang->current_state = '현황';
|
||||
|
|
|
|||
|
|
@ -12,5 +12,6 @@
|
|||
<li class="x_active"|cond="$act == 'dispAdminConfigAdvanced'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigAdvanced')}">{$lang->subtitle_advanced}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdminConfigDebug'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigDebug')}">{$lang->subtitle_debug}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdminConfigSEO'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigSEO')}">{$lang->subtitle_seo}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdminConfigQueue'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigQueue')}">{$lang->subtitle_queue}</a></li>
|
||||
<li class="x_active"|cond="$act == 'dispAdminConfigSitelock'"><a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigSitelock')}">{$lang->subtitle_sitelock}</a></li>
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue