Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Jan 16, 2024
1 parent 99dbc35 commit 0ecc774
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Builders/GroupBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class $className extends GroupBuilder
public function handler(string \$id, array \$value, Connection \$connection): bool
{
\$header = new Headers(\$value['_header']);
\$body = \$value['_body']
\$body = \$value['_body'];
// TODO 请重写消费逻辑
echo "请重写 $className::handler\\n";
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/Builders/QueueBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class $className extends QueueBuilder
public function handler(string \$id, array \$value, Connection \$connection): bool
{
\$header = new Headers(\$value['_header']);
\$body = \$value['_body']
\$body = \$value['_body'];
// TODO 请重写消费逻辑
echo "请重写 $className::handler\\n";
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/WorkbunnyWebmanRqueueBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if(!file_exists($process = config_path() . '/plugin/workbunny/webman-rqueue/process.php')) {
return $this->error($output, "Builder {$name} failed to create: plugin/workbunny/webman-rqueue/process.php does not exist.");
}
$processName = AbstractBuilder::getName($className = "$namespace\\$name", true) . "-$mode";
$processName = AbstractBuilder::getName($className = "$namespace\\$name", true);
// check config
$config = config('plugin.workbunny.webman-rqueue.process', []);
if(isset($config[$processName])){
Expand Down
16 changes: 11 additions & 5 deletions src/Commands/WorkbunnyWebmanRqueueList.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Workbunny\WebmanRqueue\Builders\AbstractBuilder;
use function Workbunny\WebmanRqueue\base_path;
use function Workbunny\WebmanRqueue\config;

Expand Down Expand Up @@ -38,12 +39,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$configs = config('plugin.workbunny.webman-rqueue.process', []);

/** @var SplFileInfo $file */
foreach ($files as $file){
$key = str_replace(
'/',
'.',
str_replace(base_path() . '/' , '', $fileName = $file->getPath() . '/' . $file->getBasename('.php'))
foreach ($files as $file) {
$key = AbstractBuilder::getName(
str_replace('/', '\\',
str_replace(base_path() . '/' , '', $fileName = $file->getPath() . '/' . $file->getBasename('.php'))
)
);
// $key = str_replace(
// '/',
// '.',
// str_replace(base_path() . '/' , '', $fileName = $file->getPath() . '/' . $file->getBasename('.php'))
// );
$name = str_replace(base_path() . '/' . self::$baseProcessPath . '/', '', $fileName);
$rows[] = [
strtolower(
Expand Down

0 comments on commit 0ecc774

Please sign in to comment.