Git Product home page Git Product logo

Comments (9)

DavertMik avatar DavertMik commented on August 21, 2024

Oh... I closed referenced task before I implemented Timer :)

from robo.

boedah avatar boedah commented on August 21, 2024

Timer also does not need to be a trait actually.

You could simply use https://packagist.org/packages/phpunit/PHP-timer for example.

from robo.

DavertMik avatar DavertMik commented on August 21, 2024

I like traits a bit more than static calls.

from robo.

DavertMik avatar DavertMik commented on August 21, 2024

@boedah oh, why do you need ExecOne + Stack?

Stack is about running multiple commands one by one, ExecOne - to run exactly one command.
Actually I didn't think of combining them together...

from robo.

DavertMik avatar DavertMik commented on August 21, 2024

I think you still won't have a chance to include one into another because you still get conflicitng properties in this case :(


arg and option will append arguments to exact one command.
while Stack will ask for a set of different commands. Not sure how they are expected to run with same arguments. In your case you might think to define your own *Stack class.

from robo.

DavertMik avatar DavertMik commented on August 21, 2024

Btw, check latest update, I have removed some redundant methods from CommandStack

from robo.

boedah avatar boedah commented on August 21, 2024

Reason behind wanting to use both is: for Drush you can set global arguments which must not be set for each command (e.g. the drupal root directory and the site alias).

E.g.

$command = $this->taskDrushStack()
    ->drupalRootDirectory('/var/www/html/app')
    ->siteAlias('@qa')
    ->exec('command-1')
    ->exec('command-2')
    ->getCommand();

results in

drush @qa command-1 -y -r /var/www/html/app && drush @qa command-2 -y -r /var/www/html/app

I will make a PR with a suggestion to be able to do this.

from robo.

DavertMik avatar DavertMik commented on August 21, 2024

Thanks for explaining. I like your PR.

from robo.

boedah avatar boedah commented on August 21, 2024

I like traits a bit more than static calls.

But you can be in depencency hell...
A static Timer class can simply be used by any class who wants to use it...
Additionally, using e.g. PHP-timer would mean a little less NIH ;)

from robo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.