DEV Community

Claudio Fior
Claudio Fior

Posted on

1

Tools for creating shell command in PHP

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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (2)

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 • Edited

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay