public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Get rid of autoloading. It causes too many problems.
Hongli Lai (Phusion) (author)
Sat May 10 07:41:21 -0700 2008
commit  43804b03a2f200cb2d31b46fb7ba3536e951eca6
tree    2b6609ce21924df6c30a3ba50e3756dcff3857f5
parent  98dc49e30ec6d62dc4b1b17589800f7e1d6e14ff
...
17
18
19
 
20
21
22
...
17
18
19
20
21
22
23
0
@@ -17,6 +17,7 @@
0
 
0
 PASSENGER_ROOT = File.expand_path(File.dirname(__FILE__) << "/..")
0
 $LOAD_PATH.unshift("#{PASSENGER_ROOT}/lib")
0
+$LOAD_PATH.unshift("#{PASSENGER_ROOT}/ext")
0
 
0
 # The Apache executable may be located in an 'sbin' folder. We add
0
 # the 'sbin' folders to $PATH just in case. On some systems
...
17
18
19
20
 
 
21
22
23
...
17
18
19
 
20
21
22
23
24
0
@@ -17,7 +17,8 @@
0
 
0
 require 'pathname'
0
 $LOAD_PATH.unshift(File.expand_path("#{File.dirname(__FILE__)}/../lib"))
0
-require 'passenger/passenger'
0
+$LOAD_PATH.unshift(File.expand_path("#{File.dirname(__FILE__)}/../ext"))
0
+require 'passenger/spawn_manager'
0
 
0
 begin
0
   STDOUT.sync = true
...
16
17
18
19
 
 
 
20
21
22
...
16
17
18
 
19
20
21
22
23
24
0
@@ -16,7 +16,9 @@
0
 
0
 require 'socket'
0
 require 'timeout'
0
-require 'passenger/passenger'
0
+require 'passenger/message_channel'
0
+require 'passenger/utils'
0
+require 'passenger/native_support'
0
 module Passenger
0
 
0
 # An abstract base class for a server, with the following properties:
...
15
16
17
18
 
19
20
21
...
15
16
17
 
18
19
20
21
0
@@ -15,7 +15,7 @@
0
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0
 
0
 require 'rubygems'
0
-require 'passenger/passenger'
0
+require 'passenger/exceptions'
0
 module Passenger
0
 
0
 # Represents a single Ruby on Rails application instance.
...
17
18
19
20
 
 
 
 
21
22
23
...
17
18
19
 
20
21
22
23
24
25
26
0
@@ -17,7 +17,10 @@
0
 require 'rubygems'
0
 require 'socket'
0
 require 'etc'
0
-require 'passenger/passenger'
0
+require 'passenger/abstract_server'
0
+require 'passenger/request_handler'
0
+require 'passenger/exceptions'
0
+require 'passenger/utils'
0
 
0
 begin
0
   # Preload MySQL if possible. We want to preload it and we need
...
15
16
17
18
 
 
 
 
19
20
21
...
15
16
17
 
18
19
20
21
22
23
24
0
@@ -15,7 +15,10 @@
0
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0
 
0
 require 'rubygems'
0
-require 'passenger/passenger'
0
+require 'passenger/abstract_server'
0
+require 'passenger/application_spawner'
0
+require 'passenger/exceptions'
0
+require 'passenger/utils'
0
 module Passenger
0
 
0
 # This class is capable of spawning Ruby on Rails application instances
...
16
17
18
19
 
 
20
21
22
...
16
17
18
 
19
20
21
22
23
0
@@ -16,7 +16,8 @@
0
 
0
 require 'socket'
0
 require 'base64'
0
-require 'passenger/passenger'
0
+require 'passenger/cgi_fixed'
0
+require 'passenger/native_support'
0
 module Passenger
0
 
0
 # The request handler's job is to process incoming HTTP requests using the
...
14
15
16
17
 
 
 
 
 
 
 
18
19
20
...
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
250
251
252
253
254
255
256
257
258
259
...
14
15
16
 
17
18
19
20
21
22
23
24
25
26
...
84
85
86
 
 
 
 
 
 
 
 
 
 
 
 
 
87
88
89
...
243
244
245
 
 
 
 
246
247
248
0
@@ -14,7 +14,13 @@
0
 # with this program; if not, write to the Free Software Foundation, Inc.,
0
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0
 
0
-require 'passenger/passenger'
0
+require 'passenger/abstract_server'
0
+require 'passenger/application'
0
+require 'passenger/framework_spawner'
0
+require 'passenger/application_spawner'
0
+require 'passenger/html_template'
0
+require 'passenger/exceptions'
0
+require 'passenger/utils'
0
 module Passenger
0
 
0
 # This class is capable of spawning Ruby on Rails application instances.
0
@@ -78,19 +84,6 @@ class SpawnManager < AbstractServer
0
   # - AppInitError: The application raised an exception or called exit() during startup.
