bin/jacana in jacana-0.0.7 vs bin/jacana in jacana-0.0.8
- old
+ new
@@ -1,10 +1,12 @@
#!/usr/bin/env ruby
require "jacana"
require "optparse"
+require 'fileutils'
+include FileUtils
options = {
:Doc_Root => './',
:Port => 1453,
:Php_Path => '/usr/bin/env',
@@ -21,13 +23,31 @@
end
opt.on('-s VAL') do |php_path|
options[:Php_Path] = php_path.to_s
end
+
+opt.on('--FRAMEWORK=PATH,NAME,VAL') do |framework|
+ framework = framework.split(",")
+ case framework[2]
+ when 'laravel'
+ cd(framework[0],:verbose => false)
+ system("composer create-project laravel/laravel #{framework[1]} --prefer-dist")
+ chmod_R 0777,"#{framework[0]}/#{framework[1]}"
+ system("clear")
+ puts "Laravel project is created !"
+ options[:Doc_Root] = framework[0] + "/" + framework[1] + "/public"
+ end
+end
+
opt.parse!
+puts "Jagana PHP Handler is Started !"
+
jacana_server = Jacana::JacanaHttpServer.new options
-trap('INT') { jacana_server.shutdown }
+trap 'INT' do
+ jacana_server.shutdown
+end
jacana_server.start