Permalink
Browse files

adding more docs

  • Loading branch information...
1 parent 6bb2d6b commit e3e82381fdd4d6e18f1cc3d66b7b7dc113d6b005 @tenderlove committed Aug 6, 2009
Showing with 40 additions and 4 deletions.
  1. +29 −4 README.rdoc
  2. +4 −0 lib/phuby/php_handler.rb
  3. +7 −0 test/test_phuby.rb
View
@@ -27,11 +27,36 @@ Phuby wraps PHP in a loving embrace. Exposes a PHP runtime in ruby
== BUILD INSTRUCTIONS:
* Download php-5.3.0
-* If you're on OS X, apply php.patch to the downloaded php
-* ./configure --enable-debug --enable-embed --disable-cli --prefix=/usr/local
-* make && sudo make install
-* then, back in phuby land: rake test
+The following instructions apply to OS X (probably not needed on linux):
+
+=== 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
+
+=== 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:
+
+ $ ./configure --enable-debug \
+ --enable-embed \
+ --disable-cli \
+ --with-mysql=/opt/local \
+ --with-mysqli=/opt/local/lib/mysql5/bin/mysql_config \
+ --with-mysql-sock=/opt/local/var/run/mysql5/mysqld.sock \
+ --prefix=/usr/local
+
+ $ make && sudo make install
+
+Then, either install the gem, or rake test
== INSTALL:
View
@@ -20,6 +20,8 @@ def write string
end
def send_headers response_code
+ #print "#" * 50
+ #puts response_code
end
end
@@ -45,6 +47,8 @@ def process verb, req, res
Dir.chdir(@root) do
Phuby::Runtime.php do |rt|
+ rt.eval("date_default_timezone_set('America/Los_Angeles');")
+
req.request_uri.query.split('&').each do |pair|
k, v = pair.split '='
rt["_GET"][k] = v
View
@@ -74,4 +74,11 @@ def test_file_handle
}
assert_equal 'world', @rt['hi']
end
+
+ #def test_mysql
+ # @rt['dbhost'] = 'localhost'
+ # @rt['dbuser'] = 'root'
+ # @rt['dbpassword'] = nil
+ # @rt.eval('@mysql_connect($dbhost, $dbuser, $dbpassword, true);')
+ #end
end

0 comments on commit e3e8238

Please sign in to comment.