0
   def spawn_application(app_root, lower_privilege = true, lowest_user = "nobody",
0
    environment = "production", spawn_method = "smart")
0
- if GC.copy_on_write_friendly?
0
- # If the garbage collector is copy-on-write friendly, then we'll
0
- # want to preload all Passenger classes (before any spawn servers have
0
- # been started), for copy-on-write semantics.
0
- #
0
- # On the other hand, if the garbage collector is *not* copy-on-write
0
- # friendly, then we'll want to load Passenger classes after we've
0
- # spawned an application. This increases perceived speed of the first spawn
0
- # operation, and increases actual speed for subsequently created spawn
0
- # servers (because they don't have to load classes on-demand anymore).
0
- Passenger.load_all_classes!
0
- end
0
-
0
     if spawn_method == "smart"
0
       spawner_must_be_started = true
0
       framework_version = Application.detect_framework_version(app_root)
0
@@ -250,10 +243,6 @@ private
0
       client.send_io(app.owner_pipe)
0
       app.close
0
     end
0
- if !GC.copy_on_write_friendly?
0
- # See the comment associated with the other load_all_classes! call.
0
- Passenger.load_all_classes!
0
- end
0
   end
0
   
0
   def handle_reload(app_root)
...
17
18
19
20
21
 
 
 
 
22
23
24
...
31
32
33
34
35
36
37
...
62
63
64
65
66
67
68
...
70
71
72
73
74
75
76
...
17
18
19
 
 
20
21
22
23
24
25
26
...
33
34
35
 
36
37
38
...
63
64
65
 
66
67
68
...
70
71
72
 
73
74
75
0
@@ -17,8 +17,10 @@
0
 require 'rubygems'
0
 require 'thread'
0
 require 'fastthread'
0
-require 'passenger/passenger'
0
-
0
+require 'pathname'
0
+require 'etc'
0
+require 'passenger/exceptions'
0
+require 'passenger/native_support'
0
 module Passenger
0
 
0
 # Utility functions.
0
@@ -31,7 +33,6 @@ protected
0
   # Raises SystemCallError if something went wrong. Raises ArgumentError
0
   # if +path+ is nil.
0
   def normalize_path(path)
0
- require 'pathname' unless defined?(Pathname)
0
     raise ArgumentError, "The 'path' argument may not be nil" if path.nil?
0
     return Pathname.new(path).realpath.to_s
0
   rescue Errno::ENOENT => e
0
@@ -62,7 +63,6 @@ protected
0
   # Assert that +username+ is a valid username. Raises
0
   # ArgumentError if that is not the case.
0
   def assert_valid_username(username)
0
- require 'etc' unless defined?(Etc)
0
     # If username does not exist then getpwnam() will raise an ArgumentError.
0
     username && Etc.getpwnam(username)
0
   end
0
@@ -70,7 +70,6 @@ protected
0
   # Assert that +groupname+ is a valid group name. Raises
0
   # ArgumentError if that is not the case.
0
   def assert_valid_groupname(groupname)
0
- require 'etc' unless defined?(Etc)
0
     # If groupname does not exist then getgrnam() will raise an ArgumentError.
0
     groupname && Etc.getgrnam(groupname)
0
   end
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 require 'support/config'
0
 require 'support/test_helper'
0
+require 'passenger/application_spawner'
0
 
0
 require 'minimal_spawner_spec'
0
 require 'spawn_server_spec'
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 require 'support/config'
0
 require 'support/test_helper'
0
+require 'passenger/application'
0
 include Passenger
0
 
0
 describe Application do
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 require 'support/config'
0
 require 'support/test_helper'
0
+require 'passenger/framework_spawner'
0
 
0
 require 'minimal_spawner_spec'
0
 require 'spawn_server_spec'
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 require 'socket'
0
 require 'support/config'
0
+require 'passenger/message_channel'
0
 include Passenger
0
 
0
 describe MessageChannel do
...
1
2
 
3
4
5
...
1
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 require 'support/config'
0
 require 'support/test_helper'
0
+require 'passenger/spawn_manager'
0
 
0
 require 'abstract_server_spec'
0
 require 'minimal_spawner_spec'
...
1
 
 
2
3
4
5
6
...
 
1
2
3
 
4
5
6
0
@@ -1,6 +1,6 @@
0
-$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/../../lib")
0
+$LOAD_PATH.unshift(File.expand_path("#{File.dirname(__FILE__)}/../../lib"))
0
+$LOAD_PATH.unshift(File.expand_path("#{File.dirname(__FILE__)}/../../ext"))
0
 require 'yaml'
0
-require 'passenger/passenger'
0
 
0
 begin
0
   CONFIG = YAML::load_file('config.yml')

Comments

    No one has commented yet.