forked from rastating/wordpress-exploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenv.rb
50 lines (41 loc) · 1.1 KB
/
env.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# frozen_string_literal: true
require 'date'
require 'fileutils'
require 'json'
require 'time'
required_gems = [
'colorize',
'mime/types',
'nokogiri',
'require_all',
'slop',
'typhoeus',
'zip'
]
required_gems.each do |gem_name|
begin
require gem_name
rescue LoadError
puts
puts "Failed to load required dependency: #{gem_name}"
puts
puts 'You must run "bundle install" prior to using WordPress Exploit Framework.'
puts 'If bundler is not present on your system, you can install it by running "gem install bundler"'
puts
exit
end
end
wpxfbase = __FILE__
while File.symlink?(wpxfbase)
wpxfbase = File.expand_path(File.readlink(wpxfbase), File.dirname(wpxfbase))
end
app_path = File.expand_path(File.join(File.dirname(wpxfbase)))
$LOAD_PATH.unshift(File.join(app_path, 'lib'))
$LOAD_PATH.unshift(File.join(app_path, 'modules'))
require 'wpxf/core'
require 'wpxf/utility/body_builder'
require 'wpxf/utility/text'
require 'wpxf/utility/reference_inflater'
require_relative 'github_updater'
Wpxf.app_path = app_path
Wpxf.data_directory = File.join(app_path, 'data/')