Coder Social home page Coder Social logo

lucasvllima / zsh-valet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nasirnobin/zsh-valet

0.0 0.0 0.0 20 KB

This zsh plugin will read `.valetphprc` from the project root and will switch to that PHP version automatically real time

License: MIT License

Shell 100.00%

zsh-valet's Introduction

ZSH Valet

This zsh plugin will read from the project root and will switch to that PHP version automatically real time. So php artisan & composer commands will always run on the project's PHP version when you are using Valet's site isolation feature!

Here's a quick video demonstration
CleanShot.2022-03-15.at.13.32.49.mp4

Install (oh-my-zsh)

  1. Clone this repository in oh-my-zsh's plugins directory:
git clone https://github.com/NasirNobin/zsh-valet ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-valet
  1. Activate the plugin in ~/.zshrc:
plugins=( [plugins...] zsh-valet)

3. Optionally, You can define a default PHP version on your `.zshrc`. This will be used to reset PHP Binary when you exit a project directory. (Make sure to put before the `plugins=( [plugins...] zsh-valet)` block)
```bash
[email protected]
  1. Restart zsh (such as by opening a new instance of your terminal emulator). Now when you cd into your project directory. It should automatically swap to .valetphprc defined PHP binary for that session.

Install (non oh-my-zsh)

Simply clone this repository and source the script:

git clone https://github.com/NasirNobin/zsh-valet
echo "source ${(q-)PWD}/zsh-valet/zsh-valet.plugin.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

Show PHP Version Output

If you want to show the PHP version change add this to your ~/.zshrc.

export VALETPHPRC_SHOW_PHP_VERSION_CHANGE=1

Recommended PHP installation method

If for some reason this plugin doesn't work with your environment. We recommend you uninstall your PHP versions and reinstall with the following method.

brew tap shivammathur/php


# install your required php versions
brew install shivammathur/php/[email protected]
brew install shivammathur/php/[email protected]
brew install shivammathur/php/[email protected]
brew install shivammathur/php/[email protected]
brew install shivammathur/php/[email protected]
brew install shivammathur/php/[email protected]
brew install shivammathur/php/[email protected]

Beta Testing

This is still very early version of this plugin. If you see any issues, please open an issue on this repository. Also this seems to work fine on my M1 Mac, I still haven't tested it on Intel Mac (i think homebrew stores the php binary in a different directory on Intel Mac, so it might not work there yet)

zsh-valet's People

Contributors

nasirnobin avatar

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.