Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid - Version 1.15.3

Version Description

Release date: November 1st, 2022

  • Update: Updated dependencies.
Download this release

Release Info

Developer boldgrid
Plugin Icon 128x128 Total Upkeep – WordPress Backup Plugin plus Restore & Migrate by BoldGrid
Version 1.15.3
Comparing to
See all releases

Code changes from version 1.15.2 to 1.15.3

Files changed (51) hide show
  1. boldgrid-backup.php +1 -1
  2. cli/{verify-852edb2c5781b6f633c8d8b96775d55c.php → verify-ef3bf6331c85b535eed0cffc76d35d3a.php} +0 -0
  3. readme.txt +8 -2
  4. vendor/autoload.php +1 -1
  5. vendor/boldgrid/library/README.md +18 -0
  6. vendor/boldgrid/library/src/Library/Api/Call.php +2 -2
  7. vendor/boldgrid/library/src/Library/License.php +1 -1
  8. vendor/boldgrid/library/src/Library/Menu/External.php +4 -0
  9. vendor/boldgrid/library/src/Library/Menu/Reseller.php +4 -0
  10. vendor/boldgrid/library/src/Library/Page/Connect.php +3 -0
  11. vendor/boldgrid/library/src/Library/Start.php +3 -1
  12. vendor/boldgrid/library/src/library.global.php +1 -1
  13. vendor/chland/tdcron +0 -1
  14. vendor/composer/autoload_real.php +7 -7
  15. vendor/composer/autoload_static.php +4 -4
  16. vendor/composer/installed.json +25 -38
  17. vendor/ifsnop/mysqldump-php/.gitattributes +0 -5
  18. vendor/ifsnop/mysqldump-php/.scrutinizer.yml +0 -135
  19. vendor/ifsnop/mysqldump-php/.travis.yml +0 -279
  20. vendor/ifsnop/mysqldump-php/README.md +23 -6
  21. vendor/ifsnop/mysqldump-php/phpunit.xml +0 -21
  22. vendor/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php +58 -39
  23. vendor/ifsnop/mysqldump-php/tests/create_users.sh +0 -26
  24. vendor/ifsnop/mysqldump-php/tests/delete_users.sh +0 -16
  25. vendor/ifsnop/mysqldump-php/tests/test.php +0 -165
  26. vendor/ifsnop/mysqldump-php/tests/test.sh +0 -284
  27. vendor/ifsnop/mysqldump-php/tests/test001.src.sql +0 -140
  28. vendor/ifsnop/mysqldump-php/tests/test002.src.sql +0 -14
  29. vendor/ifsnop/mysqldump-php/tests/test005.src.sql +0 -12
  30. vendor/ifsnop/mysqldump-php/tests/test006.src.sql +0 -107
  31. vendor/ifsnop/mysqldump-php/tests/test008.src.sql +0 -80
  32. vendor/ifsnop/mysqldump-php/tests/test009.src.sql +0 -57
  33. vendor/ifsnop/mysqldump-php/tests/test010.src.sql +0 -56
  34. vendor/ifsnop/mysqldump-php/tests/test011.src.sql +0 -53
  35. vendor/ifsnop/mysqldump-php/tests/test012.src.sql +0 -32
  36. vendor/ifsnop/mysqldump-php/unit-tests/MysqldumpTest.php +0 -48
  37. vendor/phpseclib/phpseclib/AUTHORS +1 -0
  38. vendor/phpseclib/phpseclib/BACKERS.md +2 -1
  39. vendor/phpseclib/phpseclib/composer.json +2 -1
  40. vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php +72 -14
  41. vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php +427 -12
  42. vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php +2 -2
  43. vendor/phpseclib/phpseclib/phpseclib/Crypt/RC2.php +1 -1
  44. vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php +45 -7
  45. vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php +4 -1
  46. vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php +22 -17
  47. vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php +36 -0
  48. vendor/phpseclib/phpseclib/phpseclib/File/X509.php +6 -1
  49. vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php +3 -3
  50. vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php +75 -13
  51. vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php +5 -1
boldgrid-backup.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Total Upkeep
17
  * Plugin URI: https://www.boldgrid.com/boldgrid-backup/
18
  * Description: Automated backups, remote backup to Amazon S3 and Google Drive, stop website crashes before they happen and more. Total Upkeep is the backup solution you need.
19
- * Version: 1.15.2
20
  * Author: BoldGrid
21
  * Author URI: https://www.boldgrid.com/
22
  * License: GPL-2.0+
16
  * Plugin Name: Total Upkeep
17
  * Plugin URI: https://www.boldgrid.com/boldgrid-backup/
18
  * Description: Automated backups, remote backup to Amazon S3 and Google Drive, stop website crashes before they happen and more. Total Upkeep is the backup solution you need.
19
+ * Version: 1.15.3
20
  * Author: BoldGrid
21
  * Author URI: https://www.boldgrid.com/
22
  * License: GPL-2.0+
cli/{verify-852edb2c5781b6f633c8d8b96775d55c.php → verify-ef3bf6331c85b535eed0cffc76d35d3a.php} RENAMED
File without changes
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: backup, cloud backup, database backup, restore, wordpress backup
4
  Requires at least: 4.4
5
  Tested up to: 6.1
6
  Requires PHP: 5.4
7
- Stable tag: 1.15.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -132,11 +132,17 @@ Have a problem? First, take a look at our [Getting Started](https://www.boldgrid
132
 
133
  == Changelog ==
134
 
 
 
 
 
 
 
135
  = 1.15.2 =
136
 
137
  Release date: May 27th, 2022
138
 
139
- * Updpate: Updated dependencies.
140
 
141
  = 1.15.1 =
142
 
4
  Requires at least: 4.4
5
  Tested up to: 6.1
6
  Requires PHP: 5.4
7
+ Stable tag: 1.15.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
132
 
133
  == Changelog ==
134
 
135
+ = 1.15.3 =
136
+
137
+ Release date: November 1st, 2022
138
+
139
+ * Update: Updated dependencies.
140
+
141
  = 1.15.2 =
142
 
143
  Release date: May 27th, 2022
144
 
145
+ * Update: Updated dependencies.
146
 
147
  = 1.15.1 =
148
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitd3475abad362b46ca6ec161094303b5a::getLoader();
vendor/boldgrid/library/README.md CHANGED
@@ -11,6 +11,24 @@ composer require boldgrid/library
11
 
12
  ## Changelog ##
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ### 2.13.7 ###
15
 
16
  Release date: May 25th, 2022
11
 
12
  ## Changelog ##
13
 
14
+ ### 2.13.10 ###
15
+
16
+ Release date: November 1st, 2022
17
+
18
+ * Update: Allow menus to be hidden.
19
+
20
+ ### 2.13.9 ###
21
+
22
+ Release date: June 5th, 2022
23
+
24
+ * Bug Fix: Fix fatal error 'IMH_Central class not found' occuring on some installs.
25
+
26
+ ### 2.13.8 ###
27
+
28
+ Release date: June 26th, 2022
29
+
30
+ * Bug Fix: Allow premium license key on preview servers.
31
+
32
  ### 2.13.7 ###
33
 
34
  Release date: May 25th, 2022
vendor/boldgrid/library/src/Library/Api/Call.php CHANGED
@@ -94,7 +94,7 @@ class Call {
94
  * @return mixed $key The key string or false if not found.
95
  */
96
  protected function setKey() {
97
- return $this->key = get_option( 'boldgrid_api_key' );
98
  }
99
 
100
  /**
@@ -105,7 +105,7 @@ class Call {
105
  * @return mixed $siteHash The site hash string or false if not found.
106
  */
107
  protected function setSiteHash() {
108
- return $this->siteHash = get_option( 'boldgrid_site_hash' );
109
  }
110
 
111
  /**
94
  * @return mixed $key The key string or false if not found.
95
  */
96
  protected function setKey() {
97
+ return $this->key = get_site_option( 'boldgrid_api_key' );
98
  }
99
 
100
  /**
105
  * @return mixed $siteHash The site hash string or false if not found.
106
  */
107
  protected function setSiteHash() {
108
+ return $this->siteHash = get_site_option( 'boldgrid_site_hash' );
109
  }
110
 
111
  /**
vendor/boldgrid/library/src/Library/License.php CHANGED
@@ -335,7 +335,7 @@ class License {
335
  * @hook Boldgrid\Library\License\getApiKey
336
  */
337
  public function getApiKey() {
338
- return get_option( 'boldgrid_api_key' );
339
  }
340
 
341
  /**
335
  * @hook Boldgrid\Library\License\getApiKey
336
  */
337
  public function getApiKey() {
338
+ return get_site_option( 'boldgrid_api_key' );
339
  }
340
 
341
  /**
vendor/boldgrid/library/src/Library/Menu/External.php CHANGED
@@ -39,6 +39,10 @@ class External {
39
  * @param WP_Admin_Bar $wpAdminBar Admin Bar.
40
  */
41
  public function addMenu( $wpAdminBar ) {
 
 
 
 
42
  Render::adminBarNode( $wpAdminBar, $this->getMenuItems() );
43
  }
44
 
39
  * @param WP_Admin_Bar $wpAdminBar Admin Bar.
40
  */
41
  public function addMenu( $wpAdminBar ) {
42
+ if ( get_option( 'boldgrid_connect_hide_menu', false ) ) {
43
+ return;
44
+ }
45
+
46
  Render::adminBarNode( $wpAdminBar, $this->getMenuItems() );
47
  }
48
 
vendor/boldgrid/library/src/Library/Menu/Reseller.php CHANGED
@@ -95,6 +95,10 @@ class Reseller {
95
  * @param WP_Admin_Bar $wpAdminBar Admin Bar.
96
  */
97
  public function addMenu( $wpAdminBar ) {
 
 
 
 
98
  Render::adminBarNode( $wpAdminBar, $this->getMenuItems() );
99
  }
100
 
95
  * @param WP_Admin_Bar $wpAdminBar Admin Bar.
96
  */
97
  public function addMenu( $wpAdminBar ) {
98
+ if ( get_option( 'boldgrid_connect_hide_menu', false ) ) {
99
+ return;
100
+ }
101
+
102
  Render::adminBarNode( $wpAdminBar, $this->getMenuItems() );
103
  }
104
 
vendor/boldgrid/library/src/Library/Page/Connect.php CHANGED
@@ -157,6 +157,9 @@ class Connect {
157
  * @hook admin_menu
158
  */
159
  public function addPage() {
 
 
 
160
  add_submenu_page(
161
  'options-general.php',
162
  'BoldGrid Connect',
157
  * @hook admin_menu
158
  */
159
  public function addPage() {
160
+ if ( get_option( 'boldgrid_connect_hide_menu', false ) ) {
161
+ return;
162
+ }
163
  add_submenu_page(
164
  'options-general.php',
165
  'BoldGrid Connect',
vendor/boldgrid/library/src/Library/Start.php CHANGED
@@ -137,7 +137,9 @@ class Start {
137
  Configs::setItem( 'assets', new Asset() );
138
  new Editor();
139
 
140
- new Configs\IMH_Central();
 
 
141
  }
142
 
143
  /**
137
  Configs::setItem( 'assets', new Asset() );
138
  new Editor();
139
 
140
+ if ( class_exists( '\Boldgrid\Library\Library\Configs\IMH_Central' ) ) {
141
+ new Configs\IMH_Central();
142
+ }
143
  }
144
 
145
  /**
vendor/boldgrid/library/src/library.global.php CHANGED
@@ -7,7 +7,7 @@ defined( 'WPFORMS_SHAREASALE_ID' ) || define( 'WPFORMS_SHAREASALE_ID', '1581233'
7
 
8
  return array(
9
  // libraryVersion is used to put the version number on js/css files.
10
- 'libraryVersion' => '2.13.7',
11
  'api' => 'https://api.boldgrid.com',
12
  'option' => 'license',
13
  'key' => get_site_option( 'boldgrid_api_key', null ),
7
 
8
  return array(
9
  // libraryVersion is used to put the version number on js/css files.
10
+ 'libraryVersion' => '2.13.10',
11
  'api' => 'https://api.boldgrid.com',
12
  'option' => 'license',
13
  'key' => get_site_option( 'boldgrid_api_key', null ),
vendor/chland/tdcron DELETED
@@ -1 +0,0 @@
1
- Subproject commit 33673affb6c452ff41c843aae515b37411ecddcb
 
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit26d4acbfedaf0bcf5650b36fab97aa59
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire26d4acbfedaf0bcf5650b36fab97aa59($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire26d4acbfedaf0bcf5650b36fab97aa59($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitd3475abad362b46ca6ec161094303b5a
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitd3475abad362b46ca6ec161094303b5a', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitd3475abad362b46ca6ec161094303b5a', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInitd3475abad362b46ca6ec161094303b5a::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInitd3475abad362b46ca6ec161094303b5a::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequired3475abad362b46ca6ec161094303b5a($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequired3475abad362b46ca6ec161094303b5a($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59
8
  {
9
  public static $files = array (
10
  'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
@@ -91,9 +91,9 @@ class ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59
91
  public static function getInitializer(ClassLoader $loader)
92
  {
93
  return \Closure::bind(function () use ($loader) {
94
- $loader->prefixLengthsPsr4 = ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$prefixLengthsPsr4;
95
- $loader->prefixDirsPsr4 = ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$prefixDirsPsr4;
96
- $loader->classMap = ComposerStaticInit26d4acbfedaf0bcf5650b36fab97aa59::$classMap;
97
 
98
  }, null, ClassLoader::class);
99
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitd3475abad362b46ca6ec161094303b5a
8
  {
9
  public static $files = array (
10
  'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
91
  public static function getInitializer(ClassLoader $loader)
92
  {
93
  return \Closure::bind(function () use ($loader) {
94
+ $loader->prefixLengthsPsr4 = ComposerStaticInitd3475abad362b46ca6ec161094303b5a::$prefixLengthsPsr4;
95
+ $loader->prefixDirsPsr4 = ComposerStaticInitd3475abad362b46ca6ec161094303b5a::$prefixDirsPsr4;
96
+ $loader->classMap = ComposerStaticInitd3475abad362b46ca6ec161094303b5a::$classMap;
97
 
98
  }, null, ClassLoader::class);
99
  }
vendor/composer/installed.json CHANGED
@@ -1,23 +1,23 @@
1
  [
2
  {
3
  "name": "boldgrid/library",
4
- "version": "2.13.7",
5
- "version_normalized": "2.13.7.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/BoldGrid/library.git",
9
- "reference": "93602b2785b54a7439777822901ec3f66b6349e9"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/BoldGrid/library/zipball/93602b2785b54a7439777822901ec3f66b6349e9",
14
- "reference": "93602b2785b54a7439777822901ec3f66b6349e9",
15
  "shasum": ""
16
  },
17
  "require-dev": {
18
  "yoast/phpunit-polyfills": "^1.0"
19
  },
20
- "time": "2022-05-26T14:24:24+00:00",
21
  "type": "library",
22
  "installation-source": "dist",
23
  "autoload": {
@@ -54,31 +54,19 @@
54
  ],
55
  "description": "The BoldGrid Library for shared code used in official BoldGrid plugins and themes."
56
  },
57
- {
58
- "name": "chland/tdcron",
59
- "version": "dev-master",
60
- "version_normalized": "9999999-dev",
61
- "source": {
62
- "type": "git",
63
- "url": "https://github.com/chland/tdcron",
64
- "reference": "origin/master"
65
- },
66
- "type": "library",
67
- "installation-source": "source"
68
- },
69
  {
70
  "name": "ifsnop/mysqldump-php",
71
- "version": "dev-add-include-views",
72
- "version_normalized": "dev-add-include-views",
73
  "source": {
74
  "type": "git",
75
- "url": "https://github.com/BoldGrid/mysqldump-php.git",
76
- "reference": "e9d009e543795069272d09ed5cb71a865a805522"
77
  },
78
  "dist": {
79
  "type": "zip",
80
- "url": "https://api.github.com/repos/BoldGrid/mysqldump-php/zipball/e9d009e543795069272d09ed5cb71a865a805522",
81
- "reference": "e9d009e543795069272d09ed5cb71a865a805522",
82
  "shasum": ""
83
  },
84
  "require": {
@@ -88,14 +76,15 @@
88
  "phpunit/phpunit": "4.8.36",
89
  "squizlabs/php_codesniffer": "1.*"
90
  },
91
- "time": "2020-01-09T19:43:11+00:00",
92
  "type": "library",
93
- "installation-source": "source",
94
  "autoload": {
95
  "psr-4": {
96
  "Ifsnop\\": "src/Ifsnop/"
97
  }
98
  },
 
99
  "license": [
100
  "GPL-3.0-or-later"
101
  ],
@@ -109,6 +98,7 @@
109
  "description": "PHP version of mysqldump cli that comes with MySQL",
110
  "homepage": "https://github.com/ifsnop/mysqldump-php",
111
  "keywords": [
 
112
  "database",
113
  "hhvm",
114
  "mariadb",
@@ -118,26 +108,22 @@
118
  "pdo",
119
  "php",
120
  "php5",
121
- "php7",
122
  "sql"
123
- ],
124
- "support": {
125
- "source": "https://github.com/BoldGrid/mysqldump-php/tree/add-include-views"
126
- }
127
  },
128
  {
129
  "name": "phpseclib/phpseclib",
130
- "version": "2.0.37",
131
- "version_normalized": "2.0.37.0",
132
  "source": {
133
  "type": "git",
134
  "url": "https://github.com/phpseclib/phpseclib.git",
135
- "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c"
136
  },
137
  "dist": {
138
  "type": "zip",
139
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/c812fbb4d6b4d7f30235ab7298a12f09ba13b37c",
140
- "reference": "c812fbb4d6b4d7f30235ab7298a12f09ba13b37c",
141
  "shasum": ""
142
  },
143
  "require": {
@@ -152,9 +138,10 @@
152
  "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
153
  "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
154
  "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
155
- "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
 
156
  },
157
- "time": "2022-04-04T04:57:45+00:00",
158
  "type": "library",
159
  "installation-source": "dist",
160
  "autoload": {
1
  [
2
  {
3
  "name": "boldgrid/library",
4
+ "version": "2.13.10",
5
+ "version_normalized": "2.13.10.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/BoldGrid/library.git",
9
+ "reference": "e6f9638b89d63f390c3ea86fd1873eaa383ef979"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/BoldGrid/library/zipball/e6f9638b89d63f390c3ea86fd1873eaa383ef979",
14
+ "reference": "e6f9638b89d63f390c3ea86fd1873eaa383ef979",
15
  "shasum": ""
16
  },
17
  "require-dev": {
18
  "yoast/phpunit-polyfills": "^1.0"
19
  },
20
+ "time": "2022-11-01T14:58:10+00:00",
21
  "type": "library",
22
  "installation-source": "dist",
23
  "autoload": {
54
  ],
55
  "description": "The BoldGrid Library for shared code used in official BoldGrid plugins and themes."
56
  },
 
 
 
 
 
 
 
 
 
 
 
 
57
  {
58
  "name": "ifsnop/mysqldump-php",
59
+ "version": "v2.9",
60
+ "version_normalized": "2.9.0.0",
61
  "source": {
62
  "type": "git",
63
+ "url": "https://github.com/ifsnop/mysqldump-php.git",
64
+ "reference": "fc9c119fe5d70af9a685cad6a8ac612fd7589e25"
65
  },
66
  "dist": {
67
  "type": "zip",
68
+ "url": "https://api.github.com/repos/ifsnop/mysqldump-php/zipball/fc9c119fe5d70af9a685cad6a8ac612fd7589e25",
69
+ "reference": "fc9c119fe5d70af9a685cad6a8ac612fd7589e25",
70
  "shasum": ""
71
  },
72
  "require": {
76
  "phpunit/phpunit": "4.8.36",
77
  "squizlabs/php_codesniffer": "1.*"
78
  },
79
+ "time": "2020-04-03T14:40:40+00:00",
80
  "type": "library",
81
+ "installation-source": "dist",
82
  "autoload": {
83
  "psr-4": {
84
  "Ifsnop\\": "src/Ifsnop/"
85
  }
86
  },
87
+ "notification-url": "https://packagist.org/downloads/",
88
  "license": [
89
  "GPL-3.0-or-later"
90
  ],
98
  "description": "PHP version of mysqldump cli that comes with MySQL",
99
  "homepage": "https://github.com/ifsnop/mysqldump-php",
100
  "keywords": [
101
+ "PHP7",
102
  "database",
103
  "hhvm",
104
  "mariadb",
108
  "pdo",
109
  "php",
110
  "php5",
 
111
  "sql"
112
+ ]
 
 
 
113
  },
114
  {
115
  "name": "phpseclib/phpseclib",
116
+ "version": "2.0.39",
117
+ "version_normalized": "2.0.39.0",
118
  "source": {
119
  "type": "git",
120
  "url": "https://github.com/phpseclib/phpseclib.git",
121
+ "reference": "f3a0e2b715c40cf1fd270d444901b63311725d63"
122
  },
123
  "dist": {
124
  "type": "zip",
125
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f3a0e2b715c40cf1fd270d444901b63311725d63",
126
+ "reference": "f3a0e2b715c40cf1fd270d444901b63311725d63",
127
  "shasum": ""
128
  },
129
  "require": {
138
  "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
139
  "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
140
  "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
141
+ "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.",
142
+ "ext-xml": "Install the XML extension to load XML formatted public keys."
143
  },
144
+ "time": "2022-10-24T10:49:03+00:00",
145
  "type": "library",
146
  "installation-source": "dist",
147
  "autoload": {
vendor/ifsnop/mysqldump-php/.gitattributes DELETED
@@ -1,5 +0,0 @@
1
- /tests export-ignore
2
- .gitattributes export-ignore
3
- .gitignore export-ignore
4
- .scrutinizer.yml export-ignore
5
- .travis.yml export-ignore
 
 
 
 
 
vendor/ifsnop/mysqldump-php/.scrutinizer.yml DELETED
@@ -1,135 +0,0 @@
1
- build:
2
- nodes:
3
- tests: true
4
- analysis:
5
- tests:
6
- override:
7
- -
8
- command: phpcs-run
9
- use_website_config: true
10
- - php-scrutinizer-run
11
- dependencies:
12
- before:
13
- - 'composer install --dev --prefer-source'
14
- # Run after dependencies
15
- project_setup:
16
- before:
17
- - 'tests/create_users.sh'
18
- environment:
19
- php:
20
- version: 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, hhvm, nightly
21
- tools:
22
- php_loc:
23
- enabled: true
24
- command: phploc
25
- excluded_dirs:
26
- - vendor
27
- - tests
28
- sensiolabs_security_checker: true
29
- filter:
30
- excluded_paths:
31
- - 'vendor/'
32
- - 'tests/'
33
- coding_style:
34
- php: { }
35
- imports:
36
- - php
37
- checks:
38
- php:
39
- verify_property_names: true
40
- verify_argument_usable_as_reference: true
41
- verify_access_scope_valid: true
42
- variable_existence: true
43
- useless_calls: true
44
- use_statement_alias_conflict: true
45
- unused_variables: true
46
- unused_properties: true
47
- unused_parameters: true
48
- unused_methods: true
49
- unreachable_code: true
50
- too_many_arguments: true
51
- symfony_request_injection: true
52
- switch_fallthrough_commented: true
53
- sql_injection_vulnerabilities: true
54
- security_vulnerabilities: true
55
- return_in_constructor: true
56
- require_scope_for_methods: true
57
- require_php_tag_first: true
58
- property_assignments: true
59
- precedence_mistakes: true
60
- precedence_in_conditions: true
61
- parse_doc_comments: true
62
- parameter_non_unique: true
63
- overriding_private_members: true
64
- overriding_parameter: true
65
- non_commented_empty_catch_block: true
66
- no_trait_type_hints: true
67
- no_trailing_whitespace: true
68
- no_short_open_tag: true
69
- no_property_on_interface: true
70
- no_non_implemented_abstract_methods: true
71
- no_exit: true
72
- no_eval: true
73
- no_error_suppression: true
74
- no_debug_code: true
75
- missing_arguments: true
76
- method_calls_on_non_object: true
77
- instanceof_class_exists: true
78
- foreach_usable_as_reference: true
79
- foreach_traversable: true
80
- fix_doc_comments: true
81
- encourage_shallow_comparison: true
82
- duplication: true
83
- deprecated_code_usage: true
84
- deadlock_detection_in_loops: true
85
- comparison_always_same_result: true
86
- code_rating: true
87
- closure_use_not_conflicting: true
88
- closure_use_modifiable: true
89
- catch_class_exists: true
90
- call_to_parent_method: true
91
- avoid_superglobals: true
92
- avoid_length_functions_in_loops: true
93
- avoid_entity_manager_injection: true
94
- avoid_duplicate_types: true
95
- avoid_closing_tag: true
96
- assignment_of_null_return: true
97
- argument_type_checks: true
98
- simplify_boolean_return: true
99
- return_doc_comments: true
100
- return_doc_comment_if_not_inferrable: true
101
- remove_extra_empty_lines: true
102
- properties_in_camelcaps: true
103
- parameters_in_camelcaps: true
104
- parameter_doc_comments: true
105
- param_doc_comment_if_not_inferrable: true
106
- no_short_variable_names:
107
- minimum: '3'
108
- no_short_method_names:
109
- minimum: '3'
110
- no_long_variable_names:
111
- maximum: '20'
112
- no_goto: true
113
- naming_conventions:
114
- local_variable: '^[a-z][a-zA-Z0-9]*$'
115
- abstract_class_name: ^Abstract|Factory$
116
- utility_class_name: 'Utils?$'
117
- constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$'
118
- property_name: '^[a-z][a-zA-Z0-9]*$'
119
- method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$'
120
- parameter_name: '^[a-z][a-zA-Z0-9]*$'
121
- interface_name: '^[A-Z][a-zA-Z0-9]*Interface$'
122
- type_name: '^[A-Z][a-zA-Z0-9]*$'
123
- exception_name: '^[A-Z][a-zA-Z0-9]*Exception$'
124
- isser_method_name: '^(?:is|has|should|may|supports)'
125
- more_specific_types_in_doc_comments: true
126
- fix_use_statements:
127
- remove_unused: true
128
- preserve_multiple: false
129
- preserve_blanklines: false
130
- order_alphabetically: false
131
- fix_line_ending: true
132
- check_method_contracts:
133
- verify_interface_like_constraints: true
134
- verify_documented_constraints: true
135
- verify_parent_constraints: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/.travis.yml DELETED
@@ -1,279 +0,0 @@
1
- language: php
2
-
3
- matrix:
4
- include:
5
- - php: 5.3
6
- dist: precise
7
- sudo: required
8
- services:
9
- - mysql
10
- before_script:
11
- - curl -s http://getcomposer.org/installer | php
12
- - php composer.phar install
13
- - mysql -V
14
- - mysqldump -V
15
- - tests/create_users.sh
16
- script:
17
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
18
- - php src/Ifsnop/Mysqldump/Mysqldump.php
19
- - vendor/bin/phpunit
20
- - cd tests && ./test.sh
21
- before_install:
22
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
23
- - php: 5.4
24
- dist: precise
25
- sudo: required
26
- services:
27
- - mysql
28
- before_script:
29
- - curl -s http://getcomposer.org/installer | php
30
- - php composer.phar install
31
- - mysql -V
32
- - mysqldump -V
33
- - tests/create_users.sh
34
- script:
35
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
36
- - php src/Ifsnop/Mysqldump/Mysqldump.php
37
- - vendor/bin/phpunit
38
- - cd tests && ./test.sh
39
- before_install:
40
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
41
- - php: 5.5
42
- dist: precise
43
- sudo: required
44
- services:
45
- - mysql
46
- before_script:
47
- - curl -s http://getcomposer.org/installer | php
48
- - php composer.phar install
49
- - mysql -V
50
- - mysqldump -V
51
- - tests/create_users.sh
52
- script:
53
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
54
- - php src/Ifsnop/Mysqldump/Mysqldump.php
55
- - vendor/bin/phpunit
56
- - cd tests && ./test.sh
57
- before_install:
58
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
59
- - php: 5.6
60
- dist: precise
61
- sudo: required
62
- services:
63
- - mysql
64
- before_script:
65
- - curl -s http://getcomposer.org/installer | php
66
- - php composer.phar install
67
- - mysql -V
68
- - mysqldump -V
69
- - tests/create_users.sh
70
- script:
71
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
72
- - php src/Ifsnop/Mysqldump/Mysqldump.php
73
- - vendor/bin/phpunit
74
- - cd tests && ./test.sh
75
- before_install:
76
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
77
- - php: 5.6
78
- dist: xenial
79
- sudo: required
80
- services:
81
- - mysql
82
- before_script:
83
- - curl -s http://getcomposer.org/installer | php
84
- - php composer.phar install
85
- - mysql -V
86
- - mysqldump -V
87
- - tests/create_users.sh
88
- script:
89
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
90
- - php src/Ifsnop/Mysqldump/Mysqldump.php
91
- - vendor/bin/phpunit
92
- - cd tests && ./test.sh
93
- before_install:
94
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
95
- - php: 7.0
96
- dist: xenial
97
- sudo: required
98
- services:
99
- - mysql
100
- before_script:
101
- - curl -s http://getcomposer.org/installer | php
102
- - php composer.phar install
103
- - mysql -V
104
- - mysqldump -V
105
- - tests/create_users.sh
106
- script:
107
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
108
- - php src/Ifsnop/Mysqldump/Mysqldump.php
109
- - vendor/bin/phpunit
110
- - cd tests && ./test.sh
111
- before_install:
112
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
113
- - php: 7.1
114
- dist: xenial
115
- sudo: required
116
- services:
117
- - mysql
118
- before_script:
119
- - curl -s http://getcomposer.org/installer | php
120
- - php composer.phar install
121
- - mysql -V
122
- - mysqldump -V
123
- - tests/create_users.sh
124
- script:
125
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
126
- - php src/Ifsnop/Mysqldump/Mysqldump.php
127
- - vendor/bin/phpunit
128
- - cd tests && ./test.sh
129
- before_install:
130
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
131
- - php: 7.2
132
- dist: xenial
133
- sudo: required
134
- services:
135
- - mysql
136
- before_script:
137
- - curl -s http://getcomposer.org/installer | php
138
- - php composer.phar install
139
- - mysql -V
140
- - mysqldump -V
141
- - tests/create_users.sh
142
- script:
143
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
144
- - php src/Ifsnop/Mysqldump/Mysqldump.php
145
- - vendor/bin/phpunit
146
- - cd tests && ./test.sh
147
- before_install:
148
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
149
- - php: 7.3
150
- dist: xenial
151
- sudo: required
152
- services:
153
- - mysql
154
- before_script:
155
- - curl -s http://getcomposer.org/installer | php
156
- - php composer.phar install
157
- - mysql -V
158
- - mysqldump -V
159
- - tests/create_users.sh
160
- script:
161
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
162
- - php src/Ifsnop/Mysqldump/Mysqldump.php
163
- - vendor/bin/phpunit
164
- - cd tests && ./test.sh
165
- before_install:
166
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
167
- - php: 7.4
168
- dist: xenial
169
- sudo: required
170
- services:
171
- - mysql
172
- before_script:
173
- - curl -s http://getcomposer.org/installer | php
174
- - php composer.phar install
175
- - mysql -V
176
- - mysqldump -V
177
- - tests/create_users.sh
178
- script:
179
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
180
- - php src/Ifsnop/Mysqldump/Mysqldump.php
181
- - vendor/bin/phpunit
182
- - cd tests && ./test.sh
183
- before_install:
184
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
185
- - php: nightly
186
- dist: xenial
187
- sudo: required
188
- services:
189
- - mysql
190
- before_script:
191
- - curl -s http://getcomposer.org/installer | php
192
- - php composer.phar install
193
- - mysql -V
194
- - mysqldump -V
195
- - tests/create_users.sh
196
- script:
197
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
198
- - php src/Ifsnop/Mysqldump/Mysqldump.php
199
- - vendor/bin/phpunit
200
- - cd tests && ./test.sh
201
- before_install:
202
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
203
- - php: hhvm-3.18
204
- dist: xenial
205
- sudo: required
206
- services:
207
- - mysql
208
- before_script:
209
- - curl -s http://getcomposer.org/installer | php
210
- - php composer.phar install
211
- - mysql -V
212
- - mysqldump -V
213
- - tests/create_users.sh
214
- script:
215
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
216
- - php src/Ifsnop/Mysqldump/Mysqldump.php
217
- - vendor/bin/phpunit
218
- - cd tests && ./test.sh
219
- before_install:
220
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
221
- - php: hhvm-3.21
222
- dist: xenial
223
- sudo: required
224
- services:
225
- - mysql
226
- before_script:
227
- - curl -s http://getcomposer.org/installer | php
228
- - php composer.phar install
229
- - mysql -V
230
- - mysqldump -V
231
- - tests/create_users.sh
232
- script:
233
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
234
- - php src/Ifsnop/Mysqldump/Mysqldump.php
235
- - vendor/bin/phpunit
236
- - cd tests && ./test.sh
237
- before_install:
238
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
239
- - php: hhvm-3.24
240
- dist: xenial
241
- sudo: required
242
- services:
243
- - mysql
244
- before_script:
245
- - curl -s http://getcomposer.org/installer | php
246
- - php composer.phar install
247
- - mysql -V
248
- - mysqldump -V
249
- - tests/create_users.sh
250
- script:
251
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
252
- - php src/Ifsnop/Mysqldump/Mysqldump.php
253
- - vendor/bin/phpunit
254
- - cd tests && ./test.sh
255
- before_install:
256
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
257
- - php: hhvm
258
- dist: xenial
259
- sudo: required
260
- services:
261
- - mysql
262
- before_script:
263
- - curl -s http://getcomposer.org/installer | php
264
- - php composer.phar install
265
- - mysql -V
266
- - mysqldump -V
267
- - tests/create_users.sh
268
- script:
269
- - php -l src/Ifsnop/Mysqldump/Mysqldump.php
270
- - php src/Ifsnop/Mysqldump/Mysqldump.php
271
- - vendor/bin/phpunit
272
- - cd tests && ./test.sh
273
- before_install:
274
- - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
275
-
276
- allow_failures:
277
- - php: 5.3
278
- - php: nightly
279
- - php: hhvm
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/README.md CHANGED
@@ -89,23 +89,36 @@ Plain old PHP:
89
  Refer to the [wiki](https://github.com/ifsnop/mysqldump-php/wiki/Full-usage-example) for some examples and a comparision between mysqldump and mysqldump-php dumps.
90
 
91
  ## Changing values when exporting
 
92
  You can register a callable that will be used to transform values during the export. An example use-case for this is removing sensitive data from database dumps:
93
 
94
  ```php
95
  $dumper = new IMysqldump\Mysqldump('mysql:host=localhost;dbname=testdb', 'username', 'password');
96
 
97
- $dumper->setTransformColumnValueHook(function ($tableName, $colName, $colValue) {
98
- if ($colName === 'social_security_number') {
99
- return (string) rand(1000000, 9999999);
100
  }
101
 
102
- return $colValue;
103
  });
104
 
105
  $dumper->start('storage/work/dump.sql');
106
  ```
107
 
 
 
 
 
 
 
 
 
 
 
 
108
  ## Table specific export conditions
 
109
  You can register table specific 'where' clauses to limit data on a per table basis. These override the default `where` dump setting:
110
 
111
  ```php
@@ -119,6 +132,7 @@ $dumper->setTableWheres(array(
119
  ```
120
 
121
  ## Table specific export limits
 
122
  You can register table specific 'limits' to limit the returned rows on a per table basis:
123
 
124
  ```php
@@ -132,6 +146,7 @@ $dumper->setTableLimits(array(
132
  ```
133
 
134
  ## Constructor and default parameters
 
135
  ```php
136
  /**
137
  * Constructor of Mysqldump. Note that in the case of an SQLite database
@@ -200,9 +215,11 @@ $this->_dumpSettings = self::array_replace_recursive($dumpSettingsDefault, $dump
200
  ## Dump Settings
201
 
202
  - **include-tables**
203
- - Only include these tables (array of table names), include all if empty
204
  - **exclude-tables**
205
- - Exclude these tables (array of table names), include all if empty, supports regexps
 
 
206
  - **compress**
207
  - Gzip, Bzip2, None.
208
  - Could be specified using the declared consts: IMysqldump\Mysqldump::GZIP, IMysqldump\Mysqldump::BZIP2 or IMysqldump\Mysqldump::NONE
89
  Refer to the [wiki](https://github.com/ifsnop/mysqldump-php/wiki/Full-usage-example) for some examples and a comparision between mysqldump and mysqldump-php dumps.
90
 
91
  ## Changing values when exporting
92
+
93
  You can register a callable that will be used to transform values during the export. An example use-case for this is removing sensitive data from database dumps:
94
 
95
  ```php
96
  $dumper = new IMysqldump\Mysqldump('mysql:host=localhost;dbname=testdb', 'username', 'password');
97
 
98
+ $dumper->setTransformTableRowHook(function ($tableName, array $row) {
99
+ if ($tableName === 'customers') {
100
+ $row['social_security_number'] = (string) rand(1000000, 9999999);
101
  }
102
 
103
+ return $row;
104
  });
105
 
106
  $dumper->start('storage/work/dump.sql');
107
  ```
108
 
109
+ ## Getting information about the dump
110
+
111
+ You can register a callable that will be used to report on the progress of the dump
112
+
113
+ ```php
114
+ $dumper->setInfoHook(function($object, $info) {
115
+ if ($object === 'table') {
116
+ echo $info['name'], $info['rowCount'];
117
+ });
118
+ ```
119
+
120
  ## Table specific export conditions
121
+
122
  You can register table specific 'where' clauses to limit data on a per table basis. These override the default `where` dump setting:
123
 
124
  ```php
132
  ```
133
 
134
  ## Table specific export limits
135
+
136
  You can register table specific 'limits' to limit the returned rows on a per table basis:
137
 
138
  ```php
146
  ```
147
 
148
  ## Constructor and default parameters
149
+
150
  ```php
151
  /**
152
  * Constructor of Mysqldump. Note that in the case of an SQLite database
215
  ## Dump Settings
216
 
217
  - **include-tables**
218
+ - Only include these tables (array of table names), include all if empty.
219
  - **exclude-tables**
220
+ - Exclude these tables (array of table names), include all if empty, supports regexps.
221
+ - **include-views**
222
+ - Only include these views (array of view names), include all if empty. By default, all views named as the include-tables array are included.
223
  - **compress**
224
  - Gzip, Bzip2, None.
225
  - Could be specified using the declared consts: IMysqldump\Mysqldump::GZIP, IMysqldump\Mysqldump::BZIP2 or IMysqldump\Mysqldump::NONE
vendor/ifsnop/mysqldump-php/phpunit.xml DELETED
@@ -1,21 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
- xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
4
- bootstrap="vendor/autoload.php"
5
- backupGlobals="false"
6
- beStrictAboutCoversAnnotation="true"
7
- beStrictAboutOutputDuringTests="true"
8
- beStrictAboutTestsThatDoNotTestAnything="true"
9
- beStrictAboutTodoAnnotatedTests="true"
10
- colors="true"
11
- verbose="true">
12
- <testsuite name="default">
13
- <directory suffix="Test.php">unit-tests</directory>
14
- </testsuite>
15
-
16
- <filter>
17
- <whitelist processUncoveredFilesFromWhitelist="true">
18
- <directory suffix=".php">src</directory>
19
- </whitelist>
20
- </filter>
21
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php CHANGED
@@ -83,7 +83,9 @@ class Mysqldump
83
  private $pdoSettings = array();
84
  private $version;
85
  private $tableColumnTypes = array();
 
86
  private $transformColumnValueCallable;
 
87
 
88
  /**
89
  * Database name, parsed from dsn.
@@ -112,6 +114,7 @@ class Mysqldump
112
  private $tableWheres = array();
113
  private $tableLimits = array();
114
 
 
115
  /**
116
  * Constructor of Mysqldump. Note that in the case of an SQLite database
117
  * connection, the filename must be in the $db parameter.
@@ -198,8 +201,8 @@ class Mysqldump
198
  }
199
 
200
  // If no include-views is passed in, dump the same views as tables, mimic mysqldump behaviour.
201
- if ( ! isset( $dumpSettings['include-views'] ) ) {
202
- $this->dumpSettings['include-views'] = $this->dumpSettings['include-tables'];
203
  }
204
 
205
  // Create a new compressManager to manage compressed output
@@ -726,6 +729,7 @@ class Mysqldump
726
  foreach ($this->triggers as $trigger) {
727
  $this->getTriggerStructure($trigger);
728
  }
 
729
  }
730
 
731
  /**
@@ -1014,12 +1018,20 @@ class Mysqldump
1014
  *
1015
  * @return array
1016
  */
1017
- private function prepareColumnValues($tableName, $row)
1018
  {
1019
  $ret = array();
1020
  $columnTypes = $this->tableColumnTypes[$tableName];
 
 
 
 
 
1021
  foreach ($row as $colName => $colValue) {
1022
- $colValue = $this->hookTransformColumnValue($tableName, $colName, $colValue, $row);
 
 
 
1023
  $ret[] = $this->escape($colValue, $columnTypes[$colName]);
1024
  }
1025
 
@@ -1052,11 +1064,25 @@ class Mysqldump
1052
  }
1053
 
1054
  /**
1055
- * Set a callable that will will be used to transform column values.
 
 
 
 
 
 
 
 
 
 
 
 
1056
  *
1057
  * @param callable $callable
1058
  *
1059
  * @return void
 
 
1060
  */
1061
  public function setTransformColumnValueHook($callable)
1062
  {
@@ -1064,26 +1090,15 @@ class Mysqldump
1064
  }
1065
 
1066
  /**
1067
- * Give extending classes an opportunity to transform column values
1068
  *
1069
- * @param string $tableName Name of table which contains rows
1070
- * @param string $colName Name of the column in question
1071
- * @param string $colValue Value of the column in question
1072
  *
1073
- * @return string
1074
  */
1075
- protected function hookTransformColumnValue($tableName, $colName, $colValue, $row)
1076
  {
1077
- if (!$this->transformColumnValueCallable) {
1078
- return $colValue;
1079
- }
1080
-
1081
- return call_user_func_array($this->transformColumnValueCallable, array(
1082
- $tableName,
1083
- $colName,
1084
- $colValue,
1085
- $row
1086
- ));
1087
  }
1088
 
1089
  /**
@@ -1160,6 +1175,10 @@ class Mysqldump
1160
  }
1161
 
1162
  $this->endListValues($tableName, $count);
 
 
 
 
1163
  }
1164
 
1165
  /**
@@ -1461,39 +1480,39 @@ class CompressNone extends CompressManagerFactory
1461
 
1462
  class CompressGzipstream extends CompressManagerFactory
1463
  {
1464
- private $fileHandler = null;
1465
 
1466
- private $compressContext;
1467
 
1468
- /**
1469
- * @param string $filename
1470
- */
1471
- public function open($filename)
1472
- {
1473
  $this->fileHandler = fopen($filename, "wb");
1474
  if (false === $this->fileHandler) {
1475
- throw new Exception("Output file is not writable");
1476
  }
1477
 
1478
  $this->compressContext = deflate_init(ZLIB_ENCODING_GZIP, array('level' => 9));
1479
  return true;
1480
- }
1481
 
1482
- public function write($str)
1483
- {
1484
 
1485
  $bytesWritten = fwrite($this->fileHandler, deflate_add($this->compressContext, $str, ZLIB_NO_FLUSH));
1486
  if (false === $bytesWritten) {
1487
- throw new Exception("Writting to file failed! Probably, there is no more free space left?");
1488
  }
1489
  return $bytesWritten;
1490
- }
1491
 
1492
- public function close()
1493
- {
1494
  fwrite($this->fileHandler, deflate_add($this->compressContext, '', ZLIB_FINISH));
1495
  return fclose($this->fileHandler);
1496
- }
1497
  }
1498
 
1499
  /**
@@ -1945,7 +1964,7 @@ class TypeAdapterMysql extends TypeAdapterFactory
1945
  "Please check 'https://bugs.mysql.com/bug.php?id=14564'");
1946
  }
1947
  $procedureStmt = $row['Create Procedure'];
1948
- if ( $this->dumpSettings['skip-definer'] ) {
1949
  if ($procedureStmtReplaced = preg_replace(
1950
  '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(PROCEDURE\s.*)$/s',
1951
  '\1 \3',
@@ -2135,7 +2154,7 @@ class TypeAdapterMysql extends TypeAdapterFactory
2135
 
2136
  public function start_transaction()
2137
  {
2138
- return "START TRANSACTION " .
2139
  "/*!40100 WITH CONSISTENT SNAPSHOT */";
2140
  }
2141
 
83
  private $pdoSettings = array();
84
  private $version;
85
  private $tableColumnTypes = array();
86
+ private $transformTableRowCallable;
87
  private $transformColumnValueCallable;
88
+ private $infoCallable;
89
 
90
  /**
91
  * Database name, parsed from dsn.
114
  private $tableWheres = array();
115
  private $tableLimits = array();
116
 
117
+
118
  /**
119
  * Constructor of Mysqldump. Note that in the case of an SQLite database
120
  * connection, the filename must be in the $db parameter.
201
  }
202
 
203
  // If no include-views is passed in, dump the same views as tables, mimic mysqldump behaviour.
204
+ if (!isset($dumpSettings['include-views'])) {
205
+ $this->dumpSettings['include-views'] = $this->dumpSettings['include-tables'];
206
  }
207
 
208
  // Create a new compressManager to manage compressed output
729
  foreach ($this->triggers as $trigger) {
730
  $this->getTriggerStructure($trigger);
731
  }
732
+
733
  }
734
 
735
  /**
1018
  *
1019
  * @return array
1020
  */
1021
+ private function prepareColumnValues($tableName, array $row)
1022
  {
1023
  $ret = array();
1024
  $columnTypes = $this->tableColumnTypes[$tableName];
1025
+
1026
+ if ($this->transformTableRowCallable) {
1027
+ $row = call_user_func($this->transformTableRowCallable, $tableName, $row);
1028
+ }
1029
+
1030
  foreach ($row as $colName => $colValue) {
1031
+ if ($this->transformColumnValueCallable) {
1032
+ $colValue = call_user_func($this->transformColumnValueCallable, $tableName, $colName, $colValue, $row);
1033
+ }
1034
+
1035
  $ret[] = $this->escape($colValue, $columnTypes[$colName]);
1036
  }
1037
 
1064
  }
1065
 
1066
  /**
1067
+ * Set a callable that will be used to transform table rows
1068
+ *
1069
+ * @param callable $callable
1070
+ *
1071
+ * @return void
1072
+ */
1073
+ public function setTransformTableRowHook($callable)
1074
+ {
1075
+ $this->transformTableRowCallable = $callable;
1076
+ }
1077
+
1078
+ /**
1079
+ * Set a callable that will be used to transform column values
1080
  *
1081
  * @param callable $callable
1082
  *
1083
  * @return void
1084
+ *
1085
+ * @deprecated Use setTransformTableRowHook instead for better performance
1086
  */
1087
  public function setTransformColumnValueHook($callable)
1088
  {
1090
  }
1091
 
1092
  /**
1093
+ * Set a callable that will be used to report dump information
1094
  *
1095
+ * @param callable $callable
 
 
1096
  *
1097
+ * @return void
1098
  */
1099
+ public function setInfoHook($callable)
1100
  {
1101
+ $this->infoCallable = $callable;
 
 
 
 
 
 
 
 
 
1102
  }
1103
 
1104
  /**
1175
  }
1176
 
1177
  $this->endListValues($tableName, $count);
1178
+
1179
+ if ($this->infoCallable) {
1180
+ call_user_func($this->infoCallable, 'table', array('name' => $tableName, 'rowCount' => $count));
1181
+ }
1182
  }
1183
 
1184
  /**
1480
 
1481
  class CompressGzipstream extends CompressManagerFactory
1482
  {
1483
+ private $fileHandler = null;
1484
 
1485
+ private $compressContext;
1486
 
1487
+ /**
1488
+ * @param string $filename
1489
+ */
1490
+ public function open($filename)
1491
+ {
1492
  $this->fileHandler = fopen($filename, "wb");
1493
  if (false === $this->fileHandler) {
1494
+ throw new Exception("Output file is not writable");
1495
  }
1496
 
1497
  $this->compressContext = deflate_init(ZLIB_ENCODING_GZIP, array('level' => 9));
1498
  return true;
1499
+ }
1500
 
1501
+ public function write($str)
1502
+ {
1503
 
1504
  $bytesWritten = fwrite($this->fileHandler, deflate_add($this->compressContext, $str, ZLIB_NO_FLUSH));
1505
  if (false === $bytesWritten) {
1506
+ throw new Exception("Writting to file failed! Probably, there is no more free space left?");
1507
  }
1508
  return $bytesWritten;
1509
+ }
1510
 
1511
+ public function close()
1512
+ {
1513
  fwrite($this->fileHandler, deflate_add($this->compressContext, '', ZLIB_FINISH));
1514
  return fclose($this->fileHandler);
1515
+ }
1516
  }
1517
 
1518
  /**
1964
  "Please check 'https://bugs.mysql.com/bug.php?id=14564'");
1965
  }
1966
  $procedureStmt = $row['Create Procedure'];
1967
+ if ($this->dumpSettings['skip-definer']) {
1968
  if ($procedureStmtReplaced = preg_replace(
1969
  '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(PROCEDURE\s.*)$/s',
1970
  '\1 \3',
2154
 
2155
  public function start_transaction()
2156
  {
2157
+ return "START TRANSACTION ".
2158
  "/*!40100 WITH CONSISTENT SNAPSHOT */";
2159
  }
2160
 
vendor/ifsnop/mysqldump-php/tests/create_users.sh DELETED
@@ -1,26 +0,0 @@
1
- #!/bin/bash
2
-
3
- mysql -u root -e "CREATE USER 'travis'@'%';"
4
- mysql -u root -e "CREATE DATABASE test001;"
5
- mysql -u root -e "CREATE DATABASE test002;"
6
- mysql -u root -e "CREATE DATABASE test005;"
7
- mysql -u root -e "CREATE DATABASE test006a;"
8
- mysql -u root -e "CREATE DATABASE test006b;"
9
- mysql -u root -e "CREATE DATABASE test008;"
10
- mysql -u root -e "CREATE DATABASE test009;"
11
- mysql -u root -e "CREATE DATABASE test010;"
12
- mysql -u root -e "CREATE DATABASE test011;"
13
- mysql -u root -e "CREATE DATABASE test012;"
14
- mysql -u root -e "GRANT ALL PRIVILEGES ON test001.* TO 'travis'@'%' WITH GRANT OPTION;"
15
- mysql -u root -e "GRANT ALL PRIVILEGES ON test002.* TO 'travis'@'%' WITH GRANT OPTION;"
16
- mysql -u root -e "GRANT ALL PRIVILEGES ON test005.* TO 'travis'@'%' WITH GRANT OPTION;"
17
- mysql -u root -e "GRANT ALL PRIVILEGES ON test006a.* TO 'travis'@'%' WITH GRANT OPTION;"
18
- mysql -u root -e "GRANT ALL PRIVILEGES ON test006b.* TO 'travis'@'%' WITH GRANT OPTION;"
19
- mysql -u root -e "GRANT ALL PRIVILEGES ON test008.* TO 'travis'@'%' WITH GRANT OPTION;"
20
- mysql -u root -e "GRANT ALL PRIVILEGES ON test009.* TO 'travis'@'%' WITH GRANT OPTION;"
21
- mysql -u root -e "GRANT ALL PRIVILEGES ON test010.* TO 'travis'@'%' WITH GRANT OPTION;"
22
- mysql -u root -e "GRANT ALL PRIVILEGES ON test011.* TO 'travis'@'%' WITH GRANT OPTION;"
23
- mysql -u root -e "GRANT ALL PRIVILEGES ON test012.* TO 'travis'@'%' WITH GRANT OPTION;"
24
- mysql -u root -e "GRANT SUPER,LOCK TABLES ON *.* TO 'travis'@'%';"
25
- mysql -u root -e "GRANT SELECT ON mysql.proc to 'travis'@'%';"
26
- mysql -u root -e "FLUSH PRIVILEGES;"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/delete_users.sh DELETED
@@ -1,16 +0,0 @@
1
- #!/bin/bash
2
-
3
- mysql -e "DROP DATABASE test001;"
4
- mysql -e "DROP DATABASE test002;"
5
- mysql -e "DROP DATABASE test005;"
6
- mysql -e "DROP DATABASE test006a;"
7
- mysql -e "DROP DATABASE test006b;"
8
- mysql -e "DROP DATABASE test008;"
9
- mysql -e "DROP DATABASE test009;"
10
- mysql -e "DROP DATABASE test010;"
11
- mysql -e "DROP DATABASE test011;"
12
- mysql -e "DROP DATABASE test012;"
13
-
14
- mysql -e "DROP USER 'travis'";
15
-
16
- mysql -e "FLUSH PRIVILEGES;"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test.php DELETED
@@ -1,165 +0,0 @@
1
- <?php
2
- /*
3
- for($i=0;$i<128;$i++) {
4
- echo "$i>" . bin2hex(chr($i)) . "<" . PHP_EOL;
5
- }
6
- */
7
- date_default_timezone_set('UTC');
8
-
9
- error_reporting(E_ALL);
10
-
11
- include_once(dirname(__FILE__) . "/../src/Ifsnop/Mysqldump/Mysqldump.php");
12
-
13
- use Ifsnop\Mysqldump as IMysqldump;
14
-
15
- $dumpSettings = array(
16
- 'exclude-tables' => array('/^travis*/'),
17
- 'compress' => IMysqldump\Mysqldump::NONE,
18
- 'no-data' => false,
19
- 'add-drop-table' => true,
20
- 'single-transaction' => true,
21
- 'lock-tables' => true,
22
- 'add-locks' => true,
23
- 'extended-insert' => false,
24
- 'disable-keys' => true,
25
- 'skip-triggers' => false,
26
- 'add-drop-trigger' => true,
27
- 'routines' => true,
28
- 'databases' => false,
29
- 'add-drop-database' => false,
30
- 'hex-blob' => true,
31
- 'no-create-info' => false,
32
- 'where' => ''
33
- );
34
-
35
- // do nothing test
36
- print "starting mysql-php_test000.sql" . PHP_EOL;
37
- $dump = new IMysqldump\Mysqldump(
38
- "mysql:host=localhost;dbname=test001",
39
- "travis",
40
- ""
41
- );
42
-
43
- print "starting mysql-php_test001.sql" . PHP_EOL;
44
- $dump = new IMysqldump\Mysqldump(
45
- "mysql:host=localhost;dbname=test001",
46
- "travis",
47
- "",
48
- $dumpSettings);
49
- $dump->start("mysqldump-php_test001.sql");
50
-
51
- // checks if complete-insert && hex-blob works ok together
52
- print "starting mysql-php_test001_complete.sql" . PHP_EOL;
53
- $dumpSettings['complete-insert'] = true;
54
- $dump = new IMysqldump\Mysqldump(
55
- "mysql:host=localhost;dbname=test001",
56
- "travis",
57
- "",
58
- $dumpSettings);
59
- $dump->start("mysqldump-php_test001_complete.sql");
60
-
61
- print "starting mysql-php_test002.sql" . PHP_EOL;
62
- $dumpSettings['default-character-set'] = IMysqldump\Mysqldump::UTF8MB4;
63
- $dumpSettings['complete-insert'] = true;
64
- $dump = new IMysqldump\Mysqldump(
65
- "mysql:host=localhost;dbname=test002",
66
- "travis",
67
- "",
68
- $dumpSettings);
69
- $dump->start("mysqldump-php_test002.sql");
70
-
71
- print "starting mysql-php_test005.sql" . PHP_EOL;
72
- $dumpSettings['complete-insert'] = false;
73
- $dump = new IMysqldump\Mysqldump(
74
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test005",
75
- "travis",
76
- "",
77
- $dumpSettings);
78
- $dump->start("mysqldump-php_test005.sql");
79
-
80
- print "starting mysql-php_test006.sql" . PHP_EOL;
81
- $dump = new IMysqldump\Mysqldump(
82
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test006a",
83
- "travis",
84
- "",
85
- array("no-data" => true, "add-drop-table" => true));
86
- $dump->start("mysqldump-php_test006.sql");
87
-
88
- print "starting mysql-php_test008.sql" . PHP_EOL;
89
- $dump = new IMysqldump\Mysqldump(
90
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test008",
91
- "travis",
92
- "",
93
- array("no-data" => true, "add-drop-table" => true));
94
- $dump->start("mysqldump-php_test008.sql");
95
-
96
- print "starting mysql-php_test009.sql" . PHP_EOL;
97
- $dump = new IMysqldump\Mysqldump(
98
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test009",
99
- "travis",
100
- "",
101
- array("no-data" => true, "add-drop-table" => true, "reset-auto-increment" => true, "add-drop-database" => true));
102
- $dump->start("mysqldump-php_test009.sql");
103
-
104
- print "starting mysql-php_test010.sql" . PHP_EOL;
105
- $dump = new IMysqldump\Mysqldump(
106
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test010",
107
- "travis",
108
- "",
109
- array("events" => true));
110
- $dump->start("mysqldump-php_test010.sql");
111
-
112
- print "starting mysql-php_test011a.sql" . PHP_EOL;
113
- $dump = new IMysqldump\Mysqldump(
114
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test011",
115
- "travis",
116
- "",
117
- array('complete-insert' => false));
118
- $dump->start("mysqldump-php_test011a.sql");
119
-
120
- print "starting mysql-php_test011b.sql" . PHP_EOL;
121
- $dump = new IMysqldump\Mysqldump(
122
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test011",
123
- "travis",
124
- "",
125
- array('complete-insert' => true));
126
- $dump->start("mysqldump-php_test011b.sql");
127
-
128
- print "starting mysql-php_test012.sql" . PHP_EOL;
129
- $dump = new IMysqldump\Mysqldump(
130
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test012",
131
- "travis",
132
- "",
133
- array("events" => true,
134
- 'skip-triggers' => false,
135
- 'routines' => true,
136
- 'add-drop-trigger' => true,
137
- ));
138
- $dump->start("mysqldump-php_test012.sql");
139
-
140
- print "starting mysql-php_test012b_no-definer.sql" . PHP_EOL;
141
- $dump = new IMysqldump\Mysqldump(
142
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test012",
143
- "travis",
144
- "",
145
- array(
146
- "events" => true,
147
- 'skip-triggers' => false,
148
- 'routines' => true,
149
- 'add-drop-trigger' => true,
150
- 'skip-definer' => true,
151
- ));
152
- $dump->start("mysqldump-php_test012_no-definer.sql");
153
-
154
- print "starting mysql-php_test013.sql" . PHP_EOL;
155
- $dump = new IMysqldump\Mysqldump(
156
- "mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=test001",
157
- "travis",
158
- "",
159
- array(
160
- "insert-ignore" => true,
161
- "extended-insert" => false
162
- ));
163
- $dump->start("mysqldump-php_test013.sql");
164
-
165
- exit(0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test.sh DELETED
@@ -1,284 +0,0 @@
1
- #!/bin/bash
2
-
3
- major=`mysql -u travis -e "SELECT @@version\G" | grep version |awk '{print $2}' | awk -F"." '{print $1}'`
4
- medium=`mysql -u travis -e "SELECT @@version\G" | grep version |awk '{print $2}' | awk -F"." '{print $2}'`
5
- minor=`mysql -u travis -e "SELECT @@version\G" | grep version |awk '{print $2}' | awk -F"." '{print $3}'`
6
-
7
- echo Testing against mysql server version $major.$medium.$minor
8
-
9
- function checksum_test001() {
10
- for i in 000 001 002 003 010 011 015 027 029 033 200; do
11
- mysql -utravis -B -e "CHECKSUM TABLE test${i}" test001 | grep -v -i checksum
12
- done
13
- }
14
-
15
- function checksum_test002() {
16
- for i in 201; do
17
- mysql -utravis --default-character-set=utf8mb4 -B -e "CHECKSUM TABLE test${i}" test002 | grep -v -i checksum
18
- done
19
- }
20
-
21
- function checksum_test005() {
22
- for i in 000; do
23
- mysql -utravis -B -e "CHECKSUM TABLE test${i}" test001 | grep -v -i checksum
24
- done
25
- }
26
-
27
- for i in $(seq 0 40) ; do
28
- ret[$i]=0
29
- done
30
-
31
- index=0
32
-
33
- mysql -utravis < test001.src.sql; errCode=$?; ret[((index++))]=$errCode
34
- if [[ $errCode -ne 0 ]]; then echo "error test001.src.sql"; fi
35
-
36
- mysql -utravis --default-character-set=utf8mb4 < test002.src.sql; errCode=$?; ret[((index++))]=$errCode
37
- if [[ $errCode -ne 0 ]]; then echo "error test002.src.sql"; fi
38
-
39
- mysql -utravis < test005.src.sql; errCode=$?; ret[((index++))]=$errCode
40
- if [[ $errCode -ne 0 ]]; then echo "error test005.src.sql"; fi
41
-
42
- mysql -utravis < test006.src.sql; errCode=$?; ret[((index++))]=$errCode
43
- if [[ $errCode -ne 0 ]]; then echo "error test006.src.sql"; fi
44
-
45
- mysql -utravis < test008.src.sql; errCode=$?; ret[((index++))]=$errCode
46
- if [[ $errCode -ne 0 ]]; then echo "error test008.src.sql"; fi
47
-
48
- mysql -utravis < test009.src.sql; errCode=$?; ret[((index++))]=$errCode
49
- if [[ $errCode -ne 0 ]]; then echo "error test001.src.sql"; fi
50
-
51
- mysql -utravis < test010.src.sql; errCode=$?; ret[((index++))]=$errCode
52
- if [[ $errCode -ne 0 ]]; then echo "error test010.src.sql"; fi
53
-
54
- if [[ $major -eq 5 && $medium -ge 7 ]]; then
55
- # test virtual column support, with simple inserts forced to complete (a) and complete inserts (b)
56
- mysql -utravis < test011.src.sql; errCode=$?; ret[((index++))]=$errCode
57
- else
58
- echo "test011 disabled, only valid for mysql server version > 5.7.0"
59
- fi
60
- mysql -utravis < test012.src.sql; errCode=$?; ret[((index++))]=$errCode
61
- #mysql -utravis < test013.src.sql; errCode=$?; ret[((index++))]=$errCode
62
-
63
- checksum_test001 > test001.src.checksum
64
- checksum_test002 > test002.src.checksum
65
- checksum_test005 > test005.src.checksum
66
- mysqldump -utravis test001 \
67
- --no-autocommit \
68
- --skip-extended-insert \
69
- --hex-blob \
70
- --routines \
71
- > mysqldump_test001.sql
72
- errCode=$?; ret[((index++))]=$errCode
73
-
74
- mysqldump -utravis test001 \
75
- --no-autocommit \
76
- --skip-extended-insert \
77
- --complete-insert=true \
78
- --hex-blob \
79
- --routines \
80
- > mysqldump_test001_complete.sql
81
- errCode=$?; ret[((index++))]=$errCode
82
-
83
- mysqldump -utravis test002 \
84
- --no-autocommit \
85
- --skip-extended-insert \
86
- --complete-insert \
87
- --hex-blob \
88
- --default-character-set=utf8mb4 \
89
- > mysqldump_test002.sql
90
- errCode=$?; ret[((index++))]=$errCode
91
-
92
- mysqldump -utravis test005 \
93
- --no-autocommit \
94
- --skip-extended-insert \
95
- --hex-blob \
96
- > mysqldump_test005.sql
97
- errCode=$?; ret[((index++))]=$errCode
98
-
99
- mysqldump -utravis test012 \
100
- --no-autocommit \
101
- --skip-extended-insert \
102
- --hex-blob \
103
- --events \
104
- --routines \
105
- > mysqldump_test012.sql
106
- errCode=$?; ret[((index++))]=$errCode
107
-
108
- mysqldump -utravis test001 \
109
- --no-autocommit \
110
- --skip-extended-insert \
111
- --hex-blob \
112
- --insert-ignore \
113
- > mysqldump_test013.sql
114
- errCode=$?; ret[((index++))]=$errCode
115
-
116
- php test.php || { echo "ERROR running test.php" && exit -1; }
117
- errCode=$?; ret[((index++))]=$errCode
118
-
119
- mysql -utravis test001 < mysqldump-php_test001.sql
120
- errCode=$?; ret[((index++))]=$errCode
121
- mysql -utravis test002 < mysqldump-php_test002.sql
122
- errCode=$?; ret[((index++))]=$errCode
123
- mysql -utravis test005 < mysqldump-php_test005.sql
124
- errCode=$?; ret[((index++))]=$errCode
125
- mysql -utravis test006b < mysqldump-php_test006.sql
126
- errCode=$?; ret[((index++))]=$errCode
127
- mysql -utravis test009 < mysqldump-php_test009.sql
128
- errCode=$?; ret[((index++))]=$errCode
129
-
130
- checksum_test001 > mysqldump-php_test001.checksum
131
- checksum_test002 > mysqldump-php_test002.checksum
132
- checksum_test005 > mysqldump-php_test005.checksum
133
-
134
- cat test001.src.sql | grep ^INSERT > test001.filtered.sql
135
- cat test002.src.sql | grep ^INSERT > test002.filtered.sql
136
- cat test005.src.sql | grep ^INSERT > test005.filtered.sql
137
- cat test008.src.sql | grep FOREIGN > test008.filtered.sql
138
- cat test010.src.sql | grep CREATE | grep EVENT > test010.filtered.sql
139
-
140
- if [[ $major -eq 5 && $medium -ge 7 ]]; then
141
- # test virtual column support, with simple inserts forced to complete (a) and complete inserts (b)
142
- cat test011.src.sql | egrep "INSERT|GENERATED" > test011.filtered.sql
143
- else
144
- echo "test011 disabled, only valid for mysql server version > 5.7.0"
145
- fi
146
-
147
- cat mysqldump_test001.sql | grep ^INSERT > mysqldump_test001.filtered.sql
148
- cat mysqldump_test001_complete.sql | grep ^INSERT > mysqldump_test001_complete.filtered.sql
149
- cat mysqldump_test002.sql | grep ^INSERT > mysqldump_test002.filtered.sql
150
- cat mysqldump_test005.sql | grep ^INSERT > mysqldump_test005.filtered.sql
151
- cat mysqldump_test012.sql | grep -E -e '50001 (CREATE|VIEW)' -e '50013 DEFINER' -e 'TRIGGER' -e 'FUNCTION' -e 'PROCEDURE' | grep -v -e 'TABLE' -e 'CREATE VIEW' > mysqldump_test012.filtered.sql
152
- cat mysqldump_test013.sql | grep "INSERT" > mysqldump_test013.filtered.sql
153
- cat mysqldump-php_test001.sql | grep ^INSERT > mysqldump-php_test001.filtered.sql
154
- cat mysqldump-php_test001_complete.sql | grep ^INSERT > mysqldump-php_test001_complete.filtered.sql
155
- cat mysqldump-php_test002.sql | grep ^INSERT > mysqldump-php_test002.filtered.sql
156
- cat mysqldump-php_test005.sql | grep ^INSERT > mysqldump-php_test005.filtered.sql
157
- cat mysqldump-php_test008.sql | grep FOREIGN > mysqldump-php_test008.filtered.sql
158
- cat mysqldump-php_test010.sql | grep CREATE | grep EVENT > mysqldump-php_test010.filtered.sql
159
-
160
- if [[ $major -eq 5 && $medium -ge 7 ]]; then
161
- # test virtual column support, with simple inserts forced to complete (a) and complete inserts (b)
162
- cat mysqldump-php_test011a.sql | egrep "INSERT|GENERATED" > mysqldump-php_test011a.filtered.sql
163
- cat mysqldump-php_test011b.sql | egrep "INSERT|GENERATED" > mysqldump-php_test011b.filtered.sql
164
- else
165
- echo "test011 disabled, only valid for mysql server version > 5.7.0"
166
- fi
167
-
168
- cat mysqldump-php_test012.sql | grep -E -e '50001 (CREATE|VIEW)' -e '50013 DEFINER' -e 'CREATE.*TRIGGER' -e 'FUNCTION' -e 'PROCEDURE' > mysqldump-php_test012.filtered.sql
169
- cat mysqldump-php_test013.sql | grep INSERT > mysqldump-php_test013.filtered.sql
170
-
171
- test="test $index diff test001.filtered.sql mysqldump_test001.filtered.sql"
172
- diff test001.filtered.sql mysqldump_test001.filtered.sql
173
- errCode=$?; ret[((index++))]=$errCode
174
- if [[ $errCode -ne 0 ]]; then echo $test; fi
175
-
176
- test="test $index diff mysqldump_test001_complete.filtered.sql mysqldump-php_test001_complete.filtered.sql"
177
- diff mysqldump_test001_complete.filtered.sql mysqldump-php_test001_complete.filtered.sql
178
- errCode=$?; ret[((index++))]=$errCode
179
- if [[ $errCode -ne 0 ]]; then echo $test; fi
180
-
181
- test="test $index diff test002.filtered.sql mysqldump_test002.filtered.sql"
182
- diff test002.filtered.sql mysqldump_test002.filtered.sql
183
- errCode=$?; ret[((index++))]=$errCode
184
- if [[ $errCode -ne 0 ]]; then echo $test; fi
185
-
186
- test="test $index diff test001.filtered.sql mysqldump-php_test001.filtered.sql"
187
- diff test001.filtered.sql mysqldump-php_test001.filtered.sql
188
- errCode=$?; ret[((index++))]=$errCode
189
- if [[ $errCode -ne 0 ]]; then echo $test; fi
190
-
191
- test="test $index diff test002.filtered.sql mysqldump-php_test002.filtered.sql"
192
- diff test002.filtered.sql mysqldump-php_test002.filtered.sql
193
- errCode=$?; ret[((index++))]=$errCode
194
- if [[ $errCode -ne 0 ]]; then echo $test; fi
195
-
196
- test="test $index diff test001.src.checksum mysqldump-php_test001.checksum"
197
- diff test001.src.checksum mysqldump-php_test001.checksum
198
- errCode=$?; ret[((index++))]=$errCode
199
- if [[ $errCode -ne 0 ]]; then echo $test; fi
200
-
201
- test="test $index diff test002.src.checksum mysqldump-php_test002.checksum"
202
- diff test002.src.checksum mysqldump-php_test002.checksum
203
- errCode=$?; ret[((index++))]=$errCode
204
- if [[ $errCode -ne 0 ]]; then echo $test; fi
205
-
206
- test="test $index diff test005.src.checksum mysqldump-php_test005.checksum"
207
- diff test005.src.checksum mysqldump-php_test005.checksum
208
- errCode=$?; ret[((index++))]=$errCode
209
- if [[ $errCode -ne 0 ]]; then echo $test; fi
210
-
211
- test="test $index diff mysqldump_test005.filtered.sql mysqldump-php_test005.filtered.sql"
212
- diff mysqldump_test005.filtered.sql mysqldump-php_test005.filtered.sql
213
- errCode=$?; ret[((index++))]=$errCode
214
- if [[ $errCode -ne 0 ]]; then echo $test; fi
215
-
216
- test="test $index diff test008.filtered.sql mysqldump-php_test008.filtered.sql"
217
- diff test008.filtered.sql mysqldump-php_test008.filtered.sql
218
- errCode=$?; ret[((index++))]=$errCode
219
- if [[ $errCode -ne 0 ]]; then echo $test; fi
220
-
221
- #test reset-auto-increment, make sure we don't find an AUTO_INCREMENT
222
- test="test $index cat mysqldump-php_test009.sql \| grep -i ENGINE \| grep AUTO_INCREMENT"
223
- cat mysqldump-php_test009.sql | grep -i ENGINE | (! grep AUTO_INCREMENT)
224
- errCode=$?; ret[((index++))]=$errCode
225
- if [[ $errCode -ne 0 ]]; then echo $test; fi
226
-
227
- # test backup events
228
- test="test $index diff test010.filtered.sql mysqldump-php_test010.filtered.sql"
229
- diff test010.filtered.sql mysqldump-php_test010.filtered.sql
230
- errCode=$?; ret[((index++))]=$errCode
231
- if [[ $errCode -ne 0 ]]; then echo $test; fi
232
-
233
- if [[ $major -eq 5 && $medium -ge 7 ]]; then
234
- # test virtual column support, with simple inserts forced to complete (a) and complete inserts (b)
235
- test="test $index diff test011.filtered.sql mysqldump-php_test011a.filtered.sql"
236
- diff test011.filtered.sql mysqldump-php_test011a.filtered.sql
237
- errCode=$?; ret[((index++))]=$errCode
238
- if [[ $errCode -ne 0 ]]; then echo $test; fi
239
- test="test $index diff test011.filtered.sql mysqldump-php_test011b.filtered.sql"
240
- diff test011.filtered.sql mysqldump-php_test011b.filtered.sql
241
- errCode=$?; ret[((index++))]=$errCode
242
- if [[ $errCode -ne 0 ]]; then echo $test; fi
243
- else
244
- echo test011 disabled, only valid for mysql server version > 5.7.0
245
- fi
246
-
247
- # Test create views, events, trigger
248
- test="test $index diff mysqldump_test012.filtered.sql mysqldump-php_test012.filtered.sql"
249
- diff mysqldump_test012.filtered.sql mysqldump-php_test012.filtered.sql
250
- errCode=$?; ret[((index++))]=$errCode
251
- if [[ $errCode -ne 0 ]]; then echo $test; fi
252
-
253
- # Make sure we do not find a DEFINER
254
- test="test $index grep 'DEFINER' mysqldump-php_test012_no-definer.sql"
255
- ! grep 'DEFINER' mysqldump-php_test012_no-definer.sql
256
- errCode=$?; ret[((index++))]=$errCode
257
- if [[ $errCode -ne 0 ]]; then echo $test; fi
258
-
259
- # test INSERT IGNORE
260
- test="test $index diff mysqldump_test013.filtered.sql mysqldump-php_test013.filtered.sql"
261
- diff mysqldump_test013.filtered.sql mysqldump-php_test013.filtered.sql
262
- errCode=$?; ret[((index++))]=$errCode
263
- if [[ $errCode -ne 0 ]]; then echo $test; fi
264
-
265
- echo "Done $index tests"
266
-
267
- retvalue=0
268
- for i in $(seq 0 $index) ; do
269
- if [[ ${ret[$i]} -ne 0 ]]; then
270
- echo "test $i returned ${ret[$i]}"
271
- retvalue=${ret[$i]}
272
- fi
273
- # total=$((${ret[$i]} + $total))
274
- done
275
-
276
- echo "Exiting with code $retvalue"
277
-
278
- if [[ $retvalue -eq 0 ]]; then
279
- rm *.checksum 2> /dev/null
280
- rm *.filtered.sql 2> /dev/null
281
- rm mysqldump* 2> /dev/null
282
- fi
283
-
284
- exit $retvalue
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test001.src.sql DELETED
@@ -1,140 +0,0 @@
1
- DROP DATABASE IF EXISTS `test001`;
2
- CREATE DATABASE `test001`;
3
- USE `test001`;
4
-
5
- DROP TABLE IF EXISTS `test000`;
6
- CREATE TABLE `test000` (
7
- `id` int,
8
- `col01` bit(6) DEFAULT NULL,
9
- `col02` tinyint(4) DEFAULT NULL,
10
- `col03` tinyint(4) UNSIGNED DEFAULT NULL,
11
- `col10` bigint DEFAULT NULL,
12
- `col11` bigint UNSIGNED DEFAULT NULL,
13
- `col15` double DEFAULT NULL,
14
- `col27` varchar(6) DEFAULT NULL
15
- );
16
- INSERT INTO `test000` VALUES (1,0x21,-128,255,-9223372036854775808,18446744073709551615,-2.2250738585072014e-308,'0abcde');
17
-
18
- DROP TABLE IF EXISTS `test001`;
19
- CREATE TABLE `test001` (
20
- `id` int,
21
- `col` bit(1) DEFAULT NULL
22
- );
23
- INSERT INTO `test001` VALUES (1,NULL);
24
- INSERT INTO `test001` VALUES (2,0x00);
25
- INSERT INTO `test001` VALUES (3,0x01);
26
-
27
- DROP TABLE IF EXISTS `test002`;
28
- CREATE TABLE `test002` (
29
- `id` int,
30
- `col` tinyint(4) DEFAULT NULL
31
- );
32
- INSERT INTO `test002` VALUES (1,NULL);
33
- INSERT INTO `test002` VALUES (2,-128);
34
- INSERT INTO `test002` VALUES (3,0);
35
- INSERT INTO `test002` VALUES (4,127);
36
-
37
- DROP TABLE IF EXISTS `test003`;
38
- CREATE TABLE `test003` (
39
- `id` int,
40
- `col` tinyint(4) UNSIGNED DEFAULT NULL
41
- );
42
- INSERT INTO `test003` VALUES (1,NULL);
43
- INSERT INTO `test003` VALUES (2,0);
44
- INSERT INTO `test003` VALUES (3,255);
45
-
46
- DROP TABLE IF EXISTS `test010`;
47
- CREATE TABLE `test010` (
48
- `id` int,
49
- `col` bigint DEFAULT NULL
50
- );
51
- INSERT INTO `test010` VALUES (1,NULL);
52
- INSERT INTO `test010` VALUES (2,-9223372036854775808);
53
- INSERT INTO `test010` VALUES (3,0);
54
- INSERT INTO `test010` VALUES (4,9223372036854775807);
55
-
56
- DROP TABLE IF EXISTS `test011`;
57
- CREATE TABLE `test011` (
58
- `id` int,
59
- `col` bigint UNSIGNED DEFAULT NULL
60
- );
61
- INSERT INTO `test011` VALUES (1,NULL);
62
- INSERT INTO `test011` VALUES (3,0);
63
- INSERT INTO `test011` VALUES (4,18446744073709551615);
64
-
65
-
66
- DROP TABLE IF EXISTS `test015`;
67
- CREATE TABLE `test015` (
68
- `id` int,
69
- `col` double DEFAULT NULL
70
- );
71
- INSERT INTO `test015` VALUES (1,NULL);
72
- INSERT INTO `test015` VALUES (2,-1.7976931348623157e308);
73
- INSERT INTO `test015` VALUES (3,-2.2250738585072014e-308);
74
- INSERT INTO `test015` VALUES (4,0);
75
- INSERT INTO `test015` VALUES (5,2.2250738585072014e-308);
76
- INSERT INTO `test015` VALUES (6,1.7976931348623157e308);
77
-
78
-
79
- DROP TABLE IF EXISTS `test027`;
80
- CREATE TABLE `test027` (
81
- `id` int,
82
- `col` varchar(6) DEFAULT NULL
83
- );
84
- INSERT INTO `test027` VALUES (1,NULL);
85
- INSERT INTO `test027` VALUES (2,'');
86
- INSERT INTO `test027` VALUES (3,'0');
87
- INSERT INTO `test027` VALUES (4,'2e308');
88
- INSERT INTO `test027` VALUES (5,'999.99');
89
- INSERT INTO `test027` VALUES (6,'-2e-30');
90
- INSERT INTO `test027` VALUES (7,'-99.99');
91
- INSERT INTO `test027` VALUES (8,'0');
92
- INSERT INTO `test027` VALUES (9,'0abcde');
93
- INSERT INTO `test027` VALUES (10,'123');
94
-
95
- DROP TABLE IF EXISTS `test029`;
96
- CREATE TABLE `test029` (
97
- `id` int,
98
- `col` blob NOT NULL
99
- );
100
- INSERT INTO `test029` VALUES (1,0x00010203040506070809909192939495969798A9);
101
- -- mysqldump 5.7.23 has a bug, an appends _binary to empty blob data, which is incorrect.
102
- -- mysqldump 5.7.17 is ok
103
- -- lets skip this test an implement it in some near future
104
- -- https://bugs.mysql.com/bug.php?id=80150
105
- INSERT INTO `test029` VALUES (2,0x99AAFF);
106
-
107
- DROP TABLE IF EXISTS `test033`;
108
- CREATE TABLE `test033` (
109
- `id` int,
110
- `col` text NOT NULL
111
- );
112
- INSERT INTO `test033` VALUES (1,'test test test');
113
-
114
-
115
- DROP VIEW IF EXISTS `test100`;
116
- CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `test100` AS select `test000`.`id` AS `id`,`test000`.`col01` AS `col01`,`test000`.`col02` AS `col02`,`test000`.`col03` AS `col03`,`test000`.`col10` AS `col10`,`test000`.`col11` AS `col11`,`test000`.`col15` AS `col15`,`test000`.`col27` AS `col27` from `test000`;
117
-
118
- DROP VIEW IF EXISTS `test127`;
119
- CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `test127` AS select `test027`.`id` AS `id`,`test027`.`col` AS `col` from `test027`;
120
-
121
-
122
- DROP TABLE IF EXISTS `test200`;
123
- CREATE TABLE `test200` (
124
- `id` int,
125
- `col` tinyint(4) DEFAULT NULL
126
- );
127
-
128
- CREATE TRIGGER before_test200_insert
129
- BEFORE insert ON `test200`
130
- FOR EACH ROW set NEW.col = NEW.col + 1;
131
-
132
- -- INSERT INTO `test200` VALUES (1,1); -- trigger tests
133
-
134
- /*!50003 DROP PROCEDURE IF EXISTS `GetAllFromTest000` */;
135
- DELIMITER //
136
- CREATE PROCEDURE GetAllFromTest000()
137
- BEGIN
138
- SELECT * FROM test000;
139
- END //
140
- DELIMITER ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test002.src.sql DELETED
@@ -1,14 +0,0 @@
1
- DROP DATABASE IF EXISTS `test002`;
2
- CREATE DATABASE `test002`;
3
- USE `test002`;
4
-
5
- DROP TABLE IF EXISTS `test201`;
6
- CREATE TABLE `test201` (
7
- `col` text COLLATE utf8mb4_unicode_ci
8
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
9
-
10
- INSERT INTO `test201` (`col`) VALUES ('áéíóú');
11
- INSERT INTO `test201` (`col`) VALUES ('🎲');
12
- INSERT INTO `test201` (`col`) VALUES ('🎭');
13
- INSERT INTO `test201` (`col`) VALUES ('💩');
14
- INSERT INTO `test201` (`col`) VALUES ('🐈');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test005.src.sql DELETED
@@ -1,12 +0,0 @@
1
- DROP DATABASE IF EXISTS `test005`;
2
- CREATE DATABASE `test005`;
3
- USE `test005`;
4
-
5
- SET TIME_ZONE='+07:00';
6
- DROP TABLE IF EXISTS `test000`;
7
- CREATE TABLE `test000`(
8
- `id` int,
9
- `col` TIMESTAMP NOT NULL
10
- );
11
- INSERT INTO `test000` VALUES (1,'2014-01-01 00:00:00');
12
- SET TIME_ZONE='+00:00';
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test006.src.sql DELETED
@@ -1,107 +0,0 @@
1
- -- phpMyAdmin SQL Dump
2
- -- version 4.4.0
3
- -- http://www.phpmyadmin.net
4
- --
5
- -- Servidor: localhost
6
- -- Tiempo de generación: 31-08-2015 a las 19:26:58
7
- -- Versión del servidor: 5.5.42
8
- -- Versión de PHP: 5.6.7
9
-
10
- DROP DATABASE IF EXISTS `test006a`;
11
- CREATE DATABASE `test006a`;
12
-
13
- DROP DATABASE IF EXISTS `test006b`;
14
- CREATE DATABASE `test006b`;
15
-
16
- USE `test006a`;
17
-
18
- SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
19
- SET time_zone = "+00:00";
20
-
21
-
22
- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
23
- /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
24
- /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
25
- /*!40101 SET NAMES utf8 */;
26
-
27
- --
28
- -- Base de datos: `my_test_db`
29
- --
30
-
31
- -- --------------------------------------------------------
32
-
33
- --
34
- -- Estructura de tabla para la tabla `my_table`
35
- --
36
-
37
- CREATE TABLE IF NOT EXISTS `my_table` (
38
- `id` int(11) NOT NULL,
39
- `name` varchar(300) DEFAULT NULL,
40
- `lastname` varchar(300) DEFAULT NULL,
41
- `username` varchar(300) DEFAULT NULL
42
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
43
-
44
- -- --------------------------------------------------------
45
-
46
- --
47
- -- Estructura Stand-in para la vista `my_view`
48
- --
49
- CREATE TABLE IF NOT EXISTS `my_view` (
50
- `id` int(11)
51
- ,`name` varchar(300)
52
- ,`lastname` varchar(300)
53
- ,`username` varchar(300)
54
- );
55
-
56
- -- --------------------------------------------------------
57
-
58
- --
59
- -- Estructura Stand-in para la vista `view_of_my_table`
60
- --
61
- CREATE TABLE IF NOT EXISTS `view_of_my_table` (
62
- `id` int(11)
63
- ,`name` varchar(300)
64
- ,`lastname` varchar(300)
65
- ,`username` varchar(300)
66
- );
67
-
68
- -- --------------------------------------------------------
69
-
70
- --
71
- -- Estructura para la vista `my_view`
72
- --
73
- DROP TABLE IF EXISTS `my_view`;
74
-
75
- CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `my_view` AS select `view_of_my_table`.`id` AS `id`,`view_of_my_table`.`name` AS `name`,`view_of_my_table`.`lastname` AS `lastname`,`view_of_my_table`.`username` AS `username` from `view_of_my_table`;
76
-
77
- -- --------------------------------------------------------
78
-
79
- --
80
- -- Estructura para la vista `view_of_my_table`
81
- --
82
- DROP TABLE IF EXISTS `view_of_my_table`;
83
-
84
- CREATE ALGORITHM=UNDEFINED DEFINER=`travis`@`localhost` SQL SECURITY DEFINER VIEW `view_of_my_table` AS select `my_table`.`id` AS `id`,`my_table`.`name` AS `name`,`my_table`.`lastname` AS `lastname`,`my_table`.`username` AS `username` from `my_table`;
85
-
86
- --
87
- -- Índices para tablas volcadas
88
- --
89
-
90
- --
91
- -- Indices de la tabla `my_table`
92
- --
93
- ALTER TABLE `my_table`
94
- ADD PRIMARY KEY (`id`);
95
-
96
- --
97
- -- AUTO_INCREMENT de las tablas volcadas
98
- --
99
-
100
- --
101
- -- AUTO_INCREMENT de la tabla `my_table`
102
- --
103
- ALTER TABLE `my_table`
104
- MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
105
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
106
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
107
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test008.src.sql DELETED
@@ -1,80 +0,0 @@
1
- DROP DATABASE IF EXISTS `test008`;
2
- CREATE DATABASE `test008`;
3
- USE `test008`;
4
-
5
- -- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64)
6
- --
7
- -- Host: 192.168.0.34 Database: test007
8
- -- ------------------------------------------------------
9
- -- Server version 5.5.43-0+deb7u1-log
10
-
11
- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
12
- /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
13
- /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
14
- /*!40101 SET NAMES utf8 */;
15
- /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
16
- /*!40103 SET TIME_ZONE='+00:00' */;
17
- /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
18
- /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
19
- /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
20
- /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
21
-
22
- --
23
- -- Table structure for table `fields`
24
- --
25
-
26
- DROP TABLE IF EXISTS `fields`;
27
- /*!40101 SET @saved_cs_client = @@character_set_client */;
28
- /*!40101 SET character_set_client = utf8 */;
29
- CREATE TABLE `fields` (
30
- `id` int(11) NOT NULL,
31
- `name` varchar(128) NOT NULL,
32
- `form_id` int(11) NOT NULL,
33
- PRIMARY KEY (`id`),
34
- KEY `form_id` (`form_id`),
35
- CONSTRAINT `fields to forms` FOREIGN KEY (`form_id`) REFERENCES `forms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
36
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
37
- /*!40101 SET character_set_client = @saved_cs_client */;
38
-
39
- --
40
- -- Dumping data for table `fields`
41
- --
42
-
43
- LOCK TABLES `fields` WRITE;
44
- /*!40000 ALTER TABLE `fields` DISABLE KEYS */;
45
- /*!40000 ALTER TABLE `fields` ENABLE KEYS */;
46
- UNLOCK TABLES;
47
-
48
- --
49
- -- Table structure for table `forms`
50
- --
51
-
52
- DROP TABLE IF EXISTS `forms`;
53
- /*!40101 SET @saved_cs_client = @@character_set_client */;
54
- /*!40101 SET character_set_client = utf8 */;
55
- CREATE TABLE `forms` (
56
- `id` int(11) NOT NULL,
57
- `name` varchar(128) NOT NULL,
58
- PRIMARY KEY (`id`)
59
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
60
- /*!40101 SET character_set_client = @saved_cs_client */;
61
-
62
- --
63
- -- Dumping data for table `forms`
64
- --
65
-
66
- LOCK TABLES `forms` WRITE;
67
- /*!40000 ALTER TABLE `forms` DISABLE KEYS */;
68
- /*!40000 ALTER TABLE `forms` ENABLE KEYS */;
69
- UNLOCK TABLES;
70
- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
71
-
72
- /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
73
- /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
74
- /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
75
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
76
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
77
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
78
- /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
79
-
80
- -- Dump completed on 2016-12-27 22:39:51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test009.src.sql DELETED
@@ -1,57 +0,0 @@
1
- DROP DATABASE IF EXISTS `test009`;
2
- CREATE DATABASE `test009`;
3
- USE `test009`;
4
-
5
- -- MySQL dump 10.15 Distrib 10.0.28-MariaDB, for debian-linux-gnu (x86_64)
6
- --
7
- -- Host: localhost Database: localhost
8
- -- ------------------------------------------------------
9
- -- Server version 10.0.28-MariaDB-0ubuntu0.16.04.1
10
-
11
- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
12
- /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
13
- /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
14
- /*!40101 SET NAMES utf8 */;
15
- /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
16
- /*!40103 SET TIME_ZONE='+00:00' */;
17
- /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
18
- /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
19
- /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
20
- /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
21
-
22
- --
23
- -- Table structure for table `increments`
24
- --
25
-
26
- DROP TABLE IF EXISTS `increments`;
27
- /*!40101 SET @saved_cs_client = @@character_set_client */;
28
- /*!40101 SET character_set_client = utf8 */;
29
- CREATE TABLE `increments` (
30
- `id` int(11) NOT NULL AUTO_INCREMENT,
31
- PRIMARY KEY (`id`)
32
- ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
33
- /*!40101 SET character_set_client = @saved_cs_client */;
34
-
35
- --
36
- -- Dumping data for table `increments`
37
- --
38
-
39
- LOCK TABLES `increments` WRITE;
40
- /*!40000 ALTER TABLE `increments` DISABLE KEYS */;
41
- INSERT INTO `increments` VALUES (1);
42
- INSERT INTO `increments` VALUES (2);
43
- INSERT INTO `increments` VALUES (3);
44
- INSERT INTO `increments` VALUES (4);
45
- /*!40000 ALTER TABLE `increments` ENABLE KEYS */;
46
- UNLOCK TABLES;
47
- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
48
-
49
- /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
50
- /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
51
- /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
52
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
53
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
54
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
55
- /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
56
-
57
- -- Dump completed on 2017-03-02 13:23:17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test010.src.sql DELETED
@@ -1,56 +0,0 @@
1
- DROP DATABASE IF EXISTS `test010`;
2
- CREATE DATABASE `test010`;
3
- USE `test010`;
4
-
5
- -- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64)
6
- --
7
- -- Host: localhost Database: test010
8
- -- ------------------------------------------------------
9
- -- Server version 5.7.17
10
-
11
- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
12
- /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
13
- /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
14
- /*!40101 SET NAMES utf8 */;
15
- /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
16
- /*!40103 SET TIME_ZONE='+00:00' */;
17
- /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
18
- /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
19
- /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
20
- /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
21
-
22
- --
23
- -- Dumping events for database 'test010'
24
- --
25
- /*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
26
- /*!50106 DROP EVENT IF EXISTS `e_test010` */;
27
- DELIMITER ;;
28
- /*!50003 SET @saved_cs_client = @@character_set_client */ ;;
29
- /*!50003 SET @saved_cs_results = @@character_set_results */ ;;
30
- /*!50003 SET @saved_col_connection = @@collation_connection */ ;;
31
- /*!50003 SET character_set_client = utf8 */ ;;
32
- /*!50003 SET character_set_results = utf8 */ ;;
33
- /*!50003 SET collation_connection = utf8_general_ci */ ;;
34
- /*!50003 SET @saved_sql_mode = @@sql_mode */ ;;
35
- /*!50003 SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;;
36
- /*!50003 SET @saved_time_zone = @@time_zone */ ;;
37
- /*!50003 SET time_zone = 'SYSTEM' */ ;;
38
- /*!50106 CREATE*/ /*!50117 DEFINER=`travis`@`%`*/ /*!50106 EVENT `e_test010` ON SCHEDULE AT '2030-01-01 23:59:00' ON COMPLETION NOT PRESERVE ENABLE DO INSERT INTO test010.test VALUES (NOW()) */ ;;
39
- /*!50003 SET time_zone = @saved_time_zone */ ;;
40
- /*!50003 SET sql_mode = @saved_sql_mode */ ;;
41
- /*!50003 SET character_set_client = @saved_cs_client */ ;;
42
- /*!50003 SET character_set_results = @saved_cs_results */ ;;
43
- /*!50003 SET collation_connection = @saved_col_connection */ ;;
44
- DELIMITER ;
45
- /*!50106 SET TIME_ZONE= @save_time_zone */ ;
46
- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
47
-
48
- /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
49
- /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
50
- /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
51
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
52
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
53
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
54
- /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
55
-
56
- -- Dump completed on 2017-03-20 21:52:21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test011.src.sql DELETED
@@ -1,53 +0,0 @@
1
- DROP DATABASE IF EXISTS `test011`;
2
- CREATE DATABASE `test011`;
3
- USE `test011`;
4
-
5
- -- MySQL dump 10.13 Distrib 5.7.15, for Linux (x86_64)
6
- --
7
- -- Host: localhost Database: test
8
- -- ------------------------------------------------------
9
- -- Server version 5.7.15
10
-
11
- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
12
- /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
13
- /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
14
- /*!40101 SET NAMES utf8 */;
15
- /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
16
- /*!40103 SET TIME_ZONE='+00:00' */;
17
- /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
18
- /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
19
- /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
20
- /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
21
-
22
- --
23
- -- Table structure for table `test011`
24
- --
25
-
26
- DROP TABLE IF EXISTS `test011`;
27
- /*!40101 SET @saved_cs_client = @@character_set_client */;
28
- /*!40101 SET character_set_client = utf8 */;
29
- CREATE TABLE `test011` (
30
- `id` int(11) NOT NULL,
31
- `hash_stored` char(32) CHARACTER SET ascii COLLATE ascii_bin GENERATED ALWAYS AS (md5(`id`)) STORED NOT NULL,
32
- `hash_virtual` char(32) CHARACTER SET ascii COLLATE ascii_bin GENERATED ALWAYS AS (md5(`id`)) VIRTUAL NOT NULL
33
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
34
- /*!40101 SET character_set_client = @saved_cs_client */;
35
-
36
- --
37
- -- Dumping data for table `test011`
38
- --
39
-
40
- LOCK TABLES `test011` WRITE;
41
- /*!40000 ALTER TABLE `test011` DISABLE KEYS */;
42
- INSERT INTO `test011` (`id`) VALUES (159413),(294775);
43
- /*!40000 ALTER TABLE `test011` ENABLE KEYS */;
44
- UNLOCK TABLES;
45
- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
46
-
47
- /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
48
- /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
49
- /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
50
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
51
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
52
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
53
- /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/tests/test012.src.sql DELETED
@@ -1,32 +0,0 @@
1
- DROP DATABASE IF EXISTS `test012`;
2
- CREATE DATABASE `test012`;
3
- USE `test012`;
4
-
5
- DROP TABLE IF EXISTS test;
6
- CREATE TABLE test
7
- (
8
- col INT
9
- );
10
-
11
-
12
- DROP VIEW IF EXISTS `test012_view`;
13
- CREATE VIEW `test012_view` AS SELECT 1 as `a VIEW a`;
14
-
15
- CREATE TRIGGER `test012_trigger`
16
- BEFORE insert ON `test`
17
- FOR EACH ROW set NEW.col = NEW.col + 1;
18
-
19
- DELIMITER ;;
20
- CREATE FUNCTION `test012_function`(i INT) RETURNS INT
21
- DETERMINISTIC
22
- BEGIN
23
- RETURN (i);
24
- END ;;
25
- DELIMITER ;
26
-
27
- DELIMITER ;;
28
- CREATE PROCEDURE test012_procedure()
29
- BEGIN
30
- SELECT * FROM test012;
31
- END ;;
32
- DELIMITER ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ifsnop/mysqldump-php/unit-tests/MysqldumpTest.php DELETED
@@ -1,48 +0,0 @@
1
- <?php
2
-
3
- use Ifsnop\Mysqldump\Mysqldump;
4
-
5
- class MysqldumpTest extends PHPUnit_Framework_TestCase
6
- {
7
-
8
- /** @test */
9
- public function tableSpecificWhereConditionsWork()
10
- {
11
- $dump = new Mysqldump('mysql:host=localhost;dbname=test', 'testing', 'testing', array(
12
- 'where' => 'defaultWhere'
13
- ));
14
-
15
- $dump->setTableWheres(array(
16
- 'users' => 'date_registered > NOW() - INTERVAL 3 MONTH AND is_deleted=0',
17
- 'logs' => 'date_registered > NOW() - INTERVAL 1 DAY',
18
- 'posts' => 'active=1'
19
- ));
20
-
21
- $this->assertEquals(
22
- 'date_registered > NOW() - INTERVAL 3 MONTH AND is_deleted=0',
23
- $dump->getTableWhere('users')
24
- );
25
-
26
- $this->assertEquals(
27
- 'defaultWhere',
28
- $dump->getTableWhere('non_overriden_table')
29
- );
30
- }
31
-
32
- /** @test */
33
- public function tableSpecificLimitsWork()
34
- {
35
- $dump = new Mysqldump('mysql:host=localhost;dbname=test', 'testing', 'testing');
36
-
37
- $dump->setTableLimits(array(
38
- 'users' => 200,
39
- 'logs' => 500,
40
- 'table_with_invalid_limit' => '41923, 42992'
41
- ));
42
-
43
- $this->assertEquals(200, $dump->getTableLimit('users'));
44
- $this->assertEquals(500, $dump->getTableLimit('logs'));
45
- $this->assertFalse($dump->getTableLimit('table_with_invalid_limit'));
46
- $this->assertFalse($dump->getTableLimit('table_name_with_no_limit'));
47
- }
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/phpseclib/phpseclib/AUTHORS CHANGED
@@ -4,3 +4,4 @@ phpseclib Developers: monnerat (Patrick Monnerat)
4
  bantu (Andreas Fischer)
5
  petrich (Hans-Jürgen Petrich)
6
  GrahamCampbell (Graham Campbell)
 
4
  bantu (Andreas Fischer)
5
  petrich (Hans-Jürgen Petrich)
6
  GrahamCampbell (Graham Campbell)
7
+ hc-jworman
vendor/phpseclib/phpseclib/BACKERS.md CHANGED
@@ -10,4 +10,5 @@ phpseclib ongoing development is made possible by [Tidelift](https://tidelift.co
10
  - Zane Hooper
11
  - [Setasign](https://www.setasign.com/)
12
  - [Charles Severance](https://github.com/csev)
13
- - [Rachel Fish](https://github.com/itsrachelfish)
 
10
  - Zane Hooper
11
  - [Setasign](https://www.setasign.com/)
12
  - [Charles Severance](https://github.com/csev)
13
+ - [Rachel Fish](https://github.com/itsrachelfish)
14
+ - Tharyrok
vendor/phpseclib/phpseclib/composer.json CHANGED
@@ -62,7 +62,8 @@
62
  "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
63
  "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.",
64
  "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
65
- "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations."
 
66
  },
67
  "autoload": {
68
  "files": [
62
  "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
63
  "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.",
64
  "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
65
+ "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
66
+ "ext-xml": "Install the XML extension to load XML formatted public keys."
67
  },
68
  "autoload": {
69
  "files": [
vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php CHANGED
@@ -500,6 +500,44 @@ abstract class Base
500
  }
501
 
502
  $this->_setEngine();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
  }
504
 
505
  /**
@@ -593,6 +631,10 @@ abstract class Base
593
  * $hash, $salt, $count, $dkLen
594
  *
595
  * Where $hash (default = sha1) currently supports the following hashes: see: Crypt/Hash.php
 
 
 
 
596
  *
597
  * @see Crypt/Hash.php
598
  * @param string $password
@@ -606,6 +648,28 @@ abstract class Base
606
  $key = '';
607
 
608
  switch ($method) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
  default: // 'pbkdf2' or 'pbkdf1'
610
  $func_args = func_get_args();
611
 
@@ -1105,7 +1169,7 @@ abstract class Base
1105
  $plaintext = '';
1106
  if ($this->continuousBuffer) {
1107
  $iv = &$this->decryptIV;
1108
- $pos = &$this->buffer['pos'];
1109
  } else {
1110
  $iv = $this->decryptIV;
1111
  $pos = 0;
@@ -2798,11 +2862,8 @@ abstract class Base
2798
  */
2799
  function safe_intval($x)
2800
  {
2801
- switch (true) {
2802
- case is_int($x):
2803
- // PHP 5.3, per http://php.net/releases/5_3_0.php, introduced "more consistent float rounding"
2804
- case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
2805
- return $x;
2806
  }
2807
  return (fmod($x, 0x80000000) & 0x7FFFFFFF) |
2808
  ((fmod(floor($x / 0x80000000), 2) & 1) << 31);
@@ -2816,15 +2877,12 @@ abstract class Base
2816
  */
2817
  function safe_intval_inline()
2818
  {
2819
- switch (true) {
2820
- case defined('PHP_INT_SIZE') && PHP_INT_SIZE == 8:
2821
- case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
2822
- return '%s';
2823
- break;
2824
- default:
2825
- $safeint = '(is_int($temp = %s) ? $temp : (fmod($temp, 0x80000000) & 0x7FFFFFFF) | ';
2826
- return $safeint . '((fmod(floor($temp / 0x80000000), 2) & 1) << 31))';
2827
  }
 
 
 
2828
  }
2829
 
2830
  /**
500
  }
501
 
502
  $this->_setEngine();
503
+
504
+ // Determining whether inline crypting can be used by the cipher
505
+ if ($this->use_inline_crypt !== false) {
506
+ $this->use_inline_crypt = version_compare(PHP_VERSION, '5.3.0') >= 0 || function_exists('create_function');
507
+ }
508
+
509
+ if (!defined('PHP_INT_SIZE')) {
510
+ define('PHP_INT_SIZE', 4);
511
+ }
512
+
513
+ if (!defined('CRYPT_BASE_USE_REG_INTVAL')) {
514
+ switch (true) {
515
+ // PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster
516
+ case (PHP_OS & "\xDF\xDF\xDF") === 'WIN':
517
+ case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
518
+ case PHP_INT_SIZE == 8:
519
+ define('CRYPT_BASE_USE_REG_INTVAL', true);
520
+ break;
521
+ case (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
522
+ switch (true) {
523
+ /* PHP 7.0.0 introduced a bug that affected 32-bit ARM processors:
524
+
525
+ https://github.com/php/php-src/commit/716da71446ebbd40fa6cf2cea8a4b70f504cc3cd
526
+
527
+ altho the changelogs make no mention of it, this bug was fixed with this commit:
528
+
529
+ https://github.com/php/php-src/commit/c1729272b17a1fe893d1a54e423d3b71470f3ee8
530
+
531
+ affected versions of PHP are: 7.0.x, 7.1.0 - 7.1.23 and 7.2.0 - 7.2.11 */
532
+ case PHP_VERSION_ID >= 70000 && PHP_VERSION_ID <= 70123:
533
+ case PHP_VERSION_ID >= 70200 && PHP_VERSION_ID <= 70211:
534
+ define('CRYPT_BASE_USE_REG_INTVAL', false);
535
+ break;
536
+ default:
537
+ define('CRYPT_BASE_USE_REG_INTVAL', true);
538
+ }
539
+ }
540
+ }
541
  }
542
 
543
  /**
631
  * $hash, $salt, $count, $dkLen
632
  *
633
  * Where $hash (default = sha1) currently supports the following hashes: see: Crypt/Hash.php
634
+ * {@link https://en.wikipedia.org/wiki/Bcrypt bcypt}:
635
+ * $salt, $rounds, $keylen
636
+ *
637
+ * This is a modified version of bcrypt used by OpenSSH.
638
  *
639
  * @see Crypt/Hash.php
640
  * @param string $password
648
  $key = '';
649
 
650
  switch ($method) {
651
+ case 'bcrypt':
652
+ $func_args = func_get_args();
653
+
654
+ if (!isset($func_args[2])) {
655
+ return false;
656
+ }
657
+
658
+ $salt = $func_args[2];
659
+
660
+ $rounds = isset($func_args[3]) ? $func_args[3] : 16;
661
+ $keylen = isset($func_args[4]) ? $func_args[4] : $this->key_length;
662
+
663
+ $bf = new Blowfish();
664
+ $key = $bf->bcrypt_pbkdf($password, $salt, $keylen + $this->block_size, $rounds);
665
+ if (!$key) {
666
+ return false;
667
+ }
668
+
669
+ $this->setKey(substr($key, 0, $keylen));
670
+ $this->setIV(substr($key, $keylen));
671
+
672
+ return true;
673
  default: // 'pbkdf2' or 'pbkdf1'
674
  $func_args = func_get_args();
675
 
1169
  $plaintext = '';
1170
  if ($this->continuousBuffer) {
1171
  $iv = &$this->decryptIV;
1172
+ $pos = &$this->debuffer['pos'];
1173
  } else {
1174
  $iv = $this->decryptIV;
1175
  $pos = 0;
2862
  */
2863
  function safe_intval($x)
2864
  {
2865
+ if (is_int($x)) {
2866
+ return $x;
 
 
 
2867
  }
2868
  return (fmod($x, 0x80000000) & 0x7FFFFFFF) |
2869
  ((fmod(floor($x / 0x80000000), 2) & 1) << 31);
2877
  */
2878
  function safe_intval_inline()
2879
  {
2880
+ if (CRYPT_BASE_USE_REG_INTVAL) {
2881
+ return PHP_INT_SIZE == 4 ? 'intval(%s)' : '%s';
 
 
 
 
 
 
2882
  }
2883
+
2884
+ $safeint = '(is_int($temp = %s) ? $temp : (fmod($temp, 0x80000000) & 0x7FFFFFFF) | ';
2885
+ return $safeint . '((fmod(floor($temp / 0x80000000), 2) & 1) << 31))';
2886
  }
2887
 
2888
  /**
vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php CHANGED
@@ -11,6 +11,87 @@
11
  *
12
  * - {@link http://en.wikipedia.org/wiki/Blowfish_(cipher) Wikipedia description of Blowfish}
13
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  * Here's a short example of how to use this library:
15
  * <code>
16
  * <?php
@@ -74,6 +155,15 @@ class Blowfish extends Base
74
  */
75
  var $cfb_init_len = 500;
76
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  * The fixed subkeys boxes ($sbox0 - $sbox3) with 256 entries each
79
  *
@@ -283,6 +373,41 @@ class Blowfish extends Base
283
  */
284
  var $key_length = 16;
285
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  /**
287
  * Sets the key length.
288
  *
@@ -358,6 +483,7 @@ class Blowfish extends Base
358
  // unpack binary string in unsigned chars
359
  $key = array_values(unpack('C*', $this->key));
360
  $keyl = count($key);
 
361
  for ($j = 0, $i = 0; $i < 18; ++$i) {
362
  // xor P1 with the first 32-bits of the key, xor P2 with the second 32-bits ...
363
  for ($data = 0, $k = 0; $k < 4; ++$k) {
@@ -366,7 +492,7 @@ class Blowfish extends Base
366
  $j = 0;
367
  }
368
  }
369
- $this->bctx['p'][] = $this->parray[$i] ^ $data;
370
  }
371
 
372
  // encrypt the zero-string, replace P1 and P2 with the encrypted data,
@@ -386,6 +512,230 @@ class Blowfish extends Base
386
  }
387
  }
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  /**
390
  * Encrypts a block
391
  *
@@ -406,18 +756,83 @@ class Blowfish extends Base
406
  $l = $in[1];
407
  $r = $in[2];
408
 
409
- for ($i = 0; $i < 16; $i+= 2) {
410
- $l^= $p[$i];
411
- $r^= $this->safe_intval(($this->safe_intval($sb_0[$l >> 24 & 0xff] + $sb_1[$l >> 16 & 0xff]) ^
412
- $sb_2[$l >> 8 & 0xff]) +
413
- $sb_3[$l & 0xff]);
414
 
415
- $r^= $p[$i + 1];
416
- $l^= $this->safe_intval(($this->safe_intval($sb_0[$r >> 24 & 0xff] + $sb_1[$r >> 16 & 0xff]) ^
417
- $sb_2[$r >> 8 & 0xff]) +
418
- $sb_3[$r & 0xff]);
419
- }
420
- return pack("N*", $r ^ $p[17], $l ^ $p[16]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  }
422
 
423
  /**
11
  *
12
  * - {@link http://en.wikipedia.org/wiki/Blowfish_(cipher) Wikipedia description of Blowfish}
13
  *
14
+ * # An overview of bcrypt vs Blowfish
15
+ *
16
+ * OpenSSH private keys use a customized version of bcrypt. Specifically, instead of
17
+ * encrypting OrpheanBeholderScryDoubt 64 times OpenSSH's bcrypt variant encrypts
18
+ * OxychromaticBlowfishSwatDynamite 64 times. so we can't use crypt().
19
+ *
20
+ * bcrypt is basically Blowfish but instead of performing the key expansion once it performs
21
+ * the expansion 129 times for each round, with the first key expansion interleaving the salt
22
+ * and password. This renders OpenSSL unusable and forces us to use a pure-PHP implementation
23
+ * of blowfish.
24
+ *
25
+ * # phpseclib's four different _encryptBlock() implementations
26
+ *
27
+ * When using Blowfish as an encryption algorithm, _encryptBlock() is called 9 + 512 +
28
+ * (the number of blocks in the plaintext) times.
29
+ *
30
+ * Each of the first 9 calls to _encryptBlock() modify the P-array. Each of the next 512
31
+ * calls modify the S-boxes. The remaining _encryptBlock() calls operate on the plaintext to
32
+ * produce the ciphertext. In the pure-PHP implementation of Blowfish these remaining
33
+ * _encryptBlock() calls are highly optimized through the use of eval(). Among other things,
34
+ * P-array lookups are eliminated by hard-coding the key-dependent P-array values, and thus we
35
+ * have explained 2 of the 4 different _encryptBlock() implementations.
36
+ *
37
+ * With bcrypt things are a bit different. _encryptBlock() is called 1,079,296 times,
38
+ * assuming 16 rounds (which is what OpenSSH's bcrypt defaults to). The eval()-optimized
39
+ * _encryptBlock() isn't as beneficial because the P-array values are not constant. Well, they
40
+ * are constant, but only for, at most, 777 _encryptBlock() calls, which is equivalent to ~6KB
41
+ * of data. The average length of back to back _encryptBlock() calls with a fixed P-array is
42
+ * 514.12, which is ~4KB of data. Creating an eval()-optimized _encryptBlock() has an upfront
43
+ * cost, which is CPU dependent and is probably not going to be worth it for just ~4KB of
44
+ * data. Conseqeuently, bcrypt does not benefit from the eval()-optimized _encryptBlock().
45
+ *
46
+ * The regular _encryptBlock() does unpack() and pack() on every call, as well, and that can
47
+ * begin to add up after one million function calls.
48
+ *
49
+ * In theory, one might think that it might be beneficial to rewrite all block ciphers so
50
+ * that, instead of passing strings to _encryptBlock(), you convert the string to an array of
51
+ * integers and then pass successive subarrays of that array to _encryptBlock. This, however,
52
+ * kills PHP's memory use. Like let's say you have a 1MB long string. After doing
53
+ * $in = str_repeat('a', 1024 * 1024); PHP's memory utilization jumps up by ~1MB. After doing
54
+ * $blocks = str_split($in, 4); it jumps up by an additional ~16MB. After
55
+ * $blocks = array_map(fn($x) => unpack('N*', $x), $blocks); it jumps up by an additional
56
+ * ~90MB, yielding a 106x increase in memory usage. Consequently, it bcrypt calls a different
57
+ * _encryptBlock() then the regular Blowfish does. That said, the Blowfish _encryptBlock() is
58
+ * basically just a thin wrapper around the bcrypt _encryptBlock(), so there's that.
59
+ *
60
+ * This explains 3 of the 4 _encryptBlock() implementations. the last _encryptBlock()
61
+ * implementation can best be understood by doing Ctrl + F and searching for where
62
+ * CRYPT_BASE_USE_REG_INTVAL is defined.
63
+ *
64
+ * # phpseclib's three different _setupKey() implementations
65
+ *
66
+ * Every bcrypt round is the equivalent of encrypting 512KB of data. Since OpenSSH uses 16
67
+ * rounds by default that's ~8MB of data that's essentially being encrypted whenever
68
+ * you use bcrypt. That's a lot of data, however, bcrypt operates within tighter constraints
69
+ * than regular Blowfish, so we can use that to our advantage. In particular, whereas Blowfish
70
+ * supports variable length keys, in bcrypt, the initial "key" is the sha512 hash of the
71
+ * password. sha512 hashes are 512 bits or 64 bytes long and thus the bcrypt keys are of a
72
+ * fixed length whereas Blowfish keys are not of a fixed length.
73
+ *
74
+ * bcrypt actually has two different key expansion steps. The first one (expandstate) is
75
+ * constantly XOR'ing every _encryptBlock() parameter against the salt prior _encryptBlock()'s
76
+ * being called. The second one (expand0state) is more similar to Blowfish's _setupKey()
77
+ * but it can still use the fixed length key optimization discussed above and can do away with
78
+ * the pack() / unpack() calls.
79
+ *
80
+ * I suppose _setupKey() could be made to be a thin wrapper around expandstate() but idk it's
81
+ * just a lot of work for very marginal benefits as _setupKey() is only called once for
82
+ * regular Blowfish vs the 128 times it's called --per round-- with bcrypt.
83
+ *
84
+ * # blowfish + bcrypt in the same class
85
+ *
86
+ * Altho there's a lot of Blowfish code that bcrypt doesn't re-use, bcrypt does re-use the
87
+ * initial S-boxes, the initial P-array and the int-only _encryptBlock() implementation.
88
+ *
89
+ * # Credit
90
+ *
91
+ * phpseclib's bcrypt implementation is based losely off of OpenSSH's implementation:
92
+ *
93
+ * https://github.com/openssh/openssh-portable/blob/master/openbsd-compat/bcrypt_pbkdf.c
94
+ *
95
  * Here's a short example of how to use this library:
96
  * <code>
97
  * <?php
155
  */
156
  var $cfb_init_len = 500;
157
 
158
+ /**
159
+ * SHA512 Object
160
+ *
161
+ * @see self::bcrypt_pbkdf
162
+ * @var object
163
+ * @access private
164
+ */
165
+ var $sha512;
166
+
167
  /**
168
  * The fixed subkeys boxes ($sbox0 - $sbox3) with 256 entries each
169
  *
373
  */
374
  var $key_length = 16;
375
 
376
+ /**
377
+ * Default Constructor.
378
+ *
379
+ * Determines whether or not the mcrypt extension should be used.
380
+ *
381
+ * $mode could be:
382
+ *
383
+ * - CRYPT_MODE_ECB
384
+ *
385
+ * - CRYPT_MODE_CBC
386
+ *
387
+ * - CRYPT_MODE_CTR
388
+ *
389
+ * - CRYPT_MODE_CFB
390
+ *
391
+ * - CRYPT_MODE_OFB
392
+ *
393
+ * (or the alias constants of the chosen cipher, for example for AES: CRYPT_AES_MODE_ECB or CRYPT_AES_MODE_CBC ...)
394
+ *
395
+ * If not explicitly set, CRYPT_MODE_CBC will be used.
396
+ *
397
+ * @param int $mode
398
+ * @access public
399
+ */
400
+ function __construct($mode = self::MODE_CBC)
401
+ {
402
+ parent::__construct($mode);
403
+
404
+ $this->sbox0 = array_map('intval', $this->sbox0);
405
+ $this->sbox1 = array_map('intval', $this->sbox1);
406
+ $this->sbox2 = array_map('intval', $this->sbox2);
407
+ $this->sbox3 = array_map('intval', $this->sbox3);
408
+ $this->parray = array_map('intval', $this->parray);
409
+ }
410
+
411
  /**
412
  * Sets the key length.
413
  *
483
  // unpack binary string in unsigned chars
484
  $key = array_values(unpack('C*', $this->key));
485
  $keyl = count($key);
486
+ // with bcrypt $keyl will always be 16 (because the key is the sha512 of the key you provide)
487
  for ($j = 0, $i = 0; $i < 18; ++$i) {
488
  // xor P1 with the first 32-bits of the key, xor P2 with the second 32-bits ...
489
  for ($data = 0, $k = 0; $k < 4; ++$k) {
492
  $j = 0;
493
  }
494
  }
495
+ $this->bctx['p'][] = $this->parray[$i] ^ intval($data);
496
  }
497
 
498
  // encrypt the zero-string, replace P1 and P2 with the encrypted data,
512
  }
513
  }
514
 
515
+ /**
516
+ * bcrypt
517
+ *
518
+ * @param string $sha2pass
519
+ * @param string $sha2salt
520
+ * @access private
521
+ * @return string
522
+ */
523
+ function _bcrypt_hash($sha2pass, $sha2salt)
524
+ {
525
+ $p = $this->parray;
526
+ $sbox0 = $this->sbox0;
527
+ $sbox1 = $this->sbox1;
528
+ $sbox2 = $this->sbox2;
529
+ $sbox3 = $this->sbox3;
530
+
531
+ $cdata = array_values(unpack('N*', 'OxychromaticBlowfishSwatDynamite'));
532
+ $sha2pass = array_values(unpack('N*', $sha2pass));
533
+ $sha2salt = array_values(unpack('N*', $sha2salt));
534
+
535
+ $this->_expandstate($sha2salt, $sha2pass, $sbox0, $sbox1, $sbox2, $sbox3, $p);
536
+ for ($i = 0; $i < 64; $i++) {
537
+ $this->_expand0state($sha2salt, $sbox0, $sbox1, $sbox2, $sbox3, $p);
538
+ $this->_expand0state($sha2pass, $sbox0, $sbox1, $sbox2, $sbox3, $p);
539
+ }
540
+
541
+ for ($i = 0; $i < 64; $i++) {
542
+ for ($j = 0; $j < 8; $j+= 2) { // count($cdata) == 8
543
+ list($cdata[$j], $cdata[$j + 1]) = $this->_encryptBlockHelperFast($cdata[$j], $cdata[$j + 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
544
+ }
545
+ }
546
+
547
+ $output = '';
548
+ for ($i = 0; $i < count($cdata); $i++) {
549
+ $output.= pack('L*', $cdata[$i]);
550
+ }
551
+ return $output;
552
+ }
553
+
554
+ /**
555
+ * Performs OpenSSH-style bcrypt
556
+ *
557
+ * @param string $pass
558
+ * @param string $salt
559
+ * @param int $keylen
560
+ * @param int $rounds
561
+ * @access public
562
+ * @return false|string
563
+ */
564
+ function bcrypt_pbkdf($pass, $salt, $keylen, $rounds)
565
+ {
566
+ if (PHP_INT_SIZE == 4) {
567
+ user_error('bcrypt is far too slow to be practical on 32-bit versions of PHP');
568
+ return false;
569
+ }
570
+
571
+ if (!isset($this->sha512)) {
572
+ $this->sha512 = new Hash('sha512');
573
+ }
574
+
575
+ $sha2pass = $this->sha512->hash($pass);
576
+ $results = array();
577
+ $count = 1;
578
+ while (32 * count($results) < $keylen) {
579
+ $countsalt = $salt . pack('N', $count++);
580
+ $sha2salt = $this->sha512->hash($countsalt);
581
+ $out = $tmpout = $this->_bcrypt_hash($sha2pass, $sha2salt);
582
+ for ($i = 1; $i < $rounds; $i++) {
583
+ $sha2salt = $this->sha512->hash($tmpout);
584
+ $tmpout = $this->_bcrypt_hash($sha2pass, $sha2salt);
585
+ $out^= $tmpout;
586
+ }
587
+ $results[] = $out;
588
+ }
589
+ $output = '';
590
+ for ($i = 0; $i < 32; $i++) {
591
+ foreach ($results as $result) {
592
+ $output.= $result[$i];
593
+ }
594
+ }
595
+ return substr($output, 0, $keylen);
596
+ }
597
+
598
+ /**
599
+ * Key expansion without salt
600
+ *
601
+ * @access private
602
+ * @param int[] $key
603
+ * @param int[] $sbox0
604
+ * @param int[] $sbox1
605
+ * @param int[] $sbox2
606
+ * @param int[] $sbox3
607
+ * @param int[] $p
608
+ * @see self::_bcrypt_hash()
609
+ */
610
+ function _expand0state($key, &$sbox0, &$sbox1, &$sbox2, &$sbox3, &$p)
611
+ {
612
+ // expand0state is basically the same thing as this:
613
+ //return $this->_expandstate(array_fill(0, 16, 0), $key);
614
+ // but this separate function eliminates a bunch of XORs and array lookups
615
+
616
+ $p = array(
617
+ $p[0] ^ $key[0],
618
+ $p[1] ^ $key[1],
619
+ $p[2] ^ $key[2],
620
+ $p[3] ^ $key[3],
621
+ $p[4] ^ $key[4],
622
+ $p[5] ^ $key[5],
623
+ $p[6] ^ $key[6],
624
+ $p[7] ^ $key[7],
625
+ $p[8] ^ $key[8],
626
+ $p[9] ^ $key[9],
627
+ $p[10] ^ $key[10],
628
+ $p[11] ^ $key[11],
629
+ $p[12] ^ $key[12],
630
+ $p[13] ^ $key[13],
631
+ $p[14] ^ $key[14],
632
+ $p[15] ^ $key[15],
633
+ $p[16] ^ $key[0],
634
+ $p[17] ^ $key[1]
635
+ );
636
+
637
+ // @codingStandardsIgnoreStart
638
+ list( $p[0], $p[1]) = $this->_encryptBlockHelperFast( 0, 0, $sbox0, $sbox1, $sbox2, $sbox3, $p);
639
+ list( $p[2], $p[3]) = $this->_encryptBlockHelperFast($p[ 0], $p[ 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
640
+ list( $p[4], $p[5]) = $this->_encryptBlockHelperFast($p[ 2], $p[ 3], $sbox0, $sbox1, $sbox2, $sbox3, $p);
641
+ list( $p[6], $p[7]) = $this->_encryptBlockHelperFast($p[ 4], $p[ 5], $sbox0, $sbox1, $sbox2, $sbox3, $p);
642
+ list( $p[8], $p[9]) = $this->_encryptBlockHelperFast($p[ 6], $p[ 7], $sbox0, $sbox1, $sbox2, $sbox3, $p);
643
+ list($p[10], $p[11]) = $this->_encryptBlockHelperFast($p[ 8], $p[ 9], $sbox0, $sbox1, $sbox2, $sbox3, $p);
644
+ list($p[12], $p[13]) = $this->_encryptBlockHelperFast($p[10], $p[11], $sbox0, $sbox1, $sbox2, $sbox3, $p);
645
+ list($p[14], $p[15]) = $this->_encryptBlockHelperFast($p[12], $p[13], $sbox0, $sbox1, $sbox2, $sbox3, $p);
646
+ list($p[16], $p[17]) = $this->_encryptBlockHelperFast($p[14], $p[15], $sbox0, $sbox1, $sbox2, $sbox3, $p);
647
+ // @codingStandardsIgnoreEnd
648
+
649
+ list($sbox0[0], $sbox0[1]) = $this->_encryptBlockHelperFast($p[16], $p[17], $sbox0, $sbox1, $sbox2, $sbox3, $p);
650
+ for ($i = 2; $i < 256; $i+= 2) {
651
+ list($sbox0[$i], $sbox0[$i + 1]) = $this->_encryptBlockHelperFast($sbox0[$i - 2], $sbox0[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
652
+ }
653
+
654
+ list($sbox1[0], $sbox1[1]) = $this->_encryptBlockHelperFast($sbox0[254], $sbox0[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
655
+ for ($i = 2; $i < 256; $i+= 2) {
656
+ list($sbox1[$i], $sbox1[$i + 1]) = $this->_encryptBlockHelperFast($sbox1[$i - 2], $sbox1[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
657
+ }
658
+
659
+ list($sbox2[0], $sbox2[1]) = $this->_encryptBlockHelperFast($sbox1[254], $sbox1[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
660
+ for ($i = 2; $i < 256; $i+= 2) {
661
+ list($sbox2[$i], $sbox2[$i + 1]) = $this->_encryptBlockHelperFast($sbox2[$i - 2], $sbox2[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
662
+ }
663
+
664
+ list($sbox3[0], $sbox3[1]) = $this->_encryptBlockHelperFast($sbox2[254], $sbox2[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
665
+ for ($i = 2; $i < 256; $i+= 2) {
666
+ list($sbox3[$i], $sbox3[$i + 1]) = $this->_encryptBlockHelperFast($sbox3[$i - 2], $sbox3[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
667
+ }
668
+ }
669
+
670
+ /**
671
+ * Key expansion with salt
672
+ *
673
+ * @access private
674
+ * @param int[] $data
675
+ * @param int[] $key
676
+ * @param int[] $sbox0
677
+ * @param int[] $sbox1
678
+ * @param int[] $sbox2
679
+ * @param int[] $sbox3
680
+ * @param int[] $p
681
+ * @see self::_bcrypt_hash()
682
+ */
683
+ function _expandstate($data, $key, &$sbox0, &$sbox1, &$sbox2, &$sbox3, &$p)
684
+ {
685
+ $p = array(
686
+ $p[0] ^ $key[0],
687
+ $p[1] ^ $key[1],
688
+ $p[2] ^ $key[2],
689
+ $p[3] ^ $key[3],
690
+ $p[4] ^ $key[4],
691
+ $p[5] ^ $key[5],
692
+ $p[6] ^ $key[6],
693
+ $p[7] ^ $key[7],
694
+ $p[8] ^ $key[8],
695
+ $p[9] ^ $key[9],
696
+ $p[10] ^ $key[10],
697
+ $p[11] ^ $key[11],
698
+ $p[12] ^ $key[12],
699
+ $p[13] ^ $key[13],
700
+ $p[14] ^ $key[14],
701
+ $p[15] ^ $key[15],
702
+ $p[16] ^ $key[0],
703
+ $p[17] ^ $key[1]
704
+ );
705
+
706
+ // @codingStandardsIgnoreStart
707
+ list( $p[0], $p[1]) = $this->_encryptBlockHelperFast($data[ 0] , $data[ 1] , $sbox0, $sbox1, $sbox2, $sbox3, $p);
708
+ list( $p[2], $p[3]) = $this->_encryptBlockHelperFast($data[ 2] ^ $p[ 0], $data[ 3] ^ $p[ 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
709
+ list( $p[4], $p[5]) = $this->_encryptBlockHelperFast($data[ 4] ^ $p[ 2], $data[ 5] ^ $p[ 3], $sbox0, $sbox1, $sbox2, $sbox3, $p);
710
+ list( $p[6], $p[7]) = $this->_encryptBlockHelperFast($data[ 6] ^ $p[ 4], $data[ 7] ^ $p[ 5], $sbox0, $sbox1, $sbox2, $sbox3, $p);
711
+ list( $p[8], $p[9]) = $this->_encryptBlockHelperFast($data[ 8] ^ $p[ 6], $data[ 9] ^ $p[ 7], $sbox0, $sbox1, $sbox2, $sbox3, $p);
712
+ list($p[10], $p[11]) = $this->_encryptBlockHelperFast($data[10] ^ $p[ 8], $data[11] ^ $p[ 9], $sbox0, $sbox1, $sbox2, $sbox3, $p);
713
+ list($p[12], $p[13]) = $this->_encryptBlockHelperFast($data[12] ^ $p[10], $data[13] ^ $p[11], $sbox0, $sbox1, $sbox2, $sbox3, $p);
714
+ list($p[14], $p[15]) = $this->_encryptBlockHelperFast($data[14] ^ $p[12], $data[15] ^ $p[13], $sbox0, $sbox1, $sbox2, $sbox3, $p);
715
+ list($p[16], $p[17]) = $this->_encryptBlockHelperFast($data[ 0] ^ $p[14], $data[ 1] ^ $p[15], $sbox0, $sbox1, $sbox2, $sbox3, $p);
716
+ // @codingStandardsIgnoreEnd
717
+
718
+ list($sbox0[0], $sbox0[1]) = $this->_encryptBlockHelperFast($data[2] ^ $p[16], $data[3] ^ $p[17], $sbox0, $sbox1, $sbox2, $sbox3, $p);
719
+ for ($i = 2, $j = 4; $i < 256; $i+= 2, $j = ($j + 2) % 16) { // instead of 16 maybe count($data) would be better?
720
+ list($sbox0[$i], $sbox0[$i + 1]) = $this->_encryptBlockHelperFast($data[$j] ^ $sbox0[$i - 2], $data[$j + 1] ^ $sbox0[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
721
+ }
722
+
723
+ list($sbox1[0], $sbox1[1]) = $this->_encryptBlockHelperFast($data[2] ^ $sbox0[254], $data[3] ^ $sbox0[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
724
+ for ($i = 2, $j = 4; $i < 256; $i+= 2, $j = ($j + 2) % 16) {
725
+ list($sbox1[$i], $sbox1[$i + 1]) = $this->_encryptBlockHelperFast($data[$j] ^ $sbox1[$i - 2], $data[$j + 1] ^ $sbox1[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
726
+ }
727
+
728
+ list($sbox2[0], $sbox2[1]) = $this->_encryptBlockHelperFast($data[2] ^ $sbox1[254], $data[3] ^ $sbox1[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
729
+ for ($i = 2, $j = 4; $i < 256; $i+= 2, $j = ($j + 2) % 16) {
730
+ list($sbox2[$i], $sbox2[$i + 1]) = $this->_encryptBlockHelperFast($data[$j] ^ $sbox2[$i - 2], $data[$j + 1] ^ $sbox2[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
731
+ }
732
+
733
+ list($sbox3[0], $sbox3[1]) = $this->_encryptBlockHelperFast($data[2] ^ $sbox2[254], $data[3] ^ $sbox2[255], $sbox0, $sbox1, $sbox2, $sbox3, $p);
734
+ for ($i = 2, $j = 4; $i < 256; $i+= 2, $j = ($j + 2) % 16) {
735
+ list($sbox3[$i], $sbox3[$i + 1]) = $this->_encryptBlockHelperFast($data[$j] ^ $sbox3[$i - 2], $data[$j + 1] ^ $sbox3[$i - 1], $sbox0, $sbox1, $sbox2, $sbox3, $p);
736
+ }
737
+ }
738
+
739
  /**
740
  * Encrypts a block
741
  *
756
  $l = $in[1];
757
  $r = $in[2];
758
 
759
+ list($r, $l) = CRYPT_BASE_USE_REG_INTVAL ?
760
+ $this->_encryptBlockHelperFast($l, $r, $sb_0, $sb_1, $sb_2, $sb_3, $p) :
761
+ $this->_encryptBlockHelperSlow($l, $r, $sb_0, $sb_1, $sb_2, $sb_3, $p);
 
 
762
 
763
+ return pack("N*", $r, $l);
764
+ }
765
+
766
+ /**
767
+ * Fast helper function for block encryption
768
+ *
769
+ * @access private
770
+ * @param int $x0
771
+ * @param int $x1
772
+ * @param int[] $sbox0
773
+ * @param int[] $sbox1
774
+ * @param int[] $sbox2
775
+ * @param int[] $sbox3
776
+ * @param int[] $p
777
+ * @return int[]
778
+ */
779
+ function _encryptBlockHelperFast($x0, $x1, $sbox0, $sbox1, $sbox2, $sbox3, $p)
780
+ {
781
+ $x0 ^= $p[0];
782
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[1];
783
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[2];
784
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[3];
785
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[4];
786
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[5];
787
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[6];
788
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[7];
789
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[8];
790
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[9];
791
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[10];
792
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[11];
793
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[12];
794
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[13];
795
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[14];
796
+ $x1 ^= ((($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[15];
797
+ $x0 ^= ((($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[16];
798
+
799
+ return array($x1 & 0xFFFFFFFF ^ $p[17], $x0 & 0xFFFFFFFF);
800
+ }
801
+
802
+ /**
803
+ * Slow helper function for block encryption
804
+ *
805
+ * @access private
806
+ * @param int $x0
807
+ * @param int $x1
808
+ * @param int[] $sbox0
809
+ * @param int[] $sbox1
810
+ * @param int[] $sbox2
811
+ * @param int[] $sbox3
812
+ * @param int[] $p
813
+ * @return int[]
814
+ */
815
+ function _encryptBlockHelperSlow($x0, $x1, $sbox0, $sbox1, $sbox2, $sbox3, $p)
816
+ {
817
+ $x0^= $p[0];
818
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[1];
819
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[2];
820
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[3];
821
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[4];
822
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[5];
823
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[6];
824
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[7];
825
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[8];
826
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[9];
827
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[10];
828
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[11];
829
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[12];
830
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[13];
831
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[14];
832
+ $x1^= $this->safe_intval(($this->safe_intval($sbox0[($x0 & 0xFF000000) >> 24] + $sbox1[($x0 & 0xFF0000) >> 16]) ^ $sbox2[($x0 & 0xFF00) >> 8]) + $sbox3[$x0 & 0xFF]) ^ $p[15];
833
+ $x0^= $this->safe_intval(($this->safe_intval($sbox0[($x1 & 0xFF000000) >> 24] + $sbox1[($x1 & 0xFF0000) >> 16]) ^ $sbox2[($x1 & 0xFF00) >> 8]) + $sbox3[$x1 & 0xFF]) ^ $p[16];
834
+
835
+ return array($x1 & 0xFFFFFFFF ^ $p[17], $x0 & 0xFFFFFFFF);
836
  }
837
 
838
  /**
vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php CHANGED
@@ -1246,9 +1246,9 @@ class DES extends Base
1246
  $pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[ $d & 0xFF];
1247
 
1248
  // Reorder: odd bytes/even bytes. Push the result in key schedule.
1249
- $val1 = ( $cp & 0xFF000000) | (($cp << 8) & 0x00FF0000) |
1250
  (($dp >> 16) & 0x0000FF00) | (($dp >> 8) & 0x000000FF);
1251
- $val2 = (($cp << 8) & 0xFF000000) | (($cp << 16) & 0x00FF0000) |
1252
  (($dp >> 8) & 0x0000FF00) | ( $dp & 0x000000FF);
1253
  $keys[$des_round][self::ENCRYPT][ ] = $val1;
1254
  $keys[$des_round][self::DECRYPT][$ki - 1] = $val1;
1246
  $pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[ $d & 0xFF];
1247
 
1248
  // Reorder: odd bytes/even bytes. Push the result in key schedule.
1249
+ $val1 = ( $cp & intval(0xFF000000)) | (($cp << 8) & 0x00FF0000) |
1250
  (($dp >> 16) & 0x0000FF00) | (($dp >> 8) & 0x000000FF);
1251
+ $val2 = (($cp << 8) & intval(0xFF000000)) | (($cp << 16) & 0x00FF0000) |
1252
  (($dp >> 8) & 0x0000FF00) | ( $dp & 0x000000FF);
1253
  $keys[$des_round][self::ENCRYPT][ ] = $val1;
1254
  $keys[$des_round][self::DECRYPT][$ki - 1] = $val1;
vendor/phpseclib/phpseclib/phpseclib/Crypt/RC2.php CHANGED
@@ -72,7 +72,7 @@ class RC2 extends Base
72
  * @var string
73
  * @access private
74
  */
75
- var $orig_key;
76
 
77
  /**
78
  * Don't truncate / null pad key
72
  * @var string
73
  * @access private
74
  */
75
+ var $orig_key = '';
76
 
77
  /**
78
  * Don't truncate / null pad key
vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php CHANGED
@@ -1388,6 +1388,10 @@ class RSA
1388
  // http://en.wikipedia.org/wiki/XML_Signature
1389
  case self::PRIVATE_FORMAT_XML:
1390
  case self::PUBLIC_FORMAT_XML:
 
 
 
 
1391
  $this->components = array();
1392
 
1393
  $xml = xml_parser_create('UTF-8');
@@ -1522,14 +1526,44 @@ class RSA
1522
  if ($magic !== "openssh-key-v1\0") {
1523
  return false;
1524
  }
1525
- $options = $this->_string_shift($decoded, 24);
1526
- // \0\0\0\4none = ciphername
1527
- // \0\0\0\4none = kdfname
1528
- // \0\0\0\0 = kdfoptions
1529
- // \0\0\0\1 = numkeys
1530
- if ($options != "\0\0\0\4none\0\0\0\4none\0\0\0\0\0\0\0\1") {
 
1531
  return false;
1532
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1533
  extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1534
  if (strlen($decoded) < $length) {
1535
  return false;
@@ -1539,12 +1573,16 @@ class RSA
1539
  if (strlen($decoded) < $length) {
1540
  return false;
1541
  }
1542
- $paddedKey = $this->_string_shift($decoded, $length);
1543
 
1544
  if ($this->_string_shift($publicKey, 11) !== "\0\0\0\7ssh-rsa") {
1545
  return false;
1546
  }
1547
 
 
 
 
 
 
1548
  $checkint1 = $this->_string_shift($paddedKey, 4);
1549
  $checkint2 = $this->_string_shift($paddedKey, 4);
1550
  if (strlen($checkint1) != 4 || $checkint1 !== $checkint2) {
1388
  // http://en.wikipedia.org/wiki/XML_Signature
1389
  case self::PRIVATE_FORMAT_XML:
1390
  case self::PUBLIC_FORMAT_XML:
1391
+ if (!extension_loaded('xml')) {
1392
+ return false;
1393
+ }
1394
+
1395
  $this->components = array();
1396
 
1397
  $xml = xml_parser_create('UTF-8');
1526
  if ($magic !== "openssh-key-v1\0") {
1527
  return false;
1528
  }
1529
+ extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1530
+ if (strlen($decoded) < $length) {
1531
+ return false;
1532
+ }
1533
+ $ciphername = $this->_string_shift($decoded, $length);
1534
+ extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1535
+ if (strlen($decoded) < $length) {
1536
  return false;
1537
  }
1538
+ $kdfname = $this->_string_shift($decoded, $length);
1539
+ extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1540
+ if (strlen($decoded) < $length) {
1541
+ return false;
1542
+ }
1543
+ $kdfoptions = $this->_string_shift($decoded, $length);
1544
+ extract(unpack('Nnumkeys', $this->_string_shift($decoded, 4)));
1545
+ if ($numkeys != 1 || ($ciphername != 'none' && $kdfname != 'bcrypt')) {
1546
+ return false;
1547
+ }
1548
+ switch ($ciphername) {
1549
+ case 'none':
1550
+ break;
1551
+ case 'aes256-ctr':
1552
+ extract(unpack('Nlength', $this->_string_shift($kdfoptions, 4)));
1553
+ if (strlen($kdfoptions) < $length) {
1554
+ return false;
1555
+ }
1556
+ $salt = $this->_string_shift($kdfoptions, $length);
1557
+ extract(unpack('Nrounds', $this->_string_shift($kdfoptions, 4)));
1558
+ $crypto = new AES(AES::MODE_CTR);
1559
+ $crypto->disablePadding();
1560
+ if (!$crypto->setPassword($this->password, 'bcrypt', $salt, $rounds, 32)) {
1561
+ return false;
1562
+ }
1563
+ break;
1564
+ default:
1565
+ return false;
1566
+ }
1567
  extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1568
  if (strlen($decoded) < $length) {
1569
  return false;
1573
  if (strlen($decoded) < $length) {
1574
  return false;
1575
  }
 
1576
 
1577
  if ($this->_string_shift($publicKey, 11) !== "\0\0\0\7ssh-rsa") {
1578
  return false;
1579
  }
1580
 
1581
+ $paddedKey = $this->_string_shift($decoded, $length);
1582
+ if (isset($crypto)) {
1583
+ $paddedKey = $crypto->decrypt($paddedKey);
1584
+ }
1585
+
1586
  $checkint1 = $this->_string_shift($paddedKey, 4);
1587
  $checkint2 = $this->_string_shift($paddedKey, 4);
1588
  if (strlen($checkint1) != 4 || $checkint1 !== $checkint2) {
vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php CHANGED
@@ -151,7 +151,10 @@ class Random
151
  (isset($_POST) ? phpseclib_safe_serialize($_POST) : '') .
152
  (isset($_GET) ? phpseclib_safe_serialize($_GET) : '') .
153
  (isset($_COOKIE) ? phpseclib_safe_serialize($_COOKIE) : '') .
154
- phpseclib_safe_serialize($GLOBALS) .
 
 
 
155
  phpseclib_safe_serialize($_SESSION) .
156
  phpseclib_safe_serialize($_OLD_SESSION)
157
  ));
151
  (isset($_POST) ? phpseclib_safe_serialize($_POST) : '') .
152
  (isset($_GET) ? phpseclib_safe_serialize($_GET) : '') .
153
  (isset($_COOKIE) ? phpseclib_safe_serialize($_COOKIE) : '') .
154
+ // as of PHP 8.1 $GLOBALS cann't be accessed by reference, which eliminates
155
+ // the need for phpseclib_safe_serialize. see https://wiki.php.net/rfc/restrict_globals_usage
156
+ // for more info
157
+ (version_compare(PHP_VERSION, '8.1.0', '>=') ? serialize($GLOBALS) : phpseclib_safe_serialize($GLOBALS)) .
158
  phpseclib_safe_serialize($_SESSION) .
159
  phpseclib_safe_serialize($_OLD_SESSION)
160
  ));
vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php CHANGED
@@ -340,7 +340,7 @@ class Rijndael extends Base
340
  $k = $c[2];
341
  $l = $c[3];
342
  while ($i < $Nb) {
343
- $temp[$i] = ($state[$i] & 0xFF000000) ^
344
  ($state[$j] & 0x00FF0000) ^
345
  ($state[$k] & 0x0000FF00) ^
346
  ($state[$l] & 0x000000FF) ^
@@ -426,7 +426,7 @@ class Rijndael extends Base
426
  $l = $Nb - $c[3];
427
 
428
  while ($i < $Nb) {
429
- $word = ($state[$i] & 0xFF000000) |
430
  ($state[$j] & 0x00FF0000) |
431
  ($state[$k] & 0x0000FF00) |
432
  ($state[$l] & 0x000000FF);
@@ -465,14 +465,19 @@ class Rijndael extends Base
465
  {
466
  // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.
467
  // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse
468
- static $rcon = array(0,
469
- 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,
470
- 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,
471
- 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,
472
- 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,
473
- 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,
474
- 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000
475
- );
 
 
 
 
 
476
 
477
  if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) {
478
  // already expanded
@@ -511,7 +516,7 @@ class Rijndael extends Base
511
  // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,
512
  // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'
513
  // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.
514
- $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord
515
  $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];
516
  } elseif ($this->Nk > 6 && $i % $this->Nk == 4) {
517
  $temp = $this->_subWord($temp);
@@ -641,9 +646,9 @@ class Rijndael extends Base
641
  ));
642
 
643
  foreach ($t3 as $t3i) {
644
- $t0[] = (($t3i << 24) & 0xFF000000) | (($t3i >> 8) & 0x00FFFFFF);
645
- $t1[] = (($t3i << 16) & 0xFFFF0000) | (($t3i >> 16) & 0x0000FFFF);
646
- $t2[] = (($t3i << 8) & 0xFFFFFF00) | (($t3i >> 24) & 0x000000FF);
647
  }
648
 
649
  $tables = array(
@@ -725,9 +730,9 @@ class Rijndael extends Base
725
  ));
726
 
727
  foreach ($dt3 as $dt3i) {
728
- $dt0[] = (($dt3i << 24) & 0xFF000000) | (($dt3i >> 8) & 0x00FFFFFF);
729
- $dt1[] = (($dt3i << 16) & 0xFFFF0000) | (($dt3i >> 16) & 0x0000FFFF);
730
- $dt2[] = (($dt3i << 8) & 0xFFFFFF00) | (($dt3i >> 24) & 0x000000FF);
731
  };
732
 
733
  $tables = array(
340
  $k = $c[2];
341
  $l = $c[3];
342
  while ($i < $Nb) {
343
+ $temp[$i] = ($state[$i] & intval(0xFF000000)) ^
344
  ($state[$j] & 0x00FF0000) ^
345
  ($state[$k] & 0x0000FF00) ^
346
  ($state[$l] & 0x000000FF) ^
426
  $l = $Nb - $c[3];
427
 
428
  while ($i < $Nb) {
429
+ $word = ($state[$i] & intval(0xFF000000)) |
430
  ($state[$j] & 0x00FF0000) |
431
  ($state[$k] & 0x0000FF00) |
432
  ($state[$l] & 0x000000FF);
465
  {
466
  // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.
467
  // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse
468
+ static $rcon;
469
+
470
+ if (!isset($rcon)) {
471
+ $rcon = array(0,
472
+ 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,
473
+ 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,
474
+ 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,
475
+ 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,
476
+ 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,
477
+ 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000
478
+ );
479
+ $rcon = array_map('intval', $rcon);
480
+ }
481
 
482
  if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) {
483
  // already expanded
516
  // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,
517
  // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'
518
  // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.
519
+ $temp = (($temp << 8) & intval(0xFFFFFF00)) | (($temp >> 24) & 0x000000FF); // rotWord
520
  $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];
521
  } elseif ($this->Nk > 6 && $i % $this->Nk == 4) {
522
  $temp = $this->_subWord($temp);
646
  ));
647
 
648
  foreach ($t3 as $t3i) {
649
+ $t0[] = (($t3i << 24) & intval(0xFF000000)) | (($t3i >> 8) & 0x00FFFFFF);
650
+ $t1[] = (($t3i << 16) & intval(0xFFFF0000)) | (($t3i >> 16) & 0x0000FFFF);
651
+ $t2[] = (($t3i << 8) & intval(0xFFFFFF00)) | (($t3i >> 24) & 0x000000FF);
652
  }
653
 
654
  $tables = array(
730
  ));
731
 
732
  foreach ($dt3 as $dt3i) {
733
+ $dt0[] = (($dt3i << 24) & intval(0xFF000000)) | (($dt3i >> 8) & 0x00FFFFFF);
734
+ $dt1[] = (($dt3i << 16) & intval(0xFFFF0000)) | (($dt3i >> 16) & 0x0000FFFF);
735
+ $dt2[] = (($dt3i << 8) & intval(0xFFFFFF00)) | (($dt3i >> 24) & 0x000000FF);
736
  };
737
 
738
  $tables = array(
vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php CHANGED
@@ -368,6 +368,42 @@ class Twofish extends Base
368
  */
369
  var $key_length = 16;
370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  /**
372
  * Sets the key length.
373
  *
368
  */
369
  var $key_length = 16;
370
 
371
+ /**
372
+ * Default Constructor.
373
+ *
374
+ * Determines whether or not the mcrypt extension should be used.
375
+ *
376
+ * $mode could be:
377
+ *
378
+ * - CRYPT_MODE_ECB
379
+ *
380
+ * - CRYPT_MODE_CBC
381
+ *
382
+ * - CRYPT_MODE_CTR
383
+ *
384
+ * - CRYPT_MODE_CFB
385
+ *
386
+ * - CRYPT_MODE_OFB
387
+ *
388
+ * (or the alias constants of the chosen cipher, for example for AES: CRYPT_AES_MODE_ECB or CRYPT_AES_MODE_CBC ...)
389
+ *
390
+ * If not explicitly set, CRYPT_MODE_CBC will be used.
391
+ *
392
+ * @param int $mode
393
+ * @access public
394
+ */
395
+ function __construct($mode = self::MODE_CBC)
396
+ {
397
+ parent::__construct($mode);
398
+
399
+ $this->m0 = array_map('intval', $this->m0);
400
+ $this->m1 = array_map('intval', $this->m1);
401
+ $this->m2 = array_map('intval', $this->m2);
402
+ $this->m3 = array_map('intval', $this->m3);
403
+ $this->q0 = array_map('intval', $this->q0);
404
+ $this->q1 = array_map('intval', $this->q1);
405
+ }
406
+
407
  /**
408
  * Sets the key length.
409
  *
vendor/phpseclib/phpseclib/phpseclib/File/X509.php CHANGED
@@ -145,6 +145,7 @@ class X509
145
  var $AuthorityKeyIdentifier;
146
  var $CertificatePolicies;
147
  var $AuthorityInfoAccessSyntax;
 
148
  var $SubjectAltName;
149
  var $SubjectDirectoryAttributes;
150
  var $PrivateKeyUsagePeriod;
@@ -2163,7 +2164,11 @@ class X509
2163
  if (!$fsock) {
2164
  return false;
2165
  }
2166
- fputs($fsock, "GET $parts[path] HTTP/1.0\r\n");
 
 
 
 
2167
  fputs($fsock, "Host: $parts[host]\r\n\r\n");
2168
  $line = fgets($fsock, 1024);
2169
  if (strlen($line) < 3) {
145
  var $AuthorityKeyIdentifier;
146
  var $CertificatePolicies;
147
  var $AuthorityInfoAccessSyntax;
148
+ var $SubjectInfoAccessSyntax;
149
  var $SubjectAltName;
150
  var $SubjectDirectoryAttributes;
151
  var $PrivateKeyUsagePeriod;
2164
  if (!$fsock) {
2165
  return false;
2166
  }
2167
+ $path = $parts['path'];
2168
+ if (isset($parts['query'])) {
2169
+ $path.= '?' . $parts['query'];
2170
+ }
2171
+ fputs($fsock, "GET $path HTTP/1.0\r\n");
2172
  fputs($fsock, "Host: $parts[host]\r\n\r\n");
2173
  $line = fgets($fsock, 1024);
2174
  if (strlen($line) < 3) {
vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php CHANGED
@@ -263,12 +263,12 @@ class BigInteger
263
  }
264
  }
265
 
266
- if (function_exists('phpinfo') && extension_loaded('openssl') && !defined('MATH_BIGINTEGER_OPENSSL_DISABLE') && !defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
267
  // some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
268
  $versions = array();
269
 
270
  // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems)
271
- if (strpos(ini_get('disable_functions'), 'phpinfo') === false) {
272
  ob_start();
273
  @phpinfo();
274
  $content = ob_get_contents();
@@ -372,7 +372,7 @@ class BigInteger
372
  break;
373
  case self::MODE_BCMATH:
374
  // round $len to the nearest 4 (thanks, DavidMJ!)
375
- $len = (strlen($x) + 3) & 0xFFFFFFFC;
376
 
377
  $x = str_pad($x, $len, chr(0), STR_PAD_LEFT);
378
 
263
  }
264
  }
265
 
266
+ if (extension_loaded('openssl') && !defined('MATH_BIGINTEGER_OPENSSL_DISABLE') && !defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
267
  // some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
268
  $versions = array();
269
 
270
  // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems)
271
+ if (function_exists('phpinfo')) {
272
  ob_start();
273
  @phpinfo();
274
  $content = ob_get_contents();
372
  break;
373
  case self::MODE_BCMATH:
374
  // round $len to the nearest 4 (thanks, DavidMJ!)
375
+ $len = (strlen($x) + 3) & ~3;
376
 
377
  $x = str_pad($x, $len, chr(0), STR_PAD_LEFT);
378
 
vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php CHANGED
@@ -422,7 +422,7 @@ class SFTP extends SSH2
422
  // yields inconsistent behavior depending on how php is compiled. so we left shift -1 (which, in
423
  // two's compliment, consists of all 1 bits) by 31. on 64-bit systems this'll yield 0xFFFFFFFF80000000.
424
  // that's not a problem, however, and 'anded' and a 32-bit number, as all the leading 1 bits are ignored.
425
- (-1 << 31) & 0xFFFFFFFF => 'NET_SFTP_ATTR_EXTENDED'
426
  );
427
  $this->open_flags = array(
428
  0x00000001 => 'NET_SFTP_OPEN_READ',
@@ -718,7 +718,16 @@ class SFTP extends SSH2
718
  return false;
719
  }
720
 
 
721
  $this->pwd = $this->_realpath('.');
 
 
 
 
 
 
 
 
722
 
723
  $this->_update_stat_cache($this->pwd, array());
724
 
@@ -766,7 +775,9 @@ class SFTP extends SSH2
766
  }
767
 
768
  /**
769
- * Enable path canonicalization
 
 
770
  *
771
  * @access public
772
  */
@@ -872,10 +883,37 @@ class SFTP extends SSH2
872
  function _realpath($path)
873
  {
874
  if (!$this->canonicalize_paths) {
875
- return $path;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
876
  }
877
 
878
- if ($this->pwd === false) {
879
  // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.9
880
  if (!$this->_send_sftp_packet(NET_SFTP_REALPATH, pack('Na*', strlen($path), $path))) {
881
  return false;
@@ -897,7 +935,6 @@ class SFTP extends SSH2
897
  $this->_logError($response);
898
  return false;
899
  default:
900
- user_error('Expected SSH_FXP_NAME or SSH_FXP_STATUS');
901
  return false;
902
  }
903
  }
@@ -1013,6 +1050,12 @@ class SFTP extends SSH2
1013
  {
1014
  $files = $this->_list($dir, false);
1015
 
 
 
 
 
 
 
1016
  if (!$recursive || $files === false) {
1017
  return $files;
1018
  }
@@ -1048,6 +1091,13 @@ class SFTP extends SSH2
1048
  function rawlist($dir = '.', $recursive = false)
1049
  {
1050
  $files = $this->_list($dir, true);
 
 
 
 
 
 
 
1051
  if (!$recursive || $files === false) {
1052
  return $files;
1053
  }
@@ -1115,8 +1165,12 @@ class SFTP extends SSH2
1115
  break;
1116
  case NET_SFTP_STATUS:
1117
  // presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
1118
- $this->_logError($response);
1119
- return false;
 
 
 
 
1120
  default:
1121
  user_error('Expected SSH_FXP_HANDLE or SSH_FXP_STATUS');
1122
  return false;
@@ -1185,7 +1239,7 @@ class SFTP extends SSH2
1185
  extract(unpack('Nstatus', $this->_string_shift($response, 4)));
1186
  if ($status != NET_SFTP_STATUS_EOF) {
1187
  $this->_logError($response, $status);
1188
- return false;
1189
  }
1190
  break 2;
1191
  default:
@@ -1861,7 +1915,7 @@ class SFTP extends SSH2
1861
  $i = 0;
1862
  $entries = $this->_list($path, true);
1863
 
1864
- if ($entries === false) {
1865
  return $this->_setstat($path, $attr, false);
1866
  }
1867
 
@@ -2273,7 +2327,7 @@ class SFTP extends SSH2
2273
  case is_resource($data):
2274
  $mode = $mode & ~self::SOURCE_LOCAL_FILE;
2275
  $info = stream_get_meta_data($data);
2276
- if ($info['wrapper_type'] == 'PHP' && $info['stream_type'] == 'Input') {
2277
  $fp = fopen('php://memory', 'w+');
2278
  stream_copy_to_stream($data, $fp);
2279
  rewind($fp);
@@ -2706,12 +2760,17 @@ class SFTP extends SSH2
2706
  $i = 0;
2707
  $entries = $this->_list($path, true);
2708
 
2709
- // normally $entries would have at least . and .. but it might not if the directories
2710
- // permissions didn't allow reading
2711
- if (empty($entries)) {
2712
  return false;
2713
  }
2714
 
 
 
 
 
 
 
2715
  unset($entries['.'], $entries['..']);
2716
  foreach ($entries as $filename => $props) {
2717
  if (!isset($props['type'])) {
@@ -3618,6 +3677,9 @@ class SFTP extends SSH2
3618
  while ($tempLength > 0) {
3619
  $temp = $this->_get_channel_packet(self::CHANNEL, true);
3620
  if (is_bool($temp)) {
 
 
 
3621
  $this->packet_type = false;
3622
  $this->packet_buffer = '';
3623
  return false;
422
  // yields inconsistent behavior depending on how php is compiled. so we left shift -1 (which, in
423
  // two's compliment, consists of all 1 bits) by 31. on 64-bit systems this'll yield 0xFFFFFFFF80000000.
424
  // that's not a problem, however, and 'anded' and a 32-bit number, as all the leading 1 bits are ignored.
425
+ (PHP_INT_SIZE == 4 ? -1 : 0xFFFFFFFF) => 'NET_SFTP_ATTR_EXTENDED'
426
  );
427
  $this->open_flags = array(
428
  0x00000001 => 'NET_SFTP_OPEN_READ',
718
  return false;
719
  }
720
 
721
+ $this->pwd = true;
722
  $this->pwd = $this->_realpath('.');
723
+ if ($this->pwd === false) {
724
+ if (!$this->canonicalize_paths) {
725
+ user_error('Unable to canonicalize current working directory');
726
+ return false;
727
+ }
728
+ $this->canonicalize_paths = false;
729
+ $this->_reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST);
730
+ }
731
 
732
  $this->_update_stat_cache($this->pwd, array());
733
 
775
  }
776
 
777
  /**
778
+ * Disable path canonicalization
779
+ *
780
+ * If this is enabled then $sftp->pwd() will not return the canonicalized absolute path
781
  *
782
  * @access public
783
  */
883
  function _realpath($path)
884
  {
885
  if (!$this->canonicalize_paths) {
886
+ if ($this->pwd === true) {
887
+ return '.';
888
+ }
889
+ if (!strlen($path) || $path[0] != '/') {
890
+ $path = $this->pwd . '/' . $path;
891
+ }
892
+
893
+ $parts = explode('/', $path);
894
+ $afterPWD = $beforePWD = [];
895
+ foreach ($parts as $part) {
896
+ switch ($part) {
897
+ //case '': // some SFTP servers /require/ double /'s. see https://github.com/phpseclib/phpseclib/pull/1137
898
+ case '.':
899
+ break;
900
+ case '..':
901
+ if (!empty($afterPWD)) {
902
+ array_pop($afterPWD);
903
+ } else {
904
+ $beforePWD[] = '..';
905
+ }
906
+ break;
907
+ default:
908
+ $afterPWD[] = $part;
909
+ }
910
+ }
911
+
912
+ $beforePWD = count($beforePWD) ? implode('/', $beforePWD) : '.';
913
+ return $beforePWD . '/' . implode('/', $afterPWD);
914
  }
915
 
916
+ if ($this->pwd === true) {
917
  // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-8.9
918
  if (!$this->_send_sftp_packet(NET_SFTP_REALPATH, pack('Na*', strlen($path), $path))) {
919
  return false;
935
  $this->_logError($response);
936
  return false;
937
  default:
 
938
  return false;
939
  }
940
  }
1050
  {
1051
  $files = $this->_list($dir, false);
1052
 
1053
+ // If we get an int back, then that is an "unexpected" status.
1054
+ // We do not have a file list, so return false.
1055
+ if (is_int($files)) {
1056
+ return false;
1057
+ }
1058
+
1059
  if (!$recursive || $files === false) {
1060
  return $files;
1061
  }
1091
  function rawlist($dir = '.', $recursive = false)
1092
  {
1093
  $files = $this->_list($dir, true);
1094
+
1095
+ // If we get an int back, then that is an "unexpected" status.
1096
+ // We do not have a file list, so return false.
1097
+ if (is_int($files)) {
1098
+ return false;
1099
+ }
1100
+
1101
  if (!$recursive || $files === false) {
1102
  return $files;
1103
  }
1165
  break;
1166
  case NET_SFTP_STATUS:
1167
  // presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
1168
+ if (strlen($response) < 4) {
1169
+ return false;
1170
+ }
1171
+ extract(unpack('Nstatus', $this->_string_shift($response, 4)));
1172
+ $this->_logError($response, $status);
1173
+ return $status;
1174
  default:
1175
  user_error('Expected SSH_FXP_HANDLE or SSH_FXP_STATUS');
1176
  return false;
1239
  extract(unpack('Nstatus', $this->_string_shift($response, 4)));
1240
  if ($status != NET_SFTP_STATUS_EOF) {
1241
  $this->_logError($response, $status);
1242
+ return $status;
1243
  }
1244
  break 2;
1245
  default:
1915
  $i = 0;
1916
  $entries = $this->_list($path, true);
1917
 
1918
+ if ($entries === false || is_int($entries)) {
1919
  return $this->_setstat($path, $attr, false);
1920
  }
1921
 
2327
  case is_resource($data):
2328
  $mode = $mode & ~self::SOURCE_LOCAL_FILE;
2329
  $info = stream_get_meta_data($data);
2330
+ if (isset($info['wrapper_type']) && $info['wrapper_type'] == 'PHP' && $info['stream_type'] == 'Input') {
2331
  $fp = fopen('php://memory', 'w+');
2332
  stream_copy_to_stream($data, $fp);
2333
  rewind($fp);
2760
  $i = 0;
2761
  $entries = $this->_list($path, true);
2762
 
2763
+ // The folder does not exist at all, so we cannot delete it.
2764
+ if ($entries === NET_SFTP_STATUS_NO_SUCH_FILE) {
 
2765
  return false;
2766
  }
2767
 
2768
+ // Normally $entries would have at least . and .. but it might not if the directories
2769
+ // permissions didn't allow reading. If this happens then default to an empty list of files.
2770
+ if ($entries === false || is_int($entries)) {
2771
+ $entries = array();
2772
+ }
2773
+
2774
  unset($entries['.'], $entries['..']);
2775
  foreach ($entries as $filename => $props) {
2776
  if (!isset($props['type'])) {
3677
  while ($tempLength > 0) {
3678
  $temp = $this->_get_channel_packet(self::CHANNEL, true);
3679
  if (is_bool($temp)) {
3680
+ if ($temp && $this->channel_status[self::CHANNEL] === NET_SSH2_MSG_CHANNEL_CLOSE) {
3681
+ $this->channel_close = true;
3682
+ }
3683
  $this->packet_type = false;
3684
  $this->packet_buffer = '';
3685
  return false;
vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php CHANGED
@@ -3519,7 +3519,11 @@ class SSH2
3519
 
3520
  if (!is_resource($this->fsock) || feof($this->fsock)) {
3521
  $this->bitmap = 0;
3522
- user_error('Connection closed (by server) prematurely ' . $elapsed . 's');
 
 
 
 
3523
  return false;
3524
  }
3525
 
3519
 
3520
  if (!is_resource($this->fsock) || feof($this->fsock)) {
3521
  $this->bitmap = 0;
3522
+ $str = 'Connection closed (by server) prematurely';
3523
+ if (isset($elapsed)) {
3524
+ $str.= ' ' . $elapsed . 's';
3525
+ }
3526
+ user_error($str);
3527
  return false;
3528
  }
3529