aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2016-01-09 08:32:32 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2016-01-09 08:32:32 +0100
commite9e1c621f06dc2fa59634fadb1bd5799f63c541a (patch)
tree9d5e59b6e4b5631474bb6849ec29f50a23ef2641
parent72335dcfa216a2b5e1a10408adb42076da0a75cb (diff)
downloadWorker-e9e1c621f06dc2fa59634fadb1bd5799f63c541a.zip
Worker-e9e1c621f06dc2fa59634fadb1bd5799f63c541a.tar.gz
Worker-e9e1c621f06dc2fa59634fadb1bd5799f63c541a.tar.bz2
Core: Remove `Hoa\Core`.
-rw-r--r--Bin/Status.php10
-rw-r--r--Bin/Stop.php9
-rw-r--r--Documentation/En/Index.xyl6
-rw-r--r--Documentation/Fr/Index.xyl6
-rw-r--r--composer.json1
5 files changed, 13 insertions, 19 deletions
diff --git a/Bin/Status.php b/Bin/Status.php
index 5cb372a..949e2dc 100644
--- a/Bin/Status.php
+++ b/Bin/Status.php
@@ -37,7 +37,7 @@
namespace Hoa\Worker\Bin;
use Hoa\Console;
-use Hoa\Core;
+use Hoa\Protocol;
use Hoa\Worker;
/**
@@ -92,10 +92,10 @@ class Status extends Console\Dispatcher\Kit
}
}
- $run = resolve($run);
- Core::getInstance()->initialize([
- 'protocol.Data/Variable/Run' => "\r" . $run . DS
- ]);
+ $run = resolve($run);
+ $protocol = Protocol::getInstance();
+ $protocol['Data']['Variable']['Run']->setReach("\r" . $run . DS);
+
$outi = [['ID', 'PID', 'Socket', 'Uptime', 'Messages', 'Last']];
$outm = [];
$now = new \DateTime();
diff --git a/Bin/Stop.php b/Bin/Stop.php
index 6c13ba7..f283b4f 100644
--- a/Bin/Stop.php
+++ b/Bin/Stop.php
@@ -37,7 +37,7 @@
namespace Hoa\Worker\Bin;
use Hoa\Console;
-use Hoa\Core;
+use Hoa\Protocol;
use Hoa\Worker;
/**
@@ -96,11 +96,10 @@ class Stop extends Console\Dispatcher\Kit
return $this->usage();
}
+ $run = resolve($run);
+ $protocol = Protocol::getInstance();
+ $protocol['Data']['Variable']['Run']->setReach("\r" . $run . DS);
- $run = resolve($run);
- Core::getInstance()->initialize([
- 'protocol.Data/Variable/Run' => "\r" . $run . DS
- ]);
$password = $this->readPassword('Password: ');
$sw = new Worker\Backend\Shared($workerId, $password);
$sw->stop();
diff --git a/Documentation/En/Index.xyl b/Documentation/En/Index.xyl
index 45e8592..4747854 100644
--- a/Documentation/En/Index.xyl
+++ b/Documentation/En/Index.xyl
@@ -79,10 +79,8 @@ $worker->run();</code></pre>
<code>hoa://Data/Variable/Run/<em>workerId</em>.wid</code> files. Pay attention
to verify that this path is well defined, for example by choosing the folder
<code>/path/to/wid/directory</code>:</p>
- <pre><code class="language-php">Hoa\Core\Core::getInstance()->setProtocol(
- 'hoa://Data/Variable/Run',
- '/path/to/wid/directory'
-);
+ <pre><code class="language-php">$protocol = Hoa\Protocol\Protocol::getInstance();
+$protocol['Data']['Variable']['Run']->setReach("\r" . '/path/to/wid/directory);
var_dump(resolve('hoa://Data/Variable/Run'));
/**
diff --git a/Documentation/Fr/Index.xyl b/Documentation/Fr/Index.xyl
index bbfc85f..dc6ab9a 100644
--- a/Documentation/Fr/Index.xyl
+++ b/Documentation/Fr/Index.xyl
@@ -89,10 +89,8 @@ $worker->run();</code></pre>
<code>hoa://Data/Variable/Run/<em>workerId</em>.wid</code>. Attention à
vérifier que ce chemin est bien défini, par exemple en choisissant le dossier
<code>/path/to/wid/directory</code> :</p>
- <pre><code class="language-php">Hoa\Core\Core::getInstance()->setProtocol(
- 'hoa://Data/Variable/Run',
- '/path/to/wid/directory'
-);
+ <pre><code class="language-php">$protocol = Hoa\Protocol\Protocol::getInstance();
+$protocol['Data']['Variable']['Run']->setReach("\r" . '/path/to/wid/directory);
var_dump(resolve('hoa://Data/Variable/Run'));
/**
diff --git a/composer.json b/composer.json
index 4c420d8..7e822f1 100644
--- a/composer.json
+++ b/composer.json
@@ -22,7 +22,6 @@
},
"require": {
"hoa/consistency": "~0.0",
- "hoa/core" : "~2.0",
"hoa/event" : "~0.0",
"hoa/exception" : "~0.0",
"hoa/fastcgi" : "~2.0",