Phusion Passenger - www.phusionpassenger.com/ Copyright (c) 2010-2014 Phusion Holding B.V.
"Passenger", "Phusion Passenger" and "Union Station" are registered trademarks of Phusion Holding B.V.
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 | = | '5.0.26' | Run ‘rake src/cxx_supportlib/Constants.h’ after changing this number. | |
| PREFERRED_NGINX_VERSION | = | '1.8.1' | ||
| NGINX_SHA256_CHECKSUM | = | '8f4b3c630966c044ec72715754334d1fdf741caa1d5795fb4646c27d09f797b7' | ||
| 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 | = | [ # User-invoked commands :bin_dir, # Support binaries :support_binaries_dir, # Library files like libboost_oxt.a and various .o files :lib_dir, # Scripts not directly invoked by users :helper_scripts_dir, # Various non-executable resources :resources_dir, # C header files, necessary for compiling Nginx :include_dir, # Documentation :doc_dir, # Ruby support libraries :ruby_libdir, # Node.js support libraries :node_libdir, # Path to the compiled Apache module :apache2_module_path, # Directory containing the source code of our Ruby extension :ruby_extension_source_dir, # Directory containing the source code of our Nginx module :nginx_module_source_dir | ||
| OPTIONAL_LOCATIONS_INI_FIELDS | = | [ # Directory which contains the main Phusion Passenger Rakefile. Only # available when originally packaged, :build_system_dir, # Directory in which downloaded Phusion Passenger binaries are cached. :download_cache_dir | ||
| PASSENGER_TXN_ID | = | "PASSENGER_TXN_ID".freeze | ||
| PASSENGER_APP_GROUP_NAME | = | "PASSENGER_APP_GROUP_NAME".freeze | ||
| PASSENGER_DELTA_MONOTONIC | = | "PASSENGER_DELTA_MONOTONIC".freeze | ||
| RACK_HIJACK_IO | = | "rack.hijack_io".freeze | ||
| LVL_CRIT | = | 0 | ||
| LVL_ERROR | = | 1 | ||
| LVL_WARN | = | 2 | ||
| LVL_NOTICE | = | 3 | ||
| LVL_INFO | = | 4 | ||
| LVL_DEBUG | = | 5 | ||
| LVL_DEBUG2 | = | 6 | ||
| LVL_DEBUG3 | = | 7 |
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.
Returns whether this Phusion Passenger installation is in the ‘originally packaged’ configuration (as opposed to the ‘custom packaged’ configuration.
If Phusion Passenger is custom packaged, returns which packaging method was used. Can be ‘deb’, ‘rpm’, ‘homebrew’, ‘test’ or ‘unknown’.
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.