Browse files

Merge branch 'master' of github.com:tenderlove/phuby

* 'master' of github.com:tenderlove/phuby:
  clean up and fixes
  Fixed instructions
  • Loading branch information...
2 parents 73a5739 + 334bb3d commit 7052fc8fedf3ecce2f8dffd5577dacf6f203040f @tenderlove committed Oct 26, 2009
Showing with 21 additions and 13 deletions.
  1. +12 −4 README.rdoc
  2. +1 −4 bin/phuby_server
  3. +8 −5 ext/phuby/extconf.rb
View
16 README.rdoc
@@ -30,22 +30,30 @@ Phuby wraps PHP in a loving embrace. Exposes a PHP runtime in ruby
The following instructions apply to OS X (probably not needed on linux):
+DO NOT change the prefix... No, I don't know why yet.
+
+=== Install iconv with macports
+
+ $ sudo port install iconv
+
=== Install MySQL with macports
$ sudo port install mysql5 mysql5-server
Set some symbolic links:
- $ sudo ln -s /opt/local/include/mysql5/mysql /opt/local/include/mysql
- $ sudo ln -s /opt/local/lib/mysql5/mysql/libmysqlclient.15.dylib \
- /opt/local/lib/libmysqlclient.dylib
+ $ cd /opt/local
+ $ sudo ln -s mysql5/mysql include/mysql
+ $ sudo ln -s mysql5/mysql/libmysqlclient.15.dylib lib/libmysqlclient.dylib
=== Patch and configure php
If you're on OS X, apply php.patch to the downloaded php. Then configure
php with the proper flags. These paths are for OS X, but you should be able
to adjust them for linux:
+ $ patch -p0 < ../path/to/php.patch
+
$ ./configure --enable-debug \
--enable-embed \
--disable-cli \
@@ -66,7 +74,7 @@ Then, either install the gem, or rake test
(The MIT License)
-Copyright (c) 2009 FIX
+Copyright (c) Aaron Patterson and Ryan Davis of Seattle.rb
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
5 bin/phuby_server 100644 → 100755
@@ -4,10 +4,7 @@ require 'rubygems'
require 'phuby'
require 'webrick'
-s = WEBrick::HTTPServer.new(
- :Port => 10101,
- :DocumentRoot => ARGV[0]
-)
+s = WEBrick::HTTPServer.new(:Port => 10101, :DocumentRoot => ARGV[0])
s.mount('/', Phuby::PHPHandler)
View
13 ext/phuby/extconf.rb
@@ -4,18 +4,21 @@
require 'mkmf'
-php_inc, php_lib = dir_config('php5', '/usr/local/include', '/usr/local/lib')
+config = Dir["/{usr,opt}/local/bin/php-config"]
+prefix = `#{config} --prefix`.chomp
-$INCFLAGS = "-I#{File.join(php_inc, 'php')}".quote + " #{$INCFLAGS}"
+php_inc, php_lib = dir_config("php5", "#{prefix}/include", "#{prefix}/lib")
+
+$INCFLAGS = "-I#{File.join(php_inc, "php").quote} #{$INCFLAGS}"
%w{ Zend TSRM main }.each do |dir|
- $INCFLAGS = "-I#{File.join(php_inc, 'php', dir)}".quote + " #{$INCFLAGS}"
+ $INCFLAGS = "-I#{File.join(php_inc, "php", dir).quote} #{$INCFLAGS}"
end
-unless find_library('php5', 'php_embed_init', php_lib)
+unless find_library("php5", "php_embed_init", php_lib)
abort "php is missing!"
end
-create_makefile('phuby/phuby')
+create_makefile("phuby/phuby")
# :startdoc:

0 comments on commit 7052fc8

Please sign in to comment.