Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'change_namespace' into nginx_change_namespace
Browse files Browse the repository at this point in the history
Conflicts:

	.gitignore
	Rakefile
	bin/passenger-install-apache2-module
	lib/passenger/templates/apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb
	lib/passenger/templates/apache2/config_snippets.txt.erb
	lib/passenger/templates/apache2/no_write_permission_to_passenger_root.txt.erb
	lib/passenger/templates/apache2_config_snippets.txt.erb
	lib/passenger/templates/apache_must_be_compiled_with_compatible_mpm.txt.erb
	lib/passenger/templates/deployment_example.txt.erb
	lib/passenger/templates/nginx/deployment_example.txt.erb
	lib/passenger/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb
	lib/passenger/templates/nginx/run_installer_as_root.txt.erb
	lib/passenger/templates/nginx/welcome.txt.erb
	lib/passenger/templates/no_write_permission_to_passenger_root.txt.erb
	lib/passenger/templates/possible_solutions_for_compilation_and_installation_problems.txt.erb
	lib/passenger/templates/run_installer_as_root.txt.erb
	lib/passenger/templates/welcome.txt.erb
	lib/phusion_passenger/templates/apache2_config_snippets.txt.erb
	lib/phusion_passenger/templates/apache_must_be_compiled_with_compatible_mpm.txt.erb
	lib/phusion_passenger/templates/deployment_example.txt.erb
	lib/phusion_passenger/templates/no_write_permission_to_passenger_root.txt.erb
	lib/phusion_passenger/templates/possible_solutions_for_compilation_and_installation_problems.txt.erb
	lib/phusion_passenger/templates/run_installer_as_root.txt.erb
	lib/phusion_passenger/templates/welcome.txt.erb
  • Loading branch information
FooBarWidget committed Feb 3, 2009
2 parents 0a98b7f + 71d1513 commit 9e19941
Show file tree
Hide file tree
Showing 84 changed files with 224 additions and 255 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -13,7 +13,8 @@ ext/apache2/*.slo
ext/apache2/.libs
ext/apache2/ApplicationPoolServerExecutable
ext/nginx/HelperServer
ext/passenger/Makefile
ext/phusion_passenger/Makefile
ext/*.a
doc/rdoc
doc/cxxapi
doc/*.html
Expand Down
12 changes: 9 additions & 3 deletions DEVELOPERS.TXT
Expand Up @@ -27,9 +27,9 @@ Run the following command to compile everything:
== Directory structure

The most important directories are:
[ lib/passenger ]
[ lib/phusion_passenger ]
The source code for the spawn server, which is written in Ruby.
[ ext/passenger ]
[ ext/phusion_passenger ]
Native extensions for Ruby, used by the spawn server.
[ ext/apache2 ]
The Phusion Passenger Apache 2 module (mod_passenger).
Expand All @@ -48,7 +48,13 @@ Less important directories:
[ lib/rake ]
Rake tasks.
[ ext/boost ]
A vendor copy of the Boost C++ library (www.boost.org).
A stripped-down and customized version of the Boost C++ library
(www.boost.org).
[ ext/oxt ]
The "OS eXtensions for boosT" library, which provides various important
functionality necessary for writing robust server software. It provides
things like support for interruptable system calls and portable backtraces
for C++. Boost was modified to make use of the functionality provided by OXT.
[ benchmark ]
Benchmark tools.
[ misc ]
Expand Down
48 changes: 28 additions & 20 deletions Rakefile
Expand Up @@ -23,8 +23,8 @@ require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rake/extensions'
require 'rake/cplusplus'
require 'passenger/platform_info'
require 'passenger/version'
require 'phusion_passenger/platform_info'
require 'phusion_passenger/version'

verbose true

Expand Down Expand Up @@ -68,7 +68,7 @@ task :clobber

##### Ruby C extension

subdir 'ext/passenger' do
subdir 'ext/phusion_passenger' do
task :native_support => ["native_support.#{LIBEXT}"]

file 'Makefile' => 'extconf.rb' do
Expand Down Expand Up @@ -580,7 +580,10 @@ Rake::RDocTask.new(:clobber_rdoc => "rdoc:clobber", :rerdoc => "rdoc:force") do
rd.main = "README"
rd.rdoc_dir = "doc/rdoc"
rd.rdoc_files.include("README", "DEVELOPERS.TXT",
"lib/passenger/*.rb", "lib/rake/extensions.rb", "ext/passenger/*.c")
"lib/phusion_passenger/*.rb",
"lib/phusion_passenger/*/*.rb",
"lib/rake/extensions.rb",
"ext/phusion_passenger/*.c")
rd.template = "./doc/template/horo"
rd.title = "Passenger Ruby API"
rd.options << "-S" << "-N" << "-p" << "-H"
Expand All @@ -599,10 +602,10 @@ spec = Gem::Specification.new do |s|
s.author = "Phusion - http://www.phusion.nl/"
s.email = "info@phusion.nl"
s.requirements << "fastthread" << "Apache 2 with development headers"
s.require_path = ["lib", "ext"]
s.require_paths = ["lib", "ext"]
s.add_dependency 'rake', '>= 0.8.1'
s.add_dependency 'fastthread', '>= 1.0.1'
s.extensions << 'ext/passenger/extconf.rb'
s.extensions << 'ext/phusion_passenger/extconf.rb'
s.files = FileList[
'Rakefile',
'README',
Expand All @@ -612,9 +615,9 @@ spec = Gem::Specification.new do |s|
'NEWS',
'lib/**/*.rb',
'lib/**/*.py',
'lib/passenger/templates/*',
'lib/passenger/templates/apache2/*',
'lib/passenger/templates/nginx/*',
'lib/phusion_passenger/templates/*',
'lib/phusion_passenger/templates/apache2/*',
'lib/phusion_passenger/templates/nginx/*',
'bin/*',
'doc/*',

Expand All @@ -640,7 +643,7 @@ spec = Gem::Specification.new do |s|
'ext/oxt/*.hpp',
'ext/oxt/*.cpp',
'ext/oxt/detail/*.hpp',
'ext/passenger/*.{c,rb}',
'ext/phusion_passenger/*.{c,rb}',
'benchmark/*.{cpp,rb}',
'misc/*',
'vendor/**/*',
Expand Down Expand Up @@ -704,20 +707,20 @@ task :fakeroot => [:apache2, :native_support, :doc] do
libdir = "#{fakeroot}/usr/lib/ruby/#{CONFIG['ruby_version']}"
extdir = "#{libdir}/#{CONFIG['arch']}"
bindir = "#{fakeroot}/usr/bin"
docdir = "#{fakeroot}/usr/share/doc/passenger"
libexecdir = "#{fakeroot}/usr/lib/passenger"
docdir = "#{fakeroot}/usr/share/doc/phusion_passenger"
libexecdir = "#{fakeroot}/usr/lib/phusion_passenger"

sh "rm -rf #{fakeroot}"
sh "mkdir -p #{fakeroot}"

sh "mkdir -p #{libdir}"
sh "cp -R lib/passenger #{libdir}/"
sh "cp -R lib/phusion_passenger #{libdir}/"

sh "mkdir -p #{fakeroot}/etc"
sh "echo -n '#{PACKAGE_VERSION}' > #{fakeroot}/etc/passenger_version.txt"

sh "mkdir -p #{extdir}/passenger"
sh "cp -R ext/passenger/*.#{LIBEXT} #{extdir}/passenger/"
sh "mkdir -p #{extdir}/phusion_passenger"
sh "cp -R ext/phusion_passenger/*.#{LIBEXT} #{extdir}/phusion_passenger/"

sh "mkdir -p #{bindir}"
sh "cp bin/* #{bindir}/"
Expand All @@ -742,9 +745,14 @@ task 'package:debian' => :fakeroot do
end

fakeroot = "pkg/fakeroot"
arch = `uname -m`.strip
if arch =~ /^i.86$/
arch = "i386"
raw_arch = `uname -m`.strip
arch = case raw_arch
when /^i\.86$/
"i386"
when /^x86_64/
"amd64"
else
raw_arch
end

sh "sed -i 's/Version: .*/Version: #{PACKAGE_VERSION}/' debian/control"
Expand Down Expand Up @@ -772,12 +780,12 @@ task :sloccount do
end
sh "sloccount", *Dir[
"#{tmpdir}/*",
"lib/passenger/*",
"lib/phusion_passenger/*",
"lib/rake/{cplusplus,extensions}.rb",
"ext/apache2",
"ext/nginx",
"ext/oxt",
"ext/passenger/*.c",
"ext/phusion_passenger/*.c",
"test/**/*.{cpp,rb}",
"benchmark/*.{cpp,rb}"
]
Expand Down
2 changes: 1 addition & 1 deletion benchmark/dispatcher.rb
Expand Up @@ -24,7 +24,7 @@ def start(iterations)
milestone = 1 if milestone == 0
result = Benchmark.measure do
iterations.times do |i|
cgi = Passenger::Railz::CGIFixed.new(headers, output, output)
cgi = PhusionPassenger::Railz::CGIFixed.new(headers, output, output)
::Dispatcher.dispatch(cgi,
::ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS,
cgi.stdoutput)
Expand Down
10 changes: 5 additions & 5 deletions bin/passenger-install-apache2-module
Expand Up @@ -28,13 +28,13 @@ $LOAD_PATH.unshift("#{PASSENGER_ROOT}/ext")
ENV["PATH"] += ":/usr/sbin:/sbin:/usr/local/sbin"

require 'optparse'
require 'passenger/platform_info'
require 'passenger/dependencies'
require 'passenger/abstract_installer'
require 'phusion_passenger/platform_info'
require 'phusion_passenger/dependencies'
require 'phusion_passenger/abstract_installer'
include PlatformInfo

class Installer < Passenger::AbstractInstaller
include Passenger
class Installer < PhusionPassenger::AbstractInstaller
include PhusionPassenger

def dependencies
result = [
Expand Down
2 changes: 1 addition & 1 deletion bin/passenger-memory-stats
Expand Up @@ -18,7 +18,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib")
require 'passenger/platform_info'
require 'phusion_passenger/platform_info'

# ANSI color codes
RESET = "\e[0m"
Expand Down
8 changes: 4 additions & 4 deletions bin/passenger-spawn-server
Expand Up @@ -41,13 +41,13 @@ begin
exit
end

require 'passenger/spawn_manager'
spawn_manager = Passenger::SpawnManager.new
require 'phusion_passenger/spawn_manager'
spawn_manager = PhusionPassenger::SpawnManager.new
spawn_manager.start_synchronously(input)
spawn_manager.cleanup
rescue => e
require 'passenger/utils'
include Passenger::Utils
require 'phusion_passenger/utils'
include PhusionPassenger::Utils
print_exception("spawn manager", e)
exit 10
end
4 changes: 2 additions & 2 deletions bin/passenger-status
Expand Up @@ -19,9 +19,9 @@

$LOAD_PATH << File.expand_path(File.dirname(__FILE__) + "/../lib")
$LOAD_PATH << File.expand_path(File.dirname(__FILE__) + "/../ext")
require 'passenger/admin_tools/control_process'
require 'phusion_passenger/admin_tools/control_process'

include Passenger::AdminTools
include PhusionPassenger::AdminTools

# ANSI color codes
RESET = "\e[0m"
Expand Down
10 changes: 5 additions & 5 deletions bin/passenger-stress-test
Expand Up @@ -23,12 +23,12 @@ require 'rubygems'
require 'optparse'
require 'socket'
require 'thread'
require 'passenger/platform_info'
require 'passenger/message_channel'
require 'passenger/utils'
require 'phusion_passenger/platform_info'
require 'phusion_passenger/message_channel'
require 'phusion_passenger/utils'

include Passenger
include Passenger::Utils
include PhusionPassenger
include PhusionPassenger::Utils
include PlatformInfo

# A thread or a process, depending on the Ruby VM implementation.
Expand Down
File renamed without changes.
Expand Up @@ -268,7 +268,7 @@ Init_native_support() {
struct sockaddr_un addr;

/* */
mPassenger = rb_define_module("Passenger"); // Do not remove the above comment. We want the Passenger module's rdoc to be empty.
mPassenger = rb_define_module("PhusionPassenger"); // Do not remove the above comment. We want the Passenger module's rdoc to be empty.

/*
* Utility functions for accessing system functionality.
Expand Down
File renamed without changes.
Expand Up @@ -18,9 +18,9 @@

require 'socket'
require 'fcntl'
require 'passenger/message_channel'
require 'passenger/utils'
module Passenger
require 'phusion_passenger/message_channel'
require 'phusion_passenger/utils'
module PhusionPassenger

# The request handler is the layer which connects Apache with the underlying application's
# request dispatcher (i.e. either Rails's Dispatcher class or Rack).
Expand Down Expand Up @@ -169,13 +169,6 @@ def main_loop_running?

# Enter the request handler's main loop.
def main_loop
if defined?(::Passenger::AbstractRequestHandler)
# Some applications have a model named 'Passenger'.
# So we temporarily remove it from the global namespace
# and restore it later.
phusion_passenger_namespace = ::Passenger
Object.send(:remove_const, :Passenger)
end
reset_signal_handlers
begin
@graceful_termination_pipe = IO.pipe
Expand Down Expand Up @@ -226,10 +219,6 @@ def main_loop
@graceful_termination_pipe[0].close rescue nil
@graceful_termination_pipe[1].close rescue nil
revert_signal_handlers
if phusion_passenger_namespace
Object.send(:remove_const, :Passenger) rescue nil
Object.const_set(:Passenger, phusion_passenger_namespace)
end
@main_loop_thread_lock.synchronize do
@main_loop_running = false
@main_loop_thread_cond.broadcast
Expand Down Expand Up @@ -446,4 +435,4 @@ def self.determine_passenger_header
PASSENGER_HEADER = determine_passenger_header
end

end # module Passenger
end # module PhusionPassenger
Expand Up @@ -19,9 +19,9 @@
require 'socket'
require 'set'
require 'timeout'
require 'passenger/message_channel'
require 'passenger/utils'
module Passenger
require 'phusion_passenger/message_channel'
require 'phusion_passenger/utils'
module PhusionPassenger

# An abstract base class for a server, with the following properties:
#
Expand All @@ -42,7 +42,7 @@ module Passenger
#
# Here's an example on using AbstractServer:
#
# class MyServer < Passenger::AbstractServer
# class MyServer < PhusionPassenger::AbstractServer
# def initialize
# super()
# define_message_handler(:hello, :handle_hello)
Expand Down Expand Up @@ -346,4 +346,4 @@ def main_loop
end
end

end # module Passenger
end # module PhusionPassenger
Expand Up @@ -16,9 +16,9 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

require 'passenger/utils'
require 'phusion_passenger/utils'

module Passenger
module PhusionPassenger

# This class maintains a collection of AbstractServer objects. One can add new
# AbstractServer objects, or look up existing ones via a key.
Expand Down Expand Up @@ -298,4 +298,4 @@ def eligable_for_cleanup?(server)
end
end

end # module Passenger
end # module PhusionPassenger
@@ -1,4 +1,4 @@
module Passenger
module PhusionPassenger

module AdminTools
def self.tmpdir
Expand All @@ -22,4 +22,4 @@ def self.process_is_alive?(pid)
end
end # module AdminTools

end # module Passenger
end # module PhusionPassenger
@@ -1,9 +1,9 @@
require 'rexml/document'
require 'fileutils'
require 'passenger/admin_tools'
require 'passenger/message_channel'
require 'phusion_passenger/admin_tools'
require 'phusion_passenger/message_channel'

module Passenger
module PhusionPassenger
module AdminTools

class ControlProcess
Expand Down Expand Up @@ -104,4 +104,4 @@ def reload
end

end # module AdminTools
end # module Passenger
end # module PhusionPassenger
Expand Up @@ -17,8 +17,8 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

require 'rubygems'
require 'passenger/exceptions'
module Passenger
require 'phusion_passenger/exceptions'
module PhusionPassenger

# Represents a single application instance.
class Application
Expand Down Expand Up @@ -105,4 +105,4 @@ def close
end
end

end # module Passenger
end # module PhusionPassenger

0 comments on commit 9e19941

Please sign in to comment.