@ -1,642 +0,0 @@ |
||||
[Feb 24 12:32:44] |
||||
[Feb 24 12:32:44] [PHP ERR][ISSUE] MSG:Creation of dynamic property DUPX_Bootstrap::$extractionTmpFolder is deprecated [CODE:8192|FILE:/var/www/u2062703/data/www/blog.cosmopet.shop/installer.php|LINE:99] |
||||
[Feb 24 12:32:44] ==DUPLICATOR INSTALLER BOOTSTRAP v1.5.6== |
||||
[Feb 24 12:32:44] ---------------------------------------------------- |
||||
[Feb 24 12:32:44] Installer bootstrap start |
||||
[Feb 24 12:32:44] Ready to extract the installer |
||||
[Feb 24 12:32:44] Checking permission of destination folder |
||||
[Feb 24 12:32:44] ZipArchive exists so using that |
||||
[Feb 24 12:32:44] Successfully opened archive file. |
||||
[Feb 24 12:32:44] Extracting all files from archive within dup-installer |
||||
[Feb 24 12:32:44] Success: dup-installer/dup-database__[HASH].sql >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/addons/.htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/addons/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/css/all.min.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/css/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/webfonts/fa-brands-400.woff >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/webfonts/fa-brands-400.woff2 >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/webfonts/fa-regular-400.woff >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/webfonts/fa-regular-400.woff2 >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/webfonts/fa-solid-900.woff >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/webfonts/fa-solid-900.woff2 >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/font-awesome/webfonts/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/fonts/dots/dots-font.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/fonts/dots/dotsfont.eot >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/fonts/dots/dotsfont.svg >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/fonts/dots/dotsfont.ttf >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/fonts/dots/dotsfont.woff >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/fonts/dots/dotsfont.woff2 >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/exclamation-triangle-orange.svg >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-bg_glass_55_fbf9ee_1x400.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-bg_glass_65_ffffff_1x400.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-bg_glass_75_dadada_1x400.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-bg_glass_75_e6e6e6_1x400.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-bg_glass_95_fef1ec_1x400.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-icons_222222_256x240.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-icons_2e83ff_256x240.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-icons_454545_256x240.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-icons_888888_256x240.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/images/ui-icons_cd0a0a_256x240.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/inc.css.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/inc.css.validation.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/inc.js.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/inc.libs.css.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/inc.libs.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/password-strength/LICENSE.md >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/password-strength/password.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/password-strength/password.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/password-strength/passwordstrength.jpg >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/password-strength/README.md >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/maintenance.html >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/normalize.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/wp-config-sample.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/.htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/chunk/class.chunk.s3.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/chunk/class.chunkingmanager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/chunk/class.chunkingmanager_file.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/chunk/Iterators/class.s3.iterator.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/chunk/Iterators/Interfaces/EventIterator.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/chunk/Iterators/Interfaces/GenericSeekableIterator.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.crypt.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.csrf.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.engine.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.http.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.installer.state.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.package.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.password.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/class.server.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/config/class.archive.config.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/config/class.conf.srv.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/config/class.conf.utils.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/config/class.conf.wp.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/config/class.constants.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/config/class.security.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/config/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/database/class.db.functions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/database/class.db.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/database/class.db.table.item.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/database/class.db.tables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.custom.host.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.flywheel.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.godaddy.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.liquidweb.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.pantheon.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.siteground.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.wordpresscom.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/class.wpengine.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/host/interface.host.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/plugins/class.plugin.custom.actions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/plugins/class.plugin.item.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/plugins/class.plugins.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/rest/class.rest.auth.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/rest/class.rest.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/class.u.exceptions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/class.u.notices.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/class.u.orig.files.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/class.u.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/class.u.remove.redundant.data.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/class.u.search.reaplce.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/template/class.u.template.item.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/utilities/template/class.u.template.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/class.validation.abstract.item.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/class.validation.database.service.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/class.validation.manager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.affected.tables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.case.sentivie.tables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.cleanup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.connection.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.create.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.gtid.mode.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.host.name.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.manual.tables.count.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.multiple.wp.installs.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.prefix.too.long.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.show.variables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.supported.charset.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.supported.default.charset.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.supported.engine.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.triggers.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.user.perms.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.user.resources.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.version.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/database-tests/class.validation.test.db.visibility.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.addon.sites.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.archive.check.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.dbonly.iswordpress.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.disk.space.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.importable.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.importer.version.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.iswritable.configs.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.iswritable.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.managed.supported.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.managed.tprefix.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.manual.extraction.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.memory.limit.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.mysql.connect.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.open.basedir.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.owrinstall.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.package.age.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.package.size.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.php.extensions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.php.version.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.recovery.link.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.replace.paths.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.rest.api.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.siteground.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.timeout.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.tokenizer.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/validation/tests/class.validation.test.wordfence.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/view-helpers/class.u.html.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/classes/view-helpers/class.view.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/.htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/classes/class.ctrl.ajax.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/classes/class.ctrl.dbinstall.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/classes/class.ctrl.extraction.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/classes/class.ctrl.params.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/classes/class.ctrl.s0.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/classes/class.ctrl.s3.funcs.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/classes/class.ctrl.s4.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/ctrl.base.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/ctrls/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/browserconfig.xml >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_android-chrome-192x192.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_android-chrome-256x256.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_apple-touch-icon.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_favicon-16x16.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_favicon-32x32.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_favicon.ico >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_mstile-150x150.png >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/pro01_safari-pinned-tab.svg >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/favicon/site.webmanifest >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/main.installer.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/.htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Addons/InstAbstractAddonCore.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Addons/InstAddonsManager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Bootstrap.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/Database/DbCleanup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/Database/DbReplace.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/Database/DbUserMode.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/Database/QueryFixes.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/DupArchive/Daws.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/DupArchive/DawsExpandState.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/DupArchive/DawsLogger.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/Files/FilterMng.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/Files/Filters.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Deploy/Files/RemoveFiles.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Hooks/Hook.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Hooks/HooksMng.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/DescriptorInterface.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescConfigs.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescController.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescDatabase.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescEngines.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescGeneric.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescNewAdmin.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescPlugins.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescReplace.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescSecurity.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescUrlsPaths.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescUsers.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescValidation.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamDescWpConfig.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Descriptors/ParamsDescriptors.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamForm.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamFormPass.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamFormPlugins.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamFormTables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamFormUsersReset.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamFormWpConfig.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamItem.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/Items/ParamOption.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Core/Params/PrmMng.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Models/ImportUser.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Models/ScanInfo.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Autoloader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/InstallerUpsell.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Log/Log.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Log/LogHandler.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Tests/MessageCustomizer.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Tests/MessageCustomizerItem.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Tests/TestInterface.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Tests/WP/TestsErrorHandler.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Tests/WP/TestsExecuter.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/src/Utils/Tests/WP/tests_template.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/.htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/base/pages-parts/step1/actions/switch-template.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/base/pages-parts/step1/continue-block.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/base/pages-parts/step1/options.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/base/pages-parts/step1/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/base/pages-parts/step4/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/base/scripts/step1-deploy.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-boot-error.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-exception.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-help.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-secure.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-security-error.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-step1.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-step2.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-step3.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/page-step4.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/body/body-tag.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/boot-error/header.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/exception/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/head/css-scripts.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/head/css-template-custom.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/head/header-main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/head/meta.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/head/server-details.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/addtional-help.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/security.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/step-1.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/step-2.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/step-3.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/step-4.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/step1-parts/advanced-step1-options.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/step1-parts/basic-step1-setup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/step1-parts/validation-step1.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/help/steps/troubleshoot.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/page-footer.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/page-header.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/secure/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/actions/error.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/actions/hwarn-accept.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/actions/next.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/actions/switch-template.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/actions/validate.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/actions-part.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/base-setup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/continue-block.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/database-tabs/basic-db-connection.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/database-tabs/cpanel-panel.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/database-tabs/db-options.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/info-tabs/archive.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/info-tabs/general.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/info-tabs/overview-description.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/info-tabs/overviews/restore-backup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/info-tabs/overviews/type-single-site.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/info.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/options-tabs/advanced.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/options-tabs/engine-settings.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/options-tabs/other-urls-path.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/options-tabs/settings.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/options.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/proceed-confirm-dialog.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step1/terms-and-conditions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step2/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step2/options-tabs/general.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step2/options-tabs/tables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step2/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/options-tabs/plugins.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/options-tabs/search-rules.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/options-tabs/users.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/options-tabs/wp-config.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/options.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/usersParts/newAdminUser.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step3/usersParts/usersPwdReset.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step4/actions/admin-login-button.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step4/final-review-actions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step4/full-report.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step4/important-final-notice.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step4/installer-result-summary.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step4/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/pages-parts/step4/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/ajax-error.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/education/did-you-know-blurb.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/education/footer-cta.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/params/archive-action-notes.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/params/db-name-notes.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/params/extract-skip-notes.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/params/inline_helps/subsite_user_mode.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/params/inline_helps/user_mode.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/progress-bar.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/reports/import_report.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/restore-backup-mode-notice.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/top-header-help.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/top-header.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/top-messages.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-affected-tables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-case-sensitive-duplicates.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-case-sensitive-tables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-cleanup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-connection.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-create.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-gtid-mode.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-host-name.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-manual-tables-count.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-multiple-wp-installs.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-prefix-too-long.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-show-variables.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-supported-charset.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-supported-default-charset.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-supported-engine.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-triggers.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-user-cleanup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-user-perms.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-user-resources.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-version-swarn.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-version.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/database-tests/db-visibility.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/addon-sites.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/archive-check.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/configs-is-writable.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/dbonly-iswordpress.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/diskspace.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/importable-package.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/importer-version.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/managed-supported.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/managed-tprefix.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/manual-extraction.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/memory-limit.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/mysql-connect.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/open-basedir.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/overwrite-install.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/package-age.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/package-size.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/php-extensions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/php-version.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/recovery.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/replace-paths.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/rest-api.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/siteground.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/timeout.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/tokenizer.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/wordfence/wordfence-detected.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/wordfence/wordfence-not-detected.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/tests/writeable-checks.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/validate-area.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/validate-noresult.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/validation-category.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/validation-result.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/parts/validation/validation-test.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/dupx-functions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/ajax-functions.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/confirm-dialog.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/db-charset.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/db-install.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/db-test.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/extraction-module.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/final-tests.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/new-admin-user.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/package-deploy.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/page-components.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/params-module.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/progress-bar.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/site-replace-and-update.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/system-validation-module.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/modules/top-page-messages.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/secure-init.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/step1-deploy.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/step1-init.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/step2-init.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/step3-init.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/default/scripts/step4-init.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/body/body-tag.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/head/css-template-custom.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step1/actions/next.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step1/actions/switch-template.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step1/info-tabs/restore-backup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step1/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step2/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step3/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step4/actions/recovery-point-button.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step4/main.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/pages-parts/step4/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/parts/top-header.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-advanced/parts/validation/tests/wordfence/wordfence-detected.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/pages-parts/step1/actions/switch-template.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/pages-parts/step1/base-setup.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/pages-parts/step1/options.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/pages-parts/step1/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/pages-parts/step4/step-title.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/parts/top-header.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/parts/validation/tests/wordfence/wordfence-detected.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/templates/import-base/scripts/step1-deploy.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/.htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/css/select2.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/css/select2.min.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/af.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ar.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/az.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/bg.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/bn.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/bs.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ca.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/cs.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/da.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/de.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/dsb.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/el.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/en.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/es.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/et.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/eu.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/fa.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/fi.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/fr.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/gl.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/he.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/hi.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/hr.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/hsb.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/hu.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/hy.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/id.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/is.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/it.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ja.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ka.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/km.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ko.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/lt.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/lv.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/mk.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ms.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/nb.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ne.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/nl.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/pl.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ps.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/pt-BR.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/pt.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ro.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/ru.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/sk.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/sl.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/sq.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/sr-Cyrl.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/sr.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/sv.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/th.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/tk.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/tr.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/uk.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/vi.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/zh-CN.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/i18n/zh-TW.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/select2.full.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/select2.full.min.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/select2.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/select2/js/select2.min.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/FunctionalityCheck.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/JsonSerializable.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/JsonSerialize/AbstractJsonSerializable.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/JsonSerialize/AbstractJsonSerializeObjData.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/JsonSerialize/JsonSerialize.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/Snap32BitSizeLimitException.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapCode.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapDB.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapIO.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapJson.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapLog.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapOrigFileManager.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapOS.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapString.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapURL.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapUtil.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/SnapWP.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Snap/wordpress_core_files.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/DupArchive.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/DupArchiveEngine.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/DupArchiveExpandBasicEngine.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/DupArchiveLoggerBase.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveDirectoryHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveFileHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveGlobHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveHeaderU.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveReaderDirectoryHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveReaderFileHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveReaderGlobHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Headers/DupArchiveReaderHeader.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Info/DupArchiveExpanderInfo.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Info/DupArchiveInfo.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Processors/DupArchiveDirectoryProcessor.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Processors/DupArchiveFileProcessor.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Processors/DupArchiveProcessingFailure.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/States/DupArchiveCreateState.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/States/DupArchiveExpandState.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/States/DupArchiveSimpleCreateState.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/States/DupArchiveSimpleExpandState.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/States/DupArchiveStateBase.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Utils/DupArchiveScanUtil.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/DupArchive/Utils/DupArchiveUtil.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/WpConfig/WPConfigTransformer.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/WpConfig/WPConfigTransformerSrc.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/libs/Certificates/cacert.pem >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Auth/Basic.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Auth.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Cookie/Jar.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Cookie.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/304.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/305.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/306.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/400.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/401.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/402.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/403.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/404.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/405.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/406.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/407.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/408.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/409.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/410.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/411.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/412.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/413.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/414.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/415.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/416.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/417.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/418.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/428.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/429.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/431.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/500.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/501.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/502.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/503.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/504.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/505.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/511.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP/Unknown.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/HTTP.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/Transport/cURL.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception/Transport.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Exception.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Hooker.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Hooks.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/IDNAEncoder.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/IPv6.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/IRI.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Proxy/HTTP.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Proxy.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Response/Headers.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Response.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Session.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/SSL.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Transport/cacert.pem >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Transport/cURL.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Transport/fsockopen.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Transport.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Utility/CaseInsensitiveDictionary.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests/Utility/FilteredIterator.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/library/Requests.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/vendor/requests/LICENSE >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/duplicator-tooltip.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/popper/popper.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/popper/popper.min.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/tippy/dup-pro-tippy.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/tippy/index.php >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/tippy/tippy-bundle.umd.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/tippy/tippy-bundle.umd.min.js >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/assets/js/tippy/tippy.css >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/original_files_[HASH]/.htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/original_files_[HASH]/entries_stored.json >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/original_files_[HASH]/source_site_htaccess >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/original_files_[HASH]/source_site_wpconfig >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/dup-archive__[HASH].txt >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/dup-scan__[HASH].json >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/dup-scanned-files__[HASH].txt >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Success: dup-installer/dup-scanned-dirs__[HASH].txt >>> /var/www/u2062703/data/www/blog.cosmopet.shop |
||||
[Feb 24 12:32:44] Skipping manual extract file: dup-installer/dup-manual-extract__[HASH] |
||||
[Feb 24 12:32:44] Successfully closed archive file |
||||
[Feb 24 12:32:44] Successfully extracted with ZipArchive |
||||
[Feb 24 12:32:44] SAPI: CGI |
||||
[Feb 24 12:32:44] No need to create dup-installer/.htaccess or dup-installer/.user.ini |
||||
[Feb 24 12:32:44] [PHP ERR][ISSUE] MSG:Creation of dynamic property DUPX_Bootstrap::$archive is deprecated [CODE:8192|FILE:/var/www/u2062703/data/www/blog.cosmopet.shop/installer.php|LINE:529] |
||||
[Feb 24 12:32:44] [PHP ERR][ISSUE] MSG:Creation of dynamic property DUPX_Bootstrap::$bootloader is deprecated [CODE:8192|FILE:/var/www/u2062703/data/www/blog.cosmopet.shop/installer.php|LINE:530] |
||||
[Feb 24 12:32:44] Set permissions of dup-installer<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/addons<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/assets<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/classes<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/ctrls<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/favicon<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/libs<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/original_files_[HASH]<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/src<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/templates<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/vendor<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/dup-archive__[HASH].txt<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/dup-database__[HASH].sql<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/dup-scan__[HASH].json<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/dup-scanned-dirs__[HASH].txt<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/dup-scanned-files__[HASH].txt<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/index.php<br/> |
||||
[Feb 24 12:32:44] Set permissions of dup-installer/main.installer.php<br/> |
||||
[Feb 24 12:32:44] DONE: No detected errors so redirecting to the main installer. Main Installer URI = http://blog.cosmopet.shop/dup-installer/main.installer.php |
||||
[Feb 24 12:32:44] [PHP ERR][ISSUE] MSG:Creation of dynamic property DUPX_Bootstrap::$extractionTmpFolder is deprecated [CODE:8192|FILE:/var/www/u2062703/data/www/blog.cosmopet.shop/installer.php|LINE:99] |
@ -1,9 +0,0 @@ |
||||
<Files *.php> |
||||
Order Deny,Allow |
||||
Deny from all |
||||
</Files> |
||||
|
||||
<Files index.php> |
||||
Order Allow,Deny |
||||
Allow from all |
||||
</Files> |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
// silent |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
@ -1,8 +0,0 @@ |
||||
@font-face { |
||||
font-family: 'dotsfont'; |
||||
src: url('dotsfont.eot'); |
||||
src: url('dotsfont.eot?#iefix') format('embedded-opentype'), |
||||
url('dotsfont.woff') format('woff'), |
||||
url('dotsfont.ttf') format('truetype'), |
||||
url('dotsfont.svg#dotsfontregular') format('svg'); |
||||
} |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 808 B |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
Before Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 332 B |
Before Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
@ -1,136 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* validation css |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
?> |
||||
<style> |
||||
#validate-area .status-badge { |
||||
margin: 1px 2px 0 0; |
||||
line-height: 18px; |
||||
height: 18px; |
||||
} |
||||
|
||||
#validate-area.show-all .header .status-badge, |
||||
#validate-area.show-warnings .header .status-badge.warn, |
||||
#validate-area.show-warnings .header .status-badge.hwarn, |
||||
#validate-area.show-warnings .header .status-badge.fail { |
||||
display: none; |
||||
} |
||||
|
||||
#validate-area.show-warnings .test-wrapper.good, |
||||
#validate-area.show-warnings .test-wrapper.pass { |
||||
display: none; |
||||
} |
||||
|
||||
#validation-result .category-wrapper { |
||||
background-color: #efefef; |
||||
border: 1px solid silver; |
||||
border-radius:2px; |
||||
margin-bottom: 10px; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
#validation-result .category-wrapper > .header { |
||||
background-color: #E0E0E0; |
||||
color: #000; |
||||
padding: 3px 3px 3px 5px; |
||||
font-weight: bold; |
||||
border-bottom: 1px solid silver; |
||||
} |
||||
|
||||
#validation-result .category-wrapper > .header .status-badge { |
||||
margin-top: 2px; |
||||
} |
||||
|
||||
#validation-result .category-title { |
||||
font-size: 14px; |
||||
} |
||||
|
||||
#validation-result .category-content { |
||||
background-color: #FFF; |
||||
} |
||||
|
||||
#validation-result .test-title { |
||||
background-color: #efefef; |
||||
padding: 3px 3px 3px 5px; |
||||
font-size: 13px; |
||||
line-height: 20px; |
||||
} |
||||
|
||||
#validation-result .test-title:hover { |
||||
background-color: #dfdfdf; |
||||
} |
||||
|
||||
#validation-result .test-content { |
||||
padding: 10px; |
||||
line-height: 18px; |
||||
font-size: 12px; |
||||
} |
||||
|
||||
#validation-result .dupx-validation-test-package-size.warn .test-content { |
||||
background-color: #fcf9e8; |
||||
} |
||||
|
||||
#validation-result .test-content pre { |
||||
overflow: auto; |
||||
} |
||||
|
||||
#validation-result .test-content *:first-child { |
||||
margin-top: 0; |
||||
} |
||||
|
||||
#validation-result .test-content *:last-child { |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
#validation-result .test-content .sub-title { |
||||
border-bottom: 1px solid #d3d3d3; |
||||
font-weight: bold; |
||||
margin: 7px 0 3px 0; |
||||
} |
||||
|
||||
#validation-result .test-content a { |
||||
color:#485AA3; |
||||
} |
||||
|
||||
#validation-result .test-content ul { |
||||
padding-left:25px |
||||
} |
||||
|
||||
#validation-result .test-content ul li { |
||||
padding:2px |
||||
} |
||||
|
||||
#validation-result .test-content ul.vids { |
||||
list-style-type: none; |
||||
} |
||||
|
||||
#validation-result .validation-iswritable-failes-objects { |
||||
padding: 10px 0 10px 10px; |
||||
background: #EDEDED; |
||||
} |
||||
|
||||
#validation-result .validation-iswritable-failes-objects pre { |
||||
min-height: 60px; |
||||
max-height: 400px; |
||||
max-width: 100%; |
||||
overflow: auto; |
||||
} |
||||
|
||||
#validation-result .test-content .desc-sol { |
||||
padding: 10px; |
||||
display: block; |
||||
background: #efefef; |
||||
margin-top: 10px; |
||||
border-radius: 5px; |
||||
} |
||||
</style> |
@ -1,502 +0,0 @@ |
||||
<?php |
||||
defined("DUPXABSPATH") or die(""); |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Installer\Utils\InstallerUpsell; |
||||
use Duplicator\Libs\Snap\SnapJson; |
||||
|
||||
$paramsManager = PrmMng::getInstance(); |
||||
?> |
||||
<script> |
||||
//Unique namespace |
||||
DUPX = new Object(); |
||||
DUPX.Util = new Object(); |
||||
DUPX.UI = new Object(); |
||||
DUPX.Const = new Object(); |
||||
DUPX.GLB_DEBUG = <?php echo $paramsManager->getValue(PrmMng::PARAM_DEBUG) ? 'true' : 'false'; ?>;
|
||||
DUPX.dupInstallerUrl = <?php echo SnapJson::jsonEncode(DUPX_INIT_URL . '/main.installer.php'); ?>;
|
||||
|
||||
DUPX.beforeUnloadListener = (event) => { |
||||
event.preventDefault(); |
||||
return event.returnValue = "Are you sure you want to exit?"; |
||||
}; |
||||
DUPX.beforeUnloadCheck = function (enable) { |
||||
if (enable) { |
||||
window.addEventListener("beforeunload", DUPX.beforeUnloadListener); |
||||
} else { |
||||
window.removeEventListener("beforeunload", DUPX.beforeUnloadListener); |
||||
} |
||||
}; |
||||
|
||||
DUPX.redirect = function (url, method, params) { |
||||
var form = $('<form>', { |
||||
method: method, |
||||
action: url |
||||
}); |
||||
|
||||
$.each(params, function (key, value) { |
||||
form.append($('<input>', { |
||||
'type': 'hidden', |
||||
'name': key, |
||||
'value': value |
||||
})); |
||||
}); |
||||
|
||||
$("body").append(form); |
||||
DUPX.beforeUnloadCheck(false); |
||||
form.submit(); |
||||
}; |
||||
|
||||
DUPX.parseJSON = function (mixData) { |
||||
// if mixData is already a object, Then don't parse it |
||||
if (typeof mixData === 'object' && mixData !== null) { |
||||
return mixData; |
||||
} |
||||
|
||||
try { |
||||
var parsed = JSON.parse(mixData); |
||||
return parsed; |
||||
} catch (e) { |
||||
console.log("JSON parse failed - 1"); |
||||
console.log(mixData); |
||||
} |
||||
|
||||
if (mixData.indexOf('[') > -1 && mixData.indexOf('{') > -1) { |
||||
if (mixData.indexOf('{') < mixData.indexOf('[')) { |
||||
var startBracket = '{'; |
||||
var endBracket = '}'; |
||||
} else { |
||||
var startBracket = '['; |
||||
var endBracket = ']'; |
||||
} |
||||
} else if (mixData.indexOf('[') > -1 && mixData.indexOf('{') === -1) { |
||||
var startBracket = '['; |
||||
var endBracket = ']'; |
||||
} else { |
||||
var startBracket = '{'; |
||||
var endBracket = '}'; |
||||
} |
||||
|
||||
var jsonStartPos = mixData.indexOf(startBracket); |
||||
var jsonLastPos = mixData.lastIndexOf(endBracket); |
||||
if (jsonStartPos > -1 && jsonLastPos > -1) { |
||||
var expectedJsonStr = mixData.slice(jsonStartPos, jsonLastPos + 1); |
||||
try { |
||||
var parsed = JSON.parse(expectedJsonStr); |
||||
return parsed; |
||||
} catch (e) { |
||||
console.log("JSON parse failed - 2"); |
||||
console.log(mixData); |
||||
throw e; |
||||
return false; |
||||
} |
||||
} |
||||
throw "could not parse the JSON"; |
||||
return false; |
||||
} |
||||
|
||||
DUPX.StandardJsonAjaxWrapper = function (action, token, ajaxData, callbackSuccess, callbackFail, options) { |
||||
var ajax_url = document.location.href; |
||||
var currentOptions = jQuery.extend({}, DUPX.standarJsonAjaxOptions, options); |
||||
|
||||
var ajaxData = $.extend({ |
||||
"ctrl_action": 'ajax', |
||||
"ajax_action": action, |
||||
"ajax_csrf_token": token |
||||
}, ajaxData); |
||||
|
||||
function retryOnFailure(result, textStatus, jqXHR) { |
||||
var retryOptions = Object.assign({}, options); |
||||
retryOptions.numberOfAttempts--; |
||||
|
||||
if (typeof currentOptions.callbackOnRetry === "function") { |
||||
currentOptions.callbackOnRetry(result, textStatus, jqXHR, retryOptions); |
||||
} |
||||
|
||||
if (currentOptions.delayRetryOnFailure > 0) { |
||||
setTimeout(function () { |
||||
DUPX.StandardJsonAjaxWrapper(action, token, ajaxData, callbackSuccess, callbackFail, retryOptions); |
||||
}, currentOptions.delayRetryOnFailure); |
||||
} else { |
||||
DUPX.StandardJsonAjaxWrapper(action, token, ajaxData, callbackSuccess, callbackFail, retryOptions); |
||||
} |
||||
} |
||||
|
||||
jQuery.ajax({ |
||||
type: "POST", |
||||
url: ajax_url, |
||||
dataType: "json", |
||||
timeout: currentOptions.timeOut, |
||||
data: ajaxData, |
||||
beforeSend: currentOptions.beforeSend, |
||||
success: function (result, textStatus, jqXHR) { |
||||
var message = ''; |
||||
if (result.success) { |
||||
if (typeof callbackSuccess === "function") { |
||||
callbackSuccess(result, textStatus, jqXHR); |
||||
} else { |
||||
alert('SUCCESS: ' + result.message); |
||||
} |
||||
} else { |
||||
if (currentOptions.retryOnFailure && currentOptions.numberOfAttempts > 0) { |
||||
retryOnFailure(result, textStatus, jqXHR); |
||||
} else { |
||||
if (typeof callbackFail === "function") { |
||||
callbackFail(result, textStatus, jqXHR); |
||||
} else { |
||||
alert('RESPONSE ERROR! ' + result.message); |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
error: function (jqXHR, textStatus, errorThrown) { |
||||
const result = { |
||||
'success': false, |
||||
'message': 'AJAX ERROR! STATUS:' + jqXHR.status + ' ' + jqXHR.statusText, |
||||
'errorContent': { |
||||
'pre': '', |
||||
'html': '' |
||||
}, |
||||
'actionData': null |
||||
}; |
||||
|
||||
if (currentOptions.retryOnFailure && currentOptions.numberOfAttempts > 0) { |
||||
retryOnFailure(result, textStatus, jqXHR); |
||||
return; |
||||
} |
||||
|
||||
if (jqXHR.status === 200) { |
||||
result.message = 'AJAX ERROR! STATUS: ' + textStatus; |
||||
result.errorContent.html = jqXHR.responseText; |
||||
} |
||||
|
||||
if (typeof callbackFail === "function") { |
||||
callbackFail(result, textStatus, jqXHR); |
||||
} else { |
||||
alert(result.message); |
||||
} |
||||
|
||||
} |
||||
}); |
||||
}; |
||||
|
||||
DUPX.standarJsonAjaxOptions = { |
||||
timeOut: 1800000, |
||||
beforeSend: null, |
||||
retryOnFailure: false, |
||||
numberOfAttempts: 3, |
||||
delayRetryOnFailure: 5000, |
||||
callbackOnRetry: null |
||||
}; |
||||
|
||||
DUPX.showProgressBar = function () |
||||
{ |
||||
DUPX.animateProgressBar('progress-bar'); |
||||
$('#ajaxerr-area').hide(); |
||||
$('#progress-area').show(); |
||||
}; |
||||
|
||||
DUPX.hideProgressBar = function () |
||||
{ |
||||
$('#progress-area').hide(100); |
||||
$('#ajaxerr-area').fadeIn(400); |
||||
}; |
||||
|
||||
DUPX.getFormDataObject = function (formObj) { |
||||
var formArray = $(formObj).serializeArray(); |
||||
var returnObj = {}; |
||||
for (var i = 0; i < formArray.length; i++) { |
||||
returnObj[formArray[i]['name']] = formArray[i]['value']; |
||||
} |
||||
return returnObj; |
||||
}; |
||||
|
||||
DUPX.animateProgressBar = function (id) { |
||||
//Create Progress Bar |
||||
var $mainbar = $("#" + id); |
||||
$mainbar.progressbar({value: 100}); |
||||
$mainbar.height(25); |
||||
runAnimation($mainbar); |
||||
|
||||
function runAnimation($pb) { |
||||
$pb.css({"padding-left": "0%", "padding-right": "90%"}); |
||||
$pb.progressbar("option", "value", 100); |
||||
$pb.animate({paddingLeft: "90%", paddingRight: "0%"}, 3500, "linear", function () { |
||||
runAnimation($pb); |
||||
}); |
||||
} |
||||
}; |
||||
|
||||
DUPX.stringifyNumber = function (n) { |
||||
const special = [ |
||||
'zeroth', 'first', 'second', 'third', 'fourth', 'fifth', 'sixth', |
||||
'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelvth', 'thirteenth', 'fourteenth', |
||||
'fifteenth', 'sixteenth', 'seventeenth', 'eighteenth', 'nineteenth' |
||||
]; |
||||
const deca = ['twent', 'thirt', 'fourt', 'fift', 'sixt', 'sevent', 'eight', 'ninet']; |
||||
if (n < 20) { |
||||
return special[n]; |
||||
} |
||||
if (n % 10 === 0) { |
||||
return deca[Math.floor(n / 10) - 2] + 'ieth'; |
||||
} |
||||
return deca[Math.floor(n / 10) - 2] + 'y-' + special[n % 10]; |
||||
}; |
||||
|
||||
/** |
||||
* Returns the windows active url */ |
||||
DUPX.getNewURL = function (id) |
||||
{ |
||||
var filename = window.location.pathname.split('/').pop() || 'main.installer.php'; |
||||
var newVal = window.location.href.split("?")[0]; |
||||
newVal = newVal.replace("/" + filename, ''); |
||||
var last_slash = newVal.lastIndexOf("/"); |
||||
newVal = newVal.substring(0, last_slash); |
||||
$("#" + id).val(newVal).keyup(); |
||||
}; |
||||
|
||||
DUPX.getNewUrlByDomObj = function (button) { |
||||
var inputId = $(button).parent().find('input').attr('id'); |
||||
DUPX.getNewURL(inputId); |
||||
}; |
||||
|
||||
DUPX.submitEmail = function (button) { |
||||
var button = $(button); |
||||
var wrapper = $('.subscribe-form'); |
||||
var input = $('.subscribe-form input'); |
||||
var inputDAta = input.serializeForm(); |
||||
|
||||
button.html('Subscribing...'); |
||||
input.attr('disabled', 'disabled'); |
||||
|
||||
DUPX.StandardJsonAjaxWrapper( |
||||
<?php echo SnapJson::jsonEncode(DUPX_Ctrl_ajax::ACTION_EMAIL_SUBSCRIPTION); ?>,
|
||||
<?php echo SnapJson::jsonEncode(DUPX_Ctrl_ajax::generateToken(DUPX_Ctrl_ajax::ACTION_EMAIL_SUBSCRIPTION)); ?>,
|
||||
inputDAta, |
||||
function (data) { |
||||
wrapper.fadeOut(300); |
||||
button.html('Subscribed ✓'); |
||||
wrapper.fadeIn(300); |
||||
|
||||
setTimeout(function () { |
||||
wrapper.fadeOut(300); |
||||
}, 3000); |
||||
}, |
||||
function (data) { |
||||
console.log("Email subscription failed with message: " + data.message); |
||||
button.html('Failed ✗'); |
||||
|
||||
setTimeout(function () { |
||||
button.html('Subscribe'); |
||||
input.removeAttr('disabled'); |
||||
}, 3000); |
||||
}, |
||||
); |
||||
}; |
||||
|
||||
DUPX.editActivate = function (button, msg) |
||||
{ |
||||
var buttonObj = $(button); |
||||
var inputObj = buttonObj.parent().find('input'); |
||||
|
||||
if (confirm(msg)) { |
||||
inputObj.removeAttr('readonly').removeClass('readonly'); |
||||
buttonObj.hide(); |
||||
} |
||||
}; |
||||
|
||||
DUPX.autoUpdateToggle = function (button, msg) |
||||
{ |
||||
var buttonObj = $(button); |
||||
var wrapperObj = $(button).closest('.param-wrapper'); |
||||
var inputObj = buttonObj.parent().find('input'); |
||||
var fromInputObj = $('#' + wrapperObj.data('auto-update-from-input')); |
||||
|
||||
if (wrapperObj.hasClass('autoupdate-enabled')) { |
||||
if (confirm(msg)) { |
||||
wrapperObj.removeClass('autoupdate-enabled').addClass('autoupdate-disabled'); |
||||
buttonObj.text('Manual'); |
||||
inputObj.prop('readonly', false); |
||||
} |
||||
} else { |
||||
wrapperObj.removeClass('autoupdate-disabled').addClass('autoupdate-enabled'); |
||||
buttonObj.text('Auto'); |
||||
inputObj.prop('readonly', true); |
||||
fromInputObj.trigger("change"); |
||||
} |
||||
/* |
||||
if (confirm(msg)) { |
||||
inputObj.removeAttr('readonly').removeClass('readonly'); |
||||
buttonObj.hide(); |
||||
}*/ |
||||
}; |
||||
|
||||
DUPX.toggleAll = function (id) { |
||||
$(id + " *[data-type='toggle']").each(function () { |
||||
$(this).trigger('click'); |
||||
}); |
||||
} |
||||
|
||||
DUPX.toggleClick = function () |
||||
{ |
||||
var button = $(this); |
||||
var src = 0; |
||||
var id = button.attr('data-target'); |
||||
var text = button.text().replace(/\+|\-/, ""); |
||||
var icon = button.find('i.fa'); |
||||
var target = $(id); |
||||
var list = new Array(); |
||||
|
||||
var style = [ |
||||
{open: "fa-minus-square", |
||||
close: "fa-plus-square" |
||||
}, |
||||
{open: "fa-caret-down", |
||||
close: "fa-caret-right" |
||||
}]; |
||||
|
||||
//Create src |
||||
for (i = 0; i < style.length; i++) { |
||||
if ($(icon).hasClass(style[i].open) || $(icon).hasClass(style[i].close)) { |
||||
src = i; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
//Build remove list |
||||
for (i = 0; i < style.length; i++) { |
||||
list.push(style[i].open); |
||||
list.push(style[i].close); |
||||
} |
||||
|
||||
$(icon).removeClass(list.join(" ")); |
||||
if (target.is(':hidden')) { |
||||
(icon.length) |
||||
? $(icon).addClass(style[src].open) |
||||
: button.html("- " + text); |
||||
button.removeClass('open').addClass('close'); |
||||
target.show().removeClass('no-display'); |
||||
} else { |
||||
(icon.length) |
||||
? $(icon).addClass(style[src].close) |
||||
: button.html("+ " + text); |
||||
button.removeClass('close').addClass('open'); |
||||
target.hide().addClass('no-display'); |
||||
} |
||||
} |
||||
|
||||
|
||||
DUPX.WpItemSwitchInit = function () { |
||||
$('.wpinconf-check-wrapper input').change(function () { |
||||
var paramWrapper = $(this).closest('.param-wrapper'); |
||||
if (this.checked) { |
||||
paramWrapper.find('.input-container').show().find('.input-item').prop('disabled', false); |
||||
} else { |
||||
paramWrapper.find('.input-container').hide().find('.input-item').prop('disabled', true); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
DUPX.Util.formatBytes = function (bytes, decimals) |
||||
{ |
||||
if (bytes == 0) |
||||
return '0 Bytes'; |
||||
var k = 1000; |
||||
var dm = decimals + 1 || 3; |
||||
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
||||
var i = Math.floor(Math.log(bytes) / Math.log(k)); |
||||
return (bytes / Math.pow(k, i)).toPrecision(dm) + ' ' + sizes[i]; |
||||
} |
||||
|
||||
DUPX.initJsSelect = function (selector) { |
||||
$(selector).select2({ |
||||
'width': '100%', |
||||
'dropdownAutoWidth': true, |
||||
'minimumResultsForSearch': 10 |
||||
}); |
||||
}; |
||||
|
||||
$(document).ready(function () |
||||
{ |
||||
DuplicatorTooltip.load(); |
||||
|
||||
DUPX.initJsSelect('select.js-select'); |
||||
|
||||
$('body').on( "click", ".copy-to-clipboard-block button", function(e) { |
||||
e.preventDefault(); |
||||
var button = $(this); |
||||
var buttonText = button.html(); |
||||
var textarea = button.parent().find("textarea")[0]; |
||||
|
||||
textarea.select(); |
||||
|
||||
try { |
||||
message = document.execCommand('copy') ? "Copied to Clipboard" : 'Unable to copy'; |
||||
} catch (err) { |
||||
console.log(err); |
||||
} |
||||
|
||||
button.html(message); |
||||
|
||||
setTimeout(function () { |
||||
button.text(buttonText); |
||||
}, 2000); |
||||
}); |
||||
|
||||
<?php if ($GLOBALS['DUPX_DEBUG']) : ?> |
||||
$("div.dupx-debug input[type=hidden], div.dupx-debug textarea").each(function () { |
||||
var label = '<label>' + $(this).attr('name') + ':</label>'; |
||||
$(this).before(label); |
||||
$(this).after('<br/>'); |
||||
}); |
||||
$("div.dupx-debug input[type=hidden]").each(function () { |
||||
$(this).attr('type', 'text'); |
||||
}); |
||||
|
||||
$("div.dupx-debug").prepend('<div class="dupx-debug-hdr">Debug View</div>'); |
||||
<?php endif; ?> |
||||
DUPX.WpItemSwitchInit(); |
||||
}); |
||||
</script> |
||||
|
||||
<script> |
||||
/** |
||||
* Fatal error messages shown at top of installer. |
||||
* Used to control the [show more] and [show all] links |
||||
*/ |
||||
$(document).ready(function () |
||||
{ |
||||
function moreCheck(moreCont, moreWrap) { |
||||
if (moreWrap.height() > moreCont.height()) { |
||||
moreCont.addClass('more'); |
||||
} else { |
||||
moreCont.removeClass('more'); |
||||
} |
||||
} |
||||
|
||||
$('.more-content').each(function () { |
||||
var moreCont = $(this); |
||||
var step = moreCont.data('more-step'); |
||||
var moreWrap = $(this).find('.more-wrapper'); |
||||
|
||||
moreCont.find('.more-button').click(function () { |
||||
moreCont.css('max-height', "+=" + step + "px"); |
||||
moreCheck(moreCont, moreWrap); |
||||
}); |
||||
|
||||
moreCont.find('.all-button').click(function () { |
||||
moreCont.css('max-height', "none"); |
||||
moreCheck(moreCont, moreWrap); |
||||
}); |
||||
|
||||
moreCheck(moreCont, moreWrap); |
||||
}); |
||||
|
||||
$('sup.hlp-pro-lbl, sup.small-pro-lbl').click(function() { |
||||
window.open('<?php echo InstallerUpsell::getCampaignUrl('installer', 'Help Section Pro Flag');?>');
|
||||
}); |
||||
}); |
||||
</script> |
||||
|
||||
<?php |
||||
DUPX_U_Html::js(); |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
@ -1,122 +0,0 @@ |
||||
/*! dup tooltip */ |
||||
(function ($) { |
||||
DuplicatorTooltip = { |
||||
initialized: false, |
||||
messages: { |
||||
'copy': 'Copy to clipboard', |
||||
'copied': 'copied to clipboard', |
||||
'copyUnable': 'Unable to copy' |
||||
}, |
||||
load: function () { |
||||
if (this.initialized) { |
||||
return; |
||||
} |
||||
|
||||
this.loadSelector('[data-tooltip]'); |
||||
this.loadCopySelector('[data-dup-copy-value]'); |
||||
|
||||
this.initialized = true; |
||||
}, |
||||
loadSelector: function (selector) { |
||||
$(selector).each(function () { |
||||
if (this._tippy) { |
||||
// already init
|
||||
return; |
||||
} |
||||
|
||||
tippy(this, { |
||||
content: function (ref) { |
||||
var header = ref.dataset.tooltipTitle; |
||||
var body = ref.dataset.tooltip; |
||||
var res = header !== undefined ? '<h3>' + header + '</h3>' : ''; |
||||
res += '<div class="dup-tippy-content">' + body + '</div>'; |
||||
return res; |
||||
}, |
||||
allowHTML: true, |
||||
interactive: true, |
||||
placement: this.dataset.tooltipPlacement ? this.dataset.tooltipPlacement : 'bottom-start', |
||||
theme: 'duplicator', |
||||
zIndex: 900000, |
||||
appendTo: document.body |
||||
}); |
||||
$(this).data('dup-tooltip-loaded', true); |
||||
}); |
||||
}, |
||||
loadCopySelector: function (selector) { |
||||
$(selector).each(function () { |
||||
if (this._tippy) { |
||||
// already init
|
||||
return; |
||||
} |
||||
|
||||
var element = $(this); |
||||
if (element.hasClass('disabled')) { |
||||
return; |
||||
} |
||||
|
||||
var tippyElement = tippy(this, { |
||||
allowHTML: true, |
||||
placement: this.dataset.tooltipPlacement ? this.dataset.tooltipPlacement : 'bottom-start', |
||||
theme: 'duplicator', |
||||
zIndex: 900000, |
||||
hideOnClick: false, |
||||
trigger: 'manual' |
||||
}); |
||||
|
||||
var copyTitle = element.is('[data-dup-copy-title]') ? element.data('dup-copy-title') : DuplicatorTooltip.messages.copy; |
||||
tippyElement.setContent('<div class="dup-tippy-content">' + copyTitle + '</div>'); |
||||
|
||||
//Have to set manually otherwise might hide on click.
|
||||
element.mouseover(function () { |
||||
tippyElement.show(); |
||||
}).mouseout(function () { |
||||
tippyElement.hide(); |
||||
}); |
||||
|
||||
element.click(function () { |
||||
var valueToCopy = element.data('dup-copy-value'); |
||||
var copiedTitle = element.is('[data-dup-copied-title]') ? element.data('dup-copied-title') : valueToCopy + ' ' + DuplicatorTooltip.messages.copied; |
||||
var message = DuplicatorTooltip.messages.copyUnable; |
||||
var tmpArea = jQuery("<textarea></textarea>").css({ |
||||
position: 'absolute', |
||||
top: '-10000px' |
||||
}).text(valueToCopy).appendTo("body"); |
||||
tmpArea.select(); |
||||
|
||||
try { |
||||
message = document.execCommand('copy') ? copiedTitle : 'Unable to copy'; |
||||
} catch (err) { |
||||
console.log(err); |
||||
} |
||||
|
||||
tippyElement.setContent('<div class="dup-tippy-content">' + message + '</div>'); |
||||
tippyElement.setProps({ theme: 'duplicator-filled' }); |
||||
|
||||
setTimeout(function () { |
||||
tippyElement.setContent('<div class="dup-tippy-content">' + copyTitle + '</div>'); |
||||
tippyElement.setProps({ theme: 'duplicator' }); |
||||
}, 2000); |
||||
}); |
||||
}); |
||||
}, |
||||
updateElementContent: function (selector, content) { |
||||
if ($(selector).get(0)) { |
||||
$(selector).get(0)._tippy.setContent('<div class="dup-tippy-content">' + content + '</div>'); |
||||
} |
||||
}, |
||||
unload: function () { |
||||
var tooltips = document.querySelectorAll('[data-tooltip], [data-dup-copy-value]'); |
||||
tooltips.forEach(function (element) { |
||||
if (element._tippy) { |
||||
element._tippy.destroy(); |
||||
element._tippy = null; |
||||
} |
||||
}); |
||||
this.initialized = false; |
||||
}, |
||||
reload: function () { |
||||
this.unload(); |
||||
this.load(); |
||||
} |
||||
} |
||||
})(jQuery); |
@ -1,674 +0,0 @@ |
||||
GNU GENERAL PUBLIC LICENSE |
||||
Version 3, 29 June 2007 |
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
||||
Everyone is permitted to copy and distribute verbatim copies |
||||
of this license document, but changing it is not allowed. |
||||
|
||||
Preamble |
||||
|
||||
The GNU General Public License is a free, copyleft license for |
||||
software and other kinds of works. |
||||
|
||||
The licenses for most software and other practical works are designed |
||||
to take away your freedom to share and change the works. By contrast, |
||||
the GNU General Public License is intended to guarantee your freedom to |
||||
share and change all versions of a program--to make sure it remains free |
||||
software for all its users. We, the Free Software Foundation, use the |
||||
GNU General Public License for most of our software; it applies also to |
||||
any other work released this way by its authors. You can apply it to |
||||
your programs, too. |
||||
|
||||
When we speak of free software, we are referring to freedom, not |
||||
price. Our General Public Licenses are designed to make sure that you |
||||
have the freedom to distribute copies of free software (and charge for |
||||
them if you wish), that you receive source code or can get it if you |
||||
want it, that you can change the software or use pieces of it in new |
||||
free programs, and that you know you can do these things. |
||||
|
||||
To protect your rights, we need to prevent others from denying you |
||||
these rights or asking you to surrender the rights. Therefore, you have |
||||
certain responsibilities if you distribute copies of the software, or if |
||||
you modify it: responsibilities to respect the freedom of others. |
||||
|
||||
For example, if you distribute copies of such a program, whether |
||||
gratis or for a fee, you must pass on to the recipients the same |
||||
freedoms that you received. You must make sure that they, too, receive |
||||
or can get the source code. And you must show them these terms so they |
||||
know their rights. |
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps: |
||||
(1) assert copyright on the software, and (2) offer you this License |
||||
giving you legal permission to copy, distribute and/or modify it. |
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains |
||||
that there is no warranty for this free software. For both users' and |
||||
authors' sake, the GPL requires that modified versions be marked as |
||||
changed, so that their problems will not be attributed erroneously to |
||||
authors of previous versions. |
||||
|
||||
Some devices are designed to deny users access to install or run |
||||
modified versions of the software inside them, although the manufacturer |
||||
can do so. This is fundamentally incompatible with the aim of |
||||
protecting users' freedom to change the software. The systematic |
||||
pattern of such abuse occurs in the area of products for individuals to |
||||
use, which is precisely where it is most unacceptable. Therefore, we |
||||
have designed this version of the GPL to prohibit the practice for those |
||||
products. If such problems arise substantially in other domains, we |
||||
stand ready to extend this provision to those domains in future versions |
||||
of the GPL, as needed to protect the freedom of users. |
||||
|
||||
Finally, every program is threatened constantly by software patents. |
||||
States should not allow patents to restrict development and use of |
||||
software on general-purpose computers, but in those that do, we wish to |
||||
avoid the special danger that patents applied to a free program could |
||||
make it effectively proprietary. To prevent this, the GPL assures that |
||||
patents cannot be used to render the program non-free. |
||||
|
||||
The precise terms and conditions for copying, distribution and |
||||
modification follow. |
||||
|
||||
TERMS AND CONDITIONS |
||||
|
||||
0. Definitions. |
||||
|
||||
"This License" refers to version 3 of the GNU General Public License. |
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of |
||||
works, such as semiconductor masks. |
||||
|
||||
"The Program" refers to any copyrightable work licensed under this |
||||
License. Each licensee is addressed as "you". "Licensees" and |
||||
"recipients" may be individuals or organizations. |
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work |
||||
in a fashion requiring copyright permission, other than the making of an |
||||
exact copy. The resulting work is called a "modified version" of the |
||||
earlier work or a work "based on" the earlier work. |
||||
|
||||
A "covered work" means either the unmodified Program or a work based |
||||
on the Program. |
||||
|
||||
To "propagate" a work means to do anything with it that, without |
||||
permission, would make you directly or secondarily liable for |
||||
infringement under applicable copyright law, except executing it on a |
||||
computer or modifying a private copy. Propagation includes copying, |
||||
distribution (with or without modification), making available to the |
||||
public, and in some countries other activities as well. |
||||
|
||||
To "convey" a work means any kind of propagation that enables other |
||||
parties to make or receive copies. Mere interaction with a user through |
||||
a computer network, with no transfer of a copy, is not conveying. |
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" |
||||
to the extent that it includes a convenient and prominently visible |
||||
feature that (1) displays an appropriate copyright notice, and (2) |
||||
tells the user that there is no warranty for the work (except to the |
||||
extent that warranties are provided), that licensees may convey the |
||||
work under this License, and how to view a copy of this License. If |
||||
the interface presents a list of user commands or options, such as a |
||||
menu, a prominent item in the list meets this criterion. |
||||
|
||||
1. Source Code. |
||||
|
||||
The "source code" for a work means the preferred form of the work |
||||
for making modifications to it. "Object code" means any non-source |
||||
form of a work. |
||||
|
||||
A "Standard Interface" means an interface that either is an official |
||||
standard defined by a recognized standards body, or, in the case of |
||||
interfaces specified for a particular programming language, one that |
||||
is widely used among developers working in that language. |
||||
|
||||
The "System Libraries" of an executable work include anything, other |
||||
than the work as a whole, that (a) is included in the normal form of |
||||
packaging a Major Component, but which is not part of that Major |
||||
Component, and (b) serves only to enable use of the work with that |
||||
Major Component, or to implement a Standard Interface for which an |
||||
implementation is available to the public in source code form. A |
||||
"Major Component", in this context, means a major essential component |
||||
(kernel, window system, and so on) of the specific operating system |
||||
(if any) on which the executable work runs, or a compiler used to |
||||
produce the work, or an object code interpreter used to run it. |
||||
|
||||
The "Corresponding Source" for a work in object code form means all |
||||
the source code needed to generate, install, and (for an executable |
||||
work) run the object code and to modify the work, including scripts to |
||||
control those activities. However, it does not include the work's |
||||
System Libraries, or general-purpose tools or generally available free |
||||
programs which are used unmodified in performing those activities but |
||||
which are not part of the work. For example, Corresponding Source |
||||
includes interface definition files associated with source files for |
||||
the work, and the source code for shared libraries and dynamically |
||||
linked subprograms that the work is specifically designed to require, |
||||
such as by intimate data communication or control flow between those |
||||
subprograms and other parts of the work. |
||||
|
||||
The Corresponding Source need not include anything that users |
||||
can regenerate automatically from other parts of the Corresponding |
||||
Source. |
||||
|
||||
The Corresponding Source for a work in source code form is that |
||||
same work. |
||||
|
||||
2. Basic Permissions. |
||||
|
||||
All rights granted under this License are granted for the term of |
||||
copyright on the Program, and are irrevocable provided the stated |
||||
conditions are met. This License explicitly affirms your unlimited |
||||
permission to run the unmodified Program. The output from running a |
||||
covered work is covered by this License only if the output, given its |
||||
content, constitutes a covered work. This License acknowledges your |
||||
rights of fair use or other equivalent, as provided by copyright law. |
||||
|
||||
You may make, run and propagate covered works that you do not |
||||
convey, without conditions so long as your license otherwise remains |
||||
in force. You may convey covered works to others for the sole purpose |
||||
of having them make modifications exclusively for you, or provide you |
||||
with facilities for running those works, provided that you comply with |
||||
the terms of this License in conveying all material for which you do |
||||
not control copyright. Those thus making or running the covered works |
||||
for you must do so exclusively on your behalf, under your direction |
||||
and control, on terms that prohibit them from making any copies of |
||||
your copyrighted material outside their relationship with you. |
||||
|
||||
Conveying under any other circumstances is permitted solely under |
||||
the conditions stated below. Sublicensing is not allowed; section 10 |
||||
makes it unnecessary. |
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
||||
|
||||
No covered work shall be deemed part of an effective technological |
||||
measure under any applicable law fulfilling obligations under article |
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or |
||||
similar laws prohibiting or restricting circumvention of such |
||||
measures. |
||||
|
||||
When you convey a covered work, you waive any legal power to forbid |
||||
circumvention of technological measures to the extent such circumvention |
||||
is effected by exercising rights under this License with respect to |
||||
the covered work, and you disclaim any intention to limit operation or |
||||
modification of the work as a means of enforcing, against the work's |
||||
users, your or third parties' legal rights to forbid circumvention of |
||||
technological measures. |
||||
|
||||
4. Conveying Verbatim Copies. |
||||
|
||||
You may convey verbatim copies of the Program's source code as you |
||||
receive it, in any medium, provided that you conspicuously and |
||||
appropriately publish on each copy an appropriate copyright notice; |
||||
keep intact all notices stating that this License and any |
||||
non-permissive terms added in accord with section 7 apply to the code; |
||||
keep intact all notices of the absence of any warranty; and give all |
||||
recipients a copy of this License along with the Program. |
||||
|
||||
You may charge any price or no price for each copy that you convey, |
||||
and you may offer support or warranty protection for a fee. |
||||
|
||||
5. Conveying Modified Source Versions. |
||||
|
||||
You may convey a work based on the Program, or the modifications to |
||||
produce it from the Program, in the form of source code under the |
||||
terms of section 4, provided that you also meet all of these conditions: |
||||
|
||||
a) The work must carry prominent notices stating that you modified |
||||
it, and giving a relevant date. |
||||
|
||||
b) The work must carry prominent notices stating that it is |
||||
released under this License and any conditions added under section |
||||
7. This requirement modifies the requirement in section 4 to |
||||
"keep intact all notices". |
||||
|
||||
c) You must license the entire work, as a whole, under this |
||||
License to anyone who comes into possession of a copy. This |
||||
License will therefore apply, along with any applicable section 7 |
||||
additional terms, to the whole of the work, and all its parts, |
||||
regardless of how they are packaged. This License gives no |
||||
permission to license the work in any other way, but it does not |
||||
invalidate such permission if you have separately received it. |
||||
|
||||
d) If the work has interactive user interfaces, each must display |
||||
Appropriate Legal Notices; however, if the Program has interactive |
||||
interfaces that do not display Appropriate Legal Notices, your |
||||
work need not make them do so. |
||||
|
||||
A compilation of a covered work with other separate and independent |
||||
works, which are not by their nature extensions of the covered work, |
||||
and which are not combined with it such as to form a larger program, |
||||
in or on a volume of a storage or distribution medium, is called an |
||||
"aggregate" if the compilation and its resulting copyright are not |
||||
used to limit the access or legal rights of the compilation's users |
||||
beyond what the individual works permit. Inclusion of a covered work |
||||
in an aggregate does not cause this License to apply to the other |
||||
parts of the aggregate. |
||||
|
||||
6. Conveying Non-Source Forms. |
||||
|
||||
You may convey a covered work in object code form under the terms |
||||
of sections 4 and 5, provided that you also convey the |
||||
machine-readable Corresponding Source under the terms of this License, |
||||
in one of these ways: |
||||
|
||||
a) Convey the object code in, or embodied in, a physical product |
||||
(including a physical distribution medium), accompanied by the |
||||
Corresponding Source fixed on a durable physical medium |
||||
customarily used for software interchange. |
||||
|
||||
b) Convey the object code in, or embodied in, a physical product |
||||
(including a physical distribution medium), accompanied by a |
||||
written offer, valid for at least three years and valid for as |
||||
long as you offer spare parts or customer support for that product |
||||
model, to give anyone who possesses the object code either (1) a |
||||
copy of the Corresponding Source for all the software in the |
||||
product that is covered by this License, on a durable physical |
||||
medium customarily used for software interchange, for a price no |
||||
more than your reasonable cost of physically performing this |
||||
conveying of source, or (2) access to copy the |
||||
Corresponding Source from a network server at no charge. |
||||
|
||||
c) Convey individual copies of the object code with a copy of the |
||||
written offer to provide the Corresponding Source. This |
||||
alternative is allowed only occasionally and noncommercially, and |
||||
only if you received the object code with such an offer, in accord |
||||
with subsection 6b. |
||||
|
||||
d) Convey the object code by offering access from a designated |
||||
place (gratis or for a charge), and offer equivalent access to the |
||||
Corresponding Source in the same way through the same place at no |
||||
further charge. You need not require recipients to copy the |
||||
Corresponding Source along with the object code. If the place to |
||||
copy the object code is a network server, the Corresponding Source |
||||
may be on a different server (operated by you or a third party) |
||||
that supports equivalent copying facilities, provided you maintain |
||||
clear directions next to the object code saying where to find the |
||||
Corresponding Source. Regardless of what server hosts the |
||||
Corresponding Source, you remain obligated to ensure that it is |
||||
available for as long as needed to satisfy these requirements. |
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided |
||||
you inform other peers where the object code and Corresponding |
||||
Source of the work are being offered to the general public at no |
||||
charge under subsection 6d. |
||||
|
||||
A separable portion of the object code, whose source code is excluded |
||||
from the Corresponding Source as a System Library, need not be |
||||
included in conveying the object code work. |
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any |
||||
tangible personal property which is normally used for personal, family, |
||||
or household purposes, or (2) anything designed or sold for incorporation |
||||
into a dwelling. In determining whether a product is a consumer product, |
||||
doubtful cases shall be resolved in favor of coverage. For a particular |
||||
product received by a particular user, "normally used" refers to a |
||||
typical or common use of that class of product, regardless of the status |
||||
of the particular user or of the way in which the particular user |
||||
actually uses, or expects or is expected to use, the product. A product |
||||
is a consumer product regardless of whether the product has substantial |
||||
commercial, industrial or non-consumer uses, unless such uses represent |
||||
the only significant mode of use of the product. |
||||
|
||||
"Installation Information" for a User Product means any methods, |
||||
procedures, authorization keys, or other information required to install |
||||
and execute modified versions of a covered work in that User Product from |
||||
a modified version of its Corresponding Source. The information must |
||||
suffice to ensure that the continued functioning of the modified object |
||||
code is in no case prevented or interfered with solely because |
||||
modification has been made. |
||||
|
||||
If you convey an object code work under this section in, or with, or |
||||
specifically for use in, a User Product, and the conveying occurs as |
||||
part of a transaction in which the right of possession and use of the |
||||
User Product is transferred to the recipient in perpetuity or for a |
||||
fixed term (regardless of how the transaction is characterized), the |
||||
Corresponding Source conveyed under this section must be accompanied |
||||
by the Installation Information. But this requirement does not apply |
||||
if neither you nor any third party retains the ability to install |
||||
modified object code on the User Product (for example, the work has |
||||
been installed in ROM). |
||||
|
||||
The requirement to provide Installation Information does not include a |
||||
requirement to continue to provide support service, warranty, or updates |
||||
for a work that has been modified or installed by the recipient, or for |
||||
the User Product in which it has been modified or installed. Access to a |
||||
network may be denied when the modification itself materially and |
||||
adversely affects the operation of the network or violates the rules and |
||||
protocols for communication across the network. |
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, |
||||
in accord with this section must be in a format that is publicly |
||||
documented (and with an implementation available to the public in |
||||
source code form), and must require no special password or key for |
||||
unpacking, reading or copying. |
||||
|
||||
7. Additional Terms. |
||||
|
||||
"Additional permissions" are terms that supplement the terms of this |
||||
License by making exceptions from one or more of its conditions. |
||||
Additional permissions that are applicable to the entire Program shall |
||||
be treated as though they were included in this License, to the extent |
||||
that they are valid under applicable law. If additional permissions |
||||
apply only to part of the Program, that part may be used separately |
||||
under those permissions, but the entire Program remains governed by |
||||
this License without regard to the additional permissions. |
||||
|
||||
When you convey a copy of a covered work, you may at your option |
||||
remove any additional permissions from that copy, or from any part of |
||||
it. (Additional permissions may be written to require their own |
||||
removal in certain cases when you modify the work.) You may place |
||||
additional permissions on material, added by you to a covered work, |
||||
for which you have or can give appropriate copyright permission. |
||||
|
||||
Notwithstanding any other provision of this License, for material you |
||||
add to a covered work, you may (if authorized by the copyright holders of |
||||
that material) supplement the terms of this License with terms: |
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the |
||||
terms of sections 15 and 16 of this License; or |
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or |
||||
author attributions in that material or in the Appropriate Legal |
||||
Notices displayed by works containing it; or |
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or |
||||
requiring that modified versions of such material be marked in |
||||
reasonable ways as different from the original version; or |
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or |
||||
authors of the material; or |
||||
|
||||
e) Declining to grant rights under trademark law for use of some |
||||
trade names, trademarks, or service marks; or |
||||
|
||||
f) Requiring indemnification of licensors and authors of that |
||||
material by anyone who conveys the material (or modified versions of |
||||
it) with contractual assumptions of liability to the recipient, for |
||||
any liability that these contractual assumptions directly impose on |
||||
those licensors and authors. |
||||
|
||||
All other non-permissive additional terms are considered "further |
||||
restrictions" within the meaning of section 10. If the Program as you |
||||
received it, or any part of it, contains a notice stating that it is |
||||
governed by this License along with a term that is a further |
||||
restriction, you may remove that term. If a license document contains |
||||
a further restriction but permits relicensing or conveying under this |
||||
License, you may add to a covered work material governed by the terms |
||||
of that license document, provided that the further restriction does |
||||
not survive such relicensing or conveying. |
||||
|
||||
If you add terms to a covered work in accord with this section, you |
||||
must place, in the relevant source files, a statement of the |
||||
additional terms that apply to those files, or a notice indicating |
||||
where to find the applicable terms. |
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the |
||||
form of a separately written license, or stated as exceptions; |
||||
the above requirements apply either way. |
||||
|
||||
8. Termination. |
||||
|
||||
You may not propagate or modify a covered work except as expressly |
||||
provided under this License. Any attempt otherwise to propagate or |
||||
modify it is void, and will automatically terminate your rights under |
||||
this License (including any patent licenses granted under the third |
||||
paragraph of section 11). |
||||
|
||||
However, if you cease all violation of this License, then your |
||||
license from a particular copyright holder is reinstated (a) |
||||
provisionally, unless and until the copyright holder explicitly and |
||||
finally terminates your license, and (b) permanently, if the copyright |
||||
holder fails to notify you of the violation by some reasonable means |
||||
prior to 60 days after the cessation. |
||||
|
||||
Moreover, your license from a particular copyright holder is |
||||
reinstated permanently if the copyright holder notifies you of the |
||||
violation by some reasonable means, this is the first time you have |
||||
received notice of violation of this License (for any work) from that |
||||
copyright holder, and you cure the violation prior to 30 days after |
||||
your receipt of the notice. |
||||
|
||||
Termination of your rights under this section does not terminate the |
||||
licenses of parties who have received copies or rights from you under |
||||
this License. If your rights have been terminated and not permanently |
||||
reinstated, you do not qualify to receive new licenses for the same |
||||
material under section 10. |
||||
|
||||
9. Acceptance Not Required for Having Copies. |
||||
|
||||
You are not required to accept this License in order to receive or |
||||
run a copy of the Program. Ancillary propagation of a covered work |
||||
occurring solely as a consequence of using peer-to-peer transmission |
||||
to receive a copy likewise does not require acceptance. However, |
||||
nothing other than this License grants you permission to propagate or |
||||
modify any covered work. These actions infringe copyright if you do |
||||
not accept this License. Therefore, by modifying or propagating a |
||||
covered work, you indicate your acceptance of this License to do so. |
||||
|
||||
10. Automatic Licensing of Downstream Recipients. |
||||
|
||||
Each time you convey a covered work, the recipient automatically |
||||
receives a license from the original licensors, to run, modify and |
||||
propagate that work, subject to this License. You are not responsible |
||||
for enforcing compliance by third parties with this License. |
||||
|
||||
An "entity transaction" is a transaction transferring control of an |
||||
organization, or substantially all assets of one, or subdividing an |
||||
organization, or merging organizations. If propagation of a covered |
||||
work results from an entity transaction, each party to that |
||||
transaction who receives a copy of the work also receives whatever |
||||
licenses to the work the party's predecessor in interest had or could |
||||
give under the previous paragraph, plus a right to possession of the |
||||
Corresponding Source of the work from the predecessor in interest, if |
||||
the predecessor has it or can get it with reasonable efforts. |
||||
|
||||
You may not impose any further restrictions on the exercise of the |
||||
rights granted or affirmed under this License. For example, you may |
||||
not impose a license fee, royalty, or other charge for exercise of |
||||
rights granted under this License, and you may not initiate litigation |
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that |
||||
any patent claim is infringed by making, using, selling, offering for |
||||
sale, or importing the Program or any portion of it. |
||||
|
||||
11. Patents. |
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this |
||||
License of the Program or a work on which the Program is based. The |
||||
work thus licensed is called the contributor's "contributor version". |
||||
|
||||
A contributor's "essential patent claims" are all patent claims |
||||
owned or controlled by the contributor, whether already acquired or |
||||
hereafter acquired, that would be infringed by some manner, permitted |
||||
by this License, of making, using, or selling its contributor version, |
||||
but do not include claims that would be infringed only as a |
||||
consequence of further modification of the contributor version. For |
||||
purposes of this definition, "control" includes the right to grant |
||||
patent sublicenses in a manner consistent with the requirements of |
||||
this License. |
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free |
||||
patent license under the contributor's essential patent claims, to |
||||
make, use, sell, offer for sale, import and otherwise run, modify and |
||||
propagate the contents of its contributor version. |
||||
|
||||
In the following three paragraphs, a "patent license" is any express |
||||
agreement or commitment, however denominated, not to enforce a patent |
||||
(such as an express permission to practice a patent or covenant not to |
||||
sue for patent infringement). To "grant" such a patent license to a |
||||
party means to make such an agreement or commitment not to enforce a |
||||
patent against the party. |
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, |
||||
and the Corresponding Source of the work is not available for anyone |
||||
to copy, free of charge and under the terms of this License, through a |
||||
publicly available network server or other readily accessible means, |
||||
then you must either (1) cause the Corresponding Source to be so |
||||
available, or (2) arrange to deprive yourself of the benefit of the |
||||
patent license for this particular work, or (3) arrange, in a manner |
||||
consistent with the requirements of this License, to extend the patent |
||||
license to downstream recipients. "Knowingly relying" means you have |
||||
actual knowledge that, but for the patent license, your conveying the |
||||
covered work in a country, or your recipient's use of the covered work |
||||
in a country, would infringe one or more identifiable patents in that |
||||
country that you have reason to believe are valid. |
||||
|
||||
If, pursuant to or in connection with a single transaction or |
||||
arrangement, you convey, or propagate by procuring conveyance of, a |
||||
covered work, and grant a patent license to some of the parties |
||||
receiving the covered work authorizing them to use, propagate, modify |
||||
or convey a specific copy of the covered work, then the patent license |
||||
you grant is automatically extended to all recipients of the covered |
||||
work and works based on it. |
||||
|
||||
A patent license is "discriminatory" if it does not include within |
||||
the scope of its coverage, prohibits the exercise of, or is |
||||
conditioned on the non-exercise of one or more of the rights that are |
||||
specifically granted under this License. You may not convey a covered |
||||
work if you are a party to an arrangement with a third party that is |
||||
in the business of distributing software, under which you make payment |
||||
to the third party based on the extent of your activity of conveying |
||||
the work, and under which the third party grants, to any of the |
||||
parties who would receive the covered work from you, a discriminatory |
||||
patent license (a) in connection with copies of the covered work |
||||
conveyed by you (or copies made from those copies), or (b) primarily |
||||
for and in connection with specific products or compilations that |
||||
contain the covered work, unless you entered into that arrangement, |
||||
or that patent license was granted, prior to 28 March 2007. |
||||
|
||||
Nothing in this License shall be construed as excluding or limiting |
||||
any implied license or other defenses to infringement that may |
||||
otherwise be available to you under applicable patent law. |
||||
|
||||
12. No Surrender of Others' Freedom. |
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or |
||||
otherwise) that contradict the conditions of this License, they do not |
||||
excuse you from the conditions of this License. If you cannot convey a |
||||
covered work so as to satisfy simultaneously your obligations under this |
||||
License and any other pertinent obligations, then as a consequence you may |
||||
not convey it at all. For example, if you agree to terms that obligate you |
||||
to collect a royalty for further conveying from those to whom you convey |
||||
the Program, the only way you could satisfy both those terms and this |
||||
License would be to refrain entirely from conveying the Program. |
||||
|
||||
13. Use with the GNU Affero General Public License. |
||||
|
||||
Notwithstanding any other provision of this License, you have |
||||
permission to link or combine any covered work with a work licensed |
||||
under version 3 of the GNU Affero General Public License into a single |
||||
combined work, and to convey the resulting work. The terms of this |
||||
License will continue to apply to the part which is the covered work, |
||||
but the special requirements of the GNU Affero General Public License, |
||||
section 13, concerning interaction through a network will apply to the |
||||
combination as such. |
||||
|
||||
14. Revised Versions of this License. |
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of |
||||
the GNU General Public License from time to time. Such new versions will |
||||
be similar in spirit to the present version, but may differ in detail to |
||||
address new problems or concerns. |
||||
|
||||
Each version is given a distinguishing version number. If the |
||||
Program specifies that a certain numbered version of the GNU General |
||||
Public License "or any later version" applies to it, you have the |
||||
option of following the terms and conditions either of that numbered |
||||
version or of any later version published by the Free Software |
||||
Foundation. If the Program does not specify a version number of the |
||||
GNU General Public License, you may choose any version ever published |
||||
by the Free Software Foundation. |
||||
|
||||
If the Program specifies that a proxy can decide which future |
||||
versions of the GNU General Public License can be used, that proxy's |
||||
public statement of acceptance of a version permanently authorizes you |
||||
to choose that version for the Program. |
||||
|
||||
Later license versions may give you additional or different |
||||
permissions. However, no additional obligations are imposed on any |
||||
author or copyright holder as a result of your choosing to follow a |
||||
later version. |
||||
|
||||
15. Disclaimer of Warranty. |
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
||||
|
||||
16. Limitation of Liability. |
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
||||
SUCH DAMAGES. |
||||
|
||||
17. Interpretation of Sections 15 and 16. |
||||
|
||||
If the disclaimer of warranty and limitation of liability provided |
||||
above cannot be given local legal effect according to their terms, |
||||
reviewing courts shall apply local law that most closely approximates |
||||
an absolute waiver of all civil liability in connection with the |
||||
Program, unless a warranty or assumption of liability accompanies a |
||||
copy of the Program in return for a fee. |
||||
|
||||
END OF TERMS AND CONDITIONS |
||||
|
||||
How to Apply These Terms to Your New Programs |
||||
|
||||
If you develop a new program, and you want it to be of the greatest |
||||
possible use to the public, the best way to achieve this is to make it |
||||
free software which everyone can redistribute and change under these terms. |
||||
|
||||
To do so, attach the following notices to the program. It is safest |
||||
to attach them to the start of each source file to most effectively |
||||
state the exclusion of warranty; and each file should have at least |
||||
the "copyright" line and a pointer to where the full notice is found. |
||||
|
||||
{one line to give the program's name and a brief idea of what it does.} |
||||
Copyright (C) {year} {name of author} |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
||||
Also add information on how to contact you by electronic and paper mail. |
||||
|
||||
If the program does terminal interaction, make it output a short |
||||
notice like this when it starts in an interactive mode: |
||||
|
||||
{project} Copyright (C) {year} {fullname} |
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
||||
This is free software, and you are welcome to redistribute it |
||||
under certain conditions; type `show c' for details. |
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate |
||||
parts of the General Public License. Of course, your program's commands |
||||
might be different; for a GUI interface, you would use an "about box". |
||||
|
||||
You should also get your employer (if you work as a programmer) or school, |
||||
if any, to sign a "copyright disclaimer" for the program, if necessary. |
||||
For more information on this, and how to apply and follow the GNU GPL, see |
||||
<http://www.gnu.org/licenses/>. |
||||
|
||||
The GNU General Public License does not permit incorporating your program |
||||
into proprietary programs. If your program is a subroutine library, you |
||||
may consider it more useful to permit linking proprietary applications with |
||||
the library. If this is what you want to do, use the GNU Lesser General |
||||
Public License instead of this License. But first, please read |
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
@ -1,175 +0,0 @@ |
||||
Password Strength Meter plugin for jQuery |
||||
========================================= |
||||
|
||||
[![Build status][build svg]][build status] |
||||
[![Code coverage][coverage svg]][coverage] |
||||
[![License][license svg]][license] |
||||
[![Latest stable version][releases svg]][releases] |
||||
[![Total downloads][downloads svg]][downloads] |
||||
[![Code climate][climate svg]][climate] |
||||
[![jsDelivr CDN][jsdelivr svg]][jsdelivr] |
||||
|
||||
A password strength meter for jQuery. [Give it a try!][web] |
||||
|
||||
![password example][example] |
||||
|
||||
|
||||
Installation |
||||
------------ |
||||
|
||||
Using npm |
||||
|
||||
~~~bash |
||||
npm install --save password-strength-meter |
||||
~~~ |
||||
|
||||
Using bower |
||||
|
||||
~~~bash |
||||
bower install --save password-strength-meter |
||||
~~~ |
||||
|
||||
Or much better, using yarn |
||||
|
||||
~~~bash |
||||
yarn add password-strength-meter |
||||
~~~ |
||||
|
||||
For manual installations check out the [releases][releases] section for tarballs. |
||||
|
||||
Usage |
||||
----- |
||||
|
||||
Import the required scripts: |
||||
|
||||
~~~html |
||||
<script src="./js/password-strength-meter/password.min.js"></script> |
||||
<script src="./js/password-strength-meter/password.min.css"></script> |
||||
~~~ |
||||
|
||||
Ensure your password field has a wrapper div, like in Bootstrap: |
||||
|
||||
~~~html |
||||
<div class="form-group"> |
||||
<label for="password"> |
||||
Password |
||||
</label> |
||||
<input id="password" type="password" class="form-control" /> |
||||
</div> |
||||
~~~ |
||||
|
||||
And call the plugin when you wanna enable it: |
||||
|
||||
~~~javascript |
||||
$('#password').password({ /* options */ }); |
||||
~~~ |
||||
|
||||
### Available options |
||||
|
||||
Here's the list of available options you can pass to the `password` plugin: |
||||
|
||||
~~~javascript |
||||
$('#password').password({ |
||||
enterPass: 'Type your password', |
||||
shortPass: 'The password is too short', |
||||
containsField: 'The password contains your username', |
||||
steps: { |
||||
// Easily change the steps' expected score here |
||||
13: 'Really insecure password', |
||||
33: 'Weak; try combining letters & numbers', |
||||
67: 'Medium; try using special characters', |
||||
94: 'Strong password', |
||||
}, |
||||
showPercent: false, |
||||
showText: true, // shows the text tips |
||||
animate: true, // whether or not to animate the progress bar on input blur/focus |
||||
animateSpeed: 'fast', // the above animation speed |
||||
field: false, // select the match field (selector or jQuery instance) for better password checks |
||||
fieldPartialMatch: true, // whether to check for partials in field |
||||
minimumLength: 4, // minimum password length (below this threshold, the score is 0) |
||||
useColorBarImage: true, // use the (old) colorbar image |
||||
customColorBarRGB: { |
||||
red: [0, 240], |
||||
green: [0, 240], |
||||
blue: 10, |
||||
} // set custom rgb color ranges for colorbar. |
||||
}); |
||||
~~~ |
||||
|
||||
### Events |
||||
|
||||
There are two events fired by the `password` plugin: |
||||
|
||||
~~~javascript |
||||
$('#password').on('password.score', (e, score) => { |
||||
console.log('Called every time a new score is calculated (this means on every keyup)') |
||||
console.log('Current score is %d', score) |
||||
}) |
||||
|
||||
$('#password').on('password.text', (e, text, score) => { |
||||
console.log('Called every time the text is changed (less updated than password.score)') |
||||
console.log('Current message is %s with a score of %d', text, score) |
||||
}) |
||||
~~~ |
||||
|
||||
Compatiblity |
||||
------------ |
||||
|
||||
This plugin was originally created in 2010 for jQuery 1.14, and the current release |
||||
has been tested under jQuery 1, 2 & 3. |
||||
|
||||
It should work in all browsers (even IE 666). |
||||
|
||||
Testing |
||||
------- |
||||
|
||||
First you'll need to grab the code, as the npm version does not come with the |
||||
source files: |
||||
|
||||
~~~bash |
||||
git clone https://github.com/elboletaire/password-strength-meter.git |
||||
cd password-strength-meter |
||||
npm install |
||||
npm test |
||||
~~~ |
||||
|
||||
> Note: tests are just run using jQuery 3. |
||||
|
||||
Why? |
||||
---- |
||||
|
||||
Why another library? Well, I found this on March 11th (of 2017) cleaning up my |
||||
documents folder and noticed I made it in 2010 and never published it, so I |
||||
decided to refactor it "a bit" (simply remade it from the ground-up) and publish |
||||
it, so others can use it. |
||||
|
||||
Credits |
||||
------- |
||||
|
||||
Created by Òscar Casajuana <elboletaire at underave dot net>. |
||||
|
||||
Based on unlicensed work by [Firas Kassem][firas], published in 2007 and modified |
||||
by Amin Rajaee in 2009. |
||||
|
||||
This code is licensed under a [GPL 3.0 license][license]. |
||||
|
||||
[example]: src/example.png |
||||
[firas]: https://phiras.wordpress.com/2009/07/29/password-strength-meter-v-2/ |
||||
[license]: LICENSE.md |
||||
[web]: https://elboletaire.github.io/password-strength-meter/ |
||||
|
||||
[build status]: https://gitlab.com/elboletaire/password-strength-meter/pipelines |
||||
[coverage]: https://gitlab.com/elboletaire/password-strength-meter/-/jobs |
||||
[license]: https://github.com/elboletaire/password-strength-meter/blob/master/LICENSE.md |
||||
[releases]: https://github.com/elboletaire/password-strength-meter/releases |
||||
[downloads]: https://www.npmjs.com/package/password-strength-meter |
||||
[climate]: https://codeclimate.com/github/elboletaire/password-strength-meter |
||||
[jsdelivr]: https://www.jsdelivr.com/package/npm/password-strength-meter |
||||
|
||||
[build svg]: https://gitlab.com/elboletaire/password-strength-meter/badges/master/pipeline.svg |
||||
[coverage svg]: https://gitlab.com/elboletaire/password-strength-meter/badges/master/coverage.svg |
||||
[license svg]: https://img.shields.io/github/license/elboletaire/password-strength-meter.svg |
||||
[releases svg]: https://img.shields.io/npm/v/password-strength-meter.svg |
||||
[downloads svg]: https://img.shields.io/npm/dt/password-strength-meter.svg |
||||
[climate svg]: https://img.shields.io/codeclimate/maintainability/elboletaire/password-strength-meter.svg |
||||
[jsdelivr svg]: https://data.jsdelivr.com/v1/package/npm/password-strength-meter/badge?style=rounded |
@ -1,22 +0,0 @@ |
||||
.pass-graybar { |
||||
height: 3px; |
||||
background-color: #CCC; |
||||
width: 100%; |
||||
position: relative; |
||||
} |
||||
|
||||
.pass-colorbar { |
||||
height: 3px; |
||||
background-image: url(passwordstrength.jpg); |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
} |
||||
|
||||
.pass-percent, .pass-text { |
||||
font-size: 1em; |
||||
} |
||||
|
||||
.pass-percent { |
||||
margin-right: 5px; |
||||
} |
@ -1,345 +0,0 @@ |
||||
/** |
||||
* @author Òscar Casajuana a.k.a. elboletaire <elboletaire at underave dot net> |
||||
* @link https://github.com/elboletaire/password-strength-meter
|
||||
* @license GPL-3.0 |
||||
*/ |
||||
// eslint-disable-next-line
|
||||
;(function ($) { |
||||
'use strict'; |
||||
|
||||
var Password = function ($object, options) { |
||||
var defaults = { |
||||
enterPass: 'Type your password', |
||||
shortPass: 'The password is too short', |
||||
containsField: 'The password contains your username', |
||||
steps: { |
||||
13: 'Really insecure password', |
||||
33: 'Weak; try combining letters & numbers', |
||||
67: 'Medium; try using special characters', |
||||
94: 'Strong password', |
||||
}, |
||||
showPercent: false, |
||||
showText: true, |
||||
animate: true, |
||||
animateSpeed: 'fast', |
||||
field: false, |
||||
fieldPartialMatch: true, |
||||
minimumLength: 4, |
||||
closestSelector: 'div', |
||||
useColorBarImage: false, |
||||
customColorBarRGB: { |
||||
red: [0, 240], |
||||
green: [0, 240], |
||||
blue: 10 |
||||
}, |
||||
}; |
||||
|
||||
options = $.extend({}, defaults, options); |
||||
|
||||
/** |
||||
* Returns strings based on the score given. |
||||
* |
||||
* @param {int} score Score base. |
||||
* @return {string} |
||||
*/ |
||||
function scoreText(score) |
||||
{ |
||||
if (score === -1) { |
||||
return options.shortPass; |
||||
} |
||||
if (score === -2) { |
||||
return options.containsField; |
||||
} |
||||
|
||||
score = score < 0 ? 0 : score; |
||||
|
||||
var text = options.shortPass; |
||||
var sortedStepKeys = Object.keys(options.steps).sort(); |
||||
for (var step in sortedStepKeys) { |
||||
var stepVal = sortedStepKeys[step]; |
||||
if (stepVal < score) { |
||||
text = options.steps[stepVal]; |
||||
} |
||||
} |
||||
|
||||
return text; |
||||
} |
||||
|
||||
/** |
||||
* Returns a value between -2 and 100 to score |
||||
* the user's password. |
||||
* |
||||
* @param {string} password The password to be checked. |
||||
* @param {string} field The field set (if options.field). |
||||
* @return {int} |
||||
*/ |
||||
function calculateScore(password, field) |
||||
{ |
||||
var score = 0; |
||||
|
||||
// password < options.minimumLength
|
||||
if (password.length < options.minimumLength) { |
||||
return -1; |
||||
} |
||||
|
||||
if (options.field) { |
||||
// password === field
|
||||
if (password.toLowerCase() === field.toLowerCase()) { |
||||
return -2; |
||||
} |
||||
// password contains field (and fieldPartialMatch is set to true)
|
||||
if (options.fieldPartialMatch && field.length) { |
||||
var user = new RegExp(field.toLowerCase()); |
||||
if (password.toLowerCase().match(user)) { |
||||
return -2; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// password length
|
||||
score += password.length * 4; |
||||
score += checkRepetition(1, password).length - password.length; |
||||
score += checkRepetition(2, password).length - password.length; |
||||
score += checkRepetition(3, password).length - password.length; |
||||
score += checkRepetition(4, password).length - password.length; |
||||
|
||||
// password has 3 numbers
|
||||
if (password.match(/(.*[0-9].*[0-9].*[0-9])/)) { |
||||
score += 5; |
||||
} |
||||
|
||||
// password has at least 2 symbols
|
||||
var symbols = '.*[!,@,#,$,%,^,&,*,?,_,~]'; |
||||
symbols = new RegExp('(' + symbols + symbols + ')'); |
||||
if (password.match(symbols)) { |
||||
score += 5; |
||||
} |
||||
|
||||
// password has Upper and Lower chars
|
||||
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) { |
||||
score += 10; |
||||
} |
||||
|
||||
// password has number and chars
|
||||
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) { |
||||
score += 15; |
||||
} |
||||
|
||||
// password has number and symbol
|
||||
if (password.match(/([!@#$%^&*?_~])/) && password.match(/([0-9])/)) { |
||||
score += 15; |
||||
} |
||||
|
||||
// password has char and symbol
|
||||
if (password.match(/([!@#$%^&*?_~])/) && password.match(/([a-zA-Z])/)) { |
||||
score += 15; |
||||
} |
||||
|
||||
// password is just numbers or chars
|
||||
if (password.match(/^\w+$/) || password.match(/^\d+$/)) { |
||||
score -= 10; |
||||
} |
||||
|
||||
if (score > 100) { |
||||
score = 100; |
||||
} |
||||
|
||||
if (score < 0) { |
||||
score = 0; |
||||
} |
||||
|
||||
return score; |
||||
} |
||||
|
||||
/** |
||||
* Checks for repetition of characters in |
||||
* a string |
||||
* |
||||
* @param {int} length Repetition length. |
||||
* @param {string} str The string to be checked. |
||||
* @return {string} |
||||
*/ |
||||
function checkRepetition(length, str) |
||||
{ |
||||
var res = "", repeated = false; |
||||
for (var i = 0; i < str.length; i++) { |
||||
repeated = true; |
||||
for (var j = 0; j < length && (j + i + length) < str.length; j++) { |
||||
repeated = repeated && (str.charAt(j + i) === str.charAt(j + i + length)); |
||||
} |
||||
if (j < length) { |
||||
repeated = false; |
||||
} |
||||
if (repeated) { |
||||
i += length - 1; |
||||
repeated = false; |
||||
} else { |
||||
res += str.charAt(i); |
||||
} |
||||
} |
||||
return res; |
||||
} |
||||
|
||||
/** |
||||
* Calculates background colors from percentage value. |
||||
* |
||||
* @param {int} perc The percentage strength of the password. |
||||
* @return {object} Object with colors as keys |
||||
*/ |
||||
function calculateColorFromPercentage(perc) |
||||
{ |
||||
var minRed = 0; |
||||
var maxRed = 240; |
||||
var minGreen = 0; |
||||
var maxGreen = 240; |
||||
var blue = 10; |
||||
|
||||
if (Object.prototype.hasOwnProperty.call(options.customColorBarRGB, 'red')) { |
||||
minRed = options.customColorBarRGB.red[0]; |
||||
maxRed = options.customColorBarRGB.red[1]; |
||||
} |
||||
|
||||
if (Object.prototype.hasOwnProperty.call(options.customColorBarRGB, 'green')) { |
||||
minGreen = options.customColorBarRGB.green[0]; |
||||
maxGreen = options.customColorBarRGB.green[1]; |
||||
} |
||||
|
||||
if (Object.prototype.hasOwnProperty.call(options.customColorBarRGB, 'blue')) { |
||||
blue = options.customColorBarRGB.blue; |
||||
} |
||||
|
||||
var green = (perc * maxGreen / 50); |
||||
var red = (2 * maxRed) - (perc * maxRed / 50); |
||||
|
||||
return { |
||||
red: Math.min(Math.max(red, minRed), maxRed), |
||||
green: Math.min(Math.max(green, minGreen), maxGreen), |
||||
blue: blue |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Adds color styles to colorbar jQuery object. |
||||
* |
||||
* @param {jQuery} $colorbar The colorbar jquery object. |
||||
* @param {int} perc The percentage strength of the password. |
||||
* @return {jQuery} |
||||
*/ |
||||
function addColorBarStyle($colorbar, perc) |
||||
{ |
||||
if (options.useColorBarImage) { |
||||
$colorbar.css({ |
||||
backgroundPosition: "0px -" + perc + "px", |
||||
width: perc + '%' |
||||
}); |
||||
} else { |
||||
var colors = calculateColorFromPercentage(perc); |
||||
|
||||
$colorbar.css({ |
||||
'background-image': 'none', |
||||
'background-color': 'rgb(' + colors.red.toString() + ', ' + colors.green.toString() + ', ' + colors.blue.toString() + ')', |
||||
width: perc + '%' |
||||
}); |
||||
} |
||||
|
||||
return $colorbar; |
||||
} |
||||
|
||||
/** |
||||
* Initializes the plugin creating and binding the |
||||
* required layers and events. |
||||
* |
||||
* @return {Password} Returns the Password instance. |
||||
*/ |
||||
function init() |
||||
{ |
||||
var shown = true; |
||||
var $text = options.showText; |
||||
var $percentage = options.showPercent; |
||||
var $graybar = $('<div>').addClass('pass-graybar'); |
||||
var $colorbar = $('<div>').addClass('pass-colorbar'); |
||||
var $insert = $('<div>').addClass('pass-wrapper').append( |
||||
$graybar.append($colorbar) |
||||
); |
||||
|
||||
$object.closest(options.closestSelector).addClass('pass-strength-visible'); |
||||
if (options.animate) { |
||||
$insert.css('display', 'none'); |
||||
shown = false; |
||||
$object.closest(options.closestSelector).removeClass('pass-strength-visible'); |
||||
} |
||||
|
||||
if (options.showPercent) { |
||||
$percentage = $('<span>').addClass('pass-percent').text('0%'); |
||||
$insert.append($percentage); |
||||
} |
||||
|
||||
if (options.showText) { |
||||
$text = $('<span>').addClass('pass-text').html(options.enterPass); |
||||
$insert.append($text); |
||||
} |
||||
|
||||
$object.closest(options.closestSelector).append($insert); |
||||
|
||||
$object.keyup(function () { |
||||
var field = options.field || ''; |
||||
if (field) { |
||||
field = $(field).val(); |
||||
} |
||||
|
||||
var score = calculateScore($object.val(), field); |
||||
$object.trigger('password.score', [score]); |
||||
var perc = score < 0 ? 0 : score; |
||||
|
||||
$colorbar = addColorBarStyle($colorbar, perc); |
||||
|
||||
if (options.showPercent) { |
||||
$percentage.html(perc + '%'); |
||||
} |
||||
|
||||
if (options.showText) { |
||||
var text = scoreText(score); |
||||
if (!$object.val().length && score <= 0) { |
||||
text = options.enterPass; |
||||
} |
||||
|
||||
if ($text.html() !== $('<div>').html(text).html()) { |
||||
$text.html(text); |
||||
$object.trigger('password.text', [text, score]); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
if (options.animate) { |
||||
$object.focus(function () { |
||||
if (!shown) { |
||||
$insert.slideDown(options.animateSpeed, function () { |
||||
shown = true; |
||||
$object.closest(options.closestSelector).addClass('pass-strength-visible'); |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
$object.blur(function () { |
||||
if (!$object.val().length && shown) { |
||||
$insert.slideUp(options.animateSpeed, function () { |
||||
shown = false; |
||||
$object.closest(options.closestSelector).removeClass('pass-strength-visible') |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
return this; |
||||
} |
||||
|
||||
return init.call(this); |
||||
}; |
||||
|
||||
// Bind to jquery
|
||||
$.fn.password = function (options) { |
||||
return this.each(function () { |
||||
new Password($(this), options); |
||||
}); |
||||
}; |
||||
})(jQuery); |
Before Width: | Height: | Size: 9.7 KiB |
@ -1,91 +0,0 @@ |
||||
/*! ================================================ |
||||
* DUPLICATOR TIPPY STYLE |
||||
* Copyright:Snap Creek LLC 2015-2021 |
||||
* ================================================ */ |
||||
|
||||
.tippy-box[data-theme~='duplicator'], |
||||
.tippy-box[data-theme~='duplicator-filled'] { |
||||
background-color: white; |
||||
color: black; |
||||
font-size: 12px; |
||||
border-width: 1px; |
||||
border-style: solid; |
||||
border-radius: 0; |
||||
padding: 0; |
||||
max-width: 250px; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'] .tippy-content, |
||||
.tippy-box[data-theme~='duplicator-filled'] .tippy-content { |
||||
padding: 0; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'] h3, |
||||
.tippy-box[data-theme~='duplicator-filled'] h3 { |
||||
display: block; |
||||
box-sizing: border-box; |
||||
margin: 0; |
||||
width: 100%; |
||||
padding: 5px; |
||||
font-weight: bold; |
||||
font-size: 12px; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'] .dup-tippy-content, |
||||
.tippy-box[data-theme~='duplicator-filled'] .dup-tippy-content { |
||||
padding: 5px; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'] .dup-tippy-content *:first-child, |
||||
.tippy-box[data-theme~='duplicator-filled'] .dup-tippy-content *:first-child { |
||||
margin-top: 0; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'] .dup-tippy-content *:last-child, |
||||
.tippy-box[data-theme~='duplicator-filled'] .dup-tippy-content *:last-child { |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
.tippy-box[data-placement^='top']>.tippy-arrow::before { |
||||
bottom: -9px; |
||||
} |
||||
|
||||
.tippy-box[data-placement^='bottom']>.tippy-arrow::before { |
||||
top: -9px; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'], |
||||
.tippy-box[data-theme~='duplicator-filled'] { |
||||
border-color: #13659C; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'] h3, |
||||
.tippy-box[data-theme~='duplicato-filled'] h3 { |
||||
background-color: #13659C; |
||||
color: white; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator-filled'] .tippy-content { |
||||
background-color: #13659C; |
||||
color: white; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'][data-placement^='top']>.tippy-arrow::before, |
||||
.tippy-box[data-theme~='duplicator-filled'][data-placement^='top']>.tippy-arrow::before { |
||||
border-top-color: #13659C; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'][data-placement^='bottom']>.tippy-arrow::before, |
||||
.tippy-box[data-theme~='duplicator-filled'][data-placement^='bottom']>.tippy-arrow::before { |
||||
border-bottom-color: #13659C; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'][data-placement^='left']>.tippy-arrow::before, |
||||
.tippy-box[data-theme~='duplicator-filled'][data-placement^='left']>.tippy-arrow::before { |
||||
border-left-color: #13659C; |
||||
} |
||||
|
||||
.tippy-box[data-theme~='duplicator'][data-placement^='right']>.tippy-arrow::before, |
||||
.tippy-box[data-theme~='duplicator-filled'][data-placement^='right']>.tippy-arrow::before { |
||||
border-right-color: #13659C; |
||||
} |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
@ -1 +0,0 @@ |
||||
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} |
@ -1,27 +0,0 @@ |
||||
<!DOCTYPE html> |
||||
<html dir='ltr'> |
||||
|
||||
<head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
||||
<meta name="viewport" content="width=device-width"> |
||||
<title>Maintenance</title> |
||||
<style> |
||||
#message { |
||||
text-align: center; |
||||
margin: 40px 0; |
||||
} |
||||
</style> |
||||
</head> |
||||
<!-- DUPLICATOR INSTALLER MAINTENANCE --> |
||||
<!-- Remove this file in case you are not running an installation but it was not removed from the installer due to some error. --> |
||||
<!-- This file is "index.html" located in home path --> |
||||
|
||||
<body id="error-page"> |
||||
<div id="message"> |
||||
<h2> |
||||
Briefly unavailable for scheduled maintenance. Check back in a minute. |
||||
</h2> |
||||
</div> |
||||
</body> |
||||
|
||||
</html> |
@ -1,349 +0,0 @@ |
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ |
||||
|
||||
/* Document |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* 1. Correct the line height in all browsers. |
||||
* 2. Prevent adjustments of font size after orientation changes in iOS. |
||||
*/ |
||||
|
||||
html { |
||||
line-height: 1.15; /* 1 */ |
||||
-webkit-text-size-adjust: 100%; /* 2 */ |
||||
} |
||||
|
||||
/* Sections |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Remove the margin in all browsers. |
||||
*/ |
||||
|
||||
body { |
||||
margin: 0; |
||||
} |
||||
|
||||
/** |
||||
* Render the `main` element consistently in IE. |
||||
*/ |
||||
|
||||
main { |
||||
display: block; |
||||
} |
||||
|
||||
/** |
||||
* Correct the font size and margin on `h1` elements within `section` and |
||||
* `article` contexts in Chrome, Firefox, and Safari. |
||||
*/ |
||||
|
||||
h1 { |
||||
font-size: 2em; |
||||
margin: 0.67em 0; |
||||
} |
||||
|
||||
/* Grouping content |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* 1. Add the correct box sizing in Firefox. |
||||
* 2. Show the overflow in Edge and IE. |
||||
*/ |
||||
|
||||
hr { |
||||
box-sizing: content-box; /* 1 */ |
||||
height: 0; /* 1 */ |
||||
overflow: visible; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* 1. Correct the inheritance and scaling of font size in all browsers. |
||||
* 2. Correct the odd `em` font sizing in all browsers. |
||||
*/ |
||||
|
||||
pre { |
||||
font-family: monospace, monospace; /* 1 */ |
||||
font-size: 1em; /* 2 */ |
||||
} |
||||
|
||||
/* Text-level semantics |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Remove the gray background on active links in IE 10. |
||||
*/ |
||||
|
||||
a { |
||||
background-color: transparent; |
||||
} |
||||
|
||||
/** |
||||
* 1. Remove the bottom border in Chrome 57- |
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. |
||||
*/ |
||||
|
||||
abbr[title] { |
||||
border-bottom: none; /* 1 */ |
||||
text-decoration: underline; /* 2 */ |
||||
text-decoration: underline dotted; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Add the correct font weight in Chrome, Edge, and Safari. |
||||
*/ |
||||
|
||||
b, |
||||
strong { |
||||
font-weight: bolder; |
||||
} |
||||
|
||||
/** |
||||
* 1. Correct the inheritance and scaling of font size in all browsers. |
||||
* 2. Correct the odd `em` font sizing in all browsers. |
||||
*/ |
||||
|
||||
code, |
||||
kbd, |
||||
samp { |
||||
font-family: monospace, monospace; /* 1 */ |
||||
font-size: 1em; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Add the correct font size in all browsers. |
||||
*/ |
||||
|
||||
small { |
||||
font-size: 80%; |
||||
} |
||||
|
||||
/** |
||||
* Prevent `sub` and `sup` elements from affecting the line height in |
||||
* all browsers. |
||||
*/ |
||||
|
||||
sub, |
||||
sup { |
||||
font-size: 75%; |
||||
line-height: 0; |
||||
position: relative; |
||||
vertical-align: baseline; |
||||
} |
||||
|
||||
sub { |
||||
bottom: -0.25em; |
||||
} |
||||
|
||||
sup { |
||||
top: -0.5em; |
||||
} |
||||
|
||||
/* Embedded content |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Remove the border on images inside links in IE 10. |
||||
*/ |
||||
|
||||
img { |
||||
border-style: none; |
||||
} |
||||
|
||||
/* Forms |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* 1. Change the font styles in all browsers. |
||||
* 2. Remove the margin in Firefox and Safari. |
||||
*/ |
||||
|
||||
button, |
||||
input, |
||||
optgroup, |
||||
select, |
||||
textarea { |
||||
font-family: inherit; /* 1 */ |
||||
font-size: 100%; /* 1 */ |
||||
line-height: 1.15; /* 1 */ |
||||
margin: 0; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Show the overflow in IE. |
||||
* 1. Show the overflow in Edge. |
||||
*/ |
||||
|
||||
button, |
||||
input { /* 1 */ |
||||
overflow: visible; |
||||
} |
||||
|
||||
/** |
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE. |
||||
* 1. Remove the inheritance of text transform in Firefox. |
||||
*/ |
||||
|
||||
button, |
||||
select { /* 1 */ |
||||
text-transform: none; |
||||
} |
||||
|
||||
/** |
||||
* Correct the inability to style clickable types in iOS and Safari. |
||||
*/ |
||||
|
||||
button, |
||||
[type="button"], |
||||
[type="reset"], |
||||
[type="submit"] { |
||||
-webkit-appearance: button; |
||||
} |
||||
|
||||
/** |
||||
* Remove the inner border and padding in Firefox. |
||||
*/ |
||||
|
||||
button::-moz-focus-inner, |
||||
[type="button"]::-moz-focus-inner, |
||||
[type="reset"]::-moz-focus-inner, |
||||
[type="submit"]::-moz-focus-inner { |
||||
border-style: none; |
||||
padding: 0; |
||||
} |
||||
|
||||
/** |
||||
* Restore the focus styles unset by the previous rule. |
||||
*/ |
||||
|
||||
button:-moz-focusring, |
||||
[type="button"]:-moz-focusring, |
||||
[type="reset"]:-moz-focusring, |
||||
[type="submit"]:-moz-focusring { |
||||
outline: 1px dotted ButtonText; |
||||
} |
||||
|
||||
/** |
||||
* Correct the padding in Firefox. |
||||
*/ |
||||
|
||||
fieldset { |
||||
padding: 0.35em 0.75em 0.625em; |
||||
} |
||||
|
||||
/** |
||||
* 1. Correct the text wrapping in Edge and IE. |
||||
* 2. Correct the color inheritance from `fieldset` elements in IE. |
||||
* 3. Remove the padding so developers are not caught out when they zero out |
||||
* `fieldset` elements in all browsers. |
||||
*/ |
||||
|
||||
legend { |
||||
box-sizing: border-box; /* 1 */ |
||||
color: inherit; /* 2 */ |
||||
display: table; /* 1 */ |
||||
max-width: 100%; /* 1 */ |
||||
padding: 0; /* 3 */ |
||||
white-space: normal; /* 1 */ |
||||
} |
||||
|
||||
/** |
||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera. |
||||
*/ |
||||
|
||||
progress { |
||||
vertical-align: baseline; |
||||
} |
||||
|
||||
/** |
||||
* Remove the default vertical scrollbar in IE 10+. |
||||
*/ |
||||
|
||||
textarea { |
||||
overflow: auto; |
||||
} |
||||
|
||||
/** |
||||
* 1. Add the correct box sizing in IE 10. |
||||
* 2. Remove the padding in IE 10. |
||||
*/ |
||||
|
||||
[type="checkbox"], |
||||
[type="radio"] { |
||||
box-sizing: border-box; /* 1 */ |
||||
padding: 0; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Correct the cursor style of increment and decrement buttons in Chrome. |
||||
*/ |
||||
|
||||
[type="number"]::-webkit-inner-spin-button, |
||||
[type="number"]::-webkit-outer-spin-button { |
||||
height: auto; |
||||
} |
||||
|
||||
/** |
||||
* 1. Correct the odd appearance in Chrome and Safari. |
||||
* 2. Correct the outline style in Safari. |
||||
*/ |
||||
|
||||
[type="search"] { |
||||
-webkit-appearance: textfield; /* 1 */ |
||||
outline-offset: -2px; /* 2 */ |
||||
} |
||||
|
||||
/** |
||||
* Remove the inner padding in Chrome and Safari on macOS. |
||||
*/ |
||||
|
||||
[type="search"]::-webkit-search-decoration { |
||||
-webkit-appearance: none; |
||||
} |
||||
|
||||
/** |
||||
* 1. Correct the inability to style clickable types in iOS and Safari. |
||||
* 2. Change font properties to `inherit` in Safari. |
||||
*/ |
||||
|
||||
::-webkit-file-upload-button { |
||||
-webkit-appearance: button; /* 1 */ |
||||
font: inherit; /* 2 */ |
||||
} |
||||
|
||||
/* Interactive |
||||
========================================================================== */ |
||||
|
||||
/* |
||||
* Add the correct display in Edge, IE 10+, and Firefox. |
||||
*/ |
||||
|
||||
details { |
||||
display: block; |
||||
} |
||||
|
||||
/* |
||||
* Add the correct display in all browsers. |
||||
*/ |
||||
|
||||
summary { |
||||
display: list-item; |
||||
} |
||||
|
||||
/* Misc |
||||
========================================================================== */ |
||||
|
||||
/** |
||||
* Add the correct display in IE 10+. |
||||
*/ |
||||
|
||||
template { |
||||
display: none; |
||||
} |
||||
|
||||
/** |
||||
* Add the correct display in IE 10. |
||||
*/ |
||||
|
||||
[hidden] { |
||||
display: none; |
||||
} |
@ -1,82 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* The base configuration for WordPress |
||||
* |
||||
* The wp-config.php creation script uses this file during the |
||||
* installation. You don't have to use the web site, you can |
||||
* copy this file to "wp-config.php" and fill in the values. |
||||
* |
||||
* This file contains the following configurations: |
||||
* |
||||
* * MySQL settings |
||||
* * Secret keys |
||||
* * Database table prefix |
||||
* * ABSPATH |
||||
* |
||||
* @link https://codex.wordpress.org/Editing_wp-config.php |
||||
* |
||||
* @package WordPress |
||||
*/ |
||||
|
||||
// ** MySQL settings - You can get this info from your web host ** // |
||||
/** The name of the database for WordPress */ |
||||
define('DB_NAME', 'database_name_here'); |
||||
/** MySQL database username */ |
||||
define('DB_USER', 'username_here'); |
||||
/** MySQL database password */ |
||||
define('DB_PASSWORD', 'password_here'); |
||||
/** MySQL hostname */ |
||||
define('DB_HOST', 'localhost'); |
||||
/** Database Charset to use in creating database tables. */ |
||||
define('DB_CHARSET', 'utf8'); |
||||
/** The Database Collate type. Don't change this if in doubt. */ |
||||
define('DB_COLLATE', ''); |
||||
/**#@+ |
||||
* Authentication Unique Keys and Salts. |
||||
* |
||||
* Change these to different unique phrases! |
||||
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service} |
||||
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again. |
||||
* |
||||
* @since 2.6.0 |
||||
*/ |
||||
define('AUTH_KEY', 'put your unique phrase here'); |
||||
define('SECURE_AUTH_KEY', 'put your unique phrase here'); |
||||
define('LOGGED_IN_KEY', 'put your unique phrase here'); |
||||
define('NONCE_KEY', 'put your unique phrase here'); |
||||
define('AUTH_SALT', 'put your unique phrase here'); |
||||
define('SECURE_AUTH_SALT', 'put your unique phrase here'); |
||||
define('LOGGED_IN_SALT', 'put your unique phrase here'); |
||||
define('NONCE_SALT', 'put your unique phrase here'); |
||||
/**#@-*/ |
||||
|
||||
/** |
||||
* WordPress Database Table prefix. |
||||
* |
||||
* You can have multiple installations in one database if you give each |
||||
* a unique prefix. Only numbers, letters, and underscores please! |
||||
*/ |
||||
$table_prefix = 'wp_'; |
||||
/** |
||||
* For developers: WordPress debugging mode. |
||||
* |
||||
* Change this to true to enable the display of notices during development. |
||||
* It is strongly recommended that plugin and theme developers use WP_DEBUG |
||||
* in their development environments. |
||||
* |
||||
* For information on other constants that can be used for debugging, |
||||
* visit the Codex. |
||||
* |
||||
* @link https://codex.wordpress.org/Debugging_in_WordPress |
||||
*/ |
||||
define('WP_DEBUG', false); |
||||
/* That's all, stop editing! Happy publishing. */ |
||||
|
||||
/** Absolute path to the WordPress directory. */ |
||||
if (! defined('ABSPATH')) { |
||||
define('ABSPATH', dirname(__FILE__) . '/'); |
||||
} |
||||
|
||||
/** Sets up WordPress vars and included files. */ |
||||
require_once(ABSPATH . 'wp-settings.php'); |
@ -1,9 +0,0 @@ |
||||
<Files *.php> |
||||
Order Deny,Allow |
||||
Deny from all |
||||
</Files> |
||||
|
||||
<Files index.php> |
||||
Order Allow,Deny |
||||
Allow from all |
||||
</Files> |
@ -1,34 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Chunk |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
/** |
||||
* Event iterator |
||||
*/ |
||||
interface EventIterator extends Iterator |
||||
{ |
||||
/** |
||||
* The callback accept 3 params |
||||
* $event , $index and $current values |
||||
* |
||||
* @param null | callable $callback |
||||
*/ |
||||
public function setEventCallback($callback = null); |
||||
|
||||
/** |
||||
* Execute event |
||||
* |
||||
* @param mixed $event |
||||
* @param mixed $key |
||||
* @param mixed $current |
||||
*/ |
||||
public function doEvent($event, $key, $current); |
||||
} |
@ -1,43 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Chunk |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
/** |
||||
* |
||||
* @author andrea |
||||
*/ |
||||
interface GenericSeekableIterator extends Iterator |
||||
{ |
||||
/** |
||||
* |
||||
* @param mixed $position |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public function gSeek($position); |
||||
|
||||
/** |
||||
* return current position |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function getPosition(); |
||||
|
||||
/** |
||||
* Free resources in current iteration |
||||
*/ |
||||
public function stopIteration(); |
||||
|
||||
/** |
||||
* Return iterations count |
||||
*/ |
||||
public function itCount(); |
||||
} |
@ -1,248 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Step 3 iterator |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Chunk |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
|
||||
require_once(DUPX_INIT . '/classes/chunk/Iterators/Interfaces/GenericSeekableIterator.php'); |
||||
|
||||
/** |
||||
* Description of class |
||||
* |
||||
* @author andrea |
||||
*/ |
||||
class DUPX_s3_iterator implements GenericSeekableIterator |
||||
{ |
||||
const STEP_START = 'start'; |
||||
const STEP_CLEANUP_EXTREA = 'cleanup_extra'; |
||||
const STEP_CLEANUP_PACKAGES = 'cleanup_packages'; |
||||
const STEP_CLEANUP_OPTIONS = 'cleanup_trans'; |
||||
const STEP_SEARCH_AND_REPLACE_INIT = 'init'; |
||||
const STEP_SEARCH_AND_REPLACE = 'search_replace'; |
||||
const STEP_REMOVE_MAINTENACE = 'rem_maintenance'; |
||||
const STEP_CREATE_ADMIN = 'create_admin'; |
||||
const STEP_CONF_UPDATE = 'config_update'; |
||||
const STEP_GEN_UPD = 'gen_update'; |
||||
const STEP_GEN_CLEAN = 'gen_clean'; |
||||
const STEP_NOTICE_TEST = 'notice_test'; |
||||
const STEP_CLEANUP_TMP_FILES = 'cleanup_tmp_files'; |
||||
const STEP_SET_FILE_PERMS = 'set_files_perms'; |
||||
const STEP_FINAL_REPORT_NOTICES = 'final_report'; |
||||
|
||||
private static $numIterations = 10; |
||||
protected $position = array( |
||||
'l0' => self::STEP_SEARCH_AND_REPLACE_INIT, |
||||
'l1' => null, |
||||
'l2' => null |
||||
); |
||||
protected $isValid = true; |
||||
protected $tablesIterator = null; |
||||
|
||||
public function __construct() |
||||
{ |
||||
$tables = DUPX_DB_Tables::getInstance()->getReplaceTablesNames(); |
||||
$this->tablesIterator = new ArrayIterator($tables); |
||||
$this->rewind(); |
||||
} |
||||
|
||||
#[\ReturnTypeWillChange] |
||||
public function rewind() |
||||
{ |
||||
$this->isValid = true; |
||||
$this->position = array( |
||||
'l0' => self::STEP_START, |
||||
'l1' => null, |
||||
'l2' => null |
||||
); |
||||
$this->tablesIterator->rewind(); |
||||
} |
||||
|
||||
#[\ReturnTypeWillChange] |
||||
public function next() |
||||
{ |
||||
switch ($this->position['l0']) { |
||||
case self::STEP_START: |
||||
$this->position['l0'] = self::STEP_CLEANUP_OPTIONS; |
||||
break; |
||||
case self::STEP_CLEANUP_OPTIONS: |
||||
$this->position['l0'] = self::STEP_CLEANUP_EXTREA; |
||||
break; |
||||
case self::STEP_CLEANUP_EXTREA: |
||||
$this->position['l0'] = self::STEP_CLEANUP_PACKAGES; |
||||
break; |
||||
case self::STEP_CLEANUP_PACKAGES: |
||||
$this->position['l0'] = self::STEP_SEARCH_AND_REPLACE_INIT; |
||||
break; |
||||
case self::STEP_SEARCH_AND_REPLACE_INIT: |
||||
if ($this->getNextSearchReplacePosition(true)) { |
||||
// if search and replace is valid go to STEP_SEARCH_AND_REPLACE |
||||
$this->position['l0'] = self::STEP_SEARCH_AND_REPLACE; |
||||
} else { |
||||
// if search and replace isn't valid skip STEP_SEARCH_AND_REPLACE and go to STEP_REMOVE_MAINTENACE |
||||
$this->position['l0'] = self::STEP_REMOVE_MAINTENACE; |
||||
} |
||||
break; |
||||
case self::STEP_SEARCH_AND_REPLACE: |
||||
if (!$this->getNextSearchReplacePosition()) { |
||||
$this->position['l0'] = self::STEP_REMOVE_MAINTENACE; |
||||
} |
||||
break; |
||||
case self::STEP_REMOVE_MAINTENACE: |
||||
$this->position['l0'] = self::STEP_CONF_UPDATE; |
||||
break; |
||||
case self::STEP_CONF_UPDATE: |
||||
$this->position['l0'] = self::STEP_GEN_UPD; |
||||
break; |
||||
case self::STEP_GEN_UPD: |
||||
$this->position['l0'] = self::STEP_GEN_CLEAN; |
||||
break; |
||||
case self::STEP_GEN_CLEAN: |
||||
$this->position['l0'] = self::STEP_CREATE_ADMIN; |
||||
break; |
||||
case self::STEP_CREATE_ADMIN: |
||||
$this->position['l0'] = self::STEP_NOTICE_TEST; |
||||
break; |
||||
case self::STEP_NOTICE_TEST: |
||||
$this->position['l0'] = self::STEP_CLEANUP_TMP_FILES; |
||||
break; |
||||
case self::STEP_CLEANUP_TMP_FILES: |
||||
$this->position['l0'] = self::STEP_SET_FILE_PERMS; |
||||
break; |
||||
case self::STEP_SET_FILE_PERMS: |
||||
$this->position['l0'] = self::STEP_FINAL_REPORT_NOTICES; |
||||
break; |
||||
case self::STEP_FINAL_REPORT_NOTICES: |
||||
default: |
||||
$this->position['l0'] = null; |
||||
$this->isValid = false; |
||||
} |
||||
} |
||||
|
||||
private function getNextSearchReplacePosition($init = false) |
||||
{ |
||||
$valid = true; |
||||
$s3func = DUPX_S3_Funcs::getInstance(); |
||||
$pages = isset($s3func->cTableParams['pages']) ? $s3func->cTableParams['pages'] : 0; |
||||
$this->position['l2'] = (int) $this->position['l2']; |
||||
|
||||
$this->position['l2']++; |
||||
if ($this->position['l2'] < $pages) { |
||||
/* NEXT PAGE */ |
||||
Log::info('ITERATOR INCREMENT PAGE: ' . $this->position['l2'] . ' PAGES[' . $pages . ']', 3); |
||||
$s3func->cTableParams['page'] = $this->position['l2']; |
||||
} else { |
||||
if ($init) { |
||||
DUPX_UpdateEngine::loadInit(); |
||||
Log::info('ITERATOR FIRST TABLE: ' . $this->position['l2'] . ' PAGES[' . $pages . ']', 3); |
||||
$this->tablesIterator->rewind(); |
||||
} else { |
||||
Log::info('ITERATOR INCREMENT TABLE: ' . $this->position['l2'] . ' PAGES[' . $pages . ']', 3); |
||||
if ($s3func->cTableParams['updated']) { |
||||
$s3func->report['updt_tables']++; |
||||
} |
||||
$this->tablesIterator->next(); |
||||
} |
||||
$this->position['l1'] = $this->tablesIterator->key(); |
||||
$this->position['l2'] = 0; |
||||
|
||||
// search first table with rows and columns |
||||
while ($this->tablesIterator->valid()) { |
||||
Log::info('ITERATOR CHECK TABLE: ' . $this->tablesIterator->current(), 3); |
||||
// init table params if isn't initialized |
||||
if (DUPX_UpdateEngine::initTableParams($this->tablesIterator->current())) { |
||||
// table with columns and rows found |
||||
break; |
||||
} |
||||
// NEXT TABLE |
||||
$this->tablesIterator->next(); |
||||
} |
||||
|
||||
if ($this->tablesIterator->valid()) { |
||||
$this->position['l1'] = $this->tablesIterator->key(); |
||||
$this->position['l2'] = 0; |
||||
} else { |
||||
$this->position['l1'] = null; |
||||
$this->position['l2'] = null; |
||||
$s3func->cTableParams = null; |
||||
DUPX_UpdateEngine::loadEnd(); |
||||
DUPX_UpdateEngine::logStats(); |
||||
DUPX_UpdateEngine::logErrors(); |
||||
$valid = false; |
||||
} |
||||
} |
||||
return $valid; |
||||
} |
||||
|
||||
public function gSeek($position) |
||||
{ |
||||
$this->position = $position; |
||||
switch ($this->position['l0']) { |
||||
case self::STEP_SEARCH_AND_REPLACE: |
||||
$this->tablesIterator->seek($this->position['l1']); |
||||
break; |
||||
default: |
||||
} |
||||
} |
||||
|
||||
public function getPosition() |
||||
{ |
||||
return $this->position; |
||||
} |
||||
|
||||
#[\ReturnTypeWillChange] |
||||
public function key() |
||||
{ |
||||
return implode('_', $this->position); |
||||
} |
||||
|
||||
#[\ReturnTypeWillChange] |
||||
public function current() |
||||
{ |
||||
$result = array( |
||||
'l0' => $this->position['l0'], |
||||
'l1' => null, |
||||
'l2' => null |
||||
); |
||||
$result['l0'] = $this->position['l0']; |
||||
|
||||
switch ($this->position['l0']) { |
||||
case self::STEP_SEARCH_AND_REPLACE: |
||||
$result['l1'] = $this->tablesIterator->current(); |
||||
$result['l2'] = $this->position['l2']; |
||||
break; |
||||
default: |
||||
} |
||||
return $result; |
||||
} |
||||
|
||||
public function stopIteration() |
||||
{ |
||||
switch ($this->position['l0']) { |
||||
case self::STEP_SEARCH_AND_REPLACE: |
||||
DUPX_UpdateEngine::commitAndSave(); |
||||
break; |
||||
default: |
||||
} |
||||
} |
||||
|
||||
#[\ReturnTypeWillChange] |
||||
public function valid() |
||||
{ |
||||
return $this->isValid; |
||||
} |
||||
|
||||
public function itCount() |
||||
{ |
||||
return self::$numIterations; |
||||
} |
||||
} |
@ -1,230 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Chunk manager step 3 |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Chunk |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Deploy\Database\DbCleanup; |
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Utils\Log\LogHandler; |
||||
use Duplicator\Libs\Snap\SnapJson; |
||||
|
||||
require_once(DUPX_INIT . '/classes/chunk/class.chunkingmanager_file.php'); |
||||
require_once(DUPX_INIT . '/classes/chunk/Iterators/class.s3.iterator.php'); |
||||
|
||||
/** |
||||
* Chunk manager step 3 |
||||
* |
||||
* @author andrea |
||||
*/ |
||||
class DUPX_chunkS3Manager extends DUPX_ChunkingManager_file |
||||
{ |
||||
/** |
||||
* Exectute action for every iteration |
||||
* |
||||
* @param string $key |
||||
* @param array $current |
||||
*/ |
||||
protected function action($key, $current) |
||||
{ |
||||
$s3FuncsManager = DUPX_S3_Funcs::getInstance(); |
||||
|
||||
Log::info('CHUNK ACTION: CURRENT [' . implode('][', $current) . ']'); |
||||
|
||||
switch ($current['l0']) { |
||||
case DUPX_s3_iterator::STEP_START: |
||||
$s3FuncsManager->initLog(); |
||||
$s3FuncsManager->initChunkLog($this->maxIteration, $this->timeOut, $this->throttling, $GLOBALS['DATABASE_PAGE_SIZE']); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CLEANUP_OPTIONS: |
||||
DbCleanup::cleanupOptions(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CLEANUP_EXTREA: |
||||
DbCleanup::cleanupExtra(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CLEANUP_PACKAGES: |
||||
DbCleanup::cleanupPackages(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_SEARCH_AND_REPLACE_INIT: |
||||
break; |
||||
case DUPX_s3_iterator::STEP_SEARCH_AND_REPLACE: |
||||
DUPX_UpdateEngine::evaluateTableRows($current['l1'], $current['l2']); |
||||
DUPX_UpdateEngine::commitAndSave(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_REMOVE_MAINTENACE: |
||||
$s3FuncsManager->removeMaintenanceMode(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CREATE_ADMIN: |
||||
$s3FuncsManager->createNewAdminUser(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CONF_UPDATE: |
||||
$s3FuncsManager->configFilesUpdate(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_GEN_UPD: |
||||
$s3FuncsManager->generalUpdate(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_GEN_CLEAN: |
||||
$s3FuncsManager->generalCleanup(); |
||||
$s3FuncsManager->forceLogoutOfAllUsers(); |
||||
$s3FuncsManager->duplicatorMigrationInfoSet(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_NOTICE_TEST: |
||||
$s3FuncsManager->checkForIndexHtml(); |
||||
$s3FuncsManager->noticeTest(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CLEANUP_TMP_FILES: |
||||
$s3FuncsManager->cleanupTmpFiles(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_SET_FILE_PERMS: |
||||
$s3FuncsManager->setFilePermsission(); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_FINAL_REPORT_NOTICES: |
||||
$s3FuncsManager->finalReportNotices(); |
||||
break; |
||||
default: |
||||
} |
||||
|
||||
/** |
||||
* At each iteration save the status in case of exit with timeout |
||||
*/ |
||||
$this->saveData(); |
||||
} |
||||
|
||||
protected function getIterator() |
||||
{ |
||||
return new DUPX_s3_iterator(); |
||||
} |
||||
|
||||
public function getStoredDataKey() |
||||
{ |
||||
return $GLOBALS["CHUNK_DATA_FILE_PATH"]; |
||||
} |
||||
|
||||
/** |
||||
* stop iteration without save data. |
||||
* It is already saved every iteration. |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function stop($saveData = false) |
||||
{ |
||||
return parent::stop(false); |
||||
} |
||||
|
||||
/** |
||||
* load data from previous step if exists adn restore _POST and GLOBALS |
||||
* |
||||
* @param string $key file name |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
protected function getStoredData($key) |
||||
{ |
||||
if (($data = parent::getStoredData($key)) != null) { |
||||
Log::info("CHUNK LOAD DATA: POSITION " . implode(' / ', $data['position']), 2); |
||||
return $data['position']; |
||||
} else { |
||||
Log::info("CHUNK LOAD DATA: IS NULL "); |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* delete stored data if exists |
||||
*/ |
||||
protected function deleteStoredData($key) |
||||
{ |
||||
Log::info("CHUNK DELETE STORED DATA FILE:" . Log::v2str($key), 2); |
||||
return parent::deleteStoredData($key); |
||||
} |
||||
|
||||
/** |
||||
* save data for next step |
||||
*/ |
||||
protected function saveStoredData($key, $data) |
||||
{ |
||||
// store s3 func data |
||||
$s3Funcs = DUPX_S3_Funcs::getInstance(); |
||||
$s3Funcs->report['chunk'] = 1; |
||||
$s3Funcs->report['chunkPos'] = $data; |
||||
$s3Funcs->report['pass'] = 0; |
||||
$s3Funcs->report['progress_perc'] = $this->getProgressPerc(); |
||||
$s3Funcs->saveData(); |
||||
|
||||
// managed output for timeout shutdown |
||||
LogHandler::setShutdownReturn(LogHandler::SHUTDOWN_TIMEOUT, SnapJson::jsonEncode($s3Funcs->getJsonReport())); |
||||
|
||||
/** |
||||
* store position post and globals |
||||
*/ |
||||
$gData = array( |
||||
'position' => $data |
||||
); |
||||
|
||||
Log::info("CHUNK SAVE DATA: POSITION " . implode(' / ', $data), 2); |
||||
return parent::saveStoredData($key, $gData); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return float progress in % |
||||
*/ |
||||
public function getProgressPerc() |
||||
{ |
||||
$result = 0; |
||||
$position = $this->it->getPosition(); |
||||
$s3Func = DUPX_S3_Funcs::getInstance(); |
||||
|
||||
switch ($position['l0']) { |
||||
case DUPX_s3_iterator::STEP_SEARCH_AND_REPLACE_INIT: |
||||
$result = 5; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_SEARCH_AND_REPLACE: |
||||
$lowLimit = 10; |
||||
$higthLimit = 90; |
||||
$stepDelta = $higthLimit - $lowLimit; |
||||
$tables = DUPX_DB_Tables::getInstance()->getReplaceTablesNames(); |
||||
$tableDelta = $stepDelta / (count($tables) + 1); |
||||
$singePagePerc = $tableDelta / ($s3Func->cTableParams['pages'] + 1); |
||||
$result = round($lowLimit + ($tableDelta * (int) $position['l1']) + ($singePagePerc * (int) $position['l2']), 2); |
||||
break; |
||||
case DUPX_s3_iterator::STEP_REMOVE_MAINTENACE: |
||||
$result = 90; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CREATE_ADMIN: |
||||
$result = 92; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CONF_UPDATE: |
||||
$result = 93; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_GEN_UPD: |
||||
$result = 94; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_GEN_CLEAN: |
||||
$result = 95; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_NOTICE_TEST: |
||||
$result = 96; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_CLEANUP_TMP_FILES: |
||||
$result = 97; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_SET_FILE_PERMS: |
||||
$result = 98; |
||||
break; |
||||
case DUPX_s3_iterator::STEP_FINAL_REPORT_NOTICES: |
||||
$result = 100; |
||||
break; |
||||
default: |
||||
} |
||||
return $result; |
||||
} |
||||
} |
@ -1,226 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Cunking manager |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Chunk |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
/** |
||||
* Abstract class to split an single ajax requet in multiple requests |
||||
*/ |
||||
abstract class DUPX_ChunkingManager |
||||
{ |
||||
/** @var GenericSeekableIterator */ |
||||
protected $it = null; |
||||
|
||||
/** @var mixed */ |
||||
protected $position = null; |
||||
|
||||
/** @var integer max iteration before stop. If 0 have no limit */ |
||||
public $maxIteration = 0; |
||||
|
||||
/** @var integer timeout in milliseconds before stop exectution */ |
||||
public $timeOut = 0; |
||||
|
||||
/** @var integer sleep in milliseconds every iteration */ |
||||
public $throttling = 0; |
||||
|
||||
/** @var float */ |
||||
protected $startTime = null; |
||||
|
||||
/** @var integer */ |
||||
protected $itCount = 0; |
||||
|
||||
/** |
||||
* set params |
||||
* |
||||
* @param number $maxIteration |
||||
* @param number $timeOut |
||||
* @param number $throttling |
||||
*/ |
||||
public function __construct($maxIteration = 0, $timeOut = 0, $throttling = 0) |
||||
{ |
||||
|
||||
$this->maxIteration = $maxIteration; |
||||
$this->timeOut = $timeOut; |
||||
$this->throttling = $throttling; |
||||
$this->it = $this->getIterator(); |
||||
|
||||
if (!is_subclass_of($this->it, 'GenericSeekableIterator')) { |
||||
throw new Exception('Iterator don\'t extend GenericSeekableIterator'); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param boolean $rewind |
||||
* |
||||
* @return boolean true if execution completed false if stopped |
||||
*/ |
||||
public function start($rewind = false) |
||||
{ |
||||
$this->itCount = 0; |
||||
$microThrottling = $this->throttling * 1000; |
||||
|
||||
if ($rewind) { |
||||
/** |
||||
* delete store data and rewind |
||||
*/ |
||||
$this->deleteStoredData($this->getStoredDataKey()); |
||||
$this->it->rewind(); |
||||
} elseif (( $last_position = $this->getStoredData($this->getStoredDataKey()) ) !== null) { |
||||
/** |
||||
* load last position if exist and delete it |
||||
*/ |
||||
$this->deleteStoredData($this->getStoredDataKey()); |
||||
$this->it->gSeek($last_position); |
||||
$this->it->next(); |
||||
} |
||||
|
||||
$this->startTime(); |
||||
|
||||
/** |
||||
* Iterate |
||||
*/ |
||||
for (; $this->it->valid(); $this->it->next()) { |
||||
$this->itCount ++; |
||||
|
||||
/** |
||||
* excetute action for current item |
||||
*/ |
||||
$this->action($this->it->key(), $this->it->current()); |
||||
|
||||
if ($microThrottling) { |
||||
usleep($microThrottling); |
||||
} |
||||
|
||||
if ($this->maxIteration && $this->itCount >= $this->maxIteration || $this->checkTime() == false) { |
||||
$this->stop(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* var bool $saveData is fals don't save data. Used in extended classe fot don't save data on stop. |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function stop($saveData = true) |
||||
{ |
||||
if ($saveData) { |
||||
if (!$this->saveStoredData($this->getStoredDataKey(), $this->it->getPosition())) { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
$position = $this->it->getPosition(); |
||||
$this->it->stopIteration(); |
||||
|
||||
return $position; |
||||
} |
||||
|
||||
protected function saveData() |
||||
{ |
||||
if (!$this->saveStoredData($this->getStoredDataKey(), $this->it->getPosition())) { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function getLastPosition() |
||||
{ |
||||
return $this->it->getPosition(); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return number |
||||
*/ |
||||
public function getIterationsCount() |
||||
{ |
||||
return $this->itCount; |
||||
} |
||||
|
||||
/** |
||||
* @return void |
||||
*/ |
||||
protected function startTime() |
||||
{ |
||||
$this->startTime = microtime(true); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
protected function checkTime() |
||||
{ |
||||
if ($this->timeOut) { |
||||
$delta = $this->getExecutionTime() * 1000; |
||||
if ($delta > $this->timeOut) { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return number |
||||
*/ |
||||
public function getExecutionTime() |
||||
{ |
||||
return microtime(true) - $this->startTime; |
||||
} |
||||
|
||||
/** |
||||
* Get stored data key |
||||
*/ |
||||
abstract public function getStoredDataKey(); |
||||
|
||||
/** |
||||
* load data from previous step if exists |
||||
*/ |
||||
abstract protected function getStoredData($key); |
||||
|
||||
/** |
||||
* delete stored data if exists |
||||
*/ |
||||
abstract protected function deleteStoredData($key); |
||||
|
||||
/** |
||||
* save data for next step |
||||
*/ |
||||
abstract protected function saveStoredData($key, $data); |
||||
|
||||
/** |
||||
* |
||||
* @param mixed $key |
||||
* @param mixed $current |
||||
*/ |
||||
abstract protected function action($key, $current); |
||||
|
||||
/** |
||||
* @return GenericSeekableIterator |
||||
*/ |
||||
abstract protected function getIterator(); |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
abstract public function getProgressPerc(); |
||||
} |
@ -1,66 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Cunking manager with stored data in json file. |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Chunk |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Libs\Snap\SnapJson; |
||||
|
||||
require_once(DUPX_INIT . '/classes/chunk/class.chunkingmanager.php'); |
||||
|
||||
/** |
||||
* Store position on json file |
||||
*/ |
||||
abstract class DUPX_ChunkingManager_file extends DUPX_ChunkingManager |
||||
{ |
||||
/** |
||||
* load data from previous step if exists |
||||
* |
||||
* @param string $key file name |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
protected function getStoredData($key) |
||||
{ |
||||
if (file_exists($key)) { |
||||
$data = file_get_contents($key); |
||||
return json_decode($data, true); |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* delete stored data if exists |
||||
*/ |
||||
protected function deleteStoredData($key) |
||||
{ |
||||
if (file_exists($key)) { |
||||
unlink($key); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $key file path |
||||
* @param mixed $data to save in file path |
||||
* |
||||
* @return boolean|int This function returns the number of bytes that were written to the file, or FALSE on failure. |
||||
*/ |
||||
protected function saveStoredData($key, $data) |
||||
{ |
||||
if (($json = SnapJson::jsonEncode($data)) === false) { |
||||
throw new Exception('Json encode chunk data error'); |
||||
} |
||||
|
||||
return file_put_contents($key, $json); |
||||
} |
||||
} |
@ -1,64 +0,0 @@ |
||||
<?php |
||||
|
||||
defined("DUPXABSPATH") or die(""); |
||||
/** |
||||
* Class used to update and edit web server configuration files |
||||
* for .htaccess, web.config and user.ini |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Crypt |
||||
*/ |
||||
class DUPX_Crypt |
||||
{ |
||||
public static function encrypt($key, $string) |
||||
{ |
||||
$result = ''; |
||||
for ($i = 0; $i < strlen($string); $i++) { |
||||
$char = substr($string, $i, 1); |
||||
$keychar = substr($key, ($i % strlen($key)) - 1, 1); |
||||
$char = chr(ord($char) + ord($keychar)); |
||||
$result .= $char; |
||||
} |
||||
|
||||
return urlencode(base64_encode($result)); |
||||
} |
||||
|
||||
public static function decrypt($key, $string) |
||||
{ |
||||
$result = ''; |
||||
$string = urldecode($string); |
||||
$string = base64_decode($string); |
||||
|
||||
for ($i = 0; $i < strlen($string); $i++) { |
||||
$char = substr($string, $i, 1); |
||||
$keychar = substr($key, ($i % strlen($key)) - 1, 1); |
||||
$char = chr(ord($char) - ord($keychar)); |
||||
$result .= $char; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
public static function scramble($string) |
||||
{ |
||||
return self::encrypt(self::sk1() . self::sk2(), $string); |
||||
} |
||||
|
||||
public static function unscramble($string) |
||||
{ |
||||
return self::decrypt(self::sk1() . self::sk2(), $string); |
||||
} |
||||
|
||||
public static function sk1() |
||||
{ |
||||
return 'fdas' . self::encrypt('abx', 'v1'); |
||||
} |
||||
|
||||
public static function sk2() |
||||
{ |
||||
return 'fres' . self::encrypt('ad3x', 'v2'); |
||||
} |
||||
} |
@ -1,212 +0,0 @@ |
||||
<?php |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Libs\Snap\SnapJson; |
||||
|
||||
|
||||
class DUPX_CSRF |
||||
{ |
||||
private static $packagHash = null; |
||||
private static $mainFolder = null; |
||||
/** |
||||
* Session var name prefix |
||||
* |
||||
* @var string |
||||
*/ |
||||
public static $prefix = '_DUPX_CSRF'; |
||||
/** |
||||
* Stores all CSRF values: Key as CSRF name and Val as CRF value |
||||
* |
||||
* @var array |
||||
*/ |
||||
private static $CSRFVars = null; |
||||
public static function init($mainFolderm, $packageHash) |
||||
{ |
||||
self::$mainFolder = $mainFolderm; |
||||
self::$packagHash = $packageHash; |
||||
self::$CSRFVars = null; |
||||
} |
||||
|
||||
/** |
||||
* Set new CSRF |
||||
* |
||||
* @param string $key CSRF Key |
||||
* @param string $val CSRF Val |
||||
* |
||||
* @return Void |
||||
*/ |
||||
public static function setKeyVal($key, $val) |
||||
{ |
||||
$CSRFVars = self::getCSRFVars(); |
||||
$CSRFVars[$key] = $val; |
||||
self::saveCSRFVars($CSRFVars); |
||||
self::$CSRFVars = null; |
||||
} |
||||
|
||||
/** |
||||
* Get CSRF value by passing CSRF key |
||||
* |
||||
* @param string $key CSRF key |
||||
* |
||||
* @return string|boolean If CSRF value set for give n Key, It returns CRF value otherise returns false |
||||
*/ |
||||
public static function getVal($key) |
||||
{ |
||||
$CSRFVars = self::getCSRFVars(); |
||||
if (isset($CSRFVars[$key])) { |
||||
return $CSRFVars[$key]; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Generate DUPX_CSRF value for form |
||||
* |
||||
* @param string $form // Form name as session key |
||||
* |
||||
* @return string // token |
||||
*/ |
||||
public static function generate($form = null) |
||||
{ |
||||
$keyName = self::getKeyName($form); |
||||
$existingToken = self::getVal($keyName); |
||||
if (false !== $existingToken) { |
||||
$token = $existingToken; |
||||
} else { |
||||
$token = DUPX_CSRF::token() . DUPX_CSRF::fingerprint(); |
||||
} |
||||
|
||||
self::setKeyVal($keyName, $token); |
||||
return $token; |
||||
} |
||||
|
||||
/** |
||||
* Check DUPX_CSRF value of form |
||||
* |
||||
* @param string $token - Token |
||||
* @param string $form - Form name as session key |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public static function check($token, $form = null) |
||||
{ |
||||
if (empty($form)) { |
||||
return false; |
||||
} |
||||
|
||||
$keyName = self::getKeyName($form); |
||||
$CSRFVars = self::getCSRFVars(); |
||||
if (isset($CSRFVars[$keyName]) && $CSRFVars[$keyName] == $token) { |
||||
// token OK |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Generate token |
||||
* |
||||
* @return string |
||||
*/ |
||||
protected static function token() |
||||
{ |
||||
$microtime = (int) (microtime(true) * 10000); |
||||
mt_srand($microtime); |
||||
$charid = strtoupper(md5(uniqid(rand(), true))); |
||||
return substr($charid, 0, 8) . substr($charid, 8, 4) . substr($charid, 12, 4) . substr($charid, 16, 4) . substr($charid, 20, 12); |
||||
} |
||||
|
||||
/** |
||||
* Returns "digital fingerprint" of user |
||||
* |
||||
* @return string - MD5 hashed data |
||||
*/ |
||||
protected static function fingerprint() |
||||
{ |
||||
return strtoupper(md5(implode('|', array($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT'])))); |
||||
} |
||||
|
||||
/** |
||||
* Generate CSRF Key name |
||||
* |
||||
* @param string $form the form name for which CSRF key need to generate |
||||
* |
||||
* @return string CSRF key |
||||
*/ |
||||
private static function getKeyName($form) |
||||
{ |
||||
return DUPX_CSRF::$prefix . '_' . $form; |
||||
} |
||||
|
||||
/** |
||||
* Get Package hash |
||||
* |
||||
* @return string Package hash |
||||
*/ |
||||
private static function getPackageHash() |
||||
{ |
||||
if (is_null(self::$packagHash)) { |
||||
throw new Exception('Not init CSFR CLASS'); |
||||
} |
||||
return self::$packagHash; |
||||
} |
||||
|
||||
/** |
||||
* Get file path where CSRF tokens are stored in JSON encoded format |
||||
* |
||||
* @return string file path where CSRF token stored |
||||
*/ |
||||
public static function getFilePath() |
||||
{ |
||||
if (is_null(self::$mainFolder)) { |
||||
throw new Exception('Not init CSFR CLASS'); |
||||
} |
||||
$dupInstallerfolderPath = self::$mainFolder; |
||||
$packageHash = self::getPackageHash(); |
||||
$fileName = 'dup-installer-csrf__' . $packageHash . '.txt'; |
||||
$filePath = $dupInstallerfolderPath . '/' . $fileName; |
||||
return $filePath; |
||||
} |
||||
|
||||
/** |
||||
* Get all CSRF vars in array format |
||||
* |
||||
* @return array Key as CSRF name and value as CSRF value |
||||
*/ |
||||
private static function getCSRFVars() |
||||
{ |
||||
if (is_null(self::$CSRFVars)) { |
||||
$filePath = self::getFilePath(); |
||||
if (file_exists($filePath)) { |
||||
$contents = file_get_contents($filePath); |
||||
if (empty($contents)) { |
||||
self::$CSRFVars = array(); |
||||
} else { |
||||
$CSRFobjs = json_decode($contents); |
||||
foreach ($CSRFobjs as $key => $value) { |
||||
self::$CSRFVars[$key] = $value; |
||||
} |
||||
} |
||||
} else { |
||||
self::$CSRFVars = array(); |
||||
} |
||||
} |
||||
return self::$CSRFVars; |
||||
} |
||||
|
||||
/** |
||||
* Stores all CSRF vars |
||||
* |
||||
* @param array $CSRFVars holds all CSRF key val |
||||
* |
||||
* @return void |
||||
*/ |
||||
private static function saveCSRFVars($CSRFVars) |
||||
{ |
||||
$contents = SnapJson::jsonEncode($CSRFVars); |
||||
$filePath = self::getFilePath(); |
||||
file_put_contents($filePath, $contents); |
||||
} |
||||
} |
@ -1,237 +0,0 @@ |
||||
<?php |
||||
|
||||
defined("DUPXABSPATH") or die(""); |
||||
|
||||
/** |
||||
* CLASS::DUPX_Http |
||||
* Http Class Utility |
||||
*/ |
||||
class DUPX_HTTP |
||||
{ |
||||
/** |
||||
* Do an http post request with curl or php code |
||||
* |
||||
* @param string $url A URL to post to |
||||
* @param string $params A valid key/pair combo $data = array('key1' => 'value1', 'key2' => 'value2'); |
||||
* @param array $headers Optional header elements |
||||
* |
||||
* @return string or FALSE on failure. |
||||
*/ |
||||
public static function post($url, $params = array(), $headers = null) |
||||
{ |
||||
//PHP POST |
||||
if (!function_exists('curl_init')) { |
||||
return self::php_get_post($url, $params, $headers = null, 'POST'); |
||||
} |
||||
|
||||
//CURL POST |
||||
$headers_on = isset($headers) && array_count_values($headers); |
||||
$params = http_build_query($params); |
||||
$ch = curl_init(); |
||||
// Return contents of transfer on curl_exec |
||||
// Allow self-signed certs |
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
||||
curl_setopt($ch, CURLOPT_URL, $url); |
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
||||
curl_setopt($ch, CURLOPT_HEADER, $headers_on); |
||||
if ($headers_on) { |
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); |
||||
} |
||||
curl_setopt($ch, CURLOPT_POST, count($params)); |
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); |
||||
$response = curl_exec($ch); |
||||
curl_close($ch); |
||||
return $response; |
||||
} |
||||
|
||||
/** |
||||
* Do an http post request with curl or php code |
||||
* |
||||
* @param string $url A URL to get. If $params is not null then all query strings will be removed. |
||||
* @param string $params A valid key/pair combo $data = array('key1' => 'value1', 'key2' => 'value2'); |
||||
* @param string $headers Optional header elements |
||||
* |
||||
* @return string|bool a string or FALSE on failure. |
||||
*/ |
||||
public static function get($url, $params = array(), $headers = null) |
||||
{ |
||||
//PHP GET |
||||
if (!function_exists('curl_init')) { |
||||
return self::php_get_post($url, $params, $headers = null, 'GET'); |
||||
} |
||||
|
||||
//Remove query string if $params are passed |
||||
$full_url = $url; |
||||
if (count($params)) { |
||||
$url = preg_replace('/\?.*/', '', $url); |
||||
$full_url = $url . '?' . http_build_query($params); |
||||
} |
||||
$headers_on = isset($headers) && array_count_values($headers); |
||||
$ch = curl_init(); |
||||
// Return contents of transfer on curl_exec |
||||
// Allow self-signed certs |
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
||||
curl_setopt($ch, CURLOPT_URL, $full_url); |
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
||||
curl_setopt($ch, CURLOPT_HEADER, $headers_on); |
||||
if ($headers_on) { |
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); |
||||
} |
||||
$response = curl_exec($ch); |
||||
curl_close($ch); |
||||
return $response; |
||||
} |
||||
|
||||
/** |
||||
* Check to see if the internet is accessible |
||||
* |
||||
* @param string $host A URL e.g without prefix "ajax.googleapis.com" |
||||
* @param string $port A valid port number |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function is_url_active($url, $port = 443, $timeout = 5) |
||||
{ |
||||
//localhost will not have cpanel in most cases |
||||
if (strpos($url, 'localhost:2083') !== false) { |
||||
return false; |
||||
} |
||||
|
||||
switch (true) { |
||||
case function_exists('curl_init'): |
||||
return self::is_url_active_curl($url, $port, $timeout); |
||||
break; |
||||
|
||||
case function_exists('fsockopen'): |
||||
return self::is_url_active_fsockopen($url, $port, $timeout); |
||||
break; |
||||
|
||||
default: |
||||
return false; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Returns the host part of a URL |
||||
* |
||||
* @param string $url A valid URL |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function parse_host($url) |
||||
{ |
||||
$url = parse_url(trim($url)); |
||||
if ($url == false) { |
||||
return null; |
||||
} |
||||
return trim($url['host'] ? $url['host'] : array_shift(explode('/', $url['path'], 2))); |
||||
} |
||||
|
||||
/** |
||||
* Return the current page URL |
||||
* |
||||
* @param bool $withQuery Return the URL with its string |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function get_page_url($withQuery = true) |
||||
{ |
||||
$protocol = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') |
||||
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https') |
||||
|| (!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') |
||||
|| (isset($_SERVER['SERVER_PORT']) && intval($_SERVER['SERVER_PORT']) === 443) ? 'https' : 'http'; |
||||
|
||||
$uri = $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
||||
|
||||
return $withQuery ? $uri : str_replace('?' . $_SERVER['QUERY_STRING'], '', $uri); |
||||
} |
||||
|
||||
//PHP POST or GET requets |
||||
private static function php_get_post($url, $params, $headers = null, $method = 'POST') |
||||
{ |
||||
$full_url = $url; |
||||
if ($method == 'GET' && count($params)) { |
||||
$url = preg_replace('/\?.*/', '', $url); |
||||
$full_url = $url . '?' . http_build_query($params); |
||||
} |
||||
|
||||
$data = array('http' => array( |
||||
'method' => $method, |
||||
'content' => http_build_query($params))); |
||||
if ($headers !== null) { |
||||
$data['http']['header'] = $headers; |
||||
} |
||||
$ctx = stream_context_create($data); |
||||
$fp = @fopen($full_url, 'rb', false, $ctx); |
||||
if (!$fp) { |
||||
throw new Exception("Problem with $full_url, $php_errormsg"); |
||||
} |
||||
$response = @stream_get_contents($fp); |
||||
if ($response === false) { |
||||
throw new Exception("Problem reading data from $full_url, $php_errormsg"); |
||||
} |
||||
return $response; |
||||
} |
||||
|
||||
//Check URL with fsockopen/ |
||||
private static function is_url_active_fsockopen($url, $port = 443, $timeout = 5) |
||||
{ |
||||
try { |
||||
$host = parse_url($url, PHP_URL_HOST); |
||||
$host = DUPX_U::is_ssl() ? "ssl://{$host}" : $host; |
||||
$errno = 0; |
||||
$message = 'Error with fsockopen'; |
||||
$connection = @fsockopen($host, $port, $code, $message, $timeout); |
||||
|
||||
if (!is_resource($connection)) { |
||||
return false; |
||||
} |
||||
@fclose($connection); |
||||
return true; |
||||
} catch (Exception $e) { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
//Check URL with curl |
||||
private static function is_url_active_curl($url, $port = 443, $timeout = 5) |
||||
{ |
||||
try { |
||||
$result = false; |
||||
$url = filter_var($url, FILTER_VALIDATE_URL); |
||||
$handle = curl_init($url); |
||||
|
||||
/* Set curl parameter */ |
||||
curl_setopt_array($handle, array( |
||||
CURLOPT_FOLLOWLOCATION => true, |
||||
CURLOPT_NOBODY => true, |
||||
CURLOPT_HEADER => false, |
||||
CURLOPT_RETURNTRANSFER => false, |
||||
CURLOPT_SSL_VERIFYHOST => false, |
||||
CURLOPT_SSL_VERIFYPEER => false, |
||||
CURLOPT_TIMEOUT => $timeout, |
||||
CURLOPT_PORT => $port |
||||
)); |
||||
|
||||
$response = curl_exec($handle); |
||||
|
||||
$httpCode = curl_getinfo($handle, CURLINFO_EFFECTIVE_URL); // Try to get the last url |
||||
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); // Get http status from last url |
||||
|
||||
/* Check for 200 (file is found). */ |
||||
if ($httpCode == 200) { |
||||
$result = true; |
||||
} |
||||
|
||||
curl_close($handle); |
||||
return $result; |
||||
} catch (Exception $e) { |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -1,689 +0,0 @@ |
||||
<?php |
||||
|
||||
defined("DUPXABSPATH") or die(""); |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\Descriptors\ParamDescConfigs; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapIO; |
||||
|
||||
class DUPX_InstallerState |
||||
{ |
||||
/** |
||||
* modes |
||||
*/ |
||||
const MODE_UNKNOWN = -1; |
||||
const MODE_STD_INSTALL = 0; |
||||
const MODE_OVR_INSTALL = 1; |
||||
|
||||
/** |
||||
* install types |
||||
*/ |
||||
const INSTALL_NOT_SET = -2; |
||||
const INSTALL_SINGLE_SITE = -1; |
||||
const INSTALL_SINGLE_SITE_ON_SUBDOMAIN = 4; |
||||
const INSTALL_SINGLE_SITE_ON_SUBFOLDER = 5; |
||||
const INSTALL_RBACKUP_SINGLE_SITE = 8; |
||||
|
||||
const LOGIC_MODE_IMPORT = 'IMPORT'; |
||||
const LOGIC_MODE_RECOVERY = 'RECOVERY'; |
||||
const LOGIC_MODE_CLASSIC = 'CLASSIC'; |
||||
const LOGIC_MODE_OVERWRITE = 'OVERWRITE'; |
||||
const LOGIC_MODE_BRIDGE = 'BRIDGE'; |
||||
const LOGIC_MODE_RESTORE_BACKUP = 'RESTORE_BACKUP'; |
||||
|
||||
/** |
||||
* min versions |
||||
*/ |
||||
const SUBSITE_IMPORT_WP_MIN_VERSION = '4.6'; |
||||
|
||||
/** |
||||
* |
||||
* @var int |
||||
*/ |
||||
protected $mode = self::MODE_UNKNOWN; |
||||
|
||||
/** |
||||
* |
||||
* @var string |
||||
*/ |
||||
protected $ovr_wp_content_dir = ''; |
||||
|
||||
/** |
||||
* |
||||
* @var self |
||||
*/ |
||||
private static $instance = null; |
||||
|
||||
/** |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
|
||||
return self::$instance; |
||||
} |
||||
|
||||
private function __construct() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* return installer mode |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getMode() |
||||
{ |
||||
return PrmMng::getInstance()->getValue(PrmMng::PARAM_INSTALLER_MODE); |
||||
} |
||||
|
||||
/** |
||||
* check current installer mode |
||||
* |
||||
* @param bool $onlyIfUnknown // check se state only if is unknow state |
||||
* @param bool $saveParams // if true update params |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function checkState($onlyIfUnknown = true, $saveParams = true) |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
if ($onlyIfUnknown && $paramsManager->getValue(PrmMng::PARAM_INSTALLER_MODE) !== self::MODE_UNKNOWN) { |
||||
return true; |
||||
} |
||||
$isOverwrite = false; |
||||
$nManager = DUPX_NOTICE_MANAGER::getInstance(); |
||||
try { |
||||
if (self::isImportFromBackendMode()) { |
||||
$overwriteData = $this->getOverwriteDataFromParams(); |
||||
} else { |
||||
$overwriteData = $this->getOverwriteDataFromWpConfig(); |
||||
} |
||||
|
||||
if (!empty($overwriteData)) { |
||||
if (!DUPX_DB::testConnection($overwriteData['dbhost'], $overwriteData['dbuser'], $overwriteData['dbpass'], $overwriteData['dbname'])) { |
||||
throw new Exception('wp-config.php exists but database data connection isn\'t valid. Continuing with standard install'); |
||||
} |
||||
|
||||
$isOverwrite = true; |
||||
|
||||
if (!self::isImportFromBackendMode()) { |
||||
//Add additional overwrite data for standard installs |
||||
$overwriteData['adminUsers'] = $this->getAdminUsersOnOverwriteDatabase($overwriteData); |
||||
$overwriteData['wpVersion'] = $this->getWordPressVersionOverwrite(); |
||||
$this->updateOverwriteDataFromDb($overwriteData); |
||||
} |
||||
} |
||||
} catch (Exception $e) { |
||||
Log::logException($e); |
||||
$longMsg = "Exception message: " . $e->getMessage() . "\n\n"; |
||||
$nManager->addNextStepNotice(array( |
||||
'shortMsg' => 'wp-config.php exists but isn\'t valid. Continue on standard install.', |
||||
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING, |
||||
'longMsg' => $longMsg, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE |
||||
)); |
||||
$nManager->saveNotices(); |
||||
} catch (Error $e) { |
||||
Log::logException($e); |
||||
$longMsg = "Exception message: " . $e->getMessage() . "\n\n"; |
||||
$nManager->addNextStepNotice(array( |
||||
'shortMsg' => 'wp-config.php exists but isn\'t valid. Continue on standard install.', |
||||
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING, |
||||
'longMsg' => $longMsg, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE |
||||
)); |
||||
$nManager->saveNotices(); |
||||
} |
||||
|
||||
|
||||
if ($isOverwrite) { |
||||
$paramsManager->setValue(PrmMng::PARAM_INSTALLER_MODE, self::MODE_OVR_INSTALL); |
||||
$paramsManager->setValue(PrmMng::PARAM_OVERWRITE_SITE_DATA, $overwriteData); |
||||
} else { |
||||
$paramsManager->setValue(PrmMng::PARAM_INSTALLER_MODE, self::MODE_STD_INSTALL); |
||||
} |
||||
|
||||
if ($saveParams) { |
||||
return $this->save(); |
||||
} else { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param int $type |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function installTypeToString($type = null) |
||||
{ |
||||
if (is_null($type)) { |
||||
$type = self::getInstType(); |
||||
} |
||||
switch ($type) { |
||||
case self::INSTALL_SINGLE_SITE: |
||||
return 'single site'; |
||||
case self::INSTALL_SINGLE_SITE_ON_SUBDOMAIN: |
||||
return 'single site on subdomain multisite'; |
||||
case self::INSTALL_SINGLE_SITE_ON_SUBFOLDER: |
||||
return 'single site on subfolder multisite'; |
||||
case self::INSTALL_RBACKUP_SINGLE_SITE: |
||||
return 'restore single site'; |
||||
case self::INSTALL_NOT_SET: |
||||
return 'NOT SET'; |
||||
default: |
||||
throw new Exception('Invalid installer mode'); |
||||
} |
||||
} |
||||
|
||||
public static function overwriteDataDefault() |
||||
{ |
||||
return array( |
||||
'dupVersion' => '0', |
||||
'wpVersion' => '0', |
||||
'dbhost' => '', |
||||
'dbname' => '', |
||||
'dbuser' => '', |
||||
'dbpass' => '', |
||||
'table_prefix' => '', |
||||
'restUrl' => '', |
||||
'restNonce' => '', |
||||
'restAuthUser' => '', |
||||
'restAuthPassword' => '', |
||||
'ustatIdentifier' => '', |
||||
'isMultisite' => false, |
||||
'subdomain' => false, |
||||
'subsites' => array(), |
||||
'nextSubsiteIdAI' => -1, |
||||
'adminUsers' => array(), |
||||
'paths' => array(), |
||||
'urls' => array() |
||||
); |
||||
} |
||||
|
||||
protected function getOverwriteDataFromParams() |
||||
{ |
||||
$overwriteData = PrmMng::getInstance()->getValue(PrmMng::PARAM_OVERWRITE_SITE_DATA); |
||||
if (empty($overwriteData)) { |
||||
return false; |
||||
} |
||||
|
||||
if (!isset($overwriteData['dbhost']) || !isset($overwriteData['dbname']) || !isset($overwriteData['dbuser']) || !isset($overwriteData['dbpass'])) { |
||||
return false; |
||||
} |
||||
|
||||
return array_merge(self::overwriteDataDefault(), $overwriteData); |
||||
} |
||||
|
||||
protected function getOverwriteDataFromWpConfig() |
||||
{ |
||||
if (($wpConfigPath = DUPX_ServerConfig::getWpConfigLocalStoredPath()) === false) { |
||||
$wpConfigPath = DUPX_WPConfig::getWpConfigPath(); |
||||
if (!file_exists($wpConfigPath)) { |
||||
$wpConfigPath = DUPX_WPConfig::getWpConfigDeafultPath(); |
||||
} |
||||
} |
||||
|
||||
$overwriteData = false; |
||||
|
||||
Log::info('CHECK STATE INSTALLER WP CONFIG PATH: ' . Log::v2str($wpConfigPath), Log::LV_DETAILED); |
||||
|
||||
if (!file_exists($wpConfigPath)) { |
||||
return $overwriteData; |
||||
} |
||||
|
||||
$nManager = DUPX_NOTICE_MANAGER::getInstance(); |
||||
try { |
||||
if (DUPX_WPConfig::getLocalConfigTransformer() === false) { |
||||
throw new Exception('wp-config.php exist but isn\'t valid. continue on standard install'); |
||||
} |
||||
|
||||
$overwriteData = array_merge( |
||||
self::overwriteDataDefault(), |
||||
array( |
||||
'dbhost' => DUPX_WPConfig::getValueFromLocalWpConfig('DB_HOST'), |
||||
'dbname' => DUPX_WPConfig::getValueFromLocalWpConfig('DB_NAME'), |
||||
'dbuser' => DUPX_WPConfig::getValueFromLocalWpConfig('DB_USER'), |
||||
'dbpass' => DUPX_WPConfig::getValueFromLocalWpConfig('DB_PASSWORD'), |
||||
'table_prefix' => DUPX_WPConfig::getValueFromLocalWpConfig('table_prefix', 'variable') |
||||
) |
||||
); |
||||
|
||||
if (DUPX_WPConfig::getValueFromLocalWpConfig('MULTISITE', 'constant', false)) { |
||||
$overwriteData['isMultisite'] = true; |
||||
$overwriteData['subdomain'] = DUPX_WPConfig::getValueFromLocalWpConfig('SUBDOMAIN_INSTALL', 'constant', false); |
||||
} |
||||
} catch (Exception $e) { |
||||
$overwriteData = false; |
||||
Log::logException($e); |
||||
$longMsg = "Exception message: " . $e->getMessage() . "\n\n"; |
||||
$nManager->addNextStepNotice(array( |
||||
'shortMsg' => 'wp-config.php exists but isn\'t valid. Continue on standard install.', |
||||
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING, |
||||
'longMsg' => $longMsg, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE |
||||
)); |
||||
$nManager->saveNotices(); |
||||
} catch (Error $e) { |
||||
$overwriteData = false; |
||||
Log::logException($e); |
||||
$longMsg = "Exception message: " . $e->getMessage() . "\n\n"; |
||||
$nManager->addNextStepNotice(array( |
||||
'shortMsg' => 'wp-config.php exists but isn\'t valid. Continue on standard install.', |
||||
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING, |
||||
'longMsg' => $longMsg, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE |
||||
)); |
||||
$nManager->saveNotices(); |
||||
} |
||||
|
||||
return $overwriteData; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function isRestoreBackup($type = null) |
||||
{ |
||||
return self::isInstType( |
||||
array( |
||||
self::INSTALL_RBACKUP_SINGLE_SITE |
||||
), |
||||
$type |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function isImportFromBackendMode() |
||||
{ |
||||
$template = PrmMng::getInstance()->getValue(PrmMng::PARAM_TEMPLATE); |
||||
return ($template === DUPX_Template::TEMPLATE_IMPORT_BASE || |
||||
$template === DUPX_Template::TEMPLATE_IMPORT_ADVANCED); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function isClassicInstall() |
||||
{ |
||||
return (!self::isImportFromBackendMode()); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param int|array $type |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function instTypeAvaiable($type) |
||||
{ |
||||
$acceptList = ParamDescConfigs::getInstallTypesAcceptValues(); |
||||
$typesToCheck = is_array($type) ? $type : array($type); |
||||
$typesAvaliables = array_intersect($acceptList, $typesToCheck); |
||||
return (count($typesAvaliables) > 0); |
||||
} |
||||
|
||||
/** |
||||
* this function in case of an error returns an empty array but never generates exceptions |
||||
* |
||||
* @param string $overwriteData |
||||
* |
||||
* @return array |
||||
*/ |
||||
protected function getAdminUsersOnOverwriteDatabase($overwriteData) |
||||
{ |
||||
$adminUsers = array(); |
||||
try { |
||||
$dbFuncs = DUPX_DB_Functions::getInstance(); |
||||
|
||||
if (!$dbFuncs->dbConnection($overwriteData)) { |
||||
Log::info('GET USERS ON CURRENT DATABASE FAILED. Can\'t connect'); |
||||
return $adminUsers; |
||||
} |
||||
|
||||
$usersTables = array( |
||||
$dbFuncs->getUserTableName($overwriteData['table_prefix']), |
||||
$dbFuncs->getUserMetaTableName($overwriteData['table_prefix']) |
||||
); |
||||
|
||||
if (!$dbFuncs->tablesExist($usersTables)) { |
||||
Log::info('GET USERS ON CURRENT DATABASE FAILED. Users tables doesn\'t exist, continue with orverwrite installation but with option keep users disabled' . "\n"); |
||||
$dbFuncs->closeDbConnection(); |
||||
return $adminUsers; |
||||
} |
||||
|
||||
if (($adminUsers = $dbFuncs->getAdminUsers($overwriteData['table_prefix'])) === false) { |
||||
Log::info('GET USERS ON CURRENT DATABASE FAILED. OVERWRITE DB USERS NOT FOUND'); |
||||
$dbFuncs->closeDbConnection(); |
||||
return $adminUsers; |
||||
} |
||||
|
||||
$dbFuncs->closeDbConnection(); |
||||
} catch (Exception $e) { |
||||
Log::logException($e, Log::LV_DEFAULT, 'GET ADMIN USER EXECPTION BUT CONTINUE'); |
||||
} catch (Error $e) { |
||||
Log::logException($e, Log::LV_DEFAULT, 'GET ADMIN USER EXECPTION BUT CONTINUE'); |
||||
} |
||||
|
||||
return $adminUsers; |
||||
} |
||||
|
||||
/** |
||||
* Returns the WP version from the ./wp-includes/version.php file if it exists, otherwise '0' |
||||
* |
||||
* @return string WP version |
||||
*/ |
||||
protected function getWordPressVersionOverwrite() |
||||
{ |
||||
$wp_version = '0'; |
||||
try { |
||||
$versionFilePath = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_WP_CORE_NEW) . "/wp-includes/version.php"; |
||||
if (!file_exists($versionFilePath) || !is_readable($versionFilePath)) { |
||||
Log::info("WordPress Version file does not exist or is not readable at path: {$versionFilePath}"); |
||||
return $wp_version; |
||||
} |
||||
|
||||
include($versionFilePath); |
||||
return $wp_version; |
||||
} catch (Exception $e) { |
||||
Log::logException($e, Log::LV_DEFAULT, 'EXCEPTION GETTING WORDPRESS VERSION, BUT CONTINUE'); |
||||
} catch (Error $e) { |
||||
Log::logException($e, Log::LV_DEFAULT, 'ERROR GETTING WORDPRESS VERSION, BUT CONTINUE'); |
||||
} |
||||
|
||||
return $wp_version; |
||||
} |
||||
|
||||
/** |
||||
* Returns the Duplicator Pro version if it exists, otherwise '0' |
||||
* |
||||
* @param array<string, mixed> $overwriteData Overwrite data |
||||
* |
||||
* @return bool True on success, false on failure |
||||
*/ |
||||
protected function updateOverwriteDataFromDb(&$overwriteData) |
||||
{ |
||||
try { |
||||
$dbFuncs = null; |
||||
$dbFuncs = DUPX_DB_Functions::getInstance(); |
||||
|
||||
if (!$dbFuncs->dbConnection($overwriteData)) { |
||||
throw new Exception('GET DUPLICATOR VERSION ON CURRENT DATABASE FAILED. Can\'t connect'); |
||||
} |
||||
|
||||
$optionsTable = DUPX_DB_Functions::getOptionsTableName($overwriteData['table_prefix']); |
||||
|
||||
if (!$dbFuncs->tablesExist($optionsTable)) { |
||||
throw new Exception("GET DUPLICATOR VERSION ON CURRENT DATABASE FAILED. Options tables doesn't exist.\n"); |
||||
} |
||||
|
||||
$duplicatorProVersion = $dbFuncs->getDuplicatorVersion($overwriteData['table_prefix']); |
||||
|
||||
$overwriteData['dupVersion'] = (empty($duplicatorProVersion) ? '0' : $duplicatorProVersion); |
||||
$overwriteData['ustatIdentifier'] = $dbFuncs->getUstatIdentifier($overwriteData['table_prefix']); |
||||
} catch (Exception $e) { |
||||
if ($dbFuncs instanceof DUPX_DB_Functions) { |
||||
$dbFuncs->closeDbConnection(); |
||||
} |
||||
Log::logException($e, Log::LV_DEFAULT, 'GET DUPLICATOR VERSION EXECPTION BUT CONTINUE'); |
||||
return false; |
||||
} catch (Error $e) { |
||||
if ($dbFuncs instanceof DUPX_DB_Functions) { |
||||
$dbFuncs->closeDbConnection(); |
||||
} |
||||
Log::logException($e, Log::LV_DEFAULT, 'GET DUPLICATOR VERSION ERROR BUT CONTINUE'); |
||||
return false; |
||||
} |
||||
|
||||
if ($dbFuncs instanceof DUPX_DB_Functions) { |
||||
$dbFuncs->closeDbConnection(); |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* getHtmlModeHeader |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getHtmlModeHeader() |
||||
{ |
||||
$php_enforced_txt = ($GLOBALS['DUPX_ENFORCE_PHP_INI']) ? '<i style="color:red"><br/>*PHP ini enforced*</i>' : ''; |
||||
$db_only_txt = (DUPX_ArchiveConfig::getInstance()->exportOnlyDB) ? ' - Database Only' : ''; |
||||
$db_only_txt = $db_only_txt . $php_enforced_txt; |
||||
|
||||
switch ($this->getMode()) { |
||||
case self::MODE_OVR_INSTALL: |
||||
$label = 'Overwrite Install'; |
||||
$class = 'dupx-overwrite mode_overwrite'; |
||||
break; |
||||
case self::MODE_STD_INSTALL: |
||||
$label = 'Standard Install'; |
||||
$class = 'dupx-overwrite mode_standard'; |
||||
break; |
||||
case self::MODE_UNKNOWN: |
||||
default: |
||||
$label = 'Unknown'; |
||||
$class = 'mode_unknown'; |
||||
break; |
||||
} |
||||
|
||||
if (strlen($db_only_txt)) { |
||||
return "<span class='{$class}'>{$label} {$db_only_txt}</span>"; |
||||
} else { |
||||
return "<span class='{$class}'>{$label}</span>"; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* reset current mode |
||||
* |
||||
* @param boolean $saveParams |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function resetState($saveParams = true) |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$paramsManager->setValue(PrmMng::PARAM_INSTALLER_MODE, self::MODE_UNKNOWN); |
||||
if ($saveParams) { |
||||
return $this->save(); |
||||
} else { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* save current installer state |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public function save() |
||||
{ |
||||
return PrmMng::getInstance()->save(); |
||||
} |
||||
|
||||
/** |
||||
* Return stru if is overwrite install |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public static function isOverwrite() |
||||
{ |
||||
return (PrmMng::getInstance()->getValue(PrmMng::PARAM_INSTALLER_MODE) === self::MODE_OVR_INSTALL); |
||||
} |
||||
|
||||
/** |
||||
* this function returns true if both the URL and path old and new path are identical |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function isInstallerCreatedInThisLocation() |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
$urlNew = null; |
||||
$pathNew = null; |
||||
|
||||
if (DUPX_InstallerState::isImportFromBackendMode()) { |
||||
$overwriteData = $paramsManager->getValue(PrmMng::PARAM_OVERWRITE_SITE_DATA); |
||||
if (isset($overwriteData['urls']['home']) && isset($overwriteData['paths']['home'])) { |
||||
$urlNew = $overwriteData['urls']['home']; |
||||
$pathNew = $overwriteData['paths']['home']; |
||||
} |
||||
} |
||||
|
||||
if (is_null($urlNew) || is_null($pathNew)) { |
||||
$pathNew = $paramsManager->getValue(PrmMng::PARAM_PATH_NEW); |
||||
$urlNew = $paramsManager->getValue(PrmMng::PARAM_URL_NEW); |
||||
} |
||||
|
||||
return self::urlAndPathAreSameOfArchive($urlNew, $pathNew); |
||||
} |
||||
|
||||
/** |
||||
* isSameLocationOfArtiche |
||||
* |
||||
* @param string $urlNew |
||||
* @param string $pathNew |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function urlAndPathAreSameOfArchive($urlNew, $pathNew) |
||||
{ |
||||
$archiveConfig = \DUPX_ArchiveConfig::getInstance(); |
||||
$urlOld = rtrim($archiveConfig->getRealValue('homeUrl'), '/'); |
||||
$paths = $archiveConfig->getRealValue('archivePaths'); |
||||
$pathOld = $paths->home; |
||||
$paths = $archiveConfig->getRealValue('originalPaths'); |
||||
$pathOldOrig = $paths->home; |
||||
|
||||
$urlNew = SnapIO::untrailingslashit($urlNew); |
||||
$urlOld = SnapIO::untrailingslashit($urlOld); |
||||
$pathNew = SnapIO::untrailingslashit($pathNew); |
||||
$pathOld = SnapIO::untrailingslashit($pathOld); |
||||
$pathOldOrig = SnapIO::untrailingslashit($pathOldOrig); |
||||
|
||||
return (($pathNew === $pathOld || $pathNew === $pathOldOrig) && $urlNew === $urlOld); |
||||
} |
||||
|
||||
/** |
||||
* get migration data to store in wp-options |
||||
* |
||||
* @return array |
||||
*/ |
||||
public static function getMigrationData() |
||||
{ |
||||
$sec = DUPX_Security::getInstance(); |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$ac = DUPX_ArchiveConfig::getInstance(); |
||||
$overwriteData = $paramsManager->getValue(PrmMng::PARAM_OVERWRITE_SITE_DATA); |
||||
|
||||
return array( |
||||
'plugin' => 'dup-lite', |
||||
'installerVersion' => DUPX_VERSION, |
||||
'installType' => $paramsManager->getValue(PrmMng::PARAM_INST_TYPE), |
||||
'logicModes' => self::getLogicModes(), |
||||
'template' => PrmMng::getInstance()->getValue(PrmMng::PARAM_TEMPLATE), |
||||
'restoreBackupMode' => self::isRestoreBackup(), |
||||
'recoveryMode' => false, |
||||
'archivePath' => $sec->getArchivePath(), |
||||
'packageHash' => DUPX_Package::getPackageHash(), |
||||
'installerPath' => $sec->getBootFilePath(), |
||||
'installerBootLog' => $sec->getBootLogFile(), |
||||
'installerLog' => Log::getLogFilePath(), |
||||
'dupInstallerPath' => DUPX_INIT, |
||||
'origFileFolderPath' => DUPX_Orig_File_Manager::getInstance()->getMainFolder(), |
||||
'safeMode' => $paramsManager->getValue(PrmMng::PARAM_SAFE_MODE), |
||||
'cleanInstallerFiles' => $paramsManager->getValue(PrmMng::PARAM_AUTO_CLEAN_INSTALLER_FILES), |
||||
'licenseType' => $ac->license_type, |
||||
'phpVersion' => $ac->version_php, |
||||
'archiveType' => $ac->isZipArchive() ? 'zip' : 'dup', |
||||
'siteSize' => $ac->fileInfo->size, |
||||
'siteNumFiles' => ($ac->fileInfo->dirCount + $ac->fileInfo->fileCount), |
||||
'siteDbSize' => $ac->dbInfo->tablesSizeOnDisk, |
||||
'siteDBNumTables' => $ac->dbInfo->tablesFinalCount, |
||||
'components' => $ac->components, |
||||
'ustatIdentifier' => $overwriteData['ustatIdentifier'], |
||||
'time' => time() |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getAdminLogin() |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$archiveConfig = \DUPX_ArchiveConfig::getInstance(); |
||||
$adminUrl = rtrim($paramsManager->getValue(PrmMng::PARAM_SITE_URL), "/"); |
||||
$sourceAdminUrl = rtrim($archiveConfig->getRealValue("siteUrl"), "/"); |
||||
$sourceLoginUrl = $archiveConfig->getRealValue("loginUrl"); |
||||
$relLoginUrl = substr($sourceLoginUrl, strlen($sourceAdminUrl)); |
||||
$loginUrl = $adminUrl . $relLoginUrl; |
||||
return $loginUrl; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return int |
||||
*/ |
||||
public static function getInstType() |
||||
{ |
||||
return PrmMng::getInstance()->getValue(PrmMng::PARAM_INST_TYPE); |
||||
} |
||||
|
||||
/** |
||||
* @param int|array $type list of types to check |
||||
* @param int $typeToCheck if is null get param install time or check this |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function isInstType($type, $typeToCheck = null) |
||||
{ |
||||
$currentType = is_null($typeToCheck) ? self::getInstType() : $typeToCheck; |
||||
if (is_array($type)) { |
||||
return in_array($currentType, $type); |
||||
} else { |
||||
return $currentType === $type; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Get install logic modes |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public static function getLogicModes() |
||||
{ |
||||
$modes = array(); |
||||
if (self::isImportFromBackendMode()) { |
||||
$modes[] = self::LOGIC_MODE_IMPORT; |
||||
} |
||||
if (self::isClassicInstall()) { |
||||
$modes[] = self::LOGIC_MODE_CLASSIC; |
||||
} |
||||
if (self::isOverwrite()) { |
||||
$modes[] = self::LOGIC_MODE_OVERWRITE; |
||||
} |
||||
if (self::isRestoreBackup()) { |
||||
$modes[] = self::LOGIC_MODE_RESTORE_BACKUP; |
||||
} |
||||
return $modes; |
||||
} |
||||
} |
@ -1,245 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Class used to update and edit web server configuration files |
||||
* for .htaccess, web.config and user.ini |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Crypt |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Bootstrap; |
||||
|
||||
/** |
||||
* Package related functions |
||||
*/ |
||||
final class DUPX_Package |
||||
{ |
||||
/** |
||||
* |
||||
* @staticvar bool|string $packageHash |
||||
* @return bool|string false if fail |
||||
* @throws Exception |
||||
*/ |
||||
public static function getPackageHash() |
||||
{ |
||||
static $packageHash = null; |
||||
if (is_null($packageHash)) { |
||||
if (($packageHash = Bootstrap::getPackageHash()) === false) { |
||||
throw new Exception('PACKAGE ERROR: can\'t find package hash'); |
||||
} |
||||
} |
||||
return $packageHash; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string $fileHash |
||||
* @return string |
||||
*/ |
||||
public static function getArchiveFileHash() |
||||
{ |
||||
static $fileHash = null; |
||||
|
||||
if (is_null($fileHash)) { |
||||
$fileHash = preg_replace('/^.+_([a-z0-9]+)_[0-9]{14}_archive\.(?:daf|zip)$/', '$1', DUPX_Security::getInstance()->getArchivePath()); |
||||
} |
||||
|
||||
return $fileHash; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string $archivePath |
||||
* @return bool|string false if fail |
||||
* @throws Exception |
||||
*/ |
||||
public static function getPackageArchivePath() |
||||
{ |
||||
static $archivePath = null; |
||||
if (is_null($archivePath)) { |
||||
$path = DUPX_INIT . '/' . Bootstrap::ARCHIVE_PREFIX . self::getPackageHash() . Bootstrap::ARCHIVE_EXTENSION; |
||||
if (!file_exists($path)) { |
||||
throw new Exception('PACKAGE ERROR: can\'t read package path: ' . $path); |
||||
} else { |
||||
$archivePath = $path; |
||||
} |
||||
} |
||||
return $archivePath; |
||||
} |
||||
|
||||
/** |
||||
* Returns a save-to-edit wp-config file |
||||
* |
||||
* @return string |
||||
* @throws Exception |
||||
*/ |
||||
public static function getWpconfigArkPath() |
||||
{ |
||||
return DUPX_Orig_File_Manager::getInstance()->getEntryStoredPath(DUPX_ServerConfig::CONFIG_ORIG_FILE_WPCONFIG_ID); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
* @throws Exception |
||||
*/ |
||||
public static function getManualExtractFile() |
||||
{ |
||||
return DUPX_INIT . '/dup-manual-extract__' . self::getPackageHash(); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar type $path |
||||
* @return string |
||||
*/ |
||||
public static function getWpconfigSamplePath() |
||||
{ |
||||
static $path = null; |
||||
if (is_null($path)) { |
||||
$path = DUPX_INIT . '/assets/wp-config-sample.php'; |
||||
} |
||||
return $path; |
||||
} |
||||
|
||||
/** |
||||
* Get sql file relative path |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getSqlFilePathInArchive() |
||||
{ |
||||
return 'dup-installer/dup-database__' . self::getPackageHash() . '.sql'; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string $path |
||||
* @return string |
||||
*/ |
||||
public static function getSqlFilePath() |
||||
{ |
||||
static $path = null; |
||||
if (is_null($path)) { |
||||
$path = DUPX_INIT . '/dup-database__' . self::getPackageHash() . '.sql'; |
||||
} |
||||
return $path; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string $dirsPath |
||||
* @return string |
||||
*/ |
||||
public static function getDirsListPath() |
||||
{ |
||||
static $path = null; |
||||
if (is_null($path)) { |
||||
$path = DUPX_INIT . '/dup-scanned-dirs__' . self::getPackageHash() . '.txt'; |
||||
} |
||||
return $path; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string $dirsPath |
||||
* @return string |
||||
*/ |
||||
public static function getFilesListPath() |
||||
{ |
||||
static $path = null; |
||||
if (is_null($path)) { |
||||
$path = DUPX_INIT . '/dup-scanned-files__' . self::getPackageHash() . '.txt'; |
||||
} |
||||
return $path; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string $path |
||||
* @return string |
||||
*/ |
||||
public static function getScanJsonPath() |
||||
{ |
||||
static $path = null; |
||||
if (is_null($path)) { |
||||
$path = DUPX_INIT . '/dup-scan__' . self::getPackageHash() . '.json'; |
||||
} |
||||
return $path; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return int |
||||
*/ |
||||
public static function getSqlFileSize() |
||||
{ |
||||
return (is_readable(self::getSqlFilePath())) ? (int) filesize(self::getSqlFilePath()) : 0; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param callable $callback |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public static function foreachDirCallback($callback) |
||||
{ |
||||
if (!is_callable($callback)) { |
||||
throw new Exception('Not valid callback'); |
||||
} |
||||
|
||||
$dirFiles = DUPX_Package::getDirsListPath(); |
||||
|
||||
if (($handle = fopen($dirFiles, "r")) === false) { |
||||
throw new Exception('Can\'t open dirs file list'); |
||||
} |
||||
|
||||
while (($line = fgets($handle)) !== false) { |
||||
if (($info = json_decode($line)) === null) { |
||||
throw new Exception('Invalid json line in dirs file: ' . $line); |
||||
} |
||||
|
||||
call_user_func($callback, $info); |
||||
} |
||||
|
||||
fclose($handle); |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param callable $callback |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public static function foreachFileCallback($callback) |
||||
{ |
||||
if (!is_callable($callback)) { |
||||
throw new Exception('Not valid callback'); |
||||
} |
||||
|
||||
$filesPath = DUPX_Package::getFilesListPath(); |
||||
|
||||
if (($handle = fopen($filesPath, "r")) === false) { |
||||
throw new Exception('Can\'t open files file list'); |
||||
} |
||||
|
||||
while (($line = fgets($handle)) !== false) { |
||||
if (($info = json_decode($line)) === null) { |
||||
throw new Exception('Invalid json line in files file: ' . $line); |
||||
} |
||||
|
||||
call_user_func($callback, $info); |
||||
} |
||||
|
||||
fclose($handle); |
||||
return true; |
||||
} |
||||
} |
@ -1,233 +0,0 @@ |
||||
<?php |
||||
|
||||
# |
||||
# Portable PHP password hashing framework. |
||||
# |
||||
# Version 0.5 / genuine. |
||||
# |
||||
# Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in |
||||
# the public domain. Revised in subsequent years, still public domain. |
||||
# |
||||
# There's absolutely no warranty. |
||||
# |
||||
# The homepage URL for this framework is: |
||||
# |
||||
# http://www.openwall.com/phpass/ |
||||
# |
||||
# Please be sure to update the Version line if you edit this file in any way. |
||||
# It is suggested that you leave the main version number intact, but indicate |
||||
# your project name (after the slash) and add your own revision information. |
||||
# |
||||
# Please do not change the "private" password hashing method implemented in |
||||
# here, thereby making your hashes incompatible. However, if you must, please |
||||
# change the hash type identifier (the "$P$") to something different. |
||||
# |
||||
# Obviously, since this code is in the public domain, the above are not |
||||
# requirements (there can be none), but merely suggestions. |
||||
# |
||||
class DUPX_PasswordHash |
||||
{ |
||||
public $itoa64; |
||||
public $iteration_count_log2; |
||||
public $portable_hashes; |
||||
public $random_state; |
||||
|
||||
public function __construct($iteration_count_log2, $portable_hashes) |
||||
{ |
||||
$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
||||
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) { |
||||
$iteration_count_log2 = 8; |
||||
} |
||||
$this->iteration_count_log2 = $iteration_count_log2; |
||||
$this->portable_hashes = $portable_hashes; |
||||
$this->random_state = microtime(); |
||||
if (function_exists('getmypid')) { |
||||
$this->random_state .= getmypid(); |
||||
} |
||||
} |
||||
|
||||
public function PasswordHash($iteration_count_log2, $portable_hashes) |
||||
{ |
||||
self::__construct($iteration_count_log2, $portable_hashes); |
||||
} |
||||
|
||||
public function get_random_bytes($count) |
||||
{ |
||||
$output = ''; |
||||
if ( |
||||
@is_readable('/dev/urandom') && |
||||
($fh = @fopen('/dev/urandom', 'rb')) |
||||
) { |
||||
$output = fread($fh, $count); |
||||
fclose($fh); |
||||
} |
||||
|
||||
if (strlen($output) < $count) { |
||||
$output = ''; |
||||
for ($i = 0; $i < $count; $i += 16) { |
||||
$this->random_state = |
||||
md5(microtime() . $this->random_state); |
||||
$output .= md5($this->random_state, true); |
||||
} |
||||
$output = substr($output, 0, $count); |
||||
} |
||||
|
||||
return $output; |
||||
} |
||||
|
||||
public function encode64($input, $count) |
||||
{ |
||||
$output = ''; |
||||
$i = 0; |
||||
do { |
||||
$value = ord($input[$i++]); |
||||
$output .= $this->itoa64[$value & 0x3f]; |
||||
if ($i < $count) { |
||||
$value |= ord($input[$i]) << 8; |
||||
} |
||||
$output .= $this->itoa64[($value >> 6) & 0x3f]; |
||||
if ($i++ >= $count) { |
||||
break; |
||||
} |
||||
if ($i < $count) { |
||||
$value |= ord($input[$i]) << 16; |
||||
} |
||||
$output .= $this->itoa64[($value >> 12) & 0x3f]; |
||||
if ($i++ >= $count) { |
||||
break; |
||||
} |
||||
$output .= $this->itoa64[($value >> 18) & 0x3f]; |
||||
} while ($i < $count); |
||||
return $output; |
||||
} |
||||
|
||||
public function gensalt_private($input) |
||||
{ |
||||
$output = '$P$'; |
||||
$output .= $this->itoa64[min($this->iteration_count_log2 + |
||||
((PHP_VERSION >= '5') ? 5 : 3), 30)]; |
||||
$output .= $this->encode64($input, 6); |
||||
return $output; |
||||
} |
||||
|
||||
public function crypt_private($password, $setting) |
||||
{ |
||||
$output = '*0'; |
||||
if (substr($setting, 0, 2) === $output) { |
||||
$output = '*1'; |
||||
} |
||||
|
||||
$id = substr($setting, 0, 3); |
||||
# We use "$P$", phpBB3 uses "$H$" for the same thing |
||||
if ($id !== '$P$' && $id !== '$H$') { |
||||
return $output; |
||||
} |
||||
|
||||
$count_log2 = strpos($this->itoa64, $setting[3]); |
||||
if ($count_log2 < 7 || $count_log2 > 30) { |
||||
return $output; |
||||
} |
||||
|
||||
$count = 1 << $count_log2; |
||||
$salt = substr($setting, 4, 8); |
||||
if (strlen($salt) !== 8) { |
||||
return $output; |
||||
} |
||||
|
||||
# We were kind of forced to use MD5 here since it's the only |
||||
# cryptographic primitive that was available in all versions |
||||
# of PHP in use. To implement our own low-level crypto in PHP |
||||
# would have resulted in much worse performance and |
||||
# consequently in lower iteration counts and hashes that are |
||||
# quicker to crack (by non-PHP code). |
||||
$hash = md5($salt . $password, true); |
||||
do { |
||||
$hash = md5($hash . $password, true); |
||||
} while (--$count); |
||||
$output = substr($setting, 0, 12); |
||||
$output .= $this->encode64($hash, 16); |
||||
return $output; |
||||
} |
||||
|
||||
public function gensalt_blowfish($input) |
||||
{ |
||||
# This one needs to use a different order of characters and a |
||||
# different encoding scheme from the one in encode64() above. |
||||
# We care because the last character in our encoded string will |
||||
# only represent 2 bits. While two known implementations of |
||||
# bcrypt will happily accept and correct a salt string which |
||||
# has the 4 unused bits set to non-zero, we do not want to take |
||||
# chances and we also do not want to waste an additional byte |
||||
# of entropy. |
||||
$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; |
||||
$output = '$2a$'; |
||||
$output .= chr(ord('0') + $this->iteration_count_log2 / 10); |
||||
$output .= chr(ord('0') + $this->iteration_count_log2 % 10); |
||||
$output .= '$'; |
||||
$i = 0; |
||||
do { |
||||
$c1 = ord($input[$i++]); |
||||
$output .= $itoa64[$c1 >> 2]; |
||||
$c1 = ($c1 & 0x03) << 4; |
||||
if ($i >= 16) { |
||||
$output .= $itoa64[$c1]; |
||||
break; |
||||
} |
||||
|
||||
$c2 = ord($input[$i++]); |
||||
$c1 |= $c2 >> 4; |
||||
$output .= $itoa64[$c1]; |
||||
$c1 = ($c2 & 0x0f) << 2; |
||||
$c2 = ord($input[$i++]); |
||||
$c1 |= $c2 >> 6; |
||||
$output .= $itoa64[$c1]; |
||||
$output .= $itoa64[$c2 & 0x3f]; |
||||
} while (1); |
||||
return $output; |
||||
} |
||||
|
||||
public function HashPassword($password) |
||||
{ |
||||
$random = ''; |
||||
if (CRYPT_BLOWFISH === 1 && !$this->portable_hashes) { |
||||
$random = $this->get_random_bytes(16); |
||||
$hash = |
||||
crypt($password, $this->gensalt_blowfish($random)); |
||||
if (strlen($hash) === 60) { |
||||
return $hash; |
||||
} |
||||
} |
||||
|
||||
if (strlen($random) < 6) { |
||||
$random = $this->get_random_bytes(6); |
||||
} |
||||
$hash = |
||||
$this->crypt_private( |
||||
$password, |
||||
$this->gensalt_private($random) |
||||
); |
||||
if (strlen($hash) === 34) { |
||||
return $hash; |
||||
} |
||||
|
||||
# Returning '*' on error is safe here, but would _not_ be safe |
||||
# in a crypt(3)-like function used _both_ for generating new |
||||
# hashes and for validating passwords against existing hashes. |
||||
return '*'; |
||||
} |
||||
|
||||
public function CheckPassword($password, $stored_hash) |
||||
{ |
||||
// IMPORTANT - PHP 5.2 may bomb out at the crypt call |
||||
$hash = $this->crypt_private($password, $stored_hash); |
||||
if ($hash[0] === '*') { |
||||
$hash = crypt($password, $stored_hash); |
||||
} |
||||
|
||||
# This is not constant-time. In order to keep the code simple, |
||||
# for timing safety we currently rely on the salts being |
||||
# unpredictable, which they are at least in the non-fallback |
||||
# cases (that is, when we use /dev/urandom and bcrypt). |
||||
return $hash === $stored_hash; |
||||
} |
||||
} |
@ -1,160 +0,0 @@ |
||||
<?php |
||||
|
||||
defined("DUPXABSPATH") or die(""); |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapIO; |
||||
use Duplicator\Libs\Snap\SnapWP; |
||||
|
||||
/** |
||||
* DUPX_cPanel |
||||
* Wrapper Class for cPanel API */ |
||||
class DUPX_Server |
||||
{ |
||||
/** |
||||
* A list of the core WordPress directories |
||||
*/ |
||||
public static $wpCoreDirsList = array( |
||||
'wp-admin', |
||||
'wp-includes' |
||||
); |
||||
|
||||
public static function phpSafeModeOn() |
||||
{ |
||||
if (version_compare(PHP_VERSION, '5.4.0', '>=')) { |
||||
// safe_mode has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. |
||||
return false; |
||||
} else { |
||||
return filter_var( |
||||
ini_get('safe_mode'), |
||||
FILTER_VALIDATE_BOOLEAN, |
||||
array( |
||||
'options' => array( |
||||
'default' => false |
||||
) |
||||
) |
||||
); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Check given path prefixed with path array |
||||
* |
||||
* @param string $checkPath Path to check |
||||
* @param array $pathsArr check against |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
private static function isPathPrefixedWithArrayPath($checkPath, $pathsArr) |
||||
{ |
||||
foreach ($pathsArr as $path) { |
||||
if (0 === strpos($checkPath, $path)) { |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Can this server process in shell_exec mode |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function is_shell_exec_available() |
||||
{ |
||||
if (array_intersect(array('shell_exec', 'escapeshellarg', 'escapeshellcmd', 'extension_loaded'), array_map('trim', explode(',', @ini_get('disable_functions'))))) { |
||||
return false; |
||||
} |
||||
|
||||
//Suhosin: http://www.hardened-php.net/suhosin/ |
||||
//Will cause PHP to silently fail. |
||||
if (extension_loaded('suhosin')) { |
||||
return false; |
||||
} |
||||
|
||||
if (! function_exists('shell_exec')) { |
||||
return false; |
||||
} |
||||
|
||||
// Can we issue a simple echo command? |
||||
if (!@shell_exec('echo duplicator')) { |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* Returns the path this this server where the zip command can be called |
||||
* |
||||
* @return null|string // null if can't find unzip |
||||
*/ |
||||
public static function get_unzip_filepath() |
||||
{ |
||||
$filepath = null; |
||||
if (self::is_shell_exec_available()) { |
||||
if (shell_exec('hash unzip 2>&1') == null) { |
||||
$filepath = 'unzip'; |
||||
} else { |
||||
$possible_paths = array('/usr/bin/unzip', '/opt/local/bin/unzip'); |
||||
foreach ($possible_paths as $path) { |
||||
if (file_exists($path)) { |
||||
$filepath = $path; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return $filepath; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public static function getWpAddonsSiteLists() |
||||
{ |
||||
$addonsSites = array(); |
||||
$pathsToCheck = DUPX_ArchiveConfig::getInstance()->getPathsMapping(); |
||||
|
||||
if (is_scalar($pathsToCheck)) { |
||||
$pathsToCheck = array($pathsToCheck); |
||||
} |
||||
|
||||
foreach ($pathsToCheck as $mainPath) { |
||||
SnapIO::regexGlobCallback($mainPath, function ($path) use (&$addonsSites) { |
||||
if (SnapWP::isWpHomeFolder($path)) { |
||||
$addonsSites[] = $path; |
||||
} |
||||
}, array( |
||||
'regexFile' => false, |
||||
'recursive' => true |
||||
)); |
||||
} |
||||
|
||||
return $addonsSites; |
||||
} |
||||
|
||||
/** |
||||
* Does the site look to be a WordPress site |
||||
* |
||||
* @return bool Returns true if the site looks like a WP site |
||||
*/ |
||||
public static function isWordPress() |
||||
{ |
||||
$absPathNew = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_WP_CORE_NEW); |
||||
if (!is_dir($absPathNew)) { |
||||
return false; |
||||
} |
||||
if (($root_files = scandir($absPathNew)) == false) { |
||||
return false; |
||||
} |
||||
$file_count = 0; |
||||
foreach ($root_files as $file) { |
||||
if (in_array($file, self::$wpCoreDirsList)) { |
||||
$file_count++; |
||||
} |
||||
} |
||||
return (count(self::$wpCoreDirsList) == $file_count); |
||||
} |
||||
} |
@ -1,782 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Class used to control values about the package meta data |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\ArchiveConfig |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapIO; |
||||
use Duplicator\Libs\Snap\SnapURL; |
||||
use Duplicator\Libs\Snap\SnapDB; |
||||
use Duplicator\Libs\Snap\SnapString; |
||||
use Duplicator\Libs\WpConfig\WPConfigTransformer; |
||||
|
||||
/** |
||||
* singleton class |
||||
*/ |
||||
class DUPX_ArchiveConfig |
||||
{ |
||||
const NOTICE_ID_PARAM_EMPTY = 'param_empty_to_validate'; |
||||
|
||||
// READ-ONLY: COMPARE VALUES |
||||
public $dup_type; |
||||
public $created; |
||||
public $version_dup; |
||||
public $version_wp; |
||||
public $version_db; |
||||
public $version_php; |
||||
public $version_os; |
||||
public $packInfo; |
||||
public $fileInfo; |
||||
public $dbInfo; |
||||
public $wpInfo; |
||||
/** @var int<-1,max> */ |
||||
public $defaultStorageId = -1; |
||||
/** @var string[] */ |
||||
public $components = array(); |
||||
// GENERAL |
||||
public $secure_on; |
||||
public $secure_pass; |
||||
public $installer_base_name = ''; |
||||
public $installer_backup_name = ''; |
||||
public $package_name; |
||||
public $package_hash; |
||||
public $package_notes; |
||||
public $wp_tableprefix; |
||||
public $blogname; |
||||
public $blogNameSafe; |
||||
public $exportOnlyDB; |
||||
//ADV OPTS |
||||
public $opts_delete; |
||||
//MULTISITE |
||||
public $mu_mode; |
||||
public $mu_generation; |
||||
/** @var mixed[] */ |
||||
public $subsites = array(); |
||||
public $main_site_id = 1; |
||||
public $mu_is_filtered; |
||||
public $mu_siteadmins = array(); |
||||
//LICENSING |
||||
/** @var int<0, max> */ |
||||
public $license_limit = 0; |
||||
/** @var int ENUM LICENSE TYPE */ |
||||
public $license_type = 0; |
||||
//PARAMS |
||||
public $overwriteInstallerParams = array(); |
||||
/** @var ?string */ |
||||
public $dbhost = null; |
||||
/** @var ?string */ |
||||
public $dbname = null; |
||||
/** @var ?string */ |
||||
public $dbuser = null; |
||||
/** @var object */ |
||||
public $brand = null; |
||||
/** @var ?string */ |
||||
public $cpnl_host; |
||||
/** @var ?string */ |
||||
public $cpnl_user; |
||||
/** @var ?string */ |
||||
public $cpnl_pass; |
||||
/** @var ?string */ |
||||
public $cpnl_enable; |
||||
|
||||
/** @var self */ |
||||
private static $instance = null; |
||||
|
||||
/** |
||||
* Get instance |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
|
||||
return self::$instance; |
||||
} |
||||
|
||||
/** |
||||
* Singleton class constructor |
||||
*/ |
||||
protected function __construct() |
||||
{ |
||||
$config_filepath = DUPX_Package::getPackageArchivePath(); |
||||
if (!file_exists($config_filepath)) { |
||||
throw new Exception("Archive file $config_filepath doesn't exist"); |
||||
} |
||||
|
||||
if (($file_contents = file_get_contents($config_filepath)) === false) { |
||||
throw new Exception("Can\'t read Archive file $config_filepath"); |
||||
} |
||||
|
||||
if (($data = json_decode($file_contents)) === null) { |
||||
throw new Exception("Can\'t decode archive json"); |
||||
} |
||||
|
||||
foreach ($data as $key => $value) { |
||||
$this->{$key} = $value; |
||||
} |
||||
|
||||
//Instance Updates: |
||||
$this->blogNameSafe = preg_replace("/[^A-Za-z0-9?!]/", '', $this->blogname); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public function isZipArchive() |
||||
{ |
||||
$extension = strtolower(pathinfo($this->package_name, PATHINFO_EXTENSION)); |
||||
return ($extension == 'zip'); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $define |
||||
* |
||||
* @return bool // return true if define value exists |
||||
*/ |
||||
public function defineValueExists($define) |
||||
{ |
||||
return isset($this->wpInfo->configs->defines->{$define}); |
||||
} |
||||
|
||||
public function getUsersLists() |
||||
{ |
||||
$result = array(); |
||||
foreach ($this->wpInfo->adminUsers as $user) { |
||||
$result[$user->id] = $user->user_login; |
||||
} |
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $define |
||||
* @param array $default |
||||
* |
||||
* @return array |
||||
*/ |
||||
public function getDefineArrayValue($define, $default = array( |
||||
'value' => false, |
||||
'inWpConfig' => false |
||||
)) |
||||
{ |
||||
$defines = $this->wpInfo->configs->defines; |
||||
if (isset($defines->{$define})) { |
||||
return (array) $defines->{$define}; |
||||
} else { |
||||
return $default; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* return define value from archive or default value if don't exists |
||||
* |
||||
* @param string $define |
||||
* @param mixed $default |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function getDefineValue($define, $default = false) |
||||
{ |
||||
$defines = $this->wpInfo->configs->defines; |
||||
if (isset($defines->{$define})) { |
||||
return $defines->{$define}->value; |
||||
} else { |
||||
return $default; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* return define value from archive or default value if don't exists in wp-config |
||||
* |
||||
* @param string $define |
||||
* @param mixed $default |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function getWpConfigDefineValue($define, $default = false) |
||||
{ |
||||
$defines = $this->wpInfo->configs->defines; |
||||
if (isset($defines->{$define}) && $defines->{$define}->inWpConfig) { |
||||
return $defines->{$define}->value; |
||||
} else { |
||||
return $default; |
||||
} |
||||
} |
||||
|
||||
public function inWpConfigDefine($define) |
||||
{ |
||||
$defines = $this->wpInfo->configs->defines; |
||||
if (isset($defines->{$define})) { |
||||
return $defines->{$define}->inWpConfig; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $key |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function realValueExists($key) |
||||
{ |
||||
return isset($this->wpInfo->configs->realValues->{$key}); |
||||
} |
||||
|
||||
/** |
||||
* return read value from archive if exists of default if don't exists |
||||
* |
||||
* @param string $key |
||||
* @param mixed $default |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function getRealValue($key, $default = false) |
||||
{ |
||||
$values = $this->wpInfo->configs->realValues; |
||||
if (isset($values->{$key})) { |
||||
return $values->{$key}; |
||||
} else { |
||||
return $default; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* in hours |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getPackageLife() |
||||
{ |
||||
$packageTime = strtotime($this->created); |
||||
$currentTime = strtotime('now'); |
||||
return ceil(($currentTime - $packageTime) / 60 / 60); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function totalArchiveItemsCount() |
||||
{ |
||||
return $this->fileInfo->dirCount + $this->fileInfo->fileCount; |
||||
} |
||||
|
||||
public function setNewPathsAndUrlParamsByMainNew() |
||||
{ |
||||
self::manageEmptyPathAndUrl(PrmMng::PARAM_PATH_WP_CORE_NEW, PrmMng::PARAM_SITE_URL); |
||||
self::manageEmptyPathAndUrl(PrmMng::PARAM_PATH_CONTENT_NEW, PrmMng::PARAM_URL_CONTENT_NEW); |
||||
self::manageEmptyPathAndUrl(PrmMng::PARAM_PATH_UPLOADS_NEW, PrmMng::PARAM_URL_UPLOADS_NEW); |
||||
self::manageEmptyPathAndUrl(PrmMng::PARAM_PATH_PLUGINS_NEW, PrmMng::PARAM_URL_PLUGINS_NEW); |
||||
self::manageEmptyPathAndUrl(PrmMng::PARAM_PATH_MUPLUGINS_NEW, PrmMng::PARAM_URL_MUPLUGINS_NEW); |
||||
|
||||
$paramsManager = PrmMng::getInstance(); |
||||
$noticeManager = DUPX_NOTICE_MANAGER::getInstance(); |
||||
$noticeManager->addNextStepNotice(array( |
||||
'shortMsg' => '', |
||||
'level' => DUPX_NOTICE_ITEM::NOTICE, |
||||
'longMsg' => '<span class="green">If desired, you can change the default values in "Advanced install" > "Other options"</span>.', |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_HTML |
||||
), DUPX_NOTICE_MANAGER::ADD_UNIQUE_APPEND_IF_EXISTS, self::NOTICE_ID_PARAM_EMPTY); |
||||
|
||||
$paramsManager->save(); |
||||
$noticeManager->saveNotices(); |
||||
} |
||||
|
||||
protected static function manageEmptyPathAndUrl($pathKey, $urlKey) |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$validPath = (strlen($paramsManager->getValue($pathKey)) > 0); |
||||
$validUrl = (strlen($paramsManager->getValue($urlKey)) > 0); |
||||
|
||||
if ($validPath && $validUrl) { |
||||
return true; |
||||
} |
||||
|
||||
$paramsManager->setValue($pathKey, self::getDefaultPathUrlValueFromParamKey($pathKey)); |
||||
$paramsManager->setValue($urlKey, self::getDefaultPathUrlValueFromParamKey($urlKey)); |
||||
|
||||
$noticeManager = DUPX_NOTICE_MANAGER::getInstance(); |
||||
$msg = '<b>' . $paramsManager->getLabel($pathKey) . ' and/or ' . $paramsManager->getLabel($urlKey) . '</b> can\'t be generated automatically so they are set to their default value.' . "<br>\n"; |
||||
$msg .= $paramsManager->getLabel($pathKey) . ': ' . $paramsManager->getValue($pathKey) . "<br>\n"; |
||||
$msg .= $paramsManager->getLabel($urlKey) . ': ' . $paramsManager->getValue($urlKey) . "<br>\n"; |
||||
|
||||
$noticeManager->addNextStepNotice(array( |
||||
'shortMsg' => 'URLs and/or PATHs set automatically to their default value.', |
||||
'level' => DUPX_NOTICE_ITEM::NOTICE, |
||||
'longMsg' => $msg . "<br>\n", |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_HTML |
||||
), DUPX_NOTICE_MANAGER::ADD_UNIQUE_APPEND, self::NOTICE_ID_PARAM_EMPTY); |
||||
} |
||||
|
||||
public static function getDefaultPathUrlValueFromParamKey($paramKey) |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
switch ($paramKey) { |
||||
case PrmMng::PARAM_SITE_URL: |
||||
return $paramsManager->getValue(PrmMng::PARAM_URL_NEW); |
||||
case PrmMng::PARAM_URL_CONTENT_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_URL_NEW) . '/wp-content'; |
||||
case PrmMng::PARAM_URL_UPLOADS_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_URL_CONTENT_NEW) . '/uploads'; |
||||
case PrmMng::PARAM_URL_PLUGINS_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_URL_CONTENT_NEW) . '/plugins'; |
||||
case PrmMng::PARAM_URL_MUPLUGINS_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_URL_CONTENT_NEW) . '/mu-plugins'; |
||||
case PrmMng::PARAM_PATH_WP_CORE_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_PATH_NEW); |
||||
case PrmMng::PARAM_PATH_CONTENT_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_PATH_NEW) . '/wp-content'; |
||||
case PrmMng::PARAM_PATH_UPLOADS_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_PATH_CONTENT_NEW) . '/uploads'; |
||||
case PrmMng::PARAM_PATH_PLUGINS_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_PATH_CONTENT_NEW) . '/plugins'; |
||||
case PrmMng::PARAM_PATH_MUPLUGINS_NEW: |
||||
return $paramsManager->getValue(PrmMng::PARAM_PATH_CONTENT_NEW) . '/mu-plugins'; |
||||
default: |
||||
throw new Exception('Invalid URL or PATH param'); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $oldMain |
||||
* @param string $newMain |
||||
* @param string $subOld |
||||
* |
||||
* @return boolean|string return false if cant generate new sub string |
||||
*/ |
||||
public static function getNewSubString($oldMain, $newMain, $subOld) |
||||
{ |
||||
if (($relativePath = SnapIO::getRelativePath($subOld, $oldMain)) === false) { |
||||
return false; |
||||
} |
||||
return $newMain . '/' . $relativePath; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $oldMain |
||||
* @param string $newMain |
||||
* @param string $subOld |
||||
* |
||||
* @return boolean|string return false if cant generate new sub string |
||||
*/ |
||||
public static function getNewSubUrl($oldMain, $newMain, $subOld) |
||||
{ |
||||
|
||||
$parsedOldMain = SnapURL::parseUrl($oldMain); |
||||
$parsedNewMain = SnapURL::parseUrl($newMain); |
||||
$parsedSubOld = SnapURL::parseUrl($subOld); |
||||
|
||||
$parsedSubNew = $parsedSubOld; |
||||
$parsedSubNew['scheme'] = $parsedNewMain['scheme']; |
||||
$parsedSubNew['port'] = $parsedNewMain['port']; |
||||
|
||||
if ($parsedOldMain['host'] !== $parsedSubOld['host']) { |
||||
return false; |
||||
} |
||||
$parsedSubNew['host'] = $parsedNewMain['host']; |
||||
|
||||
if (($newPath = self::getNewSubString($parsedOldMain['path'], $parsedNewMain['path'], $parsedSubOld['path'])) === false) { |
||||
return false; |
||||
} |
||||
$parsedSubNew['path'] = $newPath; |
||||
return SnapURL::buildUrl($parsedSubNew); |
||||
} |
||||
|
||||
/** |
||||
* Returns case insensitive duplicate tables from source site |
||||
* |
||||
* @return array<string[]> |
||||
*/ |
||||
public function getDuplicateTableNames() |
||||
{ |
||||
$tableList = (array) $this->dbInfo->tablesList; |
||||
$allTables = array_keys($tableList); |
||||
$duplicates = SnapString::getCaseInsesitiveDuplicates($allTables); |
||||
|
||||
return $duplicates; |
||||
} |
||||
|
||||
/** |
||||
* Returns list of redundant duplicates |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getRedundantDuplicateTableNames() |
||||
{ |
||||
$duplicateTables = $this->getDuplicateTableNames(); |
||||
$prefix = DUPX_ArchiveConfig::getInstance()->wp_tableprefix; |
||||
$redundantTables = array(); |
||||
|
||||
foreach ($duplicateTables as $tables) { |
||||
$redundantTables = array_merge($redundantTables, SnapDB::getRedundantDuplicateTables($prefix, $tables)); |
||||
} |
||||
|
||||
return $redundantTables; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public function isTablesCaseSensitive() |
||||
{ |
||||
return $this->dbInfo->isTablesUpperCase; |
||||
} |
||||
|
||||
public function isTablePrefixChanged() |
||||
{ |
||||
return $this->wp_tableprefix != PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX); |
||||
} |
||||
|
||||
public function getTableWithNewPrefix($table) |
||||
{ |
||||
$search = '/^' . preg_quote($this->wp_tableprefix, '/') . '(.*)/'; |
||||
$replace = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX) . '$1'; |
||||
return preg_replace($search, $replace, $table, 1); |
||||
} |
||||
|
||||
public function getOldUrlScheme() |
||||
{ |
||||
static $oldScheme = null; |
||||
if (is_null($oldScheme)) { |
||||
$siteUrl = $this->getRealValue('siteUrl'); |
||||
$oldScheme = parse_url($siteUrl, PHP_URL_SCHEME); |
||||
if ($oldScheme === false) { |
||||
$oldScheme = 'http'; |
||||
} |
||||
} |
||||
return $oldScheme; |
||||
} |
||||
|
||||
/** |
||||
* get relative path in archive of wordpress main paths |
||||
* |
||||
* @param string $pathKey (abs,home,plugins ...) |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getRelativePathsInArchive($pathKey = null) |
||||
{ |
||||
static $realtviePaths = null; |
||||
|
||||
if (is_null($realtviePaths)) { |
||||
$realtviePaths = (array) $this->getRealValue('archivePaths'); |
||||
foreach ($realtviePaths as $key => $path) { |
||||
$realtviePaths[$key] = SnapIO::getRelativePath($path, $this->wpInfo->targetRoot); |
||||
} |
||||
} |
||||
|
||||
if (!empty($pathKey)) { |
||||
if (array_key_exists($pathKey, $realtviePaths)) { |
||||
return $realtviePaths[$pathKey]; |
||||
} else { |
||||
return false; |
||||
} |
||||
} else { |
||||
return $realtviePaths; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $path |
||||
* @param string|string[] $pathKeys |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isChildOfArchivePath($path, $pathKeys = array()) |
||||
{ |
||||
if (is_scalar($pathKeys)) { |
||||
$pathKeys = array($pathKeys); |
||||
} |
||||
|
||||
$mainPaths = $this->getRelativePathsInArchive(); |
||||
foreach ($pathKeys as $key) { |
||||
if (!isset($mainPaths[$key])) { |
||||
continue; |
||||
} |
||||
|
||||
if (strlen($mainPaths[$key]) == 0) { |
||||
return true; |
||||
} |
||||
|
||||
if (strpos($path, $mainPaths[$key]) === 0) { |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string|bool $relativePath return false if PARAM_PATH_MUPLUGINS_NEW isn't a sub path of PARAM_PATH_NEW |
||||
* @return string |
||||
*/ |
||||
public function getRelativeMuPlugins() |
||||
{ |
||||
static $relativePath = null; |
||||
if (is_null($relativePath)) { |
||||
$relativePath = SnapIO::getRelativePath( |
||||
PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW), |
||||
PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_NEW) |
||||
); |
||||
} |
||||
return $relativePath; |
||||
} |
||||
|
||||
/** |
||||
* return the mapping paths from relative path of archive zip and target folder |
||||
* if exist only one entry return the target folter string |
||||
* |
||||
* @param bool $reset // if true recalculater path mappintg |
||||
* |
||||
* @return string|array |
||||
*/ |
||||
public function getPathsMapping($reset = false) |
||||
{ |
||||
static $pathsMapping = null; |
||||
|
||||
if (is_null($pathsMapping) || $reset) { |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$pathsMapping = array(); |
||||
|
||||
$targeRootPath = $this->wpInfo->targetRoot; |
||||
$paths = (array) $this->getRealValue('archivePaths'); |
||||
|
||||
foreach ($paths as $key => $path) { |
||||
if (($relativePath = SnapIO::getRelativePath($path, $targeRootPath)) !== false) { |
||||
$paths[$key] = $relativePath; |
||||
} |
||||
} |
||||
$pathsMapping[$paths['home']] = $paramsManager->getValue(PrmMng::PARAM_PATH_NEW); |
||||
if ($paths['home'] !== $paths['abs']) { |
||||
$pathsMapping[$paths['abs']] = $paramsManager->getValue(PrmMng::PARAM_PATH_WP_CORE_NEW); |
||||
} |
||||
$pathsMapping[$paths['wpcontent']] = $paramsManager->getValue(PrmMng::PARAM_PATH_CONTENT_NEW); |
||||
$pathsMapping[$paths['plugins']] = $paramsManager->getValue(PrmMng::PARAM_PATH_PLUGINS_NEW); |
||||
$pathsMapping[$paths['muplugins']] = $paramsManager->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW); |
||||
|
||||
switch (DUPX_InstallerState::getInstType()) { |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE: |
||||
case DUPX_InstallerState::INSTALL_RBACKUP_SINGLE_SITE: |
||||
$pathsMapping[$paths['uploads']] = $paramsManager->getValue(PrmMng::PARAM_PATH_UPLOADS_NEW); |
||||
break; |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE_ON_SUBDOMAIN: |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE_ON_SUBFOLDER: |
||||
throw new Exception('Mode not avaiable'); |
||||
case DUPX_InstallerState::INSTALL_NOT_SET: |
||||
throw new Exception('Cannot change setup with current installation type [' . DUPX_InstallerState::getInstType() . ']'); |
||||
default: |
||||
throw new Exception('Unknown mode'); |
||||
} |
||||
|
||||
// remove all empty values for safe, |
||||
// This should never happen, but if it does, there is a risk that the installer will remove all the files in the server root. |
||||
$pathsMapping = array_filter($pathsMapping, function ($value) { |
||||
return strlen($value) > 0; |
||||
}); |
||||
|
||||
$pathsMapping = SnapIO::sortBySubfoldersCount($pathsMapping, true, false, true); |
||||
|
||||
$unsetKeys = array(); |
||||
foreach (array_reverse($pathsMapping) as $oldPathA => $newPathA) { |
||||
foreach ($pathsMapping as $oldPathB => $newPathB) { |
||||
if ($oldPathA == $oldPathB) { |
||||
continue; |
||||
} |
||||
|
||||
if ( |
||||
($relativePathOld = SnapIO::getRelativePath($oldPathA, $oldPathB)) === false || |
||||
($relativePathNew = SnapIO::getRelativePath($newPathA, $newPathB)) === false |
||||
) { |
||||
continue; |
||||
} |
||||
|
||||
if ($relativePathOld == $relativePathNew) { |
||||
$unsetKeys[] = $oldPathA; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
foreach (array_unique($unsetKeys) as $unsetKey) { |
||||
unset($pathsMapping[$unsetKey]); |
||||
} |
||||
|
||||
$tempArray = $pathsMapping; |
||||
$pathsMapping = array(); |
||||
foreach ($tempArray as $key => $val) { |
||||
$pathsMapping['/' . $key] = $val; |
||||
} |
||||
|
||||
switch (count($pathsMapping)) { |
||||
case 0: |
||||
throw new Exception('Paths archive mapping is inconsistent'); |
||||
break; |
||||
case 1: |
||||
$pathsMapping = reset($pathsMapping); |
||||
break; |
||||
default: |
||||
} |
||||
|
||||
Log::info("--------------------------------------"); |
||||
Log::info('PATHS MAPPING : ' . Log::v2str($pathsMapping)); |
||||
Log::info("--------------------------------------"); |
||||
} |
||||
return $pathsMapping; |
||||
} |
||||
|
||||
/** |
||||
* get absolute target path from archive relative path |
||||
* |
||||
* @param string $pathInArchive |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function destFileFromArchiveName($pathInArchive) |
||||
{ |
||||
$pathsMapping = $this->getPathsMapping(); |
||||
|
||||
if (is_string($pathsMapping)) { |
||||
return $pathsMapping . '/' . ltrim($pathInArchive, '\\/'); |
||||
} |
||||
|
||||
if (strlen($pathInArchive) === 0) { |
||||
$pathInArchive = '/'; |
||||
} elseif ($pathInArchive[0] != '/') { |
||||
$pathInArchive = '/' . $pathInArchive; |
||||
} |
||||
|
||||
foreach ($pathsMapping as $archiveMainPath => $newMainPath) { |
||||
if (($relative = SnapIO::getRelativePath($pathInArchive, $archiveMainPath)) !== false) { |
||||
return $newMainPath . '/' . $relative; |
||||
} |
||||
} |
||||
|
||||
// if don't find corrispondance in mapping get the path new as default (this should never happen) |
||||
return PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_NEW) . '/' . ltrim($pathInArchive, '\\/'); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function invalidCharsets() |
||||
{ |
||||
return array_diff($this->dbInfo->charSetList, DUPX_DB_Functions::getInstance()->getCharsetsList()); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function invalidCollations() |
||||
{ |
||||
return array_diff($this->dbInfo->collationList, DUPX_DB_Functions::getInstance()->getCollationsList()); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] list of MySQL engines in source site not supported by the current database |
||||
* @throws Exception |
||||
*/ |
||||
public function invalidEngines() |
||||
{ |
||||
return array_diff($this->dbInfo->engineList, DUPX_DB_Functions::getInstance()->getSupportedEngineList()); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param WPConfigTransformer $confTrans |
||||
* @param string $defineKey |
||||
* @param string $paramKey |
||||
*/ |
||||
public static function updateWpConfigByParam(WPConfigTransformer $confTrans, $defineKey, $paramKey) |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$wpConfVal = $paramsManager->getValue($paramKey); |
||||
return self::updateWpConfigByValue($confTrans, $defineKey, $wpConfVal); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param WPConfigTransformer $confTrans |
||||
* @param string $defineKey |
||||
* @param mixed $wpConfVal |
||||
*/ |
||||
/** |
||||
* Update wp conf |
||||
* |
||||
* @param WPConfigTransformer $confTrans |
||||
* @param string $defineKey |
||||
* @param array $wpConfVal |
||||
* @param mixed $customValue if is not null custom value overwrite value |
||||
* |
||||
* @return void |
||||
*/ |
||||
public static function updateWpConfigByValue(WPConfigTransformer $confTrans, $defineKey, $wpConfVal, $customValue = null) |
||||
{ |
||||
if ($wpConfVal['inWpConfig']) { |
||||
$stringVal = ''; |
||||
if ($customValue !== null) { |
||||
$stringVal = $customValue; |
||||
$updParam = array('raw' => true, 'normalize' => true); |
||||
} else { |
||||
switch (gettype($wpConfVal['value'])) { |
||||
case "boolean": |
||||
$stringVal = $wpConfVal['value'] ? 'true' : 'false'; |
||||
$updParam = array('raw' => true, 'normalize' => true); |
||||
break; |
||||
case "integer": |
||||
case "double": |
||||
$stringVal = (string) $wpConfVal['value']; |
||||
$updParam = array('raw' => true, 'normalize' => true); |
||||
break; |
||||
case "string": |
||||
$stringVal = $wpConfVal['value']; |
||||
$updParam = array('raw' => false, 'normalize' => true); |
||||
break; |
||||
case "NULL": |
||||
$stringVal = 'null'; |
||||
$updParam = array('raw' => true, 'normalize' => true); |
||||
break; |
||||
case "array": |
||||
case "object": |
||||
case "resource": |
||||
case "resource (closed)": |
||||
case "unknown type": |
||||
default: |
||||
$stringVal = ''; |
||||
$updParam = array('raw' => true, 'normalize' => true); |
||||
break; |
||||
} |
||||
} |
||||
|
||||
Log::info('WP CONFIG UPDATE ' . $defineKey . ' ' . Log::v2str($stringVal)); |
||||
$confTrans->update('constant', $defineKey, $stringVal, $updParam); |
||||
} else { |
||||
if ($confTrans->exists('constant', $defineKey)) { |
||||
Log::info('WP CONFIG REMOVE ' . $defineKey); |
||||
$confTrans->remove('constant', $defineKey); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,471 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Class used to update and edit web server configuration files |
||||
* for .htaccess, web.config and user.ini |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\ServerConfig |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapIO; |
||||
|
||||
class DUPX_ServerConfig |
||||
{ |
||||
const INSTALLER_HOST_ENTITY_PREFIX = 'installer_host_'; |
||||
const CONFIG_ORIG_FILE_USERINI_ID = 'userini'; |
||||
const CONFIG_ORIG_FILE_HTACCESS_ID = 'htaccess'; |
||||
const CONFIG_ORIG_FILE_WPCONFIG_ID = 'wpconfig'; |
||||
const CONFIG_ORIG_FILE_PHPINI_ID = 'phpini'; |
||||
const CONFIG_ORIG_FILE_WEBCONFIG_ID = 'webconfig'; |
||||
const CONFIG_ORIG_FILE_USERINI_ID_OVERWRITE_SITE = 'installer_host_userini'; |
||||
const CONFIG_ORIG_FILE_HTACCESS_ID_OVERWRITE_SITE = 'installer_host_htaccess'; |
||||
const CONFIG_ORIG_FILE_WPCONFIG_ID_OVERWRITE_SITE = 'installer_host_wpconfig'; |
||||
const CONFIG_ORIG_FILE_PHPINI_ID_OVERWRITE_SITE = 'installer_host_phpini'; |
||||
const CONFIG_ORIG_FILE_WEBCONFIG_ID_OVERWRITE_SITE = 'installer_host_webconfig'; |
||||
|
||||
/** |
||||
* Common timestamp of all members of this class |
||||
* |
||||
* @staticvar type $time |
||||
* @return type |
||||
*/ |
||||
public static function getFixedTimestamp() |
||||
{ |
||||
static $time = null; |
||||
|
||||
if (is_null($time)) { |
||||
$time = date("ymdHis"); |
||||
} |
||||
|
||||
return $time; |
||||
} |
||||
|
||||
/** |
||||
* Creates a copy of the original server config file and resets the original to blank |
||||
* |
||||
* @param string $rootPath The root path to the location of the server config files |
||||
* |
||||
* @return null |
||||
* @throws Exception |
||||
*/ |
||||
public static function reset($rootPath) |
||||
{ |
||||
$rootPath = SnapIO::trailingslashit($rootPath); |
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
Log::info("\n*** RESET CONFIG FILES IN CURRENT HOSTING >>> START"); |
||||
|
||||
switch ($paramsManager->getValue(PrmMng::PARAM_WP_CONFIG)) { |
||||
case 'modify': |
||||
case 'new': |
||||
if (self::runReset($rootPath . 'wp-config.php', self::CONFIG_ORIG_FILE_WPCONFIG_ID) === false) { |
||||
$paramsManager->setValue(PrmMng::PARAM_WP_CONFIG, 'nothing'); |
||||
} |
||||
break; |
||||
case 'nothing': |
||||
break; |
||||
} |
||||
|
||||
switch ($paramsManager->getValue(PrmMng::PARAM_HTACCESS_CONFIG)) { |
||||
case 'new': |
||||
case 'original': |
||||
if (self::runReset($rootPath . '.htaccess', self::CONFIG_ORIG_FILE_HTACCESS_ID) === false) { |
||||
$paramsManager->setValue(PrmMng::PARAM_HTACCESS_CONFIG, 'nothing'); |
||||
} |
||||
break; |
||||
case 'nothing': |
||||
break; |
||||
} |
||||
|
||||
switch ($paramsManager->getValue(PrmMng::PARAM_OTHER_CONFIG)) { |
||||
case 'new': |
||||
case 'original': |
||||
if (self::runReset($rootPath . 'web.config', self::CONFIG_ORIG_FILE_WEBCONFIG_ID) === false) { |
||||
$paramsManager->setValue(PrmMng::PARAM_OTHER_CONFIG, 'nothing'); |
||||
} |
||||
if (self::runReset($rootPath . '.user.ini', self::CONFIG_ORIG_FILE_USERINI_ID) === false) { |
||||
$paramsManager->setValue(PrmMng::PARAM_OTHER_CONFIG, 'nothing'); |
||||
} |
||||
if (self::runReset($rootPath . 'php.ini', self::CONFIG_ORIG_FILE_PHPINI_ID) === false) { |
||||
$paramsManager->setValue(PrmMng::PARAM_OTHER_CONFIG, 'nothing'); |
||||
} |
||||
break; |
||||
case 'nothing': |
||||
break; |
||||
} |
||||
|
||||
$paramsManager->save(); |
||||
Log::info("\n*** RESET CONFIG FILES IN CURRENT HOSTING >>> END"); |
||||
} |
||||
|
||||
public static function setFiles($rootPath) |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$origFiles = DUPX_Orig_File_Manager::getInstance(); |
||||
Log::info("SET CONFIG FILES"); |
||||
|
||||
$entryKey = self::CONFIG_ORIG_FILE_WPCONFIG_ID; |
||||
switch ($paramsManager->getValue(PrmMng::PARAM_WP_CONFIG)) { |
||||
case 'new': |
||||
if (SnapIO::copy(DUPX_Package::getWpconfigSamplePath(), DUPX_WPConfig::getWpConfigPath()) === false) { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Can\' reset wp-config to wp-config-sample', |
||||
'level' => DUPX_NOTICE_ITEM::CRITICAL, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Target file entry ' . Log::v2str(DUPX_WPConfig::getWpConfigPath()), |
||||
'sections' => 'general' |
||||
)); |
||||
} else { |
||||
Log::info("Copy wp-config-sample.php to target:" . DUPX_WPConfig::getWpConfigPath()); |
||||
} |
||||
break; |
||||
case 'modify': |
||||
if (SnapIO::copy($origFiles->getEntryStoredPath($entryKey), DUPX_WPConfig::getWpConfigPath()) === false) { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Can\' restore oirg file entry ' . $entryKey, |
||||
'level' => DUPX_NOTICE_ITEM::CRITICAL, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Target file entry ' . Log::v2str(DUPX_WPConfig::getWpConfigPath()), |
||||
'sections' => 'general' |
||||
)); |
||||
} else { |
||||
Log::info("Retained original entry " . $entryKey . " target:" . DUPX_WPConfig::getWpConfigPath()); |
||||
} |
||||
break; |
||||
case 'nothing': |
||||
break; |
||||
} |
||||
|
||||
$entryKey = self::CONFIG_ORIG_FILE_HTACCESS_ID; |
||||
switch ($paramsManager->getValue(PrmMng::PARAM_HTACCESS_CONFIG)) { |
||||
case 'new': |
||||
$targetHtaccess = self::getHtaccessTargetPath(); |
||||
if (SnapIO::touch($targetHtaccess) === false) { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Can\'t create new htaccess file', |
||||
'level' => DUPX_NOTICE_ITEM::CRITICAL, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Target file entry ' . $targetHtaccess, |
||||
'sections' => 'general' |
||||
)); |
||||
} else { |
||||
Log::info("New htaccess file created:" . $targetHtaccess); |
||||
} |
||||
break; |
||||
case 'original': |
||||
if (($storedHtaccess = $origFiles->getEntryStoredPath($entryKey)) === false) { |
||||
Log::info("Retained original entry. htaccess doesn\'t exist in original site"); |
||||
break; |
||||
} |
||||
|
||||
$targetHtaccess = self::getHtaccessTargetPath(); |
||||
if (SnapIO::copy($storedHtaccess, $targetHtaccess) === false) { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Can\' restore oirg file entry ' . $entryKey, |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Target file entry ' . Log::v2str($targetHtaccess), |
||||
'sections' => 'general' |
||||
)); |
||||
} else { |
||||
Log::info("Retained original entry " . $entryKey . " target:" . $targetHtaccess); |
||||
} |
||||
break; |
||||
case 'nothing': |
||||
break; |
||||
} |
||||
|
||||
switch ($paramsManager->getValue(PrmMng::PARAM_OTHER_CONFIG)) { |
||||
case 'new': |
||||
if ($origFiles->getEntry(self::CONFIG_ORIG_FILE_WEBCONFIG_ID_OVERWRITE_SITE)) { |
||||
//IIS: This is reset because on some instances of IIS having old values cause issues |
||||
//Recommended fix for users who want it because errors are triggered is to have |
||||
//them check the box for ignoring the web.config files on step 1 of installer |
||||
$xml_contents = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
$xml_contents .= "<!-- Reset by Duplicator Installer. Original can be found in the original_files_ folder-->\n"; |
||||
$xml_contents .= "<configuration></configuration>\n"; |
||||
if (file_put_contents($rootPath . "/web.config", $xml_contents) === false) { |
||||
Log::info('RESET: can\'t create a new empty web.config'); |
||||
} |
||||
} |
||||
break; |
||||
case 'original': |
||||
$entries = array( |
||||
self::CONFIG_ORIG_FILE_USERINI_ID, |
||||
self::CONFIG_ORIG_FILE_WEBCONFIG_ID, |
||||
self::CONFIG_ORIG_FILE_PHPINI_ID |
||||
); |
||||
foreach ($entries as $entryKey) { |
||||
if ($origFiles->getEntry($entryKey) !== false) { |
||||
if (SnapIO::copy($origFiles->getEntryStoredPath($entryKey), $origFiles->getEntryTargetPath($entryKey, false)) === false) { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Notice: Cannot restore original file entry ' . $entryKey, |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Target file entry ' . Log::v2str($origFiles->getEntryTargetPath($entryKey, false)), |
||||
'sections' => 'general' |
||||
)); |
||||
} else { |
||||
Log::info("Retained original entry " . $entryKey . " target:" . $origFiles->getEntryTargetPath($entryKey, false)); |
||||
} |
||||
} |
||||
} |
||||
break; |
||||
case 'nothing': |
||||
break; |
||||
} |
||||
|
||||
DUPX_NOTICE_MANAGER::getInstance()->saveNotices(); |
||||
} |
||||
|
||||
public static function getHtaccessTargetPath() |
||||
{ |
||||
if (($targetEnty = DUPX_Orig_File_Manager::getInstance()->getEntryTargetPath(self::CONFIG_ORIG_FILE_HTACCESS_ID, false)) !== false) { |
||||
return $targetEnty; |
||||
} else { |
||||
return PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_NEW) . '/.htaccess'; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Moves the configuration file to the dup_installer/original_files_[hash] folder |
||||
* |
||||
* @param string $filePath file path to store |
||||
* @param string $storedName if not false rename |
||||
* |
||||
* @return bool Returns true if the file was backed-up and reset or there was no file to reset |
||||
*/ |
||||
private static function runReset($filePath, $storedName) |
||||
{ |
||||
$fileName = basename($filePath); |
||||
|
||||
try { |
||||
if (file_exists($filePath)) { |
||||
if (!SnapIO::chmod($filePath, 'u+rw') || !is_readable($filePath) || !is_writable($filePath)) { |
||||
throw new Exception("RESET CONFIG FILES: permissions error on file config path " . $filePath); |
||||
} |
||||
|
||||
$origFiles = DUPX_Orig_File_Manager::getInstance(); |
||||
$filePath = SnapIO::safePathUntrailingslashit($filePath); |
||||
|
||||
Log::info("RESET CONFIG FILES: I'M GOING TO MOVE CONFIG FILE " . Log::v2str($fileName) . " IN ORIGINAL FOLDER"); |
||||
|
||||
if ( |
||||
$origFiles->addEntry( |
||||
self::INSTALLER_HOST_ENTITY_PREFIX . $storedName, |
||||
$filePath, |
||||
DUPX_Orig_File_Manager::MODE_MOVE, |
||||
self::INSTALLER_HOST_ENTITY_PREFIX . $storedName |
||||
) |
||||
) { |
||||
Log::info("\tCONFIG FILE HAS BEEN RESET"); |
||||
} else { |
||||
throw new Exception("cannot store file " . Log::v2str($fileName) . " in orginal file folder"); |
||||
} |
||||
} else { |
||||
Log::info("RESET CONFIG FILES: " . Log::v2str($fileName) . " does not exist, no need for reset", Log::LV_DETAILED); |
||||
} |
||||
} catch (Exception $e) { |
||||
Log::logException($e, Log::LV_DEFAULT, 'RESET CONFIG FILES ERROR: '); |
||||
DUPX_NOTICE_MANAGER::getInstance()->addBothNextAndFinalReportNotice(array( |
||||
'shortMsg' => 'Can\'t reset config file ' . Log::v2str($fileName) . ' so it will not be modified.', |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Message: ' . $e->getMessage(), |
||||
'sections' => 'general' |
||||
)); |
||||
return false; |
||||
} catch (Error $e) { |
||||
Log::logException($e, Log::LV_DEFAULT, 'RESET CONFIG FILES ERROR: '); |
||||
DUPX_NOTICE_MANAGER::getInstance()->addBothNextAndFinalReportNotice(array( |
||||
'shortMsg' => 'Can\'t reset config file ' . Log::v2str($fileName) . ' so it will not be modified.', |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Message: ' . $e->getMessage(), |
||||
'sections' => 'general' |
||||
)); |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean|string false if loca config don't exists or path of store local config |
||||
*/ |
||||
public static function getWpConfigLocalStoredPath() |
||||
{ |
||||
$origFiles = DUPX_Orig_File_Manager::getInstance(); |
||||
$entry = self::CONFIG_ORIG_FILE_WPCONFIG_ID_OVERWRITE_SITE; |
||||
if ($origFiles->getEntry($entry)) { |
||||
return $origFiles->getEntryStoredPath($entry); |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Get AddHandler line from existing WP .htaccess file |
||||
* |
||||
* @return string |
||||
* @throws Exception |
||||
*/ |
||||
private static function getOldHtaccessAddhandlerLine() |
||||
{ |
||||
$origFiles = DUPX_Orig_File_Manager::getInstance(); |
||||
$backupHtaccessPath = $origFiles->getEntryStoredPath(self::CONFIG_ORIG_FILE_HTACCESS_ID_OVERWRITE_SITE); |
||||
Log::info("Installer Host Htaccess path: " . $backupHtaccessPath, Log::LV_DEBUG); |
||||
|
||||
if ($backupHtaccessPath !== false && file_exists($backupHtaccessPath)) { |
||||
$htaccessContent = file_get_contents($backupHtaccessPath); |
||||
if (!empty($htaccessContent)) { |
||||
// match and trim non commented line "AddHandler application/x-httpd-XXXX .php" case insenstive |
||||
$re = '/^[\s\t]*[^#]?[\s\t]*(AddHandler[\s\t]+.+\.php[ \t]?.*?)[\s\t]*$/mi'; |
||||
$matches = array(); |
||||
if (preg_match($re, $htaccessContent, $matches)) { |
||||
return "\n" . $matches[1]; |
||||
} |
||||
} |
||||
} |
||||
return ''; |
||||
} |
||||
|
||||
/** |
||||
* Sets up the web config file based on the inputs from the installer forms. |
||||
* |
||||
* @param int $mu_mode Is this site a specific multi-site mode |
||||
* @param object $dbh The database connection handle for this request |
||||
* @param string $path The path to the config file |
||||
* |
||||
* @return null |
||||
*/ |
||||
public static function setup($dbh, $path) |
||||
{ |
||||
Log::info("\nWEB SERVER CONFIGURATION FILE UPDATED:"); |
||||
|
||||
$paramsManager = PrmMng::getInstance(); |
||||
$htAccessPath = "{$path}/.htaccess"; |
||||
$mu_generation = DUPX_ArchiveConfig::getInstance()->mu_generation; |
||||
|
||||
// SKIP HTACCESS |
||||
$skipHtaccessConfigVals = array('nothing', 'original'); |
||||
if (in_array($paramsManager->getValue(PrmMng::PARAM_HTACCESS_CONFIG), $skipHtaccessConfigVals)) { |
||||
if (!DUPX_InstallerState::isRestoreBackup()) { |
||||
// on restore packup mode no warning needed |
||||
$longMsg = 'Retaining the original .htaccess file from the old site or not creating a new one may cause issues with the initial setup ' |
||||
. 'of this site. If you encounter any issues, validate the contents of the .htaccess file or reinstall the site again using the ' |
||||
. 'Step 1 ❯ Options ❯ Advanced ❯ Configuration Files ❯ Apache .htaccess ❯ Create New option. If your site works as expected this ' |
||||
. 'message can be ignored.'; |
||||
|
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Notice: A new .htaccess file was not created', |
||||
'level' => DUPX_NOTICE_ITEM::NOTICE, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => $longMsg, |
||||
'sections' => 'general' |
||||
)); |
||||
} |
||||
return; |
||||
} |
||||
|
||||
$timestamp = date("Y-m-d H:i:s"); |
||||
$post_url_new = $paramsManager->getValue(PrmMng::PARAM_URL_NEW); |
||||
$newdata = parse_url($post_url_new); |
||||
$newpath = DUPX_U::addSlash(isset($newdata['path']) ? $newdata['path'] : ""); |
||||
$update_msg = "# This file was updated by Duplicator on {$timestamp}.\n"; |
||||
$update_msg .= "# See the original_files_ folder for the original source_site_htaccess file."; |
||||
$update_msg .= self::getOldHtaccessAddhandlerLine(); |
||||
|
||||
switch (DUPX_InstallerState::getInstType()) { |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE: |
||||
case DUPX_InstallerState::INSTALL_RBACKUP_SINGLE_SITE: |
||||
$tmp_htaccess = self::htAcccessNoMultisite($update_msg, $newpath, $dbh); |
||||
Log::info("- Preparing .htaccess file with basic setup."); |
||||
break; |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE_ON_SUBDOMAIN: |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE_ON_SUBFOLDER: |
||||
case DUPX_InstallerState::INSTALL_NOT_SET: |
||||
throw new Exception('Cannot change setup with current installation type [' . DUPX_InstallerState::getInstType() . ']'); |
||||
default: |
||||
throw new Exception('Unknown mode'); |
||||
} |
||||
|
||||
if (file_exists($htAccessPath) && SnapIO::chmod($htAccessPath, 'u+rw') === false) { |
||||
Log::info("WARNING: Unable to update htaccess file permessition."); |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Notice: Unable to update new .htaccess file', |
||||
'level' => DUPX_NOTICE_ITEM::CRITICAL, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Unable to update the .htaccess file! Please check the permission on the root directory and make sure the .htaccess exists.', |
||||
'sections' => 'general' |
||||
)); |
||||
} elseif (file_put_contents($htAccessPath, $tmp_htaccess) === false) { |
||||
Log::info("WARNING: Unable to update the .htaccess file! Please check the permission on the root directory and make sure the .htaccess exists."); |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Noitice: Unable to update new .htaccess file', |
||||
'level' => DUPX_NOTICE_ITEM::CRITICAL, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'longMsg' => 'Unable to update the .htaccess file! Please check the permission on the root directory and make sure the .htaccess exists.', |
||||
'sections' => 'general' |
||||
)); |
||||
} else { |
||||
DUP_Extraction::setPermsFromParams($htAccessPath); |
||||
Log::info("HTACCESS FILE - Successfully updated the .htaccess file setting."); |
||||
} |
||||
} |
||||
|
||||
private static function htAcccessNoMultisite($update_msg, $newpath, $dbh) |
||||
{ |
||||
$result = ''; |
||||
// no multisite |
||||
$empty_htaccess = false; |
||||
$optonsTable = mysqli_real_escape_string($dbh, DUPX_DB_Functions::getOptionsTableName()); |
||||
$query_result = DUPX_DB::mysqli_query($dbh, "SELECT option_value FROM `" . $optonsTable . "` WHERE option_name = 'permalink_structure' "); |
||||
|
||||
if ($query_result) { |
||||
$row = @mysqli_fetch_array($query_result); |
||||
if ($row != null) { |
||||
$permalink_structure = trim($row[0]); |
||||
$empty_htaccess = empty($permalink_structure); |
||||
} |
||||
} |
||||
|
||||
if ($empty_htaccess) { |
||||
Log::info('NO PERMALINK STRUCTURE FOUND: set htaccess without directives'); |
||||
$result = <<<EMPTYHTACCESS |
||||
{$update_msg} |
||||
# BEGIN WordPress |
||||
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are |
||||
# dynamically generated, and should only be modified via WordPress filters. |
||||
# Any changes to the directives between these markers will be overwritten. |
||||
|
||||
# END WordPress |
||||
EMPTYHTACCESS; |
||||
} else { |
||||
$result = <<<HTACCESS |
||||
{$update_msg} |
||||
# BEGIN WordPress |
||||
<IfModule mod_rewrite.c> |
||||
RewriteEngine On |
||||
RewriteBase {$newpath} |
||||
RewriteRule ^index\.php$ - [L] |
||||
RewriteCond %{REQUEST_FILENAME} !-f |
||||
RewriteCond %{REQUEST_FILENAME} !-d |
||||
RewriteRule . {$newpath}index.php [L] |
||||
</IfModule> |
||||
# END WordPress |
||||
HTACCESS; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
} |
@ -1,97 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
/** |
||||
* In this class all the utility functions related to the wordpress configuration and the package are defined. |
||||
*/ |
||||
class DUPX_Conf_Utils |
||||
{ |
||||
/** |
||||
* |
||||
* @staticvar null|bool $present |
||||
* @return bool |
||||
*/ |
||||
public static function isConfArkPresent() |
||||
{ |
||||
static $present = null; |
||||
if (is_null($present)) { |
||||
$present = file_exists(DUPX_Package::getWpconfigArkPath()); |
||||
} |
||||
return $present; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar bool $present |
||||
* @return bool |
||||
*/ |
||||
public static function isManualExtractFilePresent() |
||||
{ |
||||
static $present = null; |
||||
if (is_null($present)) { |
||||
$present = file_exists(DUPX_Package::getManualExtractFile()); |
||||
} |
||||
return $present; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar null|bool $enable |
||||
* @return bool |
||||
*/ |
||||
public static function shellExecUnzipEnable() |
||||
{ |
||||
static $enable = null; |
||||
if (is_null($enable)) { |
||||
$enable = DUPX_Server::get_unzip_filepath() != null; |
||||
} |
||||
return $enable; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function classZipArchiveEnable() |
||||
{ |
||||
return class_exists('ZipArchive'); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar bool $exists |
||||
* @return bool |
||||
*/ |
||||
public static function archiveExists() |
||||
{ |
||||
static $exists = null; |
||||
if (is_null($exists)) { |
||||
$exists = file_exists(DUPX_Security::getInstance()->getArchivePath()); |
||||
} |
||||
return $exists; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar bool $arcSize |
||||
* @return bool |
||||
*/ |
||||
public static function archiveSize() |
||||
{ |
||||
static $arcSize = null; |
||||
if (is_null($arcSize)) { |
||||
$archivePath = DUPX_Security::getInstance()->getArchivePath(); |
||||
$arcSize = file_exists($archivePath) ? (int) @filesize($archivePath) : 0; |
||||
} |
||||
return $arcSize; |
||||
} |
||||
} |
@ -1,92 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Class used to update and edit web server configuration files |
||||
* for both Apache and IIS files .htaccess and web.config |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\WPConfig |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapIO; |
||||
use Duplicator\Libs\WpConfig\WPConfigTransformer; |
||||
|
||||
class DUPX_WPConfig |
||||
{ |
||||
const ADMIN_SERIALIZED_SECURITY_STRING = 'a:1:{s:13:"administrator";b:1;}'; |
||||
const ADMIN_LEVEL = 10; |
||||
/** |
||||
* get wp-config default path (not relative to orig file manger) |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getWpConfigDeafultPath() |
||||
{ |
||||
return PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_NEW) . '/wp-config.php'; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool|string false if fail |
||||
*/ |
||||
public static function getWpConfigPath() |
||||
{ |
||||
$origWpConfTarget = DUPX_Orig_File_Manager::getInstance()->getEntryTargetPath(DUPX_ServerConfig::CONFIG_ORIG_FILE_WPCONFIG_ID, self::getWpConfigDeafultPath()); |
||||
$origWpDir = SnapIO::safePath(dirname($origWpConfTarget)); |
||||
if ($origWpDir === PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_NEW)) { |
||||
return $origWpConfTarget; |
||||
} else { |
||||
return PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_WP_CORE_NEW) . "/wp-config.php"; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar boolean|WPConfigTransformer $confTransformer |
||||
* |
||||
* @return boolean|WPConfigTransformer |
||||
*/ |
||||
public static function getLocalConfigTransformer() |
||||
{ |
||||
static $confTransformer = null; |
||||
if (is_null($confTransformer)) { |
||||
try { |
||||
if (($wpConfigPath = DUPX_ServerConfig::getWpConfigLocalStoredPath()) === false) { |
||||
$wpConfigPath = DUPX_WPConfig::getWpConfigPath(); |
||||
} |
||||
if (is_readable($wpConfigPath)) { |
||||
$confTransformer = new WPConfigTransformer($wpConfigPath); |
||||
} else { |
||||
$confTransformer = false; |
||||
} |
||||
} catch (Exception $e) { |
||||
$confTransformer = false; |
||||
} |
||||
} |
||||
|
||||
return $confTransformer; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $name |
||||
* @param string $type // constant | variable |
||||
* @param mixed $default |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public static function getValueFromLocalWpConfig($name, $type = 'constant', $default = '') |
||||
{ |
||||
if (($confTransformer = self::getLocalConfigTransformer()) !== false) { |
||||
return $confTransformer->exists($type, $name) ? $confTransformer->getValue($type, $name) : $default; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -1,192 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Class used to group all global constants |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Constants |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Bootstrap; |
||||
|
||||
class DUPX_Constants |
||||
{ |
||||
const CHUNK_EXTRACTION_TIMEOUT_TIME_ZIP = 5; |
||||
const CHUNK_EXTRACTION_TIMEOUT_TIME_DUP = 5; |
||||
const CHUNK_DBINSTALL_TIMEOUT_TIME = 5; |
||||
const CHUNK_MAX_TIMEOUT_TIME = 5; |
||||
const DEFAULT_MAX_STRLEN_SERIALIZED_CHECK_IN_M = 4; // 0 no limit |
||||
const DUP_SITE_URL = 'https://duplicator.com/'; |
||||
const FAQ_URL = 'https://duplicator.com/knowledge-base/'; |
||||
const URL_SUBSCRIBE = 'https://duplicator.com/?lite_email_signup=1'; |
||||
const MIN_NEW_PASSWORD_LEN = 6; |
||||
const BACKUP_RENAME_PREFIX = 'dp___bk_'; |
||||
const UPSELL_DEFAULT_DISCOUNT = 50; // Default discount for upsell |
||||
|
||||
|
||||
/** |
||||
* Init method used to auto initialize the global params |
||||
* This function init all params before read from request |
||||
* |
||||
* @return null |
||||
*/ |
||||
public static function init() |
||||
{ |
||||
//DATABASE SETUP: all time in seconds |
||||
//max_allowed_packet: max value 1073741824 (1268MB) see my.ini |
||||
$GLOBALS['DB_MAX_TIME'] = 5000; |
||||
$GLOBALS['DATABASE_PAGE_SIZE'] = 3500; |
||||
$GLOBALS['DB_MAX_PACKETS'] = 268435456; |
||||
$GLOBALS['DBCHARSET_DEFAULT'] = 'utf8'; |
||||
$GLOBALS['DBCOLLATE_DEFAULT'] = 'utf8_general_ci'; |
||||
$GLOBALS['DB_RENAME_PREFIX'] = self::BACKUP_RENAME_PREFIX . date("dHi") . '_'; |
||||
$GLOBALS['DB_INSTALL_MULTI_THREADED_MAX_RETRIES'] = 3; |
||||
|
||||
if (!defined('MAX_SITES_TO_DEFAULT_ENABLE_CORSS_SEARCH')) { |
||||
define('MAX_SITES_TO_DEFAULT_ENABLE_CORSS_SEARCH', 10); |
||||
} |
||||
|
||||
//UPDATE TABLE SETTINGS |
||||
$GLOBALS['REPLACE_LIST'] = array(); |
||||
$GLOBALS['DEBUG_JS'] = false; |
||||
|
||||
//GLOBALS |
||||
$GLOBALS["NOTICES_FILE_PATH"] = DUPX_INIT . '/' . "dup-installer-notices__" . Bootstrap::getPackageHash() . ".json"; |
||||
$GLOBALS["CHUNK_DATA_FILE_PATH"] = DUPX_INIT . '/' . "dup-installer-chunk__" . Bootstrap::getPackageHash() . ".json"; |
||||
$GLOBALS['PHP_MEMORY_LIMIT'] = ini_get('memory_limit') === false ? 'n/a' : ini_get('memory_limit'); |
||||
$GLOBALS['PHP_SUHOSIN_ON'] = extension_loaded('suhosin') ? 'enabled' : 'disabled'; |
||||
$GLOBALS['DISPLAY_MAX_OBJECTS_FAILED_TO_SET_PERM'] = 5; |
||||
|
||||
// Displaying notice for slow zip chunk extraction |
||||
$GLOBALS['ZIP_ARC_CHUNK_EXTRACT_DISP_NOTICE_AFTER'] = 5 * 60 * 60; // 5 minutes |
||||
$GLOBALS['ZIP_ARC_CHUNK_EXTRACT_DISP_NOTICE_MIN_EXPECTED_EXTRACT_TIME'] = 10 * 60 * 60; // 10 minutes |
||||
$GLOBALS['ZIP_ARC_CHUNK_EXTRACT_DISP_NEXT_NOTICE_INTERVAL'] = 5 * 60 * 60; // 5 minutes |
||||
|
||||
$additional_msg = ' for additional details '; |
||||
$additional_msg .= '<a href="' . self::FAQ_URL . 'how-to-handle-various-install-scenarios" target="_blank">click here</a>.'; |
||||
$GLOBALS['ZIP_ARC_CHUNK_EXTRACT_NOTICES'] = array( |
||||
'This server looks to be under load or throttled, the extraction process may take some time', |
||||
'This host is currently experiencing very slow I/O. You can continue to wait or try a manual extraction.', |
||||
'This host I/O is currently having issues. It is recommended to try a manual extraction.', |
||||
); |
||||
foreach ($GLOBALS['ZIP_ARC_CHUNK_EXTRACT_NOTICES'] as $key => $val) { |
||||
$GLOBALS['ZIP_ARC_CHUNK_EXTRACT_NOTICES'][$key] = $val . $additional_msg; |
||||
} |
||||
|
||||
$GLOBALS['FW_USECDN'] = false; |
||||
$GLOBALS['NOW_TIME'] = @date("His"); |
||||
|
||||
self::initErrDefines(); |
||||
} |
||||
|
||||
protected static function initErrDefines() |
||||
{ |
||||
define('ERR_CONFIG_FOUND', 'A wp-config.php already exists in this location. ' . |
||||
'This error prevents users from accidentally overwriting a WordPress site or trying to install on top of an existing one. ' . |
||||
'When the archive file is extracted it can overwrite existing items if they have the same name. ' . |
||||
'If you have already manually extracted the installer then choose #1 other-wise consider these options: ' . |
||||
'<ol><li>Click > Try Again > Options > choose "Manual Archive Extraction".</li>' . |
||||
'<li>Delete the wp-config.php file and try again.</li>' . |
||||
'<li>Empty the root directory except for the package and installer and try again.</li></ol>'); |
||||
define('ERR_ZIPNOTFOUND', 'The packaged zip file was not found or has become unreadable. ' . |
||||
'Be sure the zip package is in the same directory as the installer file. ' . |
||||
'If you are trying to reinstall a package you can copy the package from the source site, ' . |
||||
' back up to your root which is the same location as your installer file.'); |
||||
define('ERR_SHELLEXEC_ZIPOPEN', 'Failed to extract the archive using shell_exec unzip'); |
||||
define( |
||||
'ERR_ZIPOPEN', |
||||
'Failed to open the zip archive file. Please be sure the archive is completely downloaded before running the installer. ' . |
||||
'Try to extract the archive manually to make sure the file is not corrupted.' |
||||
); |
||||
define( |
||||
'ERR_ZIPEXTRACTION', |
||||
'Errors extracting the zip file. Portions or part of the zip archive did not extract correctly.' . |
||||
' Try to extract the archive manually with a client side program like unzip/win-zip/winrar to make sure the file is not corrupted.' . |
||||
' If the file extracts correctly then there is an invalid file or directory that PHP is unable to extract.' . |
||||
'This can happen if you are moving from one operating system to another where certain naming ' . |
||||
'conventions work on one environment and not another. <br/><br/> Workarounds: <br/> 1. ' . |
||||
'Create a new package and be sure to exclude any directories that have name checks or files in them.' . |
||||
'This warning will be displayed on the scan results under "Name Checks". <br/> 2. Manually extract the zip file with a client side program.' . |
||||
'Then under options in step 1 of the installer select the "Manual Archive Extraction" option and perform the install.' |
||||
); |
||||
define( |
||||
'ERR_ZIPMANUAL', |
||||
'When choosing "Manual Archive Extraction", the contents of the package must already be extracted for the process to continue.' . |
||||
'Please manually extract the package into the current directory before continuing in manual extraction mode.' |
||||
); |
||||
define( |
||||
'ERR_MAKELOG', |
||||
'PHP is having issues writing to the log file <b>' . DUPX_INIT . '\dup-installer-log__[HASH].txt .</b>' . |
||||
'In order for the Duplicator to proceed to validate your owner/group and permission settings for PHP on this path. ' . |
||||
'Try temporarily setting you permissions to 777 to see if the issue gets resolved. ' . |
||||
'If you are on a shared hosting environment please contact your hosting company and tell ' . |
||||
'them you are getting errors writing files to the path above when using PHP.' |
||||
); |
||||
define( |
||||
'ERR_ZIPARCHIVE', |
||||
'In order to extract the archive.zip file, the PHP ZipArchive module must be installed.' . |
||||
'Please read the FAQ for more details. You can still install this package but you will need to select the ' . |
||||
'"Manual Archive Extraction" options found under Options. ' . |
||||
'Please read the online user guide for details in performing a manual archive extraction.' |
||||
); |
||||
define( |
||||
'ERR_MYSQLI_SUPPORT', |
||||
'In order to complete an install the mysqli extension for PHP is required.' . |
||||
'If you are on a hosted server please contact your host and request that mysqli be enabled.' . |
||||
' For more information visit: http://php.net/manual/en/mysqli.installation.php' |
||||
); |
||||
define( |
||||
'ERR_DBCONNECT', |
||||
'DATABASE CONNECTION FAILED!<br/>' |
||||
); |
||||
define( |
||||
'ERR_DBCONNECT_CREATE', |
||||
'DATABASE CREATION FAILURE!<br/> Unable to create database "%s". ' . |
||||
'Check to make sure the user has "Create" privileges. ' . |
||||
'Some hosts will restrict the creation of a database only through the cpanel. ' . |
||||
'Try creating the database manually to proceed with the installation. ' . |
||||
'If the database already exists select the action "Connect and Remove All Data" which will remove all existing tables.' |
||||
); |
||||
define('ERR_DROP_TABLE_TRYCLEAN', 'TABLE CLEAN FAILURE' |
||||
. 'Unable to remove TABLE "%s" from database "%s".<br/>' |
||||
. 'Please remove all tables from this database and try the installation again. ' |
||||
. 'If no tables show in the database, then Drop the database and re-create it.<br/>' |
||||
. 'ERROR MESSAGE: %s'); |
||||
define('ERR_DROP_PROCEDURE_TRYCLEAN', 'PROCEDURE CLEAN FAILURE. ' |
||||
. 'Please remove all procedures from this database and try the installation again. ' |
||||
. 'If no procedures show in the database, then Drop the database and re-create it.<br/>' |
||||
. 'ERROR MESSAGE: %s <br/><br/>'); |
||||
define('ERR_DROP_FUNCTION_TRYCLEAN', 'FUNCTION CLEAN FAILURE. ' |
||||
. 'Please remove all functions from this database and try the installation again. ' |
||||
. 'If no functions show in the database, then Drop the database and re-create it.<br/>' |
||||
. 'ERROR MESSAGE: %s <br/><br/>'); |
||||
define('ERR_DROP_VIEW_TRYCLEAN', 'VIEW CLEAN FAILURE. ' |
||||
. 'Please remove all views from this database and try the installation again. ' |
||||
. 'If no views show in the database, then Drop the database and re-create it.<br/>' |
||||
. 'ERROR MESSAGE: %s <br/><br/>'); |
||||
define( |
||||
'ERR_DBCREATE', |
||||
'The database "%s" does not exist.<br/> Change the action to create in order ' . |
||||
'to "Create New Database" to create the database. ' . |
||||
'Some hosting providers do not allow database creation except through their control panels. ' . |
||||
' In this case, you will need to log in to your hosting providers control panel and create the database manually. ' . |
||||
'Please contact your hosting provider for further details on how to create the database.' |
||||
); |
||||
define( |
||||
'ERR_DBEMPTY', |
||||
'The database "%s" already exists and has "%s" tables. ' . |
||||
' When using the "Create New Database" action the database should not exist. ' . |
||||
' Select the action "Connect and Remove All Data" or "Connect and Backup Any Existing Data" ' . |
||||
'to remove or backup the existing tables or choose a database name that does not already exist. ' . |
||||
'Some hosting providers do not allow table removal or renaming from scripts. ' . |
||||
'In this case, you will need to log in to your hosting providers\' control panel and remove or rename the tables manually. ' . |
||||
' Please contact your hosting provider for further details. Always backup all your data before proceeding!' |
||||
); |
||||
define('ERR_CPNL_API', 'The cPanel API had the following issues when trying to communicate on this host: <br/> %s'); |
||||
} |
||||
} |
@ -1,361 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Security class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\Constants |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Bootstrap; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Installer\Core\Params\Items\ParamItem; |
||||
use Duplicator\Libs\Snap\SnapIO; |
||||
use Duplicator\Libs\Snap\SnapUtil; |
||||
|
||||
/** |
||||
* singleton class |
||||
* |
||||
* In this class all installer security checks are performed. If the security checks are not passed, an exception is thrown and the installer is stopped. |
||||
* This happens before anything else so the class must work without the initialization of all global duplicator variables. |
||||
*/ |
||||
class DUPX_Security |
||||
{ |
||||
const CTRL_TOKEN = 'ctrl_csrf_token'; |
||||
const ROUTER_TOKEN = 'router_csrf_token'; |
||||
|
||||
const SECURITY_NONE = 'none'; |
||||
const SECURITY_PASSWORD = 'pwd'; |
||||
const SECURITY_ARCHIVE = 'archive'; |
||||
|
||||
/** |
||||
* |
||||
* @var self |
||||
*/ |
||||
private static $instance = null; |
||||
|
||||
/** |
||||
* archive path read from csrf file |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $archivePath = null; |
||||
|
||||
/** |
||||
* installer name read from csrf file |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $bootloader = null; |
||||
|
||||
/** |
||||
* installer url path read from csrf file |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $bootUrl = null; |
||||
|
||||
/** |
||||
* boot log file full path read from csrf file |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $bootFilePath = null; |
||||
|
||||
/** |
||||
* boot log file full path read from csrf file |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $bootLogFile = null; |
||||
|
||||
/** |
||||
* package hash read from csrf file |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $packageHash = null; |
||||
|
||||
/** |
||||
* public package hash read from csrf file |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $secondaryPackageHash = null; |
||||
|
||||
/** |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
|
||||
return self::$instance; |
||||
} |
||||
|
||||
private function __construct() |
||||
{ |
||||
DUPX_CSRF::init(DUPX_INIT, Bootstrap::getPackageHash()); |
||||
|
||||
if (!file_exists(DUPX_CSRF::getFilePath())) { |
||||
throw new Exception("CSRF FILE NOT FOUND\n" |
||||
. "Please, check webroot file permsission and dup-installer folder permission"); |
||||
} |
||||
|
||||
$this->bootloader = DUPX_CSRF::getVal('bootloader'); |
||||
$this->bootUrl = DUPX_CSRF::getVal('booturl'); |
||||
$this->bootLogFile = SnapIO::safePath(DUPX_CSRF::getVal('bootLogFile')); |
||||
$this->bootFilePath = SnapIO::safePath(DUPX_CSRF::getVal('installerOrigPath')); |
||||
$this->archivePath = SnapIO::safePath(DUPX_CSRF::getVal('archive')); |
||||
$this->packageHash = DUPX_CSRF::getVal('package_hash'); |
||||
$this->secondaryPackageHash = DUPX_CSRF::getVal('secondaryHash'); |
||||
} |
||||
|
||||
/** |
||||
* archive path read from intaller.php passed by DUPX_CSFR |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getArchivePath() |
||||
{ |
||||
return $this->archivePath; |
||||
} |
||||
|
||||
/** |
||||
* installer full path read from intaller.php passed by DUPX_CSFR |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getBootFilePath() |
||||
{ |
||||
return $this->bootFilePath; |
||||
} |
||||
|
||||
/** |
||||
* boot log file full path read from intaller.php passed by DUPX_CSFR |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getBootLogFile() |
||||
{ |
||||
return $this->bootLogFile; |
||||
} |
||||
|
||||
/** |
||||
* bootloader path read from intaller.php passed by DUPX_CSFR |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getBootloader() |
||||
{ |
||||
return $this->bootloader; |
||||
} |
||||
|
||||
/** |
||||
* bootloader path read from intaller.php passed by DUPX_CSFR |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getBootUrl() |
||||
{ |
||||
return $this->bootUrl; |
||||
} |
||||
|
||||
/** |
||||
* package hash read from intaller.php passed by DUPX_CSFR |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getPackageHash() |
||||
{ |
||||
return $this->packageHash; |
||||
} |
||||
|
||||
/** |
||||
* package public hash read from intaller.php passed by DUPX_CSFR |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getSecondaryPackageHash() |
||||
{ |
||||
return $this->secondaryPackageHash; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean |
||||
* @throws Exception // if fail throw exception of return true |
||||
*/ |
||||
public function check() |
||||
{ |
||||
try { |
||||
// check if current package hash is equal at bootloader package hash |
||||
if ($this->packageHash !== Bootstrap::getPackageHash()) { |
||||
throw new Exception('Incorrect hash package'); |
||||
} |
||||
|
||||
// checks if the version of the package descriptor is consistent with the version of the files. |
||||
if (DUPX_ArchiveConfig::getInstance()->version_dup !== DUPX_VERSION) { |
||||
throw new Exception('The version of the archive is different from the version of the PHP scripts'); |
||||
} |
||||
|
||||
$token_tested = false; |
||||
// @todo connect with global debug |
||||
$debug = false; |
||||
|
||||
$action = null; |
||||
if (DUPX_Ctrl_ajax::isAjax($action) == true) { |
||||
if (($token = self::getTokenFromInput(DUPX_Ctrl_ajax::TOKEN_NAME)) === false) { |
||||
$msg = 'Security issue' . ($debug ? ' LINE: ' . __LINE__ . ' TOKEN: ' . $token . ' KEY NAME: ' . DUPX_Ctrl_ajax::TOKEN_NAME : ''); |
||||
throw new Exception($msg); |
||||
} |
||||
if (!DUPX_CSRF::check(self::getTokenFromInput(DUPX_Ctrl_ajax::TOKEN_NAME), DUPX_Ctrl_ajax::getTokenKeyByAction($action))) { |
||||
$msg = 'Security issue' . ($debug ? ' LINE: ' . __LINE__ . ' TOKEN: ' . $token . ' KEY NAME: ' . DUPX_Ctrl_ajax::getTokenKeyByAction($action) . ' KEY VALUE ' . DUPX_Ctrl_ajax::getTokenKeyByAction($action) : ''); |
||||
throw new Exception($msg); |
||||
} |
||||
$token_tested = true; |
||||
} elseif (($token = self::getTokenFromInput(self::CTRL_TOKEN)) !== false) { |
||||
if (!isset($_REQUEST[PrmMng::PARAM_CTRL_ACTION])) { |
||||
$msg = 'Security issue' . ($debug ? ' LINE: ' . __LINE__ . ' TOKEN: ' . $token . ' KEY NAME: ' . PrmMng::PARAM_CTRL_ACTION : ''); |
||||
throw new Exception($msg); |
||||
} |
||||
if (!DUPX_CSRF::check($token, $_REQUEST[PrmMng::PARAM_CTRL_ACTION])) { |
||||
$msg = 'Security issue' . ($debug ? ' LINE: ' . __LINE__ . ' TOKEN: ' . $token . ' KEY NAME: ' . PrmMng::PARAM_CTRL_ACTION . ' KEY VALUE ' . $_REQUEST[PrmMng::PARAM_CTRL_ACTION] : ''); |
||||
throw new Exception($msg); |
||||
} |
||||
$token_tested = true; |
||||
} |
||||
|
||||
if (($token = self::getTokenFromInput(self::ROUTER_TOKEN)) !== false) { |
||||
if (!isset($_REQUEST[PrmMng::PARAM_ROUTER_ACTION])) { |
||||
$msg = 'Security issue' . ($debug ? ' LINE: ' . __LINE__ . ' TOKEN: ' . $token . ' KEY NAME: ' . PrmMng::PARAM_ROUTER_ACTION : ''); |
||||
throw new Exception($msg); |
||||
} |
||||
if (!DUPX_CSRF::check($token, $_REQUEST[PrmMng::PARAM_ROUTER_ACTION])) { |
||||
$msg = 'Security issue' . ($debug ? ' LINE: ' . __LINE__ . ' TOKEN: ' . $token . ' KEY NAME: ' . PrmMng::PARAM_ROUTER_ACTION . ' KEY VALUE ' . $_REQUEST[PrmMng::PARAM_ROUTER_ACTION] : ''); |
||||
throw new Exception($msg); |
||||
} |
||||
$token_tested = true; |
||||
} |
||||
|
||||
// At least one token must always and in any case be tested |
||||
if (!$token_tested) { |
||||
throw new Exception('Security Check Validation - No Token Found'); |
||||
} |
||||
} catch (Exception $e) { |
||||
if (function_exists('error_clear_last')) { |
||||
/** |
||||
* comment error_clear_last if you want see te exception html on shutdown |
||||
*/ |
||||
error_clear_last(); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.error_clear_lastFound |
||||
} |
||||
|
||||
Log::logException($e, Log::LV_DEFAULT, 'SECURITY CHECK: '); |
||||
dupxTplRender('page-security-error', array( |
||||
'message' => $e->getMessage() |
||||
)); |
||||
die(); |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* get sanitized token frominput |
||||
* |
||||
* @param string $tokenName |
||||
* |
||||
* @return string |
||||
*/ |
||||
protected static function getTokenFromInput($tokenName) |
||||
{ |
||||
return SnapUtil::filterInputDefaultSanitizeString(SnapUtil::INPUT_REQUEST, $tokenName, false); |
||||
} |
||||
|
||||
/** |
||||
* Get security tipe (NONE, PASSWORD, ARCHIVE) |
||||
* |
||||
* @return string enum type |
||||
*/ |
||||
public function getSecurityType() |
||||
{ |
||||
if (PrmMng::getInstance()->getValue(PrmMng::PARAM_SECURE_OK) == true) { |
||||
return self::SECURITY_NONE; |
||||
} |
||||
|
||||
$archiveConfig = DUPX_ArchiveConfig::getInstance(); |
||||
|
||||
if ($archiveConfig->secure_on) { |
||||
return self::SECURITY_PASSWORD; |
||||
} |
||||
|
||||
if ( |
||||
DUPX_InstallerState::isOverwrite() && |
||||
basename($this->bootFilePath) == 'installer.php' && |
||||
!in_array($_SERVER['REMOTE_ADDR'], self::getSecurityAddrWhitelist()) |
||||
) { |
||||
return self::SECURITY_ARCHIVE; |
||||
} |
||||
|
||||
return self::SECURITY_NONE; |
||||
} |
||||
|
||||
/** |
||||
* Get IPs white list for remote requests |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
private static function getSecurityAddrWhitelist() |
||||
{ |
||||
// uncomment this to test security archive on localhost |
||||
// return array(); |
||||
// ------- |
||||
return array( |
||||
'127.0.0.1', |
||||
'::1' |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* return true if security check is passed |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public function securityCheck() |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$archiveConfig = DUPX_ArchiveConfig::getInstance(); |
||||
$result = false; |
||||
switch ($this->getSecurityType()) { |
||||
case self::SECURITY_NONE: |
||||
$result = true; |
||||
break; |
||||
case self::SECURITY_PASSWORD: |
||||
$paramsManager->setValueFromInput(PrmMng::PARAM_SECURE_PASS); |
||||
$pass_hasher = new DUPX_PasswordHash(8, false); |
||||
$base64Pass = base64_encode($paramsManager->getValue(PrmMng::PARAM_SECURE_PASS)); |
||||
$result = $pass_hasher->CheckPassword($base64Pass, $archiveConfig->secure_pass); |
||||
break; |
||||
case self::SECURITY_ARCHIVE: |
||||
$paramsManager->setValueFromInput(PrmMng::PARAM_SECURE_ARCHIVE_HASH); |
||||
$result = (strcmp(basename($this->archivePath), $paramsManager->getValue(PrmMng::PARAM_SECURE_ARCHIVE_HASH)) == 0); |
||||
break; |
||||
default: |
||||
throw new Exception('Security type not valid ' . $this->getSecurityType()); |
||||
break; |
||||
} |
||||
|
||||
$paramsManager->setValue(PrmMng::PARAM_SECURE_OK, $result); |
||||
$paramsManager->save(); |
||||
return $result; |
||||
} |
||||
} |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
@ -1,797 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Database functions |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\Descriptors\ParamDescDatabase; |
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Installer\Core\Params\Descriptors\ParamDescUsers; |
||||
use Duplicator\Libs\Snap\SnapDB; |
||||
|
||||
class DUPX_DB_Functions |
||||
{ |
||||
/** |
||||
* |
||||
* @var self |
||||
*/ |
||||
protected static $instance = null; |
||||
|
||||
/** @var \mysqli connection */ |
||||
private $dbh = null; |
||||
/** @var float */ |
||||
protected $timeStart = 0; |
||||
|
||||
/** |
||||
* current data connection |
||||
* |
||||
* @var array connection |
||||
*/ |
||||
private $dataConnection = null; |
||||
|
||||
/** |
||||
* list of supported engine types |
||||
* |
||||
* @var array |
||||
*/ |
||||
private $engineData = null; |
||||
|
||||
/** |
||||
* supported charset and collation data |
||||
* |
||||
* @var array |
||||
*/ |
||||
private $charsetData = null; |
||||
|
||||
/** |
||||
* default charset in dwtabase connection |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $defaultCharset = null; |
||||
/** @var int */ |
||||
private $rename_tbl_log = 0; |
||||
|
||||
private function __construct() |
||||
{ |
||||
$this->timeStart = DUPX_U::getMicrotime(); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
return self::$instance; |
||||
} |
||||
|
||||
/** |
||||
* Returns mysqli handle |
||||
* |
||||
* @param array|null $customConnection |
||||
* |
||||
* @return mysqli|null |
||||
*/ |
||||
public function dbConnection($customConnection = null) |
||||
{ |
||||
if (!is_null($this->dbh)) { |
||||
return $this->dbh; |
||||
} |
||||
|
||||
$paramsManager = PrmMng::getInstance(); |
||||
if (is_null($customConnection)) { |
||||
if (!DUPX_Validation_manager::isValidated()) { |
||||
throw new Exception('Installer isn\'t validated'); |
||||
} |
||||
|
||||
$dbhost = $paramsManager->getValue(PrmMng::PARAM_DB_HOST); |
||||
$dbname = $paramsManager->getValue(PrmMng::PARAM_DB_NAME); |
||||
$dbuser = $paramsManager->getValue(PrmMng::PARAM_DB_USER); |
||||
$dbpass = $paramsManager->getValue(PrmMng::PARAM_DB_PASS); |
||||
} else { |
||||
$dbhost = $customConnection['dbhost']; |
||||
$dbname = $customConnection['dbname']; |
||||
$dbuser = $customConnection['dbuser']; |
||||
$dbpass = $customConnection['dbpass']; |
||||
} |
||||
|
||||
$dbflag = $paramsManager->getValue(PrmMng::PARAM_DB_FLAG); |
||||
if ($dbflag === DUPX_DB::DB_CONNECTION_FLAG_NOT_SET) { |
||||
$dbh = self::checkFlagsDbConnection($dbhost, $dbuser, $dbpass, $dbname); |
||||
$dbflag = $paramsManager->getValue(PrmMng::PARAM_DB_FLAG); |
||||
} else { |
||||
$dbh = DUPX_DB::connect($dbhost, $dbuser, $dbpass, $dbname, $dbflag); |
||||
} |
||||
|
||||
if ($dbh != false) { |
||||
$this->dbh = $dbh; |
||||
$this->dataConnection = array( |
||||
'dbhost' => $dbhost, |
||||
'dbname' => $dbname, |
||||
'dbuser' => $dbuser, |
||||
'dbpass' => $dbpass, |
||||
'dbflag' => $dbflag |
||||
); |
||||
} else { |
||||
$dbConnError = (mysqli_connect_error()) ? 'Error: ' . mysqli_connect_error() : 'Unable to Connect'; |
||||
$msg = "Unable to connect with the following parameters:<br/>" |
||||
. "HOST: " . Log::v2str($dbhost) . "\n" |
||||
. "DBUSER: " . Log::v2str($dbuser) . "\n" |
||||
. "DATABASE: " . Log::v2str($dbname) . "\n" |
||||
. "MESSAGE: " . $dbConnError; |
||||
Log::error($msg); |
||||
} |
||||
|
||||
if (is_null($customConnection)) { |
||||
$db_max_time = mysqli_real_escape_string($this->dbh, $GLOBALS['DB_MAX_TIME']); |
||||
DUPX_DB::mysqli_query($this->dbh, "SET wait_timeout = " . mysqli_real_escape_string($this->dbh, $db_max_time)); |
||||
DUPX_DB::setCharset($this->dbh, $paramsManager->getValue(PrmMng::PARAM_DB_CHARSET), $paramsManager->getValue(PrmMng::PARAM_DB_COLLATE)); |
||||
} |
||||
|
||||
return $this->dbh; |
||||
} |
||||
|
||||
/** |
||||
* Check flags dbconnection |
||||
* |
||||
* @param string $dbhost |
||||
* @param string $dbuser |
||||
* @param string $dbpass |
||||
* @param string $dbname |
||||
* |
||||
* @return bool|mysqli |
||||
*/ |
||||
protected static function checkFlagsDbConnection($dbhost, $dbuser, $dbpass, $dbname = null) |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$wpConfigFalgsVal = $paramsManager->getValue(PrmMng::PARAM_WP_CONF_MYSQL_CLIENT_FLAGS); |
||||
$isLocalhost = $dbhost == "localhost"; |
||||
|
||||
if (($dbh = DUPX_DB::connect($dbhost, $dbuser, $dbpass, $dbname)) != false) { |
||||
$dbflag = DUPX_DB::MYSQLI_CLIENT_NO_FLAGS; |
||||
$wpConfigFalgsVal['inWpConfig'] = false; |
||||
$wpConfigFalgsVal['value'] = array(); |
||||
} elseif (!$isLocalhost && ($dbh = DUPX_DB::connect($dbhost, $dbuser, $dbpass, $dbname, MYSQLI_CLIENT_SSL)) != false) { |
||||
$dbflag = MYSQLI_CLIENT_SSL; |
||||
$wpConfigFalgsVal['inWpConfig'] = true; |
||||
$wpConfigFalgsVal['value'] = array(MYSQLI_CLIENT_SSL); |
||||
} elseif ( |
||||
!$isLocalhost && |
||||
defined("MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT") && |
||||
// phpcs:ignore PHPCompatibility.Constants.NewConstants.mysqli_client_ssl_dont_verify_server_certFound |
||||
($dbh = DUPX_DB::connect($dbhost, $dbuser, $dbpass, $dbname, MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT)) != false |
||||
) { |
||||
// phpcs:ignore PHPCompatibility.Constants.NewConstants.mysqli_client_ssl_dont_verify_server_certFound |
||||
$dbflag = MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT; |
||||
$wpConfigFalgsVal['inWpConfig'] = true; |
||||
// phpcs:ignore PHPCompatibility.Constants.NewConstants.mysqli_client_ssl_dont_verify_server_certFound |
||||
$wpConfigFalgsVal['value'] = array(MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT); |
||||
} else { |
||||
$dbflag = DUPX_DB::MYSQLI_CLIENT_NO_FLAGS; |
||||
} |
||||
|
||||
$paramsManager->setValue(PrmMng::PARAM_DB_FLAG, $dbflag); |
||||
$paramsManager->setValue(PrmMng::PARAM_WP_CONF_MYSQL_CLIENT_FLAGS, $wpConfigFalgsVal); |
||||
|
||||
$paramsManager->save(); |
||||
|
||||
return $dbh; |
||||
} |
||||
|
||||
/** |
||||
* close db connection if is open |
||||
*/ |
||||
public function closeDbConnection() |
||||
{ |
||||
if (!is_null($this->dbh)) { |
||||
mysqli_close($this->dbh); |
||||
$this->dbh = null; |
||||
$this->dataConnection = null; |
||||
$this->charsetData = null; |
||||
$this->defaultCharset = null; |
||||
} |
||||
} |
||||
|
||||
public function getDefaultCharset() |
||||
{ |
||||
if (is_null($this->defaultCharset)) { |
||||
$this->dbConnection(); |
||||
|
||||
// SHOW VARIABLES LIKE "character_set_database" |
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, "SHOW VARIABLES LIKE 'character_set_database'")) === false) { |
||||
throw new Exception('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} |
||||
|
||||
if ($result->num_rows != 1) { |
||||
throw new Exception('DEFAULT CHARSET NUMBER NOT VALID NUM ' . $result->num_rows); |
||||
} |
||||
|
||||
while ($row = $result->fetch_array()) { |
||||
$this->defaultCharset = $row[1]; |
||||
} |
||||
|
||||
$result->free(); |
||||
} |
||||
return $this->defaultCharset; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $charset |
||||
* |
||||
* @return string|bool // false if charset don't exists |
||||
*/ |
||||
public function getDefaultCollateOfCharset($charset) |
||||
{ |
||||
$this->getCharsetAndCollationData(); |
||||
return isset($this->charsetData[$charset]) ? $this->charsetData[$charset]['defCollation'] : false; |
||||
} |
||||
|
||||
/** |
||||
* @return array list of supported MySQL engine data\ |
||||
*/ |
||||
public function getEngineData() |
||||
{ |
||||
if (is_null($this->engineData)) { |
||||
$this->dbConnection(); |
||||
|
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, "SHOW ENGINES")) === false) { |
||||
throw new Exception('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} |
||||
|
||||
$this->engineData = array(); |
||||
while ($row = $result->fetch_array()) { |
||||
if ($row[1] !== "YES" && $row[1] !== "DEFAULT") { |
||||
continue; |
||||
} |
||||
|
||||
$this->engineData[] = array( |
||||
"name" => $row[0], |
||||
"isDefault" => $row[1] === "DEFAULT" |
||||
); |
||||
} |
||||
} |
||||
|
||||
return $this->engineData; |
||||
} |
||||
|
||||
/** |
||||
* @return array list of supported MySQL engine names |
||||
*/ |
||||
public function getSupportedEngineList() |
||||
{ |
||||
return array_map(function ($engine) { |
||||
return $engine["name"]; |
||||
}, $this->getEngineData()); |
||||
} |
||||
|
||||
/** |
||||
* @return string the default MySQL engine of the database |
||||
*/ |
||||
public function getDefaultEngine() |
||||
{ |
||||
foreach ($this->engineData as $engine) { |
||||
if ($engine["isDefault"]) { |
||||
return $engine["name"]; |
||||
} |
||||
} |
||||
|
||||
return $this->engineData[0]["name"]; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return array |
||||
*/ |
||||
public function getCharsetAndCollationData() |
||||
{ |
||||
if (is_null($this->charsetData)) { |
||||
$this->dbConnection(); |
||||
|
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, "SHOW COLLATION")) === false) { |
||||
throw new Exception('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} |
||||
|
||||
while ($row = $result->fetch_array()) { |
||||
$collation = $row[0]; |
||||
$charset = $row[1]; |
||||
$default = filter_var($row[3], FILTER_VALIDATE_BOOLEAN); |
||||
$compiled = filter_var($row[4], FILTER_VALIDATE_BOOLEAN); |
||||
|
||||
if (!$compiled) { |
||||
continue; |
||||
} |
||||
|
||||
if (!isset($this->charsetData[$charset])) { |
||||
$this->charsetData[$charset] = array( |
||||
'defCollation' => false, |
||||
'collations' => array() |
||||
); |
||||
} |
||||
|
||||
$this->charsetData[$charset]['collations'][] = $collation; |
||||
if ($default) { |
||||
$this->charsetData[$charset]['defCollation'] = $collation; |
||||
} |
||||
} |
||||
|
||||
$result->free(); |
||||
|
||||
ksort($this->charsetData); |
||||
foreach (array_keys($this->charsetData) as $charset) { |
||||
sort($this->charsetData[$charset]['collations']); |
||||
} |
||||
} |
||||
return $this->charsetData; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getCharsetsList() |
||||
{ |
||||
return array_keys($this->getCharsetAndCollationData()); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getCollationsList() |
||||
{ |
||||
$result = array(); |
||||
foreach ($this->getCharsetAndCollationData() as $charsetInfo) { |
||||
$result = array_merge($result, $charsetInfo['collations']); |
||||
} |
||||
return array_unique($result); |
||||
} |
||||
|
||||
public function getRealCharsetByParam() |
||||
{ |
||||
$this->getCharsetAndCollationData(); |
||||
//$sourceCharset = DUPX_ArchiveConfig::getInstance()->getWpConfigDefineValue('DB_CHARSET', ''); |
||||
$sourceCharset = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_CHARSET); |
||||
return (array_key_exists($sourceCharset, $this->charsetData) ? $sourceCharset : $this->getDefaultCharset()); |
||||
} |
||||
|
||||
public function getRealCollateByParam() |
||||
{ |
||||
$this->getCharsetAndCollationData(); |
||||
$charset = $this->getRealCharsetByParam(); |
||||
//$sourceCollate = DUPX_ArchiveConfig::getInstance()->getWpConfigDefineValue('DB_COLLATE', ''); |
||||
$sourceCollate = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_COLLATE); |
||||
return (strlen($sourceCollate) == 0 || !in_array($sourceCollate, $this->charsetData[$charset]['collations'])) ? |
||||
$this->getDefaultCollateOfCharset($charset) : |
||||
$sourceCollate; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param null|string $prefix |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getOptionsTableName($prefix = null) |
||||
{ |
||||
if (is_null($prefix)) { |
||||
$prefix = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX); |
||||
} |
||||
return $prefix . 'options'; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param null|string $prefix |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getPostsTableName($prefix = null) |
||||
{ |
||||
if (is_null($prefix)) { |
||||
$prefix = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX); |
||||
} |
||||
return $prefix . 'posts'; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param null|string $prefix |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getUserTableName($prefix = null) |
||||
{ |
||||
if (is_null($prefix)) { |
||||
$prefix = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX); |
||||
} |
||||
return $prefix . 'users'; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param null|string $prefix |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getUserMetaTableName($prefix = null) |
||||
{ |
||||
if (is_null($prefix)) { |
||||
$prefix = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX); |
||||
} |
||||
return $prefix . 'usermeta'; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param null|string $prefix |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getPackagesTableName($prefix = null) |
||||
{ |
||||
if (is_null($prefix)) { |
||||
$prefix = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX); |
||||
} |
||||
return $prefix . 'duplicator_packages'; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $userLogin |
||||
* |
||||
* @return boolean return true if user login name exists in users table |
||||
*/ |
||||
public function checkIfUserNameExists($userLogin) |
||||
{ |
||||
if (!$this->tablesExist(self::getUserTableName())) { |
||||
return false; |
||||
} |
||||
|
||||
$query = 'SELECT ID FROM `' . mysqli_real_escape_string($this->dbh, self::getUserTableName()) . '` ' |
||||
. 'WHERE user_login="' . mysqli_real_escape_string($this->dbh, $userLogin) . '"'; |
||||
|
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, $query)) === false) { |
||||
throw new Exception('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} |
||||
|
||||
return ($result->num_rows > 0); |
||||
} |
||||
|
||||
public function userPwdReset($userId, $newPassword) |
||||
{ |
||||
$tableName = mysqli_real_escape_string($this->dbh, self::getUserTableName()); |
||||
$query = 'UPDATE `' . $tableName . '` ' |
||||
. 'SET `user_pass` = MD5("' . mysqli_real_escape_string($this->dbh, $newPassword) . '") ' |
||||
. 'WHERE `' . $tableName . '`.`ID` = ' . $userId; |
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, $query)) === false) { |
||||
throw new Exception('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} else { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* return true if all tables passed in list exists |
||||
* |
||||
* @param string|array $tables |
||||
*/ |
||||
public function tablesExist($tables) |
||||
{ |
||||
$this->dbConnection(); |
||||
|
||||
if (is_scalar($tables)) { |
||||
$tables = array($tables); |
||||
} |
||||
$dbName = mysqli_real_escape_string($this->dbh, $this->dataConnection['dbname']); |
||||
$dbh = $this->dbh; |
||||
|
||||
$escapedTables = array_map(function ($table) use ($dbh) { |
||||
return "'" . mysqli_real_escape_string($dbh, $table) . "'"; |
||||
}, $tables); |
||||
|
||||
$sql = 'SHOW TABLES FROM `' . $dbName . '` WHERE `Tables_in_' . $dbName . '` IN (' . implode(',', $escapedTables) . ')'; |
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, $sql)) === false) { |
||||
return false; |
||||
} |
||||
|
||||
return $result->num_rows === count($tables); |
||||
} |
||||
|
||||
/** |
||||
* Get table replace names from regex pattern |
||||
* |
||||
* @param string[] $tableList |
||||
* @param string $pattern regex search string |
||||
* @param string $replacement regex replace string |
||||
* |
||||
* @return array [ |
||||
* [ |
||||
* 'old' => string |
||||
* 'new' => string |
||||
* ] |
||||
* ] |
||||
*/ |
||||
protected static function getTablesReplaceList($tableList, $pattern, $replacement) |
||||
{ |
||||
$result = array(); |
||||
if (count($tableList) == 0) { |
||||
return $result; |
||||
} |
||||
sort($tableList); |
||||
$newNames = $tableList; |
||||
|
||||
foreach ($tableList as $index => $oldName) { |
||||
$newName = substr(preg_replace($pattern, $replacement, $oldName), 0, 64); // Truncate too long table names |
||||
$nSuffix = 1; |
||||
while (in_array($newName, $newNames)) { |
||||
$suffix = '_' . base_convert($nSuffix, 10, 36); |
||||
$newName = substr($newName, 0, -strlen($suffix)) . $suffix; |
||||
$nSuffix++; |
||||
} |
||||
$newNames[$index] = $newName; |
||||
$result[] = array( |
||||
'old' => $oldName, |
||||
'new' => $newName |
||||
); |
||||
} |
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param type $newPrefix |
||||
* @param type $options |
||||
*/ |
||||
public function pregReplaceTableName($pattern, $replacement, $options = array()) |
||||
{ |
||||
$this->dbConnection(); |
||||
|
||||
$options = array_merge(array( |
||||
'exclude' => array(), // exclude table list, |
||||
'prefixFilter' => false, |
||||
'regexFilter' => false, // filter tables with regexp |
||||
'notRegexFilter' => false, // filter tables with not regexp |
||||
'regexTablesDropFkeys' => false, |
||||
'copyTables' => array() // tables that needs to be copied instead of renamed |
||||
), $options); |
||||
|
||||
$escapedDbName = mysqli_real_escape_string($this->dbh, PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_NAME)); |
||||
|
||||
$tablesIn = 'Tables_in_' . $escapedDbName; |
||||
|
||||
$where = ' WHERE TRUE'; |
||||
|
||||
if ($options['prefixFilter'] !== false) { |
||||
$where .= ' AND `' . $tablesIn . '` NOT REGEXP "^' . mysqli_real_escape_string($this->dbh, SnapDB::quoteRegex($options['prefixFilter'])) . '.+"'; |
||||
} |
||||
|
||||
if ($options['regexFilter'] !== false) { |
||||
$where .= ' AND `' . $tablesIn . '` REGEXP "' . mysqli_real_escape_string($this->dbh, $options['regexFilter']) . '"'; |
||||
} |
||||
|
||||
if ($options['notRegexFilter'] !== false) { |
||||
$where .= ' AND `' . $tablesIn . '` NOT REGEXP "' . mysqli_real_escape_string($this->dbh, $options['notRegexFilter']) . '"'; |
||||
} |
||||
|
||||
if (($tablesList = DUPX_DB::queryColumnToArray($this->dbh, 'SHOW TABLES FROM `' . $escapedDbName . '`' . $where)) === false) { |
||||
Log::error('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} |
||||
|
||||
if (is_array($options['exclude'])) { |
||||
$tablesList = array_diff($tablesList, $options['exclude']); |
||||
} |
||||
|
||||
$this->rename_tbl_log = 0; |
||||
|
||||
if (count($tablesList) == 0) { |
||||
return; |
||||
} |
||||
|
||||
$replaceList = self::getTablesReplaceList($tablesList, $pattern, $replacement); |
||||
|
||||
DUPX_DB::mysqli_query($this->dbh, "SET FOREIGN_KEY_CHECKS = 0;"); |
||||
foreach ($replaceList as $replace) { |
||||
$table = $replace['old']; |
||||
$newName = $replace['new']; |
||||
|
||||
if (in_array($table, $options['copyTables'])) { |
||||
$this->copyTable($table, $newName, true); |
||||
} else { |
||||
$this->renameTable($table, $newName, true); |
||||
} |
||||
|
||||
$this->rename_tbl_log++; |
||||
} |
||||
|
||||
if ($options['regexTablesDropFkeys'] !== false) { |
||||
Log::info('DROP FOREING KEYS'); |
||||
$this->dropForeignKeys($options['regexTablesDropFkeys']); |
||||
} |
||||
|
||||
DUPX_DB::mysqli_query($this->dbh, "SET FOREIGN_KEY_CHECKS = 1;"); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $tableNamePatten |
||||
* |
||||
* @return array |
||||
*/ |
||||
public function getForeinKeysData($tableNamePatten = false) |
||||
{ |
||||
$this->dbConnection(); |
||||
|
||||
//SELECT CONSTRAINT_NAME FROM information_schema.table_constraints WHERE `CONSTRAINT_TYPE` = 'FOREIGN KEY AND constraint_schema = 'temp_db_test_1234' AND `TABLE_NAME` = 'renamed'' |
||||
$escapedDbName = mysqli_real_escape_string($this->dbh, PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_NAME)); |
||||
$escapePattenr = mysqli_real_escape_string($this->dbh, $tableNamePatten); |
||||
|
||||
$where = " WHERE `CONSTRAINT_TYPE` = 'FOREIGN KEY' AND constraint_schema = '" . $escapedDbName . "'"; |
||||
if ($tableNamePatten !== false) { |
||||
$where .= " AND `TABLE_NAME` REGEXP '" . $escapePattenr . "'"; |
||||
} |
||||
|
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, "SELECT TABLE_NAME as tableName, CONSTRAINT_NAME as fKeyName FROM information_schema.table_constraints " . $where)) === false) { |
||||
Log::error('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} |
||||
|
||||
|
||||
return $result->fetch_all(MYSQLI_ASSOC); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $tableNamePatten |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function dropForeignKeys($tableNamePatten = false) |
||||
{ |
||||
foreach ($this->getForeinKeysData($tableNamePatten) as $fKeyData) { |
||||
$escapedTableName = mysqli_real_escape_string($this->dbh, $fKeyData['tableName']); |
||||
$escapedFKeyName = mysqli_real_escape_string($this->dbh, $fKeyData['fKeyName']); |
||||
if (DUPX_DB::mysqli_query($this->dbh, 'ALTER TABLE `' . $escapedTableName . '` DROP CONSTRAINT `' . $escapedFKeyName . '`') === false) { |
||||
Log::error('SQL ERROR:' . mysqli_error($this->dbh)); |
||||
} |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
public function copyTable($existing_name, $new_name, $delete_if_conflict = false) |
||||
{ |
||||
$this->dbConnection(); |
||||
return DUPX_DB::copyTable($this->dbh, $existing_name, $new_name, $delete_if_conflict); |
||||
} |
||||
|
||||
public function renameTable($existing_name, $new_name, $delete_if_conflict = false) |
||||
{ |
||||
$this->dbConnection(); |
||||
return DUPX_DB::renameTable($this->dbh, $existing_name, $new_name, $delete_if_conflict); |
||||
} |
||||
|
||||
public function dropTable($name) |
||||
{ |
||||
$this->dbConnection(); |
||||
return DUPX_DB::dropTable($this->dbh, $name); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $prefix |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function getAdminUsers($prefix) |
||||
{ |
||||
$escapedPrefix = mysqli_real_escape_string($this->dbh, $prefix); |
||||
$userTable = mysqli_real_escape_string($this->dbh, $this->getUserTableName($prefix)); |
||||
$userMetaTable = mysqli_real_escape_string($this->dbh, $this->getUserMetaTableName($prefix)); |
||||
|
||||
$sql = 'SELECT `' . $userTable . '`.`id` AS id, `' . $userTable . '`.`user_login` AS user_login FROM `' . $userTable . '` ' |
||||
. 'INNER JOIN `' . $userMetaTable . '` ON ( `' . $userTable . '`.`id` = `' . $userMetaTable . '`.`user_id` ) ' |
||||
. 'WHERE `' . $userMetaTable . '`.`meta_key` = "' . $escapedPrefix . 'capabilities" AND `' . $userMetaTable . '`.`meta_value` LIKE "%\"administrator\"%" ' |
||||
. 'ORDER BY user_login ASC'; |
||||
|
||||
if (($queryResult = DUPX_DB::mysqli_query($this->dbh, $sql)) === false) { |
||||
return false; |
||||
} |
||||
|
||||
$result = array(); |
||||
while ($row = $queryResult->fetch_assoc()) { |
||||
$result[] = $row; |
||||
} |
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Returns the Duplicator version if it exists, otherwise false |
||||
* |
||||
* @param $prefix |
||||
* |
||||
* @return false|string Duplicator version |
||||
*/ |
||||
public function getDuplicatorVersion($prefix) |
||||
{ |
||||
$optionsTable = self::getOptionsTableName($prefix); |
||||
$sql = "SELECT `option_value` FROM `{$optionsTable}` WHERE `option_name` = 'duplicator_version_plugin'"; |
||||
|
||||
if (($queryResult = DUPX_DB::mysqli_query($this->dbh, $sql)) === false || $queryResult->num_rows === 0) { |
||||
return false; |
||||
} |
||||
|
||||
$row = $queryResult->fetch_row(); |
||||
return $row[0]; |
||||
} |
||||
|
||||
/** |
||||
* Return ustat identifier |
||||
* |
||||
* @param string $prefix table prefix |
||||
* |
||||
* @return string ustat identifier |
||||
*/ |
||||
public function getUstatIdentifier($prefix) |
||||
{ |
||||
$optionsTable = self::getOptionsTableName($prefix); |
||||
$sql = "SELECT `option_value` FROM `{$optionsTable}` WHERE `option_name` = 'duplicator_plugin_data_stats'"; |
||||
|
||||
if (($queryResult = DUPX_DB::mysqli_query($this->dbh, $sql)) === false || $queryResult->num_rows === 0) { |
||||
return ''; |
||||
} |
||||
|
||||
$dataStat = $queryResult->fetch_row(); |
||||
$dataStat = json_decode($dataStat[0], true); |
||||
return isset($dataStat['identifier']) ? $dataStat['identifier'] : ''; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param int $userId |
||||
* @param null|string $prefix |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function updatePostsAuthor($userId, $prefix = null) |
||||
{ |
||||
$this->dbConnection(); |
||||
//UPDATE `i5tr4_posts` SET `post_author` = 7 WHERE TRUE |
||||
$postsTable = mysqli_real_escape_string($this->dbh, $this->getPostsTableName($prefix)); |
||||
$sql = 'UPDATE `' . $postsTable . '` SET `post_author` = ' . ((int) $userId) . ' WHERE TRUE'; |
||||
Log::info('EXECUTE QUERY ' . $sql); |
||||
if (($result = DUPX_DB::mysqli_query($this->dbh, $sql)) === false) { |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] Array of tables to be excluded |
||||
*/ |
||||
public static function getExcludedTables() |
||||
{ |
||||
$excludedTables = array(); |
||||
|
||||
if (ParamDescUsers::getUsersMode() !== ParamDescUsers::USER_MODE_OVERWRITE) { |
||||
$overwriteData = PrmMng::getInstance()->getValue(PrmMng::PARAM_OVERWRITE_SITE_DATA); |
||||
$excludedTables[] = self::getUserTableName($overwriteData['table_prefix']); |
||||
$excludedTables[] = self::getUserMetaTableName($overwriteData['table_prefix']); |
||||
} |
||||
|
||||
return $excludedTables; |
||||
} |
||||
} |
@ -1,696 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Lightweight abstraction layer for common simple database routines |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
|
||||
class DUPX_DB |
||||
{ |
||||
const DELETE_CHUNK_SIZE = 500; |
||||
const MYSQLI_CLIENT_NO_FLAGS = 0; |
||||
const DB_CONNECTION_FLAG_NOT_SET = -1; |
||||
|
||||
/** |
||||
* Modified version of https://developer.wordpress.org/reference/classes/wpdb/db_connect/ |
||||
* |
||||
* @param string $host The server host name |
||||
* @param string $username The server DB user name |
||||
* @param string $password The server DB password |
||||
* @param string $dbname The server DB name |
||||
* @param int $flag Extra flags for connection |
||||
* |
||||
* @return mysqli|null Database connection handle |
||||
*/ |
||||
public static function connect($host, $username, $password, $dbname = null, $flag = self::MYSQLI_CLIENT_NO_FLAGS) |
||||
{ |
||||
try { |
||||
$port = null; |
||||
$socket = null; |
||||
$is_ipv6 = false; |
||||
$host_data = self::parseDBHost($host); |
||||
if ($host_data) { |
||||
list($host, $port, $socket, $is_ipv6) = $host_data; |
||||
} |
||||
|
||||
/* |
||||
* If using the `mysqlnd` library, the IPv6 address needs to be |
||||
* enclosed in square brackets, whereas it doesn't while using the |
||||
* `libmysqlclient` library. |
||||
* @see https://bugs.php.net/bug.php?id=67563 |
||||
*/ |
||||
if ($is_ipv6 && extension_loaded('mysqlnd')) { |
||||
$host = "[$host]"; |
||||
} |
||||
|
||||
$dbh = mysqli_init(); |
||||
@mysqli_real_connect($dbh, $host, $username, $password, null, $port, $socket, $flag); |
||||
if ($dbh->connect_errno) { |
||||
$dbh = null; |
||||
Log::info('DATABASE CONNECTION ERROR: ' . mysqli_connect_error() . '[ERRNO:' . mysqli_connect_errno() . ']'); |
||||
} else { |
||||
if (method_exists($dbh, 'options')) { |
||||
$dbh->options(MYSQLI_OPT_LOCAL_INFILE, false); |
||||
} |
||||
} |
||||
|
||||
if (!empty($dbname)) { |
||||
if (mysqli_select_db($dbh, mysqli_real_escape_string($dbh, $dbname)) == false) { |
||||
Log::info('DATABASE SELECT DB ERROR: ' . $dbname . ' BUT IS CONNECTED SO CONTINUE'); |
||||
} |
||||
} |
||||
} catch (Exception $e) { |
||||
Log::info('DATABASE CONNECTION EXCEPTION ERROR: ' . $e->getMessage()); |
||||
return null; |
||||
} |
||||
return $dbh; |
||||
} |
||||
|
||||
/** |
||||
* Modified version of https://developer.wordpress.org/reference/classes/wpdb/parse_db_host/ |
||||
* |
||||
* @param string $host The DB_HOST setting to parse |
||||
* |
||||
* @return array|bool Array containing the host, the port, the socket and whether it is an IPv6 address, in that order. |
||||
* If $host couldn't be parsed, returns false |
||||
*/ |
||||
public static function parseDBHost($host) |
||||
{ |
||||
$port = null; |
||||
$socket = null; |
||||
$is_ipv6 = false; |
||||
// First peel off the socket parameter from the right, if it exists. |
||||
$socket_pos = strpos($host, ':/'); |
||||
if (false !== $socket_pos) { |
||||
$socket = substr($host, $socket_pos + 1); |
||||
$host = substr($host, 0, $socket_pos); |
||||
} |
||||
|
||||
// We need to check for an IPv6 address first. |
||||
// An IPv6 address will always contain at least two colons. |
||||
if (substr_count($host, ':') > 1) { |
||||
$pattern = '#^(?:\[)?(?P<host>[0-9a-fA-F:]+)(?:\]:(?P<port>[\d]+))?#'; |
||||
$is_ipv6 = true; |
||||
} else { |
||||
// We seem to be dealing with an IPv4 address. |
||||
$pattern = '#^(?P<host>[^:/]*)(?::(?P<port>[\d]+))?#'; |
||||
} |
||||
|
||||
$matches = array(); |
||||
$result = preg_match($pattern, $host, $matches); |
||||
if (1 !== $result) { |
||||
// Couldn't parse the address, bail. |
||||
return false; |
||||
} |
||||
|
||||
$host = ''; |
||||
foreach (array('host', 'port') as $component) { |
||||
if (!empty($matches[$component])) { |
||||
$$component = $matches[$component]; |
||||
} |
||||
} |
||||
|
||||
return array($host, $port, $socket, $is_ipv6); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $host The server host name |
||||
* @param string $username The server DB user name |
||||
* @param string $password The server DB password |
||||
* @param string $dbname The server DB name |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public static function testConnection($host, $username, $password, $dbname = '') |
||||
{ |
||||
if (($dbh = DUPX_DB::connect($host, $username, $password, $dbname))) { |
||||
mysqli_close($dbh); |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Count the tables in a given database |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $dbname Database to count tables in |
||||
* |
||||
* @return int The number of tables in the database |
||||
*/ |
||||
public static function countTables($dbh, $dbname) |
||||
{ |
||||
$res = self::mysqli_query($dbh, "SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = '" . mysqli_real_escape_string($dbh, $dbname) . "' "); |
||||
$row = mysqli_fetch_row($res); |
||||
return is_null($row) ? 0 : $row[0]; |
||||
} |
||||
|
||||
/** |
||||
* Returns the number of rows in a table |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $name A valid table name |
||||
*/ |
||||
public static function countTableRows($dbh, $name) |
||||
{ |
||||
$total = self::mysqli_query($dbh, "SELECT COUNT(*) FROM `" . mysqli_real_escape_string($dbh, $name) . "`"); |
||||
if ($total) { |
||||
$total = @mysqli_fetch_array($total); |
||||
return $total[0]; |
||||
} else { |
||||
return 0; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Get default character set |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* |
||||
* @return string Default charset |
||||
*/ |
||||
public static function getDefaultCharSet($dbh) |
||||
{ |
||||
static $defaultCharset = null; |
||||
if (is_null($defaultCharset)) { |
||||
$query = 'SHOW VARIABLES LIKE "character_set_database"'; |
||||
if (($result = self::mysqli_query($dbh, $query))) { |
||||
if (($row = $result->fetch_assoc())) { |
||||
$defaultCharset = $row["Value"]; |
||||
} |
||||
$result->free(); |
||||
} else { |
||||
$defaultCharset = ''; |
||||
} |
||||
} |
||||
|
||||
return $defaultCharset; |
||||
} |
||||
|
||||
/** |
||||
* Get Supported charset list |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* |
||||
* @return array Supported charset list |
||||
*/ |
||||
public static function getSupportedCharSetList($dbh) |
||||
{ |
||||
static $charsetList = null; |
||||
if (is_null($charsetList)) { |
||||
$charsetList = array(); |
||||
$query = "SHOW CHARACTER SET;"; |
||||
if (($result = self::mysqli_query($dbh, $query))) { |
||||
while ($row = $result->fetch_assoc()) { |
||||
$charsetList[] = $row["Charset"]; |
||||
} |
||||
$result->free(); |
||||
} |
||||
sort($charsetList); |
||||
} |
||||
return $charsetList; |
||||
} |
||||
|
||||
/** |
||||
* Get Supported collations along with character set |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* |
||||
* @return array Supported collation |
||||
*/ |
||||
public static function getSupportedCollates($dbh) |
||||
{ |
||||
static $collations = null; |
||||
if (is_null($collations)) { |
||||
$collations = array(); |
||||
$query = "SHOW COLLATION"; |
||||
if (($result = self::mysqli_query($dbh, $query))) { |
||||
while ($row = $result->fetch_assoc()) { |
||||
$collations[] = $row; |
||||
} |
||||
$result->free(); |
||||
} |
||||
|
||||
usort($collations, function ($a, $b) { |
||||
|
||||
return strcmp($a['Collation'], $b['Collation']); |
||||
}); |
||||
} |
||||
return $collations; |
||||
} |
||||
|
||||
/** |
||||
* Get Supported collations along with character set |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* |
||||
* @return array Supported collation |
||||
*/ |
||||
public static function getSupportedCollateList($dbh) |
||||
{ |
||||
static $collates = null; |
||||
if (is_null($collates)) { |
||||
$collates = array(); |
||||
$query = "SHOW COLLATION"; |
||||
if (($result = self::mysqli_query($dbh, $query))) { |
||||
while ($row = $result->fetch_assoc()) { |
||||
$collates[] = $row['Collation']; |
||||
} |
||||
$result->free(); |
||||
} |
||||
sort($collates); |
||||
} |
||||
return $collates; |
||||
} |
||||
|
||||
/** |
||||
* Returns the database names as an array |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $dbuser An optional dbuser name to search by |
||||
* |
||||
* @return array A list of all database names |
||||
*/ |
||||
public static function getDatabases($dbh, $dbuser = '') |
||||
{ |
||||
$sql = strlen($dbuser) ? "SHOW DATABASES LIKE '%" . mysqli_real_escape_string($dbh, $dbuser) . "%'" : 'SHOW DATABASES'; |
||||
$query = self::mysqli_query($dbh, $sql); |
||||
if ($query) { |
||||
while ($db = @mysqli_fetch_array($query)) { |
||||
$all_dbs[] = $db[0]; |
||||
} |
||||
if (isset($all_dbs) && is_array($all_dbs)) { |
||||
return $all_dbs; |
||||
} |
||||
} |
||||
return array(); |
||||
} |
||||
|
||||
/** |
||||
* Check if database exists |
||||
* |
||||
* @param obj|mysqli $dbh DB connection |
||||
* @param string $dbname database name |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function databaseExists($dbh, $dbname) |
||||
{ |
||||
$sql = 'SELECT COUNT(SCHEMA_NAME) AS databaseExists ' . |
||||
'FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = "' . mysqli_real_escape_string($dbh, $dbname) . '"'; |
||||
|
||||
$res = self::mysqli_query($dbh, $sql); |
||||
$row = mysqli_fetch_row($res); |
||||
|
||||
return (!is_null($row) && $row[0] >= 1); |
||||
} |
||||
|
||||
/** |
||||
* Select database if exists |
||||
* |
||||
* @param mysqli|obj $dbh |
||||
* @param string $dbname |
||||
* |
||||
* @return bool false on failure |
||||
*/ |
||||
public static function selectDB($dbh, $dbname) |
||||
{ |
||||
if (!self::databaseExists($dbh, $dbname)) { |
||||
return false; |
||||
} |
||||
|
||||
return mysqli_select_db($dbh, $dbname); |
||||
} |
||||
|
||||
/** |
||||
* Returns the tables for a database as an array |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* |
||||
* @return array A list of all table names |
||||
*/ |
||||
public static function getTables($dbh) |
||||
{ |
||||
$query = self::mysqli_query($dbh, 'SHOW TABLES'); |
||||
if ($query) { |
||||
$all_tables = array(); |
||||
while ($table = @mysqli_fetch_array($query)) { |
||||
$all_tables[] = $table[0]; |
||||
} |
||||
return $all_tables; |
||||
} |
||||
return array(); |
||||
} |
||||
|
||||
/** |
||||
* Get the requested MySQL system variable |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $name The database variable name to lookup |
||||
* @param mixed $default default value if query fail |
||||
* |
||||
* @return string the server variable to query for |
||||
*/ |
||||
public static function getVariable($dbh, $name, $default = null) |
||||
{ |
||||
if (($result = self::mysqli_query($dbh, "SHOW VARIABLES LIKE '" . mysqli_real_escape_string($dbh, $name) . "'")) == false) { |
||||
return $default; |
||||
} |
||||
$row = @mysqli_fetch_array($result); |
||||
@mysqli_free_result($result); |
||||
return isset($row[1]) ? $row[1] : $default; |
||||
} |
||||
|
||||
/** |
||||
* Gets the MySQL database version number |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param bool $full True: Gets the full version |
||||
* False: Gets only the numeric portion i.e. 5.5.6 or 10.1.2 (for MariaDB) |
||||
* |
||||
* @return string '0' on failure, version number on success |
||||
*/ |
||||
public static function getVersion($dbh, $full = false) |
||||
{ |
||||
if ($full) { |
||||
$version = self::getVariable($dbh, 'version', ''); |
||||
} else { |
||||
$version = preg_replace('/[^0-9.].*/', '', self::getVariable($dbh, 'version', '')); |
||||
} |
||||
|
||||
//Fall-back for servers that have restricted SQL for SHOW statement |
||||
//Note: For MariaDB this will report something like 5.5.5 when it is really 10.2.1. |
||||
//This mainly is due to mysqli_get_server_info method which gets the version comment |
||||
//and uses a regex vs getting just the int version of the value. So while the former |
||||
//code above is much more accurate it may fail in rare situations |
||||
if (empty($version)) { |
||||
$version = mysqli_get_server_info($dbh); |
||||
$version = preg_replace('/[^0-9.].*/', '', $version); |
||||
} |
||||
|
||||
return empty($version) ? '0' : $version; |
||||
} |
||||
|
||||
/** |
||||
* Determine if a MySQL database supports a particular feature |
||||
* |
||||
* @param \mysqli $dbh Database connection handle |
||||
* @param string $feature the feature to check for |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function hasAbility($dbh, $feature) |
||||
{ |
||||
$version = self::getVersion($dbh); |
||||
switch (strtolower($feature)) { |
||||
case 'collation': |
||||
case 'group_concat': |
||||
case 'subqueries': |
||||
return version_compare($version, '4.1', '>='); |
||||
case 'set_charset': |
||||
return version_compare($version, '5.0.7', '>='); |
||||
}; |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* Runs a query and returns the results as an array with the column names |
||||
* |
||||
* @param obj $dbh A valid database link handle |
||||
* @param string $sql The sql to run |
||||
* |
||||
* @return array The result of the query as an array with the column name as the key |
||||
*/ |
||||
public static function queryColumnToArray($dbh, $sql, $column_index = 0) |
||||
{ |
||||
$result_array = array(); |
||||
$full_result_array = self::queryToArray($dbh, $sql); |
||||
|
||||
for ($i = 0; $i < count($full_result_array); $i++) { |
||||
$result_array[] = $full_result_array[$i][$column_index]; |
||||
} |
||||
return $result_array; |
||||
} |
||||
|
||||
/** |
||||
* Runs a query with no result |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $sql The sql to run |
||||
* |
||||
* @return array The result of the query as an array |
||||
*/ |
||||
public static function queryToArray($dbh, $sql) |
||||
{ |
||||
$result = array(); |
||||
$query_result = self::mysqli_query($dbh, $sql); |
||||
if ($query_result !== false) { |
||||
if (mysqli_num_rows($query_result) > 0) { |
||||
while ($row = mysqli_fetch_row($query_result)) { |
||||
$result[] = $row; |
||||
} |
||||
} |
||||
} else { |
||||
$error = mysqli_error($dbh); |
||||
throw new Exception("Error executing query {$sql}.<br/>{$error}"); |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Runs a query with no result |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $sql The sql to run |
||||
* |
||||
* @return void |
||||
*/ |
||||
public static function queryNoReturn($dbh, $sql) |
||||
{ |
||||
if (self::mysqli_query($dbh, $sql) === false) { |
||||
$error = mysqli_error($dbh); |
||||
throw new Exception("Error executing query {$sql}.<br/>{$error}"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Drops the table given |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $name A valid table name to remove |
||||
* |
||||
* @return null |
||||
*/ |
||||
public static function dropTable($dbh, $name) |
||||
{ |
||||
Log::info('DROP TABLE ' . $name, Log::LV_DETAILED); |
||||
$escapedName = mysqli_real_escape_string($dbh, $name); |
||||
self::queryNoReturn($dbh, 'DROP TABLE IF EXISTS `' . $escapedName . '`'); |
||||
} |
||||
|
||||
/** |
||||
* Renames an existing table |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $existing_name The current tables name |
||||
* @param string $new_name The new table name to replace the existing name |
||||
* @param string $delete_if_conflict Delete the table name if there is a conflict |
||||
* |
||||
* @return null |
||||
*/ |
||||
public static function renameTable($dbh, $existing_name, $new_name, $delete_if_conflict = false) |
||||
{ |
||||
|
||||
if ($delete_if_conflict) { |
||||
self::dropTable($dbh, $new_name); |
||||
} |
||||
|
||||
Log::info('RENAME TABLE ' . $existing_name . ' TO ' . $new_name); |
||||
$escapedOldName = mysqli_real_escape_string($dbh, $existing_name); |
||||
$escapedNewName = mysqli_real_escape_string($dbh, $new_name); |
||||
self::queryNoReturn($dbh, 'RENAME TABLE `' . $escapedOldName . '` TO `' . $escapedNewName . '`'); |
||||
} |
||||
|
||||
/** |
||||
* Renames an existing table |
||||
* |
||||
* @param \mysqli $dbh A valid database link handle |
||||
* @param string $existing_name The current tables name |
||||
* @param string $new_name The new table name to replace the existing name |
||||
* @param string $delete_if_conflict Delete the table name if there is a conflict |
||||
* |
||||
* @return null |
||||
*/ |
||||
public static function copyTable($dbh, $existing_name, $new_name, $delete_if_conflict = false) |
||||
{ |
||||
if ($delete_if_conflict) { |
||||
self::dropTable($dbh, $new_name); |
||||
} |
||||
|
||||
Log::info('COPY TABLE ' . $existing_name . ' TO ' . $new_name); |
||||
$escapedOldName = mysqli_real_escape_string($dbh, $existing_name); |
||||
$escapedNewName = mysqli_real_escape_string($dbh, $new_name); |
||||
self::queryNoReturn($dbh, 'CREATE TABLE `' . $escapedNewName . '` LIKE `' . $escapedOldName . '`'); |
||||
self::queryNoReturn($dbh, 'INSERT INTO `' . $escapedNewName . '` SELECT * FROM `' . $escapedOldName . '`'); |
||||
} |
||||
|
||||
/** |
||||
* Sets the MySQL connection's character set. |
||||
* |
||||
* @param \mysqli $dbh The resource given by mysqli_connect |
||||
* @param ?string $charset The character set, null default value |
||||
* @param ?string $collate The collation, null default value |
||||
*/ |
||||
public static function setCharset($dbh, $charset = null, $collate = null) |
||||
{ |
||||
if (!self::hasAbility($dbh, 'collation')) { |
||||
return false; |
||||
} |
||||
|
||||
$charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset; |
||||
$collate = (!isset($collate) ) ? '' : $collate; |
||||
|
||||
if (empty($charset)) { |
||||
return true; |
||||
} |
||||
|
||||
if (function_exists('mysqli_set_charset') && self::hasAbility($dbh, 'set_charset')) { |
||||
try { |
||||
if (($result1 = mysqli_set_charset($dbh, $charset)) === false) { |
||||
$errMsg = mysqli_error($dbh); |
||||
Log::info('DATABASE ERROR: mysqli_set_charset ' . Log::v2str($charset) . ' MSG: ' . $errMsg); |
||||
} else { |
||||
Log::info('DATABASE: mysqli_set_charset ' . Log::v2str($charset), Log::LV_DETAILED); |
||||
} |
||||
} catch (Exception $e) { |
||||
Log::info('DATABASE ERROR: mysqli_set_charset ' . Log::v2str($charset) . ' MSG: ' . $e->getMessage()); |
||||
$result1 = false; |
||||
} |
||||
|
||||
if (!empty($collate)) { |
||||
$sql = "SET collation_connection = " . mysqli_real_escape_string($dbh, $collate); |
||||
if (($result2 = self::mysqli_query($dbh, $sql)) === false) { |
||||
$errMsg = mysqli_error($dbh); |
||||
Log::info('DATABASE ERROR: SET collation_connection ' . Log::v2str($collate) . ' MSG: ' . $errMsg); |
||||
} else { |
||||
Log::info('DATABASE: SET collation_connection ' . Log::v2str($collate), Log::LV_DETAILED); |
||||
} |
||||
} else { |
||||
$result2 = true; |
||||
} |
||||
|
||||
return $result1 && $result2; |
||||
} else { |
||||
$sql = " SET NAMES " . mysqli_real_escape_string($dbh, $charset); |
||||
if (!empty($collate)) { |
||||
$sql .= " COLLATE " . mysqli_real_escape_string($dbh, $collate); |
||||
} |
||||
|
||||
if (($result = self::mysqli_query($dbh, $sql)) === false) { |
||||
$errMsg = mysqli_error($dbh); |
||||
Log::info('DATABASE SQL ERROR: ' . Log::v2str($sql) . ' MSG: ' . $errMsg); |
||||
} else { |
||||
Log::info('DATABASE SQL: ' . Log::v2str($sql), Log::LV_DETAILED); |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param \mysqli $dbh The resource given by mysqli_connect |
||||
* |
||||
* @return bool|string // return false if current database isent selected or the string name |
||||
*/ |
||||
public static function getCurrentDatabase($dbh) |
||||
{ |
||||
// SELECT DATABASE() as db; |
||||
if (($result = self::mysqli_query($dbh, 'SELECT DATABASE() as db')) === false) { |
||||
return false; |
||||
} |
||||
$assoc = $result->fetch_assoc(); |
||||
return isset($assoc['db']) ? $assoc['db'] : false; |
||||
} |
||||
|
||||
/** |
||||
* mysqli_query wrapper with logging |
||||
* |
||||
* @param mysqli $link |
||||
* @param string $sql |
||||
* @param int $logFailLevel // Write in the log only if the log level is equal to or greater than level |
||||
* |
||||
* @return mysqli_result|bool For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries, mysqli_query() will return a mysqli_result object. |
||||
* For other successful queries mysqli_query() will return TRUE. Returns FALSE on failure |
||||
*/ |
||||
public static function mysqli_query(\mysqli $link, $query, $logFailLevel = Log::LV_DEFAULT, $resultmode = MYSQLI_STORE_RESULT) |
||||
{ |
||||
try { |
||||
$result = mysqli_query($link, $query, $resultmode); |
||||
} catch (Exception $e) { |
||||
$result = false; |
||||
} |
||||
|
||||
self::query_log_callback($link, $result, $query, $logFailLevel); |
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param mysqli_result|bool $result |
||||
*/ |
||||
public static function query_log_callback(\mysqli $link, $result, $query, $logFailLevel = Log::LV_DEFAULT) |
||||
{ |
||||
if ($result === false) { |
||||
if (Log::isLevel($logFailLevel)) { |
||||
$callers = debug_backtrace(); |
||||
$file = $callers[0]['file']; |
||||
$line = $callers[0]['line']; |
||||
$queryLog = substr($query, 0, Log::isLevel(Log::LV_DEBUG) ? 10000 : 500); |
||||
Log::info('DB QUERY [ERROR][' . $file . ':' . $line . '] MSG: ' . mysqli_error($link) . "\n\tSQL: " . $queryLog); |
||||
Log::info(Log::traceToString($callers, 1)); |
||||
} |
||||
} else { |
||||
if (Log::isLevel(Log::LV_HARD_DEBUG)) { |
||||
$callers = debug_backtrace(); |
||||
$file = $callers[0]['file']; |
||||
$line = $callers[0]['line']; |
||||
Log::info('DB QUERY [' . $file . ':' . $line . ']: ' . Log::v2str(substr($query, 0, 2000)), Log::LV_HARD_DEBUG); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Chunks delete |
||||
* |
||||
* @param mysqli $dbh database connection |
||||
* @param string $table table name |
||||
* @param string $where where contidions |
||||
* |
||||
* @return int affected rows |
||||
*/ |
||||
public static function chunksDelete($dbh, $table, $where) |
||||
{ |
||||
$sql = 'DELETE FROM ' . mysqli_real_escape_string($dbh, $table) . ' WHERE ' . $where . ' LIMIT ' . self::DELETE_CHUNK_SIZE; |
||||
|
||||
$totalAffectedRows = 0; |
||||
do { |
||||
DUPX_DB::queryNoReturn($dbh, $sql); |
||||
$affectRows = mysqli_affected_rows($dbh); |
||||
$totalAffectedRows += $affectRows; |
||||
} while ($affectRows >= self::DELETE_CHUNK_SIZE); |
||||
|
||||
return $totalAffectedRows; |
||||
} |
||||
} |
@ -1,273 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* database table item descriptor |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\U |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\Descriptors\ParamDescUsers; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapWP; |
||||
|
||||
/** |
||||
* This class manages the installer table, all table management refers to the table name in the original site. |
||||
*/ |
||||
class DUPX_DB_Table_item |
||||
{ |
||||
protected $originalName = ''; |
||||
protected $tableWithoutPrefix = ''; |
||||
protected $rows = 0; |
||||
protected $size = 0; |
||||
protected $havePrefix = false; |
||||
protected $subsiteId = -1; |
||||
protected $subsitePrefix = ''; |
||||
|
||||
/** |
||||
* |
||||
* @param string $name |
||||
* @param int $rows |
||||
* @param int $size |
||||
*/ |
||||
public function __construct($name, $rows = 0, $size = 0) |
||||
{ |
||||
if (strlen($this->originalName = $name) == 0) { |
||||
throw new Exception('The table name can\'t be empty.'); |
||||
} |
||||
|
||||
$this->rows = max(0, (int) $rows); |
||||
$this->size = max(0, (int) $size); |
||||
|
||||
$oldPrefix = DUPX_ArchiveConfig::getInstance()->wp_tableprefix; |
||||
if (strlen($oldPrefix) === 0) { |
||||
$this->havePrefix = true; |
||||
$this->tableWithoutPrefix = $this->originalName; |
||||
} if (strpos($this->originalName, $oldPrefix) === 0) { |
||||
$this->havePrefix = true; |
||||
$this->tableWithoutPrefix = substr($this->originalName, strlen($oldPrefix)); |
||||
} else { |
||||
$this->havePrefix = false; |
||||
$this->tableWithoutPrefix = $this->originalName; |
||||
} |
||||
|
||||
$this->subsiteId = 1; |
||||
$this->subsitePrefix = $oldPrefix; |
||||
} |
||||
|
||||
/** |
||||
* return the original talbe name in source site |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getOriginalName() |
||||
{ |
||||
return $this->originalName; |
||||
} |
||||
|
||||
/** |
||||
* return table name without prefix, if the table has no prefix then the original name returns. |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getNameWithoutPrefix($includeSubsiteId = false) |
||||
{ |
||||
return (($includeSubsiteId && $this->subsiteId > 1) ? $this->subsiteId . '_' : '') . $this->tableWithoutPrefix; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param array $diffData |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isDiffPrefix(&$diffData) |
||||
{ |
||||
$oldPos = strlen(($oldName = $this->getOriginalName())); |
||||
$newPos = strlen(($newName = $this->getNewName())); |
||||
|
||||
if ($oldName == $newName) { |
||||
$diffData = array( |
||||
'oldPrefix' => '', |
||||
'newPrefix' => '', |
||||
'commonPart' => $oldName |
||||
); |
||||
return false; |
||||
} |
||||
|
||||
while ($oldPos > 0 && $newPos > 0) { |
||||
if ($oldName[$oldPos - 1] != $newName[$newPos - 1]) { |
||||
break; |
||||
} |
||||
|
||||
$oldPos--; |
||||
$newPos--; |
||||
} |
||||
|
||||
$diffData = array( |
||||
'oldPrefix' => substr($oldName, 0, $oldPos), |
||||
'newPrefix' => substr($newName, 0, $newPos), |
||||
'commonPart' => substr($oldName, $oldPos) |
||||
); |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public function havePrefix() |
||||
{ |
||||
return $this->havePrefix; |
||||
} |
||||
|
||||
/** |
||||
* return new name extracted on target site |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getNewName() |
||||
{ |
||||
if (!$this->canBeExctracted()) { |
||||
return ''; |
||||
} |
||||
|
||||
if (!$this->havePrefix) { |
||||
return $this->originalName; |
||||
} |
||||
|
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
switch (DUPX_InstallerState::getInstType()) { |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE: |
||||
case DUPX_InstallerState::INSTALL_RBACKUP_SINGLE_SITE: |
||||
return $paramsManager->getValue(PrmMng::PARAM_DB_TABLE_PREFIX) . $this->getNameWithoutPrefix(true); |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE_ON_SUBDOMAIN: |
||||
case DUPX_InstallerState::INSTALL_SINGLE_SITE_ON_SUBFOLDER: |
||||
throw new Exception('Mode not avaiable'); |
||||
case DUPX_InstallerState::INSTALL_NOT_SET: |
||||
throw new Exception('Cannot change setup with current installation type [' . DUPX_InstallerState::getInstType() . ']'); |
||||
default: |
||||
throw new Exception('Unknown mode'); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getRows() |
||||
{ |
||||
return $this->rows; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param type $formatted |
||||
* |
||||
* @return int|string |
||||
*/ |
||||
public function getSize($formatted = false) |
||||
{ |
||||
return $formatted ? DUPX_U::readableByteSize($this->size) : $this->size; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return int // if -1 isn't a subsite sable |
||||
*/ |
||||
public function getSubsisteId() |
||||
{ |
||||
return $this->subsiteId; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function canBeExctracted() |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* If false the current table create query is skipped |
||||
* |
||||
* @return boolran |
||||
*/ |
||||
public function createTable() |
||||
{ |
||||
if ($this->usersTablesCreateCheck() === false) { |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* Check if create users table |
||||
* |
||||
* @return boolran |
||||
*/ |
||||
protected function usersTablesCreateCheck() |
||||
{ |
||||
if (!$this->isUserTable()) { |
||||
return true; |
||||
} |
||||
|
||||
return (ParamDescUsers::getUsersMode() !== ParamDescUsers::USER_MODE_IMPORT_USERS); |
||||
} |
||||
|
||||
/** |
||||
* Return true if current table is user or usermeta table |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isUserTable() |
||||
{ |
||||
return ($this->havePrefix && in_array($this->tableWithoutPrefix, array('users', 'usermeta'))); |
||||
} |
||||
|
||||
/** |
||||
* returns true if the table is to be extracted |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function extract() |
||||
{ |
||||
if (!$this->canBeExctracted()) { |
||||
return false; |
||||
} |
||||
|
||||
$tablesVals = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLES); |
||||
if (!isset($tablesVals[$this->originalName])) { |
||||
throw new Exception('Table ' . $this->originalName . ' not in table vals'); |
||||
} |
||||
|
||||
return $tablesVals[$this->originalName]['extract']; |
||||
} |
||||
|
||||
/** |
||||
* returns true if a search and replace is to be performed |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function replaceEngine() |
||||
{ |
||||
if (!$this->extract()) { |
||||
return false; |
||||
} |
||||
|
||||
$tablesVals = PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLES); |
||||
if (!isset($tablesVals[$this->originalName])) { |
||||
throw new Exception('Table ' . $this->originalName . ' not in table vals'); |
||||
} |
||||
|
||||
return $tablesVals[$this->originalName]['replace']; |
||||
} |
||||
} |
@ -1,329 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Original installer files manager |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\U |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Installer\Core\Params\Items\ParamFormTables; |
||||
|
||||
/** |
||||
* Original installer files manager |
||||
* singleton class |
||||
*/ |
||||
final class DUPX_DB_Tables |
||||
{ |
||||
/** |
||||
* |
||||
* @var self |
||||
*/ |
||||
private static $instance = null; |
||||
|
||||
/** |
||||
* |
||||
* @var DUPX_DB_Table_item[] |
||||
*/ |
||||
private $tables = array(); |
||||
|
||||
/** |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
|
||||
return self::$instance; |
||||
} |
||||
|
||||
private function __construct() |
||||
{ |
||||
$confTables = (array) DUPX_ArchiveConfig::getInstance()->dbInfo->tablesList; |
||||
foreach ($confTables as $tableName => $tableInfo) { |
||||
$rows = ($tableInfo->insertedRows === false ? $tableInfo->inaccurateRows : $tableInfo->insertedRows); |
||||
|
||||
$this->tables[$tableName] = new DUPX_DB_Table_item($tableName, $rows, $tableInfo->size); |
||||
} |
||||
|
||||
Log::info('CONSTRUCT TABLES: ' . Log::v2str($this->tables), Log::LV_HARD_DEBUG); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return DUPX_DB_Table_item[] |
||||
*/ |
||||
public function getTables() |
||||
{ |
||||
return $this->tables; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getTablesNames() |
||||
{ |
||||
return array_keys($this->tables); |
||||
} |
||||
|
||||
/** |
||||
* get the list of extracted tables names |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getNewTablesNames() |
||||
{ |
||||
$result = array(); |
||||
|
||||
foreach ($this->tables as $tableObj) { |
||||
if (!$tableObj->extract()) { |
||||
continue; |
||||
} |
||||
$newName = $tableObj->getNewName(); |
||||
if (strlen($newName) == 0) { |
||||
continue; |
||||
} |
||||
$result[] = $newName; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getReplaceTablesNames() |
||||
{ |
||||
$result = array(); |
||||
|
||||
foreach ($this->tables as $tableObj) { |
||||
if (!$tableObj->replaceEngine()) { |
||||
continue; |
||||
} |
||||
$newName = $tableObj->getNewName(); |
||||
if (strlen($newName) == 0) { |
||||
continue; |
||||
} |
||||
$result[] = $newName; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Returns all tables that have a given name without prefix. |
||||
* for example all posts tables of a multisite if filter is equal to posts |
||||
* |
||||
* @param string $filter filter name |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getTablesByNameWithoutPrefix($filter) |
||||
{ |
||||
$result = array(); |
||||
|
||||
foreach ($this->tables as $tableObj) { |
||||
$newName = $tableObj->getNewName(); |
||||
if (strlen($newName) == 0) { |
||||
continue; |
||||
} |
||||
|
||||
if ( |
||||
$tableObj->extract() && |
||||
$tableObj->havePrefix() && |
||||
$tableObj->getNameWithoutPrefix() == $filter |
||||
) { |
||||
$result[] = $newName; |
||||
} |
||||
} |
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Retust tables to skip |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getTablesToSkip() |
||||
{ |
||||
$result = array(); |
||||
|
||||
foreach ($this->tables as $tableObj) { |
||||
if (!$tableObj->extract()) { |
||||
$result[] = $tableObj->getOriginalName(); |
||||
} |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Restun lsit of tables where skip create but not insert |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getTablesCreateSkip() |
||||
{ |
||||
$result = array(); |
||||
|
||||
foreach ($this->tables as $tableObj) { |
||||
if ($tableObj->extract() && !$tableObj->createTable()) { |
||||
$result[] = $tableObj->getOriginalName(); |
||||
} |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param type $table |
||||
* |
||||
* @return DUPX_DB_Table_item // false if table don't exists |
||||
*/ |
||||
public function getTableObjByName($table) |
||||
{ |
||||
if (!isset($this->tables[$table])) { |
||||
throw new Exception('TABLE ' . $table . ' Isn\'t in list'); |
||||
} |
||||
|
||||
return $this->tables[$table]; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return array |
||||
*/ |
||||
public function getRenameTablesMapping() |
||||
{ |
||||
$mapping = array(); |
||||
$diffData = array(); |
||||
|
||||
foreach ($this->tables as $tableObj) { |
||||
if (!$tableObj->extract()) { |
||||
// skip stable not extracted |
||||
continue; |
||||
} |
||||
|
||||
if (!$tableObj->isDiffPrefix($diffData)) { |
||||
continue; |
||||
} |
||||
|
||||
if (!isset($mapping[$diffData['oldPrefix']])) { |
||||
$mapping[$diffData['oldPrefix']] = array(); |
||||
} |
||||
|
||||
if (!isset($mapping[$diffData['oldPrefix']][$diffData['newPrefix']])) { |
||||
$mapping[$diffData['oldPrefix']][$diffData['newPrefix']] = array(); |
||||
} |
||||
|
||||
$mapping[$diffData['oldPrefix']][$diffData['newPrefix']][] = $diffData['commonPart']; |
||||
} |
||||
|
||||
uksort($mapping, function ($a, $b) { |
||||
$lenA = strlen($a); |
||||
$lenB = strlen($b); |
||||
|
||||
if ($lenA == $lenB) { |
||||
return 0; |
||||
} elseif ($lenA > $lenB) { |
||||
return -1; |
||||
} else { |
||||
return 1; |
||||
} |
||||
}); |
||||
|
||||
// maximise prefix length |
||||
$optimizedMapping = array(); |
||||
|
||||
foreach ($mapping as $oldPrefix => $newMapping) { |
||||
foreach ($newMapping as $newPrefix => $commons) { |
||||
for ($pos = 0; /* break inside */; $pos++) { |
||||
for ($current = 0; $current < count($commons); $current++) { |
||||
if (strlen($commons[$current]) <= $pos) { |
||||
break 2; |
||||
} |
||||
|
||||
if ($current == 0) { |
||||
$char = $commons[$current][$pos]; |
||||
continue; |
||||
} |
||||
|
||||
if ($commons[$current][$pos] != $char) { |
||||
break 2; |
||||
} |
||||
} |
||||
} |
||||
|
||||
$optOldPrefix = $oldPrefix . substr($commons[0], 0, $pos); |
||||
$optNewPrefix = $newPrefix . substr($commons[0], 0, $pos); |
||||
|
||||
if (!isset($optimizedMapping[$optOldPrefix])) { |
||||
$optimizedMapping[$optOldPrefix] = array(); |
||||
} |
||||
|
||||
$optimizedMapping[$optOldPrefix][$optNewPrefix] = array_map(function ($val) use ($pos) { |
||||
return substr($val, $pos); |
||||
}, $commons); |
||||
} |
||||
} |
||||
|
||||
return $optimizedMapping; |
||||
} |
||||
|
||||
/** |
||||
* return param table default |
||||
* |
||||
* @return array |
||||
*/ |
||||
public function getDefaultParamValue() |
||||
{ |
||||
$result = array(); |
||||
|
||||
foreach ($this->tables as $table) { |
||||
$result[$table->getOriginalName()] = ParamFormTables::getParamItemValueFromData( |
||||
$table->getOriginalName(), |
||||
$table->canBeExctracted(), |
||||
$table->canBeExctracted() |
||||
); |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* return param table default filtered |
||||
* |
||||
* @param string[] $filterTables Table names to filter |
||||
* |
||||
* @return array<string, array{name: string, extract: bool, replace: bool}> |
||||
*/ |
||||
public function getFilteredParamValue($filterTables) |
||||
{ |
||||
$result = array(); |
||||
|
||||
foreach ($this->tables as $table) { |
||||
$extract = !in_array($table->getOriginalName(), $filterTables) ? $table->canBeExctracted() : false; |
||||
|
||||
$result[$table->getOriginalName()] = ParamFormTables::getParamItemValueFromData( |
||||
$table->getOriginalName(), |
||||
$extract, |
||||
$extract |
||||
); |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
} |
@ -1,250 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* custom hosting manager |
||||
* singleton class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Installer\Core\Params\Items\ParamForm; |
||||
use Duplicator\Libs\Snap\SnapWP; |
||||
|
||||
require_once(DUPX_INIT . '/classes/host/interface.host.php'); |
||||
require_once(DUPX_INIT . '/classes/host/class.godaddy.host.php'); |
||||
require_once(DUPX_INIT . '/classes/host/class.wpengine.host.php'); |
||||
require_once(DUPX_INIT . '/classes/host/class.wordpresscom.host.php'); |
||||
require_once(DUPX_INIT . '/classes/host/class.liquidweb.host.php'); |
||||
require_once(DUPX_INIT . '/classes/host/class.pantheon.host.php'); |
||||
require_once(DUPX_INIT . '/classes/host/class.flywheel.host.php'); |
||||
require_once(DUPX_INIT . '/classes/host/class.siteground.host.php'); |
||||
|
||||
class DUPX_Custom_Host_Manager |
||||
{ |
||||
const HOST_GODADDY = 'godaddy'; |
||||
const HOST_WPENGINE = 'wpengine'; |
||||
const HOST_WORDPRESSCOM = 'wordpresscom'; |
||||
const HOST_LIQUIDWEB = 'liquidweb'; |
||||
const HOST_PANTHEON = 'pantheon'; |
||||
const HOST_FLYWHEEL = 'flywheel'; |
||||
const HOST_SITEGROUND = 'siteground'; |
||||
|
||||
/** |
||||
* |
||||
* @var self |
||||
*/ |
||||
protected static $instance = null; |
||||
|
||||
/** |
||||
* this var prevent multiple params inizialization. |
||||
* it's useful on development to prevent an infinite loop in class constructor |
||||
* |
||||
* @var bool |
||||
*/ |
||||
private $initialized = false; |
||||
|
||||
/** |
||||
* custom hostings list |
||||
* |
||||
* @var DUPX_Host_interface[] |
||||
*/ |
||||
private $customHostings = array(); |
||||
|
||||
/** |
||||
* active custom hosting in current server |
||||
* |
||||
* @var string[] |
||||
*/ |
||||
private $activeHostings = array(); |
||||
|
||||
/** |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
return self::$instance; |
||||
} |
||||
|
||||
/** |
||||
* init custom histings |
||||
*/ |
||||
private function __construct() |
||||
{ |
||||
$this->customHostings[DUPX_WPEngine_Host::getIdentifier()] = new DUPX_WPEngine_Host(); |
||||
$this->customHostings[DUPX_GoDaddy_Host::getIdentifier()] = new DUPX_GoDaddy_Host(); |
||||
$this->customHostings[DUPX_WordpressCom_Host::getIdentifier()] = new DUPX_WordpressCom_Host(); |
||||
$this->customHostings[DUPX_Liquidweb_Host::getIdentifier()] = new DUPX_Liquidweb_Host(); |
||||
$this->customHostings[DUPX_Pantheon_Host::getIdentifier()] = new DUPX_Pantheon_Host(); |
||||
$this->customHostings[DUPX_Flywheel_Host::getIdentifier()] = new DUPX_Flywheel_Host(); |
||||
$this->customHostings[DUPX_Siteground_Host::getIdentifier()] = new DUPX_Siteground_Host(); |
||||
} |
||||
|
||||
/** |
||||
* execute the active custom hostings inizialization only one time. |
||||
* |
||||
* @return boolean |
||||
* @throws Exception |
||||
*/ |
||||
public function init() |
||||
{ |
||||
if ($this->initialized) { |
||||
return true; |
||||
} |
||||
foreach ($this->customHostings as $cHost) { |
||||
if (!($cHost instanceof DUPX_Host_interface)) { |
||||
throw new Exception('Host must implemnete DUPX_Host_interface'); |
||||
} |
||||
if ($cHost->isHosting()) { |
||||
$this->activeHostings[] = $cHost->getIdentifier(); |
||||
$cHost->init(); |
||||
} |
||||
} |
||||
$this->initialized = true; |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* return the lisst of current custom active hostings |
||||
* |
||||
* @return DUPX_Host_interface[] |
||||
*/ |
||||
public function getActiveHostings() |
||||
{ |
||||
$result = array(); |
||||
foreach ($this->customHostings as $cHost) { |
||||
if ($cHost->isHosting()) { |
||||
$result[] = $cHost->getIdentifier(); |
||||
} |
||||
} |
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* return true if current identifier hostoing is active |
||||
* |
||||
* @param string $identifier |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public function isHosting($identifier) |
||||
{ |
||||
return isset($this->customHostings[$identifier]) && $this->customHostings[$identifier]->isHosting(); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean|string return false if isn't managed manage hosting of manager hosting |
||||
*/ |
||||
public function isManaged() |
||||
{ |
||||
if ($this->isHosting(self::HOST_WPENGINE)) { |
||||
return self::HOST_WPENGINE; |
||||
} elseif ($this->isHosting(self::HOST_LIQUIDWEB)) { |
||||
return self::HOST_LIQUIDWEB; |
||||
} elseif ($this->isHosting(self::HOST_GODADDY)) { |
||||
return self::HOST_GODADDY; |
||||
} elseif ($this->isHosting(self::HOST_WORDPRESSCOM)) { |
||||
return self::HOST_WORDPRESSCOM; |
||||
} elseif ($this->isHosting(self::HOST_PANTHEON)) { |
||||
return self::HOST_PANTHEON; |
||||
} elseif ($this->isHosting(self::HOST_FLYWHEEL)) { |
||||
return self::HOST_FLYWHEEL; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param type $identifier |
||||
* |
||||
* @return boolean|DUPX_Host_interface |
||||
*/ |
||||
public function getHosting($identifier) |
||||
{ |
||||
if ($this->isHosting($identifier)) { |
||||
return $this->customHostings[$identifier]; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* @todo temp function fot prevent the warnings on managed hosting. |
||||
* This function must be removed in favor of right extraction mode will'be implemented |
||||
* |
||||
* @param string $extract_filename |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function skipWarningExtractionForManaged($extract_filename) |
||||
{ |
||||
if (!$this->isManaged()) { |
||||
return false; |
||||
} elseif (SnapWP::isWpCore($extract_filename, SnapWP::PATH_RELATIVE)) { |
||||
return true; |
||||
} elseif (DUPX_ArchiveConfig::getInstance()->isChildOfArchivePath($extract_filename, array('abs', 'plugins', 'muplugins', 'themes'))) { |
||||
return true; |
||||
} elseif (in_array($extract_filename, DUPX_Plugins_Manager::getInstance()->getDropInsPaths())) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return bool |
||||
* @throws Exception |
||||
*/ |
||||
public function setManagedHostParams() |
||||
{ |
||||
if (($managedSlug = $this->isManaged()) === false) { |
||||
return; |
||||
} |
||||
|
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
$paramsManager->setValue(PrmMng::PARAM_WP_CONFIG, 'nothing'); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_WP_CONFIG, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setValue(PrmMng::PARAM_HTACCESS_CONFIG, 'nothing'); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_HTACCESS_CONFIG, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setValue(PrmMng::PARAM_OTHER_CONFIG, 'nothing'); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_OTHER_CONFIG, ParamForm::STATUS_INFO_ONLY); |
||||
|
||||
$paramsManager->setValue(PrmMng::PARAM_DB_ACTION, 'empty'); |
||||
|
||||
if (DUPX_InstallerState::getInstance()->getMode() === DUPX_InstallerState::MODE_OVR_INSTALL) { |
||||
$overwriteData = $paramsManager->getValue(PrmMng::PARAM_OVERWRITE_SITE_DATA); |
||||
$paramsManager->setValue(PrmMng::PARAM_VALIDATION_ACTION_ON_START, DUPX_Validation_manager::ACTION_ON_START_AUTO); |
||||
$paramsManager->setValue(PrmMng::PARAM_DB_DISPLAY_OVERWIRE_WARNING, false); |
||||
$paramsManager->setValue(PrmMng::PARAM_DB_HOST, $overwriteData['dbhost']); |
||||
$paramsManager->setValue(PrmMng::PARAM_DB_NAME, $overwriteData['dbname']); |
||||
$paramsManager->setValue(PrmMng::PARAM_DB_USER, $overwriteData['dbuser']); |
||||
$paramsManager->setValue(PrmMng::PARAM_DB_PASS, $overwriteData['dbpass']); |
||||
$paramsManager->setValue(PrmMng::PARAM_DB_TABLE_PREFIX, $overwriteData['table_prefix']); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_DB_ACTION, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_DB_HOST, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_DB_NAME, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_DB_USER, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_DB_PASS, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_DB_TABLE_PREFIX, ParamForm::STATUS_INFO_ONLY); |
||||
} |
||||
|
||||
$paramsManager->setFormStatus(PrmMng::PARAM_URL_NEW, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_SITE_URL, ParamForm::STATUS_INFO_ONLY); |
||||
$paramsManager->setFormStatus(PrmMng::PARAM_PATH_NEW, ParamForm::STATUS_INFO_ONLY); |
||||
|
||||
$this->getHosting($managedSlug)->setCustomParams(); |
||||
} |
||||
} |
@ -1,72 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Flywheel custom hosting class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
/** |
||||
* class for wordpress.com managed hosting |
||||
* |
||||
* @todo not yet implemneted |
||||
*/ |
||||
class DUPX_Flywheel_Host implements DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host itentifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier() |
||||
{ |
||||
return DUPX_Custom_Host_Manager::HOST_FLYWHEEL; |
||||
} |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
*/ |
||||
public function isHosting() |
||||
{ |
||||
// check only mu plugin file exists |
||||
|
||||
$testFile = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_NEW) . '/.fw-config.php'; |
||||
return file_exists($testFile); |
||||
} |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel() |
||||
{ |
||||
return 'Flywheel'; |
||||
} |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams() |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
$paramsManager->setValue(PrmMng::PARAM_ARCHIVE_ENGINE_SKIP_WP_FILES, DUP_Extraction::FILTER_SKIP_WP_CORE); |
||||
} |
||||
} |
@ -1,73 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* godaddy custom hosting class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
/** |
||||
* class for GoDaddy managed hosting |
||||
* |
||||
* @todo not yet implemneted |
||||
*/ |
||||
class DUPX_GoDaddy_Host implements DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host itentifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier() |
||||
{ |
||||
return DUPX_Custom_Host_Manager::HOST_GODADDY; |
||||
} |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
*/ |
||||
public function isHosting() |
||||
{ |
||||
// check only mu plugin file exists |
||||
|
||||
$file = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW) . '/gd-system-plugin.php'; |
||||
return file_exists($file); |
||||
} |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel() |
||||
{ |
||||
return 'GoDaddy'; |
||||
} |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams() |
||||
{ |
||||
PrmMng::getInstance()->setValue(PrmMng::PARAM_IGNORE_PLUGINS, array( |
||||
'gd-system-plugin.php', |
||||
'object-cache.php' |
||||
)); |
||||
} |
||||
} |
@ -1,71 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* liquidweb custom hosting class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
class DUPX_Liquidweb_Host implements DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host itentifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier() |
||||
{ |
||||
return DUPX_Custom_Host_Manager::HOST_LIQUIDWEB; |
||||
} |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
*/ |
||||
public function isHosting() |
||||
{ |
||||
// check only mu plugin file exists |
||||
|
||||
$testFile = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW) . '/liquid-web.php'; |
||||
return file_exists($testFile); |
||||
} |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* return the label of current hosting |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel() |
||||
{ |
||||
return 'Liquid Web'; |
||||
} |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams() |
||||
{ |
||||
PrmMng::getInstance()->setValue(PrmMng::PARAM_IGNORE_PLUGINS, array( |
||||
'liquidweb_mwp.php', |
||||
'000-liquidweb-config.php', |
||||
'liquid-web.php', |
||||
'lw_disable_nags.php' |
||||
)); |
||||
} |
||||
} |
@ -1,70 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* godaddy custom hosting class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
/** |
||||
* class for GoDaddy managed hosting |
||||
* |
||||
* @todo not yet implemneted |
||||
*/ |
||||
class DUPX_Pantheon_Host implements DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host itentifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier() |
||||
{ |
||||
return DUPX_Custom_Host_Manager::HOST_PANTHEON; |
||||
} |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
* @throws Exception |
||||
*/ |
||||
public function isHosting() |
||||
{ |
||||
// check only mu plugin file exists |
||||
|
||||
$testFile = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW) . '/pantheon.php'; |
||||
return file_exists($testFile); |
||||
} |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel() |
||||
{ |
||||
return 'Pantheon'; |
||||
} |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams() |
||||
{ |
||||
} |
||||
} |
@ -1,65 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Siteground custom hosting class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Libs\Snap\SnapUtil; |
||||
|
||||
class DUPX_Siteground_Host implements DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host identifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier() |
||||
{ |
||||
return DUPX_Custom_Host_Manager::HOST_SITEGROUND; |
||||
} |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
*/ |
||||
public function isHosting() |
||||
{ |
||||
ob_start(); |
||||
SnapUtil::phpinfo(INFO_GENERAL); |
||||
$serverinfo = ob_get_clean(); |
||||
|
||||
return (strpos($serverinfo, "siteground") !== false); |
||||
} |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel() |
||||
{ |
||||
return 'SiteGround'; |
||||
} |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams() |
||||
{ |
||||
} |
||||
} |
@ -1,75 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* godaddy custom hosting class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\Descriptors\ParamDescUsers; |
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
/** |
||||
* class for wordpress.com managed hosting |
||||
* |
||||
* @todo not yet implemneted |
||||
*/ |
||||
class DUPX_WordpressCom_Host implements DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host itentifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier() |
||||
{ |
||||
return DUPX_Custom_Host_Manager::HOST_WORDPRESSCOM; |
||||
} |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
*/ |
||||
public function isHosting() |
||||
{ |
||||
// check only mu plugin file exists |
||||
|
||||
$testFile = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW) . '/wpcomsh-loader.php'; |
||||
return file_exists($testFile); |
||||
} |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel() |
||||
{ |
||||
return 'wordpress.com'; |
||||
} |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams() |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
$paramsManager->setValue(PrmMng::PARAM_ARCHIVE_ENGINE_SKIP_WP_FILES, DUP_Extraction::FILTER_SKIP_WP_CORE); |
||||
$paramsManager->setValue(PrmMng::PARAM_USERS_MODE, ParamDescUsers::USER_MODE_IMPORT_USERS); |
||||
} |
||||
} |
@ -1,157 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* wpengine custom hosting class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
/** |
||||
* class for wpengine managed hosting |
||||
* |
||||
* @todo not yet implemneted |
||||
*/ |
||||
class DUPX_WPEngine_Host implements DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host itentifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier() |
||||
{ |
||||
return DUPX_Custom_Host_Manager::HOST_WPENGINE; |
||||
} |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
*/ |
||||
public function isHosting() |
||||
{ |
||||
// check only mu plugin file exists |
||||
|
||||
$file = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW) . '/wpengine-security-auditor.php'; |
||||
return file_exists($file); |
||||
} |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel() |
||||
{ |
||||
return 'WP Engine'; |
||||
} |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams() |
||||
{ |
||||
PrmMng::getInstance()->setValue(PrmMng::PARAM_IGNORE_PLUGINS, array( |
||||
'mu-plugin.php', |
||||
'advanced-cache.php', |
||||
'wpengine-security-auditor.php', |
||||
'stop-long-comments.php', |
||||
'slt-force-strong-passwords.php' |
||||
)); |
||||
|
||||
$this->force_disable_plugins(); |
||||
} |
||||
|
||||
/** |
||||
* force disable disallowed plugins |
||||
* |
||||
* @link https://wpengine.com/support/disallowed-plugins/ |
||||
* |
||||
* @return void |
||||
*/ |
||||
private function force_disable_plugins() |
||||
{ |
||||
$fdPlugins = PrmMng::getInstance()->getValue(PrmMng::PARAM_FORCE_DIABLE_PLUGINS); |
||||
|
||||
if (!is_array($fdPlugins)) { |
||||
$fdPlugins = array(); |
||||
} |
||||
|
||||
$fdPlugins = array_merge($fdPlugins, array( |
||||
'gd-system-plugin.php', |
||||
'hcs.php', |
||||
'hello.php', |
||||
'adminer/adminer.php', |
||||
'async-google-analytics/asyncgoogleanalytics.php', |
||||
'backup/backup.php', |
||||
'backup-scheduler/backup-scheduler.php', |
||||
'backupwordpress/backupwordpress.php', |
||||
'backwpup/backwpup.php', |
||||
'bad-behavior/bad-behavior-wordpress.php', |
||||
'broken-link-checker/broken-link-checker.php', |
||||
'content-molecules/emc2_content_molecules.php', |
||||
'contextual-related-posts/contextual-related-posts.php', |
||||
'dynamic-related-posts/drpp.php', |
||||
'ewww-image-optimizer/ewww-image-optimizer.php', |
||||
'ezpz-one-click-backup/ezpz-ocb.php', |
||||
'file-commander/wp-plugin-file-commander.php', |
||||
'fuzzy-seo-booster/seoqueries.php', |
||||
'google-xml-sitemaps-with-multisite-support/sitemap.php', |
||||
'hc-custom-wp-admin-url/hc-custom-wp-admin-url.php', |
||||
'jr-referrer/jr-referrer.php', |
||||
'jumpple/sweetcaptcha.php', |
||||
'missed-schedule/missed-schedule.php', |
||||
'no-revisions/norevisions.php', |
||||
'ozh-who-sees-ads/wp_ozh_whoseesads.php', |
||||
'pipdig-power-pack/p3.php', |
||||
'portable-phpmyadmin/wp-phpmyadmin.php', |
||||
'quick-cache/quick-cache.php', |
||||
'quick-cache-pro/quick-cache-pro.php', |
||||
'recommend-a-friend/recommend-to-a-friend.php', |
||||
'seo-alrp/seo-alrp.php', |
||||
'si-captcha-for-wordpress/si-captcha.php', |
||||
'similar-posts/similar-posts.php', |
||||
'spamreferrerblock/spam_referrer_block.php', |
||||
'super-post/super-post.php', |
||||
'superslider/superslider.php', |
||||
'sweetcaptcha-revolutionary-free-captcha-service/sweetcaptcha.php', |
||||
'the-codetree-backup/codetree-backup.php', |
||||
'ToolsPack/ToolsPack.php', |
||||
'tweet-blender/tweet-blender.php', |
||||
'versionpress/versionpress.php', |
||||
'w3-total-cache/w3-total-cache.php', |
||||
'wordpress-gzip-compression/ezgz.php', |
||||
'wp-cache/wp-cache.php', |
||||
'wp-database-optimizer/wp_database_optimizer.php', |
||||
'wp-db-backup/wp-db-backup.php', |
||||
'wp-dbmanager/wp-dbmanager.php', |
||||
'wp-engine-snapshot/plugin.php', |
||||
'wp-file-cache/file-cache.php', |
||||
'wp-mailinglist/wp-mailinglist.php', |
||||
'wp-phpmyadmin/wp-phpmyadmin.php', |
||||
'wp-postviews/wp-postviews.php', |
||||
'wp-slimstat/wp-slimstat.php', |
||||
'wp-super-cache/wp-cache.php', |
||||
'wp-symposium-alerts/wp-symposium-alerts.php', |
||||
'wponlinebackup/wponlinebackup.php', |
||||
'yet-another-featured-posts-plugin/yafpp.php', |
||||
'yet-another-related-posts-plugin/yarpp.php' |
||||
)); |
||||
|
||||
PrmMng::getInstance()->setValue(PrmMng::PARAM_FORCE_DIABLE_PLUGINS, $fdPlugins); |
||||
} |
||||
} |
@ -1,50 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* interface for specific hostings class |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @package SC\DUPX\DB |
||||
* @link http://www.php-fig.org/psr/psr-2/ |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
/** |
||||
* instaler custom host interface for cusotm hosting classes |
||||
*/ |
||||
interface DUPX_Host_interface |
||||
{ |
||||
/** |
||||
* return the current host itentifier |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getIdentifier(); |
||||
|
||||
/** |
||||
* @return bool true if is current host |
||||
*/ |
||||
public function isHosting(); |
||||
|
||||
/** |
||||
* the init function. |
||||
* is called only if isHosting is true |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function init(); |
||||
|
||||
/** |
||||
* return the label of current hosting |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getLabel(); |
||||
|
||||
/** |
||||
* this function is called if current hosting is this |
||||
*/ |
||||
public function setCustomParams(); |
||||
} |
@ -1,3 +0,0 @@ |
||||
<?php |
||||
|
||||
//silent |
@ -1,91 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* plugin custom actions |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\U |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
class DUPX_Plugin_custom_actions |
||||
{ |
||||
const BY_DEFAULT_AUTO = 'auto'; |
||||
const BY_DEFAULT_DISABLED = 'disabled'; |
||||
const BY_DEFAULT_ENABLED = 'enabled'; |
||||
|
||||
/** @var string */ |
||||
protected $slug = null; |
||||
/** @var bool|callable */ |
||||
protected $byDefaultStatus = self::BY_DEFAULT_AUTO; |
||||
/** @var bool|callable */ |
||||
protected $enableAfterLogin = false; |
||||
/** @var string */ |
||||
protected $byDefaultMessage = ''; |
||||
|
||||
/** |
||||
* Class constructor |
||||
* |
||||
* @param string $slug plugin slug |
||||
* @param string|callable $byDefaultStatus set plugin status |
||||
* @param bool|callable $enableAfterLogin enable plugin after login |
||||
* @param string|callable $byDefaultMessage message if status change |
||||
*/ |
||||
public function __construct( |
||||
$slug, |
||||
$byDefaultStatus = self::BY_DEFAULT_AUTO, |
||||
$enableAfterLogin = false, |
||||
$byDefaultMessage = '' |
||||
) { |
||||
$this->slug = $slug; |
||||
$this->byDefaultStatus = $byDefaultStatus; |
||||
$this->enableAfterLogin = $enableAfterLogin; |
||||
$this->byDefaultMessage = $byDefaultMessage; |
||||
} |
||||
|
||||
/** |
||||
* Return by defualt status |
||||
* |
||||
* @return string by default enum |
||||
*/ |
||||
public function byDefaultStatus() |
||||
{ |
||||
if (is_callable($this->byDefaultStatus)) { |
||||
return call_user_func($this->byDefaultStatus, $this); |
||||
} else { |
||||
return $this->byDefaultStatus; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* return true if plugin must be enabled after login |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isEnableAfterLogin() |
||||
{ |
||||
if (is_callable($this->enableAfterLogin)) { |
||||
return call_user_func($this->enableAfterLogin, $this); |
||||
} else { |
||||
return $this->enableAfterLogin; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* By default message |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function byDefaultMessage() |
||||
{ |
||||
if (is_callable($this->byDefaultMessage)) { |
||||
return call_user_func($this->byDefaultMessage, $this); |
||||
} else { |
||||
return $this->byDefaultMessage; |
||||
} |
||||
} |
||||
} |
@ -1,561 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* plugin item descriptor |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\U |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapUtil; |
||||
|
||||
/** |
||||
* Plugin Item |
||||
*/ |
||||
class DUPX_Plugin_item |
||||
{ |
||||
const STATUS_ACTIVE = 'active'; |
||||
const STATUS_INACTIVE = 'inactive'; |
||||
const STATUS_NETWORK_ACTIVE = 'network-active'; |
||||
const STATUS_DROP_INS = 'drop-ins'; |
||||
const STATUS_MUST_USE = 'must-use'; |
||||
|
||||
/** |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $data = array( |
||||
'slug' => null, |
||||
'name' => '', |
||||
'version' => '', |
||||
'pluginURI' => '', |
||||
'author' => '', |
||||
'authorURI' => '', |
||||
'description' => '', |
||||
'title' => '', |
||||
'networkActive' => false, |
||||
'active' => false, |
||||
'mustUse' => false, |
||||
'dropIns' => false, |
||||
'deactivateAction' => false, |
||||
'deactivateMessage' => null, |
||||
'activateAction' => false |
||||
); |
||||
|
||||
/** |
||||
* |
||||
* @param array $data |
||||
* |
||||
* @throws Exception |
||||
*/ |
||||
public function __construct($data) |
||||
{ |
||||
if (!is_array($data) || !isset($data['slug'])) { |
||||
throw new Exception('invalud input data'); |
||||
} |
||||
|
||||
$this->data = array_merge($this->data, $data); |
||||
if (empty($this->data['name'])) { |
||||
$this->data['name'] = $this->data['slug']; |
||||
} |
||||
|
||||
if (empty($this->data['title'])) { |
||||
$this->data['title'] = $this->data['name']; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param int $subsite // if -1 it checks that at least one site exists in which it is active in the netowrk |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isActive($subsite = -1) |
||||
{ |
||||
if ($this->data['active'] === true) { |
||||
return true; |
||||
} elseif ($subsite === -1 && !empty($this->data['active'])) { |
||||
return true; |
||||
} elseif ($this->data['active'] === true || (is_array($this->data['active']) && in_array($subsite, $this->data['active']))) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isNetworkActive() |
||||
{ |
||||
return $this->data['networkActive']; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isMustUse() |
||||
{ |
||||
return $this->data['mustUse']; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isDropIns() |
||||
{ |
||||
return $this->data['dropIns']; |
||||
} |
||||
|
||||
/** |
||||
* is true if all active status are false |
||||
* |
||||
* @param int $subsite // if -1 it checks that at least one site exists in which it is active in the netowrk |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isInactive($subsite = -1) |
||||
{ |
||||
return !$this->isActive($subsite) && !$this->isNetworkActive() && !$this->isMustUse() && !$this->isDropIns(); |
||||
} |
||||
|
||||
/** |
||||
* return true if isn't networkActive or must-use or drop-ins |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function isNetworkInactive() |
||||
{ |
||||
return !$this->isNetworkActive() && !$this->isMustUse() && !$this->isDropIns(); |
||||
} |
||||
|
||||
public function isIgnore() |
||||
{ |
||||
return in_array($this->data['slug'], PrmMng::getInstance()->getValue(PrmMng::PARAM_IGNORE_PLUGINS)); |
||||
} |
||||
|
||||
public function isForceDisabled() |
||||
{ |
||||
return in_array($this->data['slug'], PrmMng::getInstance()->getValue(PrmMng::PARAM_FORCE_DIABLE_PLUGINS)); |
||||
} |
||||
/** |
||||
* set activate action true if the plugin is active or if deactivateAction is enabled |
||||
* |
||||
* @return bool // return activateAction |
||||
*/ |
||||
|
||||
/** |
||||
* set activate action true if the plugin is active or if deactivateAction is enabled |
||||
* |
||||
* @param int $subsite // current subsite id |
||||
* @param bool $networkCheck // if true check only on network or check by subsite id |
||||
* @param bool $forceActivation // if true skip all pluginstati check and set activation action |
||||
* |
||||
* @return bool // return activateAction |
||||
*/ |
||||
public function setActivationAction($subsite = -1, $networkCheck = false, $forceActivation = false) |
||||
{ |
||||
if ($this->isIgnore()) { |
||||
return true; |
||||
} |
||||
|
||||
if ($forceActivation) { |
||||
Log::info('PLUGINS [' . __FUNCTION__ . ']: set forced activation action ' . Log::v2str($this->slug), Log::LV_DEBUG); |
||||
return ($this->data['activateAction'] = true); |
||||
} |
||||
|
||||
$activate = false; |
||||
if ($networkCheck) { |
||||
if ($this->isNetworkInactive()) { |
||||
$activate = true; |
||||
} |
||||
} else { |
||||
if ($this->isInactive($subsite) || ($subsite > -1 && $this->isNetworkActive())) { |
||||
$activate = true; |
||||
} |
||||
} |
||||
|
||||
if ($activate || $this->data['deactivateAction']) { |
||||
Log::info('PLUGINS [' . __FUNCTION__ . ']: set activation action ' . Log::v2str($this->slug), Log::LV_DEBUG); |
||||
$this->data['activateAction'] = true; |
||||
} |
||||
|
||||
return $this->data['activateAction']; |
||||
} |
||||
|
||||
/** |
||||
* set deactivation action if the plugin isn't inactive |
||||
* |
||||
* @param string $shortMsg |
||||
* @param string $longMsg |
||||
* @param boolean $networkCheck // if true check if is active only on network |
||||
* |
||||
* @return boolean // return deactivaeAction status |
||||
*/ |
||||
public function setDeactivateAction($subsite = -1, $shortMsg = null, $longMsg = null, $networkCheck = false) |
||||
{ |
||||
if ($this->isIgnore()) { |
||||
return true; |
||||
} |
||||
|
||||
$deactivate = false; |
||||
if ($networkCheck) { |
||||
if (!$this->isNetworkInactive()) { |
||||
$deactivate = true; |
||||
} |
||||
} else { |
||||
if (!$this->isInactive($subsite)) { |
||||
$deactivate = true; |
||||
} |
||||
} |
||||
|
||||
if ($deactivate) { |
||||
Log::info('PLUGINS [' . __FUNCTION__ . ']: set deactivate action ' . Log::v2str($this->slug), Log::LV_DEBUG); |
||||
$this->data['deactivateAction'] = true; |
||||
if (!empty($shortMsg)) { |
||||
$this->data['deactivateMessage'] = array( |
||||
'shortMsg' => $shortMsg, |
||||
'longMsg' => $longMsg |
||||
); |
||||
} |
||||
} |
||||
return $this->data['deactivateAction']; |
||||
} |
||||
|
||||
public function getPluginArchivePath() |
||||
{ |
||||
$archiveConfig = DUPX_ArchiveConfig::getInstance(); |
||||
if ($this->isMustUse()) { |
||||
$mainDir = $archiveConfig->getRelativePathsInArchive('muplugins'); |
||||
} elseif ($this->isDropIns()) { |
||||
$mainDir = $archiveConfig->getRelativePathsInArchive('wpcontent'); |
||||
} else { |
||||
$mainDir = $archiveConfig->getRelativePathsInArchive('plugins'); |
||||
} |
||||
return $mainDir . '/' . $this->slug; |
||||
} |
||||
|
||||
public function getPluginPath() |
||||
{ |
||||
$paramManager = PrmMng::getInstance(); |
||||
$mainDir = false; |
||||
if ($this->isMustUse()) { |
||||
$mainDir = $paramManager->getValue(PrmMng::PARAM_PATH_MUPLUGINS_NEW); |
||||
} elseif ($this->isDropIns()) { |
||||
$mainDir = $paramManager->getValue(PrmMng::PARAM_PATH_CONTENT_NEW); |
||||
} else { |
||||
$mainDir = $paramManager->getValue(PrmMng::PARAM_PATH_PLUGINS_NEW); |
||||
} |
||||
|
||||
if ($mainDir === false) { |
||||
return false; |
||||
} |
||||
|
||||
$dirNameRelative = dirname($this->slug); |
||||
$relativePath = false; |
||||
if (empty($dirNameRelative) || $dirNameRelative == '.') { |
||||
$relativePath = $this->slug; |
||||
} else { |
||||
$relativePath = $dirNameRelative; |
||||
} |
||||
|
||||
$result = $mainDir . '/' . $relativePath; |
||||
if (!file_exists($result)) { |
||||
return false; |
||||
} else { |
||||
return $result; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* @return mixed |
||||
*/ |
||||
public function deactivate() |
||||
{ |
||||
if (!$this->deactivateAction) { |
||||
return false; |
||||
} |
||||
|
||||
Log::info('[PLUGINS MANAGER] deactivate ' . Log::v2str($this->slug), Log::LV_DETAILED); |
||||
$deactivated = false; |
||||
$origFileManager = DUPX_Orig_File_Manager::getInstance(); |
||||
if ($this->isMustUse() || $this->isDropIns()) { |
||||
if (($pluginPath = $this->getPluginPath()) == false) { |
||||
Log::info('PLUGINS: can\'t remove plugin ' . $this->slug . ' because it doesn\'t exists'); |
||||
} else { |
||||
$origFileManager->addEntry($this->slug, $pluginPath, DUPX_Orig_File_Manager::MODE_MOVE); |
||||
$deactivated = true; |
||||
} |
||||
} else { |
||||
// for other type of plugins do nothing. They are not activated because they are missing in the table list of plugins |
||||
$deactivated = true; |
||||
} |
||||
|
||||
if ($deactivated) { |
||||
if (is_null($this->data['deactivateMessage'])) { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => $this->name . ' has been deactivated', |
||||
'level' => DUPX_NOTICE_ITEM::NOTICE, |
||||
'sections' => 'plugins' |
||||
)); |
||||
} else { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => $this->data['deactivateMessage']['shortMsg'], |
||||
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING, |
||||
'longMsg' => $this->data['deactivateMessage']['longMsg'], |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_HTML, |
||||
'sections' => 'plugins' |
||||
)); |
||||
} |
||||
} else { |
||||
DUPX_NOTICE_MANAGER::getInstance()->addFinalReportNotice(array( |
||||
'shortMsg' => 'Can\'t deactivate the plugin ' . $this->name, |
||||
'level' => DUPX_NOTICE_ITEM::SOFT_WARNING, |
||||
'longMsg' => 'Folder of the plugin not found', |
||||
'sections' => 'plugins' |
||||
)); |
||||
} |
||||
|
||||
// prevent multiple decativation action |
||||
$this->deactivateAction = false; |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param int $subsiteId |
||||
* |
||||
* @return string |
||||
*/ |
||||
public function getOrgiStatus($subsiteId) |
||||
{ |
||||
if ($this->isMustUse()) { |
||||
return self::STATUS_MUST_USE; |
||||
} elseif ($this->isDropIns()) { |
||||
return self::STATUS_DROP_INS; |
||||
} elseif ($this->isNetworkActive()) { |
||||
return self::STATUS_NETWORK_ACTIVE; |
||||
} elseif ($this->isActive($subsiteId)) { |
||||
return self::STATUS_ACTIVE; |
||||
} else { |
||||
return self::STATUS_INACTIVE; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $status |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function getStatusLabel($status) |
||||
{ |
||||
switch ($status) { |
||||
case self::STATUS_MUST_USE: |
||||
return 'must-use'; |
||||
case self::STATUS_DROP_INS: |
||||
return 'drop-in'; |
||||
case self::STATUS_NETWORK_ACTIVE: |
||||
return 'network active'; |
||||
case self::STATUS_ACTIVE: |
||||
return 'active'; |
||||
case self::STATUS_INACTIVE: |
||||
return 'inactive'; |
||||
default: |
||||
throw new Exception('Invalid status'); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Uninstall a single plugin. |
||||
* |
||||
* Calls the uninstall hook, if it is available. |
||||
* |
||||
* @param string $plugin Path to the main plugin file from plugins directory. |
||||
* |
||||
* @return true True if a plugin's uninstall.php file has been found and included. |
||||
*/ |
||||
public function uninstall() |
||||
{ |
||||
$nManager = DUPX_NOTICE_MANAGER::getInstance(); |
||||
try { |
||||
DUPX_RemoveRedundantData::loadWP(); |
||||
// UNINSTALL PLUGIN IF IS ACTIVE |
||||
$level = error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); |
||||
if (SnapUtil::isIniValChangeable('display_errors')) { |
||||
@ini_set('display_errors', 0); |
||||
} |
||||
Log::info("UNINSTALL PLUGIN " . Log::v2str($this->data['slug']), Log::LV_DEBUG); |
||||
$pluginFile = plugin_basename($this->data['slug']); |
||||
$uninstallable_plugins = (array) get_option('uninstall_plugins'); |
||||
/** |
||||
* Fires in uninstall_plugin() immediately before the plugin is uninstalled. |
||||
* |
||||
* @param string $plugin Path to the main plugin file from plugins directory. |
||||
* @param array $uninstallable_plugins Uninstallable plugins. |
||||
*/ |
||||
do_action('pre_uninstall_plugin', $this->data['slug'], $uninstallable_plugins); |
||||
if (file_exists(WP_PLUGIN_DIR . '/' . dirname($pluginFile) . '/uninstall.php')) { |
||||
if (isset($uninstallable_plugins[$pluginFile])) { |
||||
unset($uninstallable_plugins[$pluginFile]); |
||||
update_option('uninstall_plugins', $uninstallable_plugins); |
||||
} |
||||
unset($uninstallable_plugins); |
||||
if (defined('WP_UNINSTALL_PLUGIN')) { |
||||
$already_defined_uninstall_const = true; |
||||
} else { |
||||
define('WP_UNINSTALL_PLUGIN', $pluginFile); |
||||
$already_defined_uninstall_const = false; |
||||
} |
||||
|
||||
wp_register_plugin_realpath(WP_PLUGIN_DIR . '/' . $pluginFile); |
||||
if ($already_defined_uninstall_const) { |
||||
$uninstall_file_content = file_get_contents(WP_PLUGIN_DIR . '/' . dirname($pluginFile) . '/uninstall.php'); |
||||
/* |
||||
$regexProhibited = array( |
||||
'dirname[\t\s]*\([\t\s]*WP_UNINSTALL_PLUGIN[\t\s]*\)', |
||||
'WP_UNINSTALL_PLUGIN[\t\s]*\!?=', |
||||
'\!?=[\t\s]*WP_UNINSTALL_PLUGIN', |
||||
'current_user_can' |
||||
); */ |
||||
$prohibited_codes = array( |
||||
'dirname( WP_UNINSTALL_PLUGIN )', |
||||
'dirname(WP_UNINSTALL_PLUGIN )', |
||||
'dirname( WP_UNINSTALL_PLUGIN)', |
||||
'dirname(WP_UNINSTALL_PLUGIN)', |
||||
'WP_UNINSTALL_PLUGIN =', |
||||
'WP_UNINSTALL_PLUGIN !=', |
||||
'WP_UNINSTALL_PLUGIN=', |
||||
'WP_UNINSTALL_PLUGIN!=', |
||||
'= WP_UNINSTALL_PLUGIN', |
||||
'!= WP_UNINSTALL_PLUGIN', |
||||
'=WP_UNINSTALL_PLUGIN=', |
||||
'!=WP_UNINSTALL_PLUGIN', |
||||
'current_user_can', |
||||
); |
||||
foreach ($prohibited_codes as $prohibited_code) { |
||||
if (false !== stripos($uninstall_file_content, $prohibited_code)) { |
||||
Log::info("Can't include uninstall.php file of the " . $this->data['slug'] . " because prohibited code found"); |
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
include(WP_PLUGIN_DIR . '/' . dirname($pluginFile) . '/uninstall.php'); |
||||
} elseif (isset($uninstallable_plugins[$pluginFile])) { |
||||
$callable = $uninstallable_plugins[$pluginFile]; |
||||
unset($uninstallable_plugins[$pluginFile]); |
||||
update_option('uninstall_plugins', $uninstallable_plugins); |
||||
unset($uninstallable_plugins); |
||||
wp_register_plugin_realpath(WP_PLUGIN_DIR . '/' . $pluginFile); |
||||
include_once(WP_PLUGIN_DIR . '/' . $pluginFile); |
||||
add_action("uninstall_{$pluginFile}", $callable); |
||||
/** |
||||
* Fires in uninstall_plugin() once the plugin has been uninstalled. |
||||
* |
||||
* The action concatenates the 'uninstall_' prefix with the basename of the |
||||
* plugin passed to uninstall_plugin() to create a dynamically-named action. |
||||
* |
||||
* @since 2.7.0 |
||||
*/ |
||||
do_action("uninstall_{$pluginFile}"); |
||||
// Extra |
||||
// Extra |
||||
} else { |
||||
// The plugin was never activated so no need to call uninstallation hook |
||||
} |
||||
|
||||
// store plugin in original file folder |
||||
$origFileManager = DUPX_Orig_File_Manager::getInstance(); |
||||
if (($pluginPath = $this->getPluginPath()) == false) { |
||||
Log::info('PLUGINS: can\'t remove plugin ' . $this->slug . ' because doesn\'t exist'); |
||||
} else { |
||||
$origFileManager->addEntry($this->slug, $pluginPath, DUPX_Orig_File_Manager::MODE_MOVE); |
||||
} |
||||
} catch (Exception $e) { |
||||
$errorMsg = "**ERROR** The Inactive plugin " . $this->name . " can't be deleted"; |
||||
$longMsg = 'Please delete the plugin ' . $this->name . ' (' . $this->slug . ') manually' . PHP_EOL . |
||||
'Exception message: ' . $e->getMessage() . PHP_EOL . |
||||
'Trace: ' . $e->getTraceAsString(); |
||||
Log::info($errorMsg); |
||||
$nManager->addFinalReportNotice(array( |
||||
'shortMsg' => $errorMsg, |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsg' => $longMsg, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE, |
||||
'sections' => 'plugins' |
||||
)); |
||||
return false; |
||||
} catch (Error $e) { |
||||
$errorMsg = "**ERROR** The Inactive plugin " . $this->name . " can't be deleted"; |
||||
$longMsg = 'Please delete the plugin ' . $this->name . ' (' . $this->slug . ') manually' . PHP_EOL . |
||||
'Exception message: ' . $e->getMessage() . PHP_EOL . |
||||
'Trace: ' . $e->getTraceAsString(); |
||||
Log::info($errorMsg); |
||||
$nManager->addFinalReportNotice(array( |
||||
'shortMsg' => $errorMsg, |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsg' => $longMsg, |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_PRE, |
||||
'sections' => 'plugins' |
||||
)); |
||||
return false; |
||||
} |
||||
|
||||
error_reporting($level); |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $key |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function __get($key) |
||||
{ |
||||
if (!isset($this->data[$key])) { |
||||
throw new Exception('prop ' . $key . ' doesn\'t exist'); |
||||
} |
||||
|
||||
return $this->data[$key]; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $key |
||||
* @param mixed $value |
||||
* |
||||
* @return mixed |
||||
*/ |
||||
public function __set($key, $value) |
||||
{ |
||||
if (!isset($this->data[$key])) { |
||||
throw new Exception('prop ' . $key . ' doesn\'t exist'); |
||||
} |
||||
if ($key === 'slug') { |
||||
throw new Exception('can\'t modify slug prop'); |
||||
} |
||||
return ($this->data[$key] = $value); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @param string $key |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function __isset($key) |
||||
{ |
||||
return isset($this->data[$key]); |
||||
} |
||||
} |
@ -1,502 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Original installer files manager |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\U |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
require_once(DUPX_INIT . '/classes/plugins/class.plugin.item.php'); |
||||
require_once(DUPX_INIT . '/classes/plugins/class.plugin.custom.actions.php'); |
||||
require_once(DUPX_INIT . '/classes/utilities/class.u.remove.redundant.data.php'); |
||||
|
||||
/** |
||||
* Original installer files manager |
||||
* singleton class |
||||
*/ |
||||
final class DUPX_Plugins_Manager |
||||
{ |
||||
const SLUG_WOO_ADMIN = 'woocommerce-admin/woocommerce-admin.php'; |
||||
const SLUG_SIMPLE_SSL = 'really-simple-ssl/rlrsssl-really-simple-ssl.php'; |
||||
const SLUG_ONE_CLICK_SSL = 'one-click-ssl/ssl.php'; |
||||
const SLUG_WP_FORCE_SSL = 'wp-force-ssl/wp-force-ssl.php'; |
||||
const SLUG_RECAPTCHA = 'simple-google-recaptcha/simple-google-recaptcha.php'; |
||||
const SLUG_WPBAKERY_PAGE_BUILDER = 'js_composer/js_composer.php'; |
||||
const SLUG_DUPLICATOR_PRO = 'duplicator-pro/duplicator-pro.php'; |
||||
const SLUG_DUPLICATOR_LITE = 'duplicator/duplicator.php'; |
||||
const SLUG_DUPLICATOR_TESTER = 'duplicator-tester-plugin/duplicator-tester.php'; |
||||
const SLUG_WPS_HIDE_LOGIN = 'wps-hide-login/wps-hide-login.php'; |
||||
const SLUG_POPUP_MAKER = 'popup-maker/popup-maker.php'; |
||||
const SLUG_JETPACK = 'jetpack/jetpack.php'; |
||||
const SLUG_WP_ROCKET = 'wp-rocket/wp-rocket.php'; |
||||
const SLUG_BETTER_WP_SECURITY = 'better-wp-security/better-wp-security.php'; |
||||
const SLUG_HTTPS_REDIRECTION = 'https-redirection/https-redirection.php'; |
||||
const SLUG_LOGIN_NOCAPTCHA = 'login-recaptcha/login-nocaptcha.php'; |
||||
const SLUG_GOOGLE_CAPTCHA = 'google-captcha/google-captcha.php'; |
||||
const SLUG_ADVANCED_CAPTCHA = 'advanced-google-recaptcha/advanced-google-recaptcha.php'; |
||||
const OPTION_ACTIVATE_PLUGINS = 'duplicator_activate_plugins_after_installation'; |
||||
|
||||
/** |
||||
* |
||||
* @var self |
||||
*/ |
||||
private static $instance = null; |
||||
|
||||
/** |
||||
* |
||||
* @var DUPX_Plugin_item[] |
||||
*/ |
||||
private $plugins = array(); |
||||
|
||||
/** |
||||
* |
||||
* @var DUPX_Plugin_item[] |
||||
*/ |
||||
private $unistallList = array(); |
||||
|
||||
/** |
||||
* |
||||
* @var DUPX_Plugin_custom_actions[] |
||||
*/ |
||||
private $customPluginsActions = array(); |
||||
|
||||
/** |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
|
||||
return self::$instance; |
||||
} |
||||
|
||||
private function __construct() |
||||
{ |
||||
|
||||
foreach (DUPX_ArchiveConfig::getInstance()->wpInfo->plugins as $pluginInfo) { |
||||
$this->plugins[$pluginInfo->slug] = new DUPX_Plugin_item((array) $pluginInfo); |
||||
} |
||||
|
||||
$this->setCustomPluginsActions(); |
||||
|
||||
Log::info('CONSTRUCT PLUGINS OBJECTS: ' . Log::v2str($this->plugins), Log::LV_HARD_DEBUG); |
||||
} |
||||
|
||||
private function setCustomPluginsActions() |
||||
{ |
||||
$default = DUPX_Plugin_custom_actions::BY_DEFAULT_ENABLED; |
||||
$afterLogin = true; |
||||
$longMsg = ''; |
||||
|
||||
$this->customPluginsActions[self::SLUG_DUPLICATOR_LITE] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_DUPLICATOR_LITE, |
||||
$default, |
||||
$afterLogin, |
||||
$longMsg |
||||
); |
||||
$this->customPluginsActions[self::SLUG_DUPLICATOR_TESTER] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_DUPLICATOR_TESTER, |
||||
$default, |
||||
$afterLogin, |
||||
$longMsg |
||||
); |
||||
$this->customPluginsActions[self::SLUG_DUPLICATOR_PRO] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_DUPLICATOR_PRO, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
false, |
||||
'Duplicator PRO has been deactivated because in the new versions it is not possible to ' . |
||||
'have Duplicator PRO active at the same time as PRO.' |
||||
); |
||||
|
||||
$longMsg = "This plugin is deactivated by default automatically. " |
||||
. "<strong>You must reactivate from the WordPress admin panel after completing the installation</strong> " |
||||
. "or from the plugins tab." |
||||
. " Your site's frontend will render properly after reactivating the plugin."; |
||||
$this->customPluginsActions[self::SLUG_WPBAKERY_PAGE_BUILDER] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_WPBAKERY_PAGE_BUILDER, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
true, |
||||
$longMsg |
||||
); |
||||
$this->customPluginsActions[self::SLUG_JETPACK] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_JETPACK, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
true, |
||||
$longMsg |
||||
); |
||||
|
||||
$longMsg = "This plugin is deactivated by default automatically due to issues that one may encounter when migrating. " |
||||
. "<strong>You must reactivate from the WordPress admin panel after completing the installation</strong> " |
||||
. "or from the plugins tab." |
||||
. " Your site's frontend will render properly after reactivating the plugin."; |
||||
|
||||
$this->customPluginsActions[self::SLUG_POPUP_MAKER] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_POPUP_MAKER, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
true, |
||||
$longMsg |
||||
); |
||||
$this->customPluginsActions[self::SLUG_WP_ROCKET] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_WP_ROCKET, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
true, |
||||
$longMsg |
||||
); |
||||
$this->customPluginsActions[self::SLUG_WPS_HIDE_LOGIN] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_WPS_HIDE_LOGIN, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
true, |
||||
$longMsg |
||||
); |
||||
|
||||
$longMsg = "This plugin is deactivated by default automatically due to issues that one may encounter when migrating. " |
||||
. "<strong>You must reactivate from the WordPress admin panel after completing the installation</strong> " |
||||
. "or from the plugins tab."; |
||||
$this->customPluginsActions[self::SLUG_WOO_ADMIN] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_WOO_ADMIN, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
true, |
||||
$longMsg |
||||
); |
||||
$this->customPluginsActions[self::SLUG_BETTER_WP_SECURITY] = new DUPX_Plugin_custom_actions( |
||||
self::SLUG_BETTER_WP_SECURITY, |
||||
DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED, |
||||
true, |
||||
$longMsg |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @return DUPX_Plugin_item[] |
||||
*/ |
||||
public function getPlugins() |
||||
{ |
||||
return $this->plugins; |
||||
} |
||||
|
||||
/** |
||||
* |
||||
* @staticvar string[] $dropInsPaths |
||||
* @return string[] |
||||
*/ |
||||
public function getDropInsPaths() |
||||
{ |
||||
static $dropInsPaths = null; |
||||
|
||||
if (is_null($dropInsPaths)) { |
||||
$dropInsPaths = array(); |
||||
foreach ($this->plugins as $plugin) { |
||||
if ($plugin->isDropIns()) { |
||||
$dropInsPaths[] = $plugin->getPluginArchivePath(); |
||||
} |
||||
} |
||||
Log::info('DROP INS PATHS: ' . Log::v2str($dropInsPaths)); |
||||
} |
||||
return $dropInsPaths; |
||||
} |
||||
|
||||
public function pluginExistsInArchive($slug) |
||||
{ |
||||
return array_key_exists($slug, $this->plugins); |
||||
} |
||||
|
||||
/** |
||||
* This function performs status checks on plugins and disables those that must disable creating user messages |
||||
*/ |
||||
public function preViewChecks() |
||||
{ |
||||
$noticeManager = DUPX_NOTICE_MANAGER::getInstance(); |
||||
$paramsManager = PrmMng::getInstance(); |
||||
|
||||
if (DUPX_InstallerState::isRestoreBackup()) { |
||||
return; |
||||
} |
||||
|
||||
$activePlugins = $paramsManager->getValue(PrmMng::PARAM_PLUGINS); |
||||
$saveParams = false; |
||||
|
||||
foreach ($this->customPluginsActions as $slug => $customPlugin) { |
||||
if (!isset($this->plugins[$slug])) { |
||||
continue; |
||||
} |
||||
|
||||
switch ($customPlugin->byDefaultStatus()) { |
||||
case DUPX_Plugin_custom_actions::BY_DEFAULT_DISABLED: |
||||
if (($delKey = array_search($slug, $activePlugins)) !== false) { |
||||
$saveParams = true; |
||||
unset($activePlugins[$delKey]); |
||||
|
||||
$noticeManager->addNextStepNotice(array( |
||||
'shortMsg' => 'Plugin ' . $this->plugins[$slug]->name . ' disabled by default', |
||||
'level' => DUPX_NOTICE_ITEM::NOTICE, |
||||
'longMsg' => $customPlugin->byDefaultMessage(), |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_HTML, |
||||
'sections' => 'plugins' |
||||
), DUPX_NOTICE_MANAGER::ADD_UNIQUE, 'custom_plugin_action' . $slug); |
||||
} |
||||
break; |
||||
case DUPX_Plugin_custom_actions::BY_DEFAULT_ENABLED: |
||||
if (!in_array($slug, $activePlugins)) { |
||||
$saveParams = true; |
||||
$activePlugins[] = $slug; |
||||
|
||||
$noticeManager->addNextStepNotice(array( |
||||
'shortMsg' => 'Plugin ' . $this->plugins[$slug]->name . ' enabled by default', |
||||
'level' => DUPX_NOTICE_ITEM::NOTICE, |
||||
'longMsg' => $customPlugin->byDefaultMessage(), |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_HTML, |
||||
'sections' => 'plugins' |
||||
), DUPX_NOTICE_MANAGER::ADD_UNIQUE, 'custom_plugin_action' . $slug); |
||||
} |
||||
break; |
||||
case DUPX_Plugin_custom_actions::BY_DEFAULT_AUTO: |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
|
||||
if ($saveParams) { |
||||
$paramsManager->setValue(PrmMng::PARAM_PLUGINS, $activePlugins); |
||||
$paramsManager->save(); |
||||
$noticeManager->saveNotices(); |
||||
} |
||||
} |
||||
|
||||
public function getStatusCounts($subsiteId = -1) |
||||
{ |
||||
$result = array( |
||||
DUPX_Plugin_item::STATUS_MUST_USE => 0, |
||||
DUPX_Plugin_item::STATUS_DROP_INS => 0, |
||||
DUPX_Plugin_item::STATUS_NETWORK_ACTIVE => 0, |
||||
DUPX_Plugin_item::STATUS_ACTIVE => 0, |
||||
DUPX_Plugin_item::STATUS_INACTIVE => 0 |
||||
); |
||||
|
||||
foreach ($this->plugins as $plugin) { |
||||
$result[$plugin->getOrgiStatus($subsiteId)]++; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
public function getDefaultActivePluginsList($subsiteId = -1) |
||||
{ |
||||
$result = array(); |
||||
foreach ($this->plugins as $plugin) { |
||||
if (!$plugin->isInactive($subsiteId)) { |
||||
$result[] = $plugin->slug; |
||||
} |
||||
} |
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* return alla plugins slugs list |
||||
* |
||||
* @return string[] |
||||
*/ |
||||
public function getAllPluginsSlugs() |
||||
{ |
||||
return array_keys($this->plugins); |
||||
} |
||||
|
||||
public function setActions($plugins, $subsiteId = -1) |
||||
{ |
||||
Log::info('FUNCTION [' . __FUNCTION__ . ']: plugins ' . Log::v2str($plugins), Log::LV_DEBUG); |
||||
|
||||
foreach ($this->plugins as $slug => $plugin) { |
||||
$deactivate = false; |
||||
|
||||
if ($plugin->isForceDisabled()) { |
||||
$deactivate = true; |
||||
} else { |
||||
if (!$this->plugins[$slug]->isInactive($subsiteId) && !in_array($slug, $plugins)) { |
||||
$deactivate = true; |
||||
} |
||||
} |
||||
|
||||
if ($deactivate) { |
||||
$this->plugins[$slug]->setDeactivateAction($subsiteId, null, null, false); |
||||
} |
||||
} |
||||
|
||||
foreach ($plugins as $slug) { |
||||
if (isset($this->plugins[$slug])) { |
||||
$this->plugins[$slug]->setActivationAction($subsiteId, false); |
||||
} |
||||
} |
||||
|
||||
$this->setAutoActions($subsiteId); |
||||
DUPX_NOTICE_MANAGER::getInstance()->saveNotices(); |
||||
} |
||||
|
||||
public function executeActions($dbh, $subsiteId = -1) |
||||
{ |
||||
$activePluginsList = array(); |
||||
$activateOnLoginPluginsList = array(); |
||||
$this->unistallList = array(); |
||||
|
||||
$escapedTablePrefix = mysqli_real_escape_string($dbh, PrmMng::getInstance()->getValue(PrmMng::PARAM_DB_TABLE_PREFIX)); |
||||
|
||||
$noticeManager = DUPX_NOTICE_MANAGER::getInstance(); |
||||
|
||||
Log::info('PLUGINS OBJECTS: ' . Log::v2str($this->plugins), Log::LV_HARD_DEBUG); |
||||
|
||||
foreach ($this->plugins as $plugin) { |
||||
$deactivated = false; |
||||
if ($plugin->deactivateAction) { |
||||
$plugin->deactivate(); |
||||
// can't remove deactivate after login |
||||
$deactivated = true; |
||||
} else { |
||||
if ($plugin->isActive($subsiteId)) { |
||||
$activePluginsList[] = $plugin->slug; |
||||
} |
||||
} |
||||
|
||||
if ($plugin->activateAction) { |
||||
$activateOnLoginPluginsList[] = $plugin->slug; |
||||
$noticeManager->addFinalReportNotice(array( |
||||
'shortMsg' => 'Activate ' . $plugin->name . ' after you login.', |
||||
'level' => DUPX_NOTICE_ITEM::NOTICE, |
||||
'sections' => 'plugins' |
||||
)); |
||||
} |
||||
} |
||||
|
||||
// force duplicator lite activation |
||||
if (!array_key_exists(self::SLUG_DUPLICATOR_LITE, $activePluginsList)) { |
||||
$activePluginsList[] = self::SLUG_DUPLICATOR_LITE; |
||||
} |
||||
|
||||
// force duplicator tester activation if exists |
||||
if ($this->pluginExistsInArchive(self::SLUG_DUPLICATOR_TESTER) && !array_key_exists(self::SLUG_DUPLICATOR_TESTER, $activePluginsList)) { |
||||
$activePluginsList[] = self::SLUG_DUPLICATOR_TESTER; |
||||
} |
||||
|
||||
Log::info('Active plugins: ' . Log::v2str($activePluginsList), Log::LV_DEBUG); |
||||
|
||||
$value = mysqli_real_escape_string($dbh, @serialize($activePluginsList)); |
||||
$optionTable = mysqli_real_escape_string($dbh, DUPX_DB_Functions::getOptionsTableName()); |
||||
$query = "UPDATE `" . $optionTable . "` SET option_value = '" . $value . "' WHERE option_name = 'active_plugins' "; |
||||
|
||||
if (!DUPX_DB::mysqli_query($dbh, $query)) { |
||||
$noticeManager->addFinalReportNotice(array( |
||||
'shortMsg' => 'QUERY ERROR: MySQL', |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsg' => "Error description: " . mysqli_error($dbh), |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'sections' => 'database' |
||||
)); |
||||
throw new Exception("Database error description: " . mysqli_error($dbh)); |
||||
} |
||||
|
||||
$value = mysqli_real_escape_string($dbh, @serialize($activateOnLoginPluginsList)); |
||||
$optionTable = mysqli_real_escape_string($dbh, DUPX_DB_Functions::getOptionsTableName()); |
||||
$query = "INSERT INTO `" . $optionTable . "` (option_name, option_value) VALUES('" . self::OPTION_ACTIVATE_PLUGINS . "','" . $value . "') ON DUPLICATE KEY UPDATE option_name=\"" . self::OPTION_ACTIVATE_PLUGINS . "\""; |
||||
if (!DUPX_DB::mysqli_query($dbh, $query)) { |
||||
$noticeManager->addFinalReportNotice(array( |
||||
'shortMsg' => 'QUERY ERROR: MySQL', |
||||
'level' => DUPX_NOTICE_ITEM::HARD_WARNING, |
||||
'longMsg' => "Error description: " . mysqli_error($dbh), |
||||
'longMsgMode' => DUPX_NOTICE_ITEM::MSG_MODE_DEFAULT, |
||||
'sections' => 'database' |
||||
)); |
||||
throw new Exception("Database error description: " . mysqli_error($dbh)); |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* remove inactive plugins |
||||
* this method must calle after wp-config set |
||||
*/ |
||||
public function unistallInactivePlugins() |
||||
{ |
||||
Log::info('FUNCTION [' . __FUNCTION__ . ']: unistall inactive plugins'); |
||||
|
||||
foreach ($this->unistallList as $plugin) { |
||||
if ($plugin->uninstall()) { |
||||
Log::info("UNINSTALL PLUGIN " . Log::v2str($plugin->slug) . ' DONE'); |
||||
} else { |
||||
Log::info("UNINSTALL PLUGIN " . Log::v2str($plugin->slug) . ' FAILED'); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Set automatic actions for plugins |
||||
* |
||||
* @return void |
||||
*/ |
||||
public function setAutoActions($subsiteId = -1) |
||||
{ |
||||
$paramManager = PrmMng::getInstance(); |
||||
$casesToHandle = array( |
||||
array( |
||||
'slugs' => array( |
||||
self::SLUG_SIMPLE_SSL, |
||||
self::SLUG_WP_FORCE_SSL, |
||||
self::SLUG_HTTPS_REDIRECTION, |
||||
self::SLUG_ONE_CLICK_SSL |
||||
), |
||||
'longMsg' => "The plugin '%name%' has been deactivated because you are migrating from SSL (HTTPS) to Non-SSL (HTTP).<br>" . |
||||
"If it was not deactivated, you would not be able to login.", |
||||
'info' => '%name% [as Non-SSL installation] will be deactivated', |
||||
'condition' => !DUPX_U::is_ssl() |
||||
), |
||||
array( |
||||
'slugs' => array( |
||||
self::SLUG_RECAPTCHA, |
||||
self::SLUG_LOGIN_NOCAPTCHA, |
||||
self::SLUG_GOOGLE_CAPTCHA, |
||||
self::SLUG_ADVANCED_CAPTCHA |
||||
), |
||||
'longMsg' => "The plugin '%name%' has been deactivated because reCaptcha requires a site key which is bound to the site's address." . |
||||
"Your package site's address and installed site's address don't match. " . |
||||
"You can reactivate it after finishing with the installation.<br>" . |
||||
"<strong>Please do not forget to change the reCaptcha site key after activating it.</strong>", |
||||
'info' => '%name% [as package creation site URL and the installation site URL are different] will be deactivated', |
||||
'condition' => $paramManager->getValue(PrmMng::PARAM_SITE_URL_OLD) != $paramManager->getValue(PrmMng::PARAM_SITE_URL), |
||||
), |
||||
); |
||||
|
||||
foreach ($casesToHandle as $case) { |
||||
foreach ($case['slugs'] as $slug) { |
||||
if (isset($this->plugins[$slug]) && $this->plugins[$slug]->isActive($subsiteId) && $case['condition']) { |
||||
$info = str_replace('%name%', $this->plugins[$slug]->name, $case['info']); |
||||
$longMsg = str_replace('%name%', $this->plugins[$slug]->name, $case['longMsg']); |
||||
Log::info($info, Log::LV_DEBUG); |
||||
$this->plugins[$slug]->setDeactivateAction($subsiteId, $info, $longMsg); |
||||
} |
||||
} |
||||
} |
||||
|
||||
foreach ($this->customPluginsActions as $slug => $customPlugin) { |
||||
if (!isset($this->plugins[$slug])) { |
||||
continue; |
||||
} |
||||
if (!$this->plugins[$slug]->isInactive($subsiteId) && $customPlugin->isEnableAfterLogin()) { |
||||
$this->plugins[$slug]->setActivationAction($subsiteId); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private function __clone() |
||||
{ |
||||
} |
||||
} |
@ -1,42 +0,0 @@ |
||||
<?php |
||||
|
||||
/* |
||||
* To change this license header, choose License Headers in Project Properties. |
||||
* To change this template file, choose Tools | Templates |
||||
* and open the template in the editor. |
||||
*/ |
||||
|
||||
class DUPX_REST_AUTH implements Requests_Auth |
||||
{ |
||||
protected $nonce = null; |
||||
protected $basicAuthUser = ""; |
||||
protected $basicAuthPassword = ""; |
||||
|
||||
public function __construct($nonce, $basicAuthUser = "", $basicAuthPassword = "") |
||||
{ |
||||
$this->nonce = $nonce; |
||||
$this->basicAuthUser = $basicAuthUser; |
||||
$this->basicAuthPassword = $basicAuthPassword; |
||||
} |
||||
|
||||
public function register(Requests_Hooks &$hooks) |
||||
{ |
||||
if (strlen($this->basicAuthUser) > 0) { |
||||
$basicAuth = new Requests_Auth_Basic(array( |
||||
$this->basicAuthUser, |
||||
$this->basicAuthPassword |
||||
)); |
||||
$basicAuth->register($hooks); |
||||
} |
||||
|
||||
$hooks->register('requests.before_request', array($this, 'before_request')); |
||||
} |
||||
|
||||
public function before_request(&$url, &$headers, &$data, &$type, &$options) |
||||
{ |
||||
$data['_wpnonce'] = $this->nonce; |
||||
foreach ($_COOKIE as $key => $val) { |
||||
$options['cookies'][$key] = $val; |
||||
} |
||||
} |
||||
} |
@ -1,148 +0,0 @@ |
||||
<?php |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Libs\Snap\SnapIO; |
||||
use Duplicator\Installer\Utils\Log\Log; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
|
||||
|
||||
class DUPX_REST |
||||
{ |
||||
const DUPLICATOR_NAMESPACE = 'duplicator/v1/'; |
||||
|
||||
/** |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $nonce = false; |
||||
|
||||
/** |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $basicAuthUser = ""; |
||||
|
||||
/** |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $basicAuthPassword = ""; |
||||
|
||||
/** |
||||
* |
||||
* @var string |
||||
*/ |
||||
private $url = false; |
||||
|
||||
/** |
||||
* |
||||
* @var self |
||||
*/ |
||||
private static $instance = null; |
||||
|
||||
/** |
||||
* |
||||
* @return self |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
|
||||
return self::$instance; |
||||
} |
||||
|
||||
private function __construct() |
||||
{ |
||||
$paramsManager = PrmMng::getInstance(); |
||||
$overwriteData = $paramsManager->getValue(PrmMng::PARAM_OVERWRITE_SITE_DATA); |
||||
|
||||
if (is_array($overwriteData)) { |
||||
if ( |
||||
isset($overwriteData['restUrl']) && |
||||
strlen($overwriteData['restUrl']) > 0 && |
||||
isset($overwriteData['restNonce']) && |
||||
strlen($overwriteData['restNonce']) > 0 |
||||
) { |
||||
$this->url = SnapIO::untrailingslashit($overwriteData['restUrl']); |
||||
$this->nonce = $overwriteData['restNonce']; |
||||
} |
||||
|
||||
if (strlen($overwriteData['restAuthUser']) > 0) { |
||||
$this->basicAuthUser = $overwriteData['restAuthUser']; |
||||
$this->basicAuthPassword = $overwriteData['restAuthPassword']; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public function checkRest($reset = false, &$errorMessage = "") |
||||
{ |
||||
static $success = null; |
||||
if (is_null($success) || $reset) { |
||||
try { |
||||
$success = true; |
||||
if ($this->nonce === false) { |
||||
throw new Exception("Nonce is not set."); |
||||
} |
||||
|
||||
if (strlen($testUrl = $this->getRestUrl('versions')) === 0) { |
||||
throw new Exception("Couldn't get REST API backed URL to do tests. REST API URL was empty."); |
||||
} |
||||
|
||||
$response = Requests::get($testUrl, array(), $this->getRequestAuthOptions()); |
||||
if ($response->success == false) { |
||||
Log::info(Log::v2str($response)); |
||||
throw new Exception("REST API request on $testUrl failed"); |
||||
} |
||||
|
||||
if (($result = json_decode($response->body, true)) === null) { |
||||
throw new Exception("Can't decode json."); |
||||
} |
||||
|
||||
if (!isset($result["dup"])) { |
||||
throw new Exception("Did not receive the expected result."); |
||||
} |
||||
} catch (Exception $ex) { |
||||
$success = false; |
||||
$errorMessage = $ex->getMessage(); |
||||
Log::info("FAILED REST API CHECK. MESSAGE: " . $ex->getMessage()); |
||||
} |
||||
} |
||||
return $success; |
||||
} |
||||
|
||||
public function getVersions() |
||||
{ |
||||
$response = Requests::get($this->getRestUrl('versions'), array(), $this->getRequestAuthOptions()); |
||||
if (!$response->success) { |
||||
return false; |
||||
} |
||||
|
||||
if (($result = json_decode($response->body)) === null) { |
||||
return false; |
||||
} |
||||
|
||||
return $result; |
||||
} |
||||
|
||||
/** |
||||
* Return request auth options |
||||
* |
||||
* @return array |
||||
*/ |
||||
private function getRequestAuthOptions() |
||||
{ |
||||
return array( |
||||
'auth' => new DUPX_REST_AUTH($this->nonce, $this->basicAuthUser, $this->basicAuthPassword), |
||||
'verify' => false, |
||||
'verifyname' => false |
||||
); |
||||
} |
||||
|
||||
private function getRestUrl($subPath = '') |
||||
{ |
||||
return $this->url ? $this->url . '/' . self::DUPLICATOR_NAMESPACE . $subPath : ''; |
||||
} |
||||
} |
@ -1,89 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Custom exceptions |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\U |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
/** |
||||
* Dup installer custom exception |
||||
*/ |
||||
class DupxException extends Exception |
||||
{ |
||||
/** |
||||
* |
||||
* @var string // formatted html string |
||||
*/ |
||||
protected $longMsg = ''; |
||||
protected $faqLink = false; |
||||
|
||||
/** |
||||
* |
||||
* @param type $shortMsg |
||||
* @param type $longMsg |
||||
* @param type $faqLinkUrl |
||||
* @param type $faqLinkLabel |
||||
* @param type $code |
||||
* @param Exception $previous |
||||
*/ |
||||
public function __construct($shortMsg, $longMsg = '', $faqLinkUrl = '', $faqLinkLabel = '', $code = 0, Exception $previous = null) |
||||
{ |
||||
parent::__construct($shortMsg, $code, $previous); |
||||
$this->longMsg = (string) $longMsg; |
||||
if (!empty($faqLinkUrl)) { |
||||
$this->faqLink = array( |
||||
'url' => $faqLinkUrl, |
||||
'label' => $faqLinkLabel |
||||
); |
||||
} |
||||
} |
||||
|
||||
public function getLongMsg() |
||||
{ |
||||
return $this->longMsg; |
||||
} |
||||
|
||||
public function haveFaqLink() |
||||
{ |
||||
return $this->faqLink !== false; |
||||
} |
||||
|
||||
public function getFaqLinkUrl() |
||||
{ |
||||
if ($this->haveFaqLink()) { |
||||
return $this->faqLink['url']; |
||||
} else { |
||||
return ''; |
||||
} |
||||
} |
||||
|
||||
public function getFaqLinkLabel() |
||||
{ |
||||
if ($this->haveFaqLink()) { |
||||
return $this->faqLink['label']; |
||||
} else { |
||||
return ''; |
||||
} |
||||
} |
||||
|
||||
// custom string representation of object |
||||
public function __toString() |
||||
{ |
||||
$result = __CLASS__ . ": [{$this->code}]: {$this->message}"; |
||||
if ($this->haveFaqLink()) { |
||||
$result .= "\n\tSee FAQ " . $this->faqLink['label'] . ': ' . $this->faqLink['url']; |
||||
} |
||||
if (!empty($this->longMsg)) { |
||||
$result .= "\n\t" . strip_tags($this->longMsg); |
||||
} |
||||
$result .= "\n"; |
||||
return $result; |
||||
} |
||||
} |
@ -1,63 +0,0 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Original installer files manager |
||||
* |
||||
* Standard: PSR-2 |
||||
* |
||||
* @link http://www.php-fig.org/psr/psr-2 Full Documentation |
||||
* |
||||
* @package SC\DUPX\U |
||||
*/ |
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit; |
||||
|
||||
use Duplicator\Installer\Core\Bootstrap; |
||||
use Duplicator\Installer\Core\Params\PrmMng; |
||||
use Duplicator\Libs\Snap\SnapOrigFileManager; |
||||
|
||||
/** |
||||
* Original installer files manager |
||||
* |
||||
* This class saves a file or folder in the original files folder and saves the original location persistant. |
||||
* By entry we mean a file or a folder but not the files contained within it. |
||||
* In this way it is possible, for example, to move an entire plugin to restore it later. |
||||
* |
||||
* singleton class |
||||
*/ |
||||
final class DUPX_Orig_File_Manager extends SnapOrigFileManager |
||||
{ |
||||
/** |
||||
* |
||||
* @var DUPX_Orig_File_Manager |
||||
*/ |
||||
private static $instance = null; |
||||
|
||||
/** |
||||
* |
||||
* @return DUPX_Orig_File_Manager |
||||
*/ |
||||
public static function getInstance() |
||||
{ |
||||
if (is_null(self::$instance)) { |
||||
self::$instance = new self(); |
||||
} |
||||
|
||||
return self::$instance; |
||||
} |
||||
|
||||
/** |
||||
* This class should be singleton, but unfortunately it is not possible to change the constructor in private with versions prior to PHP 7.2. |
||||
*/ |
||||
public function __construct() |
||||
{ |
||||
//Init Original File Manager |
||||
$packageHash = Bootstrap::getPackageHash(); |
||||
$root = PrmMng::getInstance()->getValue(PrmMng::PARAM_PATH_NEW); |
||||
parent::__construct($root, DUPX_INIT, $packageHash); |
||||
} |
||||
|
||||
private function __clone() |
||||
{ |
||||
} |
||||
} |