Giter Site home page Giter Site logo

Comments (4)

roborourke avatar roborourke commented on May 31, 2024 1

I think this is at least worth documenting along with the basics of how to make a command. Depends on your answer regarding the use case as to whether this is something we should explicitly enable / set up in the docker image. That would require installing composer on the image too.

from altis-local-server.

ntwb avatar ntwb commented on May 31, 2024 1

Thanks for the detailed reply, it was most definitely number 3 from the list, I simply wanted to test a wp-cli package on my local setup.

I'll test that by composer require'ing it

from altis-local-server.

roborourke avatar roborourke commented on May 31, 2024 1

Are you happy for me to close this issue in favour of one like "Document installing & creating WP CLI packages" or similar? I think a guide probably makes sense for that.

If you feel like the wp package command should be supported we can look into that but it's a bit tricky as we use the same php container for local server as we do on production.

We could at least intercept it and indicate it's unsupported thinking about it.

from altis-local-server.

roborourke avatar roborourke commented on May 31, 2024

#112 might help with this, however I think it depends on how you're intending to use the package, for instance:

  1. is it providing tooling you'll need on Vantage / sandbox server?
  2. is it providing tooling others working on the project need?
  3. is it just for your own purposes?

If the answer is 3 then supporting packages installed this way makes sense because they won't be supported or available in production. If the answer is 1 or 2 however then installing packages via WP CLI is the wrong approach.


Going from the commands cookbook here all command packages must autoload their main file.

The autoloading does introduce a potential issue, take this usergen package for instance. It doesn't check if the WP_CLI class exists and will cause things like phpunit or anything run from vendor/bin to break. Good quality packages such this dotenv one however do check for this and are safe to install.

Provided the required package checks for the existence of WP_CLI there's generally no need to explicitly install and load packages using WP CLI via the wp package commands, the same packages can be required by composer directly using composer require aaemnnosttv/wp-cli-dotenv-command for example. If the package is not safe to autoload the recommendation is to make a PR or raise an issue with the maintainer, or failing that to fork the package until the problem is resolved.

You can find most packages published to packagist here (some won't have the type property set to wp-cli-package as it's not a hard requirement). If the package only exists as a github repo or similar you'll have to add it to the repositories section of your composer.json as you would for any other unpublished package.

from altis-local-server.

Related Issues (20)

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.