-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error installing: composer require henrikbjorn/lurker #459
Comments
Try Note that henrikbjorn/lurker is already in Robo's require-dev section, so you don't need to do this for the Robo project -- only for other projects you make that |
Add the line
in your Depending on what other libraries you are using it might be a good idea to change them to ^majornumber in the requirement to give enough space to find a fitting dependency. |
This still seems to be an issue. If I try to add
|
Answer (to pin to symfony 3) is here - #363 (comment) |
I was too quick to submit. I still get the same error, even with the following composer.json: {
"require": {
"consolidation/robo": "~1",
"symfony/config": "^3.0",
"symfony/event-dispatcher" : "^3.0",
"henrikbjorn/lurker": "^1.2"
}
} |
I haven't been using |
I'm new to the project, so if you'll have some time to provide me for a few pointers for that, it would be great :) If it was a "normal" task I assume I would have need to change Watch to be However, I believe that Also, sorry if my above assumptions are completely wrong :) |
Also, maybe we'd like to completely change the integration to be with another library, so it will support Symfony 4? Edit: for example https://github.com/jasonlewis/resource-watcher |
This alone seems to work: {
"require": {
"consolidation/robo": "~1",
"henrikbjorn/lurker": "1.*"
}
} |
@AronNovak composer install indeed works, but the watch throws the above error once a monitored file is changed. |
@amitaibu Right, I could indeed reproduce that: |
I can't reproduce the error. Using robo in it's own phar file and installed lurker with the procedure above and the watch task works as expected. |
The error occurs when you try to trigger a closure only once a file has changed. For example: <?php
use Lurker\Event\FilesystemEvent;
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
function watch()
{
$cmd = 'ls -al';
$this->taskWatch()
->monitor(
'.',
function($cmd) {
$this->_exec($cmd);
},
FilesystemEvent::ALL
)->run();
}
} |
This is not how the callable is supposed to work. It's an event object: <?php
public function watch(): void
{
$this
->taskWatch()
->monitor(
static::$rootdir . '/src/Boka10/Api/',
function ($event) {
$resource = $event->getResource();
$this->qiPhpstan((string)$resource);
$this->testApi();
},
FilesystemEvent::ALL
)
->monitor(
static::$rootdir . '/tests/',
function ($event) {
$resource = $event->getResource();
$this->qiPhpstan((string)$resource);
$this->testUnit();
$this->testApi();
},
FilesystemEvent::ALL
)
->monitor(
static::$rootdir . '/src/Boka10/',
function ($event) {
$resource = $event->getResource();
$this->qiPhpstan((string)$resource);
$this->testUnit();
},
FilesystemEvent::ALL
)
->run();
} The $event is a symfony event class - I had a bug report open about this some weeks ago, but can't find it. |
Found it: My issue: #845 The symfony docs: https://github.com/symfony/symfony/blob/3.1/src/Symfony/Component/Config/Resource/FileResource.php |
@davidsneighbour Interesting. Does it mean the docs here are wrong? |
So thanks to @davidsneighbour pointer, and #845 (comment), I was able to make it work: <?php
use Lurker\Event\FilesystemEvent;
use Symfony\Component\EventDispatcher\Event;
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
function watch()
{
$this->taskWatch()
->monitor(
'src/elm',
function(Event $event) {
$this->_exec('ls -al');
},
FilesystemEvent::ALL
)->run();
}
} |
No, the docs there say nothing about parameters for the Note: The I was playing around with your sample code and it did not throw errors, but it also did not print anything.
My guess is that either whatever happens inside of the callback function is not available to robo outside itself or that any output from the shell is dropped if "native" robo methods are used. Try using your own task as a response to watch instead of creating a task inside of the callable? In my (working) sample above I retrieve the path to the changed resource and then call my own methods. Thats by the way a reason to open another issue, because this one here was about non-installable composer dependencies ;) |
The Lurker repo seems to be abandoned, but pinned to Symphony 3. This prevents it from being used with the latest Robo pacages. For now the only way to enable support for Symfony 4 seems to fork the repo, enable Symfony 4 support, then override the original with a private named repository. You may see more details on how to do it here: https://github.com/lesichkovm/lurker |
Leaving a small workaround here for all those who are stuck right now and need a working solution immediately: Does a see also #363 |
There is a drop-in replacement package available by now, see flint/Lurker#30 (comment) I'll send a PR to suggest using »totten/lurkerlite« instead of »henrikbjorn/lurker«. |
The watch task requires the package »henrikbjorn/lurker«. The dependencies of this package dont allow using Symfony 4. Last release of this package was 2016-03-16. So its abdandoned. Use the drop-in replacement package totten/lurkerlite instead. Installing this packsge will remove »henrikbjorn/lurker« automatically. Since the package is a designated drop-in replacement all existing methods in robo may stay the same. Closes consolidation#459 consolidation#956 consolidation#973
The watch task requires the package »henrikbjorn/lurker«. The dependencies of this package dont allow using Symfony 4. Last release of this package was 2016-03-16. So its abdandoned. Use the drop-in replacement package totten/lurkerlite instead. Installing this packsge will remove »henrikbjorn/lurker« automatically. Since the package is a designated drop-in replacement all existing methods in robo may stay the same. Closes consolidation#459 consolidation#956 consolidation#973
The watch task requires the package »henrikbjorn/lurker«. The dependencies of this package dont allow using Symfony 4. Last release of this package was 2016-03-16. So its abdandoned. Use the drop-in replacement package totten/lurkerlite instead. Installing this packsge will remove »henrikbjorn/lurker« automatically. Since the package is a designated drop-in replacement all existing methods in robo may stay the same. Closes #459 #956 #973
The watch task requires the package »henrikbjorn/lurker«. The dependencies of this package dont allow using Symfony 4. Last release of this package was 2016-03-16. So its abdandoned. Use the drop-in replacement package totten/lurkerlite instead. Installing this packsge will remove »henrikbjorn/lurker« automatically. Since the package is a designated drop-in replacement all existing methods in robo may stay the same. Closes #459 #956 #973
Hi, I'm installing this composer require henrikbjorn/lurker, but I have this error:
The text was updated successfully, but these errors were encountered: