<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yegor Shytikov</title>
    <description>The latest articles on DEV Community by Yegor Shytikov (@genaker).</description>
    <link>https://dev.to/genaker</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F473891%2F2547b83c-4885-46e1-a873-1a9d2e0a7535.jpeg</url>
      <title>DEV Community: Yegor Shytikov</title>
      <link>https://dev.to/genaker</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/genaker"/>
    <language>en</language>
    <item>
      <title>From Proprietary Grey Zone to Open Source: Hyvä Theme’s Licensing Journey</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Mon, 17 Nov 2025 08:33:04 +0000</pubDate>
      <link>https://dev.to/genaker/from-proprietary-grey-zone-to-open-source-hyva-themes-licensing-journey-3l6m</link>
      <guid>https://dev.to/genaker/from-proprietary-grey-zone-to-open-source-hyva-themes-licensing-journey-3l6m</guid>
      <description>&lt;p&gt;When Hyvä launched, it promised to fix everything merchants hated about Magento’s default Luma theme: heavy JS, slow Core Web Vitals, and a painful developer experience. Agencies and merchants were happy to pay for a faster, cleaner frontend.&lt;/p&gt;

&lt;p&gt;But under the hood, there was always a big question:&lt;/p&gt;

&lt;p&gt;Was Hyvä truly a “from scratch” frontend — or a commercial fork of Magento Open Source distributed under a restrictive license?&lt;/p&gt;

&lt;p&gt;Now that Hyvä Theme has been relicensed as free and open source under OSL 3.0 + AFL 3.0, the answer matters less for the future and more as a lesson in how not to mix copyleft and proprietary licensing. ￼&lt;/p&gt;

&lt;p&gt;This article walks through that journey.&lt;/p&gt;

&lt;p&gt;Note: This is a technical and licensing opinion piece, not a legal judgment. No public court decision has declared Hyvä in violation of Magento’s license. The analysis here explains why many in the community perceived a grey zone, and how open-sourcing the theme addresses it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Promise: “Built from Scratch” and Commercial Licensing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hyvä marketed itself as a frontend “built from scratch” on top of Magento, with:&lt;br&gt;
    • A minimal, Tailwind-based CSS stack,&lt;br&gt;
    • Alpine.js replacing Magento’s heavy RequireJS/Knockout system,&lt;br&gt;
    • Dramatically improved performance scores. ￼&lt;/p&gt;

&lt;p&gt;This frontend was sold under a proprietary license, with a four-figure one-time fee per project and strict usage terms. ￼&lt;/p&gt;

&lt;p&gt;For many agencies, that seemed fair: pay once, get a faster Magento.&lt;/p&gt;

&lt;p&gt;The problem only appears when you look at the actual code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Reality: Massive Magento Code Reuse Under the Hood&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once Hyvä’s repositories became public, a detailed code review showed that large portions of the theme were: ￼&lt;br&gt;
    • Copied Magento core templates dropped into Magento_* module directories,&lt;br&gt;
    • Templates that were almost identical to Magento’s originals, with:&lt;br&gt;
    • extra inline JavaScript,&lt;br&gt;
    • small structural or markup tweaks, ViewModels and service classes largely mirroring Magento’s own logic.&lt;/p&gt;

&lt;p&gt;In other words, Hyvä wasn’t just a lightweight set of overrides or a pure headless frontend. It looked very much like a fork / derivative work of Magento’s own frontend stack.&lt;/p&gt;

&lt;p&gt;Architecturally, that led to a long list of technical problems you’ve already documented:&lt;br&gt;
    • Huge inline scripts in .phtml,&lt;br&gt;
    * Global state and REST calls inside templates,&lt;br&gt;
    • Hard-to-extend monolithic views,&lt;br&gt;
    • Fragile upgrade paths that require manual diffing against Magento core. ￼&lt;/p&gt;

&lt;p&gt;But our focus here is licensing, not architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Why This Clashed With OSL 3.0 in the Eyes of Many&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Magento’s OSL 3.0 license allows:&lt;br&gt;
    • Copying and modifying core code,&lt;br&gt;
    • Selling products that include that code.&lt;/p&gt;

&lt;p&gt;However, it demands that if you redistribute modified core files, you must:&lt;br&gt;
    • Keep Magento’s original license notices, and&lt;br&gt;
    • License the derivative under OSL 3.0 (or compatible terms), not a more restrictive proprietary license. ￼&lt;/p&gt;

&lt;p&gt;So when critics saw:&lt;br&gt;
    • Magento templates copied into Hyvä’s theme,&lt;br&gt;
    • Magento attributions seemingly removed or replaced,&lt;br&gt;
    • The whole bundle sold under a commercial “Hyvä Software User License” with no source access,&lt;/p&gt;

&lt;p&gt;it looked like a classic copyleft conflict.&lt;/p&gt;

