Git Product home page Git Product logo

phpake's People

Contributors

jigarius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

phpake's Issues

Only auto-detect Phpakefile in CWD

Requirements

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?

Support a special `$shell` parameter

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');
}

Support for command aliases

Requirements

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.

Allow users to include Phpakefile

Requirements

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.

Force Phpake tasks to be in a namespace?

Requirements

  • Currently, Phpake tasks are defined in the global namespace, which might make some people sad.

Proposed solution

  • Provision for a special namespace, Phpake\Task or simply Phpake?
  • All Phpake tasks must be defined in this namespace - this will also simplify task discovery.

Include command alias `fake`

Motivation

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.

Support for namespaced functions/commands

Requirements

  • If a function is declared in a namespace, it should be detected and called back correctly.
    • e.g. foobar\hello_world() should create a command foobar:hello-world

Allow @usage annotations that start with "phpake"

Requirements

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.

Proposed solution

Remove initial phpake while registering the command with the app.

Publish to Packagist.org

Requirements

  • PHPake should be installable with composer require jigarius/phpake
  • Set up auto-update for the package on packagist.org

Support for interactive shell commands

Requirements

  • I've used Makefile for doing things like docker compose exec main sh
  • This doesn't work with the Phpakefile ๐Ÿ˜ž Gotta find a way to make it work

Support tasks with parameters

Requirements

  • function task($fname, $lname = NULL)
    • $lname is treated as an optional argument.
  • An argument named $input gets the Symfony Console $input variable
  • An argument named $output gets the Symfony Console $output variable
    • This makes it easier to print stuff in a fancy way.
  • An argument named $command gets the name of the command.
    • e.g. function hello_world() becomes the command hello-world.

Use PHP 8.1 or higher

  • Primarily, use PHP 8.1 for development
  • Have compatibility with PHP 8.0
    • Run automated tests against PHP 8.0

Support tasks with no parameters

Requirements

  • Callback should be called correctly
  • _ in function name becomes - in command name
  • Function doc block becomes command description

Example

# Phpakefile
/**
  * Short description.
  *
  * Long description.
  */
function hello_world() {}

# Command
phpake hello-world

Add PHP 7 compatibility?

Requirements

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.