News for hackers. Stuff that matters.
Re:Build command line apps using PHP 7 by carlmr on Sunday September 03, 2017 @03:48PM (#15163447)
Why?
Re:Build command line apps using PHP 7 by veeti on Sunday September 03, 2017 @04:03PM (#15163550)
Why stop there? Forget Electron, build your next desktop application using PHP-GTK!

http://gtk.php.net/index.php

Re:Build command line apps using PHP 7 by jsjohnst on Sunday September 03, 2017 @05:14PM (#15163962)
I've written a handful of apps using PHP-gtk (all written more than ten years ago). I'm sure it's improved since then, but I'd still say it's not worth the effort.
Re:Build command line apps using PHP 7 by grouchoboy on Sunday September 03, 2017 @03:58PM (#15163514)
For the same reason a lot of people says that the use node as backend. Because they must use javascript in the frontend they use it in the backend. If one is using php as a language for a project and that project has related commands and with php your are capable of doing, why not?
Re:Build command line apps using PHP 7 by b101010 on Sunday September 03, 2017 @04:02PM (#15163541)
php-cli scripts normally don't have an execution time limit (or a memory limit?), which makes them ideal for upgrades/database maintenance/cron jobs/etc while being able to reuse code from the application itself

one example: https://docs.moodle.org/22/en/Administration_via_command_lin...

Re:Build command line apps using PHP 7 by korzun on Sunday September 03, 2017 @04:12PM (#15163591)
> php-cli scripts normally don't have an execution time limit (or a memory limit?), which makes them ideal for upgrades/database maintenance/cron jobs/etc while being able to reuse code from the application itself

?

PHP enforces memory limits out of the box by default. What languages have execution limits on CLI?

Re:Build command line apps using PHP 7 by octalmage on Sunday September 03, 2017 @04:40PM (#15163776)
They're probably referring to web hosts. Many hosts have timeouts for the web, but not the cli. So for long running tasks you write cli scripts. In the WordPress world this is easily done using WPCli and eval-file.
Re:Build command line apps using PHP 7 by korzun on Sunday September 03, 2017 @04:06PM (#15163566)
What value are you adding here?

There are plenty of companies that rely on PHP that also have to work with CLI. I believe they are better informed when it comes to making decisions between handling CLI via an entirely different language and sticking to PHP.

Re:Build command line apps using PHP 7 by deckarep on Sunday September 03, 2017 @03:53PM (#15163471)
My thought exactly, but it's always nice to see people push the status quo on what an "acceptable" use of a language should be.
Re:Build command line apps using PHP 7 by slipstream- on Sunday September 03, 2017 @03:57PM (#15163504)
I've written small command line scripts in PHP before (without any helper libraries). Using PHP for such things is nice when interfacing with web services (JSON parsing, SimpleXML, etc).

Perhaps Peachpie, when it reaches production quality, will also help with that, as then calling .NET (and maybe, through that, WinRT) APIs from PHP code will be made easier.

Re:Build command line apps using PHP 7 by qualitytime on Sunday September 03, 2017 @04:06PM (#15163564)
[COW ICON]