&lt;p&gt;Again, this doesn’t automatically mean a court would find actual infringement. But from a risk and compliance standpoint, it’s clear why people started asking:&lt;br&gt;
    • “Is it even safe for us, as merchants, to pay for this?”&lt;br&gt;
    • “If Adobe or another rights holder enforced OSL 3.0 strictly, what would happen?”&lt;br&gt;
    • “Why not just open-source the parts that are obviously derived from Magento?”&lt;/p&gt;

&lt;p&gt;Those questions culminated in multiple public posts and discussions calling on Hyvä to open-source its Magento-derived code to respect OSL 3.0. ￼&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The Turning Point: Hyvä Goes Open Source (OSL 3.0 + AFL 3.0)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In early November 2025, Hyvä announced that: ￼&lt;br&gt;
    • The Hyvä Theme core is now free and open source.&lt;br&gt;
    • The code is relicensed under OSL 3.0 + AFL 3.0 – the same licenses Magento uses.&lt;br&gt;
    • Supporting theme modules are also relicensed under OSL 3.0.&lt;br&gt;
    • The business model shifts to selling:&lt;br&gt;
    • Hyvä UI as a separate paid component,&lt;br&gt;
    • Hyvä Checkout, Enterprise, and Commerce as proprietary add-ons.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnir97sa2prrpyjl3tij.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhnir97sa2prrpyjl3tij.jpeg" alt=" " width="800" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This change does three important things from a licensing perspective:&lt;br&gt;
    1. Aligns the theme code with Magento’s licensing model&lt;br&gt;
Hyvä’s code that builds directly on Magento’s frontend stack now shares the same copyleft obligations.&lt;br&gt;
    2. Removes the closed-source barrier&lt;br&gt;
Developers, auditors, and merchants can inspect the actual files, check attributions, and verify compliance themselves.&lt;br&gt;
    3. Lowers risk for new adopters&lt;br&gt;
Anyone implementing Hyvä today is using a theme which, at least on paper, respects OSL 3.0’s copyleft requirements.&lt;/p&gt;

&lt;p&gt;Whether this change was driven primarily by:&lt;br&gt;
    • long-term business strategy,&lt;br&gt;
    • community and ecosystem pressure,&lt;br&gt;
    • or a quiet recognition that the previous license posture was hard to justify,&lt;/p&gt;

&lt;p&gt;is something only Hyvä’s leadership can answer. Official messaging emphasizes community and strategic growth. ￼&lt;/p&gt;

&lt;p&gt;But from the outside, the effect is clear: the licensing grey zone around the theme core has largely been closed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What Still Deserves Scrutiny&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even with the theme now open source, a few areas still deserve attention:&lt;br&gt;
    • Historical closed-source releases&lt;br&gt;
Past distributions that may have contained Magento-derived code under a proprietary license don’t magically disappear. For most merchants, though, risk is low if they move to the current open-source base.&lt;br&gt;
    • Enterprise / paid products&lt;br&gt;
Hyvä Commerce / Enterprise may also interact with or wrap Magento code. Ensuring that any Magento-derived parts in those products comply with their respective licenses will be important. ￼&lt;br&gt;
    • Attribution and headers&lt;br&gt;
Now that the repository is public, it’s easier to spot where Magento code is reused, and whether Magento’s original notices are preserved as required by OSL 3.0.&lt;/p&gt;

&lt;p&gt;The good news: because the theme is open, the community can help keep everyone honest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Takeaways for Developers, Vendors, and Merchants&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For frontend vendors and theme authors:&lt;br&gt;
    • If your product is effectively a fork of an open-source platform, you must treat licensing as a first-class architectural constraint.&lt;br&gt;
    • “Copy and paste core, close it, and sell it” is rarely compatible with copyleft licenses like OSL 3.0.&lt;br&gt;
    • Open-sourcing the parts that are clearly derivative often isn’t optional — it’s simply what the license demands.&lt;/p&gt;

&lt;p&gt;For merchants and agencies:&lt;br&gt;
    • Don’t just look at performance benchmarks and marketing claims; ask:&lt;br&gt;
    • “What is this based on?”&lt;br&gt;
    • “What licenses apply?”&lt;br&gt;
    • “Is this code legally clean to use at scale?”&lt;br&gt;
    • Hyvä’s move to OSL 3.0 / AFL 3.0 is a net win: it reduces legal uncertainty, improves transparency, and gives you an audit-able codebase.&lt;/p&gt;

&lt;p&gt;For the Magento ecosystem as a whole:&lt;br&gt;
    • This saga shows that community scrutiny works. Questions about license compliance, raised publicly and persistently, can push popular vendors toward more open and compliant models.&lt;br&gt;
    • At the same time, it’s a cautionary tale: if you build a closed product on top of copyleft code, you should expect people to notice — and eventually, you may have to open the doors anyway.&lt;/p&gt;

</description>
      <category>hyva</category>
      <category>magneto</category>
      <category>opensource</category>
      <category>adobe</category>
    </item>
    <item>
      <title>Magento 2 ARM Ubuntu Server 24.04 AMD installation sh script</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Wed, 16 Oct 2024 23:55:33 +0000</pubDate>
      <link>https://dev.to/genaker/magento-2-arm-ubuntu-server-2404-amd-installation-sh-script-2f1m</link>
      <guid>https://dev.to/genaker/magento-2-arm-ubuntu-server-2404-amd-installation-sh-script-2f1m</guid>
      <description>&lt;p&gt;Two years ago, I was the first person who researched Magento performance and installation on ARM Graviton(AWS) and Amper(Oracle) servers. However, since then, AWS and Linux have improved support ARM graviton architecture and support. Previously, there was an issue with the same software support from the Linux repos, and you need to install it from the sources. Now, you can install everything from the default Ubuntu repo.&lt;/p&gt;

&lt;p&gt;I wrote a new performance and installation script for the Graviton 4 C8g AWS instance. &lt;/p&gt;

&lt;p&gt;The new AWS Ubuntu image has better support for ARM compiler software from the default repository.&lt;/p&gt;

&lt;p&gt;So here is the Magento C8g Ubuntu Server 24 instance installation script:&lt;br&gt;
&lt;a href="https://github.com/Genaker/Magento-Linux-Installation/blob/master/magento2-ubuntu24-arm-installation.sh" rel="noopener noreferrer"&gt;https://github.com/Genaker/Magento-Linux-Installation/blob/master/magento2-ubuntu24-arm-installation.sh&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Magento 2 Installation Steps:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Nginx Config&lt;/li&gt;
&lt;li&gt;Setup NGINX&lt;/li&gt;
&lt;li&gt;Setup PHP&lt;/li&gt;
&lt;li&gt;Configure PHP&lt;/li&gt;
&lt;li&gt;Configure Opcache&lt;/li&gt;
&lt;li&gt;Setup MySQL 8&lt;/li&gt;
&lt;li&gt;Setup OpenSearch/ElasticSearch&lt;/li&gt;
&lt;li&gt;Setup Redis&lt;/li&gt;
&lt;li&gt;Setup Composer&lt;/li&gt;
&lt;li&gt;Setup Magento from the composer&lt;/li&gt;
&lt;li&gt;Set Nginx Config&lt;/li&gt;
&lt;li&gt;Set Folder Permissions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Just run this script as user data or manually, and you will have the magento ubuntu 24 server up and running. &lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
MAGE_URL="ec2-98-81-130-207.compute-1.amazonaws.com"&lt;br&gt;
PHP_VERSION="8.1"&lt;br&gt;
OPENSEARCH_VERSION="2.11.1"&lt;/p&gt;

&lt;p&gt;magento2conf="upstream fastcgi_backend {&lt;br&gt;
  server  unix:/run/php/php$PHP_VERSION-fpm.sock;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;server {&lt;br&gt;
  listen 80;&lt;br&gt;
  server_name $MAGE_URL;&lt;br&gt;
  set \$MAGE_ROOT /var/www/html/magento;&lt;br&gt;
  include /var/www/html/magento/nginx.conf.sample;&lt;br&gt;
}"&lt;/p&gt;

&lt;p&gt;sudo apt-get update&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup NGINX
&lt;/h1&gt;

&lt;p&gt;sudo apt install nginx -y&lt;br&gt;
sudo systemctl start nginx&lt;br&gt;
sudo systemctl enable nginx&lt;br&gt;
sudo apt install unzip -y&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup PHP
&lt;/h1&gt;

&lt;p&gt;sudo apt install -y software-properties-common &lt;br&gt;
yes | sudo add-apt-repository ppa:ondrej/php&lt;br&gt;
sudo apt-get install php$PHP_VERSION php$PHP_VERSION-dev php$PHP_VERSION-fpm php$PHP_VERSION-bcmath php$PHP_VERSION-intl php$PHP_VERSION-soap php$PHP_VERSION-zip php$PHP_VERSION-curl php$PHP_VERSION-mbstring php$PHP_VERSION-mysql php$PHP_VERSION-gd php$PHP_VERSION-xml --no-install-recommends  -y&lt;br&gt;
php -v&lt;/p&gt;

&lt;h1&gt;
  
  
  Configure PHP
&lt;/h1&gt;

&lt;p&gt;sudo sed -i 's/^(max_execution_time = )[0-9]&lt;em&gt;/\17200/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/^(max_input_time = )[0-9]&lt;/em&gt;/\17200/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/^(memory_limit = )[0-9]*M/\12048M/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/^(post_max_size = )[0-9]*M/\164M/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/^(upload_max_filesize = )[0-9]*M/\164M/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/expose_php = On/expose_php = Off/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/;realpath_cache_size = 16k/realpath_cache_size = 512k/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/;realpath_cache_ttl = 120/realpath_cache_ttl = 86400/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/short_open_tag = Off/short_open_tag = On/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/;max_input_vars = 1000/max_input_vars = 50000/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 28800/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/mysql.allow_persistent = On/mysql.allow_persistent = Off/' /etc/php/$PHP_VERSION/fpm/php.ini &lt;br&gt;
sudo sed -i 's/mysqli.allow_persistent = On/mysqli.allow_persistent = Off/' /etc/php/$PHP_VERSION/fpm/php.ini&lt;/p&gt;

&lt;h1&gt;
  
  
  Configure Opcache
&lt;/h1&gt;

&lt;p&gt;sudo bash -c "cat &amp;gt; /etc/php/$PHP_VERSION/fpm/conf.d/10-opcache.ini &amp;lt;&amp;lt;END&lt;br&gt;
zend_extension=opcache.so&lt;br&gt;
opcache.enable = 1&lt;br&gt;
opcache.enable_cli = 0&lt;br&gt;
opcache.memory_consumption = 356&lt;br&gt;
opcache.interned_strings_buffer = 4&lt;br&gt;
opcache.max_accelerated_files = 100000&lt;br&gt;
opcache.max_wasted_percentage = 15&lt;br&gt;
opcache.use_cwd = 1&lt;br&gt;
opcache.validate_timestamps = 0&lt;br&gt;
;opcache.revalidate_freq = 2&lt;br&gt;
;opcache.validate_permission= 1&lt;br&gt;
;opcache.validate_root= 1&lt;br&gt;
opcache.file_update_protection = 2&lt;br&gt;
opcache.revalidate_path = 0&lt;br&gt;
opcache.save_comments = 1&lt;br&gt;
opcache.load_comments = 1&lt;br&gt;
opcache.fast_shutdown = 1&lt;br&gt;
opcache.enable_file_override = 0&lt;br&gt;
opcache.optimization_level = 0xffffffff&lt;br&gt;
opcache.inherited_hack = 1&lt;br&gt;
opcache.max_file_size = 0&lt;br&gt;
opcache.consistency_checks = 0&lt;br&gt;
opcache.force_restart_timeout = 60&lt;br&gt;
opcache.log_verbosity_level = 1&lt;br&gt;
opcache.protect_memory = 0&lt;br&gt;
END"&lt;/p&gt;

&lt;p&gt;sudo systemctl start php$PHP_VERSION-fpm.service&lt;br&gt;
sudo systemctl enable php$PHP_VERSION-fpm.service&lt;br&gt;
sudo systemctl status php$PHP_VERSION-fpm.service --no-pager&lt;br&gt;
sudo systemctl restart php$PHP_VERSION-fpm.service&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup MySQL
&lt;/h1&gt;

&lt;p&gt;sudo apt install mysql-server -y &lt;br&gt;
sudo systemctl start mysql&lt;br&gt;
sudo systemctl enable mysql&lt;br&gt;
sudo mysql -e "CREATE DATABASE magento; CREATE USER 'magento'@'localhost' IDENTIFIED BY 'magento'; GRANT ALL ON magento.* TO 'magento'@'localhost'; FLUSH PRIVILEGES;"&lt;br&gt;
sudo mysql -e "show databases"&lt;br&gt;
sudo mysql -e "SET GLOBAL log_bin_trust_function_creators = 1;"&lt;br&gt;
sudo mysql -e "select version()"&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup OpenSearch
&lt;/h1&gt;

&lt;p&gt;curl -o- &lt;a href="https://artifacts.opensearch.org/publickeys/opensearch.pgp" rel="noopener noreferrer"&gt;https://artifacts.opensearch.org/publickeys/opensearch.pgp&lt;/a&gt; | sudo gpg --dearmor --batch --yes -o /usr/share/keyrings/opensearch-keyring&lt;br&gt;
echo "deb [signed-by=/usr/share/keyrings/opensearch-keyring] &lt;a href="https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt" rel="noopener noreferrer"&gt;https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt&lt;/a&gt; stable main" | sudo tee /etc/apt/sources.list.d/opensearch-2.x.list&lt;br&gt;
sudo apt update&lt;br&gt;
sudo apt list -a opensearch&lt;br&gt;
sudo apt install opensearch=$OPENSEARCH_VERSION&lt;/p&gt;

&lt;h1&gt;
  
  
  apt purge opensearch -y
&lt;/h1&gt;

&lt;p&gt;sudo bash -c "echo \"plugins.security.disabled: true\" &amp;gt;&amp;gt; /etc/opensearch/opensearch.yml"&lt;br&gt;
sudo cat /etc/opensearch/opensearch.yml&lt;br&gt;
sudo systemctl enable --now opensearch&lt;br&gt;
sudo systemctl restart opensearch&lt;br&gt;
sudo systemctl status opensearch&lt;/p&gt;

&lt;h1&gt;
  
  
  logs : cat  /etc/opensearch/opensearch.yml
&lt;/h1&gt;

&lt;p&gt;curl -X GET localhost:9200&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup Redis
&lt;/h1&gt;

&lt;p&gt;sudo apt install redis -y&lt;br&gt;
sudo systemctl restart redis.service&lt;br&gt;
sudo systemctl status redis&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup Composer
&lt;/h1&gt;

