jigarius / phpake Goto Github PK
View Code? Open in Web Editor NEWA make-like utility built for PHP.
License: GNU General Public License v3.0
A make-like utility built for PHP.
License: GNU General Public License v3.0
Turns out that tools like make
don't simply lookup a Makefile
in parent directories. Need to investigate why they do so and remove that feature from Phpake if required. Alternatively, a confirmation message can be displayed:
A Phpakefile was not found in the current working directory, but one was found in one of the parent directories. Would you like to use that one instead?
Currently, for running shell commands, one has to run proc_open()
, proc_close()
, etc. It'd be great to have a special $shell
variable, which would have a method execute($command)
to easily execute commands.
function shell_example($shell) {
$shell->execute('docker compose exec main sh');
}
Allow Phpake callbacks to declare command aliases using a @alias
annotation. For example,
# Phpakefile
namespace Input_Output;
/**
* Say hello world.
*
* @alias hhum
* @alias helo
*/
function hello_human() {
echo 'Hello human' . PHP_EOL;
}
At the end of all the changes, running phpake input-output:hello-human --help
should show the command alias(es) correctly. Running phpake helo
should work the same way as phpake input-output::hello-human
.
If a user wants to organize their commands into different Phpakefile
, they can include one Phpakefile
from another like:
require('path/to/Phpakefile1')
require('path/to/Phpakefile2')
require('path/to/Phpakefile3')
This should work by default, but need to test it so that it can be called done.
Phpake\Task
or simply Phpake
?Do you find it difficult to type phpake
and want the alias fake
to be included out-of-the-box? If yes, please thumbs up this issue.
phpake -c /path/to/Phpakefile
should work.foobar\hello_world()
should create a command foobar:hello-world
Update the README to explain everything that the tool can do.
Say, a task has the @usage
annotation set to @usage phpake hello-world
. When running phpake hello-world --help
, the usage is documented as:
phpake phpake hello-world
This should not happen.
Remove initial phpake
while registering the command with the app.
Currently, we use @something
annotations to add metadata to the Phpake callbacks. Consider using PHP's in-built attribute support for this purpose.
Reference: Attributes in PHP 8
composer require jigarius/phpake
phpcs
linterphpunit
testsMakefile
for doing things like docker compose exec main sh
Phpakefile
๐ Gotta find a way to make it workfunction task($fname, $lname = NULL)
$lname
is treated as an optional argument.$input
gets the Symfony Console $input
variable$output
gets the Symfony Console $output
variable
$command
gets the name of the command.
function hello_world()
becomes the command hello-world
._
in function name becomes -
in command name# Phpakefile
/**
* Short description.
*
* Long description.
*/
function hello_world() {}
# Command
phpake hello-world
There are several projects that still use PHP 7. More people might use the tool if PHP 7 is supported.
This will mean maintaining 2 versions of the project: 7.x-x.x and 8.x-x.x.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.