Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use pyrus locally #35

Closed
dataich opened this issue Jan 10, 2012 · 4 comments
Closed

Cannot use pyrus locally #35

dataich opened this issue Jan 10, 2012 · 4 comments
Assignees
Labels

Comments

@dataich
Copy link

dataich commented Jan 10, 2012

First thanks for php-build developement, I love this.

Well, I read share/php-build/plugins.d/pyrus.sh, and got to know $PREFIX/pyrus is used for pyrus installation directory.
https://github.com/CHH/php-build/blob/4fcd1e7342ff29d661246aeaf49beee41d77c2ba/share/php-build/plugins.d/pyrus.sh#L38

But sometimes we'd like to use pyrus locally like

pyrus my_project/vendor set bin_dir my_project/vendor/bin

Temporarily I edit .phpenv/versions/5.3.8/bin/pyrus like below.

#!/usr/bin/env bash
base_dir_option = "\"/Users/dataich/.phpenv/versions/5.3.8/pyrus\""
 if [ -d $1 ]; then #should consider when pyrus command(ex. set help) is passed
     base_dir_option = ""
 fi

 "/Users/dataich/.phpenv/versions/5.3.8/bin/php" -dphar.readonly=0 "/Users/dataich/.phpenv/versions/5.3.8/bin/pyrus.phar" $base_dir $@

We'd like to use 1st argument flexibly.

@CHH
Copy link
Member

CHH commented Jan 10, 2012

Ok, didn't thought of this, sorry :-/

I'm looking into it ASAP.

@ghost ghost assigned CHH Jan 10, 2012
@CHH
Copy link
Member

CHH commented Jan 10, 2012

I'm now setting up a separate Home directory for Pyrus again, so I do not have to set the repository by using the first argument.

Could you please try the latest HEAD of php-build?

@dataich
Copy link
Author

dataich commented Jan 11, 2012

Thank you for your quick reply and fixing, and it works very well!!
Here is how I confirmed.

# show config for global
$ pyrus config-show
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear
System paths:
  php_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/php
  ext_dir => /Users/dataich/.phpenv/versions/5.3.8/lib/php/extensions/no-debug-non-zts-20090626
  cfg_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/cfg
  doc_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/docs
  bin_dir => /Users/dataich/.phpenv/versions/5.3.8/bin/
  data_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/data
  www_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/www
  test_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/tests
  src_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/src
  php_bin => /Users/dataich/.phpenv/versions/5.3.8/bin/php
  php_ini => /Users/dataich/.phpenv/versions/5.3.8/etc/php.ini
  php_prefix => /Users/dataich/.phpenv/versions/5.3.8/bin/
  php_suffix =>
# create test directory
$ mkdir -p test/vendor/bin
$ cd test/
# set bin_dir for vendor directory
$ pyrus vendor/ set bin_dir vendor/bin/
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /Users/dataich/test/vendor
Setting bin_dir in system paths
# show config for vendor directory
$ pyrus vendor/ config-show
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /Users/dataich/test/vendor
System paths:
  php_dir => /Users/dataich/test/vendor/php
  ext_dir => /Users/dataich/.phpenv/versions/5.3.8/lib/php/extensions/no-debug-non-zts-20090626
  cfg_dir => /Users/dataich/test/vendor/cfg
  doc_dir => /Users/dataich/test/vendor/docs
  bin_dir => vendor/bin/
  data_dir => /Users/dataich/test/vendor/data
  www_dir => /Users/dataich/test/vendor/www
  test_dir => /Users/dataich/test/vendor/tests
  src_dir => /Users/dataich/test/vendor/src
  php_bin => /Users/dataich/.phpenv/versions/5.3.8/bin/php
  php_ini => /Users/dataich/.phpenv/versions/5.3.8/etc/php.ini
  php_prefix => 
  php_suffix => 
# again show config for global
$ pyrus config-show
Pyrus version 2.0.0a3 SHA-1: BE7EA9D171AE3873F1BBAF692EEE9165BB14BD5D
Using PEAR installation found at /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear
System paths:
  php_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/php
  ext_dir => /Users/dataich/.phpenv/versions/5.3.8/lib/php/extensions/no-debug-non-zts-20090626
  cfg_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/cfg
  doc_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/docs
  bin_dir => /Users/dataich/.phpenv/versions/5.3.8/bin/
  data_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/data
  www_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/www
  test_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/tests
  src_dir => /Users/dataich/.phpenv/versions/5.3.8/share/pyrus/.pear/src
  php_bin => /Users/dataich/.phpenv/versions/5.3.8/bin/php
  php_ini => /Users/dataich/.phpenv/versions/5.3.8/etc/php.ini
  php_prefix => /Users/dataich/.phpenv/versions/5.3.8/bin/
  php_suffix => 

@CHH
Copy link
Member

CHH commented Jan 11, 2012

Fine, no problem :-)

@CHH CHH closed this as completed Jan 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants