Version Description
Download this release
Release Info
Developer | yani.iliev |
Plugin | All-in-One WP Migration |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- LICENSE +675 -0
- all-in-one-wp-migration.php +37 -0
- constants.php +72 -0
- lib/controller/class-ai1wm-export-controller.php +59 -0
- lib/controller/class-ai1wm-import-controller.php +36 -0
- lib/controller/class-ai1wm-main-controller.php +343 -0
- lib/model/class-ai1wm-export.php +253 -0
- lib/model/class-ai1wm-import.php +313 -0
- lib/model/class-ai1wm-template.php +39 -0
- lib/vendor/bandar/bandar/LICENSE +20 -0
- lib/vendor/bandar/bandar/README.md +100 -0
- lib/vendor/bandar/bandar/lib/Bandar.php +223 -0
- lib/vendor/bandar/bandar/lib/Exceptions/TemplateDoesNotExistException.php +50 -0
- lib/vendor/mysqldump-php/mysqldump.php +603 -0
- lib/vendor/zipper/zipper.lib.php +62 -0
- lib/view/assets/css/export.min.css +1 -0
- lib/view/assets/css/import.min.css +1 -0
- lib/view/assets/font/servmask.eot +0 -0
- lib/view/assets/font/servmask.svg +20 -0
- lib/view/assets/font/servmask.ttf +0 -0
- lib/view/assets/font/servmask.woff +0 -0
- lib/view/assets/javascript/export.min.js +1 -0
- lib/view/assets/javascript/import.min.js +1 -0
- lib/view/export/index.php +180 -0
- lib/view/import/index.php +84 -0
- loader.php +74 -0
- readme.txt +43 -0
- uninstall.php +27 -0
LICENSE
ADDED
@@ -0,0 +1,675 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
+
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The GNU General Public License is a free, copyleft license for
|
12 |
+
software and other kinds of works.
|
13 |
+
|
14 |
+
The licenses for most software and other practical works are designed
|
15 |
+
to take away your freedom to share and change the works. By contrast,
|
16 |
+
the GNU General Public License is intended to guarantee your freedom to
|
17 |
+
share and change all versions of a program--to make sure it remains free
|
18 |
+
software for all its users. We, the Free Software Foundation, use the
|
19 |
+
GNU General Public License for most of our software; it applies also to
|
20 |
+
any other work released this way by its authors. You can apply it to
|
21 |
+
your programs, too.
|
22 |
+
|
23 |
+
When we speak of free software, we are referring to freedom, not
|
24 |
+
price. Our General Public Licenses are designed to make sure that you
|
25 |
+
have the freedom to distribute copies of free software (and charge for
|
26 |
+
them if you wish), that you receive source code or can get it if you
|
27 |
+
want it, that you can change the software or use pieces of it in new
|
28 |
+
free programs, and that you know you can do these things.
|
29 |
+
|
30 |
+
To protect your rights, we need to prevent others from denying you
|
31 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
32 |
+
certain responsibilities if you distribute copies of the software, or if
|
33 |
+
you modify it: responsibilities to respect the freedom of others.
|
34 |
+
|
35 |
+
For example, if you distribute copies of such a program, whether
|
36 |
+
gratis or for a fee, you must pass on to the recipients the same
|
37 |
+
freedoms that you received. You must make sure that they, too, receive
|
38 |
+
or can get the source code. And you must show them these terms so they
|
39 |
+
know their rights.
|
40 |
+
|
41 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
42 |
+
(1) assert copyright on the software, and (2) offer you this License
|
43 |
+
giving you legal permission to copy, distribute and/or modify it.
|
44 |
+
|
45 |
+
For the developers' and authors' protection, the GPL clearly explains
|
46 |
+
that there is no warranty for this free software. For both users' and
|
47 |
+
authors' sake, the GPL requires that modified versions be marked as
|
48 |
+
changed, so that their problems will not be attributed erroneously to
|
49 |
+
authors of previous versions.
|
50 |
+
|
51 |
+
Some devices are designed to deny users access to install or run
|
52 |
+
modified versions of the software inside them, although the manufacturer
|
53 |
+
can do so. This is fundamentally incompatible with the aim of
|
54 |
+
protecting users' freedom to change the software. The systematic
|
55 |
+
pattern of such abuse occurs in the area of products for individuals to
|
56 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
57 |
+
have designed this version of the GPL to prohibit the practice for those
|
58 |
+
products. If such problems arise substantially in other domains, we
|
59 |
+
stand ready to extend this provision to those domains in future versions
|
60 |
+
of the GPL, as needed to protect the freedom of users.
|
61 |
+
|
62 |
+
Finally, every program is threatened constantly by software patents.
|
63 |
+
States should not allow patents to restrict development and use of
|
64 |
+
software on general-purpose computers, but in those that do, we wish to
|
65 |
+
avoid the special danger that patents applied to a free program could
|
66 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
67 |
+
patents cannot be used to render the program non-free.
|
68 |
+
|
69 |
+
The precise terms and conditions for copying, distribution and
|
70 |
+
modification follow.
|
71 |
+
|
72 |
+
TERMS AND CONDITIONS
|
73 |
+
|
74 |
+
0. Definitions.
|
75 |
+
|
76 |
+
"This License" refers to version 3 of the GNU General Public License.
|
77 |
+
|
78 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
79 |
+
works, such as semiconductor masks.
|
80 |
+
|
81 |
+
"The Program" refers to any copyrightable work licensed under this
|
82 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
83 |
+
"recipients" may be individuals or organizations.
|
84 |
+
|
85 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
86 |
+
in a fashion requiring copyright permission, other than the making of an
|
87 |
+
exact copy. The resulting work is called a "modified version" of the
|
88 |
+
earlier work or a work "based on" the earlier work.
|
89 |
+
|
90 |
+
A "covered work" means either the unmodified Program or a work based
|
91 |
+
on the Program.
|
92 |
+
|
93 |
+
To "propagate" a work means to do anything with it that, without
|
94 |
+
permission, would make you directly or secondarily liable for
|
95 |
+
infringement under applicable copyright law, except executing it on a
|
96 |
+
computer or modifying a private copy. Propagation includes copying,
|
97 |
+
distribution (with or without modification), making available to the
|
98 |
+
public, and in some countries other activities as well.
|
99 |
+
|
100 |
+
To "convey" a work means any kind of propagation that enables other
|
101 |
+
parties to make or receive copies. Mere interaction with a user through
|
102 |
+
a computer network, with no transfer of a copy, is not conveying.
|
103 |
+
|
104 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
105 |
+
to the extent that it includes a convenient and prominently visible
|
106 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
107 |
+
tells the user that there is no warranty for the work (except to the
|
108 |
+
extent that warranties are provided), that licensees may convey the
|
109 |
+
work under this License, and how to view a copy of this License. If
|
110 |
+
the interface presents a list of user commands or options, such as a
|
111 |
+
menu, a prominent item in the list meets this criterion.
|
112 |
+
|
113 |
+
1. Source Code.
|
114 |
+
|
115 |
+
The "source code" for a work means the preferred form of the work
|
116 |
+
for making modifications to it. "Object code" means any non-source
|
117 |
+
form of a work.
|
118 |
+
|
119 |
+
A "Standard Interface" means an interface that either is an official
|
120 |
+
standard defined by a recognized standards body, or, in the case of
|
121 |
+
interfaces specified for a particular programming language, one that
|
122 |
+
is widely used among developers working in that language.
|
123 |
+
|
124 |
+
The "System Libraries" of an executable work include anything, other
|
125 |
+
than the work as a whole, that (a) is included in the normal form of
|
126 |
+
packaging a Major Component, but which is not part of that Major
|
127 |
+
Component, and (b) serves only to enable use of the work with that
|
128 |
+
Major Component, or to implement a Standard Interface for which an
|
129 |
+
implementation is available to the public in source code form. A
|
130 |
+
"Major Component", in this context, means a major essential component
|
131 |
+
(kernel, window system, and so on) of the specific operating system
|
132 |
+
(if any) on which the executable work runs, or a compiler used to
|
133 |
+
produce the work, or an object code interpreter used to run it.
|
134 |
+
|
135 |
+
The "Corresponding Source" for a work in object code form means all
|
136 |
+
the source code needed to generate, install, and (for an executable
|
137 |
+
work) run the object code and to modify the work, including scripts to
|
138 |
+
control those activities. However, it does not include the work's
|
139 |
+
System Libraries, or general-purpose tools or generally available free
|
140 |
+
programs which are used unmodified in performing those activities but
|
141 |
+
which are not part of the work. For example, Corresponding Source
|
142 |
+
includes interface definition files associated with source files for
|
143 |
+
the work, and the source code for shared libraries and dynamically
|
144 |
+
linked subprograms that the work is specifically designed to require,
|
145 |
+
such as by intimate data communication or control flow between those
|
146 |
+
subprograms and other parts of the work.
|
147 |
+
|
148 |
+
The Corresponding Source need not include anything that users
|
149 |
+
can regenerate automatically from other parts of the Corresponding
|
150 |
+
Source.
|
151 |
+
|
152 |
+
The Corresponding Source for a work in source code form is that
|
153 |
+
same work.
|
154 |
+
|
155 |
+
2. Basic Permissions.
|
156 |
+
|
157 |
+
All rights granted under this License are granted for the term of
|
158 |
+
copyright on the Program, and are irrevocable provided the stated
|
159 |
+
conditions are met. This License explicitly affirms your unlimited
|
160 |
+
permission to run the unmodified Program. The output from running a
|
161 |
+
covered work is covered by this License only if the output, given its
|
162 |
+
content, constitutes a covered work. This License acknowledges your
|
163 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
164 |
+
|
165 |
+
You may make, run and propagate covered works that you do not
|
166 |
+
convey, without conditions so long as your license otherwise remains
|
167 |
+
in force. You may convey covered works to others for the sole purpose
|
168 |
+
of having them make modifications exclusively for you, or provide you
|
169 |
+
with facilities for running those works, provided that you comply with
|
170 |
+
the terms of this License in conveying all material for which you do
|
171 |
+
not control copyright. Those thus making or running the covered works
|
172 |
+
for you must do so exclusively on your behalf, under your direction
|
173 |
+
and control, on terms that prohibit them from making any copies of
|
174 |
+
your copyrighted material outside their relationship with you.
|
175 |
+
|
176 |
+
Conveying under any other circumstances is permitted solely under
|
177 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
178 |
+
makes it unnecessary.
|
179 |
+
|
180 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
181 |
+
|
182 |
+
No covered work shall be deemed part of an effective technological
|
183 |
+
measure under any applicable law fulfilling obligations under article
|
184 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
185 |
+
similar laws prohibiting or restricting circumvention of such
|
186 |
+
measures.
|
187 |
+
|
188 |
+
When you convey a covered work, you waive any legal power to forbid
|
189 |
+
circumvention of technological measures to the extent such circumvention
|
190 |
+
is effected by exercising rights under this License with respect to
|
191 |
+
the covered work, and you disclaim any intention to limit operation or
|
192 |
+
modification of the work as a means of enforcing, against the work's
|
193 |
+
users, your or third parties' legal rights to forbid circumvention of
|
194 |
+
technological measures.
|
195 |
+
|
196 |
+
4. Conveying Verbatim Copies.
|
197 |
+
|
198 |
+
You may convey verbatim copies of the Program's source code as you
|
199 |
+
receive it, in any medium, provided that you conspicuously and
|
200 |
+
appropriately publish on each copy an appropriate copyright notice;
|
201 |
+
keep intact all notices stating that this License and any
|
202 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
203 |
+
keep intact all notices of the absence of any warranty; and give all
|
204 |
+
recipients a copy of this License along with the Program.
|
205 |
+
|
206 |
+
You may charge any price or no price for each copy that you convey,
|
207 |
+
and you may offer support or warranty protection for a fee.
|
208 |
+
|
209 |
+
5. Conveying Modified Source Versions.
|
210 |
+
|
211 |
+
You may convey a work based on the Program, or the modifications to
|
212 |
+
produce it from the Program, in the form of source code under the
|
213 |
+
terms of section 4, provided that you also meet all of these conditions:
|
214 |
+
|
215 |
+
a) The work must carry prominent notices stating that you modified
|
216 |
+
it, and giving a relevant date.
|
217 |
+
|
218 |
+
b) The work must carry prominent notices stating that it is
|
219 |
+
released under this License and any conditions added under section
|
220 |
+
7. This requirement modifies the requirement in section 4 to
|
221 |
+
"keep intact all notices".
|
222 |
+
|
223 |
+
c) You must license the entire work, as a whole, under this
|
224 |
+
License to anyone who comes into possession of a copy. This
|
225 |
+
License will therefore apply, along with any applicable section 7
|
226 |
+
additional terms, to the whole of the work, and all its parts,
|
227 |
+
regardless of how they are packaged. This License gives no
|
228 |
+
permission to license the work in any other way, but it does not
|
229 |
+
invalidate such permission if you have separately received it.
|
230 |
+
|
231 |
+
d) If the work has interactive user interfaces, each must display
|
232 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
233 |
+
interfaces that do not display Appropriate Legal Notices, your
|
234 |
+
work need not make them do so.
|
235 |
+
|
236 |
+
A compilation of a covered work with other separate and independent
|
237 |
+
works, which are not by their nature extensions of the covered work,
|
238 |
+
and which are not combined with it such as to form a larger program,
|
239 |
+
in or on a volume of a storage or distribution medium, is called an
|
240 |
+
"aggregate" if the compilation and its resulting copyright are not
|
241 |
+
used to limit the access or legal rights of the compilation's users
|
242 |
+
beyond what the individual works permit. Inclusion of a covered work
|
243 |
+
in an aggregate does not cause this License to apply to the other
|
244 |
+
parts of the aggregate.
|
245 |
+
|
246 |
+
6. Conveying Non-Source Forms.
|
247 |
+
|
248 |
+
You may convey a covered work in object code form under the terms
|
249 |
+
of sections 4 and 5, provided that you also convey the
|
250 |
+
machine-readable Corresponding Source under the terms of this License,
|
251 |
+
in one of these ways:
|
252 |
+
|
253 |
+
a) Convey the object code in, or embodied in, a physical product
|
254 |
+
(including a physical distribution medium), accompanied by the
|
255 |
+
Corresponding Source fixed on a durable physical medium
|
256 |
+
customarily used for software interchange.
|
257 |
+
|
258 |
+
b) Convey the object code in, or embodied in, a physical product
|
259 |
+
(including a physical distribution medium), accompanied by a
|
260 |
+
written offer, valid for at least three years and valid for as
|
261 |
+
long as you offer spare parts or customer support for that product
|
262 |
+
model, to give anyone who possesses the object code either (1) a
|
263 |
+
copy of the Corresponding Source for all the software in the
|
264 |
+
product that is covered by this License, on a durable physical
|
265 |
+
medium customarily used for software interchange, for a price no
|
266 |
+
more than your reasonable cost of physically performing this
|
267 |
+
conveying of source, or (2) access to copy the
|
268 |
+
Corresponding Source from a network server at no charge.
|
269 |
+
|
270 |
+
c) Convey individual copies of the object code with a copy of the
|
271 |
+
written offer to provide the Corresponding Source. This
|
272 |
+
alternative is allowed only occasionally and noncommercially, and
|
273 |
+
only if you received the object code with such an offer, in accord
|
274 |
+
with subsection 6b.
|
275 |
+
|
276 |
+
d) Convey the object code by offering access from a designated
|
277 |
+
place (gratis or for a charge), and offer equivalent access to the
|
278 |
+
Corresponding Source in the same way through the same place at no
|
279 |
+
further charge. You need not require recipients to copy the
|
280 |
+
Corresponding Source along with the object code. If the place to
|
281 |
+
copy the object code is a network server, the Corresponding Source
|
282 |
+
may be on a different server (operated by you or a third party)
|
283 |
+
that supports equivalent copying facilities, provided you maintain
|
284 |
+
clear directions next to the object code saying where to find the
|
285 |
+
Corresponding Source. Regardless of what server hosts the
|
286 |
+
Corresponding Source, you remain obligated to ensure that it is
|
287 |
+
available for as long as needed to satisfy these requirements.
|
288 |
+
|
289 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
290 |
+
you inform other peers where the object code and Corresponding
|
291 |
+
Source of the work are being offered to the general public at no
|
292 |
+
charge under subsection 6d.
|
293 |
+
|
294 |
+
A separable portion of the object code, whose source code is excluded
|
295 |
+
from the Corresponding Source as a System Library, need not be
|
296 |
+
included in conveying the object code work.
|
297 |
+
|
298 |
+
A "User Product" is either (1) a "consumer product", which means any
|
299 |
+
tangible personal property which is normally used for personal, family,
|
300 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
301 |
+
into a dwelling. In determining whether a product is a consumer product,
|
302 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
303 |
+
product received by a particular user, "normally used" refers to a
|
304 |
+
typical or common use of that class of product, regardless of the status
|
305 |
+
of the particular user or of the way in which the particular user
|
306 |
+
actually uses, or expects or is expected to use, the product. A product
|
307 |
+
is a consumer product regardless of whether the product has substantial
|
308 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
309 |
+
the only significant mode of use of the product.
|
310 |
+
|
311 |
+
"Installation Information" for a User Product means any methods,
|
312 |
+
procedures, authorization keys, or other information required to install
|
313 |
+
and execute modified versions of a covered work in that User Product from
|
314 |
+
a modified version of its Corresponding Source. The information must
|
315 |
+
suffice to ensure that the continued functioning of the modified object
|
316 |
+
code is in no case prevented or interfered with solely because
|
317 |
+
modification has been made.
|
318 |
+
|
319 |
+
If you convey an object code work under this section in, or with, or
|
320 |
+
specifically for use in, a User Product, and the conveying occurs as
|
321 |
+
part of a transaction in which the right of possession and use of the
|
322 |
+
User Product is transferred to the recipient in perpetuity or for a
|
323 |
+
fixed term (regardless of how the transaction is characterized), the
|
324 |
+
Corresponding Source conveyed under this section must be accompanied
|
325 |
+
by the Installation Information. But this requirement does not apply
|
326 |
+
if neither you nor any third party retains the ability to install
|
327 |
+
modified object code on the User Product (for example, the work has
|
328 |
+
been installed in ROM).
|
329 |
+
|
330 |
+
The requirement to provide Installation Information does not include a
|
331 |
+
requirement to continue to provide support service, warranty, or updates
|
332 |
+
for a work that has been modified or installed by the recipient, or for
|
333 |
+
the User Product in which it has been modified or installed. Access to a
|
334 |
+
network may be denied when the modification itself materially and
|
335 |
+
adversely affects the operation of the network or violates the rules and
|
336 |
+
protocols for communication across the network.
|
337 |
+
|
338 |
+
Corresponding Source conveyed, and Installation Information provided,
|
339 |
+
in accord with this section must be in a format that is publicly
|
340 |
+
documented (and with an implementation available to the public in
|
341 |
+
source code form), and must require no special password or key for
|
342 |
+
unpacking, reading or copying.
|
343 |
+
|
344 |
+
7. Additional Terms.
|
345 |
+
|
346 |
+
"Additional permissions" are terms that supplement the terms of this
|
347 |
+
License by making exceptions from one or more of its conditions.
|
348 |
+
Additional permissions that are applicable to the entire Program shall
|
349 |
+
be treated as though they were included in this License, to the extent
|
350 |
+
that they are valid under applicable law. If additional permissions
|
351 |
+
apply only to part of the Program, that part may be used separately
|
352 |
+
under those permissions, but the entire Program remains governed by
|
353 |
+
this License without regard to the additional permissions.
|
354 |
+
|
355 |
+
When you convey a copy of a covered work, you may at your option
|
356 |
+
remove any additional permissions from that copy, or from any part of
|
357 |
+
it. (Additional permissions may be written to require their own
|
358 |
+
removal in certain cases when you modify the work.) You may place
|
359 |
+
additional permissions on material, added by you to a covered work,
|
360 |
+
for which you have or can give appropriate copyright permission.
|
361 |
+
|
362 |
+
Notwithstanding any other provision of this License, for material you
|
363 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
364 |
+
that material) supplement the terms of this License with terms:
|
365 |
+
|
366 |
+
a) Disclaiming warranty or limiting liability differently from the
|
367 |
+
terms of sections 15 and 16 of this License; or
|
368 |
+
|
369 |
+
b) Requiring preservation of specified reasonable legal notices or
|
370 |
+
author attributions in that material or in the Appropriate Legal
|
371 |
+
Notices displayed by works containing it; or
|
372 |
+
|
373 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
374 |
+
requiring that modified versions of such material be marked in
|
375 |
+
reasonable ways as different from the original version; or
|
376 |
+
|
377 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
378 |
+
authors of the material; or
|
379 |
+
|
380 |
+
e) Declining to grant rights under trademark law for use of some
|
381 |
+
trade names, trademarks, or service marks; or
|
382 |
+
|
383 |
+
f) Requiring indemnification of licensors and authors of that
|
384 |
+
material by anyone who conveys the material (or modified versions of
|
385 |
+
it) with contractual assumptions of liability to the recipient, for
|
386 |
+
any liability that these contractual assumptions directly impose on
|
387 |
+
those licensors and authors.
|
388 |
+
|
389 |
+
All other non-permissive additional terms are considered "further
|
390 |
+
restrictions" within the meaning of section 10. If the Program as you
|
391 |
+
received it, or any part of it, contains a notice stating that it is
|
392 |
+
governed by this License along with a term that is a further
|
393 |
+
restriction, you may remove that term. If a license document contains
|
394 |
+
a further restriction but permits relicensing or conveying under this
|
395 |
+
License, you may add to a covered work material governed by the terms
|
396 |
+
of that license document, provided that the further restriction does
|
397 |
+
not survive such relicensing or conveying.
|
398 |
+
|
399 |
+
If you add terms to a covered work in accord with this section, you
|
400 |
+
must place, in the relevant source files, a statement of the
|
401 |
+
additional terms that apply to those files, or a notice indicating
|
402 |
+
where to find the applicable terms.
|
403 |
+
|
404 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
405 |
+
form of a separately written license, or stated as exceptions;
|
406 |
+
the above requirements apply either way.
|
407 |
+
|
408 |
+
8. Termination.
|
409 |
+
|
410 |
+
You may not propagate or modify a covered work except as expressly
|
411 |
+
provided under this License. Any attempt otherwise to propagate or
|
412 |
+
modify it is void, and will automatically terminate your rights under
|
413 |
+
this License (including any patent licenses granted under the third
|
414 |
+
paragraph of section 11).
|
415 |
+
|
416 |
+
However, if you cease all violation of this License, then your
|
417 |
+
license from a particular copyright holder is reinstated (a)
|
418 |
+
provisionally, unless and until the copyright holder explicitly and
|
419 |
+
finally terminates your license, and (b) permanently, if the copyright
|
420 |
+
holder fails to notify you of the violation by some reasonable means
|
421 |
+
prior to 60 days after the cessation.
|
422 |
+
|
423 |
+
Moreover, your license from a particular copyright holder is
|
424 |
+
reinstated permanently if the copyright holder notifies you of the
|
425 |
+
violation by some reasonable means, this is the first time you have
|
426 |
+
received notice of violation of this License (for any work) from that
|
427 |
+
copyright holder, and you cure the violation prior to 30 days after
|
428 |
+
your receipt of the notice.
|
429 |
+
|
430 |
+
Termination of your rights under this section does not terminate the
|
431 |
+
licenses of parties who have received copies or rights from you under
|
432 |
+
this License. If your rights have been terminated and not permanently
|
433 |
+
reinstated, you do not qualify to receive new licenses for the same
|
434 |
+
material under section 10.
|
435 |
+
|
436 |
+
9. Acceptance Not Required for Having Copies.
|
437 |
+
|
438 |
+
You are not required to accept this License in order to receive or
|
439 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
440 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
441 |
+
to receive a copy likewise does not require acceptance. However,
|
442 |
+
nothing other than this License grants you permission to propagate or
|
443 |
+
modify any covered work. These actions infringe copyright if you do
|
444 |
+
not accept this License. Therefore, by modifying or propagating a
|
445 |
+
covered work, you indicate your acceptance of this License to do so.
|
446 |
+
|
447 |
+
10. Automatic Licensing of Downstream Recipients.
|
448 |
+
|
449 |
+
Each time you convey a covered work, the recipient automatically
|
450 |
+
receives a license from the original licensors, to run, modify and
|
451 |
+
propagate that work, subject to this License. You are not responsible
|
452 |
+
for enforcing compliance by third parties with this License.
|
453 |
+
|
454 |
+
An "entity transaction" is a transaction transferring control of an
|
455 |
+
organization, or substantially all assets of one, or subdividing an
|
456 |
+
organization, or merging organizations. If propagation of a covered
|
457 |
+
work results from an entity transaction, each party to that
|
458 |
+
transaction who receives a copy of the work also receives whatever
|
459 |
+
licenses to the work the party's predecessor in interest had or could
|
460 |
+
give under the previous paragraph, plus a right to possession of the
|
461 |
+
Corresponding Source of the work from the predecessor in interest, if
|
462 |
+
the predecessor has it or can get it with reasonable efforts.
|
463 |
+
|
464 |
+
You may not impose any further restrictions on the exercise of the
|
465 |
+
rights granted or affirmed under this License. For example, you may
|
466 |
+
not impose a license fee, royalty, or other charge for exercise of
|
467 |
+
rights granted under this License, and you may not initiate litigation
|
468 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
469 |
+
any patent claim is infringed by making, using, selling, offering for
|
470 |
+
sale, or importing the Program or any portion of it.
|
471 |
+
|
472 |
+
11. Patents.
|
473 |
+
|
474 |
+
A "contributor" is a copyright holder who authorizes use under this
|
475 |
+
License of the Program or a work on which the Program is based. The
|
476 |
+
work thus licensed is called the contributor's "contributor version".
|
477 |
+
|
478 |
+
A contributor's "essential patent claims" are all patent claims
|
479 |
+
owned or controlled by the contributor, whether already acquired or
|
480 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
481 |
+
by this License, of making, using, or selling its contributor version,
|
482 |
+
but do not include claims that would be infringed only as a
|
483 |
+
consequence of further modification of the contributor version. For
|
484 |
+
purposes of this definition, "control" includes the right to grant
|
485 |
+
patent sublicenses in a manner consistent with the requirements of
|
486 |
+
this License.
|
487 |
+
|
488 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
489 |
+
patent license under the contributor's essential patent claims, to
|
490 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
491 |
+
propagate the contents of its contributor version.
|
492 |
+
|
493 |
+
In the following three paragraphs, a "patent license" is any express
|
494 |
+
agreement or commitment, however denominated, not to enforce a patent
|
495 |
+
(such as an express permission to practice a patent or covenant not to
|
496 |
+
sue for patent infringement). To "grant" such a patent license to a
|
497 |
+
party means to make such an agreement or commitment not to enforce a
|
498 |
+
patent against the party.
|
499 |
+
|
500 |
+
If you convey a covered work, knowingly relying on a patent license,
|
501 |
+
and the Corresponding Source of the work is not available for anyone
|
502 |
+
to copy, free of charge and under the terms of this License, through a
|
503 |
+
publicly available network server or other readily accessible means,
|
504 |
+
then you must either (1) cause the Corresponding Source to be so
|
505 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
506 |
+
patent license for this particular work, or (3) arrange, in a manner
|
507 |
+
consistent with the requirements of this License, to extend the patent
|
508 |
+
license to downstream recipients. "Knowingly relying" means you have
|
509 |
+
actual knowledge that, but for the patent license, your conveying the
|
510 |
+
covered work in a country, or your recipient's use of the covered work
|
511 |
+
in a country, would infringe one or more identifiable patents in that
|
512 |
+
country that you have reason to believe are valid.
|
513 |
+
|
514 |
+
If, pursuant to or in connection with a single transaction or
|
515 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
516 |
+
covered work, and grant a patent license to some of the parties
|
517 |
+
receiving the covered work authorizing them to use, propagate, modify
|
518 |
+
or convey a specific copy of the covered work, then the patent license
|
519 |
+
you grant is automatically extended to all recipients of the covered
|
520 |
+
work and works based on it.
|
521 |
+
|
522 |
+
A patent license is "discriminatory" if it does not include within
|
523 |
+
the scope of its coverage, prohibits the exercise of, or is
|
524 |
+
conditioned on the non-exercise of one or more of the rights that are
|
525 |
+
specifically granted under this License. You may not convey a covered
|
526 |
+
work if you are a party to an arrangement with a third party that is
|
527 |
+
in the business of distributing software, under which you make payment
|
528 |
+
to the third party based on the extent of your activity of conveying
|
529 |
+
the work, and under which the third party grants, to any of the
|
530 |
+
parties who would receive the covered work from you, a discriminatory
|
531 |
+
patent license (a) in connection with copies of the covered work
|
532 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
533 |
+
for and in connection with specific products or compilations that
|
534 |
+
contain the covered work, unless you entered into that arrangement,
|
535 |
+
or that patent license was granted, prior to 28 March 2007.
|
536 |
+
|
537 |
+
Nothing in this License shall be construed as excluding or limiting
|
538 |
+
any implied license or other defenses to infringement that may
|
539 |
+
otherwise be available to you under applicable patent law.
|
540 |
+
|
541 |
+
12. No Surrender of Others' Freedom.
|
542 |
+
|
543 |
+
If conditions are imposed on you (whether by court order, agreement or
|
544 |
+
otherwise) that contradict the conditions of this License, they do not
|
545 |
+
excuse you from the conditions of this License. If you cannot convey a
|
546 |
+
covered work so as to satisfy simultaneously your obligations under this
|
547 |
+
License and any other pertinent obligations, then as a consequence you may
|
548 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
549 |
+
to collect a royalty for further conveying from those to whom you convey
|
550 |
+
the Program, the only way you could satisfy both those terms and this
|
551 |
+
License would be to refrain entirely from conveying the Program.
|
552 |
+
|
553 |
+
13. Use with the GNU Affero General Public License.
|
554 |
+
|
555 |
+
Notwithstanding any other provision of this License, you have
|
556 |
+
permission to link or combine any covered work with a work licensed
|
557 |
+
under version 3 of the GNU Affero General Public License into a single
|
558 |
+
combined work, and to convey the resulting work. The terms of this
|
559 |
+
License will continue to apply to the part which is the covered work,
|
560 |
+
but the special requirements of the GNU Affero General Public License,
|
561 |
+
section 13, concerning interaction through a network will apply to the
|
562 |
+
combination as such.
|
563 |
+
|
564 |
+
14. Revised Versions of this License.
|
565 |
+
|
566 |
+
The Free Software Foundation may publish revised and/or new versions of
|
567 |
+
the GNU General Public License from time to time. Such new versions will
|
568 |
+
be similar in spirit to the present version, but may differ in detail to
|
569 |
+
address new problems or concerns.
|
570 |
+
|
571 |
+
Each version is given a distinguishing version number. If the
|
572 |
+
Program specifies that a certain numbered version of the GNU General
|
573 |
+
Public License "or any later version" applies to it, you have the
|
574 |
+
option of following the terms and conditions either of that numbered
|
575 |
+
version or of any later version published by the Free Software
|
576 |
+
Foundation. If the Program does not specify a version number of the
|
577 |
+
GNU General Public License, you may choose any version ever published
|
578 |
+
by the Free Software Foundation.
|
579 |
+
|
580 |
+
If the Program specifies that a proxy can decide which future
|
581 |
+
versions of the GNU General Public License can be used, that proxy's
|
582 |
+
public statement of acceptance of a version permanently authorizes you
|
583 |
+
to choose that version for the Program.
|
584 |
+
|
585 |
+
Later license versions may give you additional or different
|
586 |
+
permissions. However, no additional obligations are imposed on any
|
587 |
+
author or copyright holder as a result of your choosing to follow a
|
588 |
+
later version.
|
589 |
+
|
590 |
+
15. Disclaimer of Warranty.
|
591 |
+
|
592 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
593 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
594 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
595 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
596 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
597 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
598 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
599 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
600 |
+
|
601 |
+
16. Limitation of Liability.
|
602 |
+
|
603 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
604 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
605 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
606 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
607 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
608 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
609 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
610 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
611 |
+
SUCH DAMAGES.
|
612 |
+
|
613 |
+
17. Interpretation of Sections 15 and 16.
|
614 |
+
|
615 |
+
If the disclaimer of warranty and limitation of liability provided
|
616 |
+
above cannot be given local legal effect according to their terms,
|
617 |
+
reviewing courts shall apply local law that most closely approximates
|
618 |
+
an absolute waiver of all civil liability in connection with the
|
619 |
+
Program, unless a warranty or assumption of liability accompanies a
|
620 |
+
copy of the Program in return for a fee.
|
621 |
+
|
622 |
+
END OF TERMS AND CONDITIONS
|
623 |
+
|
624 |
+
How to Apply These Terms to Your New Programs
|
625 |
+
|
626 |
+
If you develop a new program, and you want it to be of the greatest
|
627 |
+
possible use to the public, the best way to achieve this is to make it
|
628 |
+
free software which everyone can redistribute and change under these terms.
|
629 |
+
|
630 |
+
To do so, attach the following notices to the program. It is safest
|
631 |
+
to attach them to the start of each source file to most effectively
|
632 |
+
state the exclusion of warranty; and each file should have at least
|
633 |
+
the "copyright" line and a pointer to where the full notice is found.
|
634 |
+
|
635 |
+
<one line to give the program's name and a brief idea of what it does.>
|
636 |
+
Copyright (C) <year> <name of author>
|
637 |
+
|
638 |
+
This program is free software: you can redistribute it and/or modify
|
639 |
+
it under the terms of the GNU General Public License as published by
|
640 |
+
the Free Software Foundation, either version 3 of the License, or
|
641 |
+
(at your option) any later version.
|
642 |
+
|
643 |
+
This program is distributed in the hope that it will be useful,
|
644 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
645 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
646 |
+
GNU General Public License for more details.
|
647 |
+
|
648 |
+
You should have received a copy of the GNU General Public License
|
649 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
650 |
+
|
651 |
+
Also add information on how to contact you by electronic and paper mail.
|
652 |
+
|
653 |
+
If the program does terminal interaction, make it output a short
|
654 |
+
notice like this when it starts in an interactive mode:
|
655 |
+
|
656 |
+
<program> Copyright (C) <year> <name of author>
|
657 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
658 |
+
This is free software, and you are welcome to redistribute it
|
659 |
+
under certain conditions; type `show c' for details.
|
660 |
+
|
661 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
662 |
+
parts of the General Public License. Of course, your program's commands
|
663 |
+
might be different; for a GUI interface, you would use an "about box".
|
664 |
+
|
665 |
+
You should also get your employer (if you work as a programmer) or school,
|
666 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
667 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
668 |
+
<http://www.gnu.org/licenses/>.
|
669 |
+
|
670 |
+
The GNU General Public License does not permit incorporating your program
|
671 |
+
into proprietary programs. If your program is a subroutine library, you
|
672 |
+
may consider it more useful to permit linking proprietary applications with
|
673 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
674 |
+
Public License instead of this License. But first, please read
|
675 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
all-in-one-wp-migration.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: All-in-One WP Migration
|
4 |
+
* Plugin URI: http://servmask.com/
|
5 |
+
* Description: Migration tool for all your blog data
|
6 |
+
* Author: ServMask
|
7 |
+
* Author URI: http://servmask.com/
|
8 |
+
* Version: 1.0.0
|
9 |
+
*
|
10 |
+
* Copyright (C) 2013 ServMask LLC
|
11 |
+
*
|
12 |
+
* This program is free software: you can redistribute it and/or modify
|
13 |
+
* it under the terms of the GNU General Public License as published by
|
14 |
+
* the Free Software Foundation, either version 3 of the License, or
|
15 |
+
* (at your option) any later version.
|
16 |
+
*
|
17 |
+
* This program is distributed in the hope that it will be useful,
|
18 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
+
* GNU General Public License for more details.
|
21 |
+
*
|
22 |
+
* You should have received a copy of the GNU General Public License
|
23 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
24 |
+
*/
|
25 |
+
@set_time_limit( 0 );
|
26 |
+
@ini_set( 'max_input_time', '-1' );
|
27 |
+
|
28 |
+
// include constants
|
29 |
+
require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'constants.php' );
|
30 |
+
|
31 |
+
// include loader
|
32 |
+
require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'loader.php' );
|
33 |
+
|
34 |
+
// ==========================================================================
|
35 |
+
// = All app initialization is done in Ai1wm_Main_Controller __constructor. =
|
36 |
+
// ==========================================================================
|
37 |
+
$main_controller = new Ai1wm_Main_Controller();
|
constants.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
// ===============
|
20 |
+
// = Plugin Name =
|
21 |
+
// ===============
|
22 |
+
define( 'AI1WM_PLUGIN_NAME', 'all-in-one-wp-migration' );
|
23 |
+
|
24 |
+
// ===================
|
25 |
+
// = Plugin Basename =
|
26 |
+
// ===================
|
27 |
+
define( 'AI1WM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
28 |
+
|
29 |
+
// ===============
|
30 |
+
// = Plugin Path =
|
31 |
+
// ===============
|
32 |
+
define( 'AI1WM_PATH', dirname( __FILE__ ) );
|
33 |
+
|
34 |
+
// ============
|
35 |
+
// = Lib Path =
|
36 |
+
// ============
|
37 |
+
define( 'AI1WM_LIB_PATH', AI1WM_PATH . DIRECTORY_SEPARATOR . 'lib' );
|
38 |
+
|
39 |
+
// ===================
|
40 |
+
// = Controller Path =
|
41 |
+
// ===================
|
42 |
+
define( 'AI1WM_CONTROLLER_PATH', AI1WM_LIB_PATH . DIRECTORY_SEPARATOR . 'controller' );
|
43 |
+
|
44 |
+
// ==============
|
45 |
+
// = Model Path =
|
46 |
+
// ==============
|
47 |
+
define( 'AI1WM_MODEL_PATH', AI1WM_LIB_PATH . DIRECTORY_SEPARATOR . 'model' );
|
48 |
+
|
49 |
+
// =============
|
50 |
+
// = View Path =
|
51 |
+
// =============
|
52 |
+
define( 'BANDAR_TEMPLATES_PATH', AI1WM_LIB_PATH . DIRECTORY_SEPARATOR . 'view' );
|
53 |
+
|
54 |
+
// ==================
|
55 |
+
// = Exception Path =
|
56 |
+
// ==================
|
57 |
+
define( 'AI1WM_EXCEPTION_PATH', AI1WM_LIB_PATH . DIRECTORY_SEPARATOR . 'exception' );
|
58 |
+
|
59 |
+
// ===================
|
60 |
+
// = Vendor Path =
|
61 |
+
// ===================
|
62 |
+
define( 'AI1WM_VENDOR_PATH', AI1WM_LIB_PATH . DIRECTORY_SEPARATOR . 'vendor' );
|
63 |
+
|
64 |
+
// ==============
|
65 |
+
// = Plugin Url =
|
66 |
+
// ==============
|
67 |
+
define( 'AI1WM_URL', plugins_url( '', __FILE__ ) );
|
68 |
+
|
69 |
+
// ==============
|
70 |
+
// = ServMask Feedback Url =
|
71 |
+
// ==============
|
72 |
+
define( 'AI1WM_FEEDBACK_URL', 'https://servmask.com/ai1wm/feedback/create' );
|
lib/controller/class-ai1wm-export-controller.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ai1wm_Export_Controller
|
20 |
+
{
|
21 |
+
public static function index() {
|
22 |
+
$model = new Ai1wm_Export;
|
23 |
+
Ai1wm_Template::render( 'export/index' );
|
24 |
+
}
|
25 |
+
|
26 |
+
public static function export() {
|
27 |
+
if ( isset( $_POST['options'] ) && ( $options = $_POST['options'] ) ) {
|
28 |
+
$output_file = tmpfile();
|
29 |
+
|
30 |
+
// Export archive
|
31 |
+
$model = new Ai1wm_Export;
|
32 |
+
$file = $model->export( $output_file, $options );
|
33 |
+
|
34 |
+
// Send the file to the user
|
35 |
+
header( 'Content-Description: File Transfer' );
|
36 |
+
header( 'Content-Type: application/octet-stream' );
|
37 |
+
header(
|
38 |
+
sprintf(
|
39 |
+
'Content-Disposition: attachment; filename=%s-%s.%s',
|
40 |
+
Ai1wm_Export::EXPORT_ARCHIVE_NAME,
|
41 |
+
time(),
|
42 |
+
'zip'
|
43 |
+
)
|
44 |
+
);
|
45 |
+
header( 'Content-Transfer-Encoding: binary' );
|
46 |
+
header( 'Expires: 0' );
|
47 |
+
header( 'Cache-Control: must-revalidate' );
|
48 |
+
header( 'Pragma: public' );
|
49 |
+
header( 'Content-Length: ' . filesize( $file ) );
|
50 |
+
|
51 |
+
// Clear output buffering and read file content
|
52 |
+
if ( ob_get_length() ) {
|
53 |
+
ob_end_clean();
|
54 |
+
}
|
55 |
+
readfile( $file );
|
56 |
+
exit;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
lib/controller/class-ai1wm-import-controller.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ai1wm_Import_Controller
|
20 |
+
{
|
21 |
+
public static function index() {
|
22 |
+
Ai1wm_Template::render( 'import/index' );
|
23 |
+
}
|
24 |
+
|
25 |
+
public static function upload_file() {
|
26 |
+
$result = array();
|
27 |
+
|
28 |
+
if ( isset( $_FILES['input_file'] ) && ( $input_file = $_FILES['input_file'] ) ) {
|
29 |
+
$model = new Ai1wm_Import;
|
30 |
+
$result = $model->import( $input_file );
|
31 |
+
}
|
32 |
+
|
33 |
+
echo json_encode( $result );
|
34 |
+
exit;
|
35 |
+
}
|
36 |
+
}
|
lib/controller/class-ai1wm-main-controller.php
ADDED
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ai1wm_Main_Controller
|
20 |
+
{
|
21 |
+
|
22 |
+
/**
|
23 |
+
* [init description]
|
24 |
+
* @return [type] [description]
|
25 |
+
*/
|
26 |
+
public function __construct() {
|
27 |
+
register_activation_hook(
|
28 |
+
AI1WM_PLUGIN_NAME .
|
29 |
+
DIRECTORY_SEPARATOR .
|
30 |
+
AI1WM_PLUGIN_NAME .
|
31 |
+
'.php',
|
32 |
+
array( $this, 'activation_hook' )
|
33 |
+
);
|
34 |
+
$this
|
35 |
+
->activate_actions()
|
36 |
+
->activate_filters();
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Activation hook callback
|
41 |
+
* @return Object Instance of this class
|
42 |
+
*/
|
43 |
+
public function activation_hook() {
|
44 |
+
// Load plugin text domain.
|
45 |
+
// $this->load_textdomain();
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Initializes language domain for the plugin
|
50 |
+
* @return Object Instance of this class
|
51 |
+
*/
|
52 |
+
private function load_textdomain() {
|
53 |
+
return $this;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Register listeners for actions
|
58 |
+
* @return Object Instance of this class
|
59 |
+
*/
|
60 |
+
private function activate_actions() {
|
61 |
+
add_action( 'admin_head', array( $this, 'admin_head' ) );
|
62 |
+
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
63 |
+
add_action( 'init', array( $this, 'router' ) );
|
64 |
+
add_action( 'wp_ajax_leave_feedback', array( $this, 'leave_feedback' ) );
|
65 |
+
add_action( 'wp_ajax_upload_file', 'Ai1wm_Import_Controller::upload_file' );
|
66 |
+
|
67 |
+
// Enable or disable maintenance mode
|
68 |
+
if ( get_option( 'maintenance_mode' ) ) {
|
69 |
+
add_action( 'get_header', array( $this, 'activate_maintenance_mode' ) );
|
70 |
+
}
|
71 |
+
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Register listeners for filters
|
77 |
+
* @return Object Instance of this class
|
78 |
+
*/
|
79 |
+
private function activate_filters() {
|
80 |
+
return $this;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Enable or disable Wordpress maintenance mode
|
85 |
+
* @return void
|
86 |
+
*/
|
87 |
+
public function activate_maintenance_mode() {
|
88 |
+
$title = _( 'Maintenance Mode' );
|
89 |
+
$body = sprintf(
|
90 |
+
'<h1>%s</h1><p>%s<br /><strong>%s%s</strong></p>',
|
91 |
+
_( 'Website Under Maintenance' ),
|
92 |
+
_( 'Hi, our Website is currently undergoing scheduled maintenance' ),
|
93 |
+
_( 'Please check back very soon.' ),
|
94 |
+
_( 'Sorry for the inconvenience!' )
|
95 |
+
);
|
96 |
+
|
97 |
+
wp_die( $body, $title );
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Submit customer feedback to ServMask.com
|
102 |
+
* @return void
|
103 |
+
*/
|
104 |
+
public function leave_feedback() {
|
105 |
+
$errors = array();
|
106 |
+
|
107 |
+
// Set E-mail
|
108 |
+
$email = null;
|
109 |
+
if ( isset( $_POST['email'] ) ) {
|
110 |
+
$email = trim( $_POST['email'] );
|
111 |
+
}
|
112 |
+
|
113 |
+
// Set Message
|
114 |
+
$message = null;
|
115 |
+
if ( isset( $_POST['email'] ) ) {
|
116 |
+
$message = trim( $_POST['message'] );
|
117 |
+
}
|
118 |
+
|
119 |
+
// Set Terms
|
120 |
+
$terms = false;
|
121 |
+
if ( isset( $_POST['terms'] ) ) {
|
122 |
+
$terms = (bool) $_POST['terms'];
|
123 |
+
}
|
124 |
+
|
125 |
+
// Submit feedback to ServMask
|
126 |
+
if ( ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
127 |
+
$errors[] = 'Your email is not valid.';
|
128 |
+
} else if ( empty( $message ) ) {
|
129 |
+
$errors[] = 'Please enter comments in the text area.';
|
130 |
+
} else if ( ! $terms ) {
|
131 |
+
$errors[] = 'Please accept feedback term conditions.';
|
132 |
+
} else {
|
133 |
+
wp_remote_post(
|
134 |
+
AI1WM_FEEDBACK_URL,
|
135 |
+
array(
|
136 |
+
'body' => array(
|
137 |
+
'email' => $email,
|
138 |
+
'message' => $message,
|
139 |
+
),
|
140 |
+
)
|
141 |
+
);
|
142 |
+
}
|
143 |
+
|
144 |
+
echo json_encode( array( 'errors' => $errors ) );
|
145 |
+
exit;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Register plugin menus
|
150 |
+
*/
|
151 |
+
public function admin_menu() {
|
152 |
+
// top level WP Migration menu
|
153 |
+
add_menu_page(
|
154 |
+
'Site Migration',
|
155 |
+
'Site Migration',
|
156 |
+
'export',
|
157 |
+
'site-migration-export',
|
158 |
+
'Ai1wm_Export_Controller::index',
|
159 |
+
'',
|
160 |
+
76
|
161 |
+
);
|
162 |
+
|
163 |
+
// sublevel Import menu
|
164 |
+
$export_page_hook_suffix = add_submenu_page(
|
165 |
+
'site-migration-export',
|
166 |
+
'Export',
|
167 |
+
'Export',
|
168 |
+
'export',
|
169 |
+
'site-migration-export',
|
170 |
+
'Ai1wm_Export_Controller::index'
|
171 |
+
);
|
172 |
+
add_action(
|
173 |
+
'admin_print_scripts-' . $export_page_hook_suffix,
|
174 |
+
array( $this, 'register_export_scripts_and_styles' )
|
175 |
+
);
|
176 |
+
|
177 |
+
// sublevel Import menu
|
178 |
+
$import_page_hook_suffix = add_submenu_page(
|
179 |
+
'site-migration-export',
|
180 |
+
'Import',
|
181 |
+
'Import',
|
182 |
+
'import',
|
183 |
+
'site-migration-import',
|
184 |
+
'Ai1wm_Import_Controller::index'
|
185 |
+
);
|
186 |
+
add_action(
|
187 |
+
'admin_print_scripts-' . $import_page_hook_suffix,
|
188 |
+
array( $this, 'register_import_scripts_and_styles' )
|
189 |
+
);
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Outputs menu icon between head tags
|
194 |
+
*/
|
195 |
+
public function admin_head() {
|
196 |
+
global $wp_version;
|
197 |
+
$_wp_version = $wp_version;
|
198 |
+
if ( strlen( $_wp_version ) === '3' ) {
|
199 |
+
$_wp_version += '.0';
|
200 |
+
} else if ( strlen( $_wp_version ) === '1' ) {
|
201 |
+
$_wp_version += '0.0';
|
202 |
+
}
|
203 |
+
$url = AI1WM_URL . '/lib/view/assets';
|
204 |
+
?>
|
205 |
+
<style type="text/css" media="all">
|
206 |
+
@font-face {
|
207 |
+
font-family: 'servmask';
|
208 |
+
src:url('<?php echo esc_url( $url ); ?>/font/servmask.eot');
|
209 |
+
src:url('<?php echo esc_url( $url ); ?>/font/servmask.eot?#iefix') format('embedded-opentype'),
|
210 |
+
url('<?php echo esc_url( $url ); ?>/font/servmask.woff') format('woff'),
|
211 |
+
url('<?php echo esc_url( $url ); ?>/font/servmask.ttf') format('truetype'),
|
212 |
+
url('<?php echo esc_url( $url ); ?>/font/servmask.svg#servmask') format('svg');
|
213 |
+
font-weight: normal;
|
214 |
+
font-style: normal;
|
215 |
+
}
|
216 |
+
<?php if ( version_compare( $_wp_version, '3.8', '<' ) ) : ?>
|
217 |
+
.toplevel_page_site-migration-export > div.wp-menu-image {
|
218 |
+
background: none !important;
|
219 |
+
}
|
220 |
+
.toplevel_page_site-migration-export > div.wp-menu-image:before {
|
221 |
+
line-height: 27px !important;
|
222 |
+
content: '\e603' !important;
|
223 |
+
font-family: 'servmask' !important;
|
224 |
+
speak: none !important;
|
225 |
+
font-style: normal !important;
|
226 |
+
font-weight: normal !important;
|
227 |
+
font-variant: normal !important;
|
228 |
+
text-transform: none !important;
|
229 |
+
margin-left: 7px;
|
230 |
+
/* Better Font Rendering =========== */
|
231 |
+
-webkit-font-smoothing: antialiased !important;
|
232 |
+
-moz-osx-font-smoothing: grayscale !important;
|
233 |
+
}
|
234 |
+
<?php else : ?>
|
235 |
+
.toplevel_page_site-migration-export > div.wp-menu-image:before {
|
236 |
+
content: '\e603' !important;
|
237 |
+
font-family: 'servmask' !important;
|
238 |
+
speak: none !important;
|
239 |
+
font-style: normal !important;
|
240 |
+
font-weight: normal !important;
|
241 |
+
font-variant: normal !important;
|
242 |
+
text-transform: none !important;
|
243 |
+
line-height: 1 !important;
|
244 |
+
/* Better Font Rendering =========== */
|
245 |
+
-webkit-font-smoothing: antialiased !important;
|
246 |
+
-moz-osx-font-smoothing: grayscale !important;
|
247 |
+
}
|
248 |
+
<?php endif; ?>
|
249 |
+
</style>
|
250 |
+
<?php
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Register scripts and styles for Export Controller
|
255 |
+
*/
|
256 |
+
public function register_export_scripts_and_styles() {
|
257 |
+
wp_enqueue_script(
|
258 |
+
'ai1wm-js-export',
|
259 |
+
Ai1wm_Template::asset_link( 'javascript/export.min.js' ),
|
260 |
+
array( 'plupload-all', 'jquery' )
|
261 |
+
);
|
262 |
+
wp_enqueue_style(
|
263 |
+
'ai1wm-css-export',
|
264 |
+
Ai1wm_Template::asset_link( 'css/export.min.css' )
|
265 |
+
);
|
266 |
+
$feedback_init = array(
|
267 |
+
'ajax' => array(
|
268 |
+
'url' => admin_url( 'admin-ajax.php' ) . '?action=leave_feedback',
|
269 |
+
),
|
270 |
+
);
|
271 |
+
wp_localize_script( 'ai1wm-js-export', 'ai1wm_feedback', $feedback_init );
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Register scripts and styles for Import Controller
|
276 |
+
*/
|
277 |
+
public function register_import_scripts_and_styles() {
|
278 |
+
wp_enqueue_script(
|
279 |
+
'ai1wm-js-import',
|
280 |
+
Ai1wm_Template::asset_link( 'javascript/import.min.js' ),
|
281 |
+
array( 'plupload-all', 'jquery' )
|
282 |
+
);
|
283 |
+
wp_enqueue_style(
|
284 |
+
'ai1wm-css-import',
|
285 |
+
Ai1wm_Template::asset_link( 'css/import.min.css' )
|
286 |
+
);
|
287 |
+
$plupload_init = array(
|
288 |
+
'runtimes' => 'html5,silverlight,flash,html4',
|
289 |
+
'browse_button' => 'ai1wm-browse-button',
|
290 |
+
'container' => 'ai1wm-plupload-upload-ui',
|
291 |
+
'drop_element' => 'ai1wm-drag-drop-area',
|
292 |
+
'file_data_name' => 'input_file',
|
293 |
+
'multiple_queues' => false,
|
294 |
+
'max_file_size' => wp_max_upload_size() . 'b',
|
295 |
+
'url' => admin_url( 'admin-ajax.php' ),
|
296 |
+
'flash_swf_url' => includes_url(
|
297 |
+
'js/plupload/plupload.flash.swf'
|
298 |
+
),
|
299 |
+
'silverlight_xap_url' => includes_url(
|
300 |
+
'js/plupload/plupload.silverlight.xap'
|
301 |
+
),
|
302 |
+
'filters' => array(
|
303 |
+
array(
|
304 |
+
'title' => __( 'Allowed Files' ),
|
305 |
+
'extensions' => 'zip',
|
306 |
+
),
|
307 |
+
),
|
308 |
+
'multipart' => true,
|
309 |
+
'urlstream_upload' => true,
|
310 |
+
'multipart_params' => array(
|
311 |
+
'action' => 'upload_file',
|
312 |
+
),
|
313 |
+
);
|
314 |
+
wp_localize_script( 'ai1wm-js-import', 'ai1wm_uploader', $plupload_init );
|
315 |
+
$feedback_init = array(
|
316 |
+
'ajax' => array(
|
317 |
+
'url' => admin_url( 'admin-ajax.php' ) . '?action=leave_feedback',
|
318 |
+
),
|
319 |
+
);
|
320 |
+
wp_localize_script( 'ai1wm-js-import', 'ai1wm_feedback', $feedback_init );
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Register initial router
|
325 |
+
*/
|
326 |
+
public function router() {
|
327 |
+
if ( isset( $_POST['options']['action'] ) && ( $action = $_POST['options']['action'] ) ) {
|
328 |
+
switch ( $action ) {
|
329 |
+
case 'export':
|
330 |
+
Ai1wm_Export_Controller::export();
|
331 |
+
break;
|
332 |
+
|
333 |
+
case 'staging':
|
334 |
+
Ai1wm_Staging_Controller::deploy();
|
335 |
+
break;
|
336 |
+
|
337 |
+
case 'production':
|
338 |
+
Ai1wm_Production_Controller::deploy();
|
339 |
+
break;
|
340 |
+
}
|
341 |
+
}
|
342 |
+
}
|
343 |
+
}
|
lib/model/class-ai1wm-export.php
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ai1wm_Export
|
20 |
+
{
|
21 |
+
const EXPORT_ARCHIVE_NAME = 'dump';
|
22 |
+
|
23 |
+
const EXPORT_DATABASE_NAME = 'database.sql';
|
24 |
+
|
25 |
+
const EXPORT_PACKAGE_NAME = 'package.json';
|
26 |
+
|
27 |
+
const EXPORT_MEDIA_NAME = 'media';
|
28 |
+
|
29 |
+
const EXPORT_THEMES_NAME = 'themes';
|
30 |
+
|
31 |
+
protected $connection = null;
|
32 |
+
|
33 |
+
public function __construct() {
|
34 |
+
$this->connection = new Mysqldump( DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, 'mysql' );
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Export archive file (database, media, package.json)
|
39 |
+
*
|
40 |
+
* @param resource $output_file Pointer to file resource
|
41 |
+
* @param array $options Export settings
|
42 |
+
* @return string Absolute file path
|
43 |
+
*/
|
44 |
+
public function export( $output_file, array $options = array() ) {
|
45 |
+
$archive = new Zipper( $output_file );
|
46 |
+
|
47 |
+
// Should we export database?
|
48 |
+
if ( ! isset( $options['export-database' ] ) ) {
|
49 |
+
$database_file = tmpfile();
|
50 |
+
$archive->addFile(
|
51 |
+
$this->prepare_database( $database_file, $options ),
|
52 |
+
self::EXPORT_DATABASE_NAME
|
53 |
+
);
|
54 |
+
}
|
55 |
+
|
56 |
+
// Should we export media?
|
57 |
+
if ( ! isset( $options['export-media'] ) ) {
|
58 |
+
$archive->addDir(
|
59 |
+
$this->prepare_media( $options ),
|
60 |
+
self::EXPORT_MEDIA_NAME
|
61 |
+
);
|
62 |
+
}
|
63 |
+
|
64 |
+
// Should we export themes?
|
65 |
+
if ( ! isset( $options['export-themes'] ) ) {
|
66 |
+
$archive->addDir(
|
67 |
+
$this->prepare_themes( $options ),
|
68 |
+
self::EXPORT_THEMES_NAME
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
// Add package
|
73 |
+
$archive->addFromString(
|
74 |
+
self::EXPORT_PACKAGE_NAME,
|
75 |
+
$this->prepare_package( $options )
|
76 |
+
);
|
77 |
+
|
78 |
+
return $archive->getArchive();
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Export database in SQL format
|
83 |
+
*
|
84 |
+
* @param resource $output_file Pointer to file resource
|
85 |
+
* @param array $options Export settings
|
86 |
+
* @return string Absolute file path
|
87 |
+
*/
|
88 |
+
public function prepare_database( $output_file, array $options = array() ) {
|
89 |
+
global $wpdb;
|
90 |
+
|
91 |
+
$settings = array(
|
92 |
+
'include-tables' => isset( $options['include-tables'] ) ? $options['include-tables'] : array(),
|
93 |
+
'exclude-tables' => isset( $options['exclude-tables'] ) ? $options['exclude-tables'] : array(),
|
94 |
+
'compress' => 'None',
|
95 |
+
'no-data' => isset( $options['export-table-data'] ),
|
96 |
+
'add-drop-table' => isset( $options['add-drop-table'] ),
|
97 |
+
'single-transaction' => isset( $options['export-single-transaction'] ),
|
98 |
+
'lock-tables' => isset( $options['export-lock-tables'] ),
|
99 |
+
'add-locks' => true,
|
100 |
+
'extended-insert' => true,
|
101 |
+
);
|
102 |
+
|
103 |
+
$clauses = array();
|
104 |
+
|
105 |
+
// Spam comments
|
106 |
+
if ( isset( $options['export-spam-comments'] ) ) {
|
107 |
+
$clauses[ $wpdb->comments ] = ' WHERE comment_approved != "spam" ORDER BY comment_ID ';
|
108 |
+
$clauses[ $wpdb->commentmeta ] = sprintf(
|
109 |
+
' INNER JOIN `%1$s`
|
110 |
+
ON `%1$s`.comment_ID = `%2$s`.comment_id AND `%1$s`.comment_approved != \'spam\'
|
111 |
+
ORDER BY `%2$s`.meta_id ', $wpdb->comments, $wpdb->commentmeta
|
112 |
+
);
|
113 |
+
}
|
114 |
+
|
115 |
+
// Post revisions
|
116 |
+
if ( isset( $options['export-revisions'] ) ) {
|
117 |
+
$clauses[ $wpdb->posts ] = ' WHERE post_type != "revision" ORDER BY ID ';
|
118 |
+
}
|
119 |
+
|
120 |
+
// No table data, but leave Administrator account unchanged
|
121 |
+
if ( isset( $options['export-table-data'] ) ) {
|
122 |
+
$clauses[ $wpdb->users ] = ' WHERE id = 1 ';
|
123 |
+
$clauses[ $wpdb->usermeta ] = ' WHERE user_id = 1 ';
|
124 |
+
}
|
125 |
+
|
126 |
+
$output_meta = stream_get_meta_data( $output_file );
|
127 |
+
|
128 |
+
// Export Database
|
129 |
+
$this->connection->set( $settings );
|
130 |
+
$this->connection->start( $output_meta['uri'], $clauses );
|
131 |
+
|
132 |
+
// Replace Old/New Values
|
133 |
+
if (
|
134 |
+
isset( $options['replace'] ) &&
|
135 |
+
( $replace = $options['replace'] )
|
136 |
+
) {
|
137 |
+
$old_values = array();
|
138 |
+
$new_values = array();
|
139 |
+
for ( $i = 0; $i < count( $replace['old-value'] ); $i++ ) {
|
140 |
+
if (
|
141 |
+
! empty( $replace['old-value'][$i] ) &&
|
142 |
+
! empty( $replace['new-value'][$i] ) &&
|
143 |
+
$replace['old-value'][$i] != $replace['new-value'][$i]
|
144 |
+
) {
|
145 |
+
$old_values[] = $replace['old-value'][$i];
|
146 |
+
$new_values[] = $replace['new-value'][$i];
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
// Do String Replacement
|
151 |
+
if ( $old_values && $new_values ) {
|
152 |
+
$data = str_replace(
|
153 |
+
$old_values,
|
154 |
+
$new_values,
|
155 |
+
stream_get_contents( $output_file )
|
156 |
+
);
|
157 |
+
|
158 |
+
// Replace serialized string values
|
159 |
+
$data = preg_replace(
|
160 |
+
'!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!e',
|
161 |
+
"'s:'.strlen( $this->unescape_mysql( '$3' ) ).':\"'. $this->unescape_quotes( '$3' ) .'\";'",
|
162 |
+
$data
|
163 |
+
);
|
164 |
+
if ( $data ) {
|
165 |
+
ftruncate( $output_file, 0 );
|
166 |
+
rewind( $output_file );
|
167 |
+
fwrite( $output_file, $data );
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
|
173 |
+
return $output_meta['uri'];
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Unescape to avoid dump-text issues
|
178 |
+
*
|
179 |
+
* @param [type] $value [description]
|
180 |
+
* @return [type] [description]
|
181 |
+
*/
|
182 |
+
public function unescape_mysql( $value ) {
|
183 |
+
return str_replace(
|
184 |
+
array( '\\\\', '\\0', "\\n", "\\r", '\Z', "\'", '\"', ),
|
185 |
+
array( '\\', '\0', "\n", "\r", "\x1a", "'", '"', ),
|
186 |
+
$value
|
187 |
+
);
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Fix strange behaviour if you have escaped quotes in your replacement
|
192 |
+
*
|
193 |
+
* @param [type] $value [description]
|
194 |
+
* @return [type] [description]
|
195 |
+
*/
|
196 |
+
public function unescape_quotes( $value ) {
|
197 |
+
return str_replace( '\"', '"', $value );
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Export media library base directory
|
202 |
+
*
|
203 |
+
* @param array $options Export settings
|
204 |
+
* @return string Media base directory
|
205 |
+
*/
|
206 |
+
public function prepare_media( array $options = array() ) {
|
207 |
+
if ( ! isset( $options['export-media'] ) ) {
|
208 |
+
$upload_dir = wp_upload_dir();
|
209 |
+
|
210 |
+
return $upload_dir['basedir'];
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Export themes root directory
|
216 |
+
*
|
217 |
+
* @param array $options Export settings
|
218 |
+
* @return string Themes root directory
|
219 |
+
*/
|
220 |
+
public function prepare_themes( array $options = array() ) {
|
221 |
+
if ( ! isset( $options['export-themes'] ) ) {
|
222 |
+
$themes_dir = get_theme_root();
|
223 |
+
|
224 |
+
return $themes_dir;
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Export package json file which includes information about installed plugins and etc.
|
230 |
+
*
|
231 |
+
* @param array $options Export settings
|
232 |
+
* @return string Package config
|
233 |
+
*/
|
234 |
+
public function prepare_package( array $options = array() ) {
|
235 |
+
$config = array();
|
236 |
+
|
237 |
+
$config['Plugins'] = array();
|
238 |
+
if ( ! isset( $options['export-plugins' ] ) ) {
|
239 |
+
if ( isset( $options['include-plugins'] ) && ( $include_plugins = $options['include-plugins'] ) ) {
|
240 |
+
foreach ( $include_plugins as $key => $plugin_name ) {
|
241 |
+
$slug = current( explode( DIRECTORY_SEPARATOR, $key ) );
|
242 |
+
|
243 |
+
$config['Plugins'][] = array(
|
244 |
+
'Name' => $plugin_name,
|
245 |
+
'Slug' => $slug,
|
246 |
+
);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
return json_encode( $config );
|
252 |
+
}
|
253 |
+
}
|
lib/model/class-ai1wm-import.php
ADDED
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ai1wm_Import
|
20 |
+
{
|
21 |
+
|
22 |
+
public function __construct() {
|
23 |
+
$this->connection = new Mysqldump( DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, 'mysql' );
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Import archive file (database, media, package.json)
|
28 |
+
*
|
29 |
+
* @param array $input_file Upload file parameters
|
30 |
+
* @return array List of messages
|
31 |
+
*/
|
32 |
+
public function import( $input_file ) {
|
33 |
+
$errors = array();
|
34 |
+
|
35 |
+
if ( empty( $input_file['error'] ) ) {
|
36 |
+
// Create temporary directory
|
37 |
+
$extract_to = sys_get_temp_dir() . DIRECTORY_SEPARATOR
|
38 |
+
. uniqid()
|
39 |
+
. DIRECTORY_SEPARATOR;
|
40 |
+
if ( ! is_dir( $extract_to ) ) {
|
41 |
+
mkdir( $extract_to );
|
42 |
+
}
|
43 |
+
|
44 |
+
// Extract archive to a temporary directory
|
45 |
+
$archive = new Zipper( $input_file['tmp_name'] );
|
46 |
+
$archive->extractTo( $extract_to );
|
47 |
+
$archive->close();
|
48 |
+
|
49 |
+
// Verify whether this arhive is valid
|
50 |
+
if ( $this->is_valid( $extract_to ) ) {
|
51 |
+
// Enable maintenance mode
|
52 |
+
$this->maintenance_mode( true );
|
53 |
+
|
54 |
+
// Media base directory
|
55 |
+
$upload_dir = wp_upload_dir();
|
56 |
+
$upload_basedir = $upload_dir['basedir'] . DIRECTORY_SEPARATOR;
|
57 |
+
if ( ! is_dir( $upload_basedir ) ) {
|
58 |
+
mkdir( $upload_basedir );
|
59 |
+
}
|
60 |
+
|
61 |
+
// Themes base directory
|
62 |
+
$themes_dir = get_theme_root();
|
63 |
+
$themes_basedir = $themes_dir . DIRECTORY_SEPARATOR;
|
64 |
+
if ( ! is_dir( $themes_basedir ) ) {
|
65 |
+
mkdir( $themes_basedir );
|
66 |
+
}
|
67 |
+
|
68 |
+
// Backup database
|
69 |
+
$model = new Ai1wm_Export;
|
70 |
+
$database_file = tmpfile();
|
71 |
+
$options = array( 'add-drop-table' => true, 'export-single-transaction' => true );
|
72 |
+
$model->prepare_database( $database_file, $options );
|
73 |
+
|
74 |
+
// Truncate database
|
75 |
+
$this->connection->truncateDatabase();
|
76 |
+
|
77 |
+
// Import database
|
78 |
+
$this->connection->importFromFile( $extract_to . Ai1wm_Export::EXPORT_DATABASE_NAME );
|
79 |
+
|
80 |
+
// Backup media files
|
81 |
+
$backup_media_to = sys_get_temp_dir() . DIRECTORY_SEPARATOR
|
82 |
+
. uniqid()
|
83 |
+
. DIRECTORY_SEPARATOR;
|
84 |
+
if ( ! is_dir( $backup_media_to ) ) {
|
85 |
+
mkdir( $backup_media_to );
|
86 |
+
}
|
87 |
+
|
88 |
+
$this->copy_dir( $upload_basedir, $backup_media_to );
|
89 |
+
|
90 |
+
// Truncate media files
|
91 |
+
$this->truncate_dir( $upload_basedir );
|
92 |
+
|
93 |
+
// Import media files
|
94 |
+
$this->copy_dir( $extract_to . Ai1wm_Export::EXPORT_MEDIA_NAME, $upload_basedir );
|
95 |
+
|
96 |
+
// Backup themes files
|
97 |
+
$backup_themes_to = sys_get_temp_dir() . DIRECTORY_SEPARATOR
|
98 |
+
. uniqid()
|
99 |
+
. DIRECTORY_SEPARATOR;
|
100 |
+
if ( ! is_dir( $backup_themes_to ) ) {
|
101 |
+
mkdir( $backup_themes_to );
|
102 |
+
}
|
103 |
+
|
104 |
+
$this->copy_dir( $themes_basedir, $backup_themes_to );
|
105 |
+
|
106 |
+
// Truncate themes files
|
107 |
+
$this->truncate_dir( $themes_basedir );
|
108 |
+
|
109 |
+
// Import themes files
|
110 |
+
$this->copy_dir( $extract_to . Ai1wm_Export::EXPORT_THEMES_NAME, $themes_basedir );
|
111 |
+
|
112 |
+
// Install selected plugins
|
113 |
+
$this->install_plugins( $extract_to . Ai1wm_Export::EXPORT_PACKAGE_NAME );
|
114 |
+
|
115 |
+
// Test website
|
116 |
+
if ( ! $this->test_website( get_option( 'siteurl' ) ) ) {
|
117 |
+
// Truncate database
|
118 |
+
$this->connection->truncateDatabase();
|
119 |
+
|
120 |
+
// Import "OLD" database
|
121 |
+
$this->connection->importFromFile( $database_file );
|
122 |
+
|
123 |
+
// Truncate media files
|
124 |
+
$this->truncate_dir( $upload_basedir );
|
125 |
+
|
126 |
+
// Import "OLD" media files
|
127 |
+
$this->copy_dir( $backup_media_to, $upload_basedir );
|
128 |
+
|
129 |
+
// Truncate themes files
|
130 |
+
$this->truncate_dir( $themes_basedir );
|
131 |
+
|
132 |
+
// Import "OLD" themes files
|
133 |
+
$this->copy_dir( $backup_themes_to, $themes_basedir );
|
134 |
+
}
|
135 |
+
|
136 |
+
// Disable maintenance mode
|
137 |
+
$this->maintenance_mode( false );
|
138 |
+
} else {
|
139 |
+
$errors[] = _( 'File is not compatible with "All In One WP Migration" plugin! Please verify your archive file.' );
|
140 |
+
}
|
141 |
+
} else {
|
142 |
+
$errors[] = $this->code_to_message( $input_file['error'] );
|
143 |
+
}
|
144 |
+
|
145 |
+
return array( 'errors' => $errors );
|
146 |
+
}
|
147 |
+
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Enable or disable Wordpress maintenance mode
|
151 |
+
*
|
152 |
+
* @param boolean $enabled Enable or disable maintenance mode
|
153 |
+
* @return boolean True if option value has changed, false if not or if update failed
|
154 |
+
*/
|
155 |
+
public function maintenance_mode( $enabled = true ) {
|
156 |
+
return update_option( 'maintenance_mode', $enabled );
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Copy files from directory to directory
|
161 |
+
*
|
162 |
+
* @param string $from Copy files and directories FROM
|
163 |
+
* @param string $to Copy files and directories TO
|
164 |
+
* @return void
|
165 |
+
*/
|
166 |
+
public function copy_dir( $from, $to ) {
|
167 |
+
$iterator = new RecursiveIteratorIterator(
|
168 |
+
new RecursiveDirectoryIterator( $from, RecursiveDirectoryIterator::SKIP_DOTS ),
|
169 |
+
RecursiveIteratorIterator::SELF_FIRST
|
170 |
+
);
|
171 |
+
|
172 |
+
foreach ( $iterator as $item ) {
|
173 |
+
if ( $item->isDir() ) {
|
174 |
+
mkdir( $to . $iterator->getSubPathName() );
|
175 |
+
} else {
|
176 |
+
copy( $item, $to . $iterator->getSubPathName() );
|
177 |
+
}
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Truncate all files from specific directory
|
183 |
+
*
|
184 |
+
* @param string $dir Path to directory
|
185 |
+
* @return void
|
186 |
+
*/
|
187 |
+
public function truncate_dir( $dir ) {
|
188 |
+
$iterator = new RecursiveIteratorIterator(
|
189 |
+
new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS ),
|
190 |
+
RecursiveIteratorIterator::CHILD_FIRST
|
191 |
+
);
|
192 |
+
|
193 |
+
foreach ( $iterator as $item ) {
|
194 |
+
if ( $item->isDir() ) {
|
195 |
+
rmdir ( $dir . $iterator->getSubPathName() );
|
196 |
+
} else {
|
197 |
+
unlink( $dir . $iterator->getSubPathName() );
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Install available plugins
|
204 |
+
*
|
205 |
+
* @param string $path Absolute path to package config file
|
206 |
+
* @return void
|
207 |
+
*/
|
208 |
+
public function install_plugins( $path ) {
|
209 |
+
$file = file_get_contents( $path );
|
210 |
+
$package = json_decode( $file, true );
|
211 |
+
|
212 |
+
// For Plugins API
|
213 |
+
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
214 |
+
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
215 |
+
|
216 |
+
// Install Plugins
|
217 |
+
if ( isset( $package['Plugins'] ) && ( $install_plugins = $package['Plugins'] ) ) {
|
218 |
+
foreach ( $install_plugins as $item ) {
|
219 |
+
$plugin = $item['Slug'];
|
220 |
+
|
221 |
+
$api = plugins_api( 'plugin_information', array( 'slug' => $plugin, 'fields' => array( 'sections' => false ) ) );
|
222 |
+
if ( ! is_wp_error( $api ) ) {
|
223 |
+
$status = install_plugin_install_status( $api );
|
224 |
+
if ( $status['status'] == 'install' ) {
|
225 |
+
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
|
226 |
+
$nonce = 'install-plugin_' . $plugin;
|
227 |
+
$url = 'update.php?action=install-plugin&plugin=' . urlencode( $plugin );
|
228 |
+
$type = 'web';
|
229 |
+
|
230 |
+
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
|
231 |
+
@$upgrader->install( $api->download_link );
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Test webside whether everything is installed properly (Not implemented yet)
|
240 |
+
*
|
241 |
+
* @param string $url Current URL address
|
242 |
+
* @return boolean Pass or not pass website tests
|
243 |
+
*/
|
244 |
+
public function test_website( $url ) {
|
245 |
+
return true;
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Verify whether directory contains necessary archive files
|
250 |
+
*
|
251 |
+
* @param string $path Archive path
|
252 |
+
* @return boolean Compatible archive
|
253 |
+
*/
|
254 |
+
public function is_valid( $path ) {
|
255 |
+
$required_objects = array(
|
256 |
+
Ai1wm_Export::EXPORT_DATABASE_NAME,
|
257 |
+
Ai1wm_Export::EXPORT_PACKAGE_NAME,
|
258 |
+
);
|
259 |
+
|
260 |
+
// Verify whether file or directory exist
|
261 |
+
foreach ( $required_objects as $object ) {
|
262 |
+
if ( ! file_exists( $path . $object ) ) {
|
263 |
+
return false;
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
return true;
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Display message for upload error code
|
272 |
+
*
|
273 |
+
* @param integer $code Upload error code
|
274 |
+
* @return string Error message
|
275 |
+
*/
|
276 |
+
public function code_to_message( $code ) {
|
277 |
+
switch ( $code ) {
|
278 |
+
case UPLOAD_ERR_INI_SIZE:
|
279 |
+
$message = _( 'The uploaded file exceeds the upload_max_filesize directive in php.ini' );
|
280 |
+
break;
|
281 |
+
|
282 |
+
case UPLOAD_ERR_FORM_SIZE:
|
283 |
+
$message = _( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form' );
|
284 |
+
break;
|
285 |
+
|
286 |
+
case UPLOAD_ERR_PARTIAL:
|
287 |
+
$message = _( 'The uploaded file was only partially uploaded' );
|
288 |
+
break;
|
289 |
+
|
290 |
+
case UPLOAD_ERR_NO_FILE:
|
291 |
+
$message = _( 'No file was uploaded' );
|
292 |
+
break;
|
293 |
+
|
294 |
+
case UPLOAD_ERR_NO_TMP_DIR:
|
295 |
+
$message = _( 'Missing a temporary folder' );
|
296 |
+
break;
|
297 |
+
|
298 |
+
case UPLOAD_ERR_CANT_WRITE:
|
299 |
+
$message = _( 'Failed to write file to disk' );
|
300 |
+
break;
|
301 |
+
|
302 |
+
case UPLOAD_ERR_EXTENSION:
|
303 |
+
$message = _( 'File upload stopped by extension' );
|
304 |
+
break;
|
305 |
+
|
306 |
+
default:
|
307 |
+
$message = _( 'Unknown upload error' );
|
308 |
+
break;
|
309 |
+
}
|
310 |
+
|
311 |
+
return $message;
|
312 |
+
}
|
313 |
+
}
|
lib/model/class-ai1wm-template.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
class Ai1wm_Template extends Bandar
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Renders a file and returns its contents bacl
|
23 |
+
* @param string $file View to render
|
24 |
+
* @param [type] $args [description]
|
25 |
+
* @return [type] [description]
|
26 |
+
*/
|
27 |
+
public static function render( $view, $args = array() ) {
|
28 |
+
parent::render( $view, $args );
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Returns link to an asset file
|
33 |
+
* @param string $asset Asset file
|
34 |
+
* @return string Asset URL
|
35 |
+
*/
|
36 |
+
public static function asset_link( $asset ) {
|
37 |
+
return AI1WM_URL . '/lib/view/assets/' . $asset;
|
38 |
+
}
|
39 |
+
}
|
lib/vendor/bandar/bandar/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2013 Yani Iliev
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
+
this software and associated documentation files (the "Software"), to deal in
|
7 |
+
the Software without restriction, including without limitation the rights to
|
8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
+
subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
lib/vendor/bandar/bandar/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Bandar
|
2 |
+
|
3 |
+
[![Build Status](https://travis-ci.org/yani-/bandar.png?branch=develop)](https://travis-ci.org/yani-/bandar)
|
4 |
+
[![Code Coverage](https://scrutinizer-ci.com/g/yani-/bandar/badges/coverage.png?s=c40636c2454c21b02833b845177f72708ac66d80)](https://scrutinizer-ci.com/g/yani-/bandar/)
|
5 |
+
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/yani-/bandar/badges/quality-score.png?s=dafa1ca61bb087fd0ed911b8376a01920fe2477f)](https://scrutinizer-ci.com/g/yani-/bandar/)
|
6 |
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/yani-/bandar/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
7 |
+
[![Latest Stable Version](https://poser.pugx.org/bandar/bandar/v/stable.png)](https://packagist.org/packages/bandar/bandar)
|
8 |
+
[![Total Downloads](https://poser.pugx.org/bandar/bandar/downloads.png)](https://packagist.org/packages/bandar/bandar)
|
9 |
+
|
10 |
+
Fully tested minimalistic PHP template engine. Include the class, set your templates location and start rendering.
|
11 |
+
|
12 |
+
### Requirements
|
13 |
+
PHP v5.2 and up. Tested on PHP v5.2, v5.3, v5.4, v5.5
|
14 |
+
|
15 |
+
### Usage
|
16 |
+
```php
|
17 |
+
// example.php
|
18 |
+
require_once 'lib/Bandar.php';
|
19 |
+
define(
|
20 |
+
'BANDAR_TEMPLATES_PATH',
|
21 |
+
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'views'
|
22 |
+
);
|
23 |
+
Bandar::render('users/list', array('users' => array('name' => 'John Smith')));
|
24 |
+
```
|
25 |
+
```php
|
26 |
+
// views/users/list.php
|
27 |
+
<ul>
|
28 |
+
<?php
|
29 |
+
foreach ($users as $user) {
|
30 |
+
echo '<li>' . $user['name'] . '</li>';
|
31 |
+
}
|
32 |
+
?>
|
33 |
+
</ul>
|
34 |
+
```
|
35 |
+
Run it
|
36 |
+
```bash
|
37 |
+
php example.php
|
38 |
+
```
|
39 |
+
|
40 |
+
#### Page with sidebar
|
41 |
+
```php
|
42 |
+
// example-with-sidebar.php
|
43 |
+
require_once 'lib/Bandar.php';
|
44 |
+
define(
|
45 |
+
'BANDAR_TEMPLATES_PATH',
|
46 |
+
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'views'
|
47 |
+
);
|
48 |
+
$sidebar = Bandar::getTemplateContent('common/sidebar');
|
49 |
+
Bandar::render(
|
50 |
+
'users/list',
|
51 |
+
array(
|
52 |
+
'users' => array(array('name' => 'John Smith')),
|
53 |
+
'sidebar' => $sidebar
|
54 |
+
)
|
55 |
+
);
|
56 |
+
```
|
57 |
+
```php
|
58 |
+
// views/users/list.php
|
59 |
+
<div class="container">
|
60 |
+
<div class="left">
|
61 |
+
<ul>
|
62 |
+
<?php
|
63 |
+
foreach ($users as $user) {
|
64 |
+
echo '<li>' . $user['name'] . '</li>';
|
65 |
+
}
|
66 |
+
?>
|
67 |
+
</ul>
|
68 |
+
</div>
|
69 |
+
<div class="right">
|
70 |
+
<?php echo $sidebar; ?>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
```
|
74 |
+
```php
|
75 |
+
// views/common/sidebar.php
|
76 |
+
Sidebar content
|
77 |
+
```
|
78 |
+
Run it
|
79 |
+
```bash
|
80 |
+
php example-with-sidebar.php
|
81 |
+
```
|
82 |
+
|
83 |
+
### Tests
|
84 |
+
Coverage reports are stored inside the coverage folder. The goal is to always have 100% coverage.
|
85 |
+
```bash
|
86 |
+
phpunit
|
87 |
+
```
|
88 |
+
|
89 |
+
### Documentation
|
90 |
+
```bash
|
91 |
+
phpdoc -f lib/Bandar.php
|
92 |
+
```
|
93 |
+
|
94 |
+
### Contributing
|
95 |
+
For code guidelines refer to `.editorconfig`. This project is following PEAR code standard - http://pear.php.net/manual/en/standards.php
|
96 |
+
The project is following Vincent Driessen's branching model aka git flow - http://nvie.com/git-model/
|
97 |
+
Make sure to submit your pull requests against the **develop** branch
|
98 |
+
|
99 |
+
### License
|
100 |
+
MIT
|
lib/vendor/bandar/bandar/lib/Bandar.php
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Main template engine file
|
7 |
+
*
|
8 |
+
* PHP version 5
|
9 |
+
*
|
10 |
+
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining
|
11 |
+
* a copy of this software and associated documentation files (the "Software"), to
|
12 |
+
* deal in the Software without restriction, including without limitation the rights
|
13 |
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
14 |
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
15 |
+
* subject to the following conditions:
|
16 |
+
*
|
17 |
+
* The above copyright notice and this permission notice shall be included in all
|
18 |
+
* copies or substantial portions of the Software.
|
19 |
+
*
|
20 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
22 |
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
23 |
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
24 |
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
25 |
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
26 |
+
*
|
27 |
+
* @category Templates
|
28 |
+
* @package Bandar
|
29 |
+
* @author Yani Iliev <yani@iliev.me>
|
30 |
+
* @copyright 2013 Yani Iliev
|
31 |
+
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
32 |
+
* @version GIT: 2.1.0
|
33 |
+
* @link https://github.com/yani-/bandar/
|
34 |
+
*/
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Define EOL for CLI and Web
|
38 |
+
*/
|
39 |
+
if (!defined('BANDAR_EOL')) {
|
40 |
+
define('BANDAR_EOL', php_sapi_name() === 'cli' ? PHP_EOL : '<br />');
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Include exceptions
|
45 |
+
*/
|
46 |
+
require_once
|
47 |
+
dirname(__FILE__) .
|
48 |
+
DIRECTORY_SEPARATOR .
|
49 |
+
'Exceptions' .
|
50 |
+
DIRECTORY_SEPARATOR .
|
51 |
+
'TemplateDoesNotExistException.php';
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Bandar Main class
|
55 |
+
*
|
56 |
+
* @category Templates
|
57 |
+
* @package Bandar
|
58 |
+
* @author Yani Iliev <yani@iliev.me>
|
59 |
+
* @copyright 2013 Yani Iliev
|
60 |
+
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
61 |
+
* @version Release: 2.0.1
|
62 |
+
* @link https://github.com/yani-/bandar/
|
63 |
+
*/
|
64 |
+
class Bandar
|
65 |
+
{
|
66 |
+
/**
|
67 |
+
* Path to template files
|
68 |
+
*
|
69 |
+
* @var string|null
|
70 |
+
*/
|
71 |
+
public static $templatesPath = null;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Template file to output
|
75 |
+
* @var string|null
|
76 |
+
*/
|
77 |
+
public static $template = null;
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Outputs the passed string if Bandar is in debug mode
|
81 |
+
*
|
82 |
+
* @param string $str Debug string to output
|
83 |
+
*
|
84 |
+
* @return void
|
85 |
+
*/
|
86 |
+
public static function debug($str)
|
87 |
+
{
|
88 |
+
/**
|
89 |
+
* if debug flag is on, output the string
|
90 |
+
*/
|
91 |
+
if (defined('BANDAR_DEBUG') && BANDAR_DEBUG) {
|
92 |
+
echo $str;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Retrieves templatesPath from BANDAR_TEMPLATES_PATH constant
|
98 |
+
*
|
99 |
+
* @throws TemplatesPathNotSetException If BANDAR_TEMPLATES_PATH is not defined
|
100 |
+
*
|
101 |
+
* @return string|null Templates path
|
102 |
+
*/
|
103 |
+
public static function getTemplatesPathFromConstant()
|
104 |
+
{
|
105 |
+
self::debug(
|
106 |
+
'Calling getTemplatesPathFromConstant' . BANDAR_EOL
|
107 |
+
);
|
108 |
+
if (defined('BANDAR_TEMPLATES_PATH')) {
|
109 |
+
return realpath(BANDAR_TEMPLATES_PATH) . DIRECTORY_SEPARATOR;
|
110 |
+
}
|
111 |
+
return null;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Setter for template
|
116 |
+
*
|
117 |
+
* @param string $template Template file
|
118 |
+
*
|
119 |
+
* @throws TemplateDoesNotExistException If template file is not found
|
120 |
+
*
|
121 |
+
* @return null
|
122 |
+
*/
|
123 |
+
public static function setTemplate($template)
|
124 |
+
{
|
125 |
+
self::debug(
|
126 |
+
'Calling setTemplate with' . BANDAR_EOL .
|
127 |
+
'$template = ' . $template . BANDAR_EOL .
|
128 |
+
'type of $template is ' . gettype($template) . BANDAR_EOL
|
129 |
+
);
|
130 |
+
$template = self::getTemplatesPathFromConstant() . $template;
|
131 |
+
$template = realpath($template . '.php');
|
132 |
+
/**
|
133 |
+
* Check if passed template exist
|
134 |
+
*/
|
135 |
+
if (self::templateExists($template)) {
|
136 |
+
self::$template = $template;
|
137 |
+
} else {
|
138 |
+
throw new TemplateDoesNotExistException;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Checks if template exists by using file_exists
|
144 |
+
*
|
145 |
+
* @param string $template Template file
|
146 |
+
*
|
147 |
+
* @return boolean
|
148 |
+
*/
|
149 |
+
public static function templateExists($template)
|
150 |
+
{
|
151 |
+
self::debug(
|
152 |
+
'Calling templateExists with ' . BANDAR_EOL .
|
153 |
+
'$template = ' . $template . BANDAR_EOL .
|
154 |
+
'type of $template is ' . gettype($template) . BANDAR_EOL
|
155 |
+
);
|
156 |
+
return (!is_dir($template) && is_readable($template));
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Renders a passed template
|
161 |
+
*
|
162 |
+
* @param string $template Template name
|
163 |
+
* @param array $args Variables to pass to the template file
|
164 |
+
*
|
165 |
+
* @return string Contents of the template
|
166 |
+
*/
|
167 |
+
public static function render($template, $args=array())
|
168 |
+
{
|
169 |
+
self::debug(
|
170 |
+
'Calling render with' .
|
171 |
+
'$template = ' . $template . BANDAR_EOL .
|
172 |
+
'type of $template is ' . gettype($template) . BANDAR_EOL .
|
173 |
+
'$args = ' . print_r($args, true) . BANDAR_EOL .
|
174 |
+
'type of $args is ' . gettype($args) . BANDAR_EOL
|
175 |
+
);
|
176 |
+
self::setTemplate($template);
|
177 |
+
/**
|
178 |
+
* Extracting passed aguments
|
179 |
+
*/
|
180 |
+
extract($args);
|
181 |
+
ob_start();
|
182 |
+
/**
|
183 |
+
* Including the view
|
184 |
+
*/
|
185 |
+
include self::$template;
|
186 |
+
|
187 |
+
return ob_get_flush();
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Returns the content of a passed template
|
192 |
+
*
|
193 |
+
* @param string $template Template name
|
194 |
+
* @param array $args Variables to pass to the template file
|
195 |
+
*
|
196 |
+
* @return string Contents of the template
|
197 |
+
*/
|
198 |
+
public static function getTemplateContent($template, $args=array())
|
199 |
+
{
|
200 |
+
self::debug(
|
201 |
+
'Calling render with' .
|
202 |
+
'$template = ' . $template . BANDAR_EOL .
|
203 |
+
'type of $template is ' . gettype($template) . BANDAR_EOL .
|
204 |
+
'$args = ' . print_r($args, true) . BANDAR_EOL .
|
205 |
+
'type of $args is ' . gettype($args) . BANDAR_EOL
|
206 |
+
);
|
207 |
+
self::setTemplate($template);
|
208 |
+
/**
|
209 |
+
* Extracting passed aguments
|
210 |
+
*/
|
211 |
+
extract($args);
|
212 |
+
ob_start();
|
213 |
+
/**
|
214 |
+
* Including the view
|
215 |
+
*/
|
216 |
+
include self::$template;
|
217 |
+
|
218 |
+
$content = ob_get_contents();
|
219 |
+
ob_end_clean();
|
220 |
+
|
221 |
+
return $content;
|
222 |
+
}
|
223 |
+
}
|
lib/vendor/bandar/bandar/lib/Exceptions/TemplateDoesNotExistException.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Contains TemplateDoesNotExistException class to be used in main Bandar class
|
7 |
+
*
|
8 |
+
* PHP version 5
|
9 |
+
*
|
10 |
+
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining
|
11 |
+
* a copy of this software and associated documentation files (the "Software"), to
|
12 |
+
* deal in the Software without restriction, including without limitation the rights
|
13 |
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
14 |
+
* of the Software, and to permit persons to whom the Software is furnished to do so,
|
15 |
+
* subject to the following conditions:
|
16 |
+
*
|
17 |
+
* The above copyright notice and this permission notice shall be included in all
|
18 |
+
* copies or substantial portions of the Software.
|
19 |
+
*
|
20 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
22 |
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
23 |
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
24 |
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
25 |
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
26 |
+
*
|
27 |
+
* @category Exceptions
|
28 |
+
* @package Bandar
|
29 |
+
* @author Yani Iliev <yani@iliev.me>
|
30 |
+
* @copyright 2013 Yani Iliev
|
31 |
+
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
32 |
+
* @version GIT: 2.1.0
|
33 |
+
* @link https://github.com/yani-/bandar/
|
34 |
+
*/
|
35 |
+
|
36 |
+
/**
|
37 |
+
* TemplateDoesNotExistException
|
38 |
+
*
|
39 |
+
* @category Exceptions
|
40 |
+
* @package Bandar
|
41 |
+
* @author Yani Iliev <yani@iliev.me>
|
42 |
+
* @copyright 2013 Yani Iliev
|
43 |
+
* @license https://raw.github.com/yani-/bandar/master/LICENSE The MIT License (MIT)
|
44 |
+
* @version Release: 2.0.1
|
45 |
+
* @link https://github.com/yani-/bandar/
|
46 |
+
*/
|
47 |
+
class TemplateDoesNotExistException extends Exception
|
48 |
+
{
|
49 |
+
|
50 |
+
}
|
lib/vendor/mysqldump-php/mysqldump.php
ADDED
@@ -0,0 +1,603 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mysqldump
|
4 |
+
{
|
5 |
+
const MAXLINESIZE = 1000000;
|
6 |
+
|
7 |
+
// This can be set both on constructor or manually
|
8 |
+
public $host;
|
9 |
+
public $user;
|
10 |
+
public $pass;
|
11 |
+
public $db;
|
12 |
+
public $fileName = 'dump.sql';
|
13 |
+
|
14 |
+
// Internal stuff
|
15 |
+
private $settings = array();
|
16 |
+
private $tables = array();
|
17 |
+
private $views = array();
|
18 |
+
private $dbHandler;
|
19 |
+
private $defaultSettings = array(
|
20 |
+
'include-tables' => array(),
|
21 |
+
'exclude-tables' => array(),
|
22 |
+
'compress' => CompressMethod::NONE,
|
23 |
+
'no-data' => false,
|
24 |
+
'add-drop-table' => false,
|
25 |
+
'single-transaction' => true,
|
26 |
+
'lock-tables' => false,
|
27 |
+
'add-locks' => true,
|
28 |
+
'extended-insert' => true
|
29 |
+
);
|
30 |
+
private $compressManager;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Constructor of Mysqldump. Note that in the case of an SQLite database connection, the filename must be in the $db parameter.
|
34 |
+
*
|
35 |
+
* @param string $db Database name
|
36 |
+
* @param string $user SQL account username
|
37 |
+
* @param string $pass SQL account password
|
38 |
+
* @param string $host SQL server to connect to
|
39 |
+
* @return null
|
40 |
+
*/
|
41 |
+
public function __construct($db = '', $user = '', $pass = '', $host = 'localhost', $type="mysql", $settings = null, $pdo_options = array(PDO::ATTR_PERSISTENT => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION))
|
42 |
+
{
|
43 |
+
$this->db = $db;
|
44 |
+
$this->user = $user;
|
45 |
+
$this->pass = $pass;
|
46 |
+
$this->host = $host;
|
47 |
+
$this->type = strtolower($type);
|
48 |
+
$this->pdo_options = $pdo_options;
|
49 |
+
$this->set($settings);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* jquery style extend, merges arrays (without errors if the passed
|
54 |
+
* values are not arrays)
|
55 |
+
*
|
56 |
+
* @param array $args default settings
|
57 |
+
* @param array $extended user settings
|
58 |
+
*
|
59 |
+
* @return array $extended merged user settings with default settings
|
60 |
+
*/
|
61 |
+
public function extend()
|
62 |
+
{
|
63 |
+
$args = func_get_args();
|
64 |
+
$extended = array();
|
65 |
+
if (is_array($args) && count($args) > 0) {
|
66 |
+
foreach ($args as $array) {
|
67 |
+
if (is_array($array)) {
|
68 |
+
$extended = array_merge($extended, $array);
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
return $extended;
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Set new settings
|
79 |
+
*
|
80 |
+
* @return void
|
81 |
+
*/
|
82 |
+
public function set($settings)
|
83 |
+
{
|
84 |
+
$this->settings = $this->extend($this->defaultSettings, $settings);
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Connect with PDO
|
89 |
+
*
|
90 |
+
* @return bool
|
91 |
+
*/
|
92 |
+
private function connect()
|
93 |
+
{
|
94 |
+
// Connecting with PDO
|
95 |
+
try {
|
96 |
+
switch ($this->type){
|
97 |
+
case 'sqlite':
|
98 |
+
$this->dbHandler = new PDO("sqlite:" . $this->db, null, null, $this->pdo_options);
|
99 |
+
break;
|
100 |
+
|
101 |
+
case 'mysql': case 'pgsql': case 'dblib':
|
102 |
+
$this->dbHandler = new PDO($this->type . ":host=" . $this->host.";dbname=" . $this->db, $this->user, $this->pass, $this->pdo_options);
|
103 |
+
// Fix for always-unicode output
|
104 |
+
$this->dbHandler->exec("SET NAMES utf8");
|
105 |
+
break;
|
106 |
+
|
107 |
+
default:
|
108 |
+
throw new \Exception("Unsupported database type: " . $this->type, 3);
|
109 |
+
}
|
110 |
+
} catch (PDOException $e) {
|
111 |
+
throw new \Exception("Connection to " . $this->type . " failed with message: " .
|
112 |
+
$e->getMessage(), 3);
|
113 |
+
}
|
114 |
+
|
115 |
+
$this->dbHandler->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_NATURAL);
|
116 |
+
$this->adapter = new TypeAdapter($this->type);
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Main call
|
121 |
+
*
|
122 |
+
* @param string $filename Name of file to write sql dump to
|
123 |
+
* @param array $clauses Query parameters
|
124 |
+
* @return bool
|
125 |
+
*/
|
126 |
+
public function start($filename = '', $clauses = array())
|
127 |
+
{
|
128 |
+
// Output file can be redefined here
|
129 |
+
if ( !empty($filename) ) {
|
130 |
+
$this->fileName = $filename;
|
131 |
+
}
|
132 |
+
|
133 |
+
// We must set a name to continue
|
134 |
+
if ( empty($this->fileName) ) {
|
135 |
+
throw new \Exception("Output file name is not set", 1);
|
136 |
+
}
|
137 |
+
|
138 |
+
// Connect to database
|
139 |
+
$this->connect();
|
140 |
+
|
141 |
+
// Create a new compressManager to manage compressed output
|
142 |
+
$this->compressManager = CompressManagerFactory::create($this->settings['compress']);
|
143 |
+
|
144 |
+
if (! $this->compressManager->open($this->fileName)) {
|
145 |
+
throw new \Exception("Output file is not writable", 2);
|
146 |
+
}
|
147 |
+
|
148 |
+
// Formating dump file
|
149 |
+
$this->compressManager->write($this->getHeader());
|
150 |
+
|
151 |
+
// Listing all tables from database
|
152 |
+
$this->tables = array();
|
153 |
+
foreach ($this->dbHandler->query($this->adapter->show_tables($this->db)) as $row) {
|
154 |
+
if (empty($this->settings['include-tables']) || (! empty($this->settings['include-tables']) && in_array(current($row), $this->settings['include-tables'], true))) {
|
155 |
+
array_push($this->tables, current($row));
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
// Exporting tables one by one
|
160 |
+
foreach ($this->tables as $table) {
|
161 |
+
if (in_array($table, $this->settings['exclude-tables'], true)) {
|
162 |
+
continue;
|
163 |
+
}
|
164 |
+
|
165 |
+
$is_table = $this->getTableStructure($table);
|
166 |
+
if (true === $is_table) {
|
167 |
+
if (false === $this->settings['no-data']) {
|
168 |
+
$this->listValues($table, $clauses);
|
169 |
+
} else if (isset($clauses[$table])) {
|
170 |
+
$this->listValues($table, $clauses);
|
171 |
+
}
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
// Exporting views one by one
|
176 |
+
foreach ($this->views as $view) {
|
177 |
+
$this->compressManager->write($view);
|
178 |
+
}
|
179 |
+
|
180 |
+
//$this->compressManager->close();
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Get current file name
|
185 |
+
*
|
186 |
+
* @return string
|
187 |
+
*/
|
188 |
+
public function getFileName()
|
189 |
+
{
|
190 |
+
return $this->fileName;
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Truncate database
|
195 |
+
*
|
196 |
+
* @return void
|
197 |
+
*/
|
198 |
+
public function truncateDatabase()
|
199 |
+
{
|
200 |
+
// Connect to database
|
201 |
+
$this->connect();
|
202 |
+
|
203 |
+
foreach ($this->dbHandler->query($this->adapter->show_tables($this->db)) as $row) {
|
204 |
+
// Drop table
|
205 |
+
$this->dbHandler->query($this->adapter->drop_table($row['tbl_name']));
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Import database from file
|
211 |
+
*
|
212 |
+
* @return void
|
213 |
+
*/
|
214 |
+
public function importFromFile($file)
|
215 |
+
{
|
216 |
+
if (!is_resource($file)) {
|
217 |
+
$file = fopen($file, 'r');
|
218 |
+
}
|
219 |
+
|
220 |
+
// Read database file
|
221 |
+
$sql = stream_get_contents($file);
|
222 |
+
|
223 |
+
return $this->dbHandler->query($sql);
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Returns list of tables
|
228 |
+
*
|
229 |
+
* @return array
|
230 |
+
*/
|
231 |
+
public function listTables()
|
232 |
+
{
|
233 |
+
// Connect to database
|
234 |
+
$this->connect();
|
235 |
+
|
236 |
+
$result = array();
|
237 |
+
foreach ($this->dbHandler->query($this->adapter->show_tables($this->db)) as $row) {
|
238 |
+
$result[] = $row['tbl_name'];
|
239 |
+
}
|
240 |
+
|
241 |
+
return $result;
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Returns header for dump file
|
246 |
+
*
|
247 |
+
* @return null
|
248 |
+
*/
|
249 |
+
private function getHeader()
|
250 |
+
{
|
251 |
+
// Some info about software, source and time
|
252 |
+
$header = "-- All In One WP Migration SQL Dump\n" .
|
253 |
+
"-- http://servmask.com/\n" .
|
254 |
+
"--\n" .
|
255 |
+
"-- Host: {$this->host}\n" .
|
256 |
+
"-- Generation Time: " . date('r') . "\n\n" .
|
257 |
+
"--\n" .
|
258 |
+
"-- Database: `{$this->db}`\n" .
|
259 |
+
"--\n\n";
|
260 |
+
|
261 |
+
return $header;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Table structure extractor
|
266 |
+
*
|
267 |
+
* @param string $tablename Name of table to export
|
268 |
+
* @return null
|
269 |
+
*/
|
270 |
+
private function getTableStructure($tablename)
|
271 |
+
{
|
272 |
+
$stmt = $this->adapter->show_create_table($tablename);
|
273 |
+
foreach ($this->dbHandler->query($stmt) as $r) {
|
274 |
+
if (isset($r['Create Table'])) {
|
275 |
+
$this->compressManager->write("-- " .
|
276 |
+
"--------------------------------------------------------" .
|
277 |
+
"\n\n" .
|
278 |
+
"--\n" .
|
279 |
+
"-- Table structure for table `$tablename`\n--\n\n");
|
280 |
+
|
281 |
+
if ($this->settings['add-drop-table']) {
|
282 |
+
$this->compressManager->write("DROP TABLE IF EXISTS `$tablename`;\n\n");
|
283 |
+
}
|
284 |
+
|
285 |
+
$this->compressManager->write($r['Create Table'] . ";\n\n");
|
286 |
+
|
287 |
+
return true;
|
288 |
+
}
|
289 |
+
if ( isset($r['Create View']) ) {
|
290 |
+
$view = "-- " .
|
291 |
+
"--------------------------------------------------------" .
|
292 |
+
"\n\n";
|
293 |
+
$view .= "--\n-- Table structure for view `$tablename`\n--\n\n";
|
294 |
+
$view .= $r['Create View'] . ";\n\n";
|
295 |
+
$this->views[] = $view;
|
296 |
+
|
297 |
+
return false;
|
298 |
+
}
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Table rows extractor
|
304 |
+
*
|
305 |
+
* @param string $tablename Name of table to export
|
306 |
+
* @param array $clauses Query parameters
|
307 |
+
* @return null
|
308 |
+
*/
|
309 |
+
private function listValues($tablename, $clauses = array())
|
310 |
+
{
|
311 |
+
$this->compressManager->write(
|
312 |
+
"--\n" .
|
313 |
+
"-- Dumping data for table `$tablename`\n" .
|
314 |
+
"--\n\n"
|
315 |
+
);
|
316 |
+
|
317 |
+
if ($this->settings['single-transaction']) {
|
318 |
+
$this->dbHandler->exec($this->adapter->start_transaction());
|
319 |
+
}
|
320 |
+
|
321 |
+
if ($this->settings['lock-tables']) {
|
322 |
+
$lockstmt = $this->adapter->lock_table($tablename);
|
323 |
+
if(strlen($lockstmt)){
|
324 |
+
$this->dbHandler->exec($lockstmt);
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
if ( $this->settings['add-locks'] ) {
|
329 |
+
$this->compressManager->write($this->adapter->start_add_lock_table($tablename));
|
330 |
+
}
|
331 |
+
|
332 |
+
$onlyOnce = true; $lineSize = 0;
|
333 |
+
$stmt = "SELECT * FROM `$tablename` ";
|
334 |
+
|
335 |
+
// Add query parameters
|
336 |
+
if (isset($clauses[$tablename]) && ($clause_query = $clauses[$tablename])) {
|
337 |
+
$stmt .= $clause_query;
|
338 |
+
}
|
339 |
+
|
340 |
+
foreach ($this->dbHandler->query($stmt, PDO::FETCH_NUM) as $r) {
|
341 |
+
$vals = array();
|
342 |
+
foreach ($r as $val) {
|
343 |
+
$vals[] = is_null($val) ? "NULL" :
|
344 |
+
$this->dbHandler->quote($val);
|
345 |
+
}
|
346 |
+
if ($onlyOnce || !$this->settings['extended-insert'] ) {
|
347 |
+
$lineSize += $this->compressManager->write("INSERT INTO `$tablename` VALUES (" . implode(",", $vals) . ")");
|
348 |
+
$onlyOnce = false;
|
349 |
+
} else {
|
350 |
+
$lineSize += $this->compressManager->write(",(" . implode(",", $vals) . ")");
|
351 |
+
}
|
352 |
+
if ( ($lineSize > Mysqldump::MAXLINESIZE) ||
|
353 |
+
!$this->settings['extended-insert'] ) {
|
354 |
+
$onlyOnce = true;
|
355 |
+
$lineSize = $this->compressManager->write(";\n");
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
if (! $onlyOnce) {
|
360 |
+
$this->compressManager->write(";\n");
|
361 |
+
}
|
362 |
+
|
363 |
+
if ($this->settings['add-locks']) {
|
364 |
+
$this->compressManager->write($this->adapter->end_add_lock_table($tablename));
|
365 |
+
}
|
366 |
+
|
367 |
+
if ($this->settings['single-transaction']) {
|
368 |
+
$this->dbHandler->exec($this->adapter->commit_transaction());
|
369 |
+
}
|
370 |
+
|
371 |
+
if ($this->settings['lock-tables']) {
|
372 |
+
$lockstmt = $this->adapter->unlock_table($tablename);
|
373 |
+
if(strlen($lockstmt)){
|
374 |
+
$this->dbHandler->exec($lockstmt);
|
375 |
+
}
|
376 |
+
}
|
377 |
+
}
|
378 |
+
}
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Enum with all available compression methods
|
382 |
+
*
|
383 |
+
*/
|
384 |
+
abstract class CompressMethod
|
385 |
+
{
|
386 |
+
const NONE = 0;
|
387 |
+
const GZIP = 1;
|
388 |
+
const BZIP2 = 2;
|
389 |
+
|
390 |
+
public static $enums = array(
|
391 |
+
"None",
|
392 |
+
"Gzip",
|
393 |
+
"Bzip2"
|
394 |
+
);
|
395 |
+
|
396 |
+
public static function isValid($c)
|
397 |
+
{
|
398 |
+
return in_array($c, self::$enums);
|
399 |
+
}
|
400 |
+
}
|
401 |
+
|
402 |
+
abstract class CompressManagerFactory
|
403 |
+
{
|
404 |
+
private $fileHandle = null;
|
405 |
+
|
406 |
+
public static function create($c)
|
407 |
+
{
|
408 |
+
$c = ucfirst(strtolower($c));
|
409 |
+
if (! CompressMethod::isValid($c)) {
|
410 |
+
throw new \Exception("Compression method is invalid", 1);
|
411 |
+
}
|
412 |
+
|
413 |
+
$method = "Compress" . $c;
|
414 |
+
|
415 |
+
return new $method();
|
416 |
+
}
|
417 |
+
}
|
418 |
+
|
419 |
+
class CompressBzip2 extends CompressManagerFactory
|
420 |
+
{
|
421 |
+
public function __construct()
|
422 |
+
{
|
423 |
+
if (! function_exists("bzopen")) {
|
424 |
+
throw new \Exception("Compression is enabled, but bzip2 lib is not installed or configured properly", 1);
|
425 |
+
}
|
426 |
+
}
|
427 |
+
|
428 |
+
public function open($filename)
|
429 |
+
{
|
430 |
+
$this->fileHandler = bzopen($filename, "w");
|
431 |
+
if (false === $this->fileHandler) {
|
432 |
+
return false;
|
433 |
+
}
|
434 |
+
|
435 |
+
return true;
|
436 |
+
}
|
437 |
+
|
438 |
+
public function write($str)
|
439 |
+
{
|
440 |
+
$bytesWritten = 0;
|
441 |
+
if (false === ($bytesWritten = bzwrite($this->fileHandler, $str))) {
|
442 |
+
throw new \Exception("Writting to file failed! Probably, there is no more free space left?", 4);
|
443 |
+
}
|
444 |
+
|
445 |
+
return $bytesWritten;
|
446 |
+
}
|
447 |
+
|
448 |
+
public function close()
|
449 |
+
{
|
450 |
+
return bzclose($this->fileHandler);
|
451 |
+
}
|
452 |
+
}
|
453 |
+
|
454 |
+
class CompressGzip extends CompressManagerFactory
|
455 |
+
{
|
456 |
+
public function __construct()
|
457 |
+
{
|
458 |
+
if (! function_exists("gzopen") ) {
|
459 |
+
throw new \Exception("Compression is enabled, but gzip lib is not installed or configured properly", 1);
|
460 |
+
}
|
461 |
+
}
|
462 |
+
|
463 |
+
public function open($filename)
|
464 |
+
{
|
465 |
+
$this->fileHandler = gzopen($filename, "wb");
|
466 |
+
if (false === $this->fileHandler) {
|
467 |
+
return false;
|
468 |
+
}
|
469 |
+
|
470 |
+
return true;
|
471 |
+
}
|
472 |
+
|
473 |
+
public function write($str)
|
474 |
+
{
|
475 |
+
$bytesWritten = 0;
|
476 |
+
if (false === ($bytesWritten = gzwrite($this->fileHandler, $str))) {
|
477 |
+
throw new \Exception("Writting to file failed! Probably, there is no more free space left?", 4);
|
478 |
+
}
|
479 |
+
|
480 |
+
return $bytesWritten;
|
481 |
+
}
|
482 |
+
|
483 |
+
public function close()
|
484 |
+
{
|
485 |
+
return gzclose($this->fileHandler);
|
486 |
+
}
|
487 |
+
}
|
488 |
+
|
489 |
+
class CompressNone extends CompressManagerFactory
|
490 |
+
{
|
491 |
+
public function open($filename)
|
492 |
+
{
|
493 |
+
$this->fileHandler = fopen($filename, "wb");
|
494 |
+
if (false === $this->fileHandler) {
|
495 |
+
return false;
|
496 |
+
}
|
497 |
+
|
498 |
+
return true;
|
499 |
+
}
|
500 |
+
|
501 |
+
public function write($str)
|
502 |
+
{
|
503 |
+
$bytesWritten = 0;
|
504 |
+
if (false === ($bytesWritten = fwrite($this->fileHandler, $str))) {
|
505 |
+
throw new \Exception("Writting to file failed! Probably, there is no more free space left?", 4);
|
506 |
+
}
|
507 |
+
|
508 |
+
return $bytesWritten;
|
509 |
+
}
|
510 |
+
|
511 |
+
public function close()
|
512 |
+
{
|
513 |
+
return fclose($this->fileHandler);
|
514 |
+
}
|
515 |
+
}
|
516 |
+
|
517 |
+
class TypeAdapter
|
518 |
+
{
|
519 |
+
public function __construct($type){
|
520 |
+
$this->type = $type;
|
521 |
+
}
|
522 |
+
|
523 |
+
public function show_create_table($tablename){
|
524 |
+
switch($this->type){
|
525 |
+
case 'sqlite':
|
526 |
+
return "select tbl_name as 'Table', sql as 'Create Table' from sqlite_master where type='table' and tbl_name='$tablename'";
|
527 |
+
default:
|
528 |
+
return "SHOW CREATE TABLE `$tablename`";
|
529 |
+
}
|
530 |
+
}
|
531 |
+
|
532 |
+
public function drop_table($tablename){
|
533 |
+
switch($this->type){
|
534 |
+
case 'sqlite':
|
535 |
+
return "drop table if exists '$tablename'";
|
536 |
+
default:
|
537 |
+
return "DROP TABLE IF EXISTS `$tablename`";
|
538 |
+
}
|
539 |
+
}
|
540 |
+
|
541 |
+
public function show_tables($dbName){
|
542 |
+
switch($this->type){
|
543 |
+
case 'sqlite':
|
544 |
+
return "SELECT tbl_name FROM sqlite_master where type='table'";
|
545 |
+
default:
|
546 |
+
return "SELECT TABLE_NAME AS tbl_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA='$dbName'";
|
547 |
+
}
|
548 |
+
}
|
549 |
+
|
550 |
+
public function start_transaction(){
|
551 |
+
switch($this->type){
|
552 |
+
case 'sqlite':
|
553 |
+
return "BEGIN EXCLUSIVE";
|
554 |
+
default:
|
555 |
+
return "SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ; START TRANSACTION";
|
556 |
+
}
|
557 |
+
}
|
558 |
+
|
559 |
+
public function commit_transaction(){
|
560 |
+
switch($this->type){
|
561 |
+
case 'sqlite':
|
562 |
+
return "COMMIT";
|
563 |
+
default:
|
564 |
+
return "SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ; START TRANSACTION";
|
565 |
+
}
|
566 |
+
}
|
567 |
+
|
568 |
+
public function lock_table($tablename){
|
569 |
+
switch($this->type){
|
570 |
+
case 'sqlite':
|
571 |
+
return "";
|
572 |
+
default:
|
573 |
+
return "LOCK TABLES `$tablename` READ LOCAL";
|
574 |
+
}
|
575 |
+
}
|
576 |
+
|
577 |
+
public function unlock_table($tablename){
|
578 |
+
switch($this->type){
|
579 |
+
case 'sqlite':
|
580 |
+
return "";
|
581 |
+
default:
|
582 |
+
return "UNLOCK TABLES";
|
583 |
+
}
|
584 |
+
}
|
585 |
+
|
586 |
+
public function start_add_lock_table($tablename){
|
587 |
+
switch($this->type){
|
588 |
+
case 'sqlite':
|
589 |
+
return "\n";
|
590 |
+
default:
|
591 |
+
return "LOCK TABLES `$tablename` WRITE;\n";
|
592 |
+
}
|
593 |
+
}
|
594 |
+
|
595 |
+
public function end_add_lock_table($tablename){
|
596 |
+
switch($this->type){
|
597 |
+
case 'sqlite':
|
598 |
+
return "\n";
|
599 |
+
default:
|
600 |
+
return "UNLOCK TABLES;\n";
|
601 |
+
}
|
602 |
+
}
|
603 |
+
}
|
lib/vendor/zipper/zipper.lib.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( class_exists( 'ZipArchive' ) ) {
|
4 |
+
class Zipper extends ZipArchive {
|
5 |
+
protected $archive = null;
|
6 |
+
|
7 |
+
protected $root_dir = null;
|
8 |
+
|
9 |
+
public function __construct( $file ) {
|
10 |
+
if ( is_resource( $file ) ) {
|
11 |
+
$meta = stream_get_meta_data( $file );
|
12 |
+
$this->archive = $meta['uri'];
|
13 |
+
} else {
|
14 |
+
$this->archive = $file;
|
15 |
+
}
|
16 |
+
|
17 |
+
// Open Archive File
|
18 |
+
if ( !( $this->open( $this->archive ) === true ) ) {
|
19 |
+
throw new RuntimeException( 'Archive file cound not be created.' );
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public function addDir( $path, $parent_dir = null, $include = array() ) {
|
24 |
+
// Use Recursive functions
|
25 |
+
$iterator = new RecursiveIteratorIterator(
|
26 |
+
new RecursiveDirectoryIterator( $path , RecursiveDirectoryIterator::SKIP_DOTS ),
|
27 |
+
RecursiveIteratorIterator::SELF_FIRST
|
28 |
+
);
|
29 |
+
|
30 |
+
// Prepare File Filter Pattern
|
31 |
+
$file_pattern = null;
|
32 |
+
if ( is_array( $include ) ) {
|
33 |
+
$filters = array();
|
34 |
+
foreach ( $include as $file ) {
|
35 |
+
$filters[] = str_replace( '\.\*', '.*' , preg_quote( $file, '/' ) );
|
36 |
+
}
|
37 |
+
|
38 |
+
$file_pattern = implode( '|', $filters );
|
39 |
+
}
|
40 |
+
|
41 |
+
foreach ( $iterator as $item ) {
|
42 |
+
// Validate file pattern
|
43 |
+
if ( $file_pattern ) {
|
44 |
+
if ( ! preg_match( '/^(' . $file_pattern . ')$/', $iterator->getSubPathName() ) ) {
|
45 |
+
continue;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
// Add to archive
|
50 |
+
if ( $item->isDir() ) {
|
51 |
+
$this->addEmptyDir( $parent_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathName() );
|
52 |
+
} else {
|
53 |
+
$this->addFile( $item->getPathname(), $parent_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathName() );
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getArchive() {
|
59 |
+
return $this->archive;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
lib/view/assets/css/export.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.ai1wm-checkbox{position:relative;display:inline-block;min-width:1em;height:1.25em;line-height:1em;outline:none;vertical-align:middle;margin-bottom:5px}.ai1wm-checkbox input{position:absolute;top:0px;left:0px;opacity:0;outline:none}.ai1wm-checkbox .box,.ai1wm-checkbox label{cursor:pointer;padding-left:2em;outline:none}.ai1wm-checkbox .box:before,.ai1wm-checkbox label:before{position:absolute;top:0em;left:0em;line-height:1;width:1em;height:1em;left:0em;content:'';border-radius:4px;background:#FFFFFF;transition:background-color 0.3s ease,box-shadow 0.3s ease;box-shadow:0em 0em 0em 1px rgba(0,0,0,0.2)}.ai1wm-checkbox .box:after,.ai1wm-checkbox label:after{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0;content:'';position:absolute;background:transparent;border:0.2em solid #333333;border-top:none;border-right:none;transform:rotate(-45deg)}.ai1wm-checkbox .box:after,.ai1wm-checkbox label:after{top:0.275em;left:0.2em;width:0.45em;height:0.15em}.ai1wm-checkbox label{color:rgba(0,0,0,0.6);transition:color 0.2s ease}.ai1wm-checkbox label:hover{color:rgba(0,0,0,0.8)}.ai1wm-checkbox input:focus+label{color:rgba(0,0,0,0.8)}.ai1wm-checkbox+label{cursor:pointer;opacity:0.85;vertical-align:middle}.ai1wm-checkbox+label:hover{opacity:1}.ai1wm-checkbox{cursor:pointer}.ai1wm-checkbox .box,.ai1wm-checkbox label{padding-left:4em}.ai1wm-checkbox .box:before,.ai1wm-checkbox label:before{cursor:pointer;display:block;position:absolute;content:'';top:-0.25em;left:0em;z-index:1;background-color:#FFFFFF;width:3em;height:1.5em;transform:none;box-shadow:0px 0px 0px 1px rgba(0,0,0,0.1) inset;border-radius:50rem}.ai1wm-checkbox .box:after,.ai1wm-checkbox label:after{opacity:1;background-color:transparent;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;content:'';position:absolute;top:0.15em;left:0.5em;z-index:2;border:none;width:0.75em;height:0.75em;background-color:#D95C5C;border-radius:50rem;transition:background 0.3s ease 0s,left 0.3s ease 0s}.ai1wm-checkbox:active .box:before,.ai1wm-checkbox:active label:before{background-color:#F5F5F5}.ai1wm-checkbox input:checked+.box:after,.ai1wm-checkbox input:checked+label:after{left:1.75em;background-color:#89B84C}.ui.checkbox{font-size:1em}.ui.large.checkbox{font-size:1.25em}.ui.huge.checkbox{font-size:1.5em}.ai1wm-divider{margin:1rem 0rem;border-top:1px solid rgba(0,0,0,0.1);border-bottom:1px solid rgba(255,255,255,0.8);line-height:1;height:0em;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;border:none;height:0em;margin:0em;background-color:transparent;font-size:0.875rem;font-weight:bold;text-align:center;text-transform:uppercase;color:rgba(0,0,0,0.8)}.ai1wm-divider{position:relative;top:0%;left:0%;margin:1rem 2.5rem;height:auto;padding:0em;line-height:1}.ai1wm-divider:before,.ai1wm-divider:after{position:absolute;top:50%;content:" ";z-index:3;width:50%;top:50%;height:0%;border-top:1px solid rgba(0,0,0,0.1);border-bottom:1px solid rgba(255,255,255,0.8)}.ai1wm-divider:before{left:0%;margin-left:-2.5rem}.ai1wm-divider:after{left:auto;right:0%;margin-right:-2.5rem}@font-face{font-family:'servmask';src:url("../font/servmask.eot");src:url("../font/servmask.eot?#iefix") format("embedded-opentype"),url("../font/servmask.woff") format("woff"),url("../font/servmask.ttf") format("truetype"),url("../font/servmask.svg#servmask") format("svg");font-weight:normal;font-style:normal}[class^="ai1wm-icon-"],[class*=" ai1wm-icon-"]{font-family:'servmask';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-plus:before{content:"\e600"}.ai1wm-icon-plus2:before{content:"\e601"}.ai1wm-icon-plus3:before{content:"\e602"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-arrow-down2:before{content:"\e606"}.ai1wm-icon-plus:before{content:"\e607"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-file:before{content:"\e60a"}@media (min-width: 855px){.ai1wm-row{margin-right:399px}.ai1wm-row:before,.ai1wm-row:after{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:left;width:100%}.ai1wm-right{float:right;width:377px;margin-right:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 white;color:#333333;background-color:#f9f9f9;padding:22px;text-decoration:none;text-shadow:0 1px 0 white;background-clip:padding-box}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:normal;font-size:0.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:0.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:0.7rem;line-height:1rem;margin:4px 0 8px 0}}.ai1wm-holder{border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 white;padding:22px;background:#f9f9f9}.ai1wm-holder h1{margin-top:0 !important}.ai1wm-segment>.ai1wm-divider:first-child{margin-top:0 !important}@media (max-width: 854px){.ai1wm-container{margin-left:10px !important}.ai1wm-row{margin-right:0px !important}.ai1wm-right{float:left !important;width:100% !important;margin-top:18px;margin-right:0 !important}.ai1wm-right .ai1wm-sidebar{width:auto !important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 white;padding:22px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:normal;font-size:0.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:0.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:0.7rem;line-height:1rem;margin:4px 0 8px 0}}.ai1wm-container{margin:20px 20px 0px 2px}.ai1wm-container:before,.ai1wm-container:after{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 white;border-radius:3px;color:#333333;font-size:11px;font-weight:bold;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 white;background-clip:padding-box;margin-bottom:10px}.ai1wm-replace-row .ai1wm-field-inline{float:left;width:100%}.ai1wm-replace-row .ai1wm-field-inline input{width:100%;font-weight:normal;font-size:0.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type="text"],.ai1wm-field textarea{width:100%;font-weight:normal}.ai1wm-message{-moz-box-sizing:border-box;background-color:#EFEFEF;border-radius:4px;color:rgba(0,0,0,0.6);height:auto;margin:10px 0;min-height:18px;padding:10px;position:relative;transition:opacity 0.1s ease 0s, color 0.1s ease 0s, background 0.1s ease 0s, box-shadow 0.1s ease 0s}.ai1wm-message.ai1wm-green-message{background-color:#F2F8F0;color:#119000}.ai1wm-message.ai1wm-blue-message{background-color:#E6F4F9;color:#4D8796}.ai1wm-message.ai1wm-red-message{background-color:#F1D7D7;color:#A95252}.ai1wm-message p{margin:4px 0}.ai1wm-button-gray{border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;display:inline-block;font-size:11px;font-weight:bold;background-color:#fafafa;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fafafa),color-stop(100%, #dedede));background-image:-webkit-linear-gradient(#fafafa,#dedede);background-image:linear-gradient(#fafafa,#dedede);padding:7px 18px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-button-gray:hover:not(:disabled){box-shadow:inset 0 1px 0 0 #fff;cursor:pointer;background-color:#ededed;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ededed),color-stop(100%, #d6d6d6));background-image:-webkit-linear-gradient(#ededed,#d6d6d6);background-image:linear-gradient(#ededed,#d6d6d6)}.ai1wm-button-gray:active:not(:disabled){border:1px solid #d6d6d6;box-shadow:inset 0 0 8px 4px #cfcfcf,inset 0 0 8px 4px #cfcfcf,0 1px 1px 0 #eee}.ai1wm-button-gray:disabled{opacity:0.5;cursor:not-allowed}.ai1wm-button-green{border:1px solid #4d8b2c;border-radius:3px;box-shadow:inset 0 1px 0 0 #9cc587;color:#fff;display:inline-block;font-size:11px;font-weight:bold;background-color:#6eb649;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #6eb649),color-stop(100%, #539730));background-image:-webkit-linear-gradient(#6eb649,#539730);background-image:linear-gradient(#6eb649,#539730);padding:7px 18px;text-decoration:none;text-shadow:0 1px 0 #428122;background-clip:padding-box}.ai1wm-button-green:hover:not(:disabled){box-shadow:inset 0 1px 0 0 #7fb563;cursor:pointer;background-color:#649f46;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #649f46),color-stop(100%, #4d8a2d));background-image:-webkit-linear-gradient(#649f46,#4d8a2d);background-image:linear-gradient(#649f46,#4d8a2d)}.ai1wm-button-green:active:not(:disabled){border:1px solid #4d8b2c;box-shadow:inset 0 0 8px 4px #477e2a,inset 0 0 8px 4px #477e2a,0 1px 1px 0 #eee}.ai1wm-button-green:disabled{opacity:0.5;cursor:not-allowed}.ai1wm-button-blue{border:1px solid #007ba9;border-radius:3px;box-shadow:inset 0 1px 0 0 #45c7f7;color:#fff;display:inline-block;font-size:11px;font-weight:bold;background-color:#00aff0;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #00aff0),color-stop(100%, #0086b8));background-image:-webkit-linear-gradient(#00aff0,#0086b8);background-image:linear-gradient(#00aff0,#0086b8);padding:7px 18px;text-decoration:none;text-shadow:0 1px 0 #006c94;background-clip:padding-box}.ai1wm-button-blue:hover:not(:disabled){box-shadow:inset 0 1px 0 0 #13b9f6;cursor:pointer;background-color:#049ad2;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049ad2),color-stop(100%, #007ba9));background-image:-webkit-linear-gradient(#049ad2,#007ba9);background-image:linear-gradient(#049ad2,#007ba9)}.ai1wm-button-blue:active:not(:disabled){border:1px solid #007ba9;box-shadow:inset 0 0 8px 4px #007099,inset 0 0 8px 4px #007099,0 1px 1px 0 #eee}.ai1wm-button-blue:disabled{opacity:0.5;cursor:not-allowed}.ai1wm-button-gray i,.ai1wm-button-green i,.ai1wm-button-blue i{margin-left:-0.5em;margin-right:0.2em}.ai1wm-button-gray i.ai1wm-alone,.ai1wm-button-green i.ai1wm-alone,.ai1wm-button-blue i.ai1wm-alone{margin-right:-0.5em !important}.ai1wm-clear{*zoom:1}.ai1wm-clear:before,.ai1wm-clear:after{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-field-inline input{border-radius:5px}.ai1wm-toggle-checkbox label{color:#333333;display:inline-block;font-size:11px;font-weight:bold;text-decoration:none;text-shadow:0 1px 0 white}.ai1wm-accordion{margin:10px 0 20px 0}.ai1wm-accordion .ai1wm-title{cursor:pointer;float:left}.ai1wm-accordion .ai1wm-title:after{clear:both}.ai1wm-accordion .ai1wm-title:hover{color:rgba(0,116,162,0.8)}.ai1wm-accordion .ai1wm-content{display:none;margin:22px 0px 0px 22px}.ai1wm-accordion.ai1wm-active .ai1wm-title .ai1wm-icon-arrow-right:before{content:"\e606"}.ai1wm-accordion.ai1wm-active .ai1wm-content{display:block}.ai1wm-include-tables{display:inline-block;width:300px;margin:0 6px 0 0}.ai1wm-include-plugins{display:inline-block;width:300px;vertical-align:top}.ai1wm-include-media{display:inline-block;width:300px;margin:0 6px 0 0}.ai1wm-include-themes{display:inline-block;width:300px;vertical-align:top}
|
lib/view/assets/css/import.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.ai1wm-divider{margin:1rem 0rem;border-top:1px solid rgba(0,0,0,0.1);border-bottom:1px solid rgba(255,255,255,0.8);line-height:1;height:0em;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;border:none;height:0em;margin:0em;background-color:transparent;font-size:0.875rem;font-weight:bold;text-align:center;text-transform:uppercase;color:rgba(0,0,0,0.8)}.ai1wm-divider{position:relative;top:0%;left:0%;margin:1rem 2.5rem;height:auto;padding:0em;line-height:1}.ai1wm-divider:before,.ai1wm-divider:after{position:absolute;top:50%;content:" ";z-index:3;width:50%;top:50%;height:0%;border-top:1px solid rgba(0,0,0,0.1);border-bottom:1px solid rgba(255,255,255,0.8)}.ai1wm-divider:before{left:0%;margin-left:-2.5rem}.ai1wm-divider:after{left:auto;right:0%;margin-right:-2.5rem}@font-face{font-family:'servmask';src:url("../font/servmask.eot");src:url("../font/servmask.eot?#iefix") format("embedded-opentype"),url("../font/servmask.woff") format("woff"),url("../font/servmask.ttf") format("truetype"),url("../font/servmask.svg#servmask") format("svg");font-weight:normal;font-style:normal}[class^="ai1wm-icon-"],[class*=" ai1wm-icon-"]{font-family:'servmask';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-plus:before{content:"\e600"}.ai1wm-icon-plus2:before{content:"\e601"}.ai1wm-icon-plus3:before{content:"\e602"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-arrow-down2:before{content:"\e606"}.ai1wm-icon-plus:before{content:"\e607"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-file:before{content:"\e60a"}@media (min-width: 855px){.ai1wm-row{margin-right:399px}.ai1wm-row:before,.ai1wm-row:after{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:left;width:100%}.ai1wm-right{float:right;width:377px;margin-right:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 white;color:#333333;background-color:#f9f9f9;padding:22px;text-decoration:none;text-shadow:0 1px 0 white;background-clip:padding-box}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:normal;font-size:0.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:0.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:0.7rem;line-height:1rem;margin:4px 0 8px 0}}.ai1wm-holder{border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 white;padding:22px;background:#f9f9f9}.ai1wm-holder h1{margin-top:0 !important}.ai1wm-segment>.ai1wm-divider:first-child{margin-top:0 !important}@media (max-width: 854px){.ai1wm-container{margin-left:10px !important}.ai1wm-row{margin-right:0px !important}.ai1wm-right{float:left !important;width:100% !important;margin-top:18px;margin-right:0 !important}.ai1wm-right .ai1wm-sidebar{width:auto !important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 white;padding:22px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:normal;font-size:0.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:0.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:0.7rem;line-height:1rem;margin:4px 0 8px 0}}.ai1wm-container{margin:20px 20px 0px 2px}.ai1wm-container:before,.ai1wm-container:after{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 white;border-radius:3px;color:#333333;font-size:11px;font-weight:bold;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 white;background-clip:padding-box;margin-bottom:10px}.ai1wm-replace-row .ai1wm-field-inline{float:left;width:100%}.ai1wm-replace-row .ai1wm-field-inline input{width:100%;font-weight:normal;font-size:0.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type="text"],.ai1wm-field textarea{width:100%;font-weight:normal}.ai1wm-message{-moz-box-sizing:border-box;background-color:#EFEFEF;border-radius:4px;color:rgba(0,0,0,0.6);height:auto;margin:10px 0;min-height:18px;padding:10px;position:relative;transition:opacity 0.1s ease 0s, color 0.1s ease 0s, background 0.1s ease 0s, box-shadow 0.1s ease 0s}.ai1wm-message.ai1wm-green-message{background-color:#F2F8F0;color:#119000}.ai1wm-message.ai1wm-blue-message{background-color:#E6F4F9;color:#4D8796}.ai1wm-message.ai1wm-red-message{background-color:#F1D7D7;color:#A95252}.ai1wm-message p{margin:4px 0}.ai1wm-button-gray{border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;display:inline-block;font-size:11px;font-weight:bold;background-color:#fafafa;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fafafa),color-stop(100%, #dedede));background-image:-webkit-linear-gradient(#fafafa,#dedede);background-image:linear-gradient(#fafafa,#dedede);padding:7px 18px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-button-gray:hover:not(:disabled){box-shadow:inset 0 1px 0 0 #fff;cursor:pointer;background-color:#ededed;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ededed),color-stop(100%, #d6d6d6));background-image:-webkit-linear-gradient(#ededed,#d6d6d6);background-image:linear-gradient(#ededed,#d6d6d6)}.ai1wm-button-gray:active:not(:disabled){border:1px solid #d6d6d6;box-shadow:inset 0 0 8px 4px #cfcfcf,inset 0 0 8px 4px #cfcfcf,0 1px 1px 0 #eee}.ai1wm-button-gray:disabled{opacity:0.5;cursor:not-allowed}.ai1wm-button-green{border:1px solid #4d8b2c;border-radius:3px;box-shadow:inset 0 1px 0 0 #9cc587;color:#fff;display:inline-block;font-size:11px;font-weight:bold;background-color:#6eb649;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #6eb649),color-stop(100%, #539730));background-image:-webkit-linear-gradient(#6eb649,#539730);background-image:linear-gradient(#6eb649,#539730);padding:7px 18px;text-decoration:none;text-shadow:0 1px 0 #428122;background-clip:padding-box}.ai1wm-button-green:hover:not(:disabled){box-shadow:inset 0 1px 0 0 #7fb563;cursor:pointer;background-color:#649f46;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #649f46),color-stop(100%, #4d8a2d));background-image:-webkit-linear-gradient(#649f46,#4d8a2d);background-image:linear-gradient(#649f46,#4d8a2d)}.ai1wm-button-green:active:not(:disabled){border:1px solid #4d8b2c;box-shadow:inset 0 0 8px 4px #477e2a,inset 0 0 8px 4px #477e2a,0 1px 1px 0 #eee}.ai1wm-button-green:disabled{opacity:0.5;cursor:not-allowed}.ai1wm-button-blue{border:1px solid #007ba9;border-radius:3px;box-shadow:inset 0 1px 0 0 #45c7f7;color:#fff;display:inline-block;font-size:11px;font-weight:bold;background-color:#00aff0;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #00aff0),color-stop(100%, #0086b8));background-image:-webkit-linear-gradient(#00aff0,#0086b8);background-image:linear-gradient(#00aff0,#0086b8);padding:7px 18px;text-decoration:none;text-shadow:0 1px 0 #006c94;background-clip:padding-box}.ai1wm-button-blue:hover:not(:disabled){box-shadow:inset 0 1px 0 0 #13b9f6;cursor:pointer;background-color:#049ad2;background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #049ad2),color-stop(100%, #007ba9));background-image:-webkit-linear-gradient(#049ad2,#007ba9);background-image:linear-gradient(#049ad2,#007ba9)}.ai1wm-button-blue:active:not(:disabled){border:1px solid #007ba9;box-shadow:inset 0 0 8px 4px #007099,inset 0 0 8px 4px #007099,0 1px 1px 0 #eee}.ai1wm-button-blue:disabled{opacity:0.5;cursor:not-allowed}.ai1wm-button-gray i,.ai1wm-button-green i,.ai1wm-button-blue i{margin-left:-0.5em;margin-right:0.2em}.ai1wm-button-gray i.ai1wm-alone,.ai1wm-button-green i.ai1wm-alone,.ai1wm-button-blue i.ai1wm-alone{margin-right:-0.5em !important}.ai1wm-clear{*zoom:1}.ai1wm-clear:before,.ai1wm-clear:after{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-field-inline input{border-radius:5px}.ai1wm-toggle-checkbox label{color:#333333;display:inline-block;font-size:11px;font-weight:bold;text-decoration:none;text-shadow:0 1px 0 white}.ai1wm-drag-drop-area{border:4px dashed #DDDDDD;height:200px;margin:20px 0 16px 0;background:#fff}.ai1wm-drag-drop-area.dragover{background:rgba(255,255,255,0.4);border-color:green}.ai1wm-drag-drop-area .ai1wm-drag-drop-inside{margin:70px auto 0;width:250px}.ai1wm-drag-drop-inside p{display:block;text-align:center;color:#AAAAAA;font-size:14px;margin:5px 0}.ai1wm-drag-drop-inside p.ai1wm-drag-drop-info{font-size:20px}.ai1wm-drag-drop-inside p.ai1wm-upload-progress{margin:-15px 0 15px 0;display:none;color:#000;font-size:20px}.ai1wm-drag-over #ai1wm-drag-drop-area{border-color:#83b4d8}.ai1wm-upload-file-message{display:none}
|
lib/view/assets/font/servmask.eot
ADDED
Binary file
|
lib/view/assets/font/servmask.svg
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<defs>
|
5 |
+
<font id="servmask" horiz-adv-x="1024">
|
6 |
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
7 |
+
<missing-glyph horiz-adv-x="1024" />
|
8 |
+
<glyph unicode=" " d="" horiz-adv-x="512" />
|
9 |
+
<glyph unicode="" d="M992 576h-352v352c0 17.672-14.328 32-32 32h-192c-17.672 0-32-14.328-32-32v-352h-352c-17.672 0-32-14.328-32-32v-192c0-17.672 14.328-32 32-32h352v-352c0-17.672 14.328-32 32-32h192c17.672 0 32 14.328 32 32v352h352c17.672 0 32 14.328 32 32v192c0 17.672-14.328 32-32 32z" />
|
10 |
+
<glyph unicode="" d="M778.189 512h-215.040v215.040c0 28.262-22.886 30.72-51.2 30.72-28.262 0-51.2-2.406-51.2-30.72v-215.040h-214.989c-28.314 0-30.72-22.938-30.72-51.2s2.406-51.2 30.72-51.2h214.989v-215.040c0-28.262 22.938-30.72 51.2-30.72 28.314 0 51.2 2.458 51.2 30.72v215.040h215.040c28.314 0 30.771 22.938 30.771 51.2s-2.458 51.2-30.771 51.2z" />
|
11 |
+
<glyph unicode="" d="M819.2 870.4h-614.4c-56.32 0-102.4-46.080-102.4-102.4v-614.4c0-56.32 46.080-102.4 102.4-102.4h614.4c56.32 0 102.4 46.080 102.4 102.4v614.4c0 56.32-46.080 102.4-102.4 102.4zM768 409.6h-204.8v-204.8h-102.4v204.8h-204.8v102.4h204.8v204.8h102.4v-204.8h204.8v-102.4z" />
|
12 |
+
<glyph unicode="" d="M576 896c247.424 0 448-200.576 448-448s-200.576-448-448-448v96c94.024 0 182.418 36.614 248.902 103.098 66.484 66.484 103.098 154.878 103.098 248.902 0 94.022-36.614 182.418-103.098 248.902-66.484 66.484-154.878 103.098-248.902 103.098-94.022 0-182.418-36.614-248.902-103.098-51.14-51.138-84.582-115.246-97.306-184.902h186.208l-224-256-224 256h164.57c31.060 217.102 217.738 384 443.43 384zM768 512v-128h-256v320h128v-192z" />
|
13 |
+
<glyph unicode="" d="M1024 448c0 282.77-229.23 512-512 512s-512-229.23-512-512 229.23-512 512-512 512 229.23 512 512zM96 448c0 229.75 186.25 416 416 416s416-186.25 416-416-186.25-416-416-416-416 186.25-416 416zM557.254 146.744l256 256.002c24.994 24.992 24.994 65.514 0 90.508s-65.516 24.994-90.51 0l-146.744-146.744v357.49c0 35.346-28.654 64-64 64s-64-28.654-64-64v-357.49l-146.744 146.746c-24.994 24.994-65.518 24.994-90.512 0-12.496-12.498-18.744-28.878-18.744-45.256s6.248-32.758 18.744-45.254l256-256.002c24.994-24.992 65.518-24.992 90.51 0z" />
|
14 |
+
<glyph unicode="" d="M307.251 696.32l-0.051-471.040 409.6 235.52z" />
|
15 |
+
<glyph unicode="" d="M747.52 665.549l-471.040 0.051 235.52-409.6z" />
|
16 |
+
<glyph unicode="" d="M512 890.88c-237.568 0-430.080-192.614-430.080-430.080 0-237.568 192.563-430.080 430.080-430.080 237.517 0 430.080 192.563 430.080 430.080 0 237.517-192.563 430.080-430.080 430.080zM564.326 408.474v-206.182h-104.653v206.182h-206.234v104.653h206.182v206.234h104.704v-206.182h206.182v-104.704h-206.182z" />
|
17 |
+
<glyph unicode="" d="M1009.376 954.88c-5.312 3.424-11.36 5.12-17.376 5.12-6.176 0-12.384-1.76-17.76-5.376l-960-640c-9.888-6.56-15.328-18.112-14.048-29.952 1.216-11.808 8.896-22.016 19.936-26.368l250.368-100.192 117.728-206.016c5.632-9.888 16.096-16 27.424-16.128 0.128 0 0.224 0 0.352 0 11.232 0 21.664 5.952 27.424 15.552l66.464 110.816 310.24-124.064c3.808-1.536 7.808-2.272 11.872-2.272 5.44 0 10.816 1.376 15.68 4.128 8.448 4.736 14.24 13.056 15.872 22.624l160 960c2.080 12.576-3.488 25.184-14.176 32.128zM100.352 295.136l741.6 494.432-539.2-577.184c-2.848 1.696-5.376 3.936-8.512 5.184l-193.888 77.568zM326.048 189.888c-0.064 0.128-0.16 0.192-0.224 0.32l606.176 648.8-516.768-805.184-89.184 156.064zM806.944 12.512l-273.312 109.312c-6.496 2.56-13.248 3.424-19.936 3.808l420.864 652.416-127.616-765.536z" />
|
18 |
+
<glyph unicode="" d="M512-46.545c-282.764 0-512 229.236-512 512s229.236 512 512 512 512-229.236 512-512-229.236-512-512-512zM512 884.364c-231.377 0-418.909-187.532-418.909-418.909s187.532-418.909 418.909-418.909 418.909 187.532 418.909 418.909-187.532 418.909-418.909 418.909zM558.545 378.974c0-25.507 0-53.155 0-53.155h-93.091c0 0 0 67.351 0 93.091s20.852 46.545 46.545 46.545v0c51.386 0 93.091 41.705 93.091 93.091s-41.705 93.091-93.091 93.091-93.091-41.705-93.091-93.091c0-17.036 4.887-32.815 12.893-46.545h-99.375c-3.91 14.941-6.609 30.394-6.609 46.545 0 102.819 83.363 186.182 186.182 186.182s186.182-83.363 186.182-186.182c0-86.621-59.439-158.813-139.636-179.572zM558.545 186.182h-93.091v93.091h93.091v-93.091z" />
|
19 |
+
<glyph unicode="" d="M864 960h-768c-52.8 0-96-43.2-96-96v-832c0-52.8 43.2-96 96-96h768c52.8 0 96 43.2 96 96v832c0 52.8-43.2 96-96 96zM832 64h-704v768h704v-768zM256 512h448v-64h-448zM256 384h448v-64h-448zM256 256h448v-64h-448zM256 640h448v-64h-448z" />
|
20 |
+
</font></defs></svg>
|
lib/view/assets/font/servmask.ttf
ADDED
Binary file
|
lib/view/assets/font/servmask.woff
ADDED
Binary file
|
lib/view/assets/javascript/export.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function($,window,document,undefined){$.fn.ai1wm_checkbox=function(parameters){var returnedValue,$allModules=$(this),moduleSelector=$allModules.selector||"",time=(new Date).getTime(),performance=[],query=arguments[0],methodInvoked="string"==typeof query,queryArguments=[].slice.call(arguments,1);return $allModules.each(function(){var module,settings=$.extend(!0,{},$.fn.ai1wm_checkbox.settings,parameters),className=settings.className,namespace=settings.namespace,eventNamespace=(settings.error,"."+namespace),moduleNamespace="module-"+namespace,$module=$(this),$label=$(this).next(settings.selector.label).first(),$input=$(this).find(settings.selector.input),selector=$module.selector||"",instance=$module.data(moduleNamespace),element=this;module={initialize:function(){module.verbose("Initializing checkbox",settings),settings.context&&""!==selector?(module.verbose("Adding delegated events"),$(element,settings.context).on(selector,"click"+eventNamespace,module.toggle).on(selector+" + "+settings.selector.label,"click"+eventNamespace,module.toggle)):($module.on("click"+eventNamespace,module.toggle).data(moduleNamespace,module),$label.on("click"+eventNamespace,module.toggle)),module.instantiate()},instantiate:function(){module.verbose("Storing instance of module",module),instance=module,$module.data(moduleNamespace,module)},destroy:function(){module.verbose("Destroying previous module"),$module.off(eventNamespace).removeData(moduleNamespace)},is:{radio:function(){return $module.hasClass(className.radio)},enabled:function(){return $input.prop("checked")!==undefined&&$input.prop("checked")},disabled:function(){return!module.is.enabled()}},can:{disable:function(){return"boolean"==typeof settings.required?settings.required:!module.is.radio()}},enable:function(){module.debug("Enabling checkbox",$input),$input.prop("checked",!0),$.proxy(settings.onChange,$input.get())(),$.proxy(settings.onEnable,$input.get())()},disable:function(){module.debug("Disabling checkbox"),$input.prop("checked",!1),$.proxy(settings.onChange,$input.get())(),$.proxy(settings.onDisable,$input.get())()},toggle:function(){module.verbose("Determining new checkbox state"),module.is.disabled()?module.enable():module.is.enabled()&&module.can.disable()&&module.disable()},setting:function(name,value){if($.isPlainObject(name))$.extend(!0,settings,name);else{if(value===undefined)return settings[name];settings[name]=value}},internal:function(name,value){if($.isPlainObject(name))$.extend(!0,module,name);else{if(value===undefined)return module[name];module[name]=value}},debug:function(){settings.debug&&(settings.performance?module.performance.log(arguments):(module.debug=Function.prototype.bind.call(console.info,console,settings.name+":"),module.debug.apply(console,arguments)))},verbose:function(){settings.verbose&&settings.debug&&(settings.performance?module.performance.log(arguments):(module.verbose=Function.prototype.bind.call(console.info,console,settings.name+":"),module.verbose.apply(console,arguments)))},error:function(){module.error=Function.prototype.bind.call(console.error,console,settings.name+":"),module.error.apply(console,arguments)},performance:{log:function(message){var currentTime,executionTime,previousTime;settings.performance&&(currentTime=(new Date).getTime(),previousTime=time||currentTime,executionTime=currentTime-previousTime,time=currentTime,performance.push({Element:element,Name:message[0],Arguments:[].slice.call(message,1)||"","Execution Time":executionTime})),clearTimeout(module.performance.timer),module.performance.timer=setTimeout(module.performance.display,100)},display:function(){var title=settings.name+":",totalTime=0;time=!1,clearTimeout(module.performance.timer),$.each(performance,function(index,data){totalTime+=data["Execution Time"]}),title+=" "+totalTime+"ms",moduleSelector&&(title+=" '"+moduleSelector+"'"),(console.group!==undefined||console.table!==undefined)&&performance.length>0&&(console.groupCollapsed(title),console.table?console.table(performance):$.each(performance,function(index,data){console.log(data.Name+": "+data["Execution Time"]+"ms")}),console.groupEnd()),performance=[]}},invoke:function(query,passedArguments,context){var maxDepth,found,response,object=instance;return passedArguments=passedArguments||queryArguments,context=element||context,"string"==typeof query&&object!==undefined&&(query=query.split(/[\. ]/),maxDepth=query.length-1,$.each(query,function(depth,value){var camelCaseValue=depth!=maxDepth?value+query[depth+1].charAt(0).toUpperCase()+query[depth+1].slice(1):query;if($.isPlainObject(object[camelCaseValue])&&depth!=maxDepth)object=object[camelCaseValue];else{if(object[camelCaseValue]!==undefined)return found=object[camelCaseValue],!1;if(!$.isPlainObject(object[value])||depth==maxDepth)return object[value]!==undefined?(found=object[value],!1):!1;object=object[value]}})),$.isFunction(found)?response=found.apply(context,passedArguments):found!==undefined&&(response=found),$.isArray(returnedValue)?returnedValue.push(response):returnedValue!==undefined?returnedValue=[returnedValue,response]:response!==undefined&&(returnedValue=response),found}},methodInvoked?(instance===undefined&&module.initialize(),module.invoke(query)):(instance!==undefined&&module.destroy(),module.initialize())}),returnedValue!==undefined?returnedValue:this},$.fn.ai1wm_checkbox.settings={name:"ai1wm-Checkbox",namespace:"ai1wm-checkbox",verbose:!0,debug:!0,performance:!0,context:!1,required:"auto",onChange:function(){},onEnable:function(){},onDisable:function(){},error:{method:"The method you called is not defined."},selector:{input:"input[type=checkbox], input[type=radio]",label:"label"},className:{radio:"radio"}}}(jQuery,window,document),jQuery(document).ready(function($){"use strict";$("#ai1wm-feedback-submit").click(function(){var url=ai1wm_feedback.ajax.url,email=$(".ai1wm-feedback-email").val(),message=$(".ai1wm-feedback-message").val(),terms=$(".ai1wm-feedback-terms").is(":checked");$.ajax({type:"POST",url:url,data:{email:email,message:message,terms:+terms},success:function(data){var errors=data.errors;if(errors.length>0){$("#ai1wm-feedback .ai1wm-message").remove();var content=$("<div />").addClass("ai1wm-message ai1wm-red-message");$.each(errors,function(key,value){content.append("<p>"+value+"</p>")}),$("#ai1wm-feedback").prepend(content)}else{var content=$("<div />").addClass("ai1wm-message ai1wm-green-message").append("<p>Thanks for submitting your feedback!</p>");$("#ai1wm-feedback").html(content)}},dataType:"json",async:!1})})}),jQuery(document).ready(function($){"use strict";$(".ai1wm-accordion > .ai1wm-title").click(function(){$(this).parent().toggleClass("ai1wm-active")}),$(".ai1wm-checkbox").ai1wm_checkbox(),$("#add-new-replace-button").click(function(e){var row=$(".ai1wm-replace-row:last").clone();row.find("input").val(""),$(".ai1wm-replace-row:last").after(row),e.preventDefault()})});
|
lib/view/assets/javascript/import.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function($){"use strict";$("#ai1wm-feedback-submit").click(function(){var url=ai1wm_feedback.ajax.url,email=$(".ai1wm-feedback-email").val(),message=$(".ai1wm-feedback-message").val(),terms=$(".ai1wm-feedback-terms").is(":checked");$.ajax({type:"POST",url:url,data:{email:email,message:message,terms:+terms},success:function(data){var errors=data.errors;if(errors.length>0){$("#ai1wm-feedback .ai1wm-message").remove();var content=$("<div />").addClass("ai1wm-message ai1wm-red-message");$.each(errors,function(key,value){content.append("<p>"+value+"</p>")}),$("#ai1wm-feedback").prepend(content)}else{var content=$("<div />").addClass("ai1wm-message ai1wm-green-message").append("<p>Thanks for submitting your feedback!</p>");$("#ai1wm-feedback").html(content)}},dataType:"json",async:!1})})}),jQuery(document).ready(function($){"use strict";var display_upload_errors=function(errors){var box=$(".ai1wm-upload-file-message");box.removeClass("ai1wm-green-message").addClass("ai1wm-red-message"),box.find("p").remove(),errors.length>0?($.each(errors,function(index,value){box.append("<p>"+value+"</p>")}),box.show()):box.hide()},display_upload_messages=function(messages){var box=$(".ai1wm-upload-file-message");box.removeClass("ai1wm-red-message").addClass("ai1wm-green-message"),box.find("p").remove(),messages.length>0?($.each(messages,function(index,value){box.append("<p>"+value+"</p>")}),box.show()):box.hide()},upload_progress=function(up,file){var box=$(".ai1wm-upload-progress");box.text(file.percent+"%"),box.show()},upload_error=function(up,error){var message=null;message=-601===error.code?"File extension error! Please ensure that the file is in <strong>ZIP</strong> archive format.":error.message,display_upload_errors([message]),up.refresh()},file_uploaded=function(up,file,result){var json=$.parseJSON(result.response);display_upload_errors(json.errors)},upload_complete=function(){var errors=$(".ai1wm-upload-file-message.ai1wm-red-message p");0==errors.length&&display_upload_messages(["Archive was successfully uploaded and imported into Wordpress."])},uploader=new plupload.Uploader(ai1wm_uploader);uploader.bind("Init",function(up){var uploaddiv=$("#ai1wm-plupload-upload-ui");up.features.dragdrop&&!$(document.body).hasClass("mobile")?$("#ai1wm-drag-drop-area").bind("dragover.wp-uploader",function(){uploaddiv.addClass("ai1wm-drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){uploaddiv.removeClass("ai1wm-drag-over")}):$("#ai1wm-drag-drop-area").unbind(".wp-uploader"),"html4"==up.runtime&&$(".upload-flash-bypass").hide()}),uploader.init(),uploader.bind("FilesAdded",function(up){up.refresh(),up.start()}),uploader.bind("BeforeUpload",function(){var box=$(".ai1wm-upload-file-message");box.hide()}),uploader.bind("UploadFile",function(){}),uploader.bind("UploadProgress",upload_progress),uploader.bind("Error",upload_error),uploader.bind("FileUploaded",file_uploaded),uploader.bind("UploadComplete",upload_complete)});
|
lib/view/export/index.php
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
?>
|
19 |
+
<div class="ai1wm-container">
|
20 |
+
<div class="ai1wm-row">
|
21 |
+
<div class="ai1wm-left">
|
22 |
+
<div class="ai1wm-holder">
|
23 |
+
<h1><?php _e( 'Export Site Data' ); ?></h1>
|
24 |
+
<p>
|
25 |
+
<?php _e( 'Use the form below to replace any data from the current database.' ); ?><br />
|
26 |
+
<?php _e( 'In the first field, enter a string that you want to search for, in the second field enter another string to replace the first string with.' ); ?>
|
27 |
+
</p>
|
28 |
+
<form action="" method="post" id="ai1wm-export-form">
|
29 |
+
|
30 |
+
<div class="ai1wm-replace-row">
|
31 |
+
<div class="ai1wm-field-inline">
|
32 |
+
<input type="text" value="<?php echo get_bloginfo( 'url' ); ?>" placeholder="<?php _e( 'Current Site URL' ); ?>" name="options[replace][old-value][]" id="old-value-1" />
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div class="ai1wm-field-inline">
|
36 |
+
<input type="text" value="" placeholder="<?php _e( 'New Website URL (ex. https://servmask.com)' ); ?>" name="options[replace][new-value][]" id="new-value-1" />
|
37 |
+
</div>
|
38 |
+
<div class="ai1wm-clear"></div>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<div class="ai1wm-replace-row">
|
42 |
+
<div class="ai1wm-field-inline">
|
43 |
+
<input type="text" value="" placeholder="<?php _e( 'Find' ); ?>" name="options[replace][old-value][]" id="old-value-1" />
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<div class="ai1wm-field-inline">
|
47 |
+
<input type="text" value="" placeholder="<?php _e( 'Replace with' ); ?>" name="options[replace][new-value][]" id="new-value-1" />
|
48 |
+
</div>
|
49 |
+
<div class="ai1wm-clear"></div>
|
50 |
+
</div>
|
51 |
+
<div class="ai1wm-clear"></div>
|
52 |
+
<button class="ai1wm-button-gray" id="add-new-replace-button"><i class="ai1wm-icon-plus"></i> ADD MORE</button>
|
53 |
+
|
54 |
+
<div class="ai1wm-divider"><?php _e( 'Options' ); ?></div>
|
55 |
+
|
56 |
+
<div class="ai1wm-field">
|
57 |
+
<div class="ai1wm-checkbox">
|
58 |
+
<input type="checkbox" id="export-spam-comments" name="options[export-spam-comments]" />
|
59 |
+
<label for="export-spam-comments"><?php _e( 'Do not export spam comments' ); ?></label>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
|
63 |
+
<div class="ai1wm-field">
|
64 |
+
<div class="ai1wm-checkbox">
|
65 |
+
<input type="checkbox" id="export-revisions" name="options[export-revisions]" />
|
66 |
+
<label for="export-revisions"><?php _e( 'Do not export post revisions' ); ?></label>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
|
70 |
+
<div class="ai1wm-accordion">
|
71 |
+
<div class="ai1wm-title">
|
72 |
+
<i class="ai1wm-icon-arrow-right"></i>
|
73 |
+
<?php _e( 'Advanced settings' ); ?>
|
74 |
+
</div>
|
75 |
+
<div class="ai1wm-clear"></div>
|
76 |
+
<div class="ai1wm-content">
|
77 |
+
<div class="ai1wm-field">
|
78 |
+
<div class="ai1wm-checkbox">
|
79 |
+
<input type="checkbox" id="export-media" name="options[export-media]" />
|
80 |
+
<label for="export-media"><?php _e( 'Do not export media library (files)' ); ?></label>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
|
84 |
+
<div class="ai1wm-field">
|
85 |
+
<div class="ai1wm-checkbox">
|
86 |
+
<input type="checkbox" id="export-themes" name="options[export-themes]" />
|
87 |
+
<label for="export-themes"><?php _e( 'Do not export themes (files)' ); ?></label>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
|
91 |
+
<div class="ai1wm-field">
|
92 |
+
<div class="ai1wm-checkbox">
|
93 |
+
<input type="checkbox" id="export-plugins" name="options[export-plugins]" />
|
94 |
+
<label for="export-plugins"><?php _e( 'Do not export plugins (files)' ); ?></label>
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
|
98 |
+
<div class="ai1wm-field">
|
99 |
+
<div class="ai1wm-checkbox">
|
100 |
+
<input type="checkbox" id="export-database" name="options[export-database]" />
|
101 |
+
<label for="export-database"><?php _e( 'Do not export database (sql)' ); ?></label>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<div class="ai1wm-field">
|
106 |
+
<div class="ai1wm-checkbox">
|
107 |
+
<input type="checkbox" id="export-table-data" name="options[export-table-data]" />
|
108 |
+
<label for="export-table-data"><?php _e( 'Do not export table data' ); ?></label>
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
|
114 |
+
<?php if ( class_exists( 'Zipper' ) ): ?>
|
115 |
+
<div class="ai1wm-field">
|
116 |
+
<div class="ai1wm-buttons">
|
117 |
+
<button type="submit" name="options[action]" value="export" class="ai1wm-button-green">
|
118 |
+
<i class="ai1wm-icon-arrow-down"></i>
|
119 |
+
<?php _e( 'EXPORT PACKAGE' ); ?>
|
120 |
+
</button>
|
121 |
+
</div>
|
122 |
+
</div>
|
123 |
+
<?php else : ?>
|
124 |
+
<div class="ai1wm-message ai1wm-red-message">
|
125 |
+
<p><?php _e( 'Please enable zlib library in your php.ini configuration file in order to be able to export database and media library (files).' ); ?></p>
|
126 |
+
</div>
|
127 |
+
<?php endif; ?>
|
128 |
+
</form>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
<div class="ai1wm-right">
|
132 |
+
<div class="ai1wm-sidebar">
|
133 |
+
<div class="ai1wm-segment">
|
134 |
+
<div class="ai1wm-divider"><?php _e( 'Help' ); ?> <i class="ai1wm-icon-help"></i></div>
|
135 |
+
|
136 |
+
<p>
|
137 |
+
<?php _e( 'You can easily export database, media, themes and plugins by single click.' ); ?><br />
|
138 |
+
<?php _e( 'For more advanced usage the plugin provides highly customizable interface where you can select what type of data to be exported and what options to be applied.' ); ?>
|
139 |
+
</p>
|
140 |
+
|
141 |
+
<p><?php _e( 'Quick steps' ); ?></p>
|
142 |
+
<ol>
|
143 |
+
<li><?php _e( 'Change Website URL parameter and any other related to your work.' ); ?></li>
|
144 |
+
<li><?php _e( 'Select desired export options and advanced settings.' ); ?></li>
|
145 |
+
<li><?php _e( 'Press "Export Package" button and the archive file will pop up in the browser.' ); ?></li>
|
146 |
+
<li><?php _e( 'Now the file is ready and you can import it in your WordPress environments.' ); ?></li>
|
147 |
+
</ol>
|
148 |
+
|
149 |
+
<p>
|
150 |
+
<?php _e( 'For any comments or suggestions please use the feedback form below.' ); ?><br />
|
151 |
+
<?php _e( 'Thanks for using our product.' ); ?>
|
152 |
+
</p>
|
153 |
+
|
154 |
+
<div class="ai1wm-divider"><?php _e( 'Feedback' ); ?></div>
|
155 |
+
|
156 |
+
<div id="ai1wm-feedback">
|
157 |
+
<div class="ai1wm-field">
|
158 |
+
<input placeholder="<?php _e( 'Enter your email address..' ); ?>" type="text" id="ai1wm-feedback-email" class="ai1wm-feedback-email" name="" value="<?php echo esc_attr( get_option( 'admin_email' ) ); ?>" />
|
159 |
+
</div>
|
160 |
+
<div class="ai1wm-field">
|
161 |
+
<textarea rows="3" id="ai1wm-feedback-message" class="ai1wm-feedback-message" placeholder="<?php _e( 'Leave plugin developers any feedback here..' ); ?>"></textarea>
|
162 |
+
</div>
|
163 |
+
<div class="ai1wm-field ai1wm-feedback-terms-segment">
|
164 |
+
<input type="checkbox" class="ai1wm-feedback-terms" id="ai1wm-feedback-terms" />
|
165 |
+
<label for="ai1wm-feedback-terms"><?php _e( 'I agree that by clicking the send button below my email address and comments will be send to a ServMask server.' ); ?></label>
|
166 |
+
</div>
|
167 |
+
<div class="ai1wm-field">
|
168 |
+
<div class="ai1wm-buttons">
|
169 |
+
<button type="submit" id="ai1wm-feedback-submit" class="ai1wm-button-blue">
|
170 |
+
<i class="ai1wm-icon-paperplane"></i>
|
171 |
+
<?php _e( 'SEND' ); ?>
|
172 |
+
</button>
|
173 |
+
</div>
|
174 |
+
</div>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
</div>
|
179 |
+
</div>
|
180 |
+
</div>
|
lib/view/import/index.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
?>
|
19 |
+
<div class="ai1wm-container">
|
20 |
+
<div class="ai1wm-row">
|
21 |
+
<div class="ai1wm-left">
|
22 |
+
<div class="ai1wm-holder">
|
23 |
+
<h1><?php _e( 'Import Site Data' ); ?></h1>
|
24 |
+
|
25 |
+
<p>
|
26 |
+
<?php _e( 'Use the box below to upload the archive file.' ); ?><br />
|
27 |
+
<?php _e( 'When the file is uploaded successfully it will be autimatically restored on the current WordPress instanace.' ); ?>
|
28 |
+
</p>
|
29 |
+
|
30 |
+
<div class="ai1wm-upload-file-message ai1wm-message"></div>
|
31 |
+
|
32 |
+
<form action="" method="post" enctype="multipart/form-data">
|
33 |
+
<div id="ai1wm-plupload-upload-ui" class="hide-if-no-js">
|
34 |
+
<div class="ai1wm-drag-drop-area" id="ai1wm-drag-drop-area">
|
35 |
+
<div class="ai1wm-drag-drop-inside">
|
36 |
+
<p class="ai1wm-upload-progress"></p>
|
37 |
+
<p class="ai1wm-drag-drop-info"><?php _e( 'Drop file here' ); ?></p>
|
38 |
+
<p><?php _e( 'or' ); ?></p>
|
39 |
+
<p class="ai1wm-drag-drop-buttons">
|
40 |
+
<button id="ai1wm-browse-button" class="button">
|
41 |
+
<i class="ai1wm-icon-file"></i> <?php _e( 'Select File' ); ?>
|
42 |
+
</button>
|
43 |
+
</p>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<p class="max-upload-size">
|
49 |
+
<?php _e( 'Maximum upload file size:' ); ?>
|
50 |
+
<strong><?php _e( wp_max_upload_size() / 1024 / 1024 ); ?> <?php _e( 'MB' ); ?></strong>
|
51 |
+
</p>
|
52 |
+
</form>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
<div class="ai1wm-right">
|
56 |
+
<div class="ai1wm-sidebar">
|
57 |
+
<div class="ai1wm-segment">
|
58 |
+
<div class="ai1wm-divider"><?php _e( 'Feedback' ); ?></div>
|
59 |
+
|
60 |
+
<div id="ai1wm-feedback">
|
61 |
+
<div class="ai1wm-field">
|
62 |
+
<input placeholder="<?php _e( 'Enter your email address..' ); ?>" type="text" id="ai1wm-feedback-email" class="ai1wm-feedback-email" name="" value="<?php echo esc_attr( get_option( 'admin_email' ) ); ?>" />
|
63 |
+
</div>
|
64 |
+
<div class="ai1wm-field">
|
65 |
+
<textarea rows="3" id="ai1wm-feedback-message" class="ai1wm-feedback-message" placeholder="<?php _e( 'Leave plugin developers any feedback here..' ); ?>"></textarea>
|
66 |
+
</div>
|
67 |
+
<div class="ai1wm-field ai1wm-feedback-terms-segment">
|
68 |
+
<input type="checkbox" class="ai1wm-feedback-terms" id="ai1wm-feedback-terms" />
|
69 |
+
<label for="ai1wm-feedback-terms"><?php _e( 'I agree that by clicking the send button below my email address and comments will be send to a ServMask server.' ); ?></label>
|
70 |
+
</div>
|
71 |
+
<div class="ai1wm-field">
|
72 |
+
<div class="ai1wm-buttons">
|
73 |
+
<button type="submit" id="ai1wm-feedback-submit" class="ai1wm-button-blue">
|
74 |
+
<i class="ai1wm-icon-paperplane"></i>
|
75 |
+
<?php _e( 'SEND' ); ?>
|
76 |
+
</button>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
</div>
|
loader.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
// include all the files that you want to load in here
|
20 |
+
require_once(
|
21 |
+
AI1WM_VENDOR_PATH .
|
22 |
+
DIRECTORY_SEPARATOR .
|
23 |
+
'mysqldump-php' .
|
24 |
+
DIRECTORY_SEPARATOR .
|
25 |
+
'mysqldump.php'
|
26 |
+
);
|
27 |
+
require_once(
|
28 |
+
AI1WM_VENDOR_PATH .
|
29 |
+
DIRECTORY_SEPARATOR .
|
30 |
+
'bandar' .
|
31 |
+
DIRECTORY_SEPARATOR .
|
32 |
+
'bandar' .
|
33 |
+
DIRECTORY_SEPARATOR .
|
34 |
+
'lib' .
|
35 |
+
DIRECTORY_SEPARATOR .
|
36 |
+
'Bandar.php'
|
37 |
+
);
|
38 |
+
require_once(
|
39 |
+
AI1WM_VENDOR_PATH .
|
40 |
+
DIRECTORY_SEPARATOR .
|
41 |
+
'zipper' .
|
42 |
+
DIRECTORY_SEPARATOR .
|
43 |
+
'zipper.lib.php'
|
44 |
+
);
|
45 |
+
require_once(
|
46 |
+
AI1WM_CONTROLLER_PATH .
|
47 |
+
DIRECTORY_SEPARATOR .
|
48 |
+
'class-ai1wm-main-controller.php'
|
49 |
+
);
|
50 |
+
require_once(
|
51 |
+
AI1WM_CONTROLLER_PATH .
|
52 |
+
DIRECTORY_SEPARATOR .
|
53 |
+
'class-ai1wm-import-controller.php'
|
54 |
+
);
|
55 |
+
require_once(
|
56 |
+
AI1WM_CONTROLLER_PATH .
|
57 |
+
DIRECTORY_SEPARATOR .
|
58 |
+
'class-ai1wm-export-controller.php'
|
59 |
+
);
|
60 |
+
require_once(
|
61 |
+
AI1WM_MODEL_PATH .
|
62 |
+
DIRECTORY_SEPARATOR .
|
63 |
+
'class-ai1wm-template.php'
|
64 |
+
);
|
65 |
+
require_once(
|
66 |
+
AI1WM_MODEL_PATH .
|
67 |
+
DIRECTORY_SEPARATOR .
|
68 |
+
'class-ai1wm-export.php'
|
69 |
+
);
|
70 |
+
require_once(
|
71 |
+
AI1WM_MODEL_PATH .
|
72 |
+
DIRECTORY_SEPARATOR .
|
73 |
+
'class-ai1wm-import.php'
|
74 |
+
);
|
readme.txt
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== All-in-One WP Migration ===
|
2 |
+
Contributors: yani.iliev, bangelov, mirkov
|
3 |
+
Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
|
4 |
+
Requires at least: 3.3
|
5 |
+
Tested up to: 3.8
|
6 |
+
Stable tag: 1.0.0
|
7 |
+
License: GPLv2 or later
|
8 |
+
|
9 |
+
All-in-One WP Migration is the only tools that you will ever needs when you need to perform site migration of your WordPress blog.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
The plugin allows you to export your database, media files, plugins, and themes.
|
14 |
+
You can apply unlimited find and replace operations on your database and the plugin will also fix any serialization problems that occur during find/replace operations.
|
15 |
+
|
16 |
+
All in One WP Plugin is the first plugin to offer true mobile experience on WordPress versions 3.3 and up.
|
17 |
+
|
18 |
+
== Installation ==
|
19 |
+
|
20 |
+
1. Upload the `all-in-one-wp-migration` folder to the `/wp-content/plugins/` directory
|
21 |
+
1. Activate the All in One WP Migration plugin through the 'Plugins' menu in WordPress
|
22 |
+
1. Configure the plugin by going to the `Site Migration` menu that appears in your admin menu
|
23 |
+
|
24 |
+
== Screenshots ==
|
25 |
+
|
26 |
+
1. Mobile Export page
|
27 |
+
2. Mobile Import page
|
28 |
+
3. Plugin Menu
|
29 |
+
|
30 |
+
== Changelog ==
|
31 |
+
|
32 |
+
= 1.0.0 =
|
33 |
+
|
34 |
+
* Export database as SQL file
|
35 |
+
* Export media files
|
36 |
+
* Export themes files
|
37 |
+
* Export installed plugins
|
38 |
+
* Unlimited Find & replaces
|
39 |
+
* Option to exclude spam comments
|
40 |
+
* Option to apply find & replace to GUIDs
|
41 |
+
* Option to exclude post revisions
|
42 |
+
* Option to exclude tables data
|
43 |
+
* WordPress multisite support
|
uninstall.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (C) 2013 ServMask LLC
|
4 |
+
*
|
5 |
+
* This program is free software: you can redistribute it and/or modify
|
6 |
+
* it under the terms of the GNU General Public License as published by
|
7 |
+
* the Free Software Foundation, either version 3 of the License, or
|
8 |
+
* (at your option) any later version.
|
9 |
+
*
|
10 |
+
* This program is distributed in the hope that it will be useful,
|
11 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
+
* GNU General Public License for more details.
|
14 |
+
*
|
15 |
+
* You should have received a copy of the GNU General Public License
|
16 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Trigger Uninstall process only if WP_UNINSTALL_PLUGIN is defined
|
21 |
+
*/
|
22 |
+
if ( defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
23 |
+
global $wpdb, $wp_filesystem;
|
24 |
+
// delete any options or other data stored in the database here
|
25 |
+
|
26 |
+
// delete any files not located inside plugin's folder (if any)
|
27 |
+
}
|