Skip to content

Instantly share code, notes, and snippets.

@0m3r
Last active December 30, 2020 07:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0m3r/ac8b8c83edead75a476c0657ade52a7c to your computer and use it in GitHub Desktop.
Save 0m3r/ac8b8c83edead75a476c0657ade52a7c to your computer and use it in GitHub Desktop.
Magento 2.3.2 and php 7.3 Fixing

when you get this error:

bin/magento
An exception was raised while creating "Request"; no instance returned

Bug description and idea https://magento.stackexchange.com/questions/256953/an-exception-was-raised-while-creating-request-no-instance-returned

mkdir -p patches/composer
touch patches/composer/magento2.3.2-php7.3.patch

curl https://gist.githubusercontent.com/0m3r/ac8b8c83edead75a476c0657ade52a7c/raw/23b17cf3f67987e69b718b1154cd744e8dd3f576/magento2.3.2-php7.3.diff -o patches/composer/magento2.3.2-php7.3.patch

cat patches/composer/magento2.3.2-php7.3.patch | sha1sum
7a26e16f337e7313b45fb24d92e338ed1a10819e

patch -p1 -b < patches/composer/magento2.3.2-php7.3.patch

Patch content

---
 .../vendor/zendframework/zend-stdlib/src/ArrayObject.php                         |  1 +-
 .../vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php  |  3 +-

diff --git a/vendor/zendframework/zend-stdlib/src/ArrayObject.php b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
--- a/vendor/zendframework/zend-stdlib/src/ArrayObject.php
+++ b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
@@ -423,7 +423,7 @@
                     $this->setIteratorClass($v);
                     break;
                 case 'protectedProperties':
-                    continue 2;
+                    continue;
                 default:
                     $this->__set($k, $v);
             }
diff --git a/vendor/zendframework/zend-stdlib/src/ArrayObject.php b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
--- a/vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
+++ b/vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
@@ -898,7 +898,7 @@
                     if ($language != 0) {
                         $this->_debugLog('Type 0 cmap tables must be language-independent;'
                                          . ' language: %d; skipping', $language);
-                        continue 2;
+                        continue;
                     }
                     break;

@@ -917,7 +917,7 @@
                 case 0xa:    // break intentionally omitted
                 case 0xc:
                     $this->_debugLog('Format: 0x%x currently unsupported; skipping', $format);
-                    continue 2;
+                    continue;
                     //$this->skipBytes(2);
                     //$cmapLength = $this->readUInt(4);
                     //$language = $this->readUInt(4);
@@ -929,7 +929,7 @@

                 default:
                     $this->_debugLog('Unknown subtable format: 0x%x; skipping', $format);
-                    continue 2;
+                    continue;
             }
             $cmapType = $format;
             break;

Apply patch

patch < patches/composer/magento2.3.2-php7.3.patch 
can't find file to patch at input line 8
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|---
| .../vendor/zendframework/zend-stdlib/src/ArrayObject.php                         |  1 +-
| .../vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php  |  3 +-
|
|diff --git a/vendor/zendframework/zend-stdlib/src/ArrayObject.php b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
|--- a/vendor/zendframework/zend-stdlib/src/ArrayObject.php
|+++ b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
--------------------------
File to patch: ./vendor/zendframework/zend-stdlib/src/ArrayObject.php         
patching file ./vendor/zendframework/zend-stdlib/src/ArrayObject.php
Reversed (or previously applied) patch detected!  Assume -R? [n] y
can't find file to patch at input line 20
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/vendor/zendframework/zend-stdlib/src/ArrayObject.php b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
|--- a/vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
|+++ b/vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
--------------------------
File to patch: ./vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
patching file ./vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
Reversed (or previously applied) patch detected!  Assume -R? [n] y
$ bin/magento 
Magento CLI 2.3.2
---
.../vendor/zendframework/zend-stdlib/src/ArrayObject.php | 1 +-
.../vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php | 3 +-
diff --git a/vendor/zendframework/zend-stdlib/src/ArrayObject.php b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
--- a/vendor/zendframework/zend-stdlib/src/ArrayObject.php
+++ b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
@@ -423,7 +423,7 @@
$this->setIteratorClass($v);
break;
case 'protectedProperties':
- continue 2;
+ continue;
default:
$this->__set($k, $v);
}
diff --git a/vendor/zendframework/zend-stdlib/src/ArrayObject.php b/vendor/zendframework/zend-stdlib/src/ArrayObject.php
--- a/vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
+++ b/vendor/magento/zendframework1/library/Zend/Pdf/FileParser/Font/OpenType.php
@@ -898,7 +898,7 @@
if ($language != 0) {
$this->_debugLog('Type 0 cmap tables must be language-independent;'
. ' language: %d; skipping', $language);
- continue 2;
+ continue;
}
break;
@@ -917,7 +917,7 @@
case 0xa: // break intentionally omitted
case 0xc:
$this->_debugLog('Format: 0x%x currently unsupported; skipping', $format);
- continue 2;
+ continue;
//$this->skipBytes(2);
//$cmapLength = $this->readUInt(4);
//$language = $this->readUInt(4);
@@ -929,7 +929,7 @@
default:
$this->_debugLog('Unknown subtable format: 0x%x; skipping', $format);
- continue 2;
+ continue;
}
$cmapType = $format;
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment