diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-02-11 00:29:59 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-02-11 00:29:59 +0400 |
commit | 279a4d6978dd5ddcbb39b4e703bd6fdfb6a170b7 (patch) | |
tree | 103a8bbec1a9c5c5995834649c7778c7e6447cf2 | |
parent | 9cba66f58aa0cd85af5a0277e90c33445095f1bc (diff) |
refs #4610 I moved the Lock class to CliMulti as it does not 100% work on windows and is only used in CliMulti so far. As the Lock class can be quite useful and maybe needed in other use cases it would be nice to have it somewhere under core or so as it is not directly related to CLI. We might have to move it later again. Need to find a better solution for windows
-rw-r--r-- | core/CliMulti.php | 3 | ||||
-rw-r--r-- | core/CliMulti/Lock.php (renamed from core/Lock.php) | 5 | ||||
-rw-r--r-- | core/CliMulti/run.php | 4 | ||||
-rw-r--r-- | tests/PHPUnit/Core/CliMulti/LockTest.php (renamed from tests/PHPUnit/Core/LockTest.php) | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/core/CliMulti.php b/core/CliMulti.php index 55b41fb6c0..d4c08f38b5 100644 --- a/core/CliMulti.php +++ b/core/CliMulti.php @@ -7,12 +7,13 @@ */ namespace Piwik; +use Piwik\CliMulti\Lock; use Piwik\CliMulti\Output; class CliMulti { /** - * @var \Piwik\Lock[] + * @var \Piwik\CliMulti\Lock[] */ private $pids = array(); diff --git a/core/Lock.php b/core/CliMulti/Lock.php index a7efb61c25..49ed13ec61 100644 --- a/core/Lock.php +++ b/core/CliMulti/Lock.php @@ -6,7 +6,10 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -namespace Piwik; +namespace Piwik\CliMulti; + +use Piwik\Filesystem; +use Piwik\SettingsServer; class Lock { diff --git a/core/CliMulti/run.php b/core/CliMulti/run.php index b73b97c2ed..09bd3d4401 100644 --- a/core/CliMulti/run.php +++ b/core/CliMulti/run.php @@ -19,11 +19,11 @@ if (!Piwik\Common::isPhpCliMode()) { include PIWIK_INCLUDE_PATH . '/core/Singleton.php'; include PIWIK_INCLUDE_PATH . '/core/FrontController.php'; include PIWIK_INCLUDE_PATH . '/core/Filesystem.php'; -include PIWIK_INCLUDE_PATH . '/core/Lock.php'; +include PIWIK_INCLUDE_PATH . '/core/CliMulti/Lock.php'; \Piwik\FrontController::assignCliParametersToRequest(); if (!empty($_GET['pid']) && \Piwik\Filesystem::isValidFilename($_GET['pid'])) { - $lock = new \Piwik\Lock($_GET['pid']); + $lock = new \Piwik\CliMulti\Lock($_GET['pid']); $lock->lock(); } diff --git a/tests/PHPUnit/Core/LockTest.php b/tests/PHPUnit/Core/CliMulti/LockTest.php index 4ac80b07e1..d57bd1f5a2 100644 --- a/tests/PHPUnit/Core/LockTest.php +++ b/tests/PHPUnit/Core/CliMulti/LockTest.php @@ -5,7 +5,7 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -use Piwik\Lock; +use Piwik\CliMulti\Lock; /** * Class LockTest |