bin/jacana in jacana-0.1.0 vs bin/jacana in jacana-0.1.1

- old
+ new

@@ -10,10 +10,13 @@ :Doc_Root => './', :Port => 1453, :Php_Path => '/usr/bin/env', } +rewrite = nil + + opt = OptionParser.new opt.on('-d VAL') do |docroot| options[:Doc_Root] = docroot end @@ -24,14 +27,27 @@ opt.on('-s VAL') do |php_path| options[:Php_Path] = php_path.to_s end +opt.on('-c VAL') do |composer| + if composer == "true" + system("curl -sS https://getcomposer.org/installer | php") + system("mv composer.phar /usr/local/bin/composer") + end +end + opt.on('--FRAMEWORK=PATH,NAME,VAL') do |framework| framework = framework.split(",") case framework[2] when 'laravel' + + if ! File.exist?('/usr/local/bin/composer') + system("curl -sS https://getcomposer.org/installer | php") + system("mv composer.phar /usr/local/bin/composer") + end + cd(framework[0], :verbose => false) system("composer create-project laravel/laravel #{framework[1]} --prefer-dist") system("chmod -R 0777 #{framework[0]}/#{framework[1]}") system("clear") puts "Laravel project is created !" @@ -42,9 +58,12 @@ opt.parse! puts "Jagana PHP Handler is Started !" jacana_server = Jacana::JacanaHttpServer.new options + + +jacana_server.a_rewrite /\/(?<url>.*)/, '/index.php' trap 'INT' do jacana_server.shutdown end