Version Description
Fixed
- Set the type of backup file during download via HTML attribute
- Removed Math_BigInteger class which was causing issues with other plugins
Download this release
Release Info
| Developer | bangelov |
| Plugin | |
| Version | 6.84 |
| Comparing to | |
| See all releases | |
Code changes from version 6.83 to 6.84
- all-in-one-wp-migration.php +2 -2
- constants.php +7 -2
- deprecated.php +1 -1
- exceptions.php +1 -1
- functions.php +1 -64
- lib/controller/class-ai1wm-backups-controller.php +1 -1
- lib/controller/class-ai1wm-export-controller.php +1 -1
- lib/controller/class-ai1wm-feedback-controller.php +1 -1
- lib/controller/class-ai1wm-import-controller.php +1 -1
- lib/controller/class-ai1wm-main-controller.php +1 -1
- lib/controller/class-ai1wm-report-controller.php +1 -1
- lib/controller/class-ai1wm-status-controller.php +1 -1
- lib/controller/class-ai1wm-updater-controller.php +1 -1
- lib/model/class-ai1wm-backups.php +1 -1
- lib/model/class-ai1wm-compatibility.php +1 -1
- lib/model/class-ai1wm-deprecated.php +1 -1
- lib/model/class-ai1wm-extensions.php +1 -1
- lib/model/class-ai1wm-feedback.php +1 -1
- lib/model/class-ai1wm-handler.php +1 -1
- lib/model/class-ai1wm-log.php +1 -1
- lib/model/class-ai1wm-message.php +1 -1
- lib/model/class-ai1wm-notification.php +1 -1
- lib/model/class-ai1wm-report.php +1 -1
- lib/model/class-ai1wm-status.php +1 -1
- lib/model/class-ai1wm-template.php +1 -1
- lib/model/class-ai1wm-updater.php +1 -1
- lib/model/export/class-ai1wm-export-archive.php +1 -1
- lib/model/export/class-ai1wm-export-clean.php +1 -1
- lib/model/export/class-ai1wm-export-compatibility.php +1 -1
- lib/model/export/class-ai1wm-export-config-file.php +1 -1
- lib/model/export/class-ai1wm-export-config.php +1 -1
- lib/model/export/class-ai1wm-export-content.php +1 -1
- lib/model/export/class-ai1wm-export-database-file.php +1 -1
- lib/model/export/class-ai1wm-export-database.php +1 -1
- lib/model/export/class-ai1wm-export-download.php +5 -3
- lib/model/export/class-ai1wm-export-enumerate.php +1 -1
- lib/model/export/class-ai1wm-export-init.php +1 -1
- lib/model/import/class-ai1wm-import-blogs.php +1 -1
- lib/model/import/class-ai1wm-import-clean.php +1 -1
- lib/model/import/class-ai1wm-import-compatibility.php +1 -1
- lib/model/import/class-ai1wm-import-confirm.php +1 -1
- lib/model/import/class-ai1wm-import-content.php +1 -1
- lib/model/import/class-ai1wm-import-database.php +1 -1
- lib/model/import/class-ai1wm-import-done.php +4 -1
- lib/model/import/class-ai1wm-import-enumerate.php +1 -1
- lib/model/import/class-ai1wm-import-mu-plugins.php +2 -1
- lib/model/import/class-ai1wm-import-upload.php +1 -1
- lib/model/import/class-ai1wm-import-validate.php +1 -1
- lib/vendor/math/BigInteger.php +0 -3811
- lib/vendor/servmask/archiver/class-ai1wm-archiver.php +1 -1
- lib/vendor/servmask/archiver/class-ai1wm-compressor.php +1 -1
- lib/vendor/servmask/archiver/class-ai1wm-extractor.php +1 -1
- lib/vendor/servmask/command/class-ai1wm-wp-cli-command.php +1 -1
- lib/vendor/servmask/cron/class-ai1wm-cron.php +1 -1
- lib/vendor/servmask/database/class-ai1wm-database-mysql.php +1 -1
- lib/vendor/servmask/database/class-ai1wm-database-mysqli.php +1 -1
- lib/vendor/servmask/database/class-ai1wm-database-utility.php +1 -1
- lib/vendor/servmask/database/class-ai1wm-database.php +1 -1
- lib/vendor/servmask/filesystem/class-ai1wm-directory.php +1 -1
- lib/vendor/servmask/filesystem/class-ai1wm-file-htaccess.php +1 -1
- lib/vendor/servmask/filesystem/class-ai1wm-file-index.php +1 -1
- lib/vendor/servmask/filesystem/class-ai1wm-file-webconfig.php +1 -1
- lib/vendor/servmask/filesystem/class-ai1wm-file.php +1 -1
- lib/vendor/servmask/filter/class-ai1wm-recursive-exclude-filter.php +1 -1
- lib/vendor/servmask/filter/class-ai1wm-recursive-extension-filter.php +1 -1
- lib/vendor/servmask/iterator/class-ai1wm-recursive-directory-iterator.php +1 -1
- lib/vendor/servmask/iterator/class-ai1wm-recursive-iterator-iterator.php +1 -1
- lib/view/assets/css/export.min.css +1 -1
- lib/view/assets/css/export.min.rtl.css +1 -1
- lib/view/assets/javascript/backups.min.js +6 -6
- lib/view/assets/javascript/export.min.js +7 -7
- lib/view/assets/javascript/import.min.js +6 -6
- lib/view/assets/javascript/settings.min.js +3 -3
- lib/view/assets/javascript/updater.min.js +1 -1
- lib/view/assets/javascript/util.min.js +2 -2
- lib/view/backups/index.php +2 -2
- lib/view/common/http-authentication.php +1 -1
- lib/view/common/leave-feedback.php +1 -1
- lib/view/common/maintenance-mode.php +1 -1
- lib/view/common/report-problem.php +1 -1
- lib/view/common/share-buttons.php +1 -1
- lib/view/export/advanced-settings.php +1 -1
- lib/view/export/button-azure-storage.php +1 -1
- lib/view/export/button-b2.php +1 -1
- lib/view/export/button-box.php +1 -1
- lib/view/export/button-digitalocean.php +1 -1
- lib/view/export/button-dropbox.php +1 -1
- lib/view/export/button-file.php +1 -1
- lib/view/export/button-ftp.php +1 -1
- lib/view/export/button-gcloud-storage.php +1 -1
- lib/view/export/button-gdrive.php +1 -1
- lib/view/export/button-glacier.php +1 -1
- lib/view/export/button-mega.php +1 -1
- lib/view/export/button-onedrive.php +1 -1
- lib/view/export/button-pcloud.php +1 -1
- lib/view/export/button-s3-client.php +1 -1
- lib/view/export/button-s3.php +1 -1
- lib/view/export/button-webdav.php +1 -1
- lib/view/export/export-buttons.php +1 -1
- lib/view/export/find-replace.php +1 -1
- lib/view/export/help-section.php +1 -1
- lib/view/export/index.php +1 -1
- lib/view/import/button-azure-storage.php +1 -1
- lib/view/import/button-b2.php +1 -1
- lib/view/import/button-box.php +1 -1
- lib/view/import/button-digitalocean.php +1 -1
- lib/view/import/button-dropbox.php +1 -1
- lib/view/import/button-file.php +1 -1
- lib/view/import/button-ftp.php +1 -1
- lib/view/import/button-gcloud-storage.php +1 -1
- lib/view/import/button-gdrive.php +1 -1
- lib/view/import/button-glacier.php +1 -1
- lib/view/import/button-mega.php +1 -1
- lib/view/import/button-onedrive.php +1 -1
- lib/view/import/button-pcloud.php +1 -1
- lib/view/import/button-s3-client.php +1 -1
- lib/view/import/button-s3.php +1 -1
- lib/view/import/button-url.php +1 -1
- lib/view/import/button-webdav.php +1 -1
- lib/view/import/import-buttons.php +1 -1
- lib/view/import/index.php +1 -1
- lib/view/import/pro.php +1 -1
- lib/view/main/admin-head.php +1 -1
- lib/view/main/backups-htaccess-notice.php +1 -1
- lib/view/main/backups-index-notice.php +1 -1
- lib/view/main/backups-path-notice.php +1 -1
- lib/view/main/backups-webconfig-notice.php +1 -1
- lib/view/main/get-support.php +1 -1
- lib/view/main/multisite-notice.php +1 -1
- lib/view/main/storage-index-notice.php +1 -1
- lib/view/main/storage-path-notice.php +1 -1
- lib/view/main/wordpress-htaccess-notice.php +1 -1
- lib/view/updater/check.php +1 -1
- lib/view/updater/modal.php +1 -1
- loader.php +1 -7
- readme.txt +7 -1
- uninstall.php +1 -1
all-in-one-wp-migration.php
CHANGED
|
@@ -5,12 +5,12 @@
|
|
| 5 |
* Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
|
| 6 |
* Author: ServMask
|
| 7 |
* Author URI: https://servmask.com/
|
| 8 |
-
* Version: 6.
|
| 9 |
* Text Domain: all-in-one-wp-migration
|
| 10 |
* Domain Path: /languages
|
| 11 |
* Network: True
|
| 12 |
*
|
| 13 |
-
* Copyright (C) 2014-
|
| 14 |
*
|
| 15 |
* This program is free software: you can redistribute it and/or modify
|
| 16 |
* it under the terms of the GNU General Public License as published by
|
| 5 |
* Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
|
| 6 |
* Author: ServMask
|
| 7 |
* Author URI: https://servmask.com/
|
| 8 |
+
* Version: 6.84
|
| 9 |
* Text Domain: all-in-one-wp-migration
|
| 10 |
* Domain Path: /languages
|
| 11 |
* Network: True
|
| 12 |
*
|
| 13 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 14 |
*
|
| 15 |
* This program is free software: you can redistribute it and/or modify
|
| 16 |
* it under the terms of the GNU General Public License as published by
|
constants.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -31,7 +31,7 @@ define( 'AI1WM_DEBUG', false );
|
|
| 31 |
// ==================
|
| 32 |
// = Plugin Version =
|
| 33 |
// ==================
|
| 34 |
-
define( 'AI1WM_VERSION', '6.
|
| 35 |
|
| 36 |
// ===============
|
| 37 |
// = Plugin Name =
|
|
@@ -183,6 +183,11 @@ define( 'AI1WM_ENDURANCE_BROWSER_CACHE_NAME', 'endurance-browser-cache.php' );
|
|
| 183 |
// =========================
|
| 184 |
define( 'AI1WM_GD_SYSTEM_PLUGIN_NAME', 'gd-system-plugin.php' );
|
| 185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
// ===================
|
| 187 |
// = Export Log Name =
|
| 188 |
// ===================
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 31 |
// ==================
|
| 32 |
// = Plugin Version =
|
| 33 |
// ==================
|
| 34 |
+
define( 'AI1WM_VERSION', '6.84' );
|
| 35 |
|
| 36 |
// ===============
|
| 37 |
// = Plugin Name =
|
| 183 |
// =========================
|
| 184 |
define( 'AI1WM_GD_SYSTEM_PLUGIN_NAME', 'gd-system-plugin.php' );
|
| 185 |
|
| 186 |
+
// =======================
|
| 187 |
+
// = Wp Stack Cache Name =
|
| 188 |
+
// =======================
|
| 189 |
+
define( 'AI1WM_WP_STACK_CACHE_NAME', 'wp-stack-cache.php' );
|
| 190 |
+
|
| 191 |
// ===================
|
| 192 |
// = Export Log Name =
|
| 193 |
// ===================
|
deprecated.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
exceptions.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
functions.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -1314,52 +1314,6 @@ function ai1wm_copy( $source_file, $destination_file ) {
|
|
| 1314 |
ai1wm_close( $destination_handle );
|
| 1315 |
}
|
| 1316 |
|
| 1317 |
-
/**
|
| 1318 |
-
* Get the size of file in bytes
|
| 1319 |
-
*
|
| 1320 |
-
* This method supports files > 2GB on PHP x86
|
| 1321 |
-
*
|
| 1322 |
-
* @param string $file_path Path to the file
|
| 1323 |
-
* @param boolean $as_string Return the filesize as string instead of BigInteger
|
| 1324 |
-
*
|
| 1325 |
-
* @return mixed Math_BigInteger|string|null
|
| 1326 |
-
*/
|
| 1327 |
-
function ai1wm_filesize( $file_path, $as_string = true ) {
|
| 1328 |
-
$chunk_size = 2000000; // 2MB
|
| 1329 |
-
$file_size = new Math_BigInteger( 0 );
|
| 1330 |
-
|
| 1331 |
-
try {
|
| 1332 |
-
$file_handle = ai1wm_open( $file_path, 'rb' );
|
| 1333 |
-
|
| 1334 |
-
while ( ! feof( $file_handle ) ) {
|
| 1335 |
-
$bytes = ai1wm_read( $file_handle, $chunk_size );
|
| 1336 |
-
$file_size = $file_size->add( new Math_BigInteger( strlen( $bytes ) ) );
|
| 1337 |
-
}
|
| 1338 |
-
|
| 1339 |
-
ai1wm_close( $file_handle );
|
| 1340 |
-
|
| 1341 |
-
return $as_string ? $file_size->toString() : $file_size;
|
| 1342 |
-
} catch ( Exception $e ) {
|
| 1343 |
-
return null;
|
| 1344 |
-
}
|
| 1345 |
-
}
|
| 1346 |
-
|
| 1347 |
-
/**
|
| 1348 |
-
* Return the smaller of two numbers
|
| 1349 |
-
*
|
| 1350 |
-
* @param Math_BigInteger $a First number
|
| 1351 |
-
* @param Math_BigInteger $b Second number
|
| 1352 |
-
*
|
| 1353 |
-
* @return Math_BigInteger
|
| 1354 |
-
*/
|
| 1355 |
-
function ai1wm_find_smaller_number( Math_BigInteger $a, Math_BigInteger $b ) {
|
| 1356 |
-
if ( $a->compare( $b ) === -1 ) {
|
| 1357 |
-
return $a;
|
| 1358 |
-
}
|
| 1359 |
-
|
| 1360 |
-
return $b;
|
| 1361 |
-
}
|
| 1362 |
-
|
| 1363 |
/**
|
| 1364 |
* Check whether file size is supported by current PHP version
|
| 1365 |
*
|
|
@@ -1386,23 +1340,6 @@ function ai1wm_is_filesize_supported( $file, $php_int_size = PHP_INT_SIZE, $php_
|
|
| 1386 |
return $size_result;
|
| 1387 |
}
|
| 1388 |
|
| 1389 |
-
/**
|
| 1390 |
-
* Wrapper around fseek
|
| 1391 |
-
*
|
| 1392 |
-
* This function works with offsets that are > PHP_INT_MAX
|
| 1393 |
-
*
|
| 1394 |
-
* @param resource $file_handle Handle to the file
|
| 1395 |
-
* @param Math_BigInteger $offset Offset of the file
|
| 1396 |
-
*/
|
| 1397 |
-
function ai1wm_fseek( $file_handle, Math_BigInteger $offset ) {
|
| 1398 |
-
$chunk_size = ai1wm_find_smaller_number( new Math_BigInteger( 2000000 ), $offset );
|
| 1399 |
-
while ( ! feof( $file_handle ) && $offset->toString() != '0' ) {
|
| 1400 |
-
$bytes = ai1wm_read( $file_handle, $chunk_size->toInteger() );
|
| 1401 |
-
$offset = $offset->subtract( new Math_BigInteger( strlen( $bytes ) ) );
|
| 1402 |
-
$chunk_size = ai1wm_find_smaller_number( $chunk_size, $offset );
|
| 1403 |
-
}
|
| 1404 |
-
}
|
| 1405 |
-
|
| 1406 |
/**
|
| 1407 |
* Verify secret key
|
| 1408 |
*
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1314 |
ai1wm_close( $destination_handle );
|
| 1315 |
}
|
| 1316 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1317 |
/**
|
| 1318 |
* Check whether file size is supported by current PHP version
|
| 1319 |
*
|
| 1340 |
return $size_result;
|
| 1341 |
}
|
| 1342 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1343 |
/**
|
| 1344 |
* Verify secret key
|
| 1345 |
*
|
lib/controller/class-ai1wm-backups-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/controller/class-ai1wm-export-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/controller/class-ai1wm-feedback-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/controller/class-ai1wm-import-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/controller/class-ai1wm-main-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/controller/class-ai1wm-report-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/controller/class-ai1wm-status-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/controller/class-ai1wm-updater-controller.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-backups.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-compatibility.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-deprecated.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-extensions.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-feedback.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-handler.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-log.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-message.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-notification.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-report.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-status.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-template.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/class-ai1wm-updater.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-archive.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-clean.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-compatibility.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-config-file.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-config.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-content.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-database-file.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-database.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-download.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -49,6 +49,7 @@ class Ai1wm_Export_Download {
|
|
| 49 |
}
|
| 50 |
|
| 51 |
// Set archive details
|
|
|
|
| 52 |
$link = ai1wm_backup_url( $params );
|
| 53 |
$size = ai1wm_backup_size( $params );
|
| 54 |
$name = ai1wm_site_name( $blog_id );
|
|
@@ -57,7 +58,7 @@ class Ai1wm_Export_Download {
|
|
| 57 |
Ai1wm_Status::download(
|
| 58 |
sprintf(
|
| 59 |
__(
|
| 60 |
-
'<a href="%s" class="ai1wm-button-green ai1wm-emphasize" title="%s">' .
|
| 61 |
'<span>Download %s</span>' .
|
| 62 |
'<em>Size: %s</em>' .
|
| 63 |
'</a>',
|
|
@@ -65,7 +66,8 @@ class Ai1wm_Export_Download {
|
|
| 65 |
),
|
| 66 |
$link,
|
| 67 |
$name,
|
| 68 |
-
|
|
|
|
| 69 |
$size
|
| 70 |
)
|
| 71 |
);
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 49 |
}
|
| 50 |
|
| 51 |
// Set archive details
|
| 52 |
+
$file = ai1wm_archive_name( $params );
|
| 53 |
$link = ai1wm_backup_url( $params );
|
| 54 |
$size = ai1wm_backup_size( $params );
|
| 55 |
$name = ai1wm_site_name( $blog_id );
|
| 58 |
Ai1wm_Status::download(
|
| 59 |
sprintf(
|
| 60 |
__(
|
| 61 |
+
'<a href="%s" class="ai1wm-button-green ai1wm-emphasize ai1wm-button-download" title="%s" download="%s">' .
|
| 62 |
'<span>Download %s</span>' .
|
| 63 |
'<em>Size: %s</em>' .
|
| 64 |
'</a>',
|
| 66 |
),
|
| 67 |
$link,
|
| 68 |
$name,
|
| 69 |
+
$file,
|
| 70 |
+
$name,
|
| 71 |
$size
|
| 72 |
)
|
| 73 |
);
|
lib/model/export/class-ai1wm-export-enumerate.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/export/class-ai1wm-export-init.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-blogs.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-clean.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-compatibility.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-confirm.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-content.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-database.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-done.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -67,6 +67,7 @@ class Ai1wm_Import_Done {
|
|
| 67 |
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
| 68 |
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
| 69 |
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
|
|
|
| 70 |
) );
|
| 71 |
|
| 72 |
// Deactivate Jetpack modules
|
|
@@ -128,6 +129,7 @@ class Ai1wm_Import_Done {
|
|
| 128 |
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
| 129 |
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
| 130 |
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
|
|
|
| 131 |
) );
|
| 132 |
|
| 133 |
// Deactivate Jetpack modules
|
|
@@ -191,6 +193,7 @@ class Ai1wm_Import_Done {
|
|
| 191 |
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
| 192 |
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
| 193 |
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
|
|
|
| 194 |
) );
|
| 195 |
|
| 196 |
// Deactivate Jetpack modules
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 67 |
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
| 68 |
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
| 69 |
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
| 70 |
+
ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
|
| 71 |
) );
|
| 72 |
|
| 73 |
// Deactivate Jetpack modules
|
| 129 |
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
| 130 |
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
| 131 |
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
| 132 |
+
ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
|
| 133 |
) );
|
| 134 |
|
| 135 |
// Deactivate Jetpack modules
|
| 193 |
ai1wm_discover_plugin_basename( 'join-my-multisite/joinmymultisite.php' ),
|
| 194 |
ai1wm_discover_plugin_basename( 'multisite-clone-duplicator/multisite-clone-duplicator.php' ),
|
| 195 |
ai1wm_discover_plugin_basename( 'wordpress-mu-domain-mapping/domain_mapping.php' ),
|
| 196 |
+
ai1wm_discover_plugin_basename( 'pro-sites/pro-sites.php' ),
|
| 197 |
) );
|
| 198 |
|
| 199 |
// Deactivate Jetpack modules
|
lib/model/import/class-ai1wm-import-enumerate.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-mu-plugins.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -35,6 +35,7 @@ class Ai1wm_Import_Mu_Plugins {
|
|
| 35 |
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_ENDURANCE_PHP_EDGE_NAME,
|
| 36 |
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_ENDURANCE_BROWSER_CACHE_NAME,
|
| 37 |
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_GD_SYSTEM_PLUGIN_NAME,
|
|
|
|
| 38 |
);
|
| 39 |
|
| 40 |
// Open the archive file for reading
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 35 |
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_ENDURANCE_PHP_EDGE_NAME,
|
| 36 |
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_ENDURANCE_BROWSER_CACHE_NAME,
|
| 37 |
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_GD_SYSTEM_PLUGIN_NAME,
|
| 38 |
+
AI1WM_MUPLUGINS_NAME . DIRECTORY_SEPARATOR . AI1WM_WP_STACK_CACHE_NAME,
|
| 39 |
);
|
| 40 |
|
| 41 |
// Open the archive file for reading
|
lib/model/import/class-ai1wm-import-upload.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/model/import/class-ai1wm-import-validate.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/math/BigInteger.php
DELETED
|
@@ -1,3811 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
if ( ! class_exists( 'Math_BigInteger' ) ) {
|
| 4 |
-
/**
|
| 5 |
-
* Pure-PHP arbitrary precision integer arithmetic library.
|
| 6 |
-
*
|
| 7 |
-
* Supports base-2, base-10, base-16, and base-256 numbers. Uses the GMP or BCMath extensions, if available,
|
| 8 |
-
* and an internal implementation, otherwise.
|
| 9 |
-
*
|
| 10 |
-
* PHP versions 4 and 5
|
| 11 |
-
*
|
| 12 |
-
* {@internal (all DocBlock comments regarding implementation - such as the one that follows - refer to the
|
| 13 |
-
* {@link MATH_BIGINTEGER_MODE_INTERNAL MATH_BIGINTEGER_MODE_INTERNAL} mode)
|
| 14 |
-
*
|
| 15 |
-
* Math_BigInteger uses base-2**26 to perform operations such as multiplication and division and
|
| 16 |
-
* base-2**52 (ie. two base 2**26 digits) to perform addition and subtraction. Because the largest possible
|
| 17 |
-
* value when multiplying two base-2**26 numbers together is a base-2**52 number, double precision floating
|
| 18 |
-
* point numbers - numbers that should be supported on most hardware and whose significand is 53 bits - are
|
| 19 |
-
* used. As a consequence, bitwise operators such as >> and << cannot be used, nor can the modulo operator %,
|
| 20 |
-
* which only supports integers. Although this fact will slow this library down, the fact that such a high
|
| 21 |
-
* base is being used should more than compensate.
|
| 22 |
-
*
|
| 23 |
-
* Numbers are stored in {@link http://en.wikipedia.org/wiki/Endianness little endian} format. ie.
|
| 24 |
-
* (new Math_BigInteger(pow(2, 26)))->value = array(0, 1)
|
| 25 |
-
*
|
| 26 |
-
* Useful resources are as follows:
|
| 27 |
-
*
|
| 28 |
-
* - {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf Handbook of Applied Cryptography (HAC)}
|
| 29 |
-
* - {@link http://math.libtomcrypt.com/files/tommath.pdf Multi-Precision Math (MPM)}
|
| 30 |
-
* - Java's BigInteger classes. See /j2se/src/share/classes/java/math in jdk-1_5_0-src-jrl.zip
|
| 31 |
-
*
|
| 32 |
-
* Here's an example of how to use this library:
|
| 33 |
-
* <code>
|
| 34 |
-
* <?php
|
| 35 |
-
* include 'Math/BigInteger.php';
|
| 36 |
-
*
|
| 37 |
-
* $a = new Math_BigInteger(2);
|
| 38 |
-
* $b = new Math_BigInteger(3);
|
| 39 |
-
*
|
| 40 |
-
* $c = $a->add($b);
|
| 41 |
-
*
|
| 42 |
-
* echo $c->toString(); // outputs 5
|
| 43 |
-
* ?>
|
| 44 |
-
* </code>
|
| 45 |
-
*
|
| 46 |
-
* LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 47 |
-
* of this software and associated documentation files (the "Software"), to deal
|
| 48 |
-
* in the Software without restriction, including without limitation the rights
|
| 49 |
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 50 |
-
* copies of the Software, and to permit persons to whom the Software is
|
| 51 |
-
* furnished to do so, subject to the following conditions:
|
| 52 |
-
*
|
| 53 |
-
* The above copyright notice and this permission notice shall be included in
|
| 54 |
-
* all copies or substantial portions of the Software.
|
| 55 |
-
*
|
| 56 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 57 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 58 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 59 |
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 60 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 61 |
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 62 |
-
* THE SOFTWARE.
|
| 63 |
-
*
|
| 64 |
-
* @category Math
|
| 65 |
-
* @package Math_BigInteger
|
| 66 |
-
* @author Jim Wigginton <terrafrost@php.net>
|
| 67 |
-
* @copyright 2006 Jim Wigginton
|
| 68 |
-
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
| 69 |
-
* @link http://pear.php.net/package/Math_BigInteger
|
| 70 |
-
*/
|
| 71 |
-
|
| 72 |
-
/**#@+
|
| 73 |
-
* Reduction constants
|
| 74 |
-
*
|
| 75 |
-
* @access private
|
| 76 |
-
* @see self::_reduce()
|
| 77 |
-
*/
|
| 78 |
-
/**
|
| 79 |
-
* @see self::_montgomery()
|
| 80 |
-
* @see self::_prepMontgomery()
|
| 81 |
-
*/
|
| 82 |
-
define('MATH_BIGINTEGER_MONTGOMERY', 0);
|
| 83 |
-
/**
|
| 84 |
-
* @see self::_barrett()
|
| 85 |
-
*/
|
| 86 |
-
define('MATH_BIGINTEGER_BARRETT', 1);
|
| 87 |
-
/**
|
| 88 |
-
* @see self::_mod2()
|
| 89 |
-
*/
|
| 90 |
-
define('MATH_BIGINTEGER_POWEROF2', 2);
|
| 91 |
-
/**
|
| 92 |
-
* @see self::_remainder()
|
| 93 |
-
*/
|
| 94 |
-
define('MATH_BIGINTEGER_CLASSIC', 3);
|
| 95 |
-
/**
|
| 96 |
-
* @see self::__clone()
|
| 97 |
-
*/
|
| 98 |
-
define('MATH_BIGINTEGER_NONE', 4);
|
| 99 |
-
/**#@-*/
|
| 100 |
-
|
| 101 |
-
/**#@+
|
| 102 |
-
* Array constants
|
| 103 |
-
*
|
| 104 |
-
* Rather than create a thousands and thousands of new Math_BigInteger objects in repeated function calls to add() and
|
| 105 |
-
* multiply() or whatever, we'll just work directly on arrays, taking them in as parameters and returning them.
|
| 106 |
-
*
|
| 107 |
-
* @access private
|
| 108 |
-
*/
|
| 109 |
-
/**
|
| 110 |
-
* $result[MATH_BIGINTEGER_VALUE] contains the value.
|
| 111 |
-
*/
|
| 112 |
-
define('MATH_BIGINTEGER_VALUE', 0);
|
| 113 |
-
/**
|
| 114 |
-
* $result[MATH_BIGINTEGER_SIGN] contains the sign.
|
| 115 |
-
*/
|
| 116 |
-
define('MATH_BIGINTEGER_SIGN', 1);
|
| 117 |
-
/**#@-*/
|
| 118 |
-
|
| 119 |
-
/**#@+
|
| 120 |
-
* @access private
|
| 121 |
-
* @see self::_montgomery()
|
| 122 |
-
* @see self::_barrett()
|
| 123 |
-
*/
|
| 124 |
-
/**
|
| 125 |
-
* Cache constants
|
| 126 |
-
*
|
| 127 |
-
* $cache[MATH_BIGINTEGER_VARIABLE] tells us whether or not the cached data is still valid.
|
| 128 |
-
*/
|
| 129 |
-
define('MATH_BIGINTEGER_VARIABLE', 0);
|
| 130 |
-
/**
|
| 131 |
-
* $cache[MATH_BIGINTEGER_DATA] contains the cached data.
|
| 132 |
-
*/
|
| 133 |
-
define('MATH_BIGINTEGER_DATA', 1);
|
| 134 |
-
/**#@-*/
|
| 135 |
-
|
| 136 |
-
/**#@+
|
| 137 |
-
* Mode constants.
|
| 138 |
-
*
|
| 139 |
-
* @access private
|
| 140 |
-
* @see self::Math_BigInteger()
|
| 141 |
-
*/
|
| 142 |
-
/**
|
| 143 |
-
* To use the pure-PHP implementation
|
| 144 |
-
*/
|
| 145 |
-
define('MATH_BIGINTEGER_MODE_INTERNAL', 1);
|
| 146 |
-
/**
|
| 147 |
-
* To use the BCMath library
|
| 148 |
-
*
|
| 149 |
-
* (if enabled; otherwise, the internal implementation will be used)
|
| 150 |
-
*/
|
| 151 |
-
define('MATH_BIGINTEGER_MODE_BCMATH', 2);
|
| 152 |
-
/**
|
| 153 |
-
* To use the GMP library
|
| 154 |
-
*
|
| 155 |
-
* (if present; otherwise, either the BCMath or the internal implementation will be used)
|
| 156 |
-
*/
|
| 157 |
-
define('MATH_BIGINTEGER_MODE_GMP', 3);
|
| 158 |
-
/**#@-*/
|
| 159 |
-
|
| 160 |
-
/**
|
| 161 |
-
* Karatsuba Cutoff
|
| 162 |
-
*
|
| 163 |
-
* At what point do we switch between Karatsuba multiplication and schoolbook long multiplication?
|
| 164 |
-
*
|
| 165 |
-
* @access private
|
| 166 |
-
*/
|
| 167 |
-
define('MATH_BIGINTEGER_KARATSUBA_CUTOFF', 25);
|
| 168 |
-
|
| 169 |
-
/**
|
| 170 |
-
* Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256
|
| 171 |
-
* numbers.
|
| 172 |
-
*
|
| 173 |
-
* @package Math_BigInteger
|
| 174 |
-
* @author Jim Wigginton <terrafrost@php.net>
|
| 175 |
-
* @access public
|
| 176 |
-
*/
|
| 177 |
-
class Math_BigInteger
|
| 178 |
-
{
|
| 179 |
-
/**
|
| 180 |
-
* Holds the BigInteger's value.
|
| 181 |
-
*
|
| 182 |
-
* @var array
|
| 183 |
-
* @access private
|
| 184 |
-
*/
|
| 185 |
-
var $value;
|
| 186 |
-
|
| 187 |
-
/**
|
| 188 |
-
* Holds the BigInteger's magnitude.
|
| 189 |
-
*
|
| 190 |
-
* @var bool
|
| 191 |
-
* @access private
|
| 192 |
-
*/
|
| 193 |
-
var $is_negative = false;
|
| 194 |
-
|
| 195 |
-
/**
|
| 196 |
-
* Precision
|
| 197 |
-
*
|
| 198 |
-
* @see self::setPrecision()
|
| 199 |
-
* @access private
|
| 200 |
-
*/
|
| 201 |
-
var $precision = -1;
|
| 202 |
-
|
| 203 |
-
/**
|
| 204 |
-
* Precision Bitmask
|
| 205 |
-
*
|
| 206 |
-
* @see self::setPrecision()
|
| 207 |
-
* @access private
|
| 208 |
-
*/
|
| 209 |
-
var $bitmask = false;
|
| 210 |
-
|
| 211 |
-
/**
|
| 212 |
-
* Mode independent value used for serialization.
|
| 213 |
-
*
|
| 214 |
-
* If the bcmath or gmp extensions are installed $this->value will be a non-serializable resource, hence the need for
|
| 215 |
-
* a variable that'll be serializable regardless of whether or not extensions are being used. Unlike $this->value,
|
| 216 |
-
* however, $this->hex is only calculated when $this->__sleep() is called.
|
| 217 |
-
*
|
| 218 |
-
* @see self::__sleep()
|
| 219 |
-
* @see self::__wakeup()
|
| 220 |
-
* @var string
|
| 221 |
-
* @access private
|
| 222 |
-
*/
|
| 223 |
-
var $hex;
|
| 224 |
-
|
| 225 |
-
/**
|
| 226 |
-
* Converts base-2, base-10, base-16, and binary strings (base-256) to BigIntegers.
|
| 227 |
-
*
|
| 228 |
-
* If the second parameter - $base - is negative, then it will be assumed that the number's are encoded using
|
| 229 |
-
* two's compliment. The sole exception to this is -10, which is treated the same as 10 is.
|
| 230 |
-
*
|
| 231 |
-
* Here's an example:
|
| 232 |
-
* <code>
|
| 233 |
-
* <?php
|
| 234 |
-
* include 'Math/BigInteger.php';
|
| 235 |
-
*
|
| 236 |
-
* $a = new Math_BigInteger('0x32', 16); // 50 in base-16
|
| 237 |
-
*
|
| 238 |
-
* echo $a->toString(); // outputs 50
|
| 239 |
-
* ?>
|
| 240 |
-
* </code>
|
| 241 |
-
*
|
| 242 |
-
* @param $x base-10 number or base-$base number if $base set.
|
| 243 |
-
* @param int $base
|
| 244 |
-
* @return Math_BigInteger
|
| 245 |
-
* @access public
|
| 246 |
-
*/
|
| 247 |
-
function __construct($x = 0, $base = 10)
|
| 248 |
-
{
|
| 249 |
-
if (!defined('MATH_BIGINTEGER_MODE')) {
|
| 250 |
-
switch (true) {
|
| 251 |
-
case extension_loaded('gmp'):
|
| 252 |
-
define('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_GMP);
|
| 253 |
-
break;
|
| 254 |
-
case extension_loaded('bcmath'):
|
| 255 |
-
define('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_BCMATH);
|
| 256 |
-
break;
|
| 257 |
-
default:
|
| 258 |
-
define('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_INTERNAL);
|
| 259 |
-
}
|
| 260 |
-
}
|
| 261 |
-
|
| 262 |
-
if (extension_loaded('openssl') && !defined('MATH_BIGINTEGER_OPENSSL_DISABLE') && !defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
|
| 263 |
-
// some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
|
| 264 |
-
ob_start();
|
| 265 |
-
@phpinfo();
|
| 266 |
-
$content = ob_get_contents();
|
| 267 |
-
ob_end_clean();
|
| 268 |
-
|
| 269 |
-
preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
|
| 270 |
-
|
| 271 |
-
$versions = array();
|
| 272 |
-
if (!empty($matches[1])) {
|
| 273 |
-
for ($i = 0; $i < count($matches[1]); $i++) {
|
| 274 |
-
$fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
|
| 275 |
-
|
| 276 |
-
// Remove letter part in OpenSSL version
|
| 277 |
-
if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
|
| 278 |
-
$versions[$matches[1][$i]] = $fullVersion;
|
| 279 |
-
} else {
|
| 280 |
-
$versions[$matches[1][$i]] = $m[0];
|
| 281 |
-
}
|
| 282 |
-
}
|
| 283 |
-
}
|
| 284 |
-
|
| 285 |
-
// it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
|
| 286 |
-
switch (true) {
|
| 287 |
-
case !isset($versions['Header']):
|
| 288 |
-
case !isset($versions['Library']):
|
| 289 |
-
case $versions['Header'] == $versions['Library']:
|
| 290 |
-
case version_compare($versions['Header'], '1.0.0') >= 0 && version_compare($versions['Library'], '1.0.0') >= 0:
|
| 291 |
-
define('MATH_BIGINTEGER_OPENSSL_ENABLED', true);
|
| 292 |
-
break;
|
| 293 |
-
default:
|
| 294 |
-
define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);
|
| 295 |
-
}
|
| 296 |
-
}
|
| 297 |
-
|
| 298 |
-
if (!defined('PHP_INT_SIZE')) {
|
| 299 |
-
define('PHP_INT_SIZE', 4);
|
| 300 |
-
}
|
| 301 |
-
|
| 302 |
-
if (!defined('MATH_BIGINTEGER_BASE') && MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_INTERNAL) {
|
| 303 |
-
switch (PHP_INT_SIZE) {
|
| 304 |
-
case 8: // use 64-bit integers if int size is 8 bytes
|
| 305 |
-
define('MATH_BIGINTEGER_BASE', 31);
|
| 306 |
-
define('MATH_BIGINTEGER_BASE_FULL', 0x80000000);
|
| 307 |
-
define('MATH_BIGINTEGER_MAX_DIGIT', 0x7FFFFFFF);
|
| 308 |
-
define('MATH_BIGINTEGER_MSB', 0x40000000);
|
| 309 |
-
// 10**9 is the closest we can get to 2**31 without passing it
|
| 310 |
-
define('MATH_BIGINTEGER_MAX10', 1000000000);
|
| 311 |
-
define('MATH_BIGINTEGER_MAX10_LEN', 9);
|
| 312 |
-
// the largest digit that may be used in addition / subtraction
|
| 313 |
-
define('MATH_BIGINTEGER_MAX_DIGIT2', pow(2, 62));
|
| 314 |
-
break;
|
| 315 |
-
//case 4: // use 64-bit floats if int size is 4 bytes
|
| 316 |
-
default:
|
| 317 |
-
define('MATH_BIGINTEGER_BASE', 26);
|
| 318 |
-
define('MATH_BIGINTEGER_BASE_FULL', 0x4000000);
|
| 319 |
-
define('MATH_BIGINTEGER_MAX_DIGIT', 0x3FFFFFF);
|
| 320 |
-
define('MATH_BIGINTEGER_MSB', 0x2000000);
|
| 321 |
-
// 10**7 is the closest to 2**26 without passing it
|
| 322 |
-
define('MATH_BIGINTEGER_MAX10', 10000000);
|
| 323 |
-
define('MATH_BIGINTEGER_MAX10_LEN', 7);
|
| 324 |
-
// the largest digit that may be used in addition / subtraction
|
| 325 |
-
// we do pow(2, 52) instead of using 4503599627370496 directly because some
|
| 326 |
-
// PHP installations will truncate 4503599627370496.
|
| 327 |
-
define('MATH_BIGINTEGER_MAX_DIGIT2', pow(2, 52));
|
| 328 |
-
}
|
| 329 |
-
}
|
| 330 |
-
|
| 331 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 332 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 333 |
-
switch (true) {
|
| 334 |
-
case is_resource($x) && get_resource_type($x) == 'GMP integer':
|
| 335 |
-
// PHP 5.6 switched GMP from using resources to objects
|
| 336 |
-
case is_object($x) && get_class($x) == 'GMP':
|
| 337 |
-
$this->value = $x;
|
| 338 |
-
return;
|
| 339 |
-
}
|
| 340 |
-
$this->value = gmp_init(0);
|
| 341 |
-
break;
|
| 342 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 343 |
-
$this->value = '0';
|
| 344 |
-
break;
|
| 345 |
-
default:
|
| 346 |
-
$this->value = array();
|
| 347 |
-
}
|
| 348 |
-
|
| 349 |
-
// '0' counts as empty() but when the base is 256 '0' is equal to ord('0') or 48
|
| 350 |
-
// '0' is the only value like this per http://php.net/empty
|
| 351 |
-
if (empty($x) && (abs($base) != 256 || $x !== '0')) {
|
| 352 |
-
return;
|
| 353 |
-
}
|
| 354 |
-
|
| 355 |
-
switch ($base) {
|
| 356 |
-
case -256:
|
| 357 |
-
if (ord($x[0]) & 0x80) {
|
| 358 |
-
$x = ~$x;
|
| 359 |
-
$this->is_negative = true;
|
| 360 |
-
}
|
| 361 |
-
case 256:
|
| 362 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 363 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 364 |
-
$sign = $this->is_negative ? '-' : '';
|
| 365 |
-
$this->value = gmp_init($sign . '0x' . bin2hex($x));
|
| 366 |
-
break;
|
| 367 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 368 |
-
// round $len to the nearest 4 (thanks, DavidMJ!)
|
| 369 |
-
$len = (strlen($x) + 3) & 0xFFFFFFFC;
|
| 370 |
-
|
| 371 |
-
$x = str_pad($x, $len, chr(0), STR_PAD_LEFT);
|
| 372 |
-
|
| 373 |
-
for ($i = 0; $i < $len; $i+= 4) {
|
| 374 |
-
$this->value = bcmul($this->value, '4294967296', 0); // 4294967296 == 2**32
|
| 375 |
-
$this->value = bcadd($this->value, 0x1000000 * ord($x[$i]) + ((ord($x[$i + 1]) << 16) | (ord($x[$i + 2]) << 8) | ord($x[$i + 3])), 0);
|
| 376 |
-
}
|
| 377 |
-
|
| 378 |
-
if ($this->is_negative) {
|
| 379 |
-
$this->value = '-' . $this->value;
|
| 380 |
-
}
|
| 381 |
-
|
| 382 |
-
break;
|
| 383 |
-
// converts a base-2**8 (big endian / msb) number to base-2**26 (little endian / lsb)
|
| 384 |
-
default:
|
| 385 |
-
while (strlen($x)) {
|
| 386 |
-
$this->value[] = $this->_bytes2int($this->_base256_rshift($x, MATH_BIGINTEGER_BASE));
|
| 387 |
-
}
|
| 388 |
-
}
|
| 389 |
-
|
| 390 |
-
if ($this->is_negative) {
|
| 391 |
-
if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_INTERNAL) {
|
| 392 |
-
$this->is_negative = false;
|
| 393 |
-
}
|
| 394 |
-
$temp = $this->add(new Math_BigInteger('-1'));
|
| 395 |
-
$this->value = $temp->value;
|
| 396 |
-
}
|
| 397 |
-
break;
|
| 398 |
-
case 16:
|
| 399 |
-
case -16:
|
| 400 |
-
if ($base > 0 && $x[0] == '-') {
|
| 401 |
-
$this->is_negative = true;
|
| 402 |
-
$x = substr($x, 1);
|
| 403 |
-
}
|
| 404 |
-
|
| 405 |
-
$x = preg_replace('#^(?:0x)?([A-Fa-f0-9]*).*#', '$1', $x);
|
| 406 |
-
|
| 407 |
-
$is_negative = false;
|
| 408 |
-
if ($base < 0 && hexdec($x[0]) >= 8) {
|
| 409 |
-
$this->is_negative = $is_negative = true;
|
| 410 |
-
$x = bin2hex(~pack('H*', $x));
|
| 411 |
-
}
|
| 412 |
-
|
| 413 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 414 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 415 |
-
$temp = $this->is_negative ? '-0x' . $x : '0x' . $x;
|
| 416 |
-
$this->value = gmp_init($temp);
|
| 417 |
-
$this->is_negative = false;
|
| 418 |
-
break;
|
| 419 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 420 |
-
$x = (strlen($x) & 1) ? '0' . $x : $x;
|
| 421 |
-
$temp = new Math_BigInteger(pack('H*', $x), 256);
|
| 422 |
-
$this->value = $this->is_negative ? '-' . $temp->value : $temp->value;
|
| 423 |
-
$this->is_negative = false;
|
| 424 |
-
break;
|
| 425 |
-
default:
|
| 426 |
-
$x = (strlen($x) & 1) ? '0' . $x : $x;
|
| 427 |
-
$temp = new Math_BigInteger(pack('H*', $x), 256);
|
| 428 |
-
$this->value = $temp->value;
|
| 429 |
-
}
|
| 430 |
-
|
| 431 |
-
if ($is_negative) {
|
| 432 |
-
$temp = $this->add(new Math_BigInteger('-1'));
|
| 433 |
-
$this->value = $temp->value;
|
| 434 |
-
}
|
| 435 |
-
break;
|
| 436 |
-
case 10:
|
| 437 |
-
case -10:
|
| 438 |
-
// (?<!^)(?:-).*: find any -'s that aren't at the beginning and then any characters that follow that
|
| 439 |
-
// (?<=^|-)0*: find any 0's that are preceded by the start of the string or by a - (ie. octals)
|
| 440 |
-
// [^-0-9].*: find any non-numeric characters and then any characters that follow that
|
| 441 |
-
$x = preg_replace('#(?<!^)(?:-).*|(?<=^|-)0*|[^-0-9].*#', '', $x);
|
| 442 |
-
|
| 443 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 444 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 445 |
-
$this->value = gmp_init($x);
|
| 446 |
-
break;
|
| 447 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 448 |
-
// explicitly casting $x to a string is necessary, here, since doing $x[0] on -1 yields different
|
| 449 |
-
// results then doing it on '-1' does (modInverse does $x[0])
|
| 450 |
-
$this->value = $x === '-' ? '0' : (string) $x;
|
| 451 |
-
break;
|
| 452 |
-
default:
|
| 453 |
-
$temp = new Math_BigInteger();
|
| 454 |
-
|
| 455 |
-
$multiplier = new Math_BigInteger();
|
| 456 |
-
$multiplier->value = array(MATH_BIGINTEGER_MAX10);
|
| 457 |
-
|
| 458 |
-
if ($x[0] == '-') {
|
| 459 |
-
$this->is_negative = true;
|
| 460 |
-
$x = substr($x, 1);
|
| 461 |
-
}
|
| 462 |
-
|
| 463 |
-
$x = str_pad($x, strlen($x) + ((MATH_BIGINTEGER_MAX10_LEN - 1) * strlen($x)) % MATH_BIGINTEGER_MAX10_LEN, 0, STR_PAD_LEFT);
|
| 464 |
-
while (strlen($x)) {
|
| 465 |
-
$temp = $temp->multiply($multiplier);
|
| 466 |
-
$temp = $temp->add(new Math_BigInteger($this->_int2bytes(substr($x, 0, MATH_BIGINTEGER_MAX10_LEN)), 256));
|
| 467 |
-
$x = substr($x, MATH_BIGINTEGER_MAX10_LEN);
|
| 468 |
-
}
|
| 469 |
-
|
| 470 |
-
$this->value = $temp->value;
|
| 471 |
-
}
|
| 472 |
-
break;
|
| 473 |
-
case 2: // base-2 support originally implemented by Lluis Pamies - thanks!
|
| 474 |
-
case -2:
|
| 475 |
-
if ($base > 0 && $x[0] == '-') {
|
| 476 |
-
$this->is_negative = true;
|
| 477 |
-
$x = substr($x, 1);
|
| 478 |
-
}
|
| 479 |
-
|
| 480 |
-
$x = preg_replace('#^([01]*).*#', '$1', $x);
|
| 481 |
-
$x = str_pad($x, strlen($x) + (3 * strlen($x)) % 4, 0, STR_PAD_LEFT);
|
| 482 |
-
|
| 483 |
-
$str = '0x';
|
| 484 |
-
while (strlen($x)) {
|
| 485 |
-
$part = substr($x, 0, 4);
|
| 486 |
-
$str.= dechex(bindec($part));
|
| 487 |
-
$x = substr($x, 4);
|
| 488 |
-
}
|
| 489 |
-
|
| 490 |
-
if ($this->is_negative) {
|
| 491 |
-
$str = '-' . $str;
|
| 492 |
-
}
|
| 493 |
-
|
| 494 |
-
$temp = new Math_BigInteger($str, 8 * $base); // ie. either -16 or +16
|
| 495 |
-
$this->value = $temp->value;
|
| 496 |
-
$this->is_negative = $temp->is_negative;
|
| 497 |
-
|
| 498 |
-
break;
|
| 499 |
-
default:
|
| 500 |
-
// base not supported, so we'll let $this == 0
|
| 501 |
-
}
|
| 502 |
-
}
|
| 503 |
-
|
| 504 |
-
/**
|
| 505 |
-
* PHP4 compatible Default Constructor.
|
| 506 |
-
*
|
| 507 |
-
* @see self::__construct()
|
| 508 |
-
* @param $x base-10 number or base-$base number if $base set.
|
| 509 |
-
* @param int $base
|
| 510 |
-
* @access public
|
| 511 |
-
*/
|
| 512 |
-
function Math_BigInteger($x = 0, $base = 10)
|
| 513 |
-
{
|
| 514 |
-
$this->__construct($x, $base);
|
| 515 |
-
}
|
| 516 |
-
|
| 517 |
-
/**
|
| 518 |
-
* Converts a BigInteger to a byte string (eg. base-256).
|
| 519 |
-
*
|
| 520 |
-
* Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're
|
| 521 |
-
* saved as two's compliment.
|
| 522 |
-
*
|
| 523 |
-
* Here's an example:
|
| 524 |
-
* <code>
|
| 525 |
-
* <?php
|
| 526 |
-
* include 'Math/BigInteger.php';
|
| 527 |
-
*
|
| 528 |
-
* $a = new Math_BigInteger('65');
|
| 529 |
-
*
|
| 530 |
-
* echo $a->toBytes(); // outputs chr(65)
|
| 531 |
-
* ?>
|
| 532 |
-
* </code>
|
| 533 |
-
*
|
| 534 |
-
* @param bool $twos_compliment
|
| 535 |
-
* @return string
|
| 536 |
-
* @access public
|
| 537 |
-
* @internal Converts a base-2**26 number to base-2**8
|
| 538 |
-
*/
|
| 539 |
-
function toBytes($twos_compliment = false)
|
| 540 |
-
{
|
| 541 |
-
if ($twos_compliment) {
|
| 542 |
-
$comparison = $this->compare(new Math_BigInteger());
|
| 543 |
-
if ($comparison == 0) {
|
| 544 |
-
return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : '';
|
| 545 |
-
}
|
| 546 |
-
|
| 547 |
-
$temp = $comparison < 0 ? $this->add(new Math_BigInteger(1)) : $this->copy();
|
| 548 |
-
$bytes = $temp->toBytes();
|
| 549 |
-
|
| 550 |
-
if (empty($bytes)) { // eg. if the number we're trying to convert is -1
|
| 551 |
-
$bytes = chr(0);
|
| 552 |
-
}
|
| 553 |
-
|
| 554 |
-
if (ord($bytes[0]) & 0x80) {
|
| 555 |
-
$bytes = chr(0) . $bytes;
|
| 556 |
-
}
|
| 557 |
-
|
| 558 |
-
return $comparison < 0 ? ~$bytes : $bytes;
|
| 559 |
-
}
|
| 560 |
-
|
| 561 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 562 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 563 |
-
if (gmp_cmp($this->value, gmp_init(0)) == 0) {
|
| 564 |
-
return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : '';
|
| 565 |
-
}
|
| 566 |
-
|
| 567 |
-
$temp = gmp_strval(gmp_abs($this->value), 16);
|
| 568 |
-
$temp = (strlen($temp) & 1) ? '0' . $temp : $temp;
|
| 569 |
-
$temp = pack('H*', $temp);
|
| 570 |
-
|
| 571 |
-
return $this->precision > 0 ?
|
| 572 |
-
substr(str_pad($temp, $this->precision >> 3, chr(0), STR_PAD_LEFT), -($this->precision >> 3)) :
|
| 573 |
-
ltrim($temp, chr(0));
|
| 574 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 575 |
-
if ($this->value === '0') {
|
| 576 |
-
return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : '';
|
| 577 |
-
}
|
| 578 |
-
|
| 579 |
-
$value = '';
|
| 580 |
-
$current = $this->value;
|
| 581 |
-
|
| 582 |
-
if ($current[0] == '-') {
|
| 583 |
-
$current = substr($current, 1);
|
| 584 |
-
}
|
| 585 |
-
|
| 586 |
-
while (bccomp($current, '0', 0) > 0) {
|
| 587 |
-
$temp = bcmod($current, '16777216');
|
| 588 |
-
$value = chr($temp >> 16) . chr($temp >> 8) . chr($temp) . $value;
|
| 589 |
-
$current = bcdiv($current, '16777216', 0);
|
| 590 |
-
}
|
| 591 |
-
|
| 592 |
-
return $this->precision > 0 ?
|
| 593 |
-
substr(str_pad($value, $this->precision >> 3, chr(0), STR_PAD_LEFT), -($this->precision >> 3)) :
|
| 594 |
-
ltrim($value, chr(0));
|
| 595 |
-
}
|
| 596 |
-
|
| 597 |
-
if (!count($this->value)) {
|
| 598 |
-
return $this->precision > 0 ? str_repeat(chr(0), ($this->precision + 1) >> 3) : '';
|
| 599 |
-
}
|
| 600 |
-
$result = $this->_int2bytes($this->value[count($this->value) - 1]);
|
| 601 |
-
|
| 602 |
-
$temp = $this->copy();
|
| 603 |
-
|
| 604 |
-
for ($i = count($temp->value) - 2; $i >= 0; --$i) {
|
| 605 |
-
$temp->_base256_lshift($result, MATH_BIGINTEGER_BASE);
|
| 606 |
-
$result = $result | str_pad($temp->_int2bytes($temp->value[$i]), strlen($result), chr(0), STR_PAD_LEFT);
|
| 607 |
-
}
|
| 608 |
-
|
| 609 |
-
return $this->precision > 0 ?
|
| 610 |
-
str_pad(substr($result, -(($this->precision + 7) >> 3)), ($this->precision + 7) >> 3, chr(0), STR_PAD_LEFT) :
|
| 611 |
-
$result;
|
| 612 |
-
}
|
| 613 |
-
|
| 614 |
-
/**
|
| 615 |
-
* Converts a BigInteger to a hex string (eg. base-16)).
|
| 616 |
-
*
|
| 617 |
-
* Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're
|
| 618 |
-
* saved as two's compliment.
|
| 619 |
-
*
|
| 620 |
-
* Here's an example:
|
| 621 |
-
* <code>
|
| 622 |
-
* <?php
|
| 623 |
-
* include 'Math/BigInteger.php';
|
| 624 |
-
*
|
| 625 |
-
* $a = new Math_BigInteger('65');
|
| 626 |
-
*
|
| 627 |
-
* echo $a->toHex(); // outputs '41'
|
| 628 |
-
* ?>
|
| 629 |
-
* </code>
|
| 630 |
-
*
|
| 631 |
-
* @param bool $twos_compliment
|
| 632 |
-
* @return string
|
| 633 |
-
* @access public
|
| 634 |
-
* @internal Converts a base-2**26 number to base-2**8
|
| 635 |
-
*/
|
| 636 |
-
function toHex($twos_compliment = false)
|
| 637 |
-
{
|
| 638 |
-
return bin2hex($this->toBytes($twos_compliment));
|
| 639 |
-
}
|
| 640 |
-
|
| 641 |
-
/**
|
| 642 |
-
* Converts a BigInteger to a bit string (eg. base-2).
|
| 643 |
-
*
|
| 644 |
-
* Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're
|
| 645 |
-
* saved as two's compliment.
|
| 646 |
-
*
|
| 647 |
-
* Here's an example:
|
| 648 |
-
* <code>
|
| 649 |
-
* <?php
|
| 650 |
-
* include 'Math/BigInteger.php';
|
| 651 |
-
*
|
| 652 |
-
* $a = new Math_BigInteger('65');
|
| 653 |
-
*
|
| 654 |
-
* echo $a->toBits(); // outputs '1000001'
|
| 655 |
-
* ?>
|
| 656 |
-
* </code>
|
| 657 |
-
*
|
| 658 |
-
* @param bool $twos_compliment
|
| 659 |
-
* @return string
|
| 660 |
-
* @access public
|
| 661 |
-
* @internal Converts a base-2**26 number to base-2**2
|
| 662 |
-
*/
|
| 663 |
-
function toBits($twos_compliment = false)
|
| 664 |
-
{
|
| 665 |
-
$hex = $this->toHex($twos_compliment);
|
| 666 |
-
$bits = '';
|
| 667 |
-
for ($i = strlen($hex) - 8, $start = strlen($hex) & 7; $i >= $start; $i-=8) {
|
| 668 |
-
$bits = str_pad(decbin(hexdec(substr($hex, $i, 8))), 32, '0', STR_PAD_LEFT) . $bits;
|
| 669 |
-
}
|
| 670 |
-
if ($start) { // hexdec('') == 0
|
| 671 |
-
$bits = str_pad(decbin(hexdec(substr($hex, 0, $start))), 8, '0', STR_PAD_LEFT) . $bits;
|
| 672 |
-
}
|
| 673 |
-
$result = $this->precision > 0 ? substr($bits, -$this->precision) : ltrim($bits, '0');
|
| 674 |
-
|
| 675 |
-
if ($twos_compliment && $this->compare(new Math_BigInteger()) > 0 && $this->precision <= 0) {
|
| 676 |
-
return '0' . $result;
|
| 677 |
-
}
|
| 678 |
-
|
| 679 |
-
return $result;
|
| 680 |
-
}
|
| 681 |
-
|
| 682 |
-
/**
|
| 683 |
-
* Converts a BigInteger to a base-10 number.
|
| 684 |
-
*
|
| 685 |
-
* Here's an example:
|
| 686 |
-
* <code>
|
| 687 |
-
* <?php
|
| 688 |
-
* include 'Math/BigInteger.php';
|
| 689 |
-
*
|
| 690 |
-
* $a = new Math_BigInteger('50');
|
| 691 |
-
*
|
| 692 |
-
* echo $a->toString(); // outputs 50
|
| 693 |
-
* ?>
|
| 694 |
-
* </code>
|
| 695 |
-
*
|
| 696 |
-
* @return string
|
| 697 |
-
* @access public
|
| 698 |
-
* @internal Converts a base-2**26 number to base-10**7 (which is pretty much base-10)
|
| 699 |
-
*/
|
| 700 |
-
function toString()
|
| 701 |
-
{
|
| 702 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 703 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 704 |
-
return gmp_strval($this->value);
|
| 705 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 706 |
-
if ($this->value === '0') {
|
| 707 |
-
return '0';
|
| 708 |
-
}
|
| 709 |
-
|
| 710 |
-
return ltrim($this->value, '0');
|
| 711 |
-
}
|
| 712 |
-
|
| 713 |
-
if (!count($this->value)) {
|
| 714 |
-
return '0';
|
| 715 |
-
}
|
| 716 |
-
|
| 717 |
-
$temp = $this->copy();
|
| 718 |
-
$temp->is_negative = false;
|
| 719 |
-
|
| 720 |
-
$divisor = new Math_BigInteger();
|
| 721 |
-
$divisor->value = array(MATH_BIGINTEGER_MAX10);
|
| 722 |
-
$result = '';
|
| 723 |
-
while (count($temp->value)) {
|
| 724 |
-
list($temp, $mod) = $temp->divide($divisor);
|
| 725 |
-
$result = str_pad(isset($mod->value[0]) ? $mod->value[0] : '', MATH_BIGINTEGER_MAX10_LEN, '0', STR_PAD_LEFT) . $result;
|
| 726 |
-
}
|
| 727 |
-
$result = ltrim($result, '0');
|
| 728 |
-
if (empty($result)) {
|
| 729 |
-
$result = '0';
|
| 730 |
-
}
|
| 731 |
-
|
| 732 |
-
if ($this->is_negative) {
|
| 733 |
-
$result = '-' . $result;
|
| 734 |
-
}
|
| 735 |
-
|
| 736 |
-
return $result;
|
| 737 |
-
}
|
| 738 |
-
|
| 739 |
-
function toInteger()
|
| 740 |
-
{
|
| 741 |
-
return (int) $this->toString();
|
| 742 |
-
}
|
| 743 |
-
|
| 744 |
-
/**
|
| 745 |
-
* Copy an object
|
| 746 |
-
*
|
| 747 |
-
* PHP5 passes objects by reference while PHP4 passes by value. As such, we need a function to guarantee
|
| 748 |
-
* that all objects are passed by value, when appropriate. More information can be found here:
|
| 749 |
-
*
|
| 750 |
-
* {@link http://php.net/language.oop5.basic#51624}
|
| 751 |
-
*
|
| 752 |
-
* @access public
|
| 753 |
-
* @see self::__clone()
|
| 754 |
-
* @return Math_BigInteger
|
| 755 |
-
*/
|
| 756 |
-
function copy()
|
| 757 |
-
{
|
| 758 |
-
$temp = new Math_BigInteger();
|
| 759 |
-
$temp->value = $this->value;
|
| 760 |
-
$temp->is_negative = $this->is_negative;
|
| 761 |
-
$temp->precision = $this->precision;
|
| 762 |
-
$temp->bitmask = $this->bitmask;
|
| 763 |
-
return $temp;
|
| 764 |
-
}
|
| 765 |
-
|
| 766 |
-
/**
|
| 767 |
-
* __toString() magic method
|
| 768 |
-
*
|
| 769 |
-
* Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call
|
| 770 |
-
* toString().
|
| 771 |
-
*
|
| 772 |
-
* @access public
|
| 773 |
-
* @internal Implemented per a suggestion by Techie-Michael - thanks!
|
| 774 |
-
*/
|
| 775 |
-
function __toString()
|
| 776 |
-
{
|
| 777 |
-
return $this->toString();
|
| 778 |
-
}
|
| 779 |
-
|
| 780 |
-
/**
|
| 781 |
-
* __clone() magic method
|
| 782 |
-
*
|
| 783 |
-
* Although you can call Math_BigInteger::__toString() directly in PHP5, you cannot call Math_BigInteger::__clone()
|
| 784 |
-
* directly in PHP5. You can in PHP4 since it's not a magic method, but in PHP5, you have to call it by using the PHP5
|
| 785 |
-
* only syntax of $y = clone $x. As such, if you're trying to write an application that works on both PHP4 and PHP5,
|
| 786 |
-
* call Math_BigInteger::copy(), instead.
|
| 787 |
-
*
|
| 788 |
-
* @access public
|
| 789 |
-
* @see self::copy()
|
| 790 |
-
* @return Math_BigInteger
|
| 791 |
-
*/
|
| 792 |
-
function __clone()
|
| 793 |
-
{
|
| 794 |
-
return $this->copy();
|
| 795 |
-
}
|
| 796 |
-
|
| 797 |
-
/**
|
| 798 |
-
* __sleep() magic method
|
| 799 |
-
*
|
| 800 |
-
* Will be called, automatically, when serialize() is called on a Math_BigInteger object.
|
| 801 |
-
*
|
| 802 |
-
* @see self::__wakeup()
|
| 803 |
-
* @access public
|
| 804 |
-
*/
|
| 805 |
-
function __sleep()
|
| 806 |
-
{
|
| 807 |
-
$this->hex = $this->toHex(true);
|
| 808 |
-
$vars = array('hex');
|
| 809 |
-
if ($this->precision > 0) {
|
| 810 |
-
$vars[] = 'precision';
|
| 811 |
-
}
|
| 812 |
-
return $vars;
|
| 813 |
-
}
|
| 814 |
-
|
| 815 |
-
/**
|
| 816 |
-
* __wakeup() magic method
|
| 817 |
-
*
|
| 818 |
-
* Will be called, automatically, when unserialize() is called on a Math_BigInteger object.
|
| 819 |
-
*
|
| 820 |
-
* @see self::__sleep()
|
| 821 |
-
* @access public
|
| 822 |
-
*/
|
| 823 |
-
function __wakeup()
|
| 824 |
-
{
|
| 825 |
-
$temp = new Math_BigInteger($this->hex, -16);
|
| 826 |
-
$this->value = $temp->value;
|
| 827 |
-
$this->is_negative = $temp->is_negative;
|
| 828 |
-
if ($this->precision > 0) {
|
| 829 |
-
// recalculate $this->bitmask
|
| 830 |
-
$this->setPrecision($this->precision);
|
| 831 |
-
}
|
| 832 |
-
}
|
| 833 |
-
|
| 834 |
-
/**
|
| 835 |
-
* __debugInfo() magic method
|
| 836 |
-
*
|
| 837 |
-
* Will be called, automatically, when print_r() or var_dump() are called
|
| 838 |
-
*
|
| 839 |
-
* @access public
|
| 840 |
-
*/
|
| 841 |
-
function __debugInfo()
|
| 842 |
-
{
|
| 843 |
-
$opts = array();
|
| 844 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 845 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 846 |
-
$engine = 'gmp';
|
| 847 |
-
break;
|
| 848 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 849 |
-
$engine = 'bcmath';
|
| 850 |
-
break;
|
| 851 |
-
case MATH_BIGINTEGER_MODE_INTERNAL:
|
| 852 |
-
$engine = 'internal';
|
| 853 |
-
$opts[] = PHP_INT_SIZE == 8 ? '64-bit' : '32-bit';
|
| 854 |
-
}
|
| 855 |
-
if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_GMP && defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
|
| 856 |
-
$opts[] = 'OpenSSL';
|
| 857 |
-
}
|
| 858 |
-
if (!empty($opts)) {
|
| 859 |
-
$engine.= ' (' . implode($opts, ', ') . ')';
|
| 860 |
-
}
|
| 861 |
-
return array(
|
| 862 |
-
'value' => '0x' . $this->toHex(true),
|
| 863 |
-
'engine' => $engine
|
| 864 |
-
);
|
| 865 |
-
}
|
| 866 |
-
|
| 867 |
-
/**
|
| 868 |
-
* Adds two BigIntegers.
|
| 869 |
-
*
|
| 870 |
-
* Here's an example:
|
| 871 |
-
* <code>
|
| 872 |
-
* <?php
|
| 873 |
-
* include 'Math/BigInteger.php';
|
| 874 |
-
*
|
| 875 |
-
* $a = new Math_BigInteger('10');
|
| 876 |
-
* $b = new Math_BigInteger('20');
|
| 877 |
-
*
|
| 878 |
-
* $c = $a->add($b);
|
| 879 |
-
*
|
| 880 |
-
* echo $c->toString(); // outputs 30
|
| 881 |
-
* ?>
|
| 882 |
-
* </code>
|
| 883 |
-
*
|
| 884 |
-
* @param Math_BigInteger $y
|
| 885 |
-
* @return Math_BigInteger
|
| 886 |
-
* @access public
|
| 887 |
-
* @internal Performs base-2**52 addition
|
| 888 |
-
*/
|
| 889 |
-
function add($y)
|
| 890 |
-
{
|
| 891 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 892 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 893 |
-
$temp = new Math_BigInteger();
|
| 894 |
-
$temp->value = gmp_add($this->value, $y->value);
|
| 895 |
-
|
| 896 |
-
return $this->_normalize($temp);
|
| 897 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 898 |
-
$temp = new Math_BigInteger();
|
| 899 |
-
$temp->value = bcadd($this->value, $y->value, 0);
|
| 900 |
-
|
| 901 |
-
return $this->_normalize($temp);
|
| 902 |
-
}
|
| 903 |
-
|
| 904 |
-
$temp = $this->_add($this->value, $this->is_negative, $y->value, $y->is_negative);
|
| 905 |
-
|
| 906 |
-
$result = new Math_BigInteger();
|
| 907 |
-
$result->value = $temp[MATH_BIGINTEGER_VALUE];
|
| 908 |
-
$result->is_negative = $temp[MATH_BIGINTEGER_SIGN];
|
| 909 |
-
|
| 910 |
-
return $this->_normalize($result);
|
| 911 |
-
}
|
| 912 |
-
|
| 913 |
-
/**
|
| 914 |
-
* Performs addition.
|
| 915 |
-
*
|
| 916 |
-
* @param array $x_value
|
| 917 |
-
* @param bool $x_negative
|
| 918 |
-
* @param array $y_value
|
| 919 |
-
* @param bool $y_negative
|
| 920 |
-
* @return array
|
| 921 |
-
* @access private
|
| 922 |
-
*/
|
| 923 |
-
function _add($x_value, $x_negative, $y_value, $y_negative)
|
| 924 |
-
{
|
| 925 |
-
$x_size = count($x_value);
|
| 926 |
-
$y_size = count($y_value);
|
| 927 |
-
|
| 928 |
-
if ($x_size == 0) {
|
| 929 |
-
return array(
|
| 930 |
-
MATH_BIGINTEGER_VALUE => $y_value,
|
| 931 |
-
MATH_BIGINTEGER_SIGN => $y_negative
|
| 932 |
-
);
|
| 933 |
-
} elseif ($y_size == 0) {
|
| 934 |
-
return array(
|
| 935 |
-
MATH_BIGINTEGER_VALUE => $x_value,
|
| 936 |
-
MATH_BIGINTEGER_SIGN => $x_negative
|
| 937 |
-
);
|
| 938 |
-
}
|
| 939 |
-
|
| 940 |
-
// subtract, if appropriate
|
| 941 |
-
if ($x_negative != $y_negative) {
|
| 942 |
-
if ($x_value == $y_value) {
|
| 943 |
-
return array(
|
| 944 |
-
MATH_BIGINTEGER_VALUE => array(),
|
| 945 |
-
MATH_BIGINTEGER_SIGN => false
|
| 946 |
-
);
|
| 947 |
-
}
|
| 948 |
-
|
| 949 |
-
$temp = $this->_subtract($x_value, false, $y_value, false);
|
| 950 |
-
$temp[MATH_BIGINTEGER_SIGN] = $this->_compare($x_value, false, $y_value, false) > 0 ?
|
| 951 |
-
$x_negative : $y_negative;
|
| 952 |
-
|
| 953 |
-
return $temp;
|
| 954 |
-
}
|
| 955 |
-
|
| 956 |
-
if ($x_size < $y_size) {
|
| 957 |
-
$size = $x_size;
|
| 958 |
-
$value = $y_value;
|
| 959 |
-
} else {
|
| 960 |
-
$size = $y_size;
|
| 961 |
-
$value = $x_value;
|
| 962 |
-
}
|
| 963 |
-
|
| 964 |
-
$value[count($value)] = 0; // just in case the carry adds an extra digit
|
| 965 |
-
|
| 966 |
-
$carry = 0;
|
| 967 |
-
for ($i = 0, $j = 1; $j < $size; $i+=2, $j+=2) {
|
| 968 |
-
$sum = $x_value[$j] * MATH_BIGINTEGER_BASE_FULL + $x_value[$i] + $y_value[$j] * MATH_BIGINTEGER_BASE_FULL + $y_value[$i] + $carry;
|
| 969 |
-
$carry = $sum >= MATH_BIGINTEGER_MAX_DIGIT2; // eg. floor($sum / 2**52); only possible values (in any base) are 0 and 1
|
| 970 |
-
$sum = $carry ? $sum - MATH_BIGINTEGER_MAX_DIGIT2 : $sum;
|
| 971 |
-
|
| 972 |
-
$temp = MATH_BIGINTEGER_BASE === 26 ? intval($sum / 0x4000000) : ($sum >> 31);
|
| 973 |
-
|
| 974 |
-
$value[$i] = (int) ($sum - MATH_BIGINTEGER_BASE_FULL * $temp); // eg. a faster alternative to fmod($sum, 0x4000000)
|
| 975 |
-
$value[$j] = $temp;
|
| 976 |
-
}
|
| 977 |
-
|
| 978 |
-
if ($j == $size) { // ie. if $y_size is odd
|
| 979 |
-
$sum = $x_value[$i] + $y_value[$i] + $carry;
|
| 980 |
-
$carry = $sum >= MATH_BIGINTEGER_BASE_FULL;
|
| 981 |
-
$value[$i] = $carry ? $sum - MATH_BIGINTEGER_BASE_FULL : $sum;
|
| 982 |
-
++$i; // ie. let $i = $j since we've just done $value[$i]
|
| 983 |
-
}
|
| 984 |
-
|
| 985 |
-
if ($carry) {
|
| 986 |
-
for (; $value[$i] == MATH_BIGINTEGER_MAX_DIGIT; ++$i) {
|
| 987 |
-
$value[$i] = 0;
|
| 988 |
-
}
|
| 989 |
-
++$value[$i];
|
| 990 |
-
}
|
| 991 |
-
|
| 992 |
-
return array(
|
| 993 |
-
MATH_BIGINTEGER_VALUE => $this->_trim($value),
|
| 994 |
-
MATH_BIGINTEGER_SIGN => $x_negative
|
| 995 |
-
);
|
| 996 |
-
}
|
| 997 |
-
|
| 998 |
-
/**
|
| 999 |
-
* Subtracts two BigIntegers.
|
| 1000 |
-
*
|
| 1001 |
-
* Here's an example:
|
| 1002 |
-
* <code>
|
| 1003 |
-
* <?php
|
| 1004 |
-
* include 'Math/BigInteger.php';
|
| 1005 |
-
*
|
| 1006 |
-
* $a = new Math_BigInteger('10');
|
| 1007 |
-
* $b = new Math_BigInteger('20');
|
| 1008 |
-
*
|
| 1009 |
-
* $c = $a->subtract($b);
|
| 1010 |
-
*
|
| 1011 |
-
* echo $c->toString(); // outputs -10
|
| 1012 |
-
* ?>
|
| 1013 |
-
* </code>
|
| 1014 |
-
*
|
| 1015 |
-
* @param Math_BigInteger $y
|
| 1016 |
-
* @return Math_BigInteger
|
| 1017 |
-
* @access public
|
| 1018 |
-
* @internal Performs base-2**52 subtraction
|
| 1019 |
-
*/
|
| 1020 |
-
function subtract($y)
|
| 1021 |
-
{
|
| 1022 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 1023 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 1024 |
-
$temp = new Math_BigInteger();
|
| 1025 |
-
$temp->value = gmp_sub($this->value, $y->value);
|
| 1026 |
-
|
| 1027 |
-
return $this->_normalize($temp);
|
| 1028 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 1029 |
-
$temp = new Math_BigInteger();
|
| 1030 |
-
$temp->value = bcsub($this->value, $y->value, 0);
|
| 1031 |
-
|
| 1032 |
-
return $this->_normalize($temp);
|
| 1033 |
-
}
|
| 1034 |
-
|
| 1035 |
-
$temp = $this->_subtract($this->value, $this->is_negative, $y->value, $y->is_negative);
|
| 1036 |
-
|
| 1037 |
-
$result = new Math_BigInteger();
|
| 1038 |
-
$result->value = $temp[MATH_BIGINTEGER_VALUE];
|
| 1039 |
-
$result->is_negative = $temp[MATH_BIGINTEGER_SIGN];
|
| 1040 |
-
|
| 1041 |
-
return $this->_normalize($result);
|
| 1042 |
-
}
|
| 1043 |
-
|
| 1044 |
-
/**
|
| 1045 |
-
* Performs subtraction.
|
| 1046 |
-
*
|
| 1047 |
-
* @param array $x_value
|
| 1048 |
-
* @param bool $x_negative
|
| 1049 |
-
* @param array $y_value
|
| 1050 |
-
* @param bool $y_negative
|
| 1051 |
-
* @return array
|
| 1052 |
-
* @access private
|
| 1053 |
-
*/
|
| 1054 |
-
function _subtract($x_value, $x_negative, $y_value, $y_negative)
|
| 1055 |
-
{
|
| 1056 |
-
$x_size = count($x_value);
|
| 1057 |
-
$y_size = count($y_value);
|
| 1058 |
-
|
| 1059 |
-
if ($x_size == 0) {
|
| 1060 |
-
return array(
|
| 1061 |
-
MATH_BIGINTEGER_VALUE => $y_value,
|
| 1062 |
-
MATH_BIGINTEGER_SIGN => !$y_negative
|
| 1063 |
-
);
|
| 1064 |
-
} elseif ($y_size == 0) {
|
| 1065 |
-
return array(
|
| 1066 |
-
MATH_BIGINTEGER_VALUE => $x_value,
|
| 1067 |
-
MATH_BIGINTEGER_SIGN => $x_negative
|
| 1068 |
-
);
|
| 1069 |
-
}
|
| 1070 |
-
|
| 1071 |
-
// add, if appropriate (ie. -$x - +$y or +$x - -$y)
|
| 1072 |
-
if ($x_negative != $y_negative) {
|
| 1073 |
-
$temp = $this->_add($x_value, false, $y_value, false);
|
| 1074 |
-
$temp[MATH_BIGINTEGER_SIGN] = $x_negative;
|
| 1075 |
-
|
| 1076 |
-
return $temp;
|
| 1077 |
-
}
|
| 1078 |
-
|
| 1079 |
-
$diff = $this->_compare($x_value, $x_negative, $y_value, $y_negative);
|
| 1080 |
-
|
| 1081 |
-
if (!$diff) {
|
| 1082 |
-
return array(
|
| 1083 |
-
MATH_BIGINTEGER_VALUE => array(),
|
| 1084 |
-
MATH_BIGINTEGER_SIGN => false
|
| 1085 |
-
);
|
| 1086 |
-
}
|
| 1087 |
-
|
| 1088 |
-
// switch $x and $y around, if appropriate.
|
| 1089 |
-
if ((!$x_negative && $diff < 0) || ($x_negative && $diff > 0)) {
|
| 1090 |
-
$temp = $x_value;
|
| 1091 |
-
$x_value = $y_value;
|
| 1092 |
-
$y_value = $temp;
|
| 1093 |
-
|
| 1094 |
-
$x_negative = !$x_negative;
|
| 1095 |
-
|
| 1096 |
-
$x_size = count($x_value);
|
| 1097 |
-
$y_size = count($y_value);
|
| 1098 |
-
}
|
| 1099 |
-
|
| 1100 |
-
// at this point, $x_value should be at least as big as - if not bigger than - $y_value
|
| 1101 |
-
|
| 1102 |
-
$carry = 0;
|
| 1103 |
-
for ($i = 0, $j = 1; $j < $y_size; $i+=2, $j+=2) {
|
| 1104 |
-
$sum = $x_value[$j] * MATH_BIGINTEGER_BASE_FULL + $x_value[$i] - $y_value[$j] * MATH_BIGINTEGER_BASE_FULL - $y_value[$i] - $carry;
|
| 1105 |
-
$carry = $sum < 0; // eg. floor($sum / 2**52); only possible values (in any base) are 0 and 1
|
| 1106 |
-
$sum = $carry ? $sum + MATH_BIGINTEGER_MAX_DIGIT2 : $sum;
|
| 1107 |
-
|
| 1108 |
-
$temp = MATH_BIGINTEGER_BASE === 26 ? intval($sum / 0x4000000) : ($sum >> 31);
|
| 1109 |
-
|
| 1110 |
-
$x_value[$i] = (int) ($sum - MATH_BIGINTEGER_BASE_FULL * $temp);
|
| 1111 |
-
$x_value[$j] = $temp;
|
| 1112 |
-
}
|
| 1113 |
-
|
| 1114 |
-
if ($j == $y_size) { // ie. if $y_size is odd
|
| 1115 |
-
$sum = $x_value[$i] - $y_value[$i] - $carry;
|
| 1116 |
-
$carry = $sum < 0;
|
| 1117 |
-
$x_value[$i] = $carry ? $sum + MATH_BIGINTEGER_BASE_FULL : $sum;
|
| 1118 |
-
++$i;
|
| 1119 |
-
}
|
| 1120 |
-
|
| 1121 |
-
if ($carry) {
|
| 1122 |
-
for (; !$x_value[$i]; ++$i) {
|
| 1123 |
-
$x_value[$i] = MATH_BIGINTEGER_MAX_DIGIT;
|
| 1124 |
-
}
|
| 1125 |
-
--$x_value[$i];
|
| 1126 |
-
}
|
| 1127 |
-
|
| 1128 |
-
return array(
|
| 1129 |
-
MATH_BIGINTEGER_VALUE => $this->_trim($x_value),
|
| 1130 |
-
MATH_BIGINTEGER_SIGN => $x_negative
|
| 1131 |
-
);
|
| 1132 |
-
}
|
| 1133 |
-
|
| 1134 |
-
/**
|
| 1135 |
-
* Multiplies two BigIntegers
|
| 1136 |
-
*
|
| 1137 |
-
* Here's an example:
|
| 1138 |
-
* <code>
|
| 1139 |
-
* <?php
|
| 1140 |
-
* include 'Math/BigInteger.php';
|
| 1141 |
-
*
|
| 1142 |
-
* $a = new Math_BigInteger('10');
|
| 1143 |
-
* $b = new Math_BigInteger('20');
|
| 1144 |
-
*
|
| 1145 |
-
* $c = $a->multiply($b);
|
| 1146 |
-
*
|
| 1147 |
-
* echo $c->toString(); // outputs 200
|
| 1148 |
-
* ?>
|
| 1149 |
-
* </code>
|
| 1150 |
-
*
|
| 1151 |
-
* @param Math_BigInteger $x
|
| 1152 |
-
* @return Math_BigInteger
|
| 1153 |
-
* @access public
|
| 1154 |
-
*/
|
| 1155 |
-
function multiply($x)
|
| 1156 |
-
{
|
| 1157 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 1158 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 1159 |
-
$temp = new Math_BigInteger();
|
| 1160 |
-
$temp->value = gmp_mul($this->value, $x->value);
|
| 1161 |
-
|
| 1162 |
-
return $this->_normalize($temp);
|
| 1163 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 1164 |
-
$temp = new Math_BigInteger();
|
| 1165 |
-
$temp->value = bcmul($this->value, $x->value, 0);
|
| 1166 |
-
|
| 1167 |
-
return $this->_normalize($temp);
|
| 1168 |
-
}
|
| 1169 |
-
|
| 1170 |
-
$temp = $this->_multiply($this->value, $this->is_negative, $x->value, $x->is_negative);
|
| 1171 |
-
|
| 1172 |
-
$product = new Math_BigInteger();
|
| 1173 |
-
$product->value = $temp[MATH_BIGINTEGER_VALUE];
|
| 1174 |
-
$product->is_negative = $temp[MATH_BIGINTEGER_SIGN];
|
| 1175 |
-
|
| 1176 |
-
return $this->_normalize($product);
|
| 1177 |
-
}
|
| 1178 |
-
|
| 1179 |
-
/**
|
| 1180 |
-
* Performs multiplication.
|
| 1181 |
-
*
|
| 1182 |
-
* @param array $x_value
|
| 1183 |
-
* @param bool $x_negative
|
| 1184 |
-
* @param array $y_value
|
| 1185 |
-
* @param bool $y_negative
|
| 1186 |
-
* @return array
|
| 1187 |
-
* @access private
|
| 1188 |
-
*/
|
| 1189 |
-
function _multiply($x_value, $x_negative, $y_value, $y_negative)
|
| 1190 |
-
{
|
| 1191 |
-
//if ( $x_value == $y_value ) {
|
| 1192 |
-
// return array(
|
| 1193 |
-
// MATH_BIGINTEGER_VALUE => $this->_square($x_value),
|
| 1194 |
-
// MATH_BIGINTEGER_SIGN => $x_sign != $y_value
|
| 1195 |
-
// );
|
| 1196 |
-
//}
|
| 1197 |
-
|
| 1198 |
-
$x_length = count($x_value);
|
| 1199 |
-
$y_length = count($y_value);
|
| 1200 |
-
|
| 1201 |
-
if (!$x_length || !$y_length) { // a 0 is being multiplied
|
| 1202 |
-
return array(
|
| 1203 |
-
MATH_BIGINTEGER_VALUE => array(),
|
| 1204 |
-
MATH_BIGINTEGER_SIGN => false
|
| 1205 |
-
);
|
| 1206 |
-
}
|
| 1207 |
-
|
| 1208 |
-
return array(
|
| 1209 |
-
MATH_BIGINTEGER_VALUE => min($x_length, $y_length) < 2 * MATH_BIGINTEGER_KARATSUBA_CUTOFF ?
|
| 1210 |
-
$this->_trim($this->_regularMultiply($x_value, $y_value)) :
|
| 1211 |
-
$this->_trim($this->_karatsuba($x_value, $y_value)),
|
| 1212 |
-
MATH_BIGINTEGER_SIGN => $x_negative != $y_negative
|
| 1213 |
-
);
|
| 1214 |
-
}
|
| 1215 |
-
|
| 1216 |
-
/**
|
| 1217 |
-
* Performs long multiplication on two BigIntegers
|
| 1218 |
-
*
|
| 1219 |
-
* Modeled after 'multiply' in MutableBigInteger.java.
|
| 1220 |
-
*
|
| 1221 |
-
* @param array $x_value
|
| 1222 |
-
* @param array $y_value
|
| 1223 |
-
* @return array
|
| 1224 |
-
* @access private
|
| 1225 |
-
*/
|
| 1226 |
-
function _regularMultiply($x_value, $y_value)
|
| 1227 |
-
{
|
| 1228 |
-
$x_length = count($x_value);
|
| 1229 |
-
$y_length = count($y_value);
|
| 1230 |
-
|
| 1231 |
-
if (!$x_length || !$y_length) { // a 0 is being multiplied
|
| 1232 |
-
return array();
|
| 1233 |
-
}
|
| 1234 |
-
|
| 1235 |
-
if ($x_length < $y_length) {
|
| 1236 |
-
$temp = $x_value;
|
| 1237 |
-
$x_value = $y_value;
|
| 1238 |
-
$y_value = $temp;
|
| 1239 |
-
|
| 1240 |
-
$x_length = count($x_value);
|
| 1241 |
-
$y_length = count($y_value);
|
| 1242 |
-
}
|
| 1243 |
-
|
| 1244 |
-
$product_value = $this->_array_repeat(0, $x_length + $y_length);
|
| 1245 |
-
|
| 1246 |
-
// the following for loop could be removed if the for loop following it
|
| 1247 |
-
// (the one with nested for loops) initially set $i to 0, but
|
| 1248 |
-
// doing so would also make the result in one set of unnecessary adds,
|
| 1249 |
-
// since on the outermost loops first pass, $product->value[$k] is going
|
| 1250 |
-
// to always be 0
|
| 1251 |
-
|
| 1252 |
-
$carry = 0;
|
| 1253 |
-
|
| 1254 |
-
for ($j = 0; $j < $x_length; ++$j) { // ie. $i = 0
|
| 1255 |
-
$temp = $x_value[$j] * $y_value[0] + $carry; // $product_value[$k] == 0
|
| 1256 |
-
$carry = MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31);
|
| 1257 |
-
$product_value[$j] = (int) ($temp - MATH_BIGINTEGER_BASE_FULL * $carry);
|
| 1258 |
-
}
|
| 1259 |
-
|
| 1260 |
-
$product_value[$j] = $carry;
|
| 1261 |
-
|
| 1262 |
-
// the above for loop is what the previous comment was talking about. the
|
| 1263 |
-
// following for loop is the "one with nested for loops"
|
| 1264 |
-
for ($i = 1; $i < $y_length; ++$i) {
|
| 1265 |
-
$carry = 0;
|
| 1266 |
-
|
| 1267 |
-
for ($j = 0, $k = $i; $j < $x_length; ++$j, ++$k) {
|
| 1268 |
-
$temp = $product_value[$k] + $x_value[$j] * $y_value[$i] + $carry;
|
| 1269 |
-
$carry = MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31);
|
| 1270 |
-
$product_value[$k] = (int) ($temp - MATH_BIGINTEGER_BASE_FULL * $carry);
|
| 1271 |
-
}
|
| 1272 |
-
|
| 1273 |
-
$product_value[$k] = $carry;
|
| 1274 |
-
}
|
| 1275 |
-
|
| 1276 |
-
return $product_value;
|
| 1277 |
-
}
|
| 1278 |
-
|
| 1279 |
-
/**
|
| 1280 |
-
* Performs Karatsuba multiplication on two BigIntegers
|
| 1281 |
-
*
|
| 1282 |
-
* See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and
|
| 1283 |
-
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=120 MPM 5.2.3}.
|
| 1284 |
-
*
|
| 1285 |
-
* @param array $x_value
|
| 1286 |
-
* @param array $y_value
|
| 1287 |
-
* @return array
|
| 1288 |
-
* @access private
|
| 1289 |
-
*/
|
| 1290 |
-
function _karatsuba($x_value, $y_value)
|
| 1291 |
-
{
|
| 1292 |
-
$m = min(count($x_value) >> 1, count($y_value) >> 1);
|
| 1293 |
-
|
| 1294 |
-
if ($m < MATH_BIGINTEGER_KARATSUBA_CUTOFF) {
|
| 1295 |
-
return $this->_regularMultiply($x_value, $y_value);
|
| 1296 |
-
}
|
| 1297 |
-
|
| 1298 |
-
$x1 = array_slice($x_value, $m);
|
| 1299 |
-
$x0 = array_slice($x_value, 0, $m);
|
| 1300 |
-
$y1 = array_slice($y_value, $m);
|
| 1301 |
-
$y0 = array_slice($y_value, 0, $m);
|
| 1302 |
-
|
| 1303 |
-
$z2 = $this->_karatsuba($x1, $y1);
|
| 1304 |
-
$z0 = $this->_karatsuba($x0, $y0);
|
| 1305 |
-
|
| 1306 |
-
$z1 = $this->_add($x1, false, $x0, false);
|
| 1307 |
-
$temp = $this->_add($y1, false, $y0, false);
|
| 1308 |
-
$z1 = $this->_karatsuba($z1[MATH_BIGINTEGER_VALUE], $temp[MATH_BIGINTEGER_VALUE]);
|
| 1309 |
-
$temp = $this->_add($z2, false, $z0, false);
|
| 1310 |
-
$z1 = $this->_subtract($z1, false, $temp[MATH_BIGINTEGER_VALUE], false);
|
| 1311 |
-
|
| 1312 |
-
$z2 = array_merge(array_fill(0, 2 * $m, 0), $z2);
|
| 1313 |
-
$z1[MATH_BIGINTEGER_VALUE] = array_merge(array_fill(0, $m, 0), $z1[MATH_BIGINTEGER_VALUE]);
|
| 1314 |
-
|
| 1315 |
-
$xy = $this->_add($z2, false, $z1[MATH_BIGINTEGER_VALUE], $z1[MATH_BIGINTEGER_SIGN]);
|
| 1316 |
-
$xy = $this->_add($xy[MATH_BIGINTEGER_VALUE], $xy[MATH_BIGINTEGER_SIGN], $z0, false);
|
| 1317 |
-
|
| 1318 |
-
return $xy[MATH_BIGINTEGER_VALUE];
|
| 1319 |
-
}
|
| 1320 |
-
|
| 1321 |
-
/**
|
| 1322 |
-
* Performs squaring
|
| 1323 |
-
*
|
| 1324 |
-
* @param array $x
|
| 1325 |
-
* @return array
|
| 1326 |
-
* @access private
|
| 1327 |
-
*/
|
| 1328 |
-
function _square($x = false)
|
| 1329 |
-
{
|
| 1330 |
-
return count($x) < 2 * MATH_BIGINTEGER_KARATSUBA_CUTOFF ?
|
| 1331 |
-
$this->_trim($this->_baseSquare($x)) :
|
| 1332 |
-
$this->_trim($this->_karatsubaSquare($x));
|
| 1333 |
-
}
|
| 1334 |
-
|
| 1335 |
-
/**
|
| 1336 |
-
* Performs traditional squaring on two BigIntegers
|
| 1337 |
-
*
|
| 1338 |
-
* Squaring can be done faster than multiplying a number by itself can be. See
|
| 1339 |
-
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=7 HAC 14.2.4} /
|
| 1340 |
-
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=141 MPM 5.3} for more information.
|
| 1341 |
-
*
|
| 1342 |
-
* @param array $value
|
| 1343 |
-
* @return array
|
| 1344 |
-
* @access private
|
| 1345 |
-
*/
|
| 1346 |
-
function _baseSquare($value)
|
| 1347 |
-
{
|
| 1348 |
-
if (empty($value)) {
|
| 1349 |
-
return array();
|
| 1350 |
-
}
|
| 1351 |
-
$square_value = $this->_array_repeat(0, 2 * count($value));
|
| 1352 |
-
|
| 1353 |
-
for ($i = 0, $max_index = count($value) - 1; $i <= $max_index; ++$i) {
|
| 1354 |
-
$i2 = $i << 1;
|
| 1355 |
-
|
| 1356 |
-
$temp = $square_value[$i2] + $value[$i] * $value[$i];
|
| 1357 |
-
$carry = MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31);
|
| 1358 |
-
$square_value[$i2] = (int) ($temp - MATH_BIGINTEGER_BASE_FULL * $carry);
|
| 1359 |
-
|
| 1360 |
-
// note how we start from $i+1 instead of 0 as we do in multiplication.
|
| 1361 |
-
for ($j = $i + 1, $k = $i2 + 1; $j <= $max_index; ++$j, ++$k) {
|
| 1362 |
-
$temp = $square_value[$k] + 2 * $value[$j] * $value[$i] + $carry;
|
| 1363 |
-
$carry = MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31);
|
| 1364 |
-
$square_value[$k] = (int) ($temp - MATH_BIGINTEGER_BASE_FULL * $carry);
|
| 1365 |
-
}
|
| 1366 |
-
|
| 1367 |
-
// the following line can yield values larger 2**15. at this point, PHP should switch
|
| 1368 |
-
// over to floats.
|
| 1369 |
-
$square_value[$i + $max_index + 1] = $carry;
|
| 1370 |
-
}
|
| 1371 |
-
|
| 1372 |
-
return $square_value;
|
| 1373 |
-
}
|
| 1374 |
-
|
| 1375 |
-
/**
|
| 1376 |
-
* Performs Karatsuba "squaring" on two BigIntegers
|
| 1377 |
-
*
|
| 1378 |
-
* See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and
|
| 1379 |
-
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=151 MPM 5.3.4}.
|
| 1380 |
-
*
|
| 1381 |
-
* @param array $value
|
| 1382 |
-
* @return array
|
| 1383 |
-
* @access private
|
| 1384 |
-
*/
|
| 1385 |
-
function _karatsubaSquare($value)
|
| 1386 |
-
{
|
| 1387 |
-
$m = count($value) >> 1;
|
| 1388 |
-
|
| 1389 |
-
if ($m < MATH_BIGINTEGER_KARATSUBA_CUTOFF) {
|
| 1390 |
-
return $this->_baseSquare($value);
|
| 1391 |
-
}
|
| 1392 |
-
|
| 1393 |
-
$x1 = array_slice($value, $m);
|
| 1394 |
-
$x0 = array_slice($value, 0, $m);
|
| 1395 |
-
|
| 1396 |
-
$z2 = $this->_karatsubaSquare($x1);
|
| 1397 |
-
$z0 = $this->_karatsubaSquare($x0);
|
| 1398 |
-
|
| 1399 |
-
$z1 = $this->_add($x1, false, $x0, false);
|
| 1400 |
-
$z1 = $this->_karatsubaSquare($z1[MATH_BIGINTEGER_VALUE]);
|
| 1401 |
-
$temp = $this->_add($z2, false, $z0, false);
|
| 1402 |
-
$z1 = $this->_subtract($z1, false, $temp[MATH_BIGINTEGER_VALUE], false);
|
| 1403 |
-
|
| 1404 |
-
$z2 = array_merge(array_fill(0, 2 * $m, 0), $z2);
|
| 1405 |
-
$z1[MATH_BIGINTEGER_VALUE] = array_merge(array_fill(0, $m, 0), $z1[MATH_BIGINTEGER_VALUE]);
|
| 1406 |
-
|
| 1407 |
-
$xx = $this->_add($z2, false, $z1[MATH_BIGINTEGER_VALUE], $z1[MATH_BIGINTEGER_SIGN]);
|
| 1408 |
-
$xx = $this->_add($xx[MATH_BIGINTEGER_VALUE], $xx[MATH_BIGINTEGER_SIGN], $z0, false);
|
| 1409 |
-
|
| 1410 |
-
return $xx[MATH_BIGINTEGER_VALUE];
|
| 1411 |
-
}
|
| 1412 |
-
|
| 1413 |
-
/**
|
| 1414 |
-
* Divides two BigIntegers.
|
| 1415 |
-
*
|
| 1416 |
-
* Returns an array whose first element contains the quotient and whose second element contains the
|
| 1417 |
-
* "common residue". If the remainder would be positive, the "common residue" and the remainder are the
|
| 1418 |
-
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder
|
| 1419 |
-
* and the divisor (basically, the "common residue" is the first positive modulo).
|
| 1420 |
-
*
|
| 1421 |
-
* Here's an example:
|
| 1422 |
-
* <code>
|
| 1423 |
-
* <?php
|
| 1424 |
-
* include 'Math/BigInteger.php';
|
| 1425 |
-
*
|
| 1426 |
-
* $a = new Math_BigInteger('10');
|
| 1427 |
-
* $b = new Math_BigInteger('20');
|
| 1428 |
-
*
|
| 1429 |
-
* list($quotient, $remainder) = $a->divide($b);
|
| 1430 |
-
*
|
| 1431 |
-
* echo $quotient->toString(); // outputs 0
|
| 1432 |
-
* echo "\r\n";
|
| 1433 |
-
* echo $remainder->toString(); // outputs 10
|
| 1434 |
-
* ?>
|
| 1435 |
-
* </code>
|
| 1436 |
-
*
|
| 1437 |
-
* @param Math_BigInteger $y
|
| 1438 |
-
* @return array
|
| 1439 |
-
* @access public
|
| 1440 |
-
* @internal This function is based off of {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=9 HAC 14.20}.
|
| 1441 |
-
*/
|
| 1442 |
-
function divide($y)
|
| 1443 |
-
{
|
| 1444 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 1445 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 1446 |
-
$quotient = new Math_BigInteger();
|
| 1447 |
-
$remainder = new Math_BigInteger();
|
| 1448 |
-
|
| 1449 |
-
list($quotient->value, $remainder->value) = gmp_div_qr($this->value, $y->value);
|
| 1450 |
-
|
| 1451 |
-
if (gmp_sign($remainder->value) < 0) {
|
| 1452 |
-
$remainder->value = gmp_add($remainder->value, gmp_abs($y->value));
|
| 1453 |
-
}
|
| 1454 |
-
|
| 1455 |
-
return array($this->_normalize($quotient), $this->_normalize($remainder));
|
| 1456 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 1457 |
-
$quotient = new Math_BigInteger();
|
| 1458 |
-
$remainder = new Math_BigInteger();
|
| 1459 |
-
|
| 1460 |
-
$quotient->value = bcdiv($this->value, $y->value, 0);
|
| 1461 |
-
$remainder->value = bcmod($this->value, $y->value);
|
| 1462 |
-
|
| 1463 |
-
if ($remainder->value[0] == '-') {
|
| 1464 |
-
$remainder->value = bcadd($remainder->value, $y->value[0] == '-' ? substr($y->value, 1) : $y->value, 0);
|
| 1465 |
-
}
|
| 1466 |
-
|
| 1467 |
-
return array($this->_normalize($quotient), $this->_normalize($remainder));
|
| 1468 |
-
}
|
| 1469 |
-
|
| 1470 |
-
if (count($y->value) == 1) {
|
| 1471 |
-
list($q, $r) = $this->_divide_digit($this->value, $y->value[0]);
|
| 1472 |
-
$quotient = new Math_BigInteger();
|
| 1473 |
-
$remainder = new Math_BigInteger();
|
| 1474 |
-
$quotient->value = $q;
|
| 1475 |
-
$remainder->value = array($r);
|
| 1476 |
-
$quotient->is_negative = $this->is_negative != $y->is_negative;
|
| 1477 |
-
return array($this->_normalize($quotient), $this->_normalize($remainder));
|
| 1478 |
-
}
|
| 1479 |
-
|
| 1480 |
-
static $zero;
|
| 1481 |
-
if (!isset($zero)) {
|
| 1482 |
-
$zero = new Math_BigInteger();
|
| 1483 |
-
}
|
| 1484 |
-
|
| 1485 |
-
$x = $this->copy();
|
| 1486 |
-
$y = $y->copy();
|
| 1487 |
-
|
| 1488 |
-
$x_sign = $x->is_negative;
|
| 1489 |
-
$y_sign = $y->is_negative;
|
| 1490 |
-
|
| 1491 |
-
$x->is_negative = $y->is_negative = false;
|
| 1492 |
-
|
| 1493 |
-
$diff = $x->compare($y);
|
| 1494 |
-
|
| 1495 |
-
if (!$diff) {
|
| 1496 |
-
$temp = new Math_BigInteger();
|
| 1497 |
-
$temp->value = array(1);
|
| 1498 |
-
$temp->is_negative = $x_sign != $y_sign;
|
| 1499 |
-
return array($this->_normalize($temp), $this->_normalize(new Math_BigInteger()));
|
| 1500 |
-
}
|
| 1501 |
-
|
| 1502 |
-
if ($diff < 0) {
|
| 1503 |
-
// if $x is negative, "add" $y.
|
| 1504 |
-
if ($x_sign) {
|
| 1505 |
-
$x = $y->subtract($x);
|
| 1506 |
-
}
|
| 1507 |
-
return array($this->_normalize(new Math_BigInteger()), $this->_normalize($x));
|
| 1508 |
-
}
|
| 1509 |
-
|
| 1510 |
-
// normalize $x and $y as described in HAC 14.23 / 14.24
|
| 1511 |
-
$msb = $y->value[count($y->value) - 1];
|
| 1512 |
-
for ($shift = 0; !($msb & MATH_BIGINTEGER_MSB); ++$shift) {
|
| 1513 |
-
$msb <<= 1;
|
| 1514 |
-
}
|
| 1515 |
-
$x->_lshift($shift);
|
| 1516 |
-
$y->_lshift($shift);
|
| 1517 |
-
$y_value = &$y->value;
|
| 1518 |
-
|
| 1519 |
-
$x_max = count($x->value) - 1;
|
| 1520 |
-
$y_max = count($y->value) - 1;
|
| 1521 |
-
|
| 1522 |
-
$quotient = new Math_BigInteger();
|
| 1523 |
-
$quotient_value = &$quotient->value;
|
| 1524 |
-
$quotient_value = $this->_array_repeat(0, $x_max - $y_max + 1);
|
| 1525 |
-
|
| 1526 |
-
static $temp, $lhs, $rhs;
|
| 1527 |
-
if (!isset($temp)) {
|
| 1528 |
-
$temp = new Math_BigInteger();
|
| 1529 |
-
$lhs = new Math_BigInteger();
|
| 1530 |
-
$rhs = new Math_BigInteger();
|
| 1531 |
-
}
|
| 1532 |
-
$temp_value = &$temp->value;
|
| 1533 |
-
$rhs_value = &$rhs->value;
|
| 1534 |
-
|
| 1535 |
-
// $temp = $y << ($x_max - $y_max-1) in base 2**26
|
| 1536 |
-
$temp_value = array_merge($this->_array_repeat(0, $x_max - $y_max), $y_value);
|
| 1537 |
-
|
| 1538 |
-
while ($x->compare($temp) >= 0) {
|
| 1539 |
-
// calculate the "common residue"
|
| 1540 |
-
++$quotient_value[$x_max - $y_max];
|
| 1541 |
-
$x = $x->subtract($temp);
|
| 1542 |
-
$x_max = count($x->value) - 1;
|
| 1543 |
-
}
|
| 1544 |
-
|
| 1545 |
-
for ($i = $x_max; $i >= $y_max + 1; --$i) {
|
| 1546 |
-
$x_value = &$x->value;
|
| 1547 |
-
$x_window = array(
|
| 1548 |
-
isset($x_value[$i]) ? $x_value[$i] : 0,
|
| 1549 |
-
isset($x_value[$i - 1]) ? $x_value[$i - 1] : 0,
|
| 1550 |
-
isset($x_value[$i - 2]) ? $x_value[$i - 2] : 0
|
| 1551 |
-
);
|
| 1552 |
-
$y_window = array(
|
| 1553 |
-
$y_value[$y_max],
|
| 1554 |
-
($y_max > 0) ? $y_value[$y_max - 1] : 0
|
| 1555 |
-
);
|
| 1556 |
-
|
| 1557 |
-
$q_index = $i - $y_max - 1;
|
| 1558 |
-
if ($x_window[0] == $y_window[0]) {
|
| 1559 |
-
$quotient_value[$q_index] = MATH_BIGINTEGER_MAX_DIGIT;
|
| 1560 |
-
} else {
|
| 1561 |
-
$quotient_value[$q_index] = $this->_safe_divide(
|
| 1562 |
-
$x_window[0] * MATH_BIGINTEGER_BASE_FULL + $x_window[1],
|
| 1563 |
-
$y_window[0]
|
| 1564 |
-
);
|
| 1565 |
-
}
|
| 1566 |
-
|
| 1567 |
-
$temp_value = array($y_window[1], $y_window[0]);
|
| 1568 |
-
|
| 1569 |
-
$lhs->value = array($quotient_value[$q_index]);
|
| 1570 |
-
$lhs = $lhs->multiply($temp);
|
| 1571 |
-
|
| 1572 |
-
$rhs_value = array($x_window[2], $x_window[1], $x_window[0]);
|
| 1573 |
-
|
| 1574 |
-
while ($lhs->compare($rhs) > 0) {
|
| 1575 |
-
--$quotient_value[$q_index];
|
| 1576 |
-
|
| 1577 |
-
$lhs->value = array($quotient_value[$q_index]);
|
| 1578 |
-
$lhs = $lhs->multiply($temp);
|
| 1579 |
-
}
|
| 1580 |
-
|
| 1581 |
-
$adjust = $this->_array_repeat(0, $q_index);
|
| 1582 |
-
$temp_value = array($quotient_value[$q_index]);
|
| 1583 |
-
$temp = $temp->multiply($y);
|
| 1584 |
-
$temp_value = &$temp->value;
|
| 1585 |
-
$temp_value = array_merge($adjust, $temp_value);
|
| 1586 |
-
|
| 1587 |
-
$x = $x->subtract($temp);
|
| 1588 |
-
|
| 1589 |
-
if ($x->compare($zero) < 0) {
|
| 1590 |
-
$temp_value = array_merge($adjust, $y_value);
|
| 1591 |
-
$x = $x->add($temp);
|
| 1592 |
-
|
| 1593 |
-
--$quotient_value[$q_index];
|
| 1594 |
-
}
|
| 1595 |
-
|
| 1596 |
-
$x_max = count($x_value) - 1;
|
| 1597 |
-
}
|
| 1598 |
-
|
| 1599 |
-
// unnormalize the remainder
|
| 1600 |
-
$x->_rshift($shift);
|
| 1601 |
-
|
| 1602 |
-
$quotient->is_negative = $x_sign != $y_sign;
|
| 1603 |
-
|
| 1604 |
-
// calculate the "common residue", if appropriate
|
| 1605 |
-
if ($x_sign) {
|
| 1606 |
-
$y->_rshift($shift);
|
| 1607 |
-
$x = $y->subtract($x);
|
| 1608 |
-
}
|
| 1609 |
-
|
| 1610 |
-
return array($this->_normalize($quotient), $this->_normalize($x));
|
| 1611 |
-
}
|
| 1612 |
-
|
| 1613 |
-
/**
|
| 1614 |
-
* Divides a BigInteger by a regular integer
|
| 1615 |
-
*
|
| 1616 |
-
* abc / x = a00 / x + b0 / x + c / x
|
| 1617 |
-
*
|
| 1618 |
-
* @param array $dividend
|
| 1619 |
-
* @param array $divisor
|
| 1620 |
-
* @return array
|
| 1621 |
-
* @access private
|
| 1622 |
-
*/
|
| 1623 |
-
function _divide_digit($dividend, $divisor)
|
| 1624 |
-
{
|
| 1625 |
-
$carry = 0;
|
| 1626 |
-
$result = array();
|
| 1627 |
-
|
| 1628 |
-
for ($i = count($dividend) - 1; $i >= 0; --$i) {
|
| 1629 |
-
$temp = MATH_BIGINTEGER_BASE_FULL * $carry + $dividend[$i];
|
| 1630 |
-
$result[$i] = $this->_safe_divide($temp, $divisor);
|
| 1631 |
-
$carry = (int) ($temp - $divisor * $result[$i]);
|
| 1632 |
-
}
|
| 1633 |
-
|
| 1634 |
-
return array($result, $carry);
|
| 1635 |
-
}
|
| 1636 |
-
|
| 1637 |
-
/**
|
| 1638 |
-
* Performs modular exponentiation.
|
| 1639 |
-
*
|
| 1640 |
-
* Here's an example:
|
| 1641 |
-
* <code>
|
| 1642 |
-
* <?php
|
| 1643 |
-
* include 'Math/BigInteger.php';
|
| 1644 |
-
*
|
| 1645 |
-
* $a = new Math_BigInteger('10');
|
| 1646 |
-
* $b = new Math_BigInteger('20');
|
| 1647 |
-
* $c = new Math_BigInteger('30');
|
| 1648 |
-
*
|
| 1649 |
-
* $c = $a->modPow($b, $c);
|
| 1650 |
-
*
|
| 1651 |
-
* echo $c->toString(); // outputs 10
|
| 1652 |
-
* ?>
|
| 1653 |
-
* </code>
|
| 1654 |
-
*
|
| 1655 |
-
* @param Math_BigInteger $e
|
| 1656 |
-
* @param Math_BigInteger $n
|
| 1657 |
-
* @return Math_BigInteger
|
| 1658 |
-
* @access public
|
| 1659 |
-
* @internal The most naive approach to modular exponentiation has very unreasonable requirements, and
|
| 1660 |
-
* and although the approach involving repeated squaring does vastly better, it, too, is impractical
|
| 1661 |
-
* for our purposes. The reason being that division - by far the most complicated and time-consuming
|
| 1662 |
-
* of the basic operations (eg. +,-,*,/) - occurs multiple times within it.
|
| 1663 |
-
*
|
| 1664 |
-
* Modular reductions resolve this issue. Although an individual modular reduction takes more time
|
| 1665 |
-
* then an individual division, when performed in succession (with the same modulo), they're a lot faster.
|
| 1666 |
-
*
|
| 1667 |
-
* The two most commonly used modular reductions are Barrett and Montgomery reduction. Montgomery reduction,
|
| 1668 |
-
* although faster, only works when the gcd of the modulo and of the base being used is 1. In RSA, when the
|
| 1669 |
-
* base is a power of two, the modulo - a product of two primes - is always going to have a gcd of 1 (because
|
| 1670 |
-
* the product of two odd numbers is odd), but what about when RSA isn't used?
|
| 1671 |
-
*
|
| 1672 |
-
* In contrast, Barrett reduction has no such constraint. As such, some bigint implementations perform a
|
| 1673 |
-
* Barrett reduction after every operation in the modpow function. Others perform Barrett reductions when the
|
| 1674 |
-
* modulo is even and Montgomery reductions when the modulo is odd. BigInteger.java's modPow method, however,
|
| 1675 |
-
* uses a trick involving the Chinese Remainder Theorem to factor the even modulo into two numbers - one odd and
|
| 1676 |
-
* the other, a power of two - and recombine them, later. This is the method that this modPow function uses.
|
| 1677 |
-
* {@link http://islab.oregonstate.edu/papers/j34monex.pdf Montgomery Reduction with Even Modulus} elaborates.
|
| 1678 |
-
*/
|
| 1679 |
-
function modPow($e, $n)
|
| 1680 |
-
{
|
| 1681 |
-
$n = $this->bitmask !== false && $this->bitmask->compare($n) < 0 ? $this->bitmask : $n->abs();
|
| 1682 |
-
|
| 1683 |
-
if ($e->compare(new Math_BigInteger()) < 0) {
|
| 1684 |
-
$e = $e->abs();
|
| 1685 |
-
|
| 1686 |
-
$temp = $this->modInverse($n);
|
| 1687 |
-
if ($temp === false) {
|
| 1688 |
-
return false;
|
| 1689 |
-
}
|
| 1690 |
-
|
| 1691 |
-
return $this->_normalize($temp->modPow($e, $n));
|
| 1692 |
-
}
|
| 1693 |
-
|
| 1694 |
-
if (MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_GMP) {
|
| 1695 |
-
$temp = new Math_BigInteger();
|
| 1696 |
-
$temp->value = gmp_powm($this->value, $e->value, $n->value);
|
| 1697 |
-
|
| 1698 |
-
return $this->_normalize($temp);
|
| 1699 |
-
}
|
| 1700 |
-
|
| 1701 |
-
if ($this->compare(new Math_BigInteger()) < 0 || $this->compare($n) > 0) {
|
| 1702 |
-
list(, $temp) = $this->divide($n);
|
| 1703 |
-
return $temp->modPow($e, $n);
|
| 1704 |
-
}
|
| 1705 |
-
|
| 1706 |
-
if (defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
|
| 1707 |
-
$components = array(
|
| 1708 |
-
'modulus' => $n->toBytes(true),
|
| 1709 |
-
'publicExponent' => $e->toBytes(true)
|
| 1710 |
-
);
|
| 1711 |
-
|
| 1712 |
-
$components = array(
|
| 1713 |
-
'modulus' => pack('Ca*a*', 2, $this->_encodeASN1Length(strlen($components['modulus'])), $components['modulus']),
|
| 1714 |
-
'publicExponent' => pack('Ca*a*', 2, $this->_encodeASN1Length(strlen($components['publicExponent'])), $components['publicExponent'])
|
| 1715 |
-
);
|
| 1716 |
-
|
| 1717 |
-
$RSAPublicKey = pack(
|
| 1718 |
-
'Ca*a*a*',
|
| 1719 |
-
48,
|
| 1720 |
-
$this->_encodeASN1Length(strlen($components['modulus']) + strlen($components['publicExponent'])),
|
| 1721 |
-
$components['modulus'],
|
| 1722 |
-
$components['publicExponent']
|
| 1723 |
-
);
|
| 1724 |
-
|
| 1725 |
-
$rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
|
| 1726 |
-
$RSAPublicKey = chr(0) . $RSAPublicKey;
|
| 1727 |
-
$RSAPublicKey = chr(3) . $this->_encodeASN1Length(strlen($RSAPublicKey)) . $RSAPublicKey;
|
| 1728 |
-
|
| 1729 |
-
$encapsulated = pack(
|
| 1730 |
-
'Ca*a*',
|
| 1731 |
-
48,
|
| 1732 |
-
$this->_encodeASN1Length(strlen($rsaOID . $RSAPublicKey)),
|
| 1733 |
-
$rsaOID . $RSAPublicKey
|
| 1734 |
-
);
|
| 1735 |
-
|
| 1736 |
-
$RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" .
|
| 1737 |
-
chunk_split(base64_encode($encapsulated)) .
|
| 1738 |
-
'-----END PUBLIC KEY-----';
|
| 1739 |
-
|
| 1740 |
-
$plaintext = str_pad($this->toBytes(), strlen($n->toBytes(true)) - 1, "\0", STR_PAD_LEFT);
|
| 1741 |
-
|
| 1742 |
-
if (openssl_public_encrypt($plaintext, $result, $RSAPublicKey, OPENSSL_NO_PADDING)) {
|
| 1743 |
-
return new Math_BigInteger($result, 256);
|
| 1744 |
-
}
|
| 1745 |
-
}
|
| 1746 |
-
|
| 1747 |
-
if (MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_BCMATH) {
|
| 1748 |
-
$temp = new Math_BigInteger();
|
| 1749 |
-
$temp->value = bcpowmod($this->value, $e->value, $n->value, 0);
|
| 1750 |
-
|
| 1751 |
-
return $this->_normalize($temp);
|
| 1752 |
-
}
|
| 1753 |
-
|
| 1754 |
-
if (empty($e->value)) {
|
| 1755 |
-
$temp = new Math_BigInteger();
|
| 1756 |
-
$temp->value = array(1);
|
| 1757 |
-
return $this->_normalize($temp);
|
| 1758 |
-
}
|
| 1759 |
-
|
| 1760 |
-
if ($e->value == array(1)) {
|
| 1761 |
-
list(, $temp) = $this->divide($n);
|
| 1762 |
-
return $this->_normalize($temp);
|
| 1763 |
-
}
|
| 1764 |
-
|
| 1765 |
-
if ($e->value == array(2)) {
|
| 1766 |
-
$temp = new Math_BigInteger();
|
| 1767 |
-
$temp->value = $this->_square($this->value);
|
| 1768 |
-
list(, $temp) = $temp->divide($n);
|
| 1769 |
-
return $this->_normalize($temp);
|
| 1770 |
-
}
|
| 1771 |
-
|
| 1772 |
-
return $this->_normalize($this->_slidingWindow($e, $n, MATH_BIGINTEGER_BARRETT));
|
| 1773 |
-
|
| 1774 |
-
// the following code, although not callable, can be run independently of the above code
|
| 1775 |
-
// although the above code performed better in my benchmarks the following could might
|
| 1776 |
-
// perform better under different circumstances. in lieu of deleting it it's just been
|
| 1777 |
-
// made uncallable
|
| 1778 |
-
|
| 1779 |
-
// is the modulo odd?
|
| 1780 |
-
if ($n->value[0] & 1) {
|
| 1781 |
-
return $this->_normalize($this->_slidingWindow($e, $n, MATH_BIGINTEGER_MONTGOMERY));
|
| 1782 |
-
}
|
| 1783 |
-
// if it's not, it's even
|
| 1784 |
-
|
| 1785 |
-
// find the lowest set bit (eg. the max pow of 2 that divides $n)
|
| 1786 |
-
for ($i = 0; $i < count($n->value); ++$i) {
|
| 1787 |
-
if ($n->value[$i]) {
|
| 1788 |
-
$temp = decbin($n->value[$i]);
|
| 1789 |
-
$j = strlen($temp) - strrpos($temp, '1') - 1;
|
| 1790 |
-
$j+= 26 * $i;
|
| 1791 |
-
break;
|
| 1792 |
-
}
|
| 1793 |
-
}
|
| 1794 |
-
// at this point, 2^$j * $n/(2^$j) == $n
|
| 1795 |
-
|
| 1796 |
-
$mod1 = $n->copy();
|
| 1797 |
-
$mod1->_rshift($j);
|
| 1798 |
-
$mod2 = new Math_BigInteger();
|
| 1799 |
-
$mod2->value = array(1);
|
| 1800 |
-
$mod2->_lshift($j);
|
| 1801 |
-
|
| 1802 |
-
$part1 = ($mod1->value != array(1)) ? $this->_slidingWindow($e, $mod1, MATH_BIGINTEGER_MONTGOMERY) : new Math_BigInteger();
|
| 1803 |
-
$part2 = $this->_slidingWindow($e, $mod2, MATH_BIGINTEGER_POWEROF2);
|
| 1804 |
-
|
| 1805 |
-
$y1 = $mod2->modInverse($mod1);
|
| 1806 |
-
$y2 = $mod1->modInverse($mod2);
|
| 1807 |
-
|
| 1808 |
-
$result = $part1->multiply($mod2);
|
| 1809 |
-
$result = $result->multiply($y1);
|
| 1810 |
-
|
| 1811 |
-
$temp = $part2->multiply($mod1);
|
| 1812 |
-
$temp = $temp->multiply($y2);
|
| 1813 |
-
|
| 1814 |
-
$result = $result->add($temp);
|
| 1815 |
-
list(, $result) = $result->divide($n);
|
| 1816 |
-
|
| 1817 |
-
return $this->_normalize($result);
|
| 1818 |
-
}
|
| 1819 |
-
|
| 1820 |
-
/**
|
| 1821 |
-
* Performs modular exponentiation.
|
| 1822 |
-
*
|
| 1823 |
-
* Alias for Math_BigInteger::modPow()
|
| 1824 |
-
*
|
| 1825 |
-
* @param Math_BigInteger $e
|
| 1826 |
-
* @param Math_BigInteger $n
|
| 1827 |
-
* @return Math_BigInteger
|
| 1828 |
-
* @access public
|
| 1829 |
-
*/
|
| 1830 |
-
function powMod($e, $n)
|
| 1831 |
-
{
|
| 1832 |
-
return $this->modPow($e, $n);
|
| 1833 |
-
}
|
| 1834 |
-
|
| 1835 |
-
/**
|
| 1836 |
-
* Sliding Window k-ary Modular Exponentiation
|
| 1837 |
-
*
|
| 1838 |
-
* Based on {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=27 HAC 14.85} /
|
| 1839 |
-
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=210 MPM 7.7}. In a departure from those algorithims,
|
| 1840 |
-
* however, this function performs a modular reduction after every multiplication and squaring operation.
|
| 1841 |
-
* As such, this function has the same preconditions that the reductions being used do.
|
| 1842 |
-
*
|
| 1843 |
-
* @param Math_BigInteger $e
|
| 1844 |
-
* @param Math_BigInteger $n
|
| 1845 |
-
* @param int $mode
|
| 1846 |
-
* @return Math_BigInteger
|
| 1847 |
-
* @access private
|
| 1848 |
-
*/
|
| 1849 |
-
function _slidingWindow($e, $n, $mode)
|
| 1850 |
-
{
|
| 1851 |
-
static $window_ranges = array(7, 25, 81, 241, 673, 1793); // from BigInteger.java's oddModPow function
|
| 1852 |
-
//static $window_ranges = array(0, 7, 36, 140, 450, 1303, 3529); // from MPM 7.3.1
|
| 1853 |
-
|
| 1854 |
-
$e_value = $e->value;
|
| 1855 |
-
$e_length = count($e_value) - 1;
|
| 1856 |
-
$e_bits = decbin($e_value[$e_length]);
|
| 1857 |
-
for ($i = $e_length - 1; $i >= 0; --$i) {
|
| 1858 |
-
$e_bits.= str_pad(decbin($e_value[$i]), MATH_BIGINTEGER_BASE, '0', STR_PAD_LEFT);
|
| 1859 |
-
}
|
| 1860 |
-
|
| 1861 |
-
$e_length = strlen($e_bits);
|
| 1862 |
-
|
| 1863 |
-
// calculate the appropriate window size.
|
| 1864 |
-
// $window_size == 3 if $window_ranges is between 25 and 81, for example.
|
| 1865 |
-
for ($i = 0, $window_size = 1; $i < count($window_ranges) && $e_length > $window_ranges[$i]; ++$window_size, ++$i) {
|
| 1866 |
-
}
|
| 1867 |
-
|
| 1868 |
-
$n_value = $n->value;
|
| 1869 |
-
|
| 1870 |
-
// precompute $this^0 through $this^$window_size
|
| 1871 |
-
$powers = array();
|
| 1872 |
-
$powers[1] = $this->_prepareReduce($this->value, $n_value, $mode);
|
| 1873 |
-
$powers[2] = $this->_squareReduce($powers[1], $n_value, $mode);
|
| 1874 |
-
|
| 1875 |
-
// we do every other number since substr($e_bits, $i, $j+1) (see below) is supposed to end
|
| 1876 |
-
// in a 1. ie. it's supposed to be odd.
|
| 1877 |
-
$temp = 1 << ($window_size - 1);
|
| 1878 |
-
for ($i = 1; $i < $temp; ++$i) {
|
| 1879 |
-
$i2 = $i << 1;
|
| 1880 |
-
$powers[$i2 + 1] = $this->_multiplyReduce($powers[$i2 - 1], $powers[2], $n_value, $mode);
|
| 1881 |
-
}
|
| 1882 |
-
|
| 1883 |
-
$result = array(1);
|
| 1884 |
-
$result = $this->_prepareReduce($result, $n_value, $mode);
|
| 1885 |
-
|
| 1886 |
-
for ($i = 0; $i < $e_length;) {
|
| 1887 |
-
if (!$e_bits[$i]) {
|
| 1888 |
-
$result = $this->_squareReduce($result, $n_value, $mode);
|
| 1889 |
-
++$i;
|
| 1890 |
-
} else {
|
| 1891 |
-
for ($j = $window_size - 1; $j > 0; --$j) {
|
| 1892 |
-
if (!empty($e_bits[$i + $j])) {
|
| 1893 |
-
break;
|
| 1894 |
-
}
|
| 1895 |
-
}
|
| 1896 |
-
|
| 1897 |
-
// eg. the length of substr($e_bits, $i, $j + 1)
|
| 1898 |
-
for ($k = 0; $k <= $j; ++$k) {
|
| 1899 |
-
$result = $this->_squareReduce($result, $n_value, $mode);
|
| 1900 |
-
}
|
| 1901 |
-
|
| 1902 |
-
$result = $this->_multiplyReduce($result, $powers[bindec(substr($e_bits, $i, $j + 1))], $n_value, $mode);
|
| 1903 |
-
|
| 1904 |
-
$i += $j + 1;
|
| 1905 |
-
}
|
| 1906 |
-
}
|
| 1907 |
-
|
| 1908 |
-
$temp = new Math_BigInteger();
|
| 1909 |
-
$temp->value = $this->_reduce($result, $n_value, $mode);
|
| 1910 |
-
|
| 1911 |
-
return $temp;
|
| 1912 |
-
}
|
| 1913 |
-
|
| 1914 |
-
/**
|
| 1915 |
-
* Modular reduction
|
| 1916 |
-
*
|
| 1917 |
-
* For most $modes this will return the remainder.
|
| 1918 |
-
*
|
| 1919 |
-
* @see self::_slidingWindow()
|
| 1920 |
-
* @access private
|
| 1921 |
-
* @param array $x
|
| 1922 |
-
* @param array $n
|
| 1923 |
-
* @param int $mode
|
| 1924 |
-
* @return array
|
| 1925 |
-
*/
|
| 1926 |
-
function _reduce($x, $n, $mode)
|
| 1927 |
-
{
|
| 1928 |
-
switch ($mode) {
|
| 1929 |
-
case MATH_BIGINTEGER_MONTGOMERY:
|
| 1930 |
-
return $this->_montgomery($x, $n);
|
| 1931 |
-
case MATH_BIGINTEGER_BARRETT:
|
| 1932 |
-
return $this->_barrett($x, $n);
|
| 1933 |
-
case MATH_BIGINTEGER_POWEROF2:
|
| 1934 |
-
$lhs = new Math_BigInteger();
|
| 1935 |
-
$lhs->value = $x;
|
| 1936 |
-
$rhs = new Math_BigInteger();
|
| 1937 |
-
$rhs->value = $n;
|
| 1938 |
-
return $x->_mod2($n);
|
| 1939 |
-
case MATH_BIGINTEGER_CLASSIC:
|
| 1940 |
-
$lhs = new Math_BigInteger();
|
| 1941 |
-
$lhs->value = $x;
|
| 1942 |
-
$rhs = new Math_BigInteger();
|
| 1943 |
-
$rhs->value = $n;
|
| 1944 |
-
list(, $temp) = $lhs->divide($rhs);
|
| 1945 |
-
return $temp->value;
|
| 1946 |
-
case MATH_BIGINTEGER_NONE:
|
| 1947 |
-
return $x;
|
| 1948 |
-
default:
|
| 1949 |
-
// an invalid $mode was provided
|
| 1950 |
-
}
|
| 1951 |
-
}
|
| 1952 |
-
|
| 1953 |
-
/**
|
| 1954 |
-
* Modular reduction preperation
|
| 1955 |
-
*
|
| 1956 |
-
* @see self::_slidingWindow()
|
| 1957 |
-
* @access private
|
| 1958 |
-
* @param array $x
|
| 1959 |
-
* @param array $n
|
| 1960 |
-
* @param int $mode
|
| 1961 |
-
* @return array
|
| 1962 |
-
*/
|
| 1963 |
-
function _prepareReduce($x, $n, $mode)
|
| 1964 |
-
{
|
| 1965 |
-
if ($mode == MATH_BIGINTEGER_MONTGOMERY) {
|
| 1966 |
-
return $this->_prepMontgomery($x, $n);
|
| 1967 |
-
}
|
| 1968 |
-
return $this->_reduce($x, $n, $mode);
|
| 1969 |
-
}
|
| 1970 |
-
|
| 1971 |
-
/**
|
| 1972 |
-
* Modular multiply
|
| 1973 |
-
*
|
| 1974 |
-
* @see self::_slidingWindow()
|
| 1975 |
-
* @access private
|
| 1976 |
-
* @param array $x
|
| 1977 |
-
* @param array $y
|
| 1978 |
-
* @param array $n
|
| 1979 |
-
* @param int $mode
|
| 1980 |
-
* @return array
|
| 1981 |
-
*/
|
| 1982 |
-
function _multiplyReduce($x, $y, $n, $mode)
|
| 1983 |
-
{
|
| 1984 |
-
if ($mode == MATH_BIGINTEGER_MONTGOMERY) {
|
| 1985 |
-
return $this->_montgomeryMultiply($x, $y, $n);
|
| 1986 |
-
}
|
| 1987 |
-
$temp = $this->_multiply($x, false, $y, false);
|
| 1988 |
-
return $this->_reduce($temp[MATH_BIGINTEGER_VALUE], $n, $mode);
|
| 1989 |
-
}
|
| 1990 |
-
|
| 1991 |
-
/**
|
| 1992 |
-
* Modular square
|
| 1993 |
-
*
|
| 1994 |
-
* @see self::_slidingWindow()
|
| 1995 |
-
* @access private
|
| 1996 |
-
* @param array $x
|
| 1997 |
-
* @param array $n
|
| 1998 |
-
* @param int $mode
|
| 1999 |
-
* @return array
|
| 2000 |
-
*/
|
| 2001 |
-
function _squareReduce($x, $n, $mode)
|
| 2002 |
-
{
|
| 2003 |
-
if ($mode == MATH_BIGINTEGER_MONTGOMERY) {
|
| 2004 |
-
return $this->_montgomeryMultiply($x, $x, $n);
|
| 2005 |
-
}
|
| 2006 |
-
return $this->_reduce($this->_square($x), $n, $mode);
|
| 2007 |
-
}
|
| 2008 |
-
|
| 2009 |
-
/**
|
| 2010 |
-
* Modulos for Powers of Two
|
| 2011 |
-
*
|
| 2012 |
-
* Calculates $x%$n, where $n = 2**$e, for some $e. Since this is basically the same as doing $x & ($n-1),
|
| 2013 |
-
* we'll just use this function as a wrapper for doing that.
|
| 2014 |
-
*
|
| 2015 |
-
* @see self::_slidingWindow()
|
| 2016 |
-
* @access private
|
| 2017 |
-
* @param Math_BigInteger
|
| 2018 |
-
* @return Math_BigInteger
|
| 2019 |
-
*/
|
| 2020 |
-
function _mod2($n)
|
| 2021 |
-
{
|
| 2022 |
-
$temp = new Math_BigInteger();
|
| 2023 |
-
$temp->value = array(1);
|
| 2024 |
-
return $this->bitwise_and($n->subtract($temp));
|
| 2025 |
-
}
|
| 2026 |
-
|
| 2027 |
-
/**
|
| 2028 |
-
* Barrett Modular Reduction
|
| 2029 |
-
*
|
| 2030 |
-
* See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=14 HAC 14.3.3} /
|
| 2031 |
-
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=165 MPM 6.2.5} for more information. Modified slightly,
|
| 2032 |
-
* so as not to require negative numbers (initially, this script didn't support negative numbers).
|
| 2033 |
-
*
|
| 2034 |
-
* Employs "folding", as described at
|
| 2035 |
-
* {@link http://www.cosic.esat.kuleuven.be/publications/thesis-149.pdf#page=66 thesis-149.pdf#page=66}. To quote from
|
| 2036 |
-
* it, "the idea [behind folding] is to find a value x' such that x (mod m) = x' (mod m), with x' being smaller than x."
|
| 2037 |
-
*
|
| 2038 |
-
* Unfortunately, the "Barrett Reduction with Folding" algorithm described in thesis-149.pdf is not, as written, all that
|
| 2039 |
-
* usable on account of (1) its not using reasonable radix points as discussed in
|
| 2040 |
-
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=162 MPM 6.2.2} and (2) the fact that, even with reasonable
|
| 2041 |
-
* radix points, it only works when there are an even number of digits in the denominator. The reason for (2) is that
|
| 2042 |
-
* (x >> 1) + (x >> 1) != x / 2 + x / 2. If x is even, they're the same, but if x is odd, they're not. See the in-line
|
| 2043 |
-
* comments for details.
|
| 2044 |
-
*
|
| 2045 |
-
* @see self::_slidingWindow()
|
| 2046 |
-
* @access private
|
| 2047 |
-
* @param array $n
|
| 2048 |
-
* @param array $m
|
| 2049 |
-
* @return array
|
| 2050 |
-
*/
|
| 2051 |
-
function _barrett($n, $m)
|
| 2052 |
-
{
|
| 2053 |
-
static $cache = array(
|
| 2054 |
-
MATH_BIGINTEGER_VARIABLE => array(),
|
| 2055 |
-
MATH_BIGINTEGER_DATA => array()
|
| 2056 |
-
);
|
| 2057 |
-
|
| 2058 |
-
$m_length = count($m);
|
| 2059 |
-
|
| 2060 |
-
// if ($this->_compare($n, $this->_square($m)) >= 0) {
|
| 2061 |
-
if (count($n) > 2 * $m_length) {
|
| 2062 |
-
$lhs = new Math_BigInteger();
|
| 2063 |
-
$rhs = new Math_BigInteger();
|
| 2064 |
-
$lhs->value = $n;
|
| 2065 |
-
$rhs->value = $m;
|
| 2066 |
-
list(, $temp) = $lhs->divide($rhs);
|
| 2067 |
-
return $temp->value;
|
| 2068 |
-
}
|
| 2069 |
-
|
| 2070 |
-
// if (m.length >> 1) + 2 <= m.length then m is too small and n can't be reduced
|
| 2071 |
-
if ($m_length < 5) {
|
| 2072 |
-
return $this->_regularBarrett($n, $m);
|
| 2073 |
-
}
|
| 2074 |
-
|
| 2075 |
-
// n = 2 * m.length
|
| 2076 |
-
|
| 2077 |
-
if (($key = array_search($m, $cache[MATH_BIGINTEGER_VARIABLE])) === false) {
|
| 2078 |
-
$key = count($cache[MATH_BIGINTEGER_VARIABLE]);
|
| 2079 |
-
$cache[MATH_BIGINTEGER_VARIABLE][] = $m;
|
| 2080 |
-
|
| 2081 |
-
$lhs = new Math_BigInteger();
|
| 2082 |
-
$lhs_value = &$lhs->value;
|
| 2083 |
-
$lhs_value = $this->_array_repeat(0, $m_length + ($m_length >> 1));
|
| 2084 |
-
$lhs_value[] = 1;
|
| 2085 |
-
$rhs = new Math_BigInteger();
|
| 2086 |
-
$rhs->value = $m;
|
| 2087 |
-
|
| 2088 |
-
list($u, $m1) = $lhs->divide($rhs);
|
| 2089 |
-
$u = $u->value;
|
| 2090 |
-
$m1 = $m1->value;
|
| 2091 |
-
|
| 2092 |
-
$cache[MATH_BIGINTEGER_DATA][] = array(
|
| 2093 |
-
'u' => $u, // m.length >> 1 (technically (m.length >> 1) + 1)
|
| 2094 |
-
'm1'=> $m1 // m.length
|
| 2095 |
-
);
|
| 2096 |
-
} else {
|
| 2097 |
-
extract($cache[MATH_BIGINTEGER_DATA][$key]);
|
| 2098 |
-
}
|
| 2099 |
-
|
| 2100 |
-
$cutoff = $m_length + ($m_length >> 1);
|
| 2101 |
-
$lsd = array_slice($n, 0, $cutoff); // m.length + (m.length >> 1)
|
| 2102 |
-
$msd = array_slice($n, $cutoff); // m.length >> 1
|
| 2103 |
-
$lsd = $this->_trim($lsd);
|
| 2104 |
-
$temp = $this->_multiply($msd, false, $m1, false);
|
| 2105 |
-
$n = $this->_add($lsd, false, $temp[MATH_BIGINTEGER_VALUE], false); // m.length + (m.length >> 1) + 1
|
| 2106 |
-
|
| 2107 |
-
if ($m_length & 1) {
|
| 2108 |
-
return $this->_regularBarrett($n[MATH_BIGINTEGER_VALUE], $m);
|
| 2109 |
-
}
|
| 2110 |
-
|
| 2111 |
-
// (m.length + (m.length >> 1) + 1) - (m.length - 1) == (m.length >> 1) + 2
|
| 2112 |
-
$temp = array_slice($n[MATH_BIGINTEGER_VALUE], $m_length - 1);
|
| 2113 |
-
// if even: ((m.length >> 1) + 2) + (m.length >> 1) == m.length + 2
|
| 2114 |
-
// if odd: ((m.length >> 1) + 2) + (m.length >> 1) == (m.length - 1) + 2 == m.length + 1
|
| 2115 |
-
$temp = $this->_multiply($temp, false, $u, false);
|
| 2116 |
-
// if even: (m.length + 2) - ((m.length >> 1) + 1) = m.length - (m.length >> 1) + 1
|
| 2117 |
-
// if odd: (m.length + 1) - ((m.length >> 1) + 1) = m.length - (m.length >> 1)
|
| 2118 |
-
$temp = array_slice($temp[MATH_BIGINTEGER_VALUE], ($m_length >> 1) + 1);
|
| 2119 |
-
// if even: (m.length - (m.length >> 1) + 1) + m.length = 2 * m.length - (m.length >> 1) + 1
|
| 2120 |
-
// if odd: (m.length - (m.length >> 1)) + m.length = 2 * m.length - (m.length >> 1)
|
| 2121 |
-
$temp = $this->_multiply($temp, false, $m, false);
|
| 2122 |
-
|
| 2123 |
-
// at this point, if m had an odd number of digits, we'd be subtracting a 2 * m.length - (m.length >> 1) digit
|
| 2124 |
-
// number from a m.length + (m.length >> 1) + 1 digit number. ie. there'd be an extra digit and the while loop
|
| 2125 |
-
// following this comment would loop a lot (hence our calling _regularBarrett() in that situation).
|
| 2126 |
-
|
| 2127 |
-
$result = $this->_subtract($n[MATH_BIGINTEGER_VALUE], false, $temp[MATH_BIGINTEGER_VALUE], false);
|
| 2128 |
-
|
| 2129 |
-
while ($this->_compare($result[MATH_BIGINTEGER_VALUE], $result[MATH_BIGINTEGER_SIGN], $m, false) >= 0) {
|
| 2130 |
-
$result = $this->_subtract($result[MATH_BIGINTEGER_VALUE], $result[MATH_BIGINTEGER_SIGN], $m, false);
|
| 2131 |
-
}
|
| 2132 |
-
|
| 2133 |
-
return $result[MATH_BIGINTEGER_VALUE];
|
| 2134 |
-
}
|
| 2135 |
-
|
| 2136 |
-
/**
|
| 2137 |
-
* (Regular) Barrett Modular Reduction
|
| 2138 |
-
*
|
| 2139 |
-
* For numbers with more than four digits Math_BigInteger::_barrett() is faster. The difference between that and this
|
| 2140 |
-
* is that this function does not fold the denominator into a smaller form.
|
| 2141 |
-
*
|
| 2142 |
-
* @see self::_slidingWindow()
|
| 2143 |
-
* @access private
|
| 2144 |
-
* @param array $x
|
| 2145 |
-
* @param array $n
|
| 2146 |
-
* @return array
|
| 2147 |
-
*/
|
| 2148 |
-
function _regularBarrett($x, $n)
|
| 2149 |
-
{
|
| 2150 |
-
static $cache = array(
|
| 2151 |
-
MATH_BIGINTEGER_VARIABLE => array(),
|
| 2152 |
-
MATH_BIGINTEGER_DATA => array()
|
| 2153 |
-
);
|
| 2154 |
-
|
| 2155 |
-
$n_length = count($n);
|
| 2156 |
-
|
| 2157 |
-
if (count($x) > 2 * $n_length) {
|
| 2158 |
-
$lhs = new Math_BigInteger();
|
| 2159 |
-
$rhs = new Math_BigInteger();
|
| 2160 |
-
$lhs->value = $x;
|
| 2161 |
-
$rhs->value = $n;
|
| 2162 |
-
list(, $temp) = $lhs->divide($rhs);
|
| 2163 |
-
return $temp->value;
|
| 2164 |
-
}
|
| 2165 |
-
|
| 2166 |
-
if (($key = array_search($n, $cache[MATH_BIGINTEGER_VARIABLE])) === false) {
|
| 2167 |
-
$key = count($cache[MATH_BIGINTEGER_VARIABLE]);
|
| 2168 |
-
$cache[MATH_BIGINTEGER_VARIABLE][] = $n;
|
| 2169 |
-
$lhs = new Math_BigInteger();
|
| 2170 |
-
$lhs_value = &$lhs->value;
|
| 2171 |
-
$lhs_value = $this->_array_repeat(0, 2 * $n_length);
|
| 2172 |
-
$lhs_value[] = 1;
|
| 2173 |
-
$rhs = new Math_BigInteger();
|
| 2174 |
-
$rhs->value = $n;
|
| 2175 |
-
list($temp, ) = $lhs->divide($rhs); // m.length
|
| 2176 |
-
$cache[MATH_BIGINTEGER_DATA][] = $temp->value;
|
| 2177 |
-
}
|
| 2178 |
-
|
| 2179 |
-
// 2 * m.length - (m.length - 1) = m.length + 1
|
| 2180 |
-
$temp = array_slice($x, $n_length - 1);
|
| 2181 |
-
// (m.length + 1) + m.length = 2 * m.length + 1
|
| 2182 |
-
$temp = $this->_multiply($temp, false, $cache[MATH_BIGINTEGER_DATA][$key], false);
|
| 2183 |
-
// (2 * m.length + 1) - (m.length - 1) = m.length + 2
|
| 2184 |
-
$temp = array_slice($temp[MATH_BIGINTEGER_VALUE], $n_length + 1);
|
| 2185 |
-
|
| 2186 |
-
// m.length + 1
|
| 2187 |
-
$result = array_slice($x, 0, $n_length + 1);
|
| 2188 |
-
// m.length + 1
|
| 2189 |
-
$temp = $this->_multiplyLower($temp, false, $n, false, $n_length + 1);
|
| 2190 |
-
// $temp == array_slice($temp->_multiply($temp, false, $n, false)->value, 0, $n_length + 1)
|
| 2191 |
-
|
| 2192 |
-
if ($this->_compare($result, false, $temp[MATH_BIGINTEGER_VALUE], $temp[MATH_BIGINTEGER_SIGN]) < 0) {
|
| 2193 |
-
$corrector_value = $this->_array_repeat(0, $n_length + 1);
|
| 2194 |
-
$corrector_value[count($corrector_value)] = 1;
|
| 2195 |
-
$result = $this->_add($result, false, $corrector_value, false);
|
| 2196 |
-
$result = $result[MATH_BIGINTEGER_VALUE];
|
| 2197 |
-
}
|
| 2198 |
-
|
| 2199 |
-
// at this point, we're subtracting a number with m.length + 1 digits from another number with m.length + 1 digits
|
| 2200 |
-
$result = $this->_subtract($result, false, $temp[MATH_BIGINTEGER_VALUE], $temp[MATH_BIGINTEGER_SIGN]);
|
| 2201 |
-
while ($this->_compare($result[MATH_BIGINTEGER_VALUE], $result[MATH_BIGINTEGER_SIGN], $n, false) > 0) {
|
| 2202 |
-
$result = $this->_subtract($result[MATH_BIGINTEGER_VALUE], $result[MATH_BIGINTEGER_SIGN], $n, false);
|
| 2203 |
-
}
|
| 2204 |
-
|
| 2205 |
-
return $result[MATH_BIGINTEGER_VALUE];
|
| 2206 |
-
}
|
| 2207 |
-
|
| 2208 |
-
/**
|
| 2209 |
-
* Performs long multiplication up to $stop digits
|
| 2210 |
-
*
|
| 2211 |
-
* If you're going to be doing array_slice($product->value, 0, $stop), some cycles can be saved.
|
| 2212 |
-
*
|
| 2213 |
-
* @see self::_regularBarrett()
|
| 2214 |
-
* @param array $x_value
|
| 2215 |
-
* @param bool $x_negative
|
| 2216 |
-
* @param array $y_value
|
| 2217 |
-
* @param bool $y_negative
|
| 2218 |
-
* @param int $stop
|
| 2219 |
-
* @return array
|
| 2220 |
-
* @access private
|
| 2221 |
-
*/
|
| 2222 |
-
function _multiplyLower($x_value, $x_negative, $y_value, $y_negative, $stop)
|
| 2223 |
-
{
|
| 2224 |
-
$x_length = count($x_value);
|
| 2225 |
-
$y_length = count($y_value);
|
| 2226 |
-
|
| 2227 |
-
if (!$x_length || !$y_length) { // a 0 is being multiplied
|
| 2228 |
-
return array(
|
| 2229 |
-
MATH_BIGINTEGER_VALUE => array(),
|
| 2230 |
-
MATH_BIGINTEGER_SIGN => false
|
| 2231 |
-
);
|
| 2232 |
-
}
|
| 2233 |
-
|
| 2234 |
-
if ($x_length < $y_length) {
|
| 2235 |
-
$temp = $x_value;
|
| 2236 |
-
$x_value = $y_value;
|
| 2237 |
-
$y_value = $temp;
|
| 2238 |
-
|
| 2239 |
-
$x_length = count($x_value);
|
| 2240 |
-
$y_length = count($y_value);
|
| 2241 |
-
}
|
| 2242 |
-
|
| 2243 |
-
$product_value = $this->_array_repeat(0, $x_length + $y_length);
|
| 2244 |
-
|
| 2245 |
-
// the following for loop could be removed if the for loop following it
|
| 2246 |
-
// (the one with nested for loops) initially set $i to 0, but
|
| 2247 |
-
// doing so would also make the result in one set of unnecessary adds,
|
| 2248 |
-
// since on the outermost loops first pass, $product->value[$k] is going
|
| 2249 |
-
// to always be 0
|
| 2250 |
-
|
| 2251 |
-
$carry = 0;
|
| 2252 |
-
|
| 2253 |
-
for ($j = 0; $j < $x_length; ++$j) { // ie. $i = 0, $k = $i
|
| 2254 |
-
$temp = $x_value[$j] * $y_value[0] + $carry; // $product_value[$k] == 0
|
| 2255 |
-
$carry = MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31);
|
| 2256 |
-
$product_value[$j] = (int) ($temp - MATH_BIGINTEGER_BASE_FULL * $carry);
|
| 2257 |
-
}
|
| 2258 |
-
|
| 2259 |
-
if ($j < $stop) {
|
| 2260 |
-
$product_value[$j] = $carry;
|
| 2261 |
-
}
|
| 2262 |
-
|
| 2263 |
-
// the above for loop is what the previous comment was talking about. the
|
| 2264 |
-
// following for loop is the "one with nested for loops"
|
| 2265 |
-
|
| 2266 |
-
for ($i = 1; $i < $y_length; ++$i) {
|
| 2267 |
-
$carry = 0;
|
| 2268 |
-
|
| 2269 |
-
for ($j = 0, $k = $i; $j < $x_length && $k < $stop; ++$j, ++$k) {
|
| 2270 |
-
$temp = $product_value[$k] + $x_value[$j] * $y_value[$i] + $carry;
|
| 2271 |
-
$carry = MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31);
|
| 2272 |
-
$product_value[$k] = (int) ($temp - MATH_BIGINTEGER_BASE_FULL * $carry);
|
| 2273 |
-
}
|
| 2274 |
-
|
| 2275 |
-
if ($k < $stop) {
|
| 2276 |
-
$product_value[$k] = $carry;
|
| 2277 |
-
}
|
| 2278 |
-
}
|
| 2279 |
-
|
| 2280 |
-
return array(
|
| 2281 |
-
MATH_BIGINTEGER_VALUE => $this->_trim($product_value),
|
| 2282 |
-
MATH_BIGINTEGER_SIGN => $x_negative != $y_negative
|
| 2283 |
-
);
|
| 2284 |
-
}
|
| 2285 |
-
|
| 2286 |
-
/**
|
| 2287 |
-
* Montgomery Modular Reduction
|
| 2288 |
-
*
|
| 2289 |
-
* ($x->_prepMontgomery($n))->_montgomery($n) yields $x % $n.
|
| 2290 |
-
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=170 MPM 6.3} provides insights on how this can be
|
| 2291 |
-
* improved upon (basically, by using the comba method). gcd($n, 2) must be equal to one for this function
|
| 2292 |
-
* to work correctly.
|
| 2293 |
-
*
|
| 2294 |
-
* @see self::_prepMontgomery()
|
| 2295 |
-
* @see self::_slidingWindow()
|
| 2296 |
-
* @access private
|
| 2297 |
-
* @param array $x
|
| 2298 |
-
* @param array $n
|
| 2299 |
-
* @return array
|
| 2300 |
-
*/
|
| 2301 |
-
function _montgomery($x, $n)
|
| 2302 |
-
{
|
| 2303 |
-
static $cache = array(
|
| 2304 |
-
MATH_BIGINTEGER_VARIABLE => array(),
|
| 2305 |
-
MATH_BIGINTEGER_DATA => array()
|
| 2306 |
-
);
|
| 2307 |
-
|
| 2308 |
-
if (($key = array_search($n, $cache[MATH_BIGINTEGER_VARIABLE])) === false) {
|
| 2309 |
-
$key = count($cache[MATH_BIGINTEGER_VARIABLE]);
|
| 2310 |
-
$cache[MATH_BIGINTEGER_VARIABLE][] = $x;
|
| 2311 |
-
$cache[MATH_BIGINTEGER_DATA][] = $this->_modInverse67108864($n);
|
| 2312 |
-
}
|
| 2313 |
-
|
| 2314 |
-
$k = count($n);
|
| 2315 |
-
|
| 2316 |
-
$result = array(MATH_BIGINTEGER_VALUE => $x);
|
| 2317 |
-
|
| 2318 |
-
for ($i = 0; $i < $k; ++$i) {
|
| 2319 |
-
$temp = $result[MATH_BIGINTEGER_VALUE][$i] * $cache[MATH_BIGINTEGER_DATA][$key];
|
| 2320 |
-
$temp = $temp - MATH_BIGINTEGER_BASE_FULL * (MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31));
|
| 2321 |
-
$temp = $this->_regularMultiply(array($temp), $n);
|
| 2322 |
-
$temp = array_merge($this->_array_repeat(0, $i), $temp);
|
| 2323 |
-
$result = $this->_add($result[MATH_BIGINTEGER_VALUE], false, $temp, false);
|
| 2324 |
-
}
|
| 2325 |
-
|
| 2326 |
-
$result[MATH_BIGINTEGER_VALUE] = array_slice($result[MATH_BIGINTEGER_VALUE], $k);
|
| 2327 |
-
|
| 2328 |
-
if ($this->_compare($result, false, $n, false) >= 0) {
|
| 2329 |
-
$result = $this->_subtract($result[MATH_BIGINTEGER_VALUE], false, $n, false);
|
| 2330 |
-
}
|
| 2331 |
-
|
| 2332 |
-
return $result[MATH_BIGINTEGER_VALUE];
|
| 2333 |
-
}
|
| 2334 |
-
|
| 2335 |
-
/**
|
| 2336 |
-
* Montgomery Multiply
|
| 2337 |
-
*
|
| 2338 |
-
* Interleaves the montgomery reduction and long multiplication algorithms together as described in
|
| 2339 |
-
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=13 HAC 14.36}
|
| 2340 |
-
*
|
| 2341 |
-
* @see self::_prepMontgomery()
|
| 2342 |
-
* @see self::_montgomery()
|
| 2343 |
-
* @access private
|
| 2344 |
-
* @param array $x
|
| 2345 |
-
* @param array $y
|
| 2346 |
-
* @param array $m
|
| 2347 |
-
* @return array
|
| 2348 |
-
*/
|
| 2349 |
-
function _montgomeryMultiply($x, $y, $m)
|
| 2350 |
-
{
|
| 2351 |
-
$temp = $this->_multiply($x, false, $y, false);
|
| 2352 |
-
return $this->_montgomery($temp[MATH_BIGINTEGER_VALUE], $m);
|
| 2353 |
-
|
| 2354 |
-
// the following code, although not callable, can be run independently of the above code
|
| 2355 |
-
// although the above code performed better in my benchmarks the following could might
|
| 2356 |
-
// perform better under different circumstances. in lieu of deleting it it's just been
|
| 2357 |
-
// made uncallable
|
| 2358 |
-
|
| 2359 |
-
static $cache = array(
|
| 2360 |
-
MATH_BIGINTEGER_VARIABLE => array(),
|
| 2361 |
-
MATH_BIGINTEGER_DATA => array()
|
| 2362 |
-
);
|
| 2363 |
-
|
| 2364 |
-
if (($key = array_search($m, $cache[MATH_BIGINTEGER_VARIABLE])) === false) {
|
| 2365 |
-
$key = count($cache[MATH_BIGINTEGER_VARIABLE]);
|
| 2366 |
-
$cache[MATH_BIGINTEGER_VARIABLE][] = $m;
|
| 2367 |
-
$cache[MATH_BIGINTEGER_DATA][] = $this->_modInverse67108864($m);
|
| 2368 |
-
}
|
| 2369 |
-
|
| 2370 |
-
$n = max(count($x), count($y), count($m));
|
| 2371 |
-
$x = array_pad($x, $n, 0);
|
| 2372 |
-
$y = array_pad($y, $n, 0);
|
| 2373 |
-
$m = array_pad($m, $n, 0);
|
| 2374 |
-
$a = array(MATH_BIGINTEGER_VALUE => $this->_array_repeat(0, $n + 1));
|
| 2375 |
-
for ($i = 0; $i < $n; ++$i) {
|
| 2376 |
-
$temp = $a[MATH_BIGINTEGER_VALUE][0] + $x[$i] * $y[0];
|
| 2377 |
-
$temp = $temp - MATH_BIGINTEGER_BASE_FULL * (MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31));
|
| 2378 |
-
$temp = $temp * $cache[MATH_BIGINTEGER_DATA][$key];
|
| 2379 |
-
$temp = $temp - MATH_BIGINTEGER_BASE_FULL * (MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31));
|
| 2380 |
-
$temp = $this->_add($this->_regularMultiply(array($x[$i]), $y), false, $this->_regularMultiply(array($temp), $m), false);
|
| 2381 |
-
$a = $this->_add($a[MATH_BIGINTEGER_VALUE], false, $temp[MATH_BIGINTEGER_VALUE], false);
|
| 2382 |
-
$a[MATH_BIGINTEGER_VALUE] = array_slice($a[MATH_BIGINTEGER_VALUE], 1);
|
| 2383 |
-
}
|
| 2384 |
-
if ($this->_compare($a[MATH_BIGINTEGER_VALUE], false, $m, false) >= 0) {
|
| 2385 |
-
$a = $this->_subtract($a[MATH_BIGINTEGER_VALUE], false, $m, false);
|
| 2386 |
-
}
|
| 2387 |
-
return $a[MATH_BIGINTEGER_VALUE];
|
| 2388 |
-
}
|
| 2389 |
-
|
| 2390 |
-
/**
|
| 2391 |
-
* Prepare a number for use in Montgomery Modular Reductions
|
| 2392 |
-
*
|
| 2393 |
-
* @see self::_montgomery()
|
| 2394 |
-
* @see self::_slidingWindow()
|
| 2395 |
-
* @access private
|
| 2396 |
-
* @param array $x
|
| 2397 |
-
* @param array $n
|
| 2398 |
-
* @return array
|
| 2399 |
-
*/
|
| 2400 |
-
function _prepMontgomery($x, $n)
|
| 2401 |
-
{
|
| 2402 |
-
$lhs = new Math_BigInteger();
|
| 2403 |
-
$lhs->value = array_merge($this->_array_repeat(0, count($n)), $x);
|
| 2404 |
-
$rhs = new Math_BigInteger();
|
| 2405 |
-
$rhs->value = $n;
|
| 2406 |
-
|
| 2407 |
-
list(, $temp) = $lhs->divide($rhs);
|
| 2408 |
-
return $temp->value;
|
| 2409 |
-
}
|
| 2410 |
-
|
| 2411 |
-
/**
|
| 2412 |
-
* Modular Inverse of a number mod 2**26 (eg. 67108864)
|
| 2413 |
-
*
|
| 2414 |
-
* Based off of the bnpInvDigit function implemented and justified in the following URL:
|
| 2415 |
-
*
|
| 2416 |
-
* {@link http://www-cs-students.stanford.edu/~tjw/jsbn/jsbn.js}
|
| 2417 |
-
*
|
| 2418 |
-
* The following URL provides more info:
|
| 2419 |
-
*
|
| 2420 |
-
* {@link http://groups.google.com/group/sci.crypt/msg/7a137205c1be7d85}
|
| 2421 |
-
*
|
| 2422 |
-
* As for why we do all the bitmasking... strange things can happen when converting from floats to ints. For
|
| 2423 |
-
* instance, on some computers, var_dump((int) -4294967297) yields int(-1) and on others, it yields
|
| 2424 |
-
* int(-2147483648). To avoid problems stemming from this, we use bitmasks to guarantee that ints aren't
|
| 2425 |
-
* auto-converted to floats. The outermost bitmask is present because without it, there's no guarantee that
|
| 2426 |
-
* the "residue" returned would be the so-called "common residue". We use fmod, in the last step, because the
|
| 2427 |
-
* maximum possible $x is 26 bits and the maximum $result is 16 bits. Thus, we have to be able to handle up to
|
| 2428 |
-
* 40 bits, which only 64-bit floating points will support.
|
| 2429 |
-
*
|
| 2430 |
-
* Thanks to Pedro Gimeno Fortea for input!
|
| 2431 |
-
*
|
| 2432 |
-
* @see self::_montgomery()
|
| 2433 |
-
* @access private
|
| 2434 |
-
* @param array $x
|
| 2435 |
-
* @return int
|
| 2436 |
-
*/
|
| 2437 |
-
function _modInverse67108864($x) // 2**26 == 67,108,864
|
| 2438 |
-
{
|
| 2439 |
-
$x = -$x[0];
|
| 2440 |
-
$result = $x & 0x3; // x**-1 mod 2**2
|
| 2441 |
-
$result = ($result * (2 - $x * $result)) & 0xF; // x**-1 mod 2**4
|
| 2442 |
-
$result = ($result * (2 - ($x & 0xFF) * $result)) & 0xFF; // x**-1 mod 2**8
|
| 2443 |
-
$result = ($result * ((2 - ($x & 0xFFFF) * $result) & 0xFFFF)) & 0xFFFF; // x**-1 mod 2**16
|
| 2444 |
-
$result = fmod($result * (2 - fmod($x * $result, MATH_BIGINTEGER_BASE_FULL)), MATH_BIGINTEGER_BASE_FULL); // x**-1 mod 2**26
|
| 2445 |
-
return $result & MATH_BIGINTEGER_MAX_DIGIT;
|
| 2446 |
-
}
|
| 2447 |
-
|
| 2448 |
-
/**
|
| 2449 |
-
* Calculates modular inverses.
|
| 2450 |
-
*
|
| 2451 |
-
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
|
| 2452 |
-
*
|
| 2453 |
-
* Here's an example:
|
| 2454 |
-
* <code>
|
| 2455 |
-
* <?php
|
| 2456 |
-
* include 'Math/BigInteger.php';
|
| 2457 |
-
*
|
| 2458 |
-
* $a = new Math_BigInteger(30);
|
| 2459 |
-
* $b = new Math_BigInteger(17);
|
| 2460 |
-
*
|
| 2461 |
-
* $c = $a->modInverse($b);
|
| 2462 |
-
* echo $c->toString(); // outputs 4
|
| 2463 |
-
*
|
| 2464 |
-
* echo "\r\n";
|
| 2465 |
-
*
|
| 2466 |
-
* $d = $a->multiply($c);
|
| 2467 |
-
* list(, $d) = $d->divide($b);
|
| 2468 |
-
* echo $d; // outputs 1 (as per the definition of modular inverse)
|
| 2469 |
-
* ?>
|
| 2470 |
-
* </code>
|
| 2471 |
-
*
|
| 2472 |
-
* @param Math_BigInteger $n
|
| 2473 |
-
* @return Math_BigInteger|false
|
| 2474 |
-
* @access public
|
| 2475 |
-
* @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=21 HAC 14.64} for more information.
|
| 2476 |
-
*/
|
| 2477 |
-
function modInverse($n)
|
| 2478 |
-
{
|
| 2479 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2480 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2481 |
-
$temp = new Math_BigInteger();
|
| 2482 |
-
$temp->value = gmp_invert($this->value, $n->value);
|
| 2483 |
-
|
| 2484 |
-
return ($temp->value === false) ? false : $this->_normalize($temp);
|
| 2485 |
-
}
|
| 2486 |
-
|
| 2487 |
-
static $zero, $one;
|
| 2488 |
-
if (!isset($zero)) {
|
| 2489 |
-
$zero = new Math_BigInteger();
|
| 2490 |
-
$one = new Math_BigInteger(1);
|
| 2491 |
-
}
|
| 2492 |
-
|
| 2493 |
-
// $x mod -$n == $x mod $n.
|
| 2494 |
-
$n = $n->abs();
|
| 2495 |
-
|
| 2496 |
-
if ($this->compare($zero) < 0) {
|
| 2497 |
-
$temp = $this->abs();
|
| 2498 |
-
$temp = $temp->modInverse($n);
|
| 2499 |
-
return $this->_normalize($n->subtract($temp));
|
| 2500 |
-
}
|
| 2501 |
-
|
| 2502 |
-
extract($this->extendedGCD($n));
|
| 2503 |
-
|
| 2504 |
-
if (!$gcd->equals($one)) {
|
| 2505 |
-
return false;
|
| 2506 |
-
}
|
| 2507 |
-
|
| 2508 |
-
$x = $x->compare($zero) < 0 ? $x->add($n) : $x;
|
| 2509 |
-
|
| 2510 |
-
return $this->compare($zero) < 0 ? $this->_normalize($n->subtract($x)) : $this->_normalize($x);
|
| 2511 |
-
}
|
| 2512 |
-
|
| 2513 |
-
/**
|
| 2514 |
-
* Calculates the greatest common divisor and Bezout's identity.
|
| 2515 |
-
*
|
| 2516 |
-
* Say you have 693 and 609. The GCD is 21. Bezout's identity states that there exist integers x and y such that
|
| 2517 |
-
* 693*x + 609*y == 21. In point of fact, there are actually an infinite number of x and y combinations and which
|
| 2518 |
-
* combination is returned is dependent upon which mode is in use. See
|
| 2519 |
-
* {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information.
|
| 2520 |
-
*
|
| 2521 |
-
* Here's an example:
|
| 2522 |
-
* <code>
|
| 2523 |
-
* <?php
|
| 2524 |
-
* include 'Math/BigInteger.php';
|
| 2525 |
-
*
|
| 2526 |
-
* $a = new Math_BigInteger(693);
|
| 2527 |
-
* $b = new Math_BigInteger(609);
|
| 2528 |
-
*
|
| 2529 |
-
* extract($a->extendedGCD($b));
|
| 2530 |
-
*
|
| 2531 |
-
* echo $gcd->toString() . "\r\n"; // outputs 21
|
| 2532 |
-
* echo $a->toString() * $x->toString() + $b->toString() * $y->toString(); // outputs 21
|
| 2533 |
-
* ?>
|
| 2534 |
-
* </code>
|
| 2535 |
-
*
|
| 2536 |
-
* @param Math_BigInteger $n
|
| 2537 |
-
* @return Math_BigInteger
|
| 2538 |
-
* @access public
|
| 2539 |
-
* @internal Calculates the GCD using the binary xGCD algorithim described in
|
| 2540 |
-
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=19 HAC 14.61}. As the text above 14.61 notes,
|
| 2541 |
-
* the more traditional algorithim requires "relatively costly multiple-precision divisions".
|
| 2542 |
-
*/
|
| 2543 |
-
function extendedGCD($n)
|
| 2544 |
-
{
|
| 2545 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2546 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2547 |
-
extract(gmp_gcdext($this->value, $n->value));
|
| 2548 |
-
|
| 2549 |
-
return array(
|
| 2550 |
-
'gcd' => $this->_normalize(new Math_BigInteger($g)),
|
| 2551 |
-
'x' => $this->_normalize(new Math_BigInteger($s)),
|
| 2552 |
-
'y' => $this->_normalize(new Math_BigInteger($t))
|
| 2553 |
-
);
|
| 2554 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 2555 |
-
// it might be faster to use the binary xGCD algorithim here, as well, but (1) that algorithim works
|
| 2556 |
-
// best when the base is a power of 2 and (2) i don't think it'd make much difference, anyway. as is,
|
| 2557 |
-
// the basic extended euclidean algorithim is what we're using.
|
| 2558 |
-
|
| 2559 |
-
$u = $this->value;
|
| 2560 |
-
$v = $n->value;
|
| 2561 |
-
|
| 2562 |
-
$a = '1';
|
| 2563 |
-
$b = '0';
|
| 2564 |
-
$c = '0';
|
| 2565 |
-
$d = '1';
|
| 2566 |
-
|
| 2567 |
-
while (bccomp($v, '0', 0) != 0) {
|
| 2568 |
-
$q = bcdiv($u, $v, 0);
|
| 2569 |
-
|
| 2570 |
-
$temp = $u;
|
| 2571 |
-
$u = $v;
|
| 2572 |
-
$v = bcsub($temp, bcmul($v, $q, 0), 0);
|
| 2573 |
-
|
| 2574 |
-
$temp = $a;
|
| 2575 |
-
$a = $c;
|
| 2576 |
-
$c = bcsub($temp, bcmul($a, $q, 0), 0);
|
| 2577 |
-
|
| 2578 |
-
$temp = $b;
|
| 2579 |
-
$b = $d;
|
| 2580 |
-
$d = bcsub($temp, bcmul($b, $q, 0), 0);
|
| 2581 |
-
}
|
| 2582 |
-
|
| 2583 |
-
return array(
|
| 2584 |
-
'gcd' => $this->_normalize(new Math_BigInteger($u)),
|
| 2585 |
-
'x' => $this->_normalize(new Math_BigInteger($a)),
|
| 2586 |
-
'y' => $this->_normalize(new Math_BigInteger($b))
|
| 2587 |
-
);
|
| 2588 |
-
}
|
| 2589 |
-
|
| 2590 |
-
$y = $n->copy();
|
| 2591 |
-
$x = $this->copy();
|
| 2592 |
-
$g = new Math_BigInteger();
|
| 2593 |
-
$g->value = array(1);
|
| 2594 |
-
|
| 2595 |
-
while (!(($x->value[0] & 1)|| ($y->value[0] & 1))) {
|
| 2596 |
-
$x->_rshift(1);
|
| 2597 |
-
$y->_rshift(1);
|
| 2598 |
-
$g->_lshift(1);
|
| 2599 |
-
}
|
| 2600 |
-
|
| 2601 |
-
$u = $x->copy();
|
| 2602 |
-
$v = $y->copy();
|
| 2603 |
-
|
| 2604 |
-
$a = new Math_BigInteger();
|
| 2605 |
-
$b = new Math_BigInteger();
|
| 2606 |
-
$c = new Math_BigInteger();
|
| 2607 |
-
$d = new Math_BigInteger();
|
| 2608 |
-
|
| 2609 |
-
$a->value = $d->value = $g->value = array(1);
|
| 2610 |
-
$b->value = $c->value = array();
|
| 2611 |
-
|
| 2612 |
-
while (!empty($u->value)) {
|
| 2613 |
-
while (!($u->value[0] & 1)) {
|
| 2614 |
-
$u->_rshift(1);
|
| 2615 |
-
if ((!empty($a->value) && ($a->value[0] & 1)) || (!empty($b->value) && ($b->value[0] & 1))) {
|
| 2616 |
-
$a = $a->add($y);
|
| 2617 |
-
$b = $b->subtract($x);
|
| 2618 |
-
}
|
| 2619 |
-
$a->_rshift(1);
|
| 2620 |
-
$b->_rshift(1);
|
| 2621 |
-
}
|
| 2622 |
-
|
| 2623 |
-
while (!($v->value[0] & 1)) {
|
| 2624 |
-
$v->_rshift(1);
|
| 2625 |
-
if ((!empty($d->value) && ($d->value[0] & 1)) || (!empty($c->value) && ($c->value[0] & 1))) {
|
| 2626 |
-
$c = $c->add($y);
|
| 2627 |
-
$d = $d->subtract($x);
|
| 2628 |
-
}
|
| 2629 |
-
$c->_rshift(1);
|
| 2630 |
-
$d->_rshift(1);
|
| 2631 |
-
}
|
| 2632 |
-
|
| 2633 |
-
if ($u->compare($v) >= 0) {
|
| 2634 |
-
$u = $u->subtract($v);
|
| 2635 |
-
$a = $a->subtract($c);
|
| 2636 |
-
$b = $b->subtract($d);
|
| 2637 |
-
} else {
|
| 2638 |
-
$v = $v->subtract($u);
|
| 2639 |
-
$c = $c->subtract($a);
|
| 2640 |
-
$d = $d->subtract($b);
|
| 2641 |
-
}
|
| 2642 |
-
}
|
| 2643 |
-
|
| 2644 |
-
return array(
|
| 2645 |
-
'gcd' => $this->_normalize($g->multiply($v)),
|
| 2646 |
-
'x' => $this->_normalize($c),
|
| 2647 |
-
'y' => $this->_normalize($d)
|
| 2648 |
-
);
|
| 2649 |
-
}
|
| 2650 |
-
|
| 2651 |
-
/**
|
| 2652 |
-
* Calculates the greatest common divisor
|
| 2653 |
-
*
|
| 2654 |
-
* Say you have 693 and 609. The GCD is 21.
|
| 2655 |
-
*
|
| 2656 |
-
* Here's an example:
|
| 2657 |
-
* <code>
|
| 2658 |
-
* <?php
|
| 2659 |
-
* include 'Math/BigInteger.php';
|
| 2660 |
-
*
|
| 2661 |
-
* $a = new Math_BigInteger(693);
|
| 2662 |
-
* $b = new Math_BigInteger(609);
|
| 2663 |
-
*
|
| 2664 |
-
* $gcd = a->extendedGCD($b);
|
| 2665 |
-
*
|
| 2666 |
-
* echo $gcd->toString() . "\r\n"; // outputs 21
|
| 2667 |
-
* ?>
|
| 2668 |
-
* </code>
|
| 2669 |
-
*
|
| 2670 |
-
* @param Math_BigInteger $n
|
| 2671 |
-
* @return Math_BigInteger
|
| 2672 |
-
* @access public
|
| 2673 |
-
*/
|
| 2674 |
-
function gcd($n)
|
| 2675 |
-
{
|
| 2676 |
-
extract($this->extendedGCD($n));
|
| 2677 |
-
return $gcd;
|
| 2678 |
-
}
|
| 2679 |
-
|
| 2680 |
-
/**
|
| 2681 |
-
* Absolute value.
|
| 2682 |
-
*
|
| 2683 |
-
* @return Math_BigInteger
|
| 2684 |
-
* @access public
|
| 2685 |
-
*/
|
| 2686 |
-
function abs()
|
| 2687 |
-
{
|
| 2688 |
-
$temp = new Math_BigInteger();
|
| 2689 |
-
|
| 2690 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2691 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2692 |
-
$temp->value = gmp_abs($this->value);
|
| 2693 |
-
break;
|
| 2694 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 2695 |
-
$temp->value = (bccomp($this->value, '0', 0) < 0) ? substr($this->value, 1) : $this->value;
|
| 2696 |
-
break;
|
| 2697 |
-
default:
|
| 2698 |
-
$temp->value = $this->value;
|
| 2699 |
-
}
|
| 2700 |
-
|
| 2701 |
-
return $temp;
|
| 2702 |
-
}
|
| 2703 |
-
|
| 2704 |
-
/**
|
| 2705 |
-
* Compares two numbers.
|
| 2706 |
-
*
|
| 2707 |
-
* Although one might think !$x->compare($y) means $x != $y, it, in fact, means the opposite. The reason for this is
|
| 2708 |
-
* demonstrated thusly:
|
| 2709 |
-
*
|
| 2710 |
-
* $x > $y: $x->compare($y) > 0
|
| 2711 |
-
* $x < $y: $x->compare($y) < 0
|
| 2712 |
-
* $x == $y: $x->compare($y) == 0
|
| 2713 |
-
*
|
| 2714 |
-
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
|
| 2715 |
-
*
|
| 2716 |
-
* @param Math_BigInteger $y
|
| 2717 |
-
* @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
|
| 2718 |
-
* @access public
|
| 2719 |
-
* @see self::equals()
|
| 2720 |
-
* @internal Could return $this->subtract($x), but that's not as fast as what we do do.
|
| 2721 |
-
*/
|
| 2722 |
-
function compare($y)
|
| 2723 |
-
{
|
| 2724 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2725 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2726 |
-
return gmp_cmp($this->value, $y->value);
|
| 2727 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 2728 |
-
return bccomp($this->value, $y->value, 0);
|
| 2729 |
-
}
|
| 2730 |
-
|
| 2731 |
-
return $this->_compare($this->value, $this->is_negative, $y->value, $y->is_negative);
|
| 2732 |
-
}
|
| 2733 |
-
|
| 2734 |
-
/**
|
| 2735 |
-
* Compares two numbers.
|
| 2736 |
-
*
|
| 2737 |
-
* @param array $x_value
|
| 2738 |
-
* @param bool $x_negative
|
| 2739 |
-
* @param array $y_value
|
| 2740 |
-
* @param bool $y_negative
|
| 2741 |
-
* @return int
|
| 2742 |
-
* @see self::compare()
|
| 2743 |
-
* @access private
|
| 2744 |
-
*/
|
| 2745 |
-
function _compare($x_value, $x_negative, $y_value, $y_negative)
|
| 2746 |
-
{
|
| 2747 |
-
if ($x_negative != $y_negative) {
|
| 2748 |
-
return (!$x_negative && $y_negative) ? 1 : -1;
|
| 2749 |
-
}
|
| 2750 |
-
|
| 2751 |
-
$result = $x_negative ? -1 : 1;
|
| 2752 |
-
|
| 2753 |
-
if (count($x_value) != count($y_value)) {
|
| 2754 |
-
return (count($x_value) > count($y_value)) ? $result : -$result;
|
| 2755 |
-
}
|
| 2756 |
-
$size = max(count($x_value), count($y_value));
|
| 2757 |
-
|
| 2758 |
-
$x_value = array_pad($x_value, $size, 0);
|
| 2759 |
-
$y_value = array_pad($y_value, $size, 0);
|
| 2760 |
-
|
| 2761 |
-
for ($i = count($x_value) - 1; $i >= 0; --$i) {
|
| 2762 |
-
if ($x_value[$i] != $y_value[$i]) {
|
| 2763 |
-
return ($x_value[$i] > $y_value[$i]) ? $result : -$result;
|
| 2764 |
-
}
|
| 2765 |
-
}
|
| 2766 |
-
|
| 2767 |
-
return 0;
|
| 2768 |
-
}
|
| 2769 |
-
|
| 2770 |
-
/**
|
| 2771 |
-
* Tests the equality of two numbers.
|
| 2772 |
-
*
|
| 2773 |
-
* If you need to see if one number is greater than or less than another number, use Math_BigInteger::compare()
|
| 2774 |
-
*
|
| 2775 |
-
* @param Math_BigInteger $x
|
| 2776 |
-
* @return bool
|
| 2777 |
-
* @access public
|
| 2778 |
-
* @see self::compare()
|
| 2779 |
-
*/
|
| 2780 |
-
function equals($x)
|
| 2781 |
-
{
|
| 2782 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2783 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2784 |
-
return gmp_cmp($this->value, $x->value) == 0;
|
| 2785 |
-
default:
|
| 2786 |
-
return $this->value === $x->value && $this->is_negative == $x->is_negative;
|
| 2787 |
-
}
|
| 2788 |
-
}
|
| 2789 |
-
|
| 2790 |
-
/**
|
| 2791 |
-
* Set Precision
|
| 2792 |
-
*
|
| 2793 |
-
* Some bitwise operations give different results depending on the precision being used. Examples include left
|
| 2794 |
-
* shift, not, and rotates.
|
| 2795 |
-
*
|
| 2796 |
-
* @param int $bits
|
| 2797 |
-
* @access public
|
| 2798 |
-
*/
|
| 2799 |
-
function setPrecision($bits)
|
| 2800 |
-
{
|
| 2801 |
-
$this->precision = $bits;
|
| 2802 |
-
if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_BCMATH) {
|
| 2803 |
-
$this->bitmask = new Math_BigInteger(chr((1 << ($bits & 0x7)) - 1) . str_repeat(chr(0xFF), $bits >> 3), 256);
|
| 2804 |
-
} else {
|
| 2805 |
-
$this->bitmask = new Math_BigInteger(bcpow('2', $bits, 0));
|
| 2806 |
-
}
|
| 2807 |
-
|
| 2808 |
-
$temp = $this->_normalize($this);
|
| 2809 |
-
$this->value = $temp->value;
|
| 2810 |
-
}
|
| 2811 |
-
|
| 2812 |
-
/**
|
| 2813 |
-
* Logical And
|
| 2814 |
-
*
|
| 2815 |
-
* @param Math_BigInteger $x
|
| 2816 |
-
* @access public
|
| 2817 |
-
* @internal Implemented per a request by Lluis Pamies i Juarez <lluis _a_ pamies.cat>
|
| 2818 |
-
* @return Math_BigInteger
|
| 2819 |
-
*/
|
| 2820 |
-
function bitwise_and($x)
|
| 2821 |
-
{
|
| 2822 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2823 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2824 |
-
$temp = new Math_BigInteger();
|
| 2825 |
-
$temp->value = gmp_and($this->value, $x->value);
|
| 2826 |
-
|
| 2827 |
-
return $this->_normalize($temp);
|
| 2828 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 2829 |
-
$left = $this->toBytes();
|
| 2830 |
-
$right = $x->toBytes();
|
| 2831 |
-
|
| 2832 |
-
$length = max(strlen($left), strlen($right));
|
| 2833 |
-
|
| 2834 |
-
$left = str_pad($left, $length, chr(0), STR_PAD_LEFT);
|
| 2835 |
-
$right = str_pad($right, $length, chr(0), STR_PAD_LEFT);
|
| 2836 |
-
|
| 2837 |
-
return $this->_normalize(new Math_BigInteger($left & $right, 256));
|
| 2838 |
-
}
|
| 2839 |
-
|
| 2840 |
-
$result = $this->copy();
|
| 2841 |
-
|
| 2842 |
-
$length = min(count($x->value), count($this->value));
|
| 2843 |
-
|
| 2844 |
-
$result->value = array_slice($result->value, 0, $length);
|
| 2845 |
-
|
| 2846 |
-
for ($i = 0; $i < $length; ++$i) {
|
| 2847 |
-
$result->value[$i]&= $x->value[$i];
|
| 2848 |
-
}
|
| 2849 |
-
|
| 2850 |
-
return $this->_normalize($result);
|
| 2851 |
-
}
|
| 2852 |
-
|
| 2853 |
-
/**
|
| 2854 |
-
* Logical Or
|
| 2855 |
-
*
|
| 2856 |
-
* @param Math_BigInteger $x
|
| 2857 |
-
* @access public
|
| 2858 |
-
* @internal Implemented per a request by Lluis Pamies i Juarez <lluis _a_ pamies.cat>
|
| 2859 |
-
* @return Math_BigInteger
|
| 2860 |
-
*/
|
| 2861 |
-
function bitwise_or($x)
|
| 2862 |
-
{
|
| 2863 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2864 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2865 |
-
$temp = new Math_BigInteger();
|
| 2866 |
-
$temp->value = gmp_or($this->value, $x->value);
|
| 2867 |
-
|
| 2868 |
-
return $this->_normalize($temp);
|
| 2869 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 2870 |
-
$left = $this->toBytes();
|
| 2871 |
-
$right = $x->toBytes();
|
| 2872 |
-
|
| 2873 |
-
$length = max(strlen($left), strlen($right));
|
| 2874 |
-
|
| 2875 |
-
$left = str_pad($left, $length, chr(0), STR_PAD_LEFT);
|
| 2876 |
-
$right = str_pad($right, $length, chr(0), STR_PAD_LEFT);
|
| 2877 |
-
|
| 2878 |
-
return $this->_normalize(new Math_BigInteger($left | $right, 256));
|
| 2879 |
-
}
|
| 2880 |
-
|
| 2881 |
-
$length = max(count($this->value), count($x->value));
|
| 2882 |
-
$result = $this->copy();
|
| 2883 |
-
$result->value = array_pad($result->value, $length, 0);
|
| 2884 |
-
$x->value = array_pad($x->value, $length, 0);
|
| 2885 |
-
|
| 2886 |
-
for ($i = 0; $i < $length; ++$i) {
|
| 2887 |
-
$result->value[$i]|= $x->value[$i];
|
| 2888 |
-
}
|
| 2889 |
-
|
| 2890 |
-
return $this->_normalize($result);
|
| 2891 |
-
}
|
| 2892 |
-
|
| 2893 |
-
/**
|
| 2894 |
-
* Logical Exclusive-Or
|
| 2895 |
-
*
|
| 2896 |
-
* @param Math_BigInteger $x
|
| 2897 |
-
* @access public
|
| 2898 |
-
* @internal Implemented per a request by Lluis Pamies i Juarez <lluis _a_ pamies.cat>
|
| 2899 |
-
* @return Math_BigInteger
|
| 2900 |
-
*/
|
| 2901 |
-
function bitwise_xor($x)
|
| 2902 |
-
{
|
| 2903 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2904 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2905 |
-
$temp = new Math_BigInteger();
|
| 2906 |
-
$temp->value = gmp_xor($this->value, $x->value);
|
| 2907 |
-
|
| 2908 |
-
return $this->_normalize($temp);
|
| 2909 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 2910 |
-
$left = $this->toBytes();
|
| 2911 |
-
$right = $x->toBytes();
|
| 2912 |
-
|
| 2913 |
-
$length = max(strlen($left), strlen($right));
|
| 2914 |
-
|
| 2915 |
-
$left = str_pad($left, $length, chr(0), STR_PAD_LEFT);
|
| 2916 |
-
$right = str_pad($right, $length, chr(0), STR_PAD_LEFT);
|
| 2917 |
-
|
| 2918 |
-
return $this->_normalize(new Math_BigInteger($left ^ $right, 256));
|
| 2919 |
-
}
|
| 2920 |
-
|
| 2921 |
-
$length = max(count($this->value), count($x->value));
|
| 2922 |
-
$result = $this->copy();
|
| 2923 |
-
$result->value = array_pad($result->value, $length, 0);
|
| 2924 |
-
$x->value = array_pad($x->value, $length, 0);
|
| 2925 |
-
|
| 2926 |
-
for ($i = 0; $i < $length; ++$i) {
|
| 2927 |
-
$result->value[$i]^= $x->value[$i];
|
| 2928 |
-
}
|
| 2929 |
-
|
| 2930 |
-
return $this->_normalize($result);
|
| 2931 |
-
}
|
| 2932 |
-
|
| 2933 |
-
/**
|
| 2934 |
-
* Logical Not
|
| 2935 |
-
*
|
| 2936 |
-
* @access public
|
| 2937 |
-
* @internal Implemented per a request by Lluis Pamies i Juarez <lluis _a_ pamies.cat>
|
| 2938 |
-
* @return Math_BigInteger
|
| 2939 |
-
*/
|
| 2940 |
-
function bitwise_not()
|
| 2941 |
-
{
|
| 2942 |
-
// calculuate "not" without regard to $this->precision
|
| 2943 |
-
// (will always result in a smaller number. ie. ~1 isn't 1111 1110 - it's 0)
|
| 2944 |
-
$temp = $this->toBytes();
|
| 2945 |
-
if ($temp == '') {
|
| 2946 |
-
return '';
|
| 2947 |
-
}
|
| 2948 |
-
$pre_msb = decbin(ord($temp[0]));
|
| 2949 |
-
$temp = ~$temp;
|
| 2950 |
-
$msb = decbin(ord($temp[0]));
|
| 2951 |
-
if (strlen($msb) == 8) {
|
| 2952 |
-
$msb = substr($msb, strpos($msb, '0'));
|
| 2953 |
-
}
|
| 2954 |
-
$temp[0] = chr(bindec($msb));
|
| 2955 |
-
|
| 2956 |
-
// see if we need to add extra leading 1's
|
| 2957 |
-
$current_bits = strlen($pre_msb) + 8 * strlen($temp) - 8;
|
| 2958 |
-
$new_bits = $this->precision - $current_bits;
|
| 2959 |
-
if ($new_bits <= 0) {
|
| 2960 |
-
return $this->_normalize(new Math_BigInteger($temp, 256));
|
| 2961 |
-
}
|
| 2962 |
-
|
| 2963 |
-
// generate as many leading 1's as we need to.
|
| 2964 |
-
$leading_ones = chr((1 << ($new_bits & 0x7)) - 1) . str_repeat(chr(0xFF), $new_bits >> 3);
|
| 2965 |
-
$this->_base256_lshift($leading_ones, $current_bits);
|
| 2966 |
-
|
| 2967 |
-
$temp = str_pad($temp, strlen($leading_ones), chr(0), STR_PAD_LEFT);
|
| 2968 |
-
|
| 2969 |
-
return $this->_normalize(new Math_BigInteger($leading_ones | $temp, 256));
|
| 2970 |
-
}
|
| 2971 |
-
|
| 2972 |
-
/**
|
| 2973 |
-
* Logical Right Shift
|
| 2974 |
-
*
|
| 2975 |
-
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
|
| 2976 |
-
*
|
| 2977 |
-
* @param int $shift
|
| 2978 |
-
* @return Math_BigInteger
|
| 2979 |
-
* @access public
|
| 2980 |
-
* @internal The only version that yields any speed increases is the internal version.
|
| 2981 |
-
*/
|
| 2982 |
-
function bitwise_rightShift($shift)
|
| 2983 |
-
{
|
| 2984 |
-
$temp = new Math_BigInteger();
|
| 2985 |
-
|
| 2986 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 2987 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 2988 |
-
static $two;
|
| 2989 |
-
|
| 2990 |
-
if (!isset($two)) {
|
| 2991 |
-
$two = gmp_init('2');
|
| 2992 |
-
}
|
| 2993 |
-
|
| 2994 |
-
$temp->value = gmp_div_q($this->value, gmp_pow($two, $shift));
|
| 2995 |
-
|
| 2996 |
-
break;
|
| 2997 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 2998 |
-
$temp->value = bcdiv($this->value, bcpow('2', $shift, 0), 0);
|
| 2999 |
-
|
| 3000 |
-
break;
|
| 3001 |
-
default: // could just replace _lshift with this, but then all _lshift() calls would need to be rewritten
|
| 3002 |
-
// and I don't want to do that...
|
| 3003 |
-
$temp->value = $this->value;
|
| 3004 |
-
$temp->_rshift($shift);
|
| 3005 |
-
}
|
| 3006 |
-
|
| 3007 |
-
return $this->_normalize($temp);
|
| 3008 |
-
}
|
| 3009 |
-
|
| 3010 |
-
/**
|
| 3011 |
-
* Logical Left Shift
|
| 3012 |
-
*
|
| 3013 |
-
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
|
| 3014 |
-
*
|
| 3015 |
-
* @param int $shift
|
| 3016 |
-
* @return Math_BigInteger
|
| 3017 |
-
* @access public
|
| 3018 |
-
* @internal The only version that yields any speed increases is the internal version.
|
| 3019 |
-
*/
|
| 3020 |
-
function bitwise_leftShift($shift)
|
| 3021 |
-
{
|
| 3022 |
-
$temp = new Math_BigInteger();
|
| 3023 |
-
|
| 3024 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 3025 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 3026 |
-
static $two;
|
| 3027 |
-
|
| 3028 |
-
if (!isset($two)) {
|
| 3029 |
-
$two = gmp_init('2');
|
| 3030 |
-
}
|
| 3031 |
-
|
| 3032 |
-
$temp->value = gmp_mul($this->value, gmp_pow($two, $shift));
|
| 3033 |
-
|
| 3034 |
-
break;
|
| 3035 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 3036 |
-
$temp->value = bcmul($this->value, bcpow('2', $shift, 0), 0);
|
| 3037 |
-
|
| 3038 |
-
break;
|
| 3039 |
-
default: // could just replace _rshift with this, but then all _lshift() calls would need to be rewritten
|
| 3040 |
-
// and I don't want to do that...
|
| 3041 |
-
$temp->value = $this->value;
|
| 3042 |
-
$temp->_lshift($shift);
|
| 3043 |
-
}
|
| 3044 |
-
|
| 3045 |
-
return $this->_normalize($temp);
|
| 3046 |
-
}
|
| 3047 |
-
|
| 3048 |
-
/**
|
| 3049 |
-
* Logical Left Rotate
|
| 3050 |
-
*
|
| 3051 |
-
* Instead of the top x bits being dropped they're appended to the shifted bit string.
|
| 3052 |
-
*
|
| 3053 |
-
* @param int $shift
|
| 3054 |
-
* @return Math_BigInteger
|
| 3055 |
-
* @access public
|
| 3056 |
-
*/
|
| 3057 |
-
function bitwise_leftRotate($shift)
|
| 3058 |
-
{
|
| 3059 |
-
$bits = $this->toBytes();
|
| 3060 |
-
|
| 3061 |
-
if ($this->precision > 0) {
|
| 3062 |
-
$precision = $this->precision;
|
| 3063 |
-
if (MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_BCMATH) {
|
| 3064 |
-
$mask = $this->bitmask->subtract(new Math_BigInteger(1));
|
| 3065 |
-
$mask = $mask->toBytes();
|
| 3066 |
-
} else {
|
| 3067 |
-
$mask = $this->bitmask->toBytes();
|
| 3068 |
-
}
|
| 3069 |
-
} else {
|
| 3070 |
-
$temp = ord($bits[0]);
|
| 3071 |
-
for ($i = 0; $temp >> $i; ++$i) {
|
| 3072 |
-
}
|
| 3073 |
-
$precision = 8 * strlen($bits) - 8 + $i;
|
| 3074 |
-
$mask = chr((1 << ($precision & 0x7)) - 1) . str_repeat(chr(0xFF), $precision >> 3);
|
| 3075 |
-
}
|
| 3076 |
-
|
| 3077 |
-
if ($shift < 0) {
|
| 3078 |
-
$shift+= $precision;
|
| 3079 |
-
}
|
| 3080 |
-
$shift%= $precision;
|
| 3081 |
-
|
| 3082 |
-
if (!$shift) {
|
| 3083 |
-
return $this->copy();
|
| 3084 |
-
}
|
| 3085 |
-
|
| 3086 |
-
$left = $this->bitwise_leftShift($shift);
|
| 3087 |
-
$left = $left->bitwise_and(new Math_BigInteger($mask, 256));
|
| 3088 |
-
$right = $this->bitwise_rightShift($precision - $shift);
|
| 3089 |
-
$result = MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_BCMATH ? $left->bitwise_or($right) : $left->add($right);
|
| 3090 |
-
return $this->_normalize($result);
|
| 3091 |
-
}
|
| 3092 |
-
|
| 3093 |
-
/**
|
| 3094 |
-
* Logical Right Rotate
|
| 3095 |
-
*
|
| 3096 |
-
* Instead of the bottom x bits being dropped they're prepended to the shifted bit string.
|
| 3097 |
-
*
|
| 3098 |
-
* @param int $shift
|
| 3099 |
-
* @return Math_BigInteger
|
| 3100 |
-
* @access public
|
| 3101 |
-
*/
|
| 3102 |
-
function bitwise_rightRotate($shift)
|
| 3103 |
-
{
|
| 3104 |
-
return $this->bitwise_leftRotate(-$shift);
|
| 3105 |
-
}
|
| 3106 |
-
|
| 3107 |
-
/**
|
| 3108 |
-
* Set random number generator function
|
| 3109 |
-
*
|
| 3110 |
-
* This function is deprecated.
|
| 3111 |
-
*
|
| 3112 |
-
* @param string $generator
|
| 3113 |
-
* @access public
|
| 3114 |
-
*/
|
| 3115 |
-
function setRandomGenerator($generator)
|
| 3116 |
-
{
|
| 3117 |
-
}
|
| 3118 |
-
|
| 3119 |
-
/**
|
| 3120 |
-
* Generates a random BigInteger
|
| 3121 |
-
*
|
| 3122 |
-
* Byte length is equal to $length. Uses crypt_random if it's loaded and mt_rand if it's not.
|
| 3123 |
-
*
|
| 3124 |
-
* @param int $length
|
| 3125 |
-
* @return Math_BigInteger
|
| 3126 |
-
* @access private
|
| 3127 |
-
*/
|
| 3128 |
-
function _random_number_helper($size)
|
| 3129 |
-
{
|
| 3130 |
-
if (function_exists('crypt_random_string')) {
|
| 3131 |
-
$random = crypt_random_string($size);
|
| 3132 |
-
} else {
|
| 3133 |
-
$random = '';
|
| 3134 |
-
|
| 3135 |
-
if ($size & 1) {
|
| 3136 |
-
$random.= chr(mt_rand(0, 255));
|
| 3137 |
-
}
|
| 3138 |
-
|
| 3139 |
-
$blocks = $size >> 1;
|
| 3140 |
-
for ($i = 0; $i < $blocks; ++$i) {
|
| 3141 |
-
// mt_rand(-2147483648, 0x7FFFFFFF) always produces -2147483648 on some systems
|
| 3142 |
-
$random.= pack('n', mt_rand(0, 0xFFFF));
|
| 3143 |
-
}
|
| 3144 |
-
}
|
| 3145 |
-
|
| 3146 |
-
return new Math_BigInteger($random, 256);
|
| 3147 |
-
}
|
| 3148 |
-
|
| 3149 |
-
/**
|
| 3150 |
-
* Generate a random number
|
| 3151 |
-
*
|
| 3152 |
-
* Returns a random number between $min and $max where $min and $max
|
| 3153 |
-
* can be defined using one of the two methods:
|
| 3154 |
-
*
|
| 3155 |
-
* $min->random($max)
|
| 3156 |
-
* $max->random($min)
|
| 3157 |
-
*
|
| 3158 |
-
* @param Math_BigInteger $arg1
|
| 3159 |
-
* @param Math_BigInteger $arg2
|
| 3160 |
-
* @return Math_BigInteger
|
| 3161 |
-
* @access public
|
| 3162 |
-
* @internal The API for creating random numbers used to be $a->random($min, $max), where $a was a Math_BigInteger object.
|
| 3163 |
-
* That method is still supported for BC purposes.
|
| 3164 |
-
*/
|
| 3165 |
-
function random($arg1, $arg2 = false)
|
| 3166 |
-
{
|
| 3167 |
-
if ($arg1 === false) {
|
| 3168 |
-
return false;
|
| 3169 |
-
}
|
| 3170 |
-
|
| 3171 |
-
if ($arg2 === false) {
|
| 3172 |
-
$max = $arg1;
|
| 3173 |
-
$min = $this;
|
| 3174 |
-
} else {
|
| 3175 |
-
$min = $arg1;
|
| 3176 |
-
$max = $arg2;
|
| 3177 |
-
}
|
| 3178 |
-
|
| 3179 |
-
$compare = $max->compare($min);
|
| 3180 |
-
|
| 3181 |
-
if (!$compare) {
|
| 3182 |
-
return $this->_normalize($min);
|
| 3183 |
-
} elseif ($compare < 0) {
|
| 3184 |
-
// if $min is bigger then $max, swap $min and $max
|
| 3185 |
-
$temp = $max;
|
| 3186 |
-
$max = $min;
|
| 3187 |
-
$min = $temp;
|
| 3188 |
-
}
|
| 3189 |
-
|
| 3190 |
-
static $one;
|
| 3191 |
-
if (!isset($one)) {
|
| 3192 |
-
$one = new Math_BigInteger(1);
|
| 3193 |
-
}
|
| 3194 |
-
|
| 3195 |
-
$max = $max->subtract($min->subtract($one));
|
| 3196 |
-
$size = strlen(ltrim($max->toBytes(), chr(0)));
|
| 3197 |
-
|
| 3198 |
-
/*
|
| 3199 |
-
doing $random % $max doesn't work because some numbers will be more likely to occur than others.
|
| 3200 |
-
eg. if $max is 140 and $random's max is 255 then that'd mean both $random = 5 and $random = 145
|
| 3201 |
-
would produce 5 whereas the only value of random that could produce 139 would be 139. ie.
|
| 3202 |
-
not all numbers would be equally likely. some would be more likely than others.
|
| 3203 |
-
|
| 3204 |
-
creating a whole new random number until you find one that is within the range doesn't work
|
| 3205 |
-
because, for sufficiently small ranges, the likelihood that you'd get a number within that range
|
| 3206 |
-
would be pretty small. eg. with $random's max being 255 and if your $max being 1 the probability
|
| 3207 |
-
would be pretty high that $random would be greater than $max.
|
| 3208 |
-
|
| 3209 |
-
phpseclib works around this using the technique described here:
|
| 3210 |
-
|
| 3211 |
-
http://crypto.stackexchange.com/questions/5708/creating-a-small-number-from-a-cryptographically-secure-random-string
|
| 3212 |
-
*/
|
| 3213 |
-
$random_max = new Math_BigInteger(chr(1) . str_repeat("\0", $size), 256);
|
| 3214 |
-
$random = $this->_random_number_helper($size);
|
| 3215 |
-
|
| 3216 |
-
list($max_multiple) = $random_max->divide($max);
|
| 3217 |
-
$max_multiple = $max_multiple->multiply($max);
|
| 3218 |
-
|
| 3219 |
-
while ($random->compare($max_multiple) >= 0) {
|
| 3220 |
-
$random = $random->subtract($max_multiple);
|
| 3221 |
-
$random_max = $random_max->subtract($max_multiple);
|
| 3222 |
-
$random = $random->bitwise_leftShift(8);
|
| 3223 |
-
$random = $random->add($this->_random_number_helper(1));
|
| 3224 |
-
$random_max = $random_max->bitwise_leftShift(8);
|
| 3225 |
-
list($max_multiple) = $random_max->divide($max);
|
| 3226 |
-
$max_multiple = $max_multiple->multiply($max);
|
| 3227 |
-
}
|
| 3228 |
-
list(, $random) = $random->divide($max);
|
| 3229 |
-
|
| 3230 |
-
return $this->_normalize($random->add($min));
|
| 3231 |
-
}
|
| 3232 |
-
|
| 3233 |
-
/**
|
| 3234 |
-
* Generate a random prime number.
|
| 3235 |
-
*
|
| 3236 |
-
* If there's not a prime within the given range, false will be returned.
|
| 3237 |
-
* If more than $timeout seconds have elapsed, give up and return false.
|
| 3238 |
-
*
|
| 3239 |
-
* @param Math_BigInteger $arg1
|
| 3240 |
-
* @param Math_BigInteger $arg2
|
| 3241 |
-
* @param int $timeout
|
| 3242 |
-
* @return Math_BigInteger|false
|
| 3243 |
-
* @access public
|
| 3244 |
-
* @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=15 HAC 4.44}.
|
| 3245 |
-
*/
|
| 3246 |
-
function randomPrime($arg1, $arg2 = false, $timeout = false)
|
| 3247 |
-
{
|
| 3248 |
-
if ($arg1 === false) {
|
| 3249 |
-
return false;
|
| 3250 |
-
}
|
| 3251 |
-
|
| 3252 |
-
if ($arg2 === false) {
|
| 3253 |
-
$max = $arg1;
|
| 3254 |
-
$min = $this;
|
| 3255 |
-
} else {
|
| 3256 |
-
$min = $arg1;
|
| 3257 |
-
$max = $arg2;
|
| 3258 |
-
}
|
| 3259 |
-
|
| 3260 |
-
$compare = $max->compare($min);
|
| 3261 |
-
|
| 3262 |
-
if (!$compare) {
|
| 3263 |
-
return $min->isPrime() ? $min : false;
|
| 3264 |
-
} elseif ($compare < 0) {
|
| 3265 |
-
// if $min is bigger then $max, swap $min and $max
|
| 3266 |
-
$temp = $max;
|
| 3267 |
-
$max = $min;
|
| 3268 |
-
$min = $temp;
|
| 3269 |
-
}
|
| 3270 |
-
|
| 3271 |
-
static $one, $two;
|
| 3272 |
-
if (!isset($one)) {
|
| 3273 |
-
$one = new Math_BigInteger(1);
|
| 3274 |
-
$two = new Math_BigInteger(2);
|
| 3275 |
-
}
|
| 3276 |
-
|
| 3277 |
-
$start = time();
|
| 3278 |
-
|
| 3279 |
-
$x = $this->random($min, $max);
|
| 3280 |
-
|
| 3281 |
-
// gmp_nextprime() requires PHP 5 >= 5.2.0 per <http://php.net/gmp-nextprime>.
|
| 3282 |
-
if (MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_GMP && extension_loaded('gmp') && version_compare(PHP_VERSION, '5.2.0', '>=')) {
|
| 3283 |
-
$p = new Math_BigInteger();
|
| 3284 |
-
$p->value = gmp_nextprime($x->value);
|
| 3285 |
-
|
| 3286 |
-
if ($p->compare($max) <= 0) {
|
| 3287 |
-
return $p;
|
| 3288 |
-
}
|
| 3289 |
-
|
| 3290 |
-
if (!$min->equals($x)) {
|
| 3291 |
-
$x = $x->subtract($one);
|
| 3292 |
-
}
|
| 3293 |
-
|
| 3294 |
-
return $x->randomPrime($min, $x);
|
| 3295 |
-
}
|
| 3296 |
-
|
| 3297 |
-
if ($x->equals($two)) {
|
| 3298 |
-
return $x;
|
| 3299 |
-
}
|
| 3300 |
-
|
| 3301 |
-
$x->_make_odd();
|
| 3302 |
-
if ($x->compare($max) > 0) {
|
| 3303 |
-
// if $x > $max then $max is even and if $min == $max then no prime number exists between the specified range
|
| 3304 |
-
if ($min->equals($max)) {
|
| 3305 |
-
return false;
|
| 3306 |
-
}
|
| 3307 |
-
$x = $min->copy();
|
| 3308 |
-
$x->_make_odd();
|
| 3309 |
-
}
|
| 3310 |
-
|
| 3311 |
-
$initial_x = $x->copy();
|
| 3312 |
-
|
| 3313 |
-
while (true) {
|
| 3314 |
-
if ($timeout !== false && time() - $start > $timeout) {
|
| 3315 |
-
return false;
|
| 3316 |
-
}
|
| 3317 |
-
|
| 3318 |
-
if ($x->isPrime()) {
|
| 3319 |
-
return $x;
|
| 3320 |
-
}
|
| 3321 |
-
|
| 3322 |
-
$x = $x->add($two);
|
| 3323 |
-
|
| 3324 |
-
if ($x->compare($max) > 0) {
|
| 3325 |
-
$x = $min->copy();
|
| 3326 |
-
if ($x->equals($two)) {
|
| 3327 |
-
return $x;
|
| 3328 |
-
}
|
| 3329 |
-
$x->_make_odd();
|
| 3330 |
-
}
|
| 3331 |
-
|
| 3332 |
-
if ($x->equals($initial_x)) {
|
| 3333 |
-
return false;
|
| 3334 |
-
}
|
| 3335 |
-
}
|
| 3336 |
-
}
|
| 3337 |
-
|
| 3338 |
-
/**
|
| 3339 |
-
* Make the current number odd
|
| 3340 |
-
*
|
| 3341 |
-
* If the current number is odd it'll be unchanged. If it's even, one will be added to it.
|
| 3342 |
-
*
|
| 3343 |
-
* @see self::randomPrime()
|
| 3344 |
-
* @access private
|
| 3345 |
-
*/
|
| 3346 |
-
function _make_odd()
|
| 3347 |
-
{
|
| 3348 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 3349 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 3350 |
-
gmp_setbit($this->value, 0);
|
| 3351 |
-
break;
|
| 3352 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 3353 |
-
if ($this->value[strlen($this->value) - 1] % 2 == 0) {
|
| 3354 |
-
$this->value = bcadd($this->value, '1');
|
| 3355 |
-
}
|
| 3356 |
-
break;
|
| 3357 |
-
default:
|
| 3358 |
-
$this->value[0] |= 1;
|
| 3359 |
-
}
|
| 3360 |
-
}
|
| 3361 |
-
|
| 3362 |
-
/**
|
| 3363 |
-
* Checks a numer to see if it's prime
|
| 3364 |
-
*
|
| 3365 |
-
* Assuming the $t parameter is not set, this function has an error rate of 2**-80. The main motivation for the
|
| 3366 |
-
* $t parameter is distributability. Math_BigInteger::randomPrime() can be distributed across multiple pageloads
|
| 3367 |
-
* on a website instead of just one.
|
| 3368 |
-
*
|
| 3369 |
-
* @param Math_BigInteger $t
|
| 3370 |
-
* @return bool
|
| 3371 |
-
* @access public
|
| 3372 |
-
* @internal Uses the
|
| 3373 |
-
* {@link http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test Miller-Rabin primality test}. See
|
| 3374 |
-
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf#page=8 HAC 4.24}.
|
| 3375 |
-
*/
|
| 3376 |
-
function isPrime($t = false)
|
| 3377 |
-
{
|
| 3378 |
-
$length = strlen($this->toBytes());
|
| 3379 |
-
|
| 3380 |
-
if (!$t) {
|
| 3381 |
-
// see HAC 4.49 "Note (controlling the error probability)"
|
| 3382 |
-
// @codingStandardsIgnoreStart
|
| 3383 |
-
if ($length >= 163) { $t = 2; } // floor(1300 / 8)
|
| 3384 |
-
else if ($length >= 106) { $t = 3; } // floor( 850 / 8)
|
| 3385 |
-
else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8)
|
| 3386 |
-
else if ($length >= 68 ) { $t = 5; } // floor( 550 / 8)
|
| 3387 |
-
else if ($length >= 56 ) { $t = 6; } // floor( 450 / 8)
|
| 3388 |
-
else if ($length >= 50 ) { $t = 7; } // floor( 400 / 8)
|
| 3389 |
-
else if ($length >= 43 ) { $t = 8; } // floor( 350 / 8)
|
| 3390 |
-
else if ($length >= 37 ) { $t = 9; } // floor( 300 / 8)
|
| 3391 |
-
else if ($length >= 31 ) { $t = 12; } // floor( 250 / 8)
|
| 3392 |
-
else if ($length >= 25 ) { $t = 15; } // floor( 200 / 8)
|
| 3393 |
-
else if ($length >= 18 ) { $t = 18; } // floor( 150 / 8)
|
| 3394 |
-
else { $t = 27; }
|
| 3395 |
-
// @codingStandardsIgnoreEnd
|
| 3396 |
-
}
|
| 3397 |
-
|
| 3398 |
-
// ie. gmp_testbit($this, 0)
|
| 3399 |
-
// ie. isEven() or !isOdd()
|
| 3400 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 3401 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 3402 |
-
return gmp_prob_prime($this->value, $t) != 0;
|
| 3403 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 3404 |
-
if ($this->value === '2') {
|
| 3405 |
-
return true;
|
| 3406 |
-
}
|
| 3407 |
-
if ($this->value[strlen($this->value) - 1] % 2 == 0) {
|
| 3408 |
-
return false;
|
| 3409 |
-
}
|
| 3410 |
-
break;
|
| 3411 |
-
default:
|
| 3412 |
-
if ($this->value == array(2)) {
|
| 3413 |
-
return true;
|
| 3414 |
-
}
|
| 3415 |
-
if (~$this->value[0] & 1) {
|
| 3416 |
-
return false;
|
| 3417 |
-
}
|
| 3418 |
-
}
|
| 3419 |
-
|
| 3420 |
-
static $primes, $zero, $one, $two;
|
| 3421 |
-
|
| 3422 |
-
if (!isset($primes)) {
|
| 3423 |
-
$primes = array(
|
| 3424 |
-
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
|
| 3425 |
-
61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137,
|
| 3426 |
-
139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227,
|
| 3427 |
-
229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313,
|
| 3428 |
-
317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,
|
| 3429 |
-
421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509,
|
| 3430 |
-
521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617,
|
| 3431 |
-
619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727,
|
| 3432 |
-
733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829,
|
| 3433 |
-
839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947,
|
| 3434 |
-
953, 967, 971, 977, 983, 991, 997
|
| 3435 |
-
);
|
| 3436 |
-
|
| 3437 |
-
if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_INTERNAL) {
|
| 3438 |
-
for ($i = 0; $i < count($primes); ++$i) {
|
| 3439 |
-
$primes[$i] = new Math_BigInteger($primes[$i]);
|
| 3440 |
-
}
|
| 3441 |
-
}
|
| 3442 |
-
|
| 3443 |
-
$zero = new Math_BigInteger();
|
| 3444 |
-
$one = new Math_BigInteger(1);
|
| 3445 |
-
$two = new Math_BigInteger(2);
|
| 3446 |
-
}
|
| 3447 |
-
|
| 3448 |
-
if ($this->equals($one)) {
|
| 3449 |
-
return false;
|
| 3450 |
-
}
|
| 3451 |
-
|
| 3452 |
-
// see HAC 4.4.1 "Random search for probable primes"
|
| 3453 |
-
if (MATH_BIGINTEGER_MODE != MATH_BIGINTEGER_MODE_INTERNAL) {
|
| 3454 |
-
foreach ($primes as $prime) {
|
| 3455 |
-
list(, $r) = $this->divide($prime);
|
| 3456 |
-
if ($r->equals($zero)) {
|
| 3457 |
-
return $this->equals($prime);
|
| 3458 |
-
}
|
| 3459 |
-
}
|
| 3460 |
-
} else {
|
| 3461 |
-
$value = $this->value;
|
| 3462 |
-
foreach ($primes as $prime) {
|
| 3463 |
-
list(, $r) = $this->_divide_digit($value, $prime);
|
| 3464 |
-
if (!$r) {
|
| 3465 |
-
return count($value) == 1 && $value[0] == $prime;
|
| 3466 |
-
}
|
| 3467 |
-
}
|
| 3468 |
-
}
|
| 3469 |
-
|
| 3470 |
-
$n = $this->copy();
|
| 3471 |
-
$n_1 = $n->subtract($one);
|
| 3472 |
-
$n_2 = $n->subtract($two);
|
| 3473 |
-
|
| 3474 |
-
$r = $n_1->copy();
|
| 3475 |
-
$r_value = $r->value;
|
| 3476 |
-
// ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s));
|
| 3477 |
-
if (MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_BCMATH) {
|
| 3478 |
-
$s = 0;
|
| 3479 |
-
// if $n was 1, $r would be 0 and this would be an infinite loop, hence our $this->equals($one) check earlier
|
| 3480 |
-
while ($r->value[strlen($r->value) - 1] % 2 == 0) {
|
| 3481 |
-
$r->value = bcdiv($r->value, '2', 0);
|
| 3482 |
-
++$s;
|
| 3483 |
-
}
|
| 3484 |
-
} else {
|
| 3485 |
-
for ($i = 0, $r_length = count($r_value); $i < $r_length; ++$i) {
|
| 3486 |
-
$temp = ~$r_value[$i] & 0xFFFFFF;
|
| 3487 |
-
for ($j = 1; ($temp >> $j) & 1; ++$j) {
|
| 3488 |
-
}
|
| 3489 |
-
if ($j != 25) {
|
| 3490 |
-
break;
|
| 3491 |
-
}
|
| 3492 |
-
}
|
| 3493 |
-
$s = 26 * $i + $j - 1;
|
| 3494 |
-
$r->_rshift($s);
|
| 3495 |
-
}
|
| 3496 |
-
|
| 3497 |
-
for ($i = 0; $i < $t; ++$i) {
|
| 3498 |
-
$a = $this->random($two, $n_2);
|
| 3499 |
-
$y = $a->modPow($r, $n);
|
| 3500 |
-
|
| 3501 |
-
if (!$y->equals($one) && !$y->equals($n_1)) {
|
| 3502 |
-
for ($j = 1; $j < $s && !$y->equals($n_1); ++$j) {
|
| 3503 |
-
$y = $y->modPow($two, $n);
|
| 3504 |
-
if ($y->equals($one)) {
|
| 3505 |
-
return false;
|
| 3506 |
-
}
|
| 3507 |
-
}
|
| 3508 |
-
|
| 3509 |
-
if (!$y->equals($n_1)) {
|
| 3510 |
-
return false;
|
| 3511 |
-
}
|
| 3512 |
-
}
|
| 3513 |
-
}
|
| 3514 |
-
return true;
|
| 3515 |
-
}
|
| 3516 |
-
|
| 3517 |
-
/**
|
| 3518 |
-
* Logical Left Shift
|
| 3519 |
-
*
|
| 3520 |
-
* Shifts BigInteger's by $shift bits.
|
| 3521 |
-
*
|
| 3522 |
-
* @param int $shift
|
| 3523 |
-
* @access private
|
| 3524 |
-
*/
|
| 3525 |
-
function _lshift($shift)
|
| 3526 |
-
{
|
| 3527 |
-
if ($shift == 0) {
|
| 3528 |
-
return;
|
| 3529 |
-
}
|
| 3530 |
-
|
| 3531 |
-
$num_digits = (int) ($shift / MATH_BIGINTEGER_BASE);
|
| 3532 |
-
$shift %= MATH_BIGINTEGER_BASE;
|
| 3533 |
-
$shift = 1 << $shift;
|
| 3534 |
-
|
| 3535 |
-
$carry = 0;
|
| 3536 |
-
|
| 3537 |
-
for ($i = 0; $i < count($this->value); ++$i) {
|
| 3538 |
-
$temp = $this->value[$i] * $shift + $carry;
|
| 3539 |
-
$carry = MATH_BIGINTEGER_BASE === 26 ? intval($temp / 0x4000000) : ($temp >> 31);
|
| 3540 |
-
$this->value[$i] = (int) ($temp - $carry * MATH_BIGINTEGER_BASE_FULL);
|
| 3541 |
-
}
|
| 3542 |
-
|
| 3543 |
-
if ($carry) {
|
| 3544 |
-
$this->value[count($this->value)] = $carry;
|
| 3545 |
-
}
|
| 3546 |
-
|
| 3547 |
-
while ($num_digits--) {
|
| 3548 |
-
array_unshift($this->value, 0);
|
| 3549 |
-
}
|
| 3550 |
-
}
|
| 3551 |
-
|
| 3552 |
-
/**
|
| 3553 |
-
* Logical Right Shift
|
| 3554 |
-
*
|
| 3555 |
-
* Shifts BigInteger's by $shift bits.
|
| 3556 |
-
*
|
| 3557 |
-
* @param int $shift
|
| 3558 |
-
* @access private
|
| 3559 |
-
*/
|
| 3560 |
-
function _rshift($shift)
|
| 3561 |
-
{
|
| 3562 |
-
if ($shift == 0) {
|
| 3563 |
-
return;
|
| 3564 |
-
}
|
| 3565 |
-
|
| 3566 |
-
$num_digits = (int) ($shift / MATH_BIGINTEGER_BASE);
|
| 3567 |
-
$shift %= MATH_BIGINTEGER_BASE;
|
| 3568 |
-
$carry_shift = MATH_BIGINTEGER_BASE - $shift;
|
| 3569 |
-
$carry_mask = (1 << $shift) - 1;
|
| 3570 |
-
|
| 3571 |
-
if ($num_digits) {
|
| 3572 |
-
$this->value = array_slice($this->value, $num_digits);
|
| 3573 |
-
}
|
| 3574 |
-
|
| 3575 |
-
$carry = 0;
|
| 3576 |
-
|
| 3577 |
-
for ($i = count($this->value) - 1; $i >= 0; --$i) {
|
| 3578 |
-
$temp = $this->value[$i] >> $shift | $carry;
|
| 3579 |
-
$carry = ($this->value[$i] & $carry_mask) << $carry_shift;
|
| 3580 |
-
$this->value[$i] = $temp;
|
| 3581 |
-
}
|
| 3582 |
-
|
| 3583 |
-
$this->value = $this->_trim($this->value);
|
| 3584 |
-
}
|
| 3585 |
-
|
| 3586 |
-
/**
|
| 3587 |
-
* Normalize
|
| 3588 |
-
*
|
| 3589 |
-
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
|
| 3590 |
-
*
|
| 3591 |
-
* @param Math_BigInteger
|
| 3592 |
-
* @return Math_BigInteger
|
| 3593 |
-
* @see self::_trim()
|
| 3594 |
-
* @access private
|
| 3595 |
-
*/
|
| 3596 |
-
function _normalize($result)
|
| 3597 |
-
{
|
| 3598 |
-
$result->precision = $this->precision;
|
| 3599 |
-
$result->bitmask = $this->bitmask;
|
| 3600 |
-
|
| 3601 |
-
switch (MATH_BIGINTEGER_MODE) {
|
| 3602 |
-
case MATH_BIGINTEGER_MODE_GMP:
|
| 3603 |
-
if ($this->bitmask !== false) {
|
| 3604 |
-
$result->value = gmp_and($result->value, $result->bitmask->value);
|
| 3605 |
-
}
|
| 3606 |
-
|
| 3607 |
-
return $result;
|
| 3608 |
-
case MATH_BIGINTEGER_MODE_BCMATH:
|
| 3609 |
-
if (!empty($result->bitmask->value)) {
|
| 3610 |
-
$result->value = bcmod($result->value, $result->bitmask->value);
|
| 3611 |
-
}
|
| 3612 |
-
|
| 3613 |
-
return $result;
|
| 3614 |
-
}
|
| 3615 |
-
|
| 3616 |
-
$value = &$result->value;
|
| 3617 |
-
|
| 3618 |
-
if (!count($value)) {
|
| 3619 |
-
return $result;
|
| 3620 |
-
}
|
| 3621 |
-
|
| 3622 |
-
$value = $this->_trim($value);
|
| 3623 |
-
|
| 3624 |
-
if (!empty($result->bitmask->value)) {
|
| 3625 |
-
$length = min(count($value), count($this->bitmask->value));
|
| 3626 |
-
$value = array_slice($value, 0, $length);
|
| 3627 |
-
|
| 3628 |
-
for ($i = 0; $i < $length; ++$i) {
|
| 3629 |
-
$value[$i] = $value[$i] & $this->bitmask->value[$i];
|
| 3630 |
-
}
|
| 3631 |
-
}
|
| 3632 |
-
|
| 3633 |
-
return $result;
|
| 3634 |
-
}
|
| 3635 |
-
|
| 3636 |
-
/**
|
| 3637 |
-
* Trim
|
| 3638 |
-
*
|
| 3639 |
-
* Removes leading zeros
|
| 3640 |
-
*
|
| 3641 |
-
* @param array $value
|
| 3642 |
-
* @return Math_BigInteger
|
| 3643 |
-
* @access private
|
| 3644 |
-
*/
|
| 3645 |
-
function _trim($value)
|
| 3646 |
-
{
|
| 3647 |
-
for ($i = count($value) - 1; $i >= 0; --$i) {
|
| 3648 |
-
if ($value[$i]) {
|
| 3649 |
-
break;
|
| 3650 |
-
}
|
| 3651 |
-
unset($value[$i]);
|
| 3652 |
-
}
|
| 3653 |
-
|
| 3654 |
-
return $value;
|
| 3655 |
-
}
|
| 3656 |
-
|
| 3657 |
-
/**
|
| 3658 |
-
* Array Repeat
|
| 3659 |
-
*
|
| 3660 |
-
* @param $input Array
|
| 3661 |
-
* @param $multiplier mixed
|
| 3662 |
-
* @return array
|
| 3663 |
-
* @access private
|
| 3664 |
-
*/
|
| 3665 |
-
function _array_repeat($input, $multiplier)
|
| 3666 |
-
{
|
| 3667 |
-
return ($multiplier) ? array_fill(0, $multiplier, $input) : array();
|
| 3668 |
-
}
|
| 3669 |
-
|
| 3670 |
-
/**
|
| 3671 |
-
* Logical Left Shift
|
| 3672 |
-
*
|
| 3673 |
-
* Shifts binary strings $shift bits, essentially multiplying by 2**$shift.
|
| 3674 |
-
*
|
| 3675 |
-
* @param $x String
|
| 3676 |
-
* @param $shift Integer
|
| 3677 |
-
* @return string
|
| 3678 |
-
* @access private
|
| 3679 |
-
*/
|
| 3680 |
-
function _base256_lshift(&$x, $shift)
|
| 3681 |
-
{
|
| 3682 |
-
if ($shift == 0) {
|
| 3683 |
-
return;
|
| 3684 |
-
}
|
| 3685 |
-
|
| 3686 |
-
$num_bytes = $shift >> 3; // eg. floor($shift/8)
|
| 3687 |
-
$shift &= 7; // eg. $shift % 8
|
| 3688 |
-
|
| 3689 |
-
$carry = 0;
|
| 3690 |
-
for ($i = strlen($x) - 1; $i >= 0; --$i) {
|
| 3691 |
-
$temp = ord($x[$i]) << $shift | $carry;
|
| 3692 |
-
$x[$i] = chr($temp);
|
| 3693 |
-
$carry = $temp >> 8;
|
| 3694 |
-
}
|
| 3695 |
-
$carry = ($carry != 0) ? chr($carry) : '';
|
| 3696 |
-
$x = $carry . $x . str_repeat(chr(0), $num_bytes);
|
| 3697 |
-
}
|
| 3698 |
-
|
| 3699 |
-
/**
|
| 3700 |
-
* Logical Right Shift
|
| 3701 |
-
*
|
| 3702 |
-
* Shifts binary strings $shift bits, essentially dividing by 2**$shift and returning the remainder.
|
| 3703 |
-
*
|
| 3704 |
-
* @param $x String
|
| 3705 |
-
* @param $shift Integer
|
| 3706 |
-
* @return string
|
| 3707 |
-
* @access private
|
| 3708 |
-
*/
|
| 3709 |
-
function _base256_rshift(&$x, $shift)
|
| 3710 |
-
{
|
| 3711 |
-
if ($shift == 0) {
|
| 3712 |
-
$x = ltrim($x, chr(0));
|
| 3713 |
-
return '';
|
| 3714 |
-
}
|
| 3715 |
-
|
| 3716 |
-
$num_bytes = $shift >> 3; // eg. floor($shift/8)
|
| 3717 |
-
$shift &= 7; // eg. $shift % 8
|
| 3718 |
-
|
| 3719 |
-
$remainder = '';
|
| 3720 |
-
if ($num_bytes) {
|
| 3721 |
-
$start = $num_bytes > strlen($x) ? -strlen($x) : -$num_bytes;
|
| 3722 |
-
$remainder = substr($x, $start);
|
| 3723 |
-
$x = substr($x, 0, -$num_bytes);
|
| 3724 |
-
}
|
| 3725 |
-
|
| 3726 |
-
$carry = 0;
|
| 3727 |
-
$carry_shift = 8 - $shift;
|
| 3728 |
-
for ($i = 0; $i < strlen($x); ++$i) {
|
| 3729 |
-
$temp = (ord($x[$i]) >> $shift) | $carry;
|
| 3730 |
-
$carry = (ord($x[$i]) << $carry_shift) & 0xFF;
|
| 3731 |
-
$x[$i] = chr($temp);
|
| 3732 |
-
}
|
| 3733 |
-
$x = ltrim($x, chr(0));
|
| 3734 |
-
|
| 3735 |
-
$remainder = chr($carry >> $carry_shift) . $remainder;
|
| 3736 |
-
|
| 3737 |
-
return ltrim($remainder, chr(0));
|
| 3738 |
-
}
|
| 3739 |
-
|
| 3740 |
-
// one quirk about how the following functions are implemented is that PHP defines N to be an unsigned long
|
| 3741 |
-
// at 32-bits, while java's longs are 64-bits.
|
| 3742 |
-
|
| 3743 |
-
/**
|
| 3744 |
-
* Converts 32-bit integers to bytes.
|
| 3745 |
-
*
|
| 3746 |
-
* @param int $x
|
| 3747 |
-
* @return string
|
| 3748 |
-
* @access private
|
| 3749 |
-
*/
|
| 3750 |
-
function _int2bytes($x)
|
| 3751 |
-
{
|
| 3752 |
-
return ltrim(pack('N', $x), chr(0));
|
| 3753 |
-
}
|
| 3754 |
-
|
| 3755 |
-
/**
|
| 3756 |
-
* Converts bytes to 32-bit integers
|
| 3757 |
-
*
|
| 3758 |
-
* @param string $x
|
| 3759 |
-
* @return int
|
| 3760 |
-
* @access private
|
| 3761 |
-
*/
|
| 3762 |
-
function _bytes2int($x)
|
| 3763 |
-
{
|
| 3764 |
-
$temp = unpack('Nint', str_pad($x, 4, chr(0), STR_PAD_LEFT));
|
| 3765 |
-
return $temp['int'];
|
| 3766 |
-
}
|
| 3767 |
-
|
| 3768 |
-
/**
|
| 3769 |
-
* DER-encode an integer
|
| 3770 |
-
*
|
| 3771 |
-
* The ability to DER-encode integers is needed to create RSA public keys for use with OpenSSL
|
| 3772 |
-
*
|
| 3773 |
-
* @see self::modPow()
|
| 3774 |
-
* @access private
|
| 3775 |
-
* @param int $length
|
| 3776 |
-
* @return string
|
| 3777 |
-
*/
|
| 3778 |
-
function _encodeASN1Length($length)
|
| 3779 |
-
{
|
| 3780 |
-
if ($length <= 0x7F) {
|
| 3781 |
-
return chr($length);
|
| 3782 |
-
}
|
| 3783 |
-
|
| 3784 |
-
$temp = ltrim(pack('N', $length), chr(0));
|
| 3785 |
-
return pack('Ca*', 0x80 | strlen($temp), $temp);
|
| 3786 |
-
}
|
| 3787 |
-
|
| 3788 |
-
/**
|
| 3789 |
-
* Single digit division
|
| 3790 |
-
*
|
| 3791 |
-
* Even if int64 is being used the division operator will return a float64 value
|
| 3792 |
-
* if the dividend is not evenly divisible by the divisor. Since a float64 doesn't
|
| 3793 |
-
* have the precision of int64 this is a problem so, when int64 is being used,
|
| 3794 |
-
* we'll guarantee that the dividend is divisible by first subtracting the remainder.
|
| 3795 |
-
*
|
| 3796 |
-
* @access private
|
| 3797 |
-
* @param int $x
|
| 3798 |
-
* @param int $y
|
| 3799 |
-
* @return int
|
| 3800 |
-
*/
|
| 3801 |
-
function _safe_divide($x, $y)
|
| 3802 |
-
{
|
| 3803 |
-
if (MATH_BIGINTEGER_BASE === 26) {
|
| 3804 |
-
return (int) ($x / $y);
|
| 3805 |
-
}
|
| 3806 |
-
|
| 3807 |
-
// MATH_BIGINTEGER_BASE === 31
|
| 3808 |
-
return ($x - ($x % $y)) / $y;
|
| 3809 |
-
}
|
| 3810 |
-
}
|
| 3811 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/vendor/servmask/archiver/class-ai1wm-archiver.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/archiver/class-ai1wm-compressor.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/archiver/class-ai1wm-extractor.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/command/class-ai1wm-wp-cli-command.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/cron/class-ai1wm-cron.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/database/class-ai1wm-database-mysql.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/database/class-ai1wm-database-mysqli.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/database/class-ai1wm-database-utility.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/database/class-ai1wm-database.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/filesystem/class-ai1wm-directory.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/filesystem/class-ai1wm-file-htaccess.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/filesystem/class-ai1wm-file-index.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/filesystem/class-ai1wm-file-webconfig.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/filesystem/class-ai1wm-file.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/filter/class-ai1wm-recursive-exclude-filter.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/filter/class-ai1wm-recursive-extension-filter.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/iterator/class-ai1wm-recursive-directory-iterator.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/vendor/servmask/iterator/class-ai1wm-recursive-iterator-iterator.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/assets/css/export.min.css
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
@charset "UTF-8";@-webkit-keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}to{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}to{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@-webkit-keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@-webkit-keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}.ai1wm-accordion{margin:1em 0;display:block}.ai1wm-accordion h4{cursor:pointer;color:rgba(0,116,162,.8);margin:0}.ai1wm-accordion h4 small{color:#444;font-weight:400}.ai1wm-accordion h4 small:after,.ai1wm-container .ai1wm-row label:after{content:"\200E"}.ai1wm-accordion .ai1wm-icon-arrow-right{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out;display:inline-block}.ai1wm-accordion ul{margin:0;padding:0;list-style:none;visibility:hidden;height:0;transition:height .2s cubic-bezier(.19,1,.22,1)}.ai1wm-accordion h4 small,.ai1wm-accordion ul li small{display:inline;float:none;width:auto}.ai1wm-accordion.ai1wm-open h4 .ai1wm-icon-arrow-right{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ai1wm-accordion.ai1wm-open ul{height:auto;margin:.6em 0 0 2em;visibility:visible}.ai1wm-button-group{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;text-transform:uppercase;font-weight:600;transition:background-color .2s ease-out;display:inline-block;text-align:left}.ai1wm-button-group.ai1wm-button-export,.ai1wm-button-group.ai1wm-button-import{box-sizing:content-box}.ai1wm-button-group.ai1wm-button-export.ai1wm-open>.ai1wm-dropdown-menu{height:448px;border-top:1px solid #27ae60}.ai1wm-button-group.ai1wm-button-import.ai1wm-open>.ai1wm-dropdown-menu{height:476px;border-top:1px solid #27ae60}.ai1wm-button-group .ai1wm-button-main{position:relative;padding:6px 50px 6px 25px;box-sizing:content-box}.ai1wm-button-group .ai1wm-dropdown-menu{height:0;overflow:hidden;transition:height .2s cubic-bezier(.19,1,.22,1);border-top:none}.ai1wm-dropdown-menu{list-style:none}.ai1wm-dropdown-menu,.ai1wm-dropdown-menu li{margin:0!important;padding:0}.ai1wm-dropdown-menu li a,.ai1wm-dropdown-menu li a:visited{display:block;padding:5px 26px;text-decoration:none;color:#27ae60;text-align:left;box-sizing:content-box}.ai1wm-dropdown-menu li a:hover,.ai1wm-dropdown-menu li a:visited:hover{text-decoration:none;color:#111}.ai1mw-lines{position:absolute;width:12px;height:10px;top:9px;right:20px}.ai1wm-line{position:absolute;width:100%;height:2px;margin:auto;background:#27ae60;transition:all .2s ease-in-out}.ai1wm-line-first{top:0;left:0}div.ai1wm-open .ai1wm-line-first,div.ai1wm-open .ai1wm-line-third{top:50%}.ai1wm-line-second{top:50%;left:0}.ai1wm-line-third{top:100%;left:0}.ai1wm-button-blue,.ai1wm-button-gray,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{display:inline-block;border:2px solid #95a5a6;background-color:transparent;color:#95a5a6;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-gray:hover{background-color:#95a5a6;color:#fff}.ai1wm-button-blue,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #27ae60;color:#27ae60}.ai1wm-button-green:hover{background-color:#27ae60;color:#fff}.ai1wm-button-blue,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #6eb649;color:#6eb649}.ai1wm-button-green-small:hover{background-color:#6eb649;color:#fff}.ai1wm-button-blue,.ai1wm-button-red{border:2px solid #00aff0;color:#00aff0}.ai1wm-button-blue:hover{background-color:#00aff0;color:#fff}.ai1wm-button-red{border:2px solid #e74c3c;color:#e74c3c}.ai1wm-button-red:hover{background-color:#e74c3c;color:#fff}.ai1wm-button-blue[disabled=disabled],.ai1wm-button-green-small[disabled=disabled],.ai1wm-button-green[disabled=disabled],.ai1wm-button-red[disabled=disabled]{opacity:.6;cursor:default}.ai1wm-button-blue[disabled=disabled]:hover{color:#00aff0}.ai1wm-button-red[disabled=disabled]:hover{color:#e74c3c}.ai1wm-button-green[disabled=disabled]:hover{color:#27ae60}.ai1wm-button-blue[disabled=disabled]:hover,.ai1wm-button-green-small[disabled=disabled]:hover,.ai1wm-button-green[disabled=disabled]:hover,.ai1wm-button-red[disabled=disabled]:hover{background:0 0}.ai1wm-message-close-button{position:absolute;right:10px;top:6px;text-decoration:none;font-size:10px}input[type=radio].ai1wm-flat-radio-button{display:none}input[type=radio].ai1wm-flat-radio-button+a i,input[type=radio].ai1wm-flat-radio-button+label i{vertical-align:middle;float:left;width:25px;height:25px;border-radius:50%;background:0 0;border:2px solid #ccc;content:" ";cursor:pointer;position:relative;box-sizing:content-box}input[type=radio].ai1wm-flat-radio-button:checked+a i,input[type=radio].ai1wm-flat-radio-button:checked+label i{background-color:#d9d9d9;border-color:#6f6f6f}.ai1wm-clear{*zoom:1;clear:both}.ai1wm-clear:after,.ai1wm-clear:before{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-container .ai1wm-row label{position:relative;top:-1px}.ai1wm-share-button-container{text-align:center}.ai1wm-share-button-container .ai1wm-share-button{text-decoration:none;margin:10px;font-size:30px}.ai1wm-report-problem{position:relative;float:right}.ai1wm-report-problem-dialog{position:absolute;z-index:999;width:280px;right:0;background-color:#fff;margin:6px 0 0;padding:15px 15px 10px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;display:none}.ai1wm-report-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-report-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-feedback-cancel:active,.ai1wm-feedback-cancel:link,.ai1wm-feedback-cancel:visited,.ai1wm-report-cancel:active,.ai1wm-report-cancel:link,.ai1wm-report-cancel:visited{float:left;line-height:34px;outline:0;text-decoration:none;color:#e74c3c}.ai1wm-form-submit{float:right}.ai1wm-report-active{display:block}.ai1wm-report-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-report-terms-segment>.ai1wm-report-terms{border-radius:3px}.ai1wm-import-info a,.ai1wm-no-underline{text-decoration:none}.ai1wm-top-negative-four{top:-4px}.ai1wm-feedback-form{display:none}.ai1wm-feedback-types{margin:0;padding:0;list-style:none}.ai1wm-feedback-types li{margin:14px 0;padding:0}.ai1wm-feedback-types>li>a>span,.ai1wm-feedback-types>li>label>span{display:inline-block;padding:5px 0 6px 8px}.ai1wm-feedback-types>li>a{height:29px;outline:0;color:#333;text-deciration:none}.ai1wm-loader{display:inline-block;width:128px;height:128px;position:relative;-webkit-animation:ai1wm-rotate 1.5s infinite linear;animation:ai1wm-rotate 1.5s infinite linear;background:url(../img/logo-128x128.png);background-repeat:no-repeat;background-position:center center}.ai1wm-hide{display:none}.ai1wm-label{border:1px solid #5cb85c;background-color:transparent;color:#5cb85c;cursor:pointer;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;padding:.2em .6em;font-size:.8em;border-radius:5px}.ai1wm-label:hover{background-color:#5cb85c;color:#fff}.ai1wm-dialog-message{text-align:left;line-height:1.5em}.ai1wm-import-info{display:inline-block;font-size:12px;font-weight:700;margin-top:16px}[class*=" ai1wm-icon-"],[class^=ai1wm-icon-]{font-family:'servmask';speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-file-zip:before{content:"\e60f"}.ai1wm-icon-folder:before{content:"\e60e"}.ai1wm-icon-file:before{content:"\e60b"}.ai1wm-icon-file-content:before{content:"\e60c"}.ai1wm-icon-cloud-upload:before{content:"\e600"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-notification:before{content:"\e619"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-close:before{content:"\e61a"}.ai1wm-icon-wordpress2:before{content:"\e620"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-plus2:before{content:"\e607"}.ai1wm-icon-export:before{content:"\e601"}.ai1wm-icon-publish:before{content:"\e602"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-chevron-right:before{content:"\e60d"}.ai1wm-icon-dropbox:before{content:"\e606"}.ai1wm-icon-gear:before{content:"\e60a"}.ai1wm-icon-database:before{content:"\e964"}.ai1wm-icon-upload2:before{content:"\e9c6"}.ai1wm-icon-checkmark:before{content:"\ea10"}.ai1wm-icon-checkmark2:before{content:"\ea11"}.ai1wm-icon-enter:before{content:"\ea13"}.ai1wm-icon-exit:before{content:"\ea14"}.ai1wm-icon-amazon:before{content:"\ea87"}.ai1wm-icon-onedrive:before{content:"\eaaf"}@media (min-width:855px){.ai1wm-row{margin-right:399px}.ai1wm-row:after,.ai1wm-row:before{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:left;width:100%}.ai1wm-right{float:right;width:377px;margin-right:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;background-color:#f9f9f9;padding:20px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-right .ai1wm-segment h2{margin:22px 0 0;padding:0;font-weight:700;font-size:14px;text-transform:uppercase;text-align:center}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-holder{position:relative;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-holder h1{float:left;font-weight:300;font-size:22px;text-transform:uppercase}.ai1wm-holder h1 i{position:relative;top:2px}@media (max-width:854px){.ai1wm-container{margin-left:10px!important}.ai1wm-right,.ai1wm-row{margin-right:0!important}.ai1wm-right{float:left!important;width:100%!important;margin-top:18px}.ai1wm-right .ai1wm-sidebar{width:auto!important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px;border-radius:3px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-container{margin:20px 20px 0 2px}.ai1wm-container:after,.ai1wm-container:before{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 white;border-radius:3px;color:#333;font-size:11px;font-weight:700;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box;margin-bottom:10px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type=text],.ai1wm-field textarea,.ai1wm-query div input{width:100%;font-weight:400}.ai1wm-field-set{margin-top:18px}.ai1wm-message{-moz-box-sizing:border-box;background-color:#efefef;border-radius:4px;color:rgba(0,0,0,.6);height:auto;margin:10px 0;min-height:18px;padding:6px 10px;position:relative;border:1px solid;transition:opacity .1s ease 0s,color .1s ease 0s,background .1s ease 0s,box-shadow .1s ease 0s}.ai1wm-message.ai1wm-success-message{background-color:#f2f8f0;color:#119000;font-size:12px}.ai1wm-message.ai1wm-info-message{background-color:#d9edf7;color:#31708f;font-size:11px}.ai1wm-message.ai1wm-error-message{background-color:#f1d7d7;color:#a95252;font-size:12px}.ai1wm-message.ai1wm-red-message{color:#d95c5c;border:2px solid #d95c5c;background-color:transparent}.ai1wm-message.ai1wm-red-message h3{margin:.4em 0;color:#d95c5c}.ai1wm-message p{margin:4px 0;font-size:12px}.ai1wm-message-warning{display:block;font-size:14px;line-height:18px;padding:12px 20px;margin:0 0 22px;background-color:#f9f9f9;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;border-left:4px solid #ffba00}.ai1wm-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);z-index:100001}.ai1wm-modal-container{position:fixed;display:none;top:50%;left:50%;z-index:100002;width:480px;height:auto;padding:16px;-webkit-transform:translate(-240px,-94px);transform:translate(-240px,-94px);border:1px solid #fff;box-shadow:0 2px 6px #292929;border-radius:6px;background:#f6f6f6;box-sizing:border-box;text-align:center}.ai1wm-modal-container section{display:block;min-height:102px}.ai1wm-holder h1,.ai1wm-modal-container section h1{margin:0;padding:0}.ai1wm-modal-container section h1 .ai1wm-title-green{color:#27ae60;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-red{color:#e74c3c;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-grey{color:gray;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-loader{width:32px;height:32px;background:url(../img/logo-32x32.png)}.ai1wm-modal-container section h1 .ai1wm-icon-notification{font-size:1.2em;color:#e74c3c}.ai1wm-modal-container section p{margin:0;padding:12px 0}.ai1wm-modal-container section p .ai1wm-modal-sites p{padding:4px 10px;text-align:left}.ai1wm-modal-container section p .ai1wm-modal-sites input,.ai1wm-modal-container section p .ai1wm-modal-sites select{padding:0 6px;width:100%;border-radius:3px;height:30px;line-height:30px}.ai1wm-modal-container section p .ai1wm-modal-subtitle-green{color:#27ae60}.ai1wm-modal-container section p .ai1wm-modal-subtitle-red{color:#e74c3c}.ai1wm-modal-container section p .ai1wm-modal-subdescription{display:block;text-align:left}.ai1wm-modal-container section p a.ai1wm-button-green{display:inline-block;position:relative;top:26px}.ai1wm-modal-container section p a.ai1wm-emphasize{-webkit-animation:ai1wm-emphasize 1s infinite;animation:ai1wm-emphasize 1s infinite}.ai1wm-modal-container section p em{display:block;color:#34495e;font-style:normal}.ai1wm-modal-container section p.ai1wm-import-modal-content{text-align:left}.ai1wm-modal-container .ai1wm-import-modal-actions{border-top:1px solid #ccc;padding-top:1em;text-align:right}.ai1wm-modal-container .ai1wm-import-modal-actions .ai1wm-button-gray{margin-right:1em}.ai1wm-modal-container .ai1wm-import-modal-notice{border-top:1px solid #ccc}.ai1wm-modal-container .ai1wm-import-modal-notice p{font-weight:700;margin:0;padding-top:16px;text-align:center}.ai1wm-query-arrow{position:relative;top:4px;float:right}.ai1wm-query.ai1wm-open{background:#ebebeb!important}.ai1wm-query.ai1wm-open p small{border-bottom:1px dashed #000}.ai1wm-query.ai1wm-open div{visibility:visible!important;height:5rem!important;margin-top:8px}.ai1wm-query.ai1wm-open .ai1wm-query-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ai1wm-query{width:100%;margin:0 0 10px;list-style:none;background:0 0;border:1px solid #d8d8d8;padding:10px;border-radius:5px;box-sizing:border-box}.ai1wm-query div{transition:height .2s cubic-bezier(.19,1,.22,1);visibility:hidden;height:0}.ai1wm-query div input{font-size:.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#333;transition:.05s border-color ease-in-out;border-radius:5px}.ai1wm-query div input:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.ai1wm-query p{margin:0;cursor:pointer}.ai1wm-query p small{display:inline;width:auto;float:none}.ai1wm-query-arrow{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out}#ai1wm-queries{padding:0}
|
| 1 |
+
@charset "UTF-8";@-webkit-keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}to{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(-90deg);transform:rotateZ(-90deg)}50%{-webkit-transform:rotateZ(-180deg);transform:rotateZ(-180deg)}75%{-webkit-transform:rotateZ(-270deg);transform:rotateZ(-270deg)}to{-webkit-transform:rotateZ(-360deg);transform:rotateZ(-360deg)}}@-webkit-keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@-webkit-keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}.ai1wm-accordion{margin:1em 0;display:block}.ai1wm-accordion h4{cursor:pointer;color:rgba(0,116,162,.8);margin:0}.ai1wm-accordion h4 small{color:#444;font-weight:400}.ai1wm-accordion h4 small:after,.ai1wm-container .ai1wm-row label:after{content:"\200E"}.ai1wm-accordion .ai1wm-icon-arrow-right{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out;display:inline-block}.ai1wm-accordion ul{margin:0;padding:0;list-style:none;visibility:hidden;height:0;transition:height .2s cubic-bezier(.19,1,.22,1)}.ai1wm-accordion h4 small,.ai1wm-accordion ul li small{display:inline;float:none;width:auto}.ai1wm-accordion.ai1wm-open h4 .ai1wm-icon-arrow-right{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ai1wm-accordion.ai1wm-open ul{height:auto;margin:.6em 0 0 2em;visibility:visible}.ai1wm-button-group{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;text-transform:uppercase;font-weight:600;transition:background-color .2s ease-out;display:inline-block;text-align:left}.ai1wm-button-group.ai1wm-button-export,.ai1wm-button-group.ai1wm-button-import{box-sizing:content-box}.ai1wm-button-group.ai1wm-button-export.ai1wm-open>.ai1wm-dropdown-menu{height:448px;border-top:1px solid #27ae60}.ai1wm-button-group.ai1wm-button-import.ai1wm-open>.ai1wm-dropdown-menu{height:476px;border-top:1px solid #27ae60}.ai1wm-button-group .ai1wm-button-main{position:relative;padding:6px 50px 6px 25px;box-sizing:content-box}.ai1wm-button-group .ai1wm-dropdown-menu{height:0;overflow:hidden;transition:height .2s cubic-bezier(.19,1,.22,1);border-top:none}.ai1wm-dropdown-menu{list-style:none}.ai1wm-dropdown-menu,.ai1wm-dropdown-menu li{margin:0!important;padding:0}.ai1wm-dropdown-menu li a,.ai1wm-dropdown-menu li a:visited{display:block;padding:5px 26px;text-decoration:none;color:#27ae60;text-align:left;box-sizing:content-box}.ai1wm-dropdown-menu li a:hover,.ai1wm-dropdown-menu li a:visited:hover{text-decoration:none;color:#111}.ai1mw-lines{position:absolute;width:12px;height:10px;top:9px;right:20px}.ai1wm-line{position:absolute;width:100%;height:2px;margin:auto;background:#27ae60;transition:all .2s ease-in-out}.ai1wm-line-first{top:0;left:0}div.ai1wm-open .ai1wm-line-first,div.ai1wm-open .ai1wm-line-third{top:50%}.ai1wm-line-second{top:50%;left:0}.ai1wm-line-third{top:100%;left:0}.ai1wm-button-blue,.ai1wm-button-gray,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{display:inline-block;border:2px solid #95a5a6;background-color:transparent;color:#95a5a6;border-radius:5px;cursor:pointer;padding:5px 25px 5px 26px;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-gray:hover{background-color:#95a5a6;color:#fff}.ai1wm-button-blue,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #27ae60;color:#27ae60}.ai1wm-button-green:hover{background-color:#27ae60;color:#fff}.ai1wm-button-blue,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #6eb649;color:#6eb649}.ai1wm-button-green-small:hover{background-color:#6eb649;color:#fff}.ai1wm-button-blue,.ai1wm-button-red{border:2px solid #00aff0;color:#00aff0}.ai1wm-button-blue:hover{background-color:#00aff0;color:#fff}.ai1wm-button-red{border:2px solid #e74c3c;color:#e74c3c}.ai1wm-button-red:hover{background-color:#e74c3c;color:#fff}.ai1wm-button-blue[disabled=disabled],.ai1wm-button-green-small[disabled=disabled],.ai1wm-button-green[disabled=disabled],.ai1wm-button-red[disabled=disabled]{opacity:.6;cursor:default}.ai1wm-button-blue[disabled=disabled]:hover{color:#00aff0}.ai1wm-button-red[disabled=disabled]:hover{color:#e74c3c}.ai1wm-button-green[disabled=disabled]:hover{color:#27ae60}.ai1wm-button-blue[disabled=disabled]:hover,.ai1wm-button-green-small[disabled=disabled]:hover,.ai1wm-button-green[disabled=disabled]:hover,.ai1wm-button-red[disabled=disabled]:hover{background:0 0}.ai1wm-message-close-button{position:absolute;right:10px;top:6px;text-decoration:none;font-size:10px}input[type=radio].ai1wm-flat-radio-button{display:none}input[type=radio].ai1wm-flat-radio-button+a i,input[type=radio].ai1wm-flat-radio-button+label i{vertical-align:middle;float:left;width:25px;height:25px;border-radius:50%;background:0 0;border:2px solid #ccc;content:" ";cursor:pointer;position:relative;box-sizing:content-box}input[type=radio].ai1wm-flat-radio-button:checked+a i,input[type=radio].ai1wm-flat-radio-button:checked+label i{background-color:#d9d9d9;border-color:#6f6f6f}.ai1wm-clear{*zoom:1;clear:both}.ai1wm-clear:after,.ai1wm-clear:before{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-container .ai1wm-row label{position:relative;top:-1px}.ai1wm-share-button-container{text-align:center}.ai1wm-share-button-container .ai1wm-share-button{text-decoration:none;margin:10px;font-size:30px}.ai1wm-report-problem{position:relative;float:right}.ai1wm-report-problem-dialog{position:absolute;z-index:999;width:280px;right:0;background-color:#fff;margin:6px 0 0;padding:15px 15px 10px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;display:none}.ai1wm-report-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-report-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-feedback-cancel:active,.ai1wm-feedback-cancel:link,.ai1wm-feedback-cancel:visited,.ai1wm-report-cancel:active,.ai1wm-report-cancel:link,.ai1wm-report-cancel:visited{float:left;line-height:34px;outline:0;text-decoration:none;color:#e74c3c}.ai1wm-form-submit{float:right}.ai1wm-report-active{display:block}.ai1wm-report-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-report-terms-segment>.ai1wm-report-terms{border-radius:3px}.ai1wm-import-info a,.ai1wm-no-underline{text-decoration:none}.ai1wm-top-negative-four{top:-4px}.ai1wm-feedback-form{display:none}.ai1wm-feedback-types{margin:0;padding:0;list-style:none}.ai1wm-feedback-types li{margin:14px 0;padding:0}.ai1wm-feedback-types>li>a>span,.ai1wm-feedback-types>li>label>span{display:inline-block;padding:5px 0 6px 8px}.ai1wm-feedback-types>li>a{height:29px;outline:0;color:#333;text-deciration:none}.ai1wm-loader{display:inline-block;width:128px;height:128px;position:relative;-webkit-animation:ai1wm-rotate 1.5s infinite linear;animation:ai1wm-rotate 1.5s infinite linear;background:url(../img/logo-128x128.png);background-repeat:no-repeat;background-position:center center}.ai1wm-hide{display:none}.ai1wm-label{border:1px solid #5cb85c;background-color:transparent;color:#5cb85c;cursor:pointer;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;padding:.2em .6em;font-size:.8em;border-radius:5px}.ai1wm-label:hover{background-color:#5cb85c;color:#fff}.ai1wm-dialog-message{text-align:left;line-height:1.5em}.ai1wm-import-info{display:inline-block;font-size:12px;font-weight:700;margin-top:16px}[class*=" ai1wm-icon-"],[class^=ai1wm-icon-]{font-family:'servmask';speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-file-zip:before{content:"\e60f"}.ai1wm-icon-folder:before{content:"\e60e"}.ai1wm-icon-file:before{content:"\e60b"}.ai1wm-icon-file-content:before{content:"\e60c"}.ai1wm-icon-cloud-upload:before{content:"\e600"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-notification:before{content:"\e619"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-close:before{content:"\e61a"}.ai1wm-icon-wordpress2:before{content:"\e620"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-plus2:before{content:"\e607"}.ai1wm-icon-export:before{content:"\e601"}.ai1wm-icon-publish:before{content:"\e602"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-chevron-right:before{content:"\e60d"}.ai1wm-icon-dropbox:before{content:"\e606"}.ai1wm-icon-gear:before{content:"\e60a"}.ai1wm-icon-database:before{content:"\e964"}.ai1wm-icon-upload2:before{content:"\e9c6"}.ai1wm-icon-checkmark:before{content:"\ea10"}.ai1wm-icon-checkmark2:before{content:"\ea11"}.ai1wm-icon-enter:before{content:"\ea13"}.ai1wm-icon-exit:before{content:"\ea14"}.ai1wm-icon-amazon:before{content:"\ea87"}.ai1wm-icon-onedrive:before{content:"\eaaf"}@media (min-width:855px){.ai1wm-row{margin-right:399px}.ai1wm-row:after,.ai1wm-row:before{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:left;width:100%}.ai1wm-right{float:right;width:377px;margin-right:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;background-color:#f9f9f9;padding:20px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-right .ai1wm-segment h2{margin:22px 0 0;padding:0;font-weight:700;font-size:14px;text-transform:uppercase;text-align:center}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-holder{position:relative;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-holder h1{float:left;font-weight:300;font-size:22px;text-transform:uppercase}.ai1wm-holder h1 i{position:relative;top:2px}@media (max-width:854px){.ai1wm-container{margin-left:10px!important}.ai1wm-right,.ai1wm-row{margin-right:0!important}.ai1wm-right{float:left!important;width:100%!important;margin-top:18px}.ai1wm-right .ai1wm-sidebar{width:auto!important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px;border-radius:3px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-container{margin:20px 20px 0 2px}.ai1wm-container:after,.ai1wm-container:before{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 white;border-radius:3px;color:#333;font-size:11px;font-weight:700;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box;margin-bottom:10px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type=text],.ai1wm-field textarea,.ai1wm-query div input{width:100%;font-weight:400}.ai1wm-field-set{margin-top:18px}.ai1wm-message{-moz-box-sizing:border-box;background-color:#efefef;border-radius:4px;color:rgba(0,0,0,.6);height:auto;margin:10px 0;min-height:18px;padding:6px 10px;position:relative;border:1px solid;transition:opacity .1s ease 0s,color .1s ease 0s,background .1s ease 0s,box-shadow .1s ease 0s}.ai1wm-message.ai1wm-success-message{background-color:#f2f8f0;color:#119000;font-size:12px}.ai1wm-message.ai1wm-info-message{background-color:#d9edf7;color:#31708f;font-size:11px}.ai1wm-message.ai1wm-error-message{background-color:#f1d7d7;color:#a95252;font-size:12px}.ai1wm-message.ai1wm-red-message{color:#d95c5c;border:2px solid #d95c5c;background-color:transparent}.ai1wm-message.ai1wm-red-message h3{margin:.4em 0;color:#d95c5c}.ai1wm-message p{margin:4px 0;font-size:12px}.ai1wm-message-warning{display:block;font-size:14px;line-height:18px;padding:12px 20px;margin:0 0 22px;background-color:#f9f9f9;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;border-left:4px solid #ffba00}.ai1wm-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);z-index:100001}.ai1wm-modal-container{position:fixed;display:none;top:50%;left:50%;z-index:100002;width:480px;height:auto;padding:16px;-webkit-transform:translate(-240px,-94px);transform:translate(-240px,-94px);border:1px solid #fff;box-shadow:0 2px 6px #292929;border-radius:6px;background:#f6f6f6;box-sizing:border-box;text-align:center}.ai1wm-modal-container section{display:block;min-height:102px}.ai1wm-holder h1,.ai1wm-modal-container section h1{margin:0;padding:0}.ai1wm-modal-container section h1 .ai1wm-title-green{color:#27ae60;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-red{color:#e74c3c;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-grey{color:gray;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-loader{width:32px;height:32px;background:url(../img/logo-32x32.png)}.ai1wm-modal-container section h1 .ai1wm-icon-notification{font-size:1.2em;color:#e74c3c}.ai1wm-modal-container section p{margin:0;padding:12px 0}.ai1wm-modal-container section p .ai1wm-modal-sites p{padding:4px 10px;text-align:left}.ai1wm-modal-container section p .ai1wm-modal-sites input,.ai1wm-modal-container section p .ai1wm-modal-sites select{padding:0 6px;width:100%;border-radius:3px;height:30px;line-height:30px}.ai1wm-modal-container section p .ai1wm-modal-subtitle-green{color:#27ae60}.ai1wm-modal-container section p .ai1wm-modal-subtitle-red{color:#e74c3c}.ai1wm-modal-container section p .ai1wm-modal-subdescription{display:block;text-align:left}.ai1wm-modal-container section p a.ai1wm-button-green{display:inline-block;position:relative;top:26px}.ai1wm-modal-container section p a.ai1wm-emphasize{-webkit-animation:ai1wm-emphasize 1s infinite;animation:ai1wm-emphasize 1s infinite}.ai1wm-modal-container section p em{display:block;color:#34495e;font-style:normal}.ai1wm-modal-container section p.ai1wm-import-modal-content{text-align:left}.ai1wm-modal-container .ai1wm-import-modal-actions{border-top:1px solid #ccc;padding-top:1em;text-align:right}.ai1wm-modal-container .ai1wm-import-modal-actions .ai1wm-button-gray{margin-right:1em}.ai1wm-modal-container .ai1wm-import-modal-notice{border-top:1px solid #ccc}.ai1wm-modal-container .ai1wm-import-modal-notice p{font-weight:700;margin:0;padding-top:16px;text-align:center}.ai1wm-query-arrow{position:relative;top:4px;float:right}.ai1wm-query.ai1wm-open{background:#ebebeb!important}.ai1wm-query.ai1wm-open p small{border-bottom:1px dashed #000}.ai1wm-query.ai1wm-open div{visibility:visible!important;height:5rem!important;margin-top:8px}.ai1wm-query.ai1wm-open .ai1wm-query-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.ai1wm-query{width:100%;margin:0 0 10px;list-style:none;background:0 0;border:1px solid #d8d8d8;padding:10px;border-radius:5px;box-sizing:border-box}.ai1wm-query div{transition:height .2s cubic-bezier(.19,1,.22,1);visibility:hidden;height:0}.ai1wm-query div input{font-size:.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#333;transition:.05s border-color ease-in-out;border-radius:5px}.ai1wm-query div input:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.ai1wm-query p{margin:0;cursor:pointer}.ai1wm-query p small{display:inline;width:auto;float:none}.ai1wm-button-download span{display:block;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai1wm-query-arrow{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out}#ai1wm-queries{padding:0}
|
lib/view/assets/css/export.min.rtl.css
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
@charset "UTF-8";@-webkit-keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}50%{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}75%{-webkit-transform:rotateZ(270deg);transform:rotateZ(270deg)}to{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg)}}@keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}50%{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}75%{-webkit-transform:rotateZ(270deg);transform:rotateZ(270deg)}to{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg)}}@-webkit-keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@-webkit-keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}.ai1wm-accordion{margin:1em 0;display:block}.ai1wm-accordion h4{cursor:pointer;color:rgba(0,116,162,.8);margin:0}.ai1wm-accordion h4 small{color:#444;font-weight:400}.ai1wm-accordion h4 small:after,.ai1wm-container .ai1wm-row label:after{content:"\200E"}.ai1wm-accordion .ai1wm-icon-arrow-right{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out;display:inline-block}.ai1wm-accordion ul{margin:0;padding:0;list-style:none;visibility:hidden;height:0;transition:height .2s cubic-bezier(.19,1,.22,1)}.ai1wm-accordion h4 small,.ai1wm-accordion ul li small{display:inline;float:none;width:auto}.ai1wm-accordion.ai1wm-open h4 .ai1wm-icon-arrow-right{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ai1wm-accordion.ai1wm-open ul{height:auto;margin:.6em 2em 0 0;visibility:visible}.ai1wm-button-group{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;text-transform:uppercase;font-weight:600;transition:background-color .2s ease-out;display:inline-block;text-align:right}.ai1wm-button-group.ai1wm-button-export,.ai1wm-button-group.ai1wm-button-import{box-sizing:content-box}.ai1wm-button-group.ai1wm-button-export.ai1wm-open>.ai1wm-dropdown-menu{height:448px;border-top:1px solid #27ae60}.ai1wm-button-group.ai1wm-button-import.ai1wm-open>.ai1wm-dropdown-menu{height:476px;border-top:1px solid #27ae60}.ai1wm-button-group .ai1wm-button-main{position:relative;padding:6px 25px 6px 50px;box-sizing:content-box}.ai1wm-button-group .ai1wm-dropdown-menu{height:0;overflow:hidden;transition:height .2s cubic-bezier(.19,1,.22,1);border-top:none}.ai1wm-dropdown-menu{list-style:none}.ai1wm-dropdown-menu,.ai1wm-dropdown-menu li{margin:0!important;padding:0}.ai1wm-dropdown-menu li a,.ai1wm-dropdown-menu li a:visited{display:block;padding:5px 26px;text-decoration:none;color:#27ae60;text-align:right;box-sizing:content-box}.ai1wm-dropdown-menu li a:hover,.ai1wm-dropdown-menu li a:visited:hover{text-decoration:none;color:#111}.ai1mw-lines{position:absolute;width:12px;height:10px;top:9px;left:20px}.ai1wm-line{position:absolute;width:100%;height:2px;margin:auto;background:#27ae60;transition:all .2s ease-in-out}.ai1wm-line-first{top:0;right:0}div.ai1wm-open .ai1wm-line-first,div.ai1wm-open .ai1wm-line-third{top:50%}.ai1wm-line-second{top:50%;right:0}.ai1wm-line-third{top:100%;right:0}.ai1wm-button-blue,.ai1wm-button-gray,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{display:inline-block;border:2px solid #95a5a6;background-color:transparent;color:#95a5a6;border-radius:5px;cursor:pointer;padding:5px 26px 5px 25px;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-gray:hover{background-color:#95a5a6;color:#fff}.ai1wm-button-blue,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #27ae60;color:#27ae60}.ai1wm-button-green:hover{background-color:#27ae60;color:#fff}.ai1wm-button-blue,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #6eb649;color:#6eb649}.ai1wm-button-green-small:hover{background-color:#6eb649;color:#fff}.ai1wm-button-blue,.ai1wm-button-red{border:2px solid #00aff0;color:#00aff0}.ai1wm-button-blue:hover{background-color:#00aff0;color:#fff}.ai1wm-button-red{border:2px solid #e74c3c;color:#e74c3c}.ai1wm-button-red:hover{background-color:#e74c3c;color:#fff}.ai1wm-button-blue[disabled=disabled],.ai1wm-button-green-small[disabled=disabled],.ai1wm-button-green[disabled=disabled],.ai1wm-button-red[disabled=disabled]{opacity:.6;cursor:default}.ai1wm-button-blue[disabled=disabled]:hover{color:#00aff0}.ai1wm-button-red[disabled=disabled]:hover{color:#e74c3c}.ai1wm-button-green[disabled=disabled]:hover{color:#27ae60}.ai1wm-button-blue[disabled=disabled]:hover,.ai1wm-button-green-small[disabled=disabled]:hover,.ai1wm-button-green[disabled=disabled]:hover,.ai1wm-button-red[disabled=disabled]:hover{background:100% 0}.ai1wm-message-close-button{position:absolute;left:10px;top:6px;text-decoration:none;font-size:10px}input[type=radio].ai1wm-flat-radio-button{display:none}input[type=radio].ai1wm-flat-radio-button+a i,input[type=radio].ai1wm-flat-radio-button+label i{vertical-align:middle;float:right;width:25px;height:25px;border-radius:50%;background:100% 0;border:2px solid #ccc;content:" ";cursor:pointer;position:relative;box-sizing:content-box}input[type=radio].ai1wm-flat-radio-button:checked+a i,input[type=radio].ai1wm-flat-radio-button:checked+label i{background-color:#d9d9d9;border-color:#6f6f6f}.ai1wm-clear{*zoom:1;clear:both}.ai1wm-clear:after,.ai1wm-clear:before{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-container .ai1wm-row label{position:relative;top:-1px}.ai1wm-share-button-container{text-align:center}.ai1wm-share-button-container .ai1wm-share-button{text-decoration:none;margin:10px;font-size:30px}.ai1wm-report-problem{position:relative;float:left}.ai1wm-report-problem-dialog{position:absolute;z-index:999;width:280px;left:0;background-color:#fff;margin:6px 0 0;padding:15px 15px 10px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;display:none}.ai1wm-report-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-report-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-feedback-cancel:active,.ai1wm-feedback-cancel:link,.ai1wm-feedback-cancel:visited,.ai1wm-report-cancel:active,.ai1wm-report-cancel:link,.ai1wm-report-cancel:visited{float:right;line-height:34px;outline:0;text-decoration:none;color:#e74c3c}.ai1wm-form-submit{float:left}.ai1wm-report-active{display:block}.ai1wm-report-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-report-terms-segment>.ai1wm-report-terms{border-radius:3px}.ai1wm-import-info a,.ai1wm-no-underline{text-decoration:none}.ai1wm-top-negative-four{top:-4px}.ai1wm-feedback-form{display:none}.ai1wm-feedback-types{margin:0;padding:0;list-style:none}.ai1wm-feedback-types li{margin:14px 0;padding:0}.ai1wm-feedback-types>li>a>span,.ai1wm-feedback-types>li>label>span{display:inline-block;padding:5px 8px 6px 0}.ai1wm-feedback-types>li>a{height:29px;outline:0;color:#333;text-deciration:none}.ai1wm-loader{display:inline-block;width:128px;height:128px;position:relative;-webkit-animation:ai1wm-rotate 1.5s infinite linear;animation:ai1wm-rotate 1.5s infinite linear;background:url(../img/logo-128x128.png);background-repeat:no-repeat;background-position:center center}.ai1wm-hide{display:none}.ai1wm-label{border:1px solid #5cb85c;background-color:transparent;color:#5cb85c;cursor:pointer;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;padding:.2em .6em;font-size:.8em;border-radius:5px}.ai1wm-label:hover{background-color:#5cb85c;color:#fff}.ai1wm-dialog-message{text-align:right;line-height:1.5em}.ai1wm-import-info{display:inline-block;font-size:12px;font-weight:700;margin-top:16px}[class*=" ai1wm-icon-"],[class^=ai1wm-icon-]{font-family:'servmask';speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-file-zip:before{content:"\e60f"}.ai1wm-icon-folder:before{content:"\e60e"}.ai1wm-icon-file:before{content:"\e60b"}.ai1wm-icon-file-content:before{content:"\e60c"}.ai1wm-icon-cloud-upload:before{content:"\e600"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-notification:before{content:"\e619"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-close:before{content:"\e61a"}.ai1wm-icon-wordpress2:before{content:"\e620"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-plus2:before{content:"\e607"}.ai1wm-icon-export:before{content:"\e601"}.ai1wm-icon-publish:before{content:"\e602"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-chevron-right:before{content:"\e60d"}.ai1wm-icon-dropbox:before{content:"\e606"}.ai1wm-icon-gear:before{content:"\e60a"}.ai1wm-icon-database:before{content:"\e964"}.ai1wm-icon-upload2:before{content:"\e9c6"}.ai1wm-icon-checkmark:before{content:"\ea10"}.ai1wm-icon-checkmark2:before{content:"\ea11"}.ai1wm-icon-enter:before{content:"\ea13"}.ai1wm-icon-exit:before{content:"\ea14"}.ai1wm-icon-amazon:before{content:"\ea87"}.ai1wm-icon-onedrive:before{content:"\eaaf"}@media (min-width:855px){.ai1wm-row{margin-left:399px}.ai1wm-row:after,.ai1wm-row:before{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:right;width:100%}.ai1wm-right{float:left;width:377px;margin-left:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;background-color:#f9f9f9;padding:20px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-right .ai1wm-segment h2{margin:22px 0 0;padding:0;font-weight:700;font-size:14px;text-transform:uppercase;text-align:center}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-holder{position:relative;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-holder h1{float:right;font-weight:300;font-size:22px;text-transform:uppercase}.ai1wm-holder h1 i{position:relative;top:2px}@media (max-width:854px){.ai1wm-container{margin-right:10px!important}.ai1wm-right,.ai1wm-row{margin-left:0!important}.ai1wm-right{float:right!important;width:100%!important;margin-top:18px}.ai1wm-right .ai1wm-sidebar{width:auto!important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px;border-radius:3px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-container{margin:20px 2px 0 20px}.ai1wm-container:after,.ai1wm-container:before{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 white;border-radius:3px;color:#333;font-size:11px;font-weight:700;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box;margin-bottom:10px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type=text],.ai1wm-field textarea,.ai1wm-query div input{width:100%;font-weight:400}.ai1wm-field-set{margin-top:18px}.ai1wm-message{-moz-box-sizing:border-box;background-color:#efefef;border-radius:4px;color:rgba(0,0,0,.6);height:auto;margin:10px 0;min-height:18px;padding:6px 10px;position:relative;border:1px solid;transition:opacity .1s ease 0s,color .1s ease 0s,background .1s ease 0s,box-shadow .1s ease 0s}.ai1wm-message.ai1wm-success-message{background-color:#f2f8f0;color:#119000;font-size:12px}.ai1wm-message.ai1wm-info-message{background-color:#d9edf7;color:#31708f;font-size:11px}.ai1wm-message.ai1wm-error-message{background-color:#f1d7d7;color:#a95252;font-size:12px}.ai1wm-message.ai1wm-red-message{color:#d95c5c;border:2px solid #d95c5c;background-color:transparent}.ai1wm-message.ai1wm-red-message h3{margin:.4em 0;color:#d95c5c}.ai1wm-message p{margin:4px 0;font-size:12px}.ai1wm-message-warning{display:block;font-size:14px;line-height:18px;padding:12px 20px;margin:0 0 22px;background-color:#f9f9f9;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;border-right:4px solid #ffba00}.ai1wm-overlay{display:none;position:fixed;top:0;right:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);z-index:100001}.ai1wm-modal-container{position:fixed;display:none;top:50%;right:50%;z-index:100002;width:480px;height:auto;padding:16px;-webkit-transform:translate(240px,-94px);transform:translate(240px,-94px);border:1px solid #fff;box-shadow:0 2px 6px #292929;border-radius:6px;background:#f6f6f6;box-sizing:border-box;text-align:center}.ai1wm-modal-container section{display:block;min-height:102px}.ai1wm-holder h1,.ai1wm-modal-container section h1{margin:0;padding:0}.ai1wm-modal-container section h1 .ai1wm-title-green{color:#27ae60;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-red{color:#e74c3c;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-grey{color:gray;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-loader{width:32px;height:32px;background:url(../img/logo-32x32.png)}.ai1wm-modal-container section h1 .ai1wm-icon-notification{font-size:1.2em;color:#e74c3c}.ai1wm-modal-container section p{margin:0;padding:12px 0}.ai1wm-modal-container section p .ai1wm-modal-sites p{padding:4px 10px;text-align:right}.ai1wm-modal-container section p .ai1wm-modal-sites input,.ai1wm-modal-container section p .ai1wm-modal-sites select{padding:0 6px;width:100%;border-radius:3px;height:30px;line-height:30px}.ai1wm-modal-container section p .ai1wm-modal-subtitle-green{color:#27ae60}.ai1wm-modal-container section p .ai1wm-modal-subtitle-red{color:#e74c3c}.ai1wm-modal-container section p .ai1wm-modal-subdescription{display:block;text-align:right}.ai1wm-modal-container section p a.ai1wm-button-green{display:inline-block;position:relative;top:26px}.ai1wm-modal-container section p a.ai1wm-emphasize{-webkit-animation:ai1wm-emphasize 1s infinite;animation:ai1wm-emphasize 1s infinite}.ai1wm-modal-container section p em{display:block;color:#34495e;font-style:normal}.ai1wm-modal-container section p.ai1wm-import-modal-content{text-align:right}.ai1wm-modal-container .ai1wm-import-modal-actions{border-top:1px solid #ccc;padding-top:1em;text-align:left}.ai1wm-modal-container .ai1wm-import-modal-actions .ai1wm-button-gray{margin-left:1em}.ai1wm-modal-container .ai1wm-import-modal-notice{border-top:1px solid #ccc}.ai1wm-modal-container .ai1wm-import-modal-notice p{font-weight:700;margin:0;padding-top:16px;text-align:center}.ai1wm-query-arrow{position:relative;top:4px;float:left}.ai1wm-query.ai1wm-open{background:#ebebeb!important}.ai1wm-query.ai1wm-open p small{border-bottom:1px dashed #000}.ai1wm-query.ai1wm-open div{visibility:visible!important;height:5rem!important;margin-top:8px}.ai1wm-query.ai1wm-open .ai1wm-query-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ai1wm-query{width:100%;margin:0 0 10px;list-style:none;background:100% 0;border:1px solid #d8d8d8;padding:10px;border-radius:5px;box-sizing:border-box}.ai1wm-query div{transition:height .2s cubic-bezier(.19,1,.22,1);visibility:hidden;height:0}.ai1wm-query div input{font-size:.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#333;transition:.05s border-color ease-in-out;border-radius:5px}.ai1wm-query div input:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.ai1wm-query p{margin:0;cursor:pointer}.ai1wm-query p small{display:inline;width:auto;float:none}.ai1wm-query-arrow{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out}#ai1wm-queries{padding:0}
|
| 1 |
+
@charset "UTF-8";@-webkit-keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}50%{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}75%{-webkit-transform:rotateZ(270deg);transform:rotateZ(270deg)}to{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg)}}@keyframes ai1wm-rotate{0%{-webkit-transform:rotateZ(0);transform:rotateZ(0)}25%{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}50%{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}75%{-webkit-transform:rotateZ(270deg);transform:rotateZ(270deg)}to{-webkit-transform:rotateZ(360deg);transform:rotateZ(360deg)}}@-webkit-keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes ai1wm-emphasize{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@-webkit-keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes ai1wm-fadein{0%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1.5);transform:scale(1.5)}to{-webkit-transform:scale(1);transform:scale(1)}}.ai1wm-accordion{margin:1em 0;display:block}.ai1wm-accordion h4{cursor:pointer;color:rgba(0,116,162,.8);margin:0}.ai1wm-accordion h4 small{color:#444;font-weight:400}.ai1wm-accordion h4 small:after,.ai1wm-container .ai1wm-row label:after{content:"\200E"}.ai1wm-accordion .ai1wm-icon-arrow-right{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out;display:inline-block}.ai1wm-accordion ul{margin:0;padding:0;list-style:none;visibility:hidden;height:0;transition:height .2s cubic-bezier(.19,1,.22,1)}.ai1wm-accordion h4 small,.ai1wm-accordion ul li small{display:inline;float:none;width:auto}.ai1wm-accordion.ai1wm-open h4 .ai1wm-icon-arrow-right{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ai1wm-accordion.ai1wm-open ul{height:auto;margin:.6em 2em 0 0;visibility:visible}.ai1wm-button-group{border:2px solid #27ae60;background-color:transparent;color:#27ae60;border-radius:5px;cursor:pointer;text-transform:uppercase;font-weight:600;transition:background-color .2s ease-out;display:inline-block;text-align:right}.ai1wm-button-group.ai1wm-button-export,.ai1wm-button-group.ai1wm-button-import{box-sizing:content-box}.ai1wm-button-group.ai1wm-button-export.ai1wm-open>.ai1wm-dropdown-menu{height:448px;border-top:1px solid #27ae60}.ai1wm-button-group.ai1wm-button-import.ai1wm-open>.ai1wm-dropdown-menu{height:476px;border-top:1px solid #27ae60}.ai1wm-button-group .ai1wm-button-main{position:relative;padding:6px 25px 6px 50px;box-sizing:content-box}.ai1wm-button-group .ai1wm-dropdown-menu{height:0;overflow:hidden;transition:height .2s cubic-bezier(.19,1,.22,1);border-top:none}.ai1wm-dropdown-menu{list-style:none}.ai1wm-dropdown-menu,.ai1wm-dropdown-menu li{margin:0!important;padding:0}.ai1wm-dropdown-menu li a,.ai1wm-dropdown-menu li a:visited{display:block;padding:5px 26px;text-decoration:none;color:#27ae60;text-align:right;box-sizing:content-box}.ai1wm-dropdown-menu li a:hover,.ai1wm-dropdown-menu li a:visited:hover{text-decoration:none;color:#111}.ai1mw-lines{position:absolute;width:12px;height:10px;top:9px;left:20px}.ai1wm-line{position:absolute;width:100%;height:2px;margin:auto;background:#27ae60;transition:all .2s ease-in-out}.ai1wm-line-first{top:0;right:0}div.ai1wm-open .ai1wm-line-first,div.ai1wm-open .ai1wm-line-third{top:50%}.ai1wm-line-second{top:50%;right:0}.ai1wm-line-third{top:100%;right:0}.ai1wm-button-blue,.ai1wm-button-gray,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{display:inline-block;border:2px solid #95a5a6;background-color:transparent;color:#95a5a6;border-radius:5px;cursor:pointer;padding:5px 26px 5px 25px;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;text-decoration:none}.ai1wm-button-gray:hover{background-color:#95a5a6;color:#fff}.ai1wm-button-blue,.ai1wm-button-green,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #27ae60;color:#27ae60}.ai1wm-button-green:hover{background-color:#27ae60;color:#fff}.ai1wm-button-blue,.ai1wm-button-green-small,.ai1wm-button-red{border:2px solid #6eb649;color:#6eb649}.ai1wm-button-green-small:hover{background-color:#6eb649;color:#fff}.ai1wm-button-blue,.ai1wm-button-red{border:2px solid #00aff0;color:#00aff0}.ai1wm-button-blue:hover{background-color:#00aff0;color:#fff}.ai1wm-button-red{border:2px solid #e74c3c;color:#e74c3c}.ai1wm-button-red:hover{background-color:#e74c3c;color:#fff}.ai1wm-button-blue[disabled=disabled],.ai1wm-button-green-small[disabled=disabled],.ai1wm-button-green[disabled=disabled],.ai1wm-button-red[disabled=disabled]{opacity:.6;cursor:default}.ai1wm-button-blue[disabled=disabled]:hover{color:#00aff0}.ai1wm-button-red[disabled=disabled]:hover{color:#e74c3c}.ai1wm-button-green[disabled=disabled]:hover{color:#27ae60}.ai1wm-button-blue[disabled=disabled]:hover,.ai1wm-button-green-small[disabled=disabled]:hover,.ai1wm-button-green[disabled=disabled]:hover,.ai1wm-button-red[disabled=disabled]:hover{background:100% 0}.ai1wm-message-close-button{position:absolute;left:10px;top:6px;text-decoration:none;font-size:10px}input[type=radio].ai1wm-flat-radio-button{display:none}input[type=radio].ai1wm-flat-radio-button+a i,input[type=radio].ai1wm-flat-radio-button+label i{vertical-align:middle;float:right;width:25px;height:25px;border-radius:50%;background:100% 0;border:2px solid #ccc;content:" ";cursor:pointer;position:relative;box-sizing:content-box}input[type=radio].ai1wm-flat-radio-button:checked+a i,input[type=radio].ai1wm-flat-radio-button:checked+label i{background-color:#d9d9d9;border-color:#6f6f6f}.ai1wm-clear{*zoom:1;clear:both}.ai1wm-clear:after,.ai1wm-clear:before{content:" ";display:table}.ai1wm-clear:after{clear:both}.ai1wm-container .ai1wm-row label{position:relative;top:-1px}.ai1wm-share-button-container{text-align:center}.ai1wm-share-button-container .ai1wm-share-button{text-decoration:none;margin:10px;font-size:30px}.ai1wm-report-problem{position:relative;float:left}.ai1wm-report-problem-dialog{position:absolute;z-index:999;width:280px;left:0;background-color:#fff;margin:6px 0 0;padding:15px 15px 10px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;display:none}.ai1wm-report-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-report-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-feedback-cancel:active,.ai1wm-feedback-cancel:link,.ai1wm-feedback-cancel:visited,.ai1wm-report-cancel:active,.ai1wm-report-cancel:link,.ai1wm-report-cancel:visited{float:right;line-height:34px;outline:0;text-decoration:none;color:#e74c3c}.ai1wm-form-submit{float:left}.ai1wm-report-active{display:block}.ai1wm-report-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-report-terms-segment>.ai1wm-report-terms{border-radius:3px}.ai1wm-import-info a,.ai1wm-no-underline{text-decoration:none}.ai1wm-top-negative-four{top:-4px}.ai1wm-feedback-form{display:none}.ai1wm-feedback-types{margin:0;padding:0;list-style:none}.ai1wm-feedback-types li{margin:14px 0;padding:0}.ai1wm-feedback-types>li>a>span,.ai1wm-feedback-types>li>label>span{display:inline-block;padding:5px 8px 6px 0}.ai1wm-feedback-types>li>a{height:29px;outline:0;color:#333;text-deciration:none}.ai1wm-loader{display:inline-block;width:128px;height:128px;position:relative;-webkit-animation:ai1wm-rotate 1.5s infinite linear;animation:ai1wm-rotate 1.5s infinite linear;background:url(../img/logo-128x128.png);background-repeat:no-repeat;background-position:center center}.ai1wm-hide{display:none}.ai1wm-label{border:1px solid #5cb85c;background-color:transparent;color:#5cb85c;cursor:pointer;text-transform:uppercase;font-weight:600;outline:0;transition:background-color .2s ease-out;padding:.2em .6em;font-size:.8em;border-radius:5px}.ai1wm-label:hover{background-color:#5cb85c;color:#fff}.ai1wm-dialog-message{text-align:right;line-height:1.5em}.ai1wm-import-info{display:inline-block;font-size:12px;font-weight:700;margin-top:16px}[class*=" ai1wm-icon-"],[class^=ai1wm-icon-]{font-family:'servmask';speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ai1wm-icon-file-zip:before{content:"\e60f"}.ai1wm-icon-folder:before{content:"\e60e"}.ai1wm-icon-file:before{content:"\e60b"}.ai1wm-icon-file-content:before{content:"\e60c"}.ai1wm-icon-cloud-upload:before{content:"\e600"}.ai1wm-icon-history:before{content:"\e603"}.ai1wm-icon-notification:before{content:"\e619"}.ai1wm-icon-arrow-down:before{content:"\e604"}.ai1wm-icon-close:before{content:"\e61a"}.ai1wm-icon-wordpress2:before{content:"\e620"}.ai1wm-icon-arrow-right:before{content:"\e605"}.ai1wm-icon-plus2:before{content:"\e607"}.ai1wm-icon-export:before{content:"\e601"}.ai1wm-icon-publish:before{content:"\e602"}.ai1wm-icon-paperplane:before{content:"\e608"}.ai1wm-icon-help:before{content:"\e609"}.ai1wm-icon-chevron-right:before{content:"\e60d"}.ai1wm-icon-dropbox:before{content:"\e606"}.ai1wm-icon-gear:before{content:"\e60a"}.ai1wm-icon-database:before{content:"\e964"}.ai1wm-icon-upload2:before{content:"\e9c6"}.ai1wm-icon-checkmark:before{content:"\ea10"}.ai1wm-icon-checkmark2:before{content:"\ea11"}.ai1wm-icon-enter:before{content:"\ea13"}.ai1wm-icon-exit:before{content:"\ea14"}.ai1wm-icon-amazon:before{content:"\ea87"}.ai1wm-icon-onedrive:before{content:"\eaaf"}@media (min-width:855px){.ai1wm-row{margin-left:399px}.ai1wm-row:after,.ai1wm-row:before{content:" ";display:table}.ai1wm-row:after{clear:both}.ai1wm-left{float:right;width:100%}.ai1wm-right{float:left;width:377px;margin-left:-399px}.ai1wm-right .ai1wm-sidebar{width:100%}.ai1wm-right .ai1wm-segment{width:333px;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;color:#333;background-color:#f9f9f9;padding:20px;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box}.ai1wm-right .ai1wm-segment h2{margin:22px 0 0;padding:0;font-weight:700;font-size:14px;text-transform:uppercase;text-align:center}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-holder{position:relative;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-holder h1{float:right;font-weight:300;font-size:22px;text-transform:uppercase}.ai1wm-holder h1 i{position:relative;top:2px}@media (max-width:854px){.ai1wm-container{margin-right:10px!important}.ai1wm-right,.ai1wm-row{margin-left:0!important}.ai1wm-right{float:right!important;width:100%!important;margin-top:18px}.ai1wm-right .ai1wm-sidebar{width:auto!important;border:1px solid #d6d6d6;border-radius:3px;box-shadow:inset 0 1px 0 0 #fff;padding:20px;background:#f9f9f9}.ai1wm-right .ai1wm-feedback-email{width:100%;font-weight:400;font-size:.8rem;height:2.3rem;line-height:2.3rem;border-radius:5px;margin-bottom:4px;padding:0 10px}.ai1wm-right .ai1wm-feedback-message{width:100%;border-radius:3px;font-size:.8rem;padding:6px 10px;resize:none}.ai1wm-right .ai1wm-feedback-terms-segment{font-size:.7rem;line-height:1rem;margin:4px 0 8px;border-radius:3px}.ai1wm-right .ai1wm-feedback-terms-segment>.ai1wm-feedback-terms{border-radius:3px}}.ai1wm-container{margin:20px 2px 0 20px}.ai1wm-container:after,.ai1wm-container:before{content:" ";display:table}.ai1wm-container:after{clear:both}.ai1wm-replace-row{width:100%;box-shadow:outset 0 1px 0 0 white;border-radius:3px;color:#333;font-size:11px;font-weight:700;background-color:#f9f9f9;text-decoration:none;text-shadow:0 1px 0 #fff;background-clip:padding-box;margin-bottom:10px}.ai1wm-field{margin-bottom:4px}.ai1wm-field input[type=text],.ai1wm-field textarea,.ai1wm-query div input{width:100%;font-weight:400}.ai1wm-field-set{margin-top:18px}.ai1wm-message{-moz-box-sizing:border-box;background-color:#efefef;border-radius:4px;color:rgba(0,0,0,.6);height:auto;margin:10px 0;min-height:18px;padding:6px 10px;position:relative;border:1px solid;transition:opacity .1s ease 0s,color .1s ease 0s,background .1s ease 0s,box-shadow .1s ease 0s}.ai1wm-message.ai1wm-success-message{background-color:#f2f8f0;color:#119000;font-size:12px}.ai1wm-message.ai1wm-info-message{background-color:#d9edf7;color:#31708f;font-size:11px}.ai1wm-message.ai1wm-error-message{background-color:#f1d7d7;color:#a95252;font-size:12px}.ai1wm-message.ai1wm-red-message{color:#d95c5c;border:2px solid #d95c5c;background-color:transparent}.ai1wm-message.ai1wm-red-message h3{margin:.4em 0;color:#d95c5c}.ai1wm-message p{margin:4px 0;font-size:12px}.ai1wm-message-warning{display:block;font-size:14px;line-height:18px;padding:12px 20px;margin:0 0 22px;background-color:#f9f9f9;border:1px solid #d6d6d6;border-radius:3px;box-shadow:0 1px 0 0 #fff inset;border-right:4px solid #ffba00}.ai1wm-overlay{display:none;position:fixed;top:0;right:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);z-index:100001}.ai1wm-modal-container{position:fixed;display:none;top:50%;right:50%;z-index:100002;width:480px;height:auto;padding:16px;-webkit-transform:translate(240px,-94px);transform:translate(240px,-94px);border:1px solid #fff;box-shadow:0 2px 6px #292929;border-radius:6px;background:#f6f6f6;box-sizing:border-box;text-align:center}.ai1wm-modal-container section{display:block;min-height:102px}.ai1wm-holder h1,.ai1wm-modal-container section h1{margin:0;padding:0}.ai1wm-modal-container section h1 .ai1wm-title-green{color:#27ae60;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-red{color:#e74c3c;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-title-grey{color:gray;font-size:20px}.ai1wm-modal-container section h1 .ai1wm-loader{width:32px;height:32px;background:url(../img/logo-32x32.png)}.ai1wm-modal-container section h1 .ai1wm-icon-notification{font-size:1.2em;color:#e74c3c}.ai1wm-modal-container section p{margin:0;padding:12px 0}.ai1wm-modal-container section p .ai1wm-modal-sites p{padding:4px 10px;text-align:right}.ai1wm-modal-container section p .ai1wm-modal-sites input,.ai1wm-modal-container section p .ai1wm-modal-sites select{padding:0 6px;width:100%;border-radius:3px;height:30px;line-height:30px}.ai1wm-modal-container section p .ai1wm-modal-subtitle-green{color:#27ae60}.ai1wm-modal-container section p .ai1wm-modal-subtitle-red{color:#e74c3c}.ai1wm-modal-container section p .ai1wm-modal-subdescription{display:block;text-align:right}.ai1wm-modal-container section p a.ai1wm-button-green{display:inline-block;position:relative;top:26px}.ai1wm-modal-container section p a.ai1wm-emphasize{-webkit-animation:ai1wm-emphasize 1s infinite;animation:ai1wm-emphasize 1s infinite}.ai1wm-modal-container section p em{display:block;color:#34495e;font-style:normal}.ai1wm-modal-container section p.ai1wm-import-modal-content{text-align:right}.ai1wm-modal-container .ai1wm-import-modal-actions{border-top:1px solid #ccc;padding-top:1em;text-align:left}.ai1wm-modal-container .ai1wm-import-modal-actions .ai1wm-button-gray{margin-left:1em}.ai1wm-modal-container .ai1wm-import-modal-notice{border-top:1px solid #ccc}.ai1wm-modal-container .ai1wm-import-modal-notice p{font-weight:700;margin:0;padding-top:16px;text-align:center}.ai1wm-query-arrow{position:relative;top:4px;float:left}.ai1wm-query.ai1wm-open{background:#ebebeb!important}.ai1wm-query.ai1wm-open p small{border-bottom:1px dashed #000}.ai1wm-query.ai1wm-open div{visibility:visible!important;height:5rem!important;margin-top:8px}.ai1wm-query.ai1wm-open .ai1wm-query-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.ai1wm-query{width:100%;margin:0 0 10px;list-style:none;background:100% 0;border:1px solid #d8d8d8;padding:10px;border-radius:5px;box-sizing:border-box}.ai1wm-query div{transition:height .2s cubic-bezier(.19,1,.22,1);visibility:hidden;height:0}.ai1wm-query div input{font-size:.8rem;padding:0 10px;height:2.3rem;line-height:2.3rem;margin-bottom:4px;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#333;transition:.05s border-color ease-in-out;border-radius:5px}.ai1wm-query div input:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.ai1wm-query p{margin:0;cursor:pointer}.ai1wm-query p small{display:inline;width:auto;float:none}.ai1wm-button-download span{display:block;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai1wm-query-arrow{transition:transform .1s ease-out;transition:transform .1s ease-out,-webkit-transform .1s ease-out}#ai1wm-queries{padding:0}
|
lib/view/assets/javascript/backups.min.js
CHANGED
|
@@ -98,7 +98,7 @@ module.exports = g;
|
|
| 98 |
|
| 99 |
|
| 100 |
/**
|
| 101 |
-
* Copyright (C) 2014-
|
| 102 |
*
|
| 103 |
* This program is free software: you can redistribute it and/or modify
|
| 104 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -227,7 +227,7 @@ jQuery(document).ready(function ($) {
|
|
| 227 |
|
| 228 |
|
| 229 |
/**
|
| 230 |
-
* Copyright (C) 2014-
|
| 231 |
*
|
| 232 |
* This program is free software: you can redistribute it and/or modify
|
| 233 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -328,7 +328,7 @@ jQuery(document).ready(function ($) {
|
|
| 328 |
|
| 329 |
|
| 330 |
/**
|
| 331 |
-
* Copyright (C) 2014-
|
| 332 |
*
|
| 333 |
* This program is free software: you can redistribute it and/or modify
|
| 334 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -691,7 +691,7 @@ module.exports = Import;
|
|
| 691 |
|
| 692 |
|
| 693 |
/**
|
| 694 |
-
* Copyright (C) 2014-
|
| 695 |
*
|
| 696 |
* This program is free software: you can redistribute it and/or modify
|
| 697 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -1137,7 +1137,7 @@ module.exports = Modal;
|
|
| 1137 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 1138 |
|
| 1139 |
/**
|
| 1140 |
-
* Copyright (C) 2014-
|
| 1141 |
*
|
| 1142 |
* This program is free software: you can redistribute it and/or modify
|
| 1143 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -1234,7 +1234,7 @@ global.Ai1wm = jQuery.extend({}, global.Ai1wm, { Feedback: Feedback, Report: Rep
|
|
| 1234 |
|
| 1235 |
|
| 1236 |
/**
|
| 1237 |
-
* Copyright (C) 2014-
|
| 1238 |
*
|
| 1239 |
* This program is free software: you can redistribute it and/or modify
|
| 1240 |
* it under the terms of the GNU General Public License as published by
|
| 98 |
|
| 99 |
|
| 100 |
/**
|
| 101 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 102 |
*
|
| 103 |
* This program is free software: you can redistribute it and/or modify
|
| 104 |
* it under the terms of the GNU General Public License as published by
|
| 227 |
|
| 228 |
|
| 229 |
/**
|
| 230 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 231 |
*
|
| 232 |
* This program is free software: you can redistribute it and/or modify
|
| 233 |
* it under the terms of the GNU General Public License as published by
|
| 328 |
|
| 329 |
|
| 330 |
/**
|
| 331 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 332 |
*
|
| 333 |
* This program is free software: you can redistribute it and/or modify
|
| 334 |
* it under the terms of the GNU General Public License as published by
|
| 691 |
|
| 692 |
|
| 693 |
/**
|
| 694 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 695 |
*
|
| 696 |
* This program is free software: you can redistribute it and/or modify
|
| 697 |
* it under the terms of the GNU General Public License as published by
|
| 1137 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 1138 |
|
| 1139 |
/**
|
| 1140 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 1141 |
*
|
| 1142 |
* This program is free software: you can redistribute it and/or modify
|
| 1143 |
* it under the terms of the GNU General Public License as published by
|
| 1234 |
|
| 1235 |
|
| 1236 |
/**
|
| 1237 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 1238 |
*
|
| 1239 |
* This program is free software: you can redistribute it and/or modify
|
| 1240 |
* it under the terms of the GNU General Public License as published by
|
lib/view/assets/javascript/export.min.js
CHANGED
|
@@ -98,7 +98,7 @@ module.exports = g;
|
|
| 98 |
|
| 99 |
|
| 100 |
/**
|
| 101 |
-
* Copyright (C) 2014-
|
| 102 |
*
|
| 103 |
* This program is free software: you can redistribute it and/or modify
|
| 104 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -227,7 +227,7 @@ jQuery(document).ready(function ($) {
|
|
| 227 |
|
| 228 |
|
| 229 |
/**
|
| 230 |
-
* Copyright (C) 2014-
|
| 231 |
*
|
| 232 |
* This program is free software: you can redistribute it and/or modify
|
| 233 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -332,7 +332,7 @@ jQuery(document).ready(function ($) {
|
|
| 332 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 333 |
|
| 334 |
/**
|
| 335 |
-
* Copyright (C) 2014-
|
| 336 |
*
|
| 337 |
* This program is free software: you can redistribute it and/or modify
|
| 338 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -404,7 +404,7 @@ global.Ai1wm = jQuery.extend({}, global.Ai1wm, { Query: Query, FindReplace: Find
|
|
| 404 |
|
| 405 |
|
| 406 |
/**
|
| 407 |
-
* Copyright (C) 2014-
|
| 408 |
*
|
| 409 |
* This program is free software: you can redistribute it and/or modify
|
| 410 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -457,7 +457,7 @@ global.Ai1wm = jQuery.extend({}, global.Ai1wm, { Query: Query, FindReplace: Find
|
|
| 457 |
|
| 458 |
|
| 459 |
/**
|
| 460 |
-
* Copyright (C) 2014-
|
| 461 |
*
|
| 462 |
* This program is free software: you can redistribute it and/or modify
|
| 463 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -521,7 +521,7 @@ global.Ai1wm = jQuery.extend({}, global.Ai1wm, { Query: Query, FindReplace: Find
|
|
| 521 |
|
| 522 |
|
| 523 |
/**
|
| 524 |
-
* Copyright (C) 2014-
|
| 525 |
*
|
| 526 |
* This program is free software: you can redistribute it and/or modify
|
| 527 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -774,7 +774,7 @@ module.exports = Export;
|
|
| 774 |
|
| 775 |
|
| 776 |
/**
|
| 777 |
-
* Copyright (C) 2014-
|
| 778 |
*
|
| 779 |
* This program is free software: you can redistribute it and/or modify
|
| 780 |
* it under the terms of the GNU General Public License as published by
|
| 98 |
|
| 99 |
|
| 100 |
/**
|
| 101 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 102 |
*
|
| 103 |
* This program is free software: you can redistribute it and/or modify
|
| 104 |
* it under the terms of the GNU General Public License as published by
|
| 227 |
|
| 228 |
|
| 229 |
/**
|
| 230 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 231 |
*
|
| 232 |
* This program is free software: you can redistribute it and/or modify
|
| 233 |
* it under the terms of the GNU General Public License as published by
|
| 332 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 333 |
|
| 334 |
/**
|
| 335 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 336 |
*
|
| 337 |
* This program is free software: you can redistribute it and/or modify
|
| 338 |
* it under the terms of the GNU General Public License as published by
|
| 404 |
|
| 405 |
|
| 406 |
/**
|
| 407 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 408 |
*
|
| 409 |
* This program is free software: you can redistribute it and/or modify
|
| 410 |
* it under the terms of the GNU General Public License as published by
|
| 457 |
|
| 458 |
|
| 459 |
/**
|
| 460 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 461 |
*
|
| 462 |
* This program is free software: you can redistribute it and/or modify
|
| 463 |
* it under the terms of the GNU General Public License as published by
|
| 521 |
|
| 522 |
|
| 523 |
/**
|
| 524 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 525 |
*
|
| 526 |
* This program is free software: you can redistribute it and/or modify
|
| 527 |
* it under the terms of the GNU General Public License as published by
|
| 774 |
|
| 775 |
|
| 776 |
/**
|
| 777 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 778 |
*
|
| 779 |
* This program is free software: you can redistribute it and/or modify
|
| 780 |
* it under the terms of the GNU General Public License as published by
|
lib/view/assets/javascript/import.min.js
CHANGED
|
@@ -98,7 +98,7 @@ module.exports = g;
|
|
| 98 |
|
| 99 |
|
| 100 |
/**
|
| 101 |
-
* Copyright (C) 2014-
|
| 102 |
*
|
| 103 |
* This program is free software: you can redistribute it and/or modify
|
| 104 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -227,7 +227,7 @@ jQuery(document).ready(function ($) {
|
|
| 227 |
|
| 228 |
|
| 229 |
/**
|
| 230 |
-
* Copyright (C) 2014-
|
| 231 |
*
|
| 232 |
* This program is free software: you can redistribute it and/or modify
|
| 233 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -328,7 +328,7 @@ jQuery(document).ready(function ($) {
|
|
| 328 |
|
| 329 |
|
| 330 |
/**
|
| 331 |
-
* Copyright (C) 2014-
|
| 332 |
*
|
| 333 |
* This program is free software: you can redistribute it and/or modify
|
| 334 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -691,7 +691,7 @@ module.exports = Import;
|
|
| 691 |
|
| 692 |
|
| 693 |
/**
|
| 694 |
-
* Copyright (C) 2014-
|
| 695 |
*
|
| 696 |
* This program is free software: you can redistribute it and/or modify
|
| 697 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -1144,7 +1144,7 @@ module.exports = Modal;
|
|
| 1144 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 1145 |
|
| 1146 |
/**
|
| 1147 |
-
* Copyright (C) 2014-
|
| 1148 |
*
|
| 1149 |
* This program is free software: you can redistribute it and/or modify
|
| 1150 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -1204,7 +1204,7 @@ global.Ai1wm = jQuery.extend({}, global.Ai1wm, { FileUploader: FileUploader, Fee
|
|
| 1204 |
|
| 1205 |
|
| 1206 |
/**
|
| 1207 |
-
* Copyright (C) 2014-
|
| 1208 |
*
|
| 1209 |
* This program is free software: you can redistribute it and/or modify
|
| 1210 |
* it under the terms of the GNU General Public License as published by
|
| 98 |
|
| 99 |
|
| 100 |
/**
|
| 101 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 102 |
*
|
| 103 |
* This program is free software: you can redistribute it and/or modify
|
| 104 |
* it under the terms of the GNU General Public License as published by
|
| 227 |
|
| 228 |
|
| 229 |
/**
|
| 230 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 231 |
*
|
| 232 |
* This program is free software: you can redistribute it and/or modify
|
| 233 |
* it under the terms of the GNU General Public License as published by
|
| 328 |
|
| 329 |
|
| 330 |
/**
|
| 331 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 332 |
*
|
| 333 |
* This program is free software: you can redistribute it and/or modify
|
| 334 |
* it under the terms of the GNU General Public License as published by
|
| 691 |
|
| 692 |
|
| 693 |
/**
|
| 694 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 695 |
*
|
| 696 |
* This program is free software: you can redistribute it and/or modify
|
| 697 |
* it under the terms of the GNU General Public License as published by
|
| 1144 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 1145 |
|
| 1146 |
/**
|
| 1147 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 1148 |
*
|
| 1149 |
* This program is free software: you can redistribute it and/or modify
|
| 1150 |
* it under the terms of the GNU General Public License as published by
|
| 1204 |
|
| 1205 |
|
| 1206 |
/**
|
| 1207 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 1208 |
*
|
| 1209 |
* This program is free software: you can redistribute it and/or modify
|
| 1210 |
* it under the terms of the GNU General Public License as published by
|
lib/view/assets/javascript/settings.min.js
CHANGED
|
@@ -100,7 +100,7 @@ module.exports = g;
|
|
| 100 |
|
| 101 |
|
| 102 |
/**
|
| 103 |
-
* Copyright (C) 2014-
|
| 104 |
*
|
| 105 |
* This program is free software: you can redistribute it and/or modify
|
| 106 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -230,7 +230,7 @@ jQuery(document).ready(function ($) {
|
|
| 230 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 231 |
|
| 232 |
/**
|
| 233 |
-
* Copyright (C) 2014-
|
| 234 |
*
|
| 235 |
* This program is free software: you can redistribute it and/or modify
|
| 236 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -272,7 +272,7 @@ global.Ai1wm = jQuery.extend({}, global.Ai1wm, { Feedback: Feedback, Report: Rep
|
|
| 272 |
|
| 273 |
|
| 274 |
/**
|
| 275 |
-
* Copyright (C) 2014-
|
| 276 |
*
|
| 277 |
* This program is free software: you can redistribute it and/or modify
|
| 278 |
* it under the terms of the GNU General Public License as published by
|
| 100 |
|
| 101 |
|
| 102 |
/**
|
| 103 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 104 |
*
|
| 105 |
* This program is free software: you can redistribute it and/or modify
|
| 106 |
* it under the terms of the GNU General Public License as published by
|
| 230 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 231 |
|
| 232 |
/**
|
| 233 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 234 |
*
|
| 235 |
* This program is free software: you can redistribute it and/or modify
|
| 236 |
* it under the terms of the GNU General Public License as published by
|
| 272 |
|
| 273 |
|
| 274 |
/**
|
| 275 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 276 |
*
|
| 277 |
* This program is free software: you can redistribute it and/or modify
|
| 278 |
* it under the terms of the GNU General Public License as published by
|
lib/view/assets/javascript/updater.min.js
CHANGED
|
@@ -72,7 +72,7 @@
|
|
| 72 |
|
| 73 |
|
| 74 |
/**
|
| 75 |
-
* Copyright (C) 2014-
|
| 76 |
*
|
| 77 |
* This program is free software: you can redistribute it and/or modify
|
| 78 |
* it under the terms of the GNU General Public License as published by
|
| 72 |
|
| 73 |
|
| 74 |
/**
|
| 75 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 76 |
*
|
| 77 |
* This program is free software: you can redistribute it and/or modify
|
| 78 |
* it under the terms of the GNU General Public License as published by
|
lib/view/assets/javascript/util.min.js
CHANGED
|
@@ -100,7 +100,7 @@ module.exports = g;
|
|
| 100 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 101 |
|
| 102 |
/**
|
| 103 |
-
* Copyright (C) 2014-
|
| 104 |
*
|
| 105 |
* This program is free software: you can redistribute it and/or modify
|
| 106 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -137,7 +137,7 @@ global.Ai1wm = jQuery.extend({}, global.Ai1wm, { Util: Util });
|
|
| 137 |
|
| 138 |
|
| 139 |
/**
|
| 140 |
-
* Copyright (C) 2014-
|
| 141 |
*
|
| 142 |
* This program is free software: you can redistribute it and/or modify
|
| 143 |
* it under the terms of the GNU General Public License as published by
|
| 100 |
/* WEBPACK VAR INJECTION */(function(global) {
|
| 101 |
|
| 102 |
/**
|
| 103 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 104 |
*
|
| 105 |
* This program is free software: you can redistribute it and/or modify
|
| 106 |
* it under the terms of the GNU General Public License as published by
|
| 137 |
|
| 138 |
|
| 139 |
/**
|
| 140 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 141 |
*
|
| 142 |
* This program is free software: you can redistribute it and/or modify
|
| 143 |
* it under the terms of the GNU General Public License as published by
|
lib/view/backups/index.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -71,7 +71,7 @@
|
|
| 71 |
<?php endif; ?>
|
| 72 |
</td>
|
| 73 |
<td class="ai1wm-column-actions ai1wm-backup-actions">
|
| 74 |
-
<a href="<?php echo ai1wm_backup_url( array( 'archive' => esc_attr( $backup['filename'] ) ) ); ?>" class="ai1wm-button-green ai1wm-backup-download">
|
| 75 |
<i class="ai1wm-icon-arrow-down"></i>
|
| 76 |
<span><?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?></span>
|
| 77 |
</a>
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 71 |
<?php endif; ?>
|
| 72 |
</td>
|
| 73 |
<td class="ai1wm-column-actions ai1wm-backup-actions">
|
| 74 |
+
<a href="<?php echo ai1wm_backup_url( array( 'archive' => esc_attr( $backup['filename'] ) ) ); ?>" class="ai1wm-button-green ai1wm-backup-download" download="<?php echo esc_attr( $backup['filename'] ); ?>">
|
| 75 |
<i class="ai1wm-icon-arrow-down"></i>
|
| 76 |
<span><?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?></span>
|
| 77 |
</a>
|
lib/view/common/http-authentication.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/common/leave-feedback.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/common/maintenance-mode.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/common/report-problem.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/common/share-buttons.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/advanced-settings.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-azure-storage.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-b2.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-box.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-digitalocean.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-dropbox.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-file.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-ftp.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-gcloud-storage.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-gdrive.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-glacier.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-mega.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-onedrive.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-pcloud.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-s3-client.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-s3.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/button-webdav.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/export-buttons.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/find-replace.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/help-section.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/export/index.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-azure-storage.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-b2.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-box.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-digitalocean.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-dropbox.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-file.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-ftp.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-gcloud-storage.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-gdrive.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-glacier.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-mega.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-onedrive.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-pcloud.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-s3-client.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-s3.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-url.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/button-webdav.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/import-buttons.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/index.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/import/pro.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/admin-head.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/backups-htaccess-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/backups-index-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/backups-path-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/backups-webconfig-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/get-support.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/multisite-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/storage-index-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/storage-path-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/main/wordpress-htaccess-notice.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/updater/check.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
lib/view/updater/modal.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
loader.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
|
@@ -181,12 +181,6 @@ require_once AI1WM_VENDOR_PATH .
|
|
| 181 |
DIRECTORY_SEPARATOR .
|
| 182 |
'class-ai1wm-database-utility.php';
|
| 183 |
|
| 184 |
-
require_once AI1WM_VENDOR_PATH .
|
| 185 |
-
DIRECTORY_SEPARATOR .
|
| 186 |
-
'math' .
|
| 187 |
-
DIRECTORY_SEPARATOR .
|
| 188 |
-
'BigInteger.php';
|
| 189 |
-
|
| 190 |
require_once AI1WM_CONTROLLER_PATH .
|
| 191 |
DIRECTORY_SEPARATOR .
|
| 192 |
'class-ai1wm-main-controller.php';
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 181 |
DIRECTORY_SEPARATOR .
|
| 182 |
'class-ai1wm-database-utility.php';
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
require_once AI1WM_CONTROLLER_PATH .
|
| 185 |
DIRECTORY_SEPARATOR .
|
| 186 |
'class-ai1wm-main-controller.php';
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Tags: move, transfer, copy, migrate, backup, clone, restore, db migration, wordp
|
|
| 4 |
Requires at least: 3.3
|
| 5 |
Tested up to: 5.0
|
| 6 |
Requires PHP: 5.2.17
|
| 7 |
-
Stable tag: 6.
|
| 8 |
License: GPLv2 or later
|
| 9 |
|
| 10 |
Move, transfer, copy, migrate, and backup a site with 1-click. Quick, easy, and reliable.
|
|
@@ -108,6 +108,12 @@ Alternatively you can download the plugin using the download button on this page
|
|
| 108 |
All-in-One WP Migration **asks for your consent** to collect **requester's email address** when filling plugin's contact form. [GDPR Compliant Privacy Policy](https://www.iubenda.com/privacy-policy/946881)
|
| 109 |
|
| 110 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
= 6.83 =
|
| 112 |
**Added**
|
| 113 |
|
| 4 |
Requires at least: 3.3
|
| 5 |
Tested up to: 5.0
|
| 6 |
Requires PHP: 5.2.17
|
| 7 |
+
Stable tag: 6.84
|
| 8 |
License: GPLv2 or later
|
| 9 |
|
| 10 |
Move, transfer, copy, migrate, and backup a site with 1-click. Quick, easy, and reliable.
|
| 108 |
All-in-One WP Migration **asks for your consent** to collect **requester's email address** when filling plugin's contact form. [GDPR Compliant Privacy Policy](https://www.iubenda.com/privacy-policy/946881)
|
| 109 |
|
| 110 |
== Changelog ==
|
| 111 |
+
= 6.84 =
|
| 112 |
+
**Fixed**
|
| 113 |
+
|
| 114 |
+
* Set the type of backup file during download via HTML attribute
|
| 115 |
+
* Removed Math_BigInteger class which was causing issues with other plugins
|
| 116 |
+
|
| 117 |
= 6.83 =
|
| 118 |
**Added**
|
| 119 |
|
uninstall.php
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
-
* Copyright (C) 2014-
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
+
* Copyright (C) 2014-2019 ServMask Inc.
|
| 4 |
*
|
| 5 |
* This program is free software: you can redistribute it and/or modify
|
| 6 |
* it under the terms of the GNU General Public License as published by
|
