Browse Source

Simplifications. Et c’est 'shiraz' le nom.

master
Matthieu Marcillaud 1 year ago
parent
commit
bcc4414fc8
  1. 7
      config/shiraz.php
  2. 2
      public/edgard.php
  3. 6
      public/sendToShiraaz.php
  4. 11
      public/shiraaz.php
  5. 11
      public/shiraz.php
  6. 6
      src/Shiraaz.php
  7. 2
      src/WikiBot.php

7
config/shiraz.php

@ -0,0 +1,7 @@
<?php
return new Edgard\Config([
'ws' => 'ws://127.0.0.1:8890',
'channel' => '#spip_test',
'nickname' => 'Shi_ra_az',
]);

2
public/edgard.php

@ -8,4 +8,4 @@ if (file_exists(dirname(__DIR__).'/config/edgard.php')) {
throw new \Exception("You have to copy app.dist.php to edgard.php and edit it’s config.");
}
$edgard = new Edgard\Edgard($config);
$edgard = new Edgard\WikiBot($config);

6
public/sendToShiraaz.php

@ -2,10 +2,10 @@
require dirname(__DIR__).'/vendor/autoload.php';
if (file_exists(dirname(__DIR__).'/config/shiraaz.php')) {
$config = include dirname(__DIR__).'/config/shiraaz.php';
if (file_exists(dirname(__DIR__).'/config/shiraz.php')) {
$config = include dirname(__DIR__).'/config/shiraz.php';
} else {
throw new \Exception("You have to copy app.dist.php to shiraaz.php and edit it’s config.");
throw new \Exception("You have to copy app.dist.php to shiraz.php and edit it’s config.");
}
array_shift($argv);

11
public/shiraaz.php

@ -1,11 +0,0 @@
<?php
require dirname(__DIR__).'/vendor/autoload.php';
if (file_exists(dirname(__DIR__).'/config/shiraaz.php')) {
$config = include dirname(__DIR__).'/config/shiraaz.php';
} else {
throw new \Exception("You have to copy app.dist.php to shiraaz.php and edit it’s config.");
}
$shiraaz = new Edgard\Shiraaz($config);

11
public/shiraz.php

@ -0,0 +1,11 @@
<?php
require dirname(__DIR__).'/vendor/autoload.php';
if (file_exists(dirname(__DIR__).'/config/shiraz.php')) {
$config = include dirname(__DIR__).'/config/shiraz.php';
} else {
throw new \Exception("You have to copy app.dist.php to shiraz.php and edit it’s config.");
}
$shiraz = new Edgard\Bot($config);

6
src/Shiraaz.php

@ -1,6 +0,0 @@
<?php
namespace Edgard;
class Shiraaz extends Bot {}

2
src/Edgard.php → src/WikiBot.php

@ -9,7 +9,7 @@ use Hoa\Socket\Server as SocketServer;
use Hoa\Websocket\Server as WsServer;
use Hoa\Event\Bucket;
class Edgard extends Bot {
class WikiBot extends Bot {
protected $wiki;
Loading…
Cancel
Save