From 2aec25b6e70d6748840fc81c9b58f19a1f640c9e Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Mon, 6 Jan 2020 14:48:16 +0530 Subject: [PATCH 1/2] Add bcmath config Signed-off-by: Riddhesh Sanghvi --- templates/config/php-fpm/php70.zip | Bin 54620 -> 54839 bytes templates/config/php-fpm/php72.zip | Bin 78622 -> 78841 bytes templates/config/php-fpm/php73.zip | Bin 79717 -> 79936 bytes templates/config/php-fpm/php74.zip | Bin 80492 -> 80711 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/templates/config/php-fpm/php70.zip b/templates/config/php-fpm/php70.zip index 1d3955b12c0e61f23ca73795e67feceb926dc3c6..4205b77da704d01f37ea8f5437afcba80b64692c 100644 GIT binary patch delta 385 zcmcb!ih27Q<_#81EUCYQ;wCpTNwRd8ss&7rWK!VB1Bx^P@#aRR940{qpzxBY*Ezxr z3=ANwGP#jcRy-*=H?br`FEcMQG=!6ZIpe2L97x;bKo&_(s9bUW=Ep2-`(PFbZ#q1k z6Jp8iGkPpw)r{w)H@`UZlTiV~5(WvNRSXP_K)j^!G0WtOXJv$u?PP`6IT>ieAjJkm%+{rW~ftajbv#!W0Q_ zE<8M)6QYvmtR6E^<>bP1GMgjM{$!lI=e*qH0wC^T<(kZN!GSrDm0|LIR@KQ_7aW)r z*(Nt$mYIBtjd$|(OEQz?F0f7henF0DD%)i7i_uIX9AMcA7d@EjAk1$UeV9H#m0Om4WG&b*0>VX_0a#AK!`4vbloov*|&22EaY zC4f8d%OB!eVF2qy!>r_&5T003$D Babf@f diff --git a/templates/config/php-fpm/php72.zip b/templates/config/php-fpm/php72.zip index 76cde46fc47c0fec28a9a5e0f08994996d18c271..6bb7e01b210aa8325bcd845ba931f10c9940dec1 100644 GIT binary patch delta 394 zcmbRDjOFKZmJJq6Ec<>5#cj4>+7ijKp;Rqk@|S1@jx9hTu&_+beI`K$pzxBY*Ezxr z3=ANwGI>Fqtaws#ZemG>US?iqXb2|*bH-1hIFPo<7vm&3p>oCfn?J^VJpi_0vJI2u zc4h^}H=JN=rhnFC)MEi@n69Y9D81c5i!m9CP1CpNFlq}UTg3{o3ao4TVjV^~rlk1k z2lW_brr+0L^kTd)T}ziSooPV=L~Ok-qc5{aBE#eZ2~yJ~^%xx(Cr>}1$0$3!T#wO% z@h^y-$&{ZAQY<^&L!Z%?=_!~aGkHxi_w;@Gj1EkpDG;M%3>dwb4nsJTyHdEO_Za|X z4O6FIFkp;id^ugqkTHfSdH?hdLq>nbxzleLG6piKDNNTkV)SFmQkY(C#2CwXYWhth VMsq$H1{sDHE(V5pO-5jF0syOXeo*95f6ff}Yy)M1pFY#Jl9{je5eAk*|ZT}HX-Mj&FB zE~6K7d_2SCxACgeb@Uh=nDi5-U({lhnck(x=*zq~fnl;?qSW*+AQ`13h)j?^qX$zD zm?JxVr#_=M(?1Aj@`_~M=>`Uj4vZz!3k?`E7@vSB*~z^rT+JjoKpDo0>8wVKG2EZ_F)$Ql6zBu-^mlrUO4A?cGO|ryF2N|oE5QH)j6l4k vQD^#QBcMOF%1>uAX7pqFDL*~Tm@$?ya{3lyMsq%C25ANIi2ZH6wCQiwSdXGu?igTfRZ2un?qyo zGx0J2g_lIV&Jku{U=W@h5T|IHl$@JblA)KGml+zu$-tcPQz#CkrL=;Zfsy3}GXn#d zNUbPI%`48#&x5Hi&JXZrW|M}}i z|E$ND%p{0nJnOM;WqPY={%l-Zu5&zQ_Kd1->s^qYo^TGMll z7`>QgBuw9F#F)mIF-NTg8fl+k2qA8>7 diff --git a/templates/config/php-fpm/php74.zip b/templates/config/php-fpm/php74.zip index 4f8512f7b456ae22bc8ba1999f37b4a0ba198bba..061006dfc107afb5ca9e60803839884efcd2f3ce 100644 GIT binary patch delta 380 zcmaF!h2{7+mJQ}iOlrS3TQYUTFuf|Bd^k>tP5!q~98l-hElbFB~h<)gc%qZ zKv-pRL87d9QgUu$Nrql#US?=bnmyT)NqT#N z8lxvS(1Pi!4H*qsK#He3m@!Ik|7FOSjK!Aec_xh7!pPRJLaYJnnjUMyD93D+#4tG_ zL3;X36GkuQ1wf8ZlInDBQ$`2of@FwHrYWN@^AjLvLbBBK%OIKLREUhB8KVdDStw_^ z8KV!geHuiD(VWqnc|DYqWezl2HXR~!3CLmWo-S*_7{%G_sG z^S&IOzR{A=pHXi*qZMNyqtNtVDA-P From 7abe8aff81def46b474c927f5b47d0df6b5c6723 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Mon, 6 Jan 2020 14:48:32 +0530 Subject: [PATCH 2/2] Add bcmath config migrations Signed-off-by: Riddhesh Sanghvi --- ...6125626_site-command_add_bcmath_config.php | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 migrations/container/20200106125626_site-command_add_bcmath_config.php diff --git a/migrations/container/20200106125626_site-command_add_bcmath_config.php b/migrations/container/20200106125626_site-command_add_bcmath_config.php new file mode 100644 index 00000000..f9adf304 --- /dev/null +++ b/migrations/container/20200106125626_site-command_add_bcmath_config.php @@ -0,0 +1,113 @@ +sites = Site::all(); + if ( $this->is_first_execution || ! $this->sites ) { + $this->skip_this_migration = true; + } + } + + /** + * Execute php config updates. + * + * @throws EE\ExitException + */ + public function up() { + + if ( $this->skip_this_migration ) { + EE::debug( 'Skipping add-bcmath-config update migration as it is not needed.' ); + + return; + } + self::$rsp = new RevertableStepProcessor(); + + foreach ( $this->sites as $site ) { + + if ( ! in_array( $site->site_type, [ 'php', 'wp' ], true ) ) { + continue; + } + + if ( '5.6' === $site->php_version ) { + continue; + } + + EE::debug( "Found site: $site->site_url of type: $site->site_type" ); + EE::debug( "Starting add-bcmath-config updates for: $site->site_url" ); + + // Create bcmath config file. + $bcmath_config_file = EE_BACKUP_DIR . '/docker-php-ext-bcmath.ini'; + $this->fs->dumpFile( $bcmath_config_file, 'extension=bcmath.so' ); + + $bcmath_config_site_path = $site->site_fs_path . '/config/php/php/conf.d/docker-php-ext-bcmath.ini'; + + self::$rsp->add_step( + "to-$site->site_url-add-bcmath-config", + 'EE\Migration\SiteContainers::backup_restore', + null, + [ $bcmath_config_file, $bcmath_config_site_path ], + null + ); + } + + if ( ! self::$rsp->execute() ) { + throw new \Exception( 'Unable to run add-bcmath-config upadte migrations.' ); + } + + } + + /** + * Bring back the existing old php config. + * + * @throws EE\ExitException + */ + public function down() { + + if ( $this->skip_this_migration ) { + EE::debug( 'Skipping add-bcmath-config update migration as it is not needed.' ); + + return; + } + self::$rsp = new RevertableStepProcessor(); + + foreach ( $this->sites as $site ) { + + EE::debug( "Reverting add-bcmath-config updates for: $site->site_url" ); + + $bcmath_config_site_path = $site->site_fs_path . '/config/php/php/conf.d/docker-php-ext-bcmath.ini'; + + if ( ! in_array( $site->site_type, [ 'php', 'wp' ], true ) ) { + continue; + } + + if ( '5.6' === $site->php_version ) { + continue; + } + + if ( ! $this->fs->exists( $bcmath_config_site_path ) ) { + continue; + } else { + $this->fs->remove( $bcmath_config_site_path ); + } + } + + if ( ! self::$rsp->execute() ) { + throw new \Exception( 'Unable to revert php add-bcmath-config migrations.' ); + } + } +}