&lt;p&gt;curl -sS &lt;a href="https://getcomposer.org/installer" rel="noopener noreferrer"&gt;https://getcomposer.org/installer&lt;/a&gt; -o composer-setup.php&lt;br&gt;
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer&lt;br&gt;
composer -V&lt;/p&gt;

&lt;p&gt;sudo mkdir /var/www/html/magento&lt;br&gt;
sudo chmod -R 755 /var/www/html/magento/&lt;/p&gt;

&lt;p&gt;composer config --global http-basic.repo.magento.com 5310458a34d580de1700dfe826ff19a1 255059b03eb9d30604d5ef52fca7465d&lt;br&gt;
composer create-project --repository-url=&lt;a href="https://repo.magento.com/" rel="noopener noreferrer"&gt;https://repo.magento.com/&lt;/a&gt; magento/project-community-edition /var/www/html/magento&lt;/p&gt;

&lt;p&gt;cd /var/www/html/magento/&lt;/p&gt;

&lt;p&gt;bin/magento setup:install --base-url=http://$MAGE_URL --db-host=localhost --db-name=magento --db-user=magento --db-password=magento --admin-firstname=Magento --admin-lastname=Admin --admin-email=&lt;a href="mailto:admin@yourdomain.com"&gt;admin@yourdomain.com&lt;/a&gt; --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=opensearch&lt;/p&gt;

&lt;p&gt;yes | /var/www/html/magento/bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=127.0.0.1 --cache-backend-redis-db=0&lt;br&gt;
yes | /var/www/html/magento/bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=127.0.0.1 --page-cache-redis-db=1&lt;br&gt;
yes | /var/www/html/magento/bin/magento setup:config:set --session-save=redis --session-save-redis-host=127.0.0.1 --session-save-redis-log-level=4 --session-save-redis-db=2&lt;/p&gt;

&lt;p&gt;php bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth&lt;br&gt;
php bin/magento module:disable Magento_TwoFactorAuth&lt;/p&gt;

&lt;p&gt;sudo bash -c "echo '$magento2conf' &amp;gt; /etc/nginx/conf.d/magento.conf"&lt;br&gt;
sudo nginx -t&lt;br&gt;
sudo service nginx restart&lt;/p&gt;

&lt;p&gt;sudo chmod -R 777 /var/www/html/magento/*&lt;/p&gt;

&lt;p&gt;curl http://$MAGE_URL&lt;/p&gt;

&lt;p&gt;tail -n 20 /var/log/nginx/error.log &lt;/p&gt;

&lt;p&gt;sudo chown -R www-data:www-data /var/www/html/magento&lt;br&gt;
sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +&lt;br&gt;
`&lt;/p&gt;

&lt;h2&gt;
  
  
  Magento 2 ARM Performance
&lt;/h2&gt;

&lt;p&gt;AWS C5.large has 0.032 PHP performance score (less is better). Cli Performace 0.110ms &lt;br&gt;
AWS C8.xlarge has 0.029 PHP performance score (less is better), CLI performace is: 0.066 for Cli opcache doesn't work. It is well known PHP issue.&lt;/p&gt;

&lt;p&gt;So, Graviton 4 instances have ~20% greater PHP performance score, especially for corn operations.&lt;/p&gt;

&lt;p&gt;More about Magento 2 PHP performance test here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Genaker/Magento2OPcacheGUI" rel="noopener noreferrer"&gt;https://github.com/Genaker/Magento2OPcacheGUI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;C8g instances offer up to 30% better performance and larger instance sizes with up to 3x more vCPUs and memory than the seventh-generation AWS Graviton3-based C7g instances.&lt;/p&gt;

&lt;p&gt;The cost of the ARM Graviton 4 &lt;strong&gt;C8g.48xlarge&lt;/strong&gt; with 192 physical (it is twice more than Intel with 192 virtual CPUs. You can count it as 384 CPUs) CPUs is $ 5,000 per month. It can handle any load as a web server. It will handle approximately 200 uncached requests per second without any issues. But you can scale it down and reduce the cost. For example, if you need only 20 uncached requests per second, you can pay 500$ per month for the C8g.4xlarge (16CPUs) computed resources and you can also apply AWS cost savings.&lt;/p&gt;

</description>
      <category>magneto</category>
      <category>ubuntu</category>
      <category>php</category>
      <category>arm</category>
    </item>
    <item>
      <title>Magento 2 get Configured Used Children Product Collection</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Fri, 28 Jan 2022 23:10:35 +0000</pubDate>
      <link>https://dev.to/genaker/magento-2-get-configured-used-children-product-collection-5bf0</link>
      <guid>https://dev.to/genaker/magento-2-get-configured-used-children-product-collection-5bf0</guid>
      <description>&lt;p&gt;/**&lt;br&gt;
     * Returns array of sub-products for specified configurable product&lt;br&gt;
     * Result array contains all children for specified configurable product&lt;br&gt;
     *&lt;br&gt;
     * &lt;a class="mentioned-user" href="https://dev.to/param"&gt;@param&lt;/a&gt; \Magento\Catalog\Model\Product $product&lt;br&gt;
     * &lt;a class="mentioned-user" href="https://dev.to/param"&gt;@param&lt;/a&gt; array $requiredAttributeIds Attributes to include in the select; one-dimensional array&lt;br&gt;
     * @return ProductInterface[]&lt;br&gt;
     */&lt;br&gt;
    public function getUsedProducts($product, $requiredAttributeIds = null)&lt;br&gt;
    {&lt;br&gt;
        if (!$product-&amp;gt;hasData($this-&amp;gt;_usedProducts)) {&lt;br&gt;
            $collection = $this-&amp;gt;getConfiguredUsedProductCollection($product, false, $requiredAttributeIds);&lt;br&gt;
            $usedProducts = array_values($collection-&amp;gt;getItems());&lt;br&gt;
            $product-&amp;gt;setData($this-&amp;gt;_usedProducts, $usedProducts);&lt;br&gt;
        }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    return $product-&amp;gt;getData($this-&amp;gt;_usedProducts);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8Yl9Xsvd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rd5rqz8l6xmtdp2efjrq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8Yl9Xsvd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rd5rqz8l6xmtdp2efjrq.png" alt="Image description" width="880" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AWS Amazon Linux 2 amazon-linux-extras PHP version upgrade 7.2 to 7.4 +</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Thu, 01 Jul 2021 16:06:05 +0000</pubDate>
      <link>https://dev.to/genaker/aws-amazon-linux-2-amazon-linux-extras-php-upgrade-7-2-to-7-4-35gc</link>
      <guid>https://dev.to/genaker/aws-amazon-linux-2-amazon-linux-extras-php-upgrade-7-2-to-7-4-35gc</guid>
      <description>&lt;p&gt;sudo yum remove php*&lt;/p&gt;

&lt;h1&gt;
  
  
  or 'sudo yum autoremove php php-common' this one not tested
&lt;/h1&gt;

&lt;p&gt;sudo amazon-linux-extras disable php7.2&lt;br&gt;
sudo amazon-linux-extras enabmle php7.4&lt;br&gt;
yum clean metadata&lt;/p&gt;

&lt;p&gt;sudo yum -y install php php-common php-mysqlnd php-opcache php-xml php-gd php-soap php-bcmath php-intl php-mbstring php-json php-iconv php-fpm php-apcu php-zip php-devel &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Magento {\"error\":{\"root_cause\"[{\"type\":\"index_not_found_exception\",\"reason\":\"no such index\":</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Fri, 14 May 2021 16:14:48 +0000</pubDate>
      <link>https://dev.to/genaker/magento-error-rootcause-type-indexnotfoundexception-reason-no-such-index-3a0i</link>
      <guid>https://dev.to/genaker/magento-error-rootcause-type-indexnotfoundexception-reason-no-such-index-3a0i</guid>
      <description>&lt;p&gt;To fix this error you need to reindex bin/magento indexer:reindex&lt;/p&gt;

&lt;p&gt;{"0":"{\"error\":{\"root_cause\":[{\"type\":\"index_not_found_exception\",\"reason\":\"no such index\",\"resource.type\":\"index_or_alias\",\"resource.id\":\"magento2_product_2\",\"index_uuid\":\"&lt;em&gt;na&lt;/em&gt;\",\"index\":\"magento2_product_2\"}],\"type\":\"index_not_found_exception\",\"reason\":\"no such index\",\"resource.type\":\"index_or_alias\",\"resource.id\":\"magento2_product_2\",\"index_uuid\":\"&lt;em&gt;na&lt;/em&gt;\",\"index\":\"magento2_product_2\"},\"status\":404}","1":"#1 Elasticsearch\Connections\Connection-&amp;gt;Elasticsearch\Connections\{closure}() called at [vendor\/react\/promise\/src\/FulfilledPromise.php:28]\n#2 React\Promise\FulfilledPromise-&amp;gt;then() called at [vendor\/ezimuel\/ringphp\/src\/Future\/CompletedFutureValue.php:55]\n#3 GuzzleHttp\Ring\Future\CompletedFutureValue-&amp;gt;then() called at [vendor\/ezimuel\/ringphp\/src\/Core.php:341]\n#4 GuzzleHttp\Ring\Core::proxy() called at [vendor\/elasticsearch\/elasticsearch\/src\/Elasticsearch\/Connections\/Connection.php:329]\n#5 Elasticsearch\Connections\Connection-&amp;gt;Elasticsearch\Connections\{closure}() called at [vendor\/elasticsearch\/elasticsearch\/src\/Elasticsearch\/Connections\/Connection.php:227]\n#6 Elasticsearch\Connections\Connection-&amp;gt;performRequest() called at [vendor\/elasticsearch\/elasticsearch\/src\/Elasticsearch\/Transport.php:105]\n#7 Elasticsearch\Transport-&amp;gt;performRequest() called at [vendor\/elasticsearch\/elasticsearch\/src\/Elasticsearch\/Client.php:1559]\n#8 Elasticsearch\Client-&amp;gt;performRequest() called at [vendor\/elasticsearch\/elasticsearch\/src\/Elasticsearch\/Client.php:1192]\n#9 Elasticsearch\Client-&amp;gt;search() called at [vendor\/magento\/module-elasticsearch-7\/Model\/Client\/Elasticsearch.php:367]\n#10 Magento\Elasticsearch7\Model\Client\Elasticsearch-&amp;gt;query() called at [vendor\/magento\/module-elasticsearch\/SearchAdapter\/Dynamic\/DataProvider.php:221]\n#11 Magento\Elasticsearch\SearchAdapter\Dynamic\DataProvider-&amp;gt;getAggregation() called at [vendor\/magento\/framework\/Search\/Dynamic\/Algorithm\/Manual.php:48]\n#12 Magento\Framework\Search\Dynamic\Algorithm\Manual-&amp;gt;getItems() called at [vendor\/magento\/module-elasticsearch\/SearchAdapter\/Aggregation\/Builder\/Dynamic.php:48]\n#13 Magento\Elasticsearch\SearchAdapter\Aggregation\Builder\Dynamic-&amp;gt;build()&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Magento 2: SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('user'@'localhost') does not exist, query was</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Tue, 27 Apr 2021 01:21:41 +0000</pubDate>
      <link>https://dev.to/genaker/magento-2-sqlstate-hy000-general-error-1449-the-user-specified-as-a-definer-user-localhost-does-not-exist-query-was-14gl</link>
      <guid>https://dev.to/genaker/magento-2-sqlstate-hy000-general-error-1449-the-user-specified-as-a-definer-user-localhost-does-not-exist-query-was-14gl</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grant all on *.* to 'theuser123'@'%' identified by 'Magento@1234567' with grant option;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SQLSTATE[HY000] Fixed ...&lt;/p&gt;

&lt;p&gt;This happens after moving the DB from one server to another server. Initially, the definer was using localhost and the theuser123. On the new server, we don't have that user(theuser123), and the host had also can be changed.&lt;/p&gt;

&lt;p&gt;Magento 2 (Zend_Db_Statement_Exception): SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('theuser123'@'localhost') does not exist, query was: SELECT&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Warning: session_start(): Session data file is not created by your uid in </title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Sun, 25 Apr 2021 23:04:57 +0000</pubDate>
      <link>https://dev.to/genaker/warning-sessionstart-session-data-file-is-not-created-by-your-uid-in-557a</link>
      <guid>https://dev.to/genaker/warning-sessionstart-session-data-file-is-not-created-by-your-uid-in-557a</guid>
      <description>&lt;p&gt;PHP requires a session file to be owned by the user running PHP.&lt;/p&gt;

&lt;p&gt;Then just run chown -R www-data:www-data /var/www/storage/session/ to own session folder and files by your PHP user (www-data:www-data are your PHP user and group separated by :).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R www-data:www-data /var/lib/php/session
or
sudo chown -R apache:apache /var/lib/php/session

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Login and SSH to Magento Cloud</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Thu, 22 Apr 2021 08:22:53 +0000</pubDate>
      <link>https://dev.to/genaker/login-and-ssh-to-magento-cloud-21fj</link>
      <guid>https://dev.to/genaker/login-and-ssh-to-magento-cloud-21fj</guid>
      <description>&lt;p&gt;Install the magento-cloud CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -sS https://accounts.magento.cloud/cli/installer | PHP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add magento-cloud CLI to the bash profile.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export PATH=$PATH:$HOME/.magento-cloud/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consult operating system documentation for details.&lt;/p&gt;

&lt;p&gt;Reload the updated bash profile.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;. ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To initiate the CLI, call magento-cloud and enter your Cloud account credentials when prompted.&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;magento-cloud login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SSH&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;magento-cloud ssh 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Migrate Magento code to another server</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Mon, 12 Apr 2021 00:24:51 +0000</pubDate>
      <link>https://dev.to/genaker/migrate-magento-code-to-another-server-45d1</link>
      <guid>https://dev.to/genaker/migrate-magento-code-to-another-server-45d1</guid>
      <description>&lt;p&gt;SSH to both servers old one (server A) and a new one (server B)&lt;/p&gt;

&lt;p&gt;you need to Copy the files legacy server &lt;strong&gt;A&lt;/strong&gt;  :&lt;/p&gt;

&lt;p&gt;Archive it first&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -czvf magento.tar.gz app/code/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;move to the public dir server &lt;strong&gt;A&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; mv magento.tar.gz pub/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go to new server &lt;strong&gt;B&lt;/strong&gt; web dir. for example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/www/html/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download files to the new server &lt;strong&gt;B&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://www.{domain}.com/magento.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Untar files on a new serve &lt;strong&gt;B&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -xzvf magento.tar.gz -C magento
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;remove a file on the old server &lt;strong&gt;B&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm pub/magento.tar.gz 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the next step, you will need to dump Magento DB. See my other posts. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Magento 2 Configurable products slow.  Fix Magento performance issue  </title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Tue, 23 Mar 2021 07:37:56 +0000</pubDate>
      <link>https://dev.to/genaker/magento-2-configurable-products-slow-fix-magento-performance-issue-2p2l</link>
      <guid>https://dev.to/genaker/magento-2-configurable-products-slow-fix-magento-performance-issue-2p2l</guid>
      <description>&lt;p&gt;Magento 2 configurable products are just containers for simple products (variations). You can no longer configure pricing data directly in the configurable product as the parent configurable inherits all its unit, tier price, and inventory data from the child simple products. So on the configurable product page, Magento loads all the configurations as a simple product. Even a single Magento Product model is slow 300ms to load, what to tell about several products on the same page... The complexity of the configurable products is just terrible. Product with 5 color and 5 sizes it is 5 * 5 + 1 separate SKUs. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GZG1t8mY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvacrbl8xc8p8eb24lth.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GZG1t8mY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvacrbl8xc8p8eb24lth.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Magento 2 Configurable Products are slow to Load!
&lt;/h1&gt;

&lt;p&gt;One of the biggest issues of the Magento 2  is the configurable products. Even Small configurable products can be slow to load in the frontend. I worked on a store with a product that is available in over 50 colors and 10 sizes. This resulted in a configurable product with over 500 child products. Due to Magento 2, Architectural issues products can lead to very slow and takes several minutes to load. &lt;/p&gt;

&lt;p&gt;In the frontend, Magento 2 loads all variations in a giant JSON object and renders that into the DOM using the legacy Knockout JS library and Jquery. This JSON object is 1 megabyte for 1000 variations. In the backend, this JSON is also built and passed to a UI component wrapped in XML. Purely written Magento 2 Core PHP code is not able to append extremely large XML structures to an existing XML structure.&lt;/p&gt;

&lt;p&gt;Even with 1000 variations page load time for an uncached configurable product was in excess of 60 seconds.&lt;/p&gt;

&lt;p&gt;If you are having traffic on your site configurable products will just kill your MySQL database &lt;/p&gt;

&lt;h1&gt;
  
  
  Fix Magento Configurable Product Performance issue:
&lt;/h1&gt;

&lt;p&gt;Unfortunately, this issue can't be fixed because even simple product is slow in the M2. It is just a waste of money and time to fix a jank car. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Laravel: Force to use HTTPS for URL with Cloudflare Flexible SSL</title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Mon, 08 Mar 2021 18:36:58 +0000</pubDate>
      <link>https://dev.to/genaker/laravel-force-to-use-https-for-url-with-cloudflare-flexible-ssl-55j</link>
      <guid>https://dev.to/genaker/laravel-force-to-use-https-for-url-with-cloudflare-flexible-ssl-55j</guid>
      <description>&lt;p&gt;When are you using Cloudflare Flexible SSL you need a solution so that all URL on our website (created by URL, route function) must be HTTPS even though our server currently doesn't support SSL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FezDZebC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjzageb8t3avad6lj9e9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FezDZebC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjzageb8t3avad6lj9e9.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Edit App\Providers\AppServiceProvider.php in the boot() method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function boot()
{
        // custom for cloudflase flexible ssl
        if($this-&amp;gt;checkHTTPSStatus()){
            URL::forceScheme('https');
        }
    /*...some other code...*/
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;private function checkHTTPSStatus()&lt;br&gt;
{&lt;br&gt;
    /&lt;em&gt;Select code in an option below&lt;/em&gt;/&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option 1: Switch to https according to the configuration in the env file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;private function checkHTTPSStatus()&lt;br&gt;
{&lt;br&gt;
    return env('APP_HTTPS',false) === true;&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In .env file you must to declare APP_HTTPS parameter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;APP_HTTPS=true&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Option 2: Automatically switch to https if the user comes from Cloudflare Flexible SSL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;private function checkHTTPSStatus()&lt;br&gt;
{&lt;br&gt;
    return (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])&amp;amp;&amp;amp;$_SERVER['HTTP_X_FORWARDED_PROTO']==='https');&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option 3: Full SSL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;private function checkHTTPSStatus()&lt;br&gt;
{&lt;br&gt;
    return !empty($_SERVER['HTTPS']);&lt;br&gt;
}&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Git Show the last files committed </title>
      <dc:creator>Yegor Shytikov</dc:creator>
      <pubDate>Tue, 23 Feb 2021 08:34:47 +0000</pubDate>
      <link>https://dev.to/genaker/git-show-the-last-files-committed-31no</link>
      <guid>https://dev.to/genaker/git-show-the-last-files-committed-31no</guid>
      <description>&lt;p&gt;&lt;br&gt;
&lt;code&gt;git show --stat --oneline HEAD&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Then reset the unwanted files in order to leave them out from the commit:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; git reset --soft HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;git add again&lt;/p&gt;

&lt;p&gt;git commit -m "new commit"&lt;/p&gt;

&lt;p&gt;git push&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
