Commit 212a4a95 authored by Chris McDonough's avatar Chris McDonough

Merge Stefan's ZOPE_CONFIG patch to the HEAD.

parent 78267434
......@@ -28,6 +28,9 @@ def configure(configfile):
configure('/path/to/configfile'); import Zope; app = Zope.app() """
import Zope.Startup
starter = Zope.Startup.get_starter()
if not configfile:
import os
configfile = os.getenv("ZOPE_CONFIG")
opts = _setconfig(configfile)
starter.setConfiguration(opts.configroot)
starter.setupSecurityOptions()
......
......@@ -42,6 +42,12 @@ def startup():
# Already began (and maybe finished) startup, so don't run again
return
_began_startup = 1
# Load configuration file from (optional) environment variable
# Also see http://zope.org/Collectors/Zope/1233
import os
configfile = os.environ.get('ZOPE_CONFIG')
if configfile is not None:
configure(configfile)
from Zope.App.startup import startup as _startup
_startup()
......@@ -71,4 +77,3 @@ import os
if os.environ.get('ZOPE_COMPATIBLE_STARTUP'):
# Open the database immediately (see comment above).
startup()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment