DEV Community

loading...

Tools for creating shell command in PHP

caiofior profile image Claudio Fior ・1 min read

I had to create a cli tool that reads excels file and push each row data to a web service.

It has to be called once a day using linux crontab.

Usually I create such software (middleware ?) from the scratch in PHP that is already present in the server.

I got many of these custom client applications and I would like to create a more structured application using a framework.

I tried Symfony console and it works, but I'm not happy.

I have 12 Mb of php scripts in vendor folder and 50 Kb of my code: an elephant that produce a mouse.

Moreover the server has php 7.0 so I have to use an old version on the framework (3.4).

When I will upgrade the server (next spring I suppose) I have fear to upgrade the framework to a more recent version (5.1) with a completely different logic.

What shall I do?

Any suggestion for a lightweight framework for a php cli command?

Thank you for your patience.

Discussion

pic
Editor guide
Collapse
vonheikemen profile image
Heiker

You can make your own framework. If you don't have any special need it should not be that hard.

Here is a good series of articles that talk about lightweight cli apps in php.

Collapse
caiofior profile image
Claudio Fior Author

Thank you for your useful suggestion.

The funny thing is that I wrote 24 Kb of code and used 15 Mb as libraries.

Code distribution