Phusion Passenger - www.phusionpassenger.com/ Copyright (c) 2010-2013 Phusion
"Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FILE_LOCATION | = | File.expand_path(__FILE__) | ||
PACKAGE_NAME | = | 'passenger' | Names and version numbers ###### | |
VERSION_STRING | = | '4.0.57' | Run ‘rake ext/common/Constants.h’ after changing this number. | |
PREFERRED_NGINX_VERSION | = | '1.6.2' | ||
NGINX_SHA256_CHECKSUM | = | 'b5608c2959d3e7ad09b20fc8f9e5bd4bc87b3bc8ba5936a513c04ed8f1391a18' | ||
PREFERRED_PCRE_VERSION | = | '8.34' | ||
PCRE_SHA256_CHECKSUM | = | '1dd78994c81e44ac41cf30b2a21d4b4cc6d76ccde7fc6e77713ed51d7bddca47' | ||
STANDALONE_INTERFACE_VERSION | = | 1 | ||
GLOBAL_NAMESPACE_DIRNAME | = | "passenger" | Directories ###### | |
USER_NAMESPACE_DIRNAME | = | ".passenger" | Subdirectory under $HOME to use for storing stuff. | |
APACHE2_MODULE_CONF_NAME | = | "passenger" | The name for the /etc/apache2/mods-available/*.{load,conf} file. | |
PLUGIN_DIRS | = | [ "/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/plugins", "/usr/local/share/#{GLOBAL_NAMESPACE_DIRNAME}/plugins", "~/#{USER_NAMESPACE_DIRNAME}/plugins" | Directories in which to look for plugins. | |
REQUIRED_LOCATIONS_INI_FIELDS | = | [ :bin_dir, :agents_dir, :lib_dir, :helper_scripts_dir, :resources_dir, :include_dir, :doc_dir, :ruby_libdir, :node_libdir, :apache2_module_path, :ruby_extension_source_dir, :nginx_module_source_dir | ||
OPTIONAL_LOCATIONS_INI_FIELDS | = | [ # Directory in which downloaded Phusion Passenger binaries are stored. # Only available when originally packaged. :download_cache_dir, # Directory which contains the main Phusion Passenger Rakefile. Only # available when originally packaged, :build_system_dir, # Directory in which the build system's output is stored, e.g. # the compiled agent executables. Only available when originally # packaged. :buildout_dir, # Directory in which we can run 'rake apache2'. Used by # passenger-install-apache2-module. Rake will save the Apache module # to `apache2_module_path`. :apache2_module_source_dir | ||
ORIGINALLY_PACKAGED_LOCATIONS_INI_FIELDS | = | [ :download_cache_dir, :build_system_dir, :buildout_dir | The subset of the optional fields which are only available when originally packaged. | |
INDEX_DOC_NAME | = | "Users guide.html" | Other resource locations ###### | |
APACHE2_DOC_NAME | = | "Users guide Apache.html" | ||
NGINX_DOC_NAME | = | "Users guide Nginx.html" | ||
STANDALONE_DOC_NAME | = | "Users guide Standalone.html" | ||
UNION_STATION_CORE | = | "UNION_STATION_CORE".freeze | ||
UNION_STATION_REQUEST_TRANSACTION | = | "UNION_STATION_REQUEST_TRANSACTION".freeze | ||
PASSENGER_TXN_ID | = | "PASSENGER_TXN_ID".freeze | ||
PASSENGER_APP_GROUP_NAME | = | "PASSENGER_APP_GROUP_NAME".freeze | ||
PASSENGER_UNION_STATION_KEY | = | "UNION_STATION_KEY".freeze | ||
RACK_HIJACK_IO | = | "rack.hijack_io".freeze |
Whether the current Phusion Passenger installation is installed from a release package, e.g. an official gem or official tarball. Retruns false if e.g. the gem was built by the user, or if this install is from a git repository.
If Phusion Passenger is natively packaged, returns which packaging method was used. Can be ‘deb’, ‘rpm’ or ‘homebrew’.
Returns whether this Phusion Passenger installation is in the ‘originally packaged’ configuration (as opposed to the ‘natively packaged’ configuration.
Instead of calling `require ‘phusion_passenger/foo’`, you should call `PhusionPassenger.require_passenger_lib ‘foo’`. This is because when Phusion Passenger is natively packaged, it may still be run with arbitrary Ruby interpreters. Adding ruby_libdir to $LOAD_PATH is then dangerous because ruby_libdir may be the distribution‘s Ruby‘s vendor_ruby directory, which may be incompatible with the active Ruby interpreter. This method looks up the exact filename directly.
Using this method also has two more advantages:
1. It is immune to Bundler's load path mangling code. 2. It is faster than plan require() because it doesn't need to scan the entire load path.