Hi Andrew.

Am 07.07.16 um 11:47 schrieb Andrew Carter:
> 
> @andreas
> 
>     Having a standardized interface for - for example - the OutputInterface
>     would allow me to use a third-party library to format output in
>     different CLI-tools.
> 
>  
> I'm not sure this is a significant enough programming problem to warrant
> a PSR. I'm trying to think of times when I would ever have wanted to do
> this - but I can only speak for my own experience (which is limited).
Having done several CLI-tools in the last time I was looking for a way
to do exactly that. But also, that's my personal idea but I believe it
would be a good idea to have a standardized interface to be able to use
third-party tools.
> 
>     Or I could use third-party libraries to filter and validate input
>     using a HTTP-like Middleware-approach.
> 
> 
> Interesting, but this isn't a console PSR - this is a separate
> filter/validate middleware PSR.
A PSR for a CLI-Interface in my eyes should includ interfaces for input
and output handling similar to PSR-7. And with such a standardized
interface it would be possible to implement validation/filtering using
middlewares. It would be even more interesting to have ONE interface for
CLI AND HTTP-Middleware, but that's far to complicated in my eyes and
wouldn't justify the effort.

> 
>     That surely can all be achieved using plain PHP-functionality, but
>     having a certain layer of abstraction would make it much easier for
>     me to write the main business-logic without always having to
>     implement all the addon stuff like validating input, howe to format
>     the output, etc.
> 
> 
> Again, I'm not really convinced there is any down side here from
> coupling to say Symfony Console (or an alternative). Composer vendor
> binaries allow you to provide as many executable commands as you like
> from different dependencies.
I was more talking about me implementing a business-logic that others
can implement. And then it would be much easier to have one set of
interfaces to be implemented instead of enabling the busines-logic for
different CLI-providers. Or the user using the logic will have to create
the command by himself and handle invocation of the logic herself.

Personally I'm absolutely in favour of creating a certain
standardization for CLI-tools but there seems to be need to further
define WHAT should be standardized and what not.

I'll try to create a set of interfaces to have something more
substantial to talk about.

Cheers

Andreas
-- 
                                                              ,,,
                                                             (o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl                                                       |
| mailto:andr...@heigl.org                  N 50°22'59.5" E 08°23'58" |
| http://andreas.heigl.org                       http://hei.gl/wiFKy7 |
+---------------------------------------------------------------------+
| http://hei.gl/root-ca                                               |
+---------------------------------------------------------------------+

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/a57df70b-5272-d608-f200-4e0084801673%40heigl.org.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to