<?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: Sebastian Michaelsen</title>
    <description>The latest articles on DEV Community by Sebastian Michaelsen (@smichaelsen).</description>
    <link>https://dev.to/smichaelsen</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%2F67929%2F1059fb79-6386-494b-bfa7-13c1e008ad7b.jpeg</url>
      <title>DEV Community: Sebastian Michaelsen</title>
      <link>https://dev.to/smichaelsen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/smichaelsen"/>
    <language>en</language>
    <item>
      <title>Bashing TYPO3 🔥</title>
      <dc:creator>Sebastian Michaelsen</dc:creator>
      <pubDate>Tue, 09 Oct 2018 10:58:08 +0000</pubDate>
      <link>https://dev.to/smichaelsen/bashing-typo3--13li</link>
      <guid>https://dev.to/smichaelsen/bashing-typo3--13li</guid>
      <description>&lt;p&gt;Since more than 10 years I've been using TYPO3 CMS to create websites, I'm an active community member, I've published extensions, I've contributed to the TYPO3 core and popular extensions.&lt;/p&gt;

&lt;p&gt;As a TYPO3 guy I can't understand why it is not the world's most used and loved CMS. 😉&lt;/p&gt;

&lt;p&gt;So I challenge you to bash TYPO3 as good as you can. For me it doesn't matter if you have just heard rumors about how bad TYPO3 is or if you have actually worked with it. If you have hard feelings about my favorite CMS please share them with me in the comments.&lt;/p&gt;

&lt;p&gt;Maybe I will try to defend TYPO3 against your criticism, I will definitely learn from it.&lt;/p&gt;

</description>
      <category>typo3</category>
      <category>cms</category>
    </item>
    <item>
      <title>Fixing git commits - you always did it wrong</title>
      <dc:creator>Sebastian Michaelsen</dc:creator>
      <pubDate>Fri, 10 Aug 2018 14:35:48 +0000</pubDate>
      <link>https://dev.to/smichaelsen/fixing-git-commits---you-always-did-it-wrong-4oi2</link>
      <guid>https://dev.to/smichaelsen/fixing-git-commits---you-always-did-it-wrong-4oi2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;... unless you did it with --fixup and --autosquash&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The most important thing first: Of course you never change commits in branches that you share with others like &lt;code&gt;develop&lt;/code&gt;, &lt;code&gt;master&lt;/code&gt; or whatever you call your "main" git  branches. If you encounter an error there, just fix it with a new commit.&lt;/p&gt;

&lt;p&gt;When you're working on a branch on your own like a feature branch or local branch there's a more elegant way to fix commits.&lt;/p&gt;

&lt;p&gt;Take a look at the following git log:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8680a59d This is the 3rd commit
7e866455 This is the 2nd commit
a069e42a This is the 1st commit of my feature branch
0e2977b5 Previous commit that is already integrated in master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Imagine you want to fix an error in the 2nd commit.&lt;/p&gt;

&lt;p&gt;Make the file changes to fix the problem and add the changes to the stage, e.g. with &lt;code&gt;git add --all&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit --fixup 7e866455
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice the commit hash &lt;code&gt;7e866455&lt;/code&gt; is the one from the commit that contained the error. Now your git log looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;335ca372 fixup! This is the 2nd commit
8680a59d This is the 3rd commit
7e866455 This is the 2nd commit
a069e42a This is the 1st commit of my feature branch
0e2977b5 Previous commit that is already integrated in master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new commit has the commit message from the 2nd commit, but prefixed with &lt;code&gt;fixup!&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can do this multiple times for the same or for different commits in your branch. When your branch is ready to be merged (or reviewed) you'll want to clean things up. Just run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rebase -i --autosquash 0e2977b5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commit hash &lt;code&gt;0e2977b5&lt;/code&gt; is the one your feature branch is based on ("previous commit").&lt;/p&gt;

&lt;p&gt;This will apply your fixup commits directly to the commits they belong to and you will get a clean git log with all errors fixed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;26fe362d This is the 3rd commit
5db42a3d This is the 2nd commit
a069e42a This is the 1st commit of my feature branch
0e2977b5 Previous commit that is already integrated in master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✨✨✨&lt;/p&gt;

</description>
      <category>git</category>
      <category>howto</category>
    </item>
    <item>
      <title>Running TYPO3 with Valet</title>
      <dc:creator>Sebastian Michaelsen</dc:creator>
      <pubDate>Fri, 10 Aug 2018 09:48:20 +0000</pubDate>
      <link>https://dev.to/smichaelsen/running-typo3-with-valet-4ocm</link>
      <guid>https://dev.to/smichaelsen/running-typo3-with-valet-4ocm</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This article describes my experiences with developing TYPO3 on a Mac. If you're working on another OS you may or may not find this article helpful.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are a lot of ways to create a local dev environment for TYPO3 and all claim to be super easy and quick to set up - here's why Valet won me over.&lt;/p&gt;

&lt;p&gt;I've been developing TYPO3 websites and extensions since &amp;gt; 12 years and I claim to have used or at least tried every possible dev setup that ever existed for TYPO3 (probably not entirely true - try me).&lt;/p&gt;

&lt;p&gt;An option I used for quite some time was Vagrant boxes, which I configured with &lt;a href="https://puphpet.com/"&gt;PuPHPet&lt;/a&gt;. After that other virtual machine based solutions followed, including docker and ddev. What I dislike about running my TYPO3 environment in a container is the command line access. Yes - all of those solutions allow you to ssh into the container and do what ever you like. But I didn't want that. I wanted to run &lt;code&gt;composer install&lt;/code&gt; on my local machine and flush the TYPO3 cache or setup extensions &lt;a href="https://github.com/TYPO3-Console/composer-auto-commands"&gt;via composer scripts&lt;/a&gt; - for example. I was always having headaches with this stuff.&lt;/p&gt;

&lt;p&gt;Then I learned about how to install, maintain and run &lt;a href="https://getgrav.org"&gt;PHP in multiple versions and MySQL with homebrew&lt;/a&gt; and realized that I didn't necessarily need Apache or nginx for TYPO3 but the &lt;a href="http://php.net/manual/en/features.commandline.webserver.php"&gt;built-in PHP server&lt;/a&gt; works fine for most use cases.&lt;/p&gt;

&lt;p&gt;But the built-in server has one major limitation. It can only handle one request at a time, which has at least two negative consequences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loading a page with many assets and AJAX requests (like the TYPO3 backend) took its time because the requests were not processed simultaneously.&lt;/li&gt;
&lt;li&gt;Sometimes parallel requests are necessary, for example when you try to index page content for solr in the TYPO3 backend - that backend requests makes a request to the TYPO3 frontend, which stalls because there's already an active backend request (I eventually found a workaround for this).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After ignoring 2 or 3 hints, this week I finally tried &lt;a href="https://github.com/laravel/valet"&gt;Valet&lt;/a&gt; and was immediatelly sold when I learned that it worked with the brew PHP / MySQL that I already had. The benefits it brings is an nginx server which works surprisingly well without any configuration at all. You just tell Valet a projects root folder and it takes care of creating vHosts for your projects. &lt;code&gt;~/projects/acme/&lt;/code&gt; automagically becomes available as &lt;a href="http://acme.test"&gt;http://acme.test&lt;/a&gt;. Zero config per project required. The TLD &lt;code&gt;.test&lt;/code&gt; can be reconfigured if you prefer something else. Bottom line: It took me minutes to get Valet installed and my current project running with it.&lt;/p&gt;

&lt;p&gt;It comes with drivers to detect and run many PHP frameworks and systems including TYPO3. Only caveat: It assumes that the document root folder in your TYPO3 project is called &lt;code&gt;web&lt;/code&gt;. This is not the case in all of my projects. My more recent ones use &lt;code&gt;public&lt;/code&gt;. I was able to quickly solve that by placing this custom driver at &lt;code&gt;~/.valet/Drivers/Typo3PublicFolderValetDriver.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

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

class Typo3PublicFolderValetDriver extends Typo3ValetDriver
{
    protected $documentRoot = '/public';
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks to &lt;a class="mentioned-user" href="https://dev.to/dakira"&gt;@dakira&lt;/a&gt;
 for giving me the &lt;a href="https://twitter.com/dakira/status/1027135773953482752"&gt;crucial nudge&lt;/a&gt; on twitter.&lt;/p&gt;

</description>
      <category>typo3</category>
      <category>php</category>
      <category>valet</category>
    </item>
  </channel>
</rss>
