Created
July 25, 2012 09:23
-
-
Save bluestrike2/3175261 to your computer and use it in GitHub Desktop.
Statamic via pow.cx & rack-legacy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rack-legacy' | |
require 'rack-rewrite' | |
use Rack::Rewrite do | |
send_file %r{([^\?]+)}, Dir.getwd + '$1', :if => Proc.new { |env| | |
path = File.expand_path(Dir.getwd + env['PATH_INFO']) | |
File.file?(path) | |
} | |
rewrite %r{([^\?]+)(\?(.*))?}, 'index.php/$1' | |
end | |
use Rack::Legacy::Php, 'public' | |
use Rack::Legacy::Cgi, 'public' | |
run Rack::File.new 'public' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rack-legacy' | |
gem 'rack-rewrite' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, I realized that earlier today (well, yesterday). Got swamped with other work (d'oh!) and haven't had a chance to loop back around and figure it out. If I recall, it was an
ENOTDIR
so I'm assuming rack is looking for anadmin.php
directory and getting cranky when it doesn't find one, ignoring the php file itself. I'll need to double check.At some point today when I'm not rushing to finish some work, I'll take a peek and see if I can't figure out a better solution. Sorry for getting your hopes up there!