<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Articles on Rafael Dohms</title><link>https://doh.ms/blog/</link><description>Rafael Dohms - Engineering Manager, Speaker, Writer, PHP and Open Source Developer</description><generator>Hugo</generator><language>en-US</language><managingEditor>Rafael Dohms</managingEditor><webMaster>Rafael Dohms</webMaster><lastBuildDate>Wed, 18 Nov 2026 00:00:00 -0300</lastBuildDate><atom:link href="https://doh.ms/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>Day to Day of a Principal Engineer</title><link>https://doh.ms/2026/11/18/day-to-day-of-a-principal-engineer/</link><pubDate>Wed, 18 Nov 2026 00:00:00 -0300</pubDate><guid>https://doh.ms/2026/11/18/day-to-day-of-a-principal-engineer/</guid><dc:language>en-US</dc:language><category>career</category><category>conference</category><category>codecon-select</category><category>principal-engineer</category><category>staff-engineer</category><category>mentoring</category><description>This past weekend I led a mentoring session at CodeCon Select with Damiana Costa. What sets CodeCon Select apart is its participatory formats, like mentoring, fishbowls, and AMAs, where the audience helps shape the talk. That makes for a much richer event, and I highly recommend …</description><content:encoded><![CDATA[<p>This past weekend I led a mentoring session at CodeCon Select with <a
  href="https://www.linkedin.com/in/damianacosta/"target="_blank" rel="noopener"
  >Damiana Costa</a
>. What sets <a
  href="https://codecon.dev/select"target="_blank" rel="noopener"
  >CodeCon Select</a
> apart is its participatory formats, like mentoring, fishbowls, and AMAs, where the audience helps shape the talk. That makes for a much richer event, and I highly recommend it.</p>

















  





  
  
  


  
  
    
    
      
    

    


    
    


    
    
    
    
    
    
    


    
    
      
      

      


      

      
      
        
        
        
      
      
      
      

    
    

    
    
      <figure
        class="img-float-right"
        role="group"
        aria-describedby="caption-With Damiana Costa during the mentoring session">
      
          <img
            title=""
            loading="lazy"
            decoding="async"
            class="img "
            width="360"
            height="240"
            src="/images/blog/codecon-select-mentoring_hu_2851c9d77190550c.webp"
            alt="Damiana Costa and me during the mentoring session at CodeCon Select"
            onerror="this.onerror='null';this.src='\/images\/blog\/codecon-select-mentoring_hu_7d9cd97290e48fd0.jpg'" />
      
        <figcaption id="caption-With Damiana Costa during the mentoring session" class="caption-With-Damiana-Costa-during-the-mentoring-session">
          With Damiana Costa during the mentoring session
        </figcaption>
      </figure>
    

  
  






  <script>
    window.addEventListener("load", (e) => {
      const lightbox = GLightbox();
    });
  </script>


<p>To prepare for this session, I synthesized my personal observations with empirical findings from a survey of 42 senior technical leaders, evenly split between Staff and Principal Engineers across platform, product, and cross-functional teams. What came out of both the conference floor and the data is that senior IC roles are not a straight continuation of senior engineering. Somewhere along the way, how you create value, how you influence people, and how you spend your days all change.</p>
<p>My core belief about the Principal+ roles is that they hinge on two primary capabilities: Strategic Autonomy and Contextual Awareness.</p>
<h2 id="strategic-autonomy">Strategic Autonomy</h2>
<p>At this level, you no longer get the roadmap handed to you; instead, your internal motivation paired with your capacity to define your own mandate will be the key factors of your role. This is where you manage up, align with stakeholders, and learn to communicate your ideas well.</p>
<h2 id="contextual-awareness">Contextual Awareness</h2>
<p>The second one is knowing the landscape your company operates in, and that takes a few layers:</p>
<ul>
<li><strong>The Organizational Topology:</strong> the overall shape of your company, from size to structure and the seniority of engineers. For example, our survey showcased that in larger organizations (5000+), 80% of respondents rely on building consensus via demonstrating proof-of-concept code. In mid-sized organizations, alignment mostly happens through 1:1 relationships. Your influence tactics must match the scale of the room.</li>
<li><strong>The Leadership Dynamics:</strong> who the stakeholders are, who you need to execute, and their purviews, capabilities, and roles.</li>
<li><strong>The Reality of the Business and Market:</strong> the state of the industry (macroeconomics), the company&rsquo;s financial standing and growth stages, and the core needs of the business.</li>
<li><strong>External Technical Horizons:</strong> How the broader industry is solving comparable challenges. In our research, 73% of senior technical leaders named engineering blogs and technical whitepapers as their most critical learning resources, and 60% added books and long-form literature on top. Staying aware means constantly checking your internal technical choices against what the rest of the industry is doing.</li>
</ul>
<p>I prepared these two as my opening salvo, and the discussion from there was rich. Questions were very diverse, from what an average day looks like, how we influence without authority, how we decided between the manager path, IC path, and just being a technical specialist, how managers can help people looking to make staff or above, how we measure our success, how we work with quarterly plans, and such. Let me line up some of those stage discussions with the survey data.</p>
<h2 id="where-does-your-day-start">Where does your day start?</h2>
<p>Mornings are mostly coordination. In our survey, 85% of respondents start their day triaging Slack and email, and 70% spend their first hours planning and prioritizing. Only 45% begin by reviewing PRs or directly unblocking teammates, and just 15% open design docs or system metrics.</p>
<p>Unblocking teams is still essential, but you have to guard against living in reactive triage. When meetings and urgent requests eat the working day, the focused specialist work gets pushed to the margins. Deep architectural thinking only happens if you schedule room for it on purpose.</p>
<h2 id="so-many-meetings">So many meetings</h2>
<p>Meetings are central to the Principal role, and they are also a constant source of anxiety about whether you are &ldquo;actually getting things done.&rdquo; Some meetings need you as the protagonist, others need you quiet in the corner, and the trick we all have to learn is extracting value from both. Meetings are where we nudge projects, get context, and direct people while giving them the credit. They are also where the 1:1 feedback happens, so plan those well and pay attention to what they really cost.</p>
<h2 id="how-to-overcome-it-looks-like-you-dont-do-anything">How to overcome &ldquo;it looks like you don&rsquo;t do anything&rdquo;</h2>
<p>I found this remark interesting, and I&rsquo;ve seen it in the wild before. A principal engineer&rsquo;s impact is systemic, not transactional, so outside observers sometimes can&rsquo;t see it. It lines up with the survey&rsquo;s biggest surprise: the delegation and responsibility balance (27%).</p>
<p>One respondent described their hardest career lesson as realizing <em>&ldquo;how difficult it is to not do certain things (and thereby leave room for others to shine).&rdquo;</em> Another put it this way: <em>&ldquo;Throw out the metrics you used to judge your success before. Your primary output is elevating others.&rdquo;</em></p>
<p>We took this further on stage, debating how much managing up matters and making sure your manager connects your team&rsquo;s achievements with your own.</p>
<h2 id="the-business-comes-before-the-tech">The business comes before the tech</h2>
<p>A classic failure at this level is designing an elegant, idealized architecture that ignores business constraints. When survey respondents were asked which critical mindset shift is required to reach the Principal level, <strong>Business Strategy and Metrics</strong> was the top response (40%), far ahead of purely technical skills.</p>
<p>This also means working with newer engineers and helping them overcome the &ldquo;just tell me what to build&rdquo; approach and translating to them what the business signals mean for their projects.</p>
<h2 id="the-bigger-career-questions">The bigger career questions</h2>
<p>The audience also raised a few broader questions about building an advanced IC career:</p>
<ul>
<li><strong>The Manager vs. IC Path:</strong> You do not need formal management authority to fix systemic organizational problems. Several survey respondents noted that stepping into management taught them valuable communication skills, but also proved that senior ICs can tackle systemic friction just as effectively through technical influence.</li>
<li><strong>Burnout and Boundaries:</strong> Staying deep in daily feature delivery while also carrying org-wide architectural responsibility is, as one respondent put it, a <em>&ldquo;fast way to burnout.&rdquo;</em> Clear boundaries and ruthless prioritization are survival skills.</li>
</ul>
<h2 id="wrap-up">Wrap up</h2>
<p>The mentoring circle and the survey ended up in the same place, and one respondent said it better than I could:</p>
<p><em>&ldquo;Realizing our job is not to be the smartest person in the room, but to pull those smartest people in to be consulted and get alignment on direction to move initiatives forward.&rdquo;</em></p>
]]></content:encoded></item><item><title>The Pitfalls of the Big Rewrite: Why Evolution Often Beats Revolution</title><link>https://doh.ms/2025/04/16/the-pitfalls-of-the-big-rewrite-why-evolution-often-beats-revolution/</link><pubDate>Wed, 16 Apr 2025 00:00:00 -0300</pubDate><guid>https://doh.ms/2025/04/16/the-pitfalls-of-the-big-rewrite-why-evolution-often-beats-revolution/</guid><dc:language>en-US</dc:language><description>In many conversations about how products and systems evolve within companies, a recurring theme emerges: the pitfalls we encounter. One of the most significant is the pattern of the major rewrite, sometimes called “building off to the side.” Now, don’t get me wrong – a …</description><content:encoded><![CDATA[<p>In many conversations about how products and systems evolve within companies, a recurring theme emerges: the pitfalls we encounter. One of the most significant is the pattern of the major rewrite, sometimes called &ldquo;building off to the side.&rdquo; Now, don&rsquo;t get me wrong – a well-executed strangler pattern can lead to amazing transformations of codebases and products. However, embarking on a major rewrite can also be the first step towards building a company&rsquo;s own tombstone.</p>
<p><em>(Disclaimer: Yes, I&rsquo;ve been involved in both successful and failed transformations. It&rsquo;s crucial to remember that beyond the technical aspects, the health of the business, the state of the market, and the broader economy are where any conversation about such significant undertakings needs to begin – these factors determine the capacity for disruption.)</em></p>
<p>One often-underestimated side effect of greenfield development is the migration. This term can cover a lot of ground: it might be as simple as users needing to click in a new place, customers switching to a new API endpoint, or new workflows delivering familiar data in a different sequence. But it can also be a noisy, troublesome process involving new passwords, different accounts, and widespread confusion.</p>
<p>Why is this disruption so critical? Because a product&rsquo;s effectiveness often lies in its usage becoming a habit. Think about knowing instinctively which button to press and when, or walking the same route with your dog while absorbed in your phone, barely noticing your surroundings until you arrive home.</p>
<p>Habits, put simply, are formed through repetition as our subconscious takes over the process. One strategy for breaking a <em>bad</em> habit is to introduce friction. Eating too much popcorn at the movies? Try using your non-dominant hand. Doomscrolling before bed? Put the phone to charge in another room. This same principle applies when a system you rely on completely changes the interface you&rsquo;ve grown accustomed to – friction is introduced, breaking your established workflow habit.</p>
<p>Reading about habit formation, one book highlighted how incremental changes contribute to product success. A great comparison is the Segway versus the Electric Scooter. One is now largely a niche item (often seen carrying tourist groups), while the other is a widespread success. Why? The electric scooter builds directly on the familiar paradigm of a child&rsquo;s scooter, offering similar mobility but with a much lower learning curve, leveraging an existing habit.</p>
<p>Reflecting on this often brings to mind that popular image representing the pinnacle of &ldquo;doing it right in agile&rdquo; – the evolution from scooter to bicycle to motorbike to car.</p>
<p>





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        

        
        
        
          
        
        
        
        
        
        
        


        
        


        <picture>
          <source
            
              srcset="/images/blog/agile-metafor_hu_cc9c8a6eaa1b5006.webp"
            
            media="(max-width: 575px)" />
          <source
            
              srcset="/images/blog/agile-metafor_hu_79d5409d424b0c41.webp"
            
            media="(max-width: 767px)" />
          <source
            
              srcset="/images/blog/agile-metafor_hu_97b044a5451a61ca.webp"
            
            media="(max-width: 991px)" />
          <source
            
              srcset="/images/blog/agile-metafor_hu_b24f8f85bb1a610e.webp"
             />
          <img
            
              loading="lazy" decoding="async"
              src="/images/blog/agile-metafor_hu_dc680b47c88557e4.png"
            
            
            class=" rounded img"
            alt="Correct Agile Approach"
            width="828"
            height="618" />
        </picture>
      
      
    
    
  


  

</p>
<p>While I agree that delivering value incrementally is generally the better approach, this specific analogy highlights a potential issue if taken too literally for user experience: our customer is forced through significant changes with each leap – from riding a scooter to balancing a bike, and so on. In this interpretation, we are constantly breaking the user&rsquo;s habit and forcing adaptation to a new interface. While change underlies all improvement and some discontinuity is natural, it&rsquo;s vital to consider the <em>unintentional</em> discontinuities we might be pushing onto customers and how we can minimize them.</p>
<p>Beyond the user, we must also consider the <em>engineering discontinuity</em>. Developers often crave the new and shiny, eagerly embarking on large rewrites. We sometimes fail to recognize these as failures even when, three years later, they haven&rsquo;t fully replaced the original system. Or consider when we describe something as &ldquo;the old-new thing&rdquo; because our supposedly pristine green field already has a patch of dying grass in the back corner. We consistently underestimate the impact the &ldquo;unknown unknowns&rdquo; of a new stack will have. We build exciting new streaming architectures only to spend far more time than anticipated figuring out the nuances of Kafka disruptions, recovering from human error, or dealing with the downstream impact of switching to React on our APIs.</p>
<p>All these challenges divert attention from the actual goal and inevitably delay our estimates. This is often coupled with the endless scope creep encouraged by business partners who hear statements like, &ldquo;With this new architecture, we&rsquo;ll have more flexibility!&rdquo; In my experience, this flexibility, combined with the allure of newfound freedom from legacy constraints, often invites the urge to build a completely <em>new</em> experience rather than continuing to build upon the existing one, leveraging established user habits and maximizing the current user experience.</p>
<p>Concluding, the evolution of software is undoubtedly tricky. We are often biased by our desire for the new and our rejection of what we label &ldquo;Legacy code.&rdquo; This bias can lead us towards fresh starts that overlook the business&rsquo;s capacity to absorb such a restart or endure an extensive period with no new feature deliveries. I believe we should all more carefully analyze our options, giving serious consideration to the incremental approach of improving existing software. The hope is to provide the business with enough continuity to allow us, over time, to further evolve the system towards the engineering excellence we strive for.</p>
]]></content:encoded></item><item><title>Closing a chapter</title><link>https://doh.ms/2024/09/01/closing-a-chapter-nl/</link><pubDate>Sun, 01 Sep 2024 00:00:00 -0300</pubDate><guid>https://doh.ms/2024/09/01/closing-a-chapter-nl/</guid><dc:language>en-US</dc:language><category>career</category><category>expats</category><category>friends</category><description>This is it; the house is mostly empty as I sit in my temporary home office, the living room table. Our Dutch lives are mostly in boxes in a container, and the only things left to go are Bella, our retriever, and me.</description><content:encoded><![CDATA[<p><strong>This is it</strong>; the house is mostly empty as I sit in my temporary home office, the living room table. Our Dutch lives are mostly in boxes in a container, and the only things left to go are Bella, our retriever, and me.</p>
<p>Just about 13 years ago, our family of then only 2 took a leap of faith and decided to make The Netherlands our new home. I&rsquo;m sitting here reminiscing about those days, so let me take you along for a look back (maybe my next post will be a look forward).</p>
<p>December 2011. I could count the number of Brazilians we knew (or heard of) in NL on a single hand. The Netherlands still celebrated Queen&rsquo;s Day instead of King&rsquo;s Day, and I was just a Senior Engineer working on a SaaS crowd-funding platform (I called it &ldquo;CaaS&rdquo;, a play on &ldquo;Kaas&rdquo;, dutch for cheese).</p>
<p>On a personal level, the wife and I enjoyed exploring Europe, NL, and a new culture while adapting to the sun setting at 16h and temperatures that would freeze a regular Brazilian. Professionally, PHP Benelux dominated the PHP landscape, trying its best to cover three countries and promote the growth of developers and the language. I remember talking to Michelangelo Van Damn back then, brainstorming if a user group in Amsterdam made sense, it&rsquo;s funny how many people thought we had &ldquo;stolen&rdquo; Amsterdam from Benelux, and yet it all started with their blessing and incentive, and today AmsterdamPHP is thriving.</p>
<blockquote>
<p>As a side note, AmsterdamPHP is one of the things I&rsquo;m most proud of. At my goodbye meetup, I heard from many people how the group touched their lives, and honestly, it was almost a selfish effort to make new friends myself. And boy, did I make friends there. I will miss you all. I&rsquo;ll forever pour one out for this group on the third Thursday of every month. Thank you all.</p>
</blockquote>
<p>Living here allowed me to hit the speaker circuit like never before and travel to so many new places, spreading topics like Composer, Object Calisthenics, Annotations, and many others. I had the opportunity to work with incredible engineers, learning from many of them, but I also had the chance to grow many careers and help many relocate here.</p>
<p>In July 2013, our family faced a challenging time. My wife was involved in a tragic accident and spent six months in the hospital. This experience changed our lives significantly, but it also taught us about the strength of the expat community. The friends we made along the way became like family to us, and we feel incredibly grateful for their support. I will always be touched by everyone who helped us through those difficult times.</p>
<p>Over the years, this place has changed a lot. Well, the weather was basically the same (takkeweer is my favorite weather word), but over the years, we had quite the increase in Brazilians, the market grew, bigger companies, more opportunities, more people at meetups, new houses, new neighborhoods, a dog, and a kid. It feels like a very different place, but still a great one. Our journey here has been filled with growth, new experiences, and the formation of lasting friendships.</p>
<p>I&rsquo;m moving back to Brazil. Why? Family. My wife supported me in coming here to work, so it&rsquo;s time to pay that back, and it&rsquo;s a good time for our daughter to spend time with her grandparents. What&rsquo;s next or after that? Who knows, but now, it&rsquo;s Brasília.</p>
<p>I will miss everything (except the kutweer) and everyone, you all made this the best ride of my life. I will continue working with SurveyMonkey, and that means I&rsquo;ll be around for visits. Don&rsquo;t be strangers; let&rsquo;s meet when I&rsquo;m around and stay connected. You won&rsquo;t be rid of me so quickly. I&rsquo;m committed to maintaining our connections, no matter the distance.</p>
<p>But mostly, I want to express my deepest gratitude. Thank you. Thank you for receiving me, embracing me, believing in my dreams, and joining this journey, regardless of which walk of life you joined me in personal, professional, AmsterdamPHP, Game nights, Dungeons &amp; Dragons, or complaining about the weather. Your support has meant the world to me.</p>
<p><strong>tot ziens, tot de volgende keer, ik hou van jullie allemaal.</strong></p>
]]></content:encoded></item><item><title>Productive Slacking</title><link>https://doh.ms/2019/10/18/productive-slacking/</link><pubDate>Fri, 18 Oct 2019 00:00:00 -0300</pubDate><guid>https://doh.ms/2019/10/18/productive-slacking/</guid><dc:language>en-US</dc:language><category>communication</category><category>enterprise</category><category>slack</category><category>tips-and-tricks</category><description>Back in 2016 I joined Usabilla, just around the time we were evaluating our work chat solutions. Usabilla was at the time on Hipchat and Slack was the up and coming solution, with plenty of advanced features and goodies. I will not try to sell Slack here, but it clearly was the …</description><content:encoded><![CDATA[<p>Back in 2016 I joined Usabilla, just around the time we were evaluating our work chat solutions. Usabilla was at the time on Hipchat and Slack was the up and coming solution, with plenty of advanced features and goodies. I will not try to sell Slack here, but it clearly was the better contender and worth our move.</p>
<p>In order to make the move a success, in a company that still relied heavily on an email tradition, we spent some time carefully evaluating our policies around Slack usage, to make it friendly to non-tech users and also efficient for a rapidly growing team doing frequent on-boardings.</p>
<p>After almost 3 years and the opportunity to see how other companies use Slack &ldquo;in the wild&rdquo;, I decided to reflect a bit on how this went, spoiler alert it was a resounding success, and outline some of the policies I believe made a real difference and can help your company get a handle on Slack.</p>
<h2 id="you-are-here-helping-users-find-themselves"><strong>You are here: helping users find themselves</strong></h2>
<p>One very overwhelming part of joining a new company is getting access to their Slack. Which channels do you join, what is relevant to your position or to your physical office or even what is business and what is social? When joining a company and seeing dozens, if not hundreds, of public channels, how do you figure this out? and how can you do it quicker</p>
<p>One of the first agreements we settled on was the use of channel prefixes. Simple, short prefixes that allowed us to easily categorize channels and make them easier to navigate. Are you a new developer? easy, check out all the <code>#dev-*</code> channels to find your interests, maybe its <code>#dev-edu</code> to learn new stuff, or <code>#dev-be-chapter</code> to join our backend chapter group.</p>
<p>Or maybe you are new to our Amsterdam office so you can join <code>#office-ams</code>. Obviously once you are done with work you can head over to <code>#ot-travel</code> to get some sweet tips on that new city you want to travel to, or just relax watching awesome dog pics at <code>#ot-dogs</code>.</p>
<p>Adding prefixes, does indeed take some of your character limit away (Slack just upped the limit so that excuse is gone), but makes for a great and easy way to ease your new users, and existing ones, into your communication infrastructure. During the on-boarding of new employees, we share a list of our most relevant prefixes and their meaning so users can quickly skip over to what they are looking for. Here are some examples:</p>
<ul>
<li><code>dev-</code> all channels related to development</li>
<li><code>ot-</code> channels that are Off Topic, usually social and not business</li>
<li><code>team-</code> channels specific to a team, this also signals this is not a channel for non-team members to ask questions</li>
<li><code>warn-</code> channels related to status and warnings, from infrastructure to dev to other parts of the company</li>
<li><code>prj-</code> short lived channels for projects that need new groups of people to collaborate</li>
</ul>
<p>Combine prefixed channel names with meaningful &ldquo;Channel Purpose&rdquo; and &ldquo;Topic&rdquo; and you can really help people navigate and find what they need at the moment they need it.</p>
<h3 id="dashing-and-visible"><strong>Dashing and visible</strong></h3>
<p>At first look dashes seem like a waste of time and char-space right? But they actually play a real important role in discoverability of channels. Let me illustrate: let&rsquo;s say you have a <code>#hashtagdogsrule</code> and a <code>#hashtag-dogs-rule</code> channel. When you search for <code>dogs</code> in the quick switcher, only the one with with dashes will show up, because Slack does prefix/word based searching.</p>
<h2 id="do-it-in-the-open-because-transparency-matters"><strong>Do it in the open: because transparency matters</strong></h2>
<p>We limit the creation of private channels, sure these are great for conversations between certain groups of people, but a private first culture can hinder your companies entire communication flow and make Slack a literal black hole of information. Of course there are exceptions, HR related channels, or our surprise party planning committee, or even sensitive projects, like acquisitions. But other then those cases, everything is done in public channels.</p>
<p>Public information is extremely valuable, by allowing people access to what is happening you create serendipitous opportunities for collaboration. Maybe a developer sees someone in a Customer Success team is trying to automate a process and they have the skill to help out, or you notice another development team is stuck on a similar problem to the one you just solved. Maybe even you notice sales is trying to approach a company where you know the right people. If all of this happens behind closed doors, you may never find the opportunity to collaborate.</p>
<p>Some channels are special, for example our <code>#team-</code> channels. You are more than welcome to join a team&rsquo;s channel as an outsider, but you are there as a guest, an observer, preferably a silent one. For example instead of asking questions and interrupting ongoing conversations, you can reply to messages where you can offer help by using threads, these are less intrusive and still allow you to access the context in which to ask or offer help. We also make it very clear that this is the team&rsquo;s house and they can ask you to leave at any moment for whichever reason they believe is relevant.</p>
<h2 id="slack-tiquette-it"><strong>Slack-tiquette: it&rsquo;s a new world, let&rsquo;s make new rules</strong></h2>
<p>Let&rsquo;s start with a simple one: you are beautiful and your <strong><em>avatar</em></strong> deserves to represent you. None of us look like colored blocks in real life and Slack is a tool for uniting people who may work in separate offices or in big companies, having a complete profile with a proper avatar, title, information such as timezone will help your co-workers talk to you, identify you and create a stronger bond, so put your best face forward.</p>
<p>Slack is a tool made to speed up the usual flow of email conversations, and it&rsquo;s <strong><em>asynchronous</em></strong>, meaning you can ask a question now and get an answer when the person is available. You would not send an email with &ldquo;how are you?&rdquo; and only follow it up once you got an answer to that, same goes for Slack, its not rude to start off with your enquiry, it&rsquo;s actually way more productive to both sides. Of course you can always ask that question as well, but don&rsquo;t wait for a response before carrying on with the communication. Especially for people spread out in different timezones this becomes really important.</p>
<p><strong><em>Pinning is winning.</em></strong> Humans hate answering questions over and over, and pinning can really help with that, make sure your important resources are pinned to your channels so they are easy to find and reference, and you no longer need to repeat yourself over and over.</p>
<h2 id="the-steering-committee"><strong>The Steering Committee</strong></h2>
<p>Have you ever asked a company who is in charge of Slack? Now I don&rsquo;t just mean who is Admin and can install apps or add people, who is guiding the formation of your slack? I&rsquo;m betting the answer will be &ldquo;no one&rdquo; or &ldquo;I don&rsquo;t know&rdquo;, another solution we established early was a Slack Steering Committee. A group of people from various areas that could guide the usage and build up of Slack within the company. I believe its always useful to have a group of people who can pull back points outside the curve, or evolve the ruleset as new requirements arise.</p>
<h2 id="happy-slacking"><strong>Happy Slacking</strong></h2>
<p>I hope this brings you some inspiration and makes your Slacking a better experience, but I will warn you, caring about all this may make you open pandora&rsquo;s box and you will never be able to stop cringing when you look at another Slack.</p>
]]></content:encoded></item><item><title>Solving conflicts in composer.lock</title><link>https://doh.ms/2016/11/28/solving-conflicts-in-composer-lock/</link><pubDate>Mon, 28 Nov 2016 00:00:00 -0200</pubDate><guid>https://doh.ms/2016/11/28/solving-conflicts-in-composer-lock/</guid><dc:language>en-US</dc:language><category>composer</category><category>composer-lock</category><category>composerphp</category><category>php</category><category>tips</category><description>We have all been there: CONFLICT (content): Merge conflict in composer.lock Automatic merge failed; fix conflicts and then commit the result. Don’t panic, breathe, let’s walk through this.</description><content:encoded><![CDATA[<p>We have all been there:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>CONFLICT (content): Merge conflict in composer.lock Automatic merge failed; fix conflicts and then commit the result.
</span></span></code></pre></div><p>Don&rsquo;t panic, breathe, let&rsquo;s walk through this.</p>
<p>Since I joined Usabilla, I have been working once more in a large team. With more people involved in the process of working with composer, adding, updating and removing libraries, merge conflicts are bound to happen. Ideally I would tell you to leave that process to only one person, but that is not realistic in teams over, well, one person. :D</p>
<p>So it will happen, but how do we keep our sanity?</p>
<h2 id="what-i-avoid-doing">What I AVOID doing.</h2>
<p>While reading other blog posts on this I found a practice that I consider not ideal. In most blogposts the first step towards fixing the conflict is usually:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>$ git merge --ours composer.lock
</span></span></code></pre></div><p>What does this do? this will impose <em>your</em> version of the lock file, which seems fine, but has a catch. The catch here is that by ignoring the remote lock file you are discarding any updates done by the other developer.</p>
<p><strong>&ldquo;but Rafael, semantic version is great nothing will break cause my json file has ^1.2&rdquo;</strong>, I agree, but as a policy I try to make sure our updates are conscious, just for good measure. Also I feel its good to respect the work of other people in your team and not discard those changes unless really required to.</p>
<h2 id="what-i-do-do">What I DO do.</h2>
<p>Its a simple switch around.</p>
<p>First I get the other developers changes:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>$ git checkout origin/{base} -- composer.lock composer.json
</span></span></code></pre></div><p>Then you replay your changes on top of this, like:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>$ composer require {new/package} --update-with-dependencies $ composer update {existing/package}
</span></span></code></pre></div><p>You should know exactly what changes you made, so this should be no problem. Now you have kept all non-conflicting changes and updates from the other developer and applied your changes on top of it and the state of your dependencies is predictable and stable.</p>
<p>Oh, and you obviously run that great test suite after doing this, right?</p>
]]></content:encoded></item><item><title>Land ho! New challenge ahead.</title><link>https://doh.ms/2016/06/30/land-ho-new-challenge-ahead/</link><pubDate>Thu, 30 Jun 2016 00:00:00 -0300</pubDate><guid>https://doh.ms/2016/06/30/land-ho-new-challenge-ahead/</guid><dc:language>en-US</dc:language><description>A few months ago I posted about the situation at my former company and the uncertain future of our team. During these 3 months we explored many new opportunities and interviewed with many companies, from startups to consolidated giants, from financial market to education and user …</description><content:encoded><![CDATA[<p>A few months ago I posted about the situation at my former company and the uncertain future of our team. During these 3 months we explored many new opportunities and interviewed with many companies, from startups to consolidated giants, from financial market to education and user feedback, it was an amazing journey.</p>
<p>This journey is now over and I have found my new challenge, but more on that in a bit. Let me tell you a bit more about the journey.</p>
<h2 id="interviewing-as-a-team">Interviewing as a team</h2>
<p>Few months ago Stripe <a
  href="https://stripe.com/blog/bring-your-own-team"target="_blank" rel="noopener"
  >posted an article</a
> about hiring teams and the benefits of that, I would like to also mention the benefits of <em>interviewing as a team</em>.</p>
<p>Our team went to many interviews as a full team, either together in big meetings or as individuals. The interesting aspect of this is that since we were a diverse group of people with many different roles, we analyzed companies from various angles, some of which I, in my interviewing experience, may never have thought to look into.</p>
<p>This made for a very fulfilling and unique experience, I got a lot more insights into companies than ever before. How does the business decide on features, how is UX looked after outside of screens, how do you make money and down to our usual questions of code/infrastructure.</p>
<p>If you ever get a chance to coordinate as a group and exchange notes on interviews, I do recommend doing so.</p>
<h2 id="whats-next">What&rsquo;s next?</h2>
<p>I&rsquo;m happy to announce my next challenge, not just because I&rsquo;m very excited to join the company and add to the great work they already do, but also because I was lucky enough to bring <a
  href="https://twitter.com/rickmb"target="_blank" rel="noopener"
  >Rick Buitenman</a
>, my former manager, and <a
  href="https://twitter.com/vanamerongen"target="_blank" rel="noopener"
  >Pauline Vos</a
>, my former &ldquo;mentee&rdquo;, along for the ride.</p>
<p>As of the first of July we will all be part of the <a
  href="http://usabilla.com"target="_blank" rel="noopener"
  >Usabilla</a
> family!</p>
<p>Usabilla is a big player in the Dutch tech scene, a company built on the belief that continuous user feedback is the key to successful products. Their focus is on providing &ldquo;Voice of Customer&rdquo; solutions to help their more than 20K clients improve their user experience, conversions and boost customer satisfaction.</p>
<p>If you have ever used websites like ABN AMRO, KLM, HP, Philips, Vodafone and countless others, you may have noticed a feedback button, that is one of the many tools Usabilla provides.</p>
<p>I&rsquo;ll be joining them as Lead Backend Engineer, where I&rsquo;ll be able to focus on my 3 personal passions: coding/architecture, development work flow and growing/mentoring developers. Together we hope to take the platform to new levels of architecture, quality and performance.</p>
<p>Apart from coding, I&rsquo;ll be working with the development team to take our development practices to even higher levels and make sure we are all learning and growing all the time. I love teaching and exposing people to more knowledge so this should feel right at home for me.</p>
<p>I&rsquo;m also looking forward to learning from a entire new set of great developers as well as also getting a chance to expand into Golang which is in line with my own personal goals for this year.</p>
<p>I&rsquo;m very excited to dive into the company and see how I can contribute to a great business and an amazing team.</p>
]]></content:encoded></item><item><title>Code Reviews - Not just a quality tool</title><link>https://doh.ms/2016/05/17/code-reviews-not-just-a-quality-tool/</link><pubDate>Tue, 17 May 2016 00:00:00 -0300</pubDate><guid>https://doh.ms/2016/05/17/code-reviews-not-just-a-quality-tool/</guid><dc:language>en-US</dc:language><category>code-review</category><category>development-cycle</category><category>quality</category><category>team-lead</category><category>workflow</category><description>I’m a big fan of Code Reviews, or Peer Reviews, within the work flow of a team. But many times when talking about them people refer to them mostly as a tool to avoid bugs, improve quality or the overlooking of details. While these things do surely come out of having a review …</description><content:encoded><![CDATA[<p>I&rsquo;m a big fan of Code Reviews, or Peer Reviews, within the work flow of a team. But many times when talking about them people refer to them mostly as a tool to avoid bugs, improve quality or the overlooking of details. While these things do surely come out of having a review process, I do not believe they are the real reason why they are a good thing for teams.</p>
<p>Code Reviews, to me, are about getting the team in sync. They are about making sure the team&rsquo;s <em>core values</em> are spread throughout the team and observed. I&rsquo;m not talking about Coding Standards, those can be enforced and checked with automated tools, I&rsquo;m more concerned about architecture, code simplicity and conventions, things that are not measurable to some extent and more about making sure code reflects the core values you have.</p>
<p>In my previous team I made sure to on-board every developer by having them read up on <a
  href="http://protalk.me/your-code-sucks-lets-fix-it"target="_blank" rel="noopener"
  >Object Calisthenics</a
>, a practice that helps code awareness and promotes simplicity. This practice cannot be enforced by automated testing like coding standards, and this is where I believe Code Reviews have a role to play. While having your code reviewed and then reviewing other people&rsquo;s code, you are exposed more and more to these aspects, and both of those parts are equally important.</p>
<p>During our on-boarding process the first thing developers are exposed to is reviews by the team lead. In our case we were expanding from a one man team, so the team lead held the <em>core values</em>, what we believed good code should look like. The first few weeks were about expressing this and showing, by example, to the team. This is where you can show what your thinking would be to solve these problems in alternate ways. For this step its very important that both sides keep an open mind, because at this point you are building the new core values, which the team will believe in, this means no one is right.</p>
<p>Now, only having your code reviewed and criticized is not a learning experience, the real learning happens when you start reviewing other people&rsquo;s code. This is where you have to start internalizing the agreed values and projecting them on other people&rsquo;s code. In our process I noticed that some developers were focused on large tasks and some on short tasks, the ones on longer tasks took more time to integrate into this, due to the long feedback loop. I recommend you try to make sure new developers have a balance of short/long tasks so they are not out of the feedback loop.</p>
<p>After a few months of our team expansion we noticed that the comments made on each other&rsquo;s code were a lot more standardized, especially to me, the team lead. I noticed that by the time I came in to make a comment, another team member had already made it. This was a good sign that the core values were being spread.</p>
<p>One thing to note is that when a big change happens in the team, here we went from 2 devs to 5, it is important to <strong>re-build</strong> core values together, not simply impose them. We had many team meetings to discuss code together in order to evaluate if our values were indeed useful and made sense. The practice of &ldquo;code burns&rdquo; is great for this. Code Burns are nothing more then team code reviews where you can make comments and discuss as a team about each point.</p>
<p>If you are trying to implement a Code Review process or if one is being implemented in your team, be sure to keep this in mind, its not about having your code criticized by someone else, its about helping everyone be on the same page about what the team believes is good code.</p>
<p><em>Looking for someone to do this in your company? I&rsquo;m currently <a
  href="http://blog.doh.ms/2016/04/05/need-a-lead-heres-my-story/"target="_blank" rel="noopener"
  >looking for new challenges</a
></em></p>
]]></content:encoded></item><item><title>Need a Lead? Here's my story.</title><link>https://doh.ms/2016/04/05/need-a-lead-heres-my-story/</link><pubDate>Tue, 05 Apr 2016 00:00:00 -0300</pubDate><guid>https://doh.ms/2016/04/05/need-a-lead-heres-my-story/</guid><dc:language>en-US</dc:language><category>career</category><category>hire-me</category><category>hire-my-team</category><category>opportunity</category><description>After 2,5 years working with Symbid, our paths must now diverge. After having contributed as a partner company and then joined to build the in-house development team that would later form the base of Symbid’s Product Development team, and finally push it over into a fintech …</description><content:encoded><![CDATA[<p>After 2,5 years working with Symbid, our paths must now diverge. After having contributed as a partner company and then joined to build the in-house development team that would later form the base of Symbid&rsquo;s Product Development team, and finally push it over into a fintech company, sadly we part ways before achieving our long dreamed and much schemed plans.</p>
<p>As is the lifetime of disruptive startups, sometimes there&rsquo;s a will and a way but not enough resources to make the plan into concrete products. This is, from a 10,000 foot view and as much as I can share, the outcome of our hard work at Symbid. We achieved amazing things and built an extraordinary team over these years but were cut short of rolling out most of the exciting developments.</p>
<p>So as of today, <strong>I&rsquo;m available to help other companies build amazing teams and release cool new products</strong>. If your company is in need of a Technical Lead with experience in many markets and a passion for growing teams and producing quality software, please drop by my <a
  href="https://nl.linkedin.com/in/rafaeldohms"target="_blank" rel="noopener"
  >LinkedIn profile</a
> to see more details, or email me at <a
  href="mailto:jobs@doh.ms"
  >jobs@doh.ms</a
>, and let&rsquo;s chat about how I can help your company and your team achieve both.</p>
<p>But that is not all, our unique situation also allows me to suggest even more. Many companies are in the process of hiring and building new teams, we all know that this takes effort and time, to get a team in sync and working like a well oiled machine. If this is where your company is at, <strong>I can offer you a chance to talk to our entire team</strong>, a complete team from backend and frontend developers to UX Experts, Product Owners, and Product Managers. If you want to kickstart your in-house team, we can offer you a fully integrated team that is ready to start building your visions and get your plans off paper. Please also reach out to me at <a
  href="mailto:jobs@doh.ms"
  >jobs@doh.ms</a
> if this sounds like an opportunity for you.</p>
<h2 id="what-did-i-do-at-symbid">What did I do at Symbid?</h2>
<p>At Symbid I operated as the Technical Lead Developer. From my early days as &ldquo;developer #1&rdquo; my work revolved around converting business value into software feature, determining the best architecture and technologies to achieve goals and integrating our many partner systems. As we expanded into a Product Development team I also took on the responsibility of managing the developers, defining work practices, creating tooling to support our flow and team, as well as mentoring and guiding developers to achieve more of their potential. Over the last year I also had the chance to design a microservices infrastructure that would join all pieces of Symbid&rsquo;s &ldquo;Funding Network&rdquo; and partner software, as well as migrate all our code to PHP 7.</p>
<p>I&rsquo;m a lover of innovative and clean code, bringing many new ideas to our code base with concepts of DDD, TDD and strategies like CQRS and Command Buses, as well as many other technology and concepts currently under research and evaluation. I&rsquo;m also a mentor and teacher at heart, so I love being able to bring some of what I do at AmsterdamPHP into the workplace, mentoring and growing our developers, pushing them towards leveling up their code as well as exposing them to the concept of community which I&rsquo;m quite fond of.</p>
<h2 id="what-am-i-looking-for">What am I looking for?</h2>
<p>I love building products, especially long running products that have a vision that aims at making the world a better place. Sounds corny but I love being able to leave a mark in the future of society through my tool set of technology. I also love iterations, being able to refine software over longer periods, redesign, refactor and improve constantly, which is why I love long running products and not the quick turn around of the web agency style of work.</p>
<p>This is also where I feel my skills are of more use. Companies that are involved in the local community and giving back to OSS get a big bag of bonus points. I do enjoy running UGs and spreading technology at various conferences, as a speaker or attendee, so I do expect my company to see the value in that and support my efforts. Give me that much and I&rsquo;ll spread the love to every person I see and make sure I&rsquo;m bringing back to the company as much ideas and knowledge as I can to take us even further.</p>
<p>I love leading teams technically and building/planning systems to solve the problems your company is aiming at. If possible I prefer focusing on the tech side of things and not so much on the HR part of that, I&rsquo;ll mentor and help developers plan their careers, but I&rsquo;m not so good at managing their vacation days.</p>
<p>If any of this, sounds like what your company needs please tell me about your vision and your needs, I would love to be a piece in that puzzle.</p>
<p>Above all of this, the team we have built at Symbid is close to my heart and we are all out there looking for a new challenge, any chance I have to keep them together will be the best outcome I can imagine.</p>
<p>Look me up on Linkedin: <a
  href="https://nl.linkedin.com/in/rafaeldohms"target="_blank" rel="noopener"
  >https://nl.linkedin.com/in/rafaeldohms</a
> Email me at: <a
  href="mailto:jobs@doh.ms"
  >jobs@doh.ms</a
></p>
]]></content:encoded></item><item><title>20 Years of PHP, and how I got on this train</title><link>https://doh.ms/2015/06/08/20-years-of-php-and-how-i-got-on-this-train/</link><pubDate>Mon, 08 Jun 2015 00:00:00 -0300</pubDate><guid>https://doh.ms/2015/06/08/20-years-of-php-and-how-i-got-on-this-train/</guid><dc:language>en-US</dc:language><category>20yearsofphp</category><category>php</category><description>PHP, the most loved and hated language on the internet turns 20 today, 20 years ago Rasmus released Personal HomePages to the public, what happened next will blow you away™.</description><content:encoded><![CDATA[<p>PHP, the most loved and hated language on the internet turns 20 today, 20 years ago <a
  href="https://groups.google.com/forum/#!msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ"target="_blank" rel="noopener"
  >Rasmus released Personal HomePages to the public</a
>, what happened next will blow you away™.</p>
<p>Ben Ramsey called on us to <a
  href="http://benramsey.com/blog/2015/06/20-years-of-php/"target="_blank" rel="noopener"
  >blog about our history</a
>, so I decided to take a few minutes and do just that.</p>
<p>Back in the 90’s in the midst of the Counter Strike and IRC wave of the Internet I started getting interested in HTML and CSS on top of my current adventures in IRC scripting (yes, I distributed one called Doomsday Script with some l337 chars.). I even stumbled onto Cold Fusion as my first run into something that could “make the web remember stuff”. By this time I was heading out of school and into College, somewhere along the end of the 90’s.</p>
<p>It was early 2000 when I had enrolled into Computer Enginneering and got word from a friend that the company she worked at, a small publicity agency, was looking for some developers to do HTML and Flash, which by then I was good enough at, having developed multiple websites for things like my Counter Strike Clan and my IRC channels I was OP of (I know… but hey, it was the cool thing back then).</p>
<p>I ended up getting the job and one day the owner of the company, Gaston, showed me how i could use this PHP thing to query a database and show current birthdays of the month on an HTML page. I was blown away in the 10 minutes it took him to show me the parts of this thing working. Then he turned to me and issued what was to become the start of my PHP adventure and what, looking back, may have been the most important moment in my early professional career. “Now go ahead and work on creating our intranet”.</p>
<p>What? A whole “intranet”? All with these html files with <code>&lt;? ?&gt;</code> in them? (yes, short tags, and spaghetti… good days.) Sure, why not? I picked PHP up as fast as the content available on the internet back then could push me forward. I still remember this one very crazy guy we hired that kept talking about this “Object Oriented” stuff that sounded like real voodoo. Jobs came and went, me and a few friends developed a site called Cerrado Mix which was later bought by a local newspaper, it was a party coverage site and it got me into all the cool parties, I was totally cool back then.</p>
<p>There I was, the only PHP developer in Brasil, no one else did this. Or at least that is what it felt like, until in 2006 I ran into this new thing, a “PHP Conference Brasil”, a gathering of people who worked with PHP? What? I’m not alone?</p>
<p>This event changed my career again, showed me not only the local community but the international, I even got to meet this <a
  href="https://twitter.com/derickr"target="_blank" rel="noopener"
  >Derick Rethans</a
> guy and saw a presentation by a local farm boy turned PHP dev by the name of <a
  href="https://twitter.com/guilhermeblanco"target="_blank" rel="noopener"
  >Guilherme Blanco</a
>. But most important of all, this showed me there was a PHP community.</p>
<p>A few months after that, PHPDF was born, my first user group, as a result of meeting Adler Medrado and Pablo Sanchez at and after the conference. The cool thing about this conference is that I vowed to be back in 2007, as a speaker. So in 2007 PHPDF had its first “<a
  href="http://blog.doh.ms/2007/04/26/1%C2%BA-phpdf-roadshow"target="_blank" rel="noopener"
  >PHPDF Roadshow</a
>”, at which I did my very <a
  href="http://www.slideshare.net/rdohms/php-e-ajax-com-xajax"target="_blank" rel="noopener"
  >first talk</a
> (Yes, I totally violated Cal’s Bat Shit Crazy Rule and spoke and organized a conference). In 2007 I came back as a speaker to the conference. Not only that I spoke there every year since, until I moved away from Brazil. And I’m now truly honored to be going back there in its 10 year anniversary as a <a
  href="http://phpconference.com.br/noticia/mostrar/id/24?ln=en_US"target="_blank" rel="noopener"
  >keynote speaker</a
>.</p>
<p>





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        

        
        
        
          
        
        
        
        
        
        
        


        
        


        <picture>
          <source
            
              srcset="/images/blog/511813740_9197bbc5c4_hu_ed815d82d1deb381.webp"
            
            media="(max-width: 575px)" />
          <source
            
              srcset="/images/blog/511813740_9197bbc5c4_hu_979f0ea0cf2282dc.webp"
            
            media="(max-width: 767px)" />
          <source
            
              srcset="/images/blog/511813740_9197bbc5c4_hu_7adc975f2911c714.webp"
            
            media="(max-width: 991px)" />
          <source
            
              srcset="/images/blog/511813740_9197bbc5c4_hu_d98f4c05f75c35.webp"
             />
          <img
            
              loading="lazy" decoding="async"
              src="/images/blog/511813740_9197bbc5c4_hu_8c6eb654db2f64f7.jpg"
            
            
            class=" rounded img"
            alt="Equipe - PHPDF Roadshow"
            width="500"
            height="333" />
        </picture>
      
      
    
    
  


  

</p>
<p>What a Ride it has been form there. I moved to SP in 2008, started <a
  href="http://www.phpsp.org.br"target="_blank" rel="noopener"
  >PHPSP</a
>, had my first international conference experience at ZendCon 2008 (trivia, this is where the PHP Ninja Turtles first met). That is actually when i got my first ElePHPant, from Mr. Community Cal Evans. Then I got to go to php[tek] in 2009 and finally broke the international speaker circuit in 2011 and finally move to the Netherlands in 2011, now calling <a
  href="http://php.amsterdam"target="_blank" rel="noopener"
  >AmsterdamPHP</a
> my home.</p>
<p>Thank you Rasmus for kicking this off, thank you Gaston for that first lesson, and thank you community for pushing me along all the steps that came since, I could not possible name everyone who made a difference in this long road, so let’s just go for THE PHP COMMUNITY.</p>
]]></content:encoded></item><item><title>Why I support "The League"</title><link>https://doh.ms/2015/03/10/why-i-support-the-league/</link><pubDate>Tue, 10 Mar 2015 00:00:00 -0300</pubDate><guid>https://doh.ms/2015/03/10/why-i-support-the-league/</guid><dc:language>en-US</dc:language><category>composer</category><category>league</category><category>packagist</category><category>php</category><description>There has been a lot of drama and press around it lately, but which does it really deserve?</description><content:encoded><![CDATA[<p>There has been a lot of drama and press around it lately, but which does it really deserve?</p>
<p>&ldquo;The League of Extraordinary Packages&rdquo; is what I have dubbed a <em>collective</em> of composer packages. Its essentially a group of developers who have gathered under a single flag (or in this case a vendor name) and set standards for the packages that live there.</p>
<p>Why does this even matter? Well for one <a
  href="https://packagist.org/"target="_blank" rel="noopener"
  >Packagist</a
> (the repository that indexes all libraries known to Composer) is an open repository, this means that it is wide open for anyone to join, from the best packages to the most ridiculous ones. Quality control is not one of its roles and quality checking is on average 2-3 clicks per package away.</p>
<blockquote>
<p>In Packagist, Quality control (or quality information), basically means going to the package homepage and looking at its *github bling*, those developer badges we see everywhere, then diving into scrutinizer, travis, etc. Hence, click on the package, click on the link, click on badge. This is something I believe the listing should handle better.</p>
</blockquote>
<p>For these reasons a curated list of packages, whomever it is that is curating it, is an interesting resource to have, adding credibility to packages and making your life easier when you are searching for that one tool.</p>
<p>Lots of its bad press comes based on the name, which is wrongly interpreted as a pompous attempt at superiority by <a
  href="https://twitter.com/philsturgeon"target="_blank" rel="noopener"
  >Phil Sturgeon</a
>, while it is quite simply a funny reference and a fun name. Also its the joint effort of many other fine authors and amazing PHP developers, not just him.</p>
<p><em>Also, can we stop throwing knifes at everything Phil does? Sure he has his moments, we all do, but he does good stuff also, give him a break.</em></p>
<p>So these are a few reasons I like this effort:</p>
<ul>
<li><strong>Imposed Quality, Curated List</strong>: The League has its own set of rules and internal standards, this means all their packages are at a certain quality point, this makes it easier for you to judge a package&rsquo;s quality and pick the right one.</li>
<li><strong>Reduced author fragility</strong>: since the authors of packages join the league, they receive a lot more contribution and guidance from the existing pool of authors. This helps them keep the package up to date, but it also offer a possible pool of people who can take over if the original author has to step away. The internal <em>pulse-check</em> also helps catch inactive packages a lot faster.</li>
<li><strong>Extended reach</strong>: as an author its not really easy for everyone to find your package. Packagist&rsquo;s ordering makes it very easy to re-use the same packages over and over and not find the new ones. With the league you get a lots more attention coming from another source. This means you can reach more people with your package and bootstrap it.</li>
<li><strong>Reduced duplication</strong>: while we cannot stop duplication on Packagist (of function and much less of vendor and package names), at least inside the League we can rely on having on a single one of each package. In the long run this helps guide developers to work together and not isolate themselves in their own package.</li>
</ul>
<p>I really enjoy the work being done by The League, or The PHPLeague, or Pleague as I prefer to call it. I think it has provided us with some very good packages and given us all something to strive for. Maybe more collectives is what we need.</p>
<p>Go check <a
  href="http://thephpleague.com/"target="_blank" rel="noopener"
  >them out</a
> and give their packages a whirl.</p>
<p><strong>Update:</strong> I wrote this a few weeks back, and today as I publish this, I&rsquo;m very happy to see the League enroll into FIG via its representative <a
  href="https://twitter.com/kayladnls"target="_blank" rel="noopener"
  >Kayla Daniels</a
>. This gives me one more point I like about it:</p>
<ul>
<li><strong>Operates as a Single Project</strong>: this means this group of people work as a unit and discuss all these internally as a team. This is a great reason to join, simply for the learning aspect, but it also brings a lot more quality to their internal ecosystem.</li>
</ul>
]]></content:encoded></item><item><title>The AmsterdamPHP ElePHPant Project</title><link>https://doh.ms/2014/12/02/the-amsterdamphp-elephpant-project/</link><pubDate>Tue, 02 Dec 2014 00:00:00 -0200</pubDate><guid>https://doh.ms/2014/12/02/the-amsterdamphp-elephpant-project/</guid><dc:language>en-US</dc:language><category>community</category><category>elephpant</category><category>kickstarter</category><category>php</category><description>Eve r since I started building User Groups and getting involved in the PHP community I always had a dream of introducing a new color to the ElePHPant collection. Always wanted to make more elePHPants available and to make sure everyone had access to them. With Kickstarter and the …</description><content:encoded><![CDATA[<p>Eve<a
  href="http://blog.doh.ms/wp-content/uploads/Screen-Shot-2014-12-01-at-16.57.24-.png"target="_blank" rel="noopener"
  >





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        
        
        
        
        
        


        
        


        <img
          
            src="/images/blog/Screen-Shot-2014-12-01-at-16.57.24--300x297_hu_9035abb809ec8efd.webp" loading="lazy"
            decoding="async" alt="Screen Shot 2014-12-01 at 16.57.24"
          
          
          class=" rounded img"
          width="300"
          height="297"
          onerror="this.onerror='null';this.src='\/images\/blog\/Screen-Shot-2014-12-01-at-16.57.24--300x297.png';" />
      
      
    
    
  


  

</a
>r since I started building User Groups and getting involved in the PHP community I always had a dream of introducing a new color to the ElePHPant collection. Always wanted to make more elePHPants available and to make sure everyone had access to them. With Kickstarter and the example of php[arch] and PHPWomen, the time has finally come.</p>
<p>AmsterdamPHP has launched a new kickstarter project to make a new color, black! We have already hit our initial funding goal, which is amazing and speaks to what an amazing community we have. We still need to get more units sold to be able to make all ends meet and walk away from this with a total win in the books.</p>
<p><a
  href="http://blog.doh.ms/wp-content/uploads/KS_picture.jpg"target="_blank" rel="noopener"
  >





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        
        
        
        
        
        


        
        


        <img
          
            src="/images/blog/KS_picture-300x300_hu_74e6aef459a02053.webp" loading="lazy"
            decoding="async" alt="KS_picture"
          
          
          class=" rounded img"
          width="300"
          height="300"
          onerror="this.onerror='null';this.src='\/images\/blog\/KS_picture-300x300.jpg';" />
      
      
    
    
  


  

</a
>I always believed elePHPants should be earned not bought, so look at it this way. You will be earning an elePHPant for supporting AmsterdamPHP. We are just getting ready to celebrate our 3 christmas as a UG and this is our way to give back to all these wonderful people who have helped us build this amazing community, a group that build knowledge, relationships and great projects. I hope you too can get motivated by all we have acomplished and adopt one of our elePHPants and give the user group a little something to keep on ticking and starting new awesome events.</p>
<p>Our Kickstarter is up at <a
  href="https://www.kickstarter.com/projects/rdohms/the-amsterdamphp-elephpant"target="_blank" rel="noopener"
  >https://www.kickstarter.com/projects/rdohms/the-amsterdamphp-elephpant</a
><a
  href="http://blog.doh.ms/wp-content/uploads/KS_picture.jpg"target="_blank" rel="noopener"
  ></a
></p>
]]></content:encoded></item><item><title>Installing Composer Packages</title><link>https://doh.ms/2014/10/13/installing-composer-packages/</link><pubDate>Mon, 13 Oct 2014 00:00:00 -0300</pubDate><guid>https://doh.ms/2014/10/13/installing-composer-packages/</guid><dc:language>en-US</dc:language><category>call-to-action</category><category>composer</category><category>install-instructions</category><category>php</category><description>I have been putting together a new talk about Composer, and that means looking around the community, doing loads of research and trying to identify the items that need to be covered in a talk. Mostly I have been trying to identify things that people do on a regular basis that …</description><content:encoded><![CDATA[<p>I have been putting together a new talk about Composer, and that means looking around the community, doing loads of research and trying to identify the items that need to be covered in a talk. Mostly I have been trying to identify things that people do on a regular basis that according to composer internals is either wrong or not ideal.</p>
<p>One such thing that I have found is the proper selection of versions, and that also led me to find a new feature in composer that makes everyone&rsquo;s life so much easier. So let me break this down.</p>
<h2 id="version-selection">Version selection</h2>
<p>First we need to define how to properly set the version of a library you need. I&rsquo;ll consider you already know about <a
  href="http://semver.org/"target="_blank" rel="noopener"
  >semantical versioning</a
> and its dynamics.</p>
<ul>
<li><strong>vendor/package: *</strong> So this is a NOPE right off the bat. As it turns out this has 2 flaws: first it will grab any version, meaning if the library breaks BC, your library will go along with it. Second it makes Composer turn into (even more) of a power hungry CPU and memory muncher, since it wides the &ldquo;search scope&rdquo; for the Version Resolver to work. Sounds bad right?</li>
<li><strong>vendor/package: 1.2.*</strong> This one is not bad, however a point release does not break BC, so you should be able to move to 1.3 without issues, this does not allow that. Fine in this case, but it gets complicated once you have two libraries with the same requirements you now blocked the download of v1.3, which the second library may need.</li>
<li><strong>vendor/package: &gt;= 1.2</strong> Once more this bites the dust with <em>semver</em> since it leaves you wide open to get v2.0 which very likely will make you unit tests turn red.</li>
<li><strong>vendor/package: 1.0.0</strong> This is the most restrictive of all, it will keep you locked on this version and will probably not play nice with any other library using this dependency.</li>
<li><strong>vendor/package: ~1.2</strong> This is what you are looking for, its called the <em>tilde</em>, and it means &ldquo;Next Significant Release&rdquo;, its internally expanded to <strong>&gt;=1.2.0,&lt;2.0.0</strong> meaning all the non-BC breaking releases before the next significant release, which will be 2.0.0. You can also be more specific with <em>~1.2.3</em> this will basically always be the lower end of the match. <strong>Update:</strong> Keep in mind that the number of dots will define which level of release you wish to grab, i.e ~1.2.3 expands to <strong>&gt;=1.2.3, &lt;1.3</strong>, restricting you to <em>patch updates.</em> One option you have is to use <strong>~1.2,&gt;=1.2.3.</strong></li>
</ul>
<p>Using the <em>tilde</em> operator gives you the best chance to avoid conflicts with other libraries, which means you will play nice and also avoids you having to update your composer.json file everytime another library releases a new version.</p>
<h2 id="adding-new-dependencies-and-install-instructions">Adding new dependencies and Install instructions</h2>
<p>With Composer gaining more and more traction we seem loads of libraries out there using and supporting it. However since not everyone is familiar with composer (yet!) we often end up with loads of install instructions on how to install libraries via composer.</p>
<p>The most common of those unfortunately goes something like:</p>
<blockquote>
<p>Install this library using Composer, please add this to your composer.json file</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-js" data-lang="js"><span style="display:flex;"><span> { <span style="color:#e6db74">&#34;require&#34;</span><span style="color:#f92672">:</span> { <span style="color:#e6db74">&#34;vendor/package&#34;</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;\*&#34;</span> } }
</span></span></code></pre></div></blockquote>
<pre tabindex="0"><code>
Now, this is a problem for 2 reasons. One, you have to edit the composer.json file, and two: to avoid editing this all the time developers usually pick &#34;\*&#34; which we already learnt was a no-no. Also people don&#39;t seem to agree on these instructions to no two are the same.

It just so happens there is a **better, faster** way to do this, which even comes with a few perks. And it fits in a single line you can copy/paste to your console and run:

```js
composer require vendor/package
</code></pre><p>That&rsquo;s it, simple as, well this. This will obviously done one thing, it will open your composer.json file and add this requirement in there for you, now messing with the file. Now some of you will be telling me i did not add the version to it, like so:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-js" data-lang="js"><span style="display:flex;"><span><span style="color:#a6e22e">composer</span> <span style="color:#a6e22e">require</span> <span style="color:#a6e22e">vendor</span><span style="color:#f92672">/</span><span style="color:#66d9ef">package</span><span style="color:#f92672">:~</span><span style="color:#ae81ff">1.2</span>
</span></span></code></pre></div><p>And this is where Composer blew me away a few weeks ago. I did not, and i <strong>should not.</strong> Turns out composer figures that part out for you (meaning it identifies the latest version available) and also binds it properly using the proper <em>tilde</em> operator. How awesome is that?</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-js" data-lang="js"><span style="display:flex;"><span> <span style="color:#a6e22e">composer</span> <span style="color:#a6e22e">require</span> <span style="color:#a6e22e">vendor</span><span style="color:#f92672">/</span><span style="color:#66d9ef">package</span> <span style="color:#a6e22e">Using</span> <span style="color:#a6e22e">version</span> <span style="color:#f92672">~</span><span style="color:#ae81ff">1.0</span> <span style="color:#66d9ef">for</span> <span style="color:#a6e22e">vendor</span><span style="color:#f92672">/</span><span style="color:#66d9ef">package</span>
</span></span></code></pre></div><p>Disclaimer: if you know you need a version and its not the latest, then yeah, stick to the previous option.</p>
<h2 id="campaign-prs-for-a-better-composer-ecosystem">Campaign: PRs for a better Composer Ecosystem</h2>
<p>So this month we are in the middle of <a
  href="https://www.digitalocean.com/company/blog/hacktoberfest/"target="_blank" rel="noopener"
  >#hacktoberfest</a
>, promoted by <a
  href="https://www.digitalocean.com/?refcode=ee841b4fb29a"target="_blank" rel="noopener"
  >Digital Ocean</a
>, so you all want to stack up those Open Source contributions right? Here is my idea, let&rsquo;s send a PR to every package that has the old composer.json instructions and send them an updated version with the new recommended install method. It would look something like:</p>
<blockquote>
<p>To install this library, run the command below and you will get the latest version</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-js" data-lang="js"><span style="display:flex;"><span><span style="color:#a6e22e">composer</span> <span style="color:#a6e22e">require</span> <span style="color:#a6e22e">vendor</span><span style="color:#f92672">/</span><span style="color:#66d9ef">package</span>
</span></span></code></pre></div></blockquote>
<pre tabindex="0"><code>
Feel free to add composer.phar if you feel the need. If you want to hear more, come see me talk at [php\[world\]](http://world.phparch.com/).

**How about it? Let&#39;s fix the internet and revolutionize composer installs! Add links to your PRs in the comments!**
</code></pre>]]></content:encoded></item><item><title>J and Beyond 2014: An Overview</title><link>https://doh.ms/2014/06/03/j-and-beyond-2014-an-overview/</link><pubDate>Tue, 03 Jun 2014 00:00:00 -0300</pubDate><guid>https://doh.ms/2014/06/03/j-and-beyond-2014-an-overview/</guid><dc:language>en-US</dc:language><category>code-quality</category><category>jab14</category><category>jandbeyond</category><category>keynote</category><category>object-calisthenics</category><category>php</category><description>The past weekend marked a very important moment for me. After almost a year on the sidelines dealing with personal matters, I finally had the opportunity to go talk to and teach another community.</description><content:encoded><![CDATA[<p>The past weekend marked a very important moment for me. After almost a year on the sidelines dealing with personal matters, I finally had the opportunity to go talk to and teach another community.</p>
<p>I was invited by Brian Teeman (<a
  href="http://twitter.com/brianteeman"target="_blank" rel="noopener"
  >@brianteeman</a
>) to go keynote at <a
  href="http://jandbeyong.org"target="_blank" rel="noopener"
  >J and Beyond</a
>, an annual Joomla Conference focused on their core leadership group and the most active community members. I was very excited about the opportunity and the timing seemed to be right to get back on the speaking wagon, so I accepted the invitation, and along with my wife, made our plans to be at Konigstein im Taunus for the conference.</p>
<p>This event was a merge of very important and exciting points, so let me walk you throughout my side of things. First of all it marked my return, something that i had been looking forward to for a while, since teaching and speaking are things i very much love to do. The second aspect of it is that it was a new community to me. I have only worked with Joomla many years ago in a short 4 month contract in the Brazilian Government. Sufficient to say I knew basically no one in the conference, apart from Lorna Jane (<a
  href="http://twitter.com/lornajane"target="_blank" rel="noopener"
  >@lornajane</a
>) and Sebastian Bergmann (<a
  href="http://twitter.com/s_bergmann"target="_blank" rel="noopener"
  >@s_bergmann</a
>). I love reaching out to new communities and bringing to them some of what we are doing in the greater PHP community, i love getting them in touch and integrated, so this was something i really looked forward to.</p>
<p>The third aspect is that i was keynoting. A keynote talk has a different mindset from a regular one as it does the role of inspiring and setting a tone for the conference. This event does not use the regular opening and closing keynote format, but it still posed an entirely new area of speaking which i had wanted to try for years. So off I went into this mix of new and old and eager to make new friends and see the ones i had not seen in ages.</p>
<p>The event was amazing, the hotel was very nice and isolated bringing in the aspect of socials that I really enjoy from conferences like php[tek]. The organizers did a wonderful job of the regular conference and the socials. I did indeed get to know many new people, some of which were familiar with my work, some which had never heard of me, which is also very refreshing. I was very happy to spread my ideas on development and quality to a new crowd like i had done so many times before. New communities are a fresh playground to me and I love the energy that comes from them at hearing these fresh points of view.</p>
<p>The Joomla community is truly a great and lively one, everyone was very open to receiving me and talking about various topics, and even reaching out to my wife who was there for the ride. I felt very good amongst these people and truly happy to be speaking again. If you do any work related to Joomla, you should get to know their events and their community, they will surely have lots to add to your day to day work.</p>
<p>I was invited to keynote, but ended up covering a few extra topics the organizers asked me to address, so I also spoke about <a
  href="http://slides.doh.ms"target="_blank" rel="noopener"
  >composer</a
> and did my talk on <a
  href="http://slides.doh.ms"target="_blank" rel="noopener"
  >object calisthenics</a
> with far more detail then the keynote.</p>
<p>The keynote was a fresh new talk that i had been working on for a few months, trying to tie my lessons from Object Calisthenics and inspiration of writing clean code into an inspirational talk to promote these values in developers. It held the title of &ldquo;Writing code that lasts&rdquo; or as I like to call it &ldquo;Writing code you won&rsquo;t hate tomorrow&rdquo;. The reaction of the crowd was very good and i really had a wonderful time being on stage ant talking to them. The conversations i had afterwards make me believe that my goal was achieved and i had developers now thinking about their code and becoming aware of these quality markers.</p>
<p>I hope to give this talk in many more communities and CakeFest has already invited me to do so in the CakePHP community, so hopefully you will see this talk somewhere close to you some day. Below are the slides if you want to have a sneak peek into it.</p>
<iframe style="border: 1px solid #CCC; border-width: 1px 1px 0; margin-bottom: 5px; max-width: 100%;" src="http://www.slideshare.net/slideshow/embed_code/35302729" width="600" height="500" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen="allowfullscreen"></iframe>
<p>Thank you all from the Joomla Community and the Conference Organizers, it was a wonderful weekend of seeing friends, making new ones, inspiring and learning from a new community and I even got some time to explore the area which was also stunning.</p>
]]></content:encoded></item><item><title>DMS\\Filter v2.0</title><link>https://doh.ms/2014/04/21/dmsfilter-v2-0/</link><pubDate>Mon, 21 Apr 2014 00:00:00 -0300</pubDate><guid>https://doh.ms/2014/04/21/dmsfilter-v2-0/</guid><dc:language>en-US</dc:language><description>I have completed the release of the DMS\Filter Package, this includes:</description><content:encoded><![CDATA[<p>I have completed the release of the DMS\Filter Package, this includes:</p>
<ul>
<li>DMS Filter Library</li>
<li>DMS Filter Bundle, that integrates all filtering capabilities in Symfony.</li>
</ul>
<p>This release includes some new features and a huge overwrite of the filters.</p>
<h2 id="independent-repositories">Independent Repositories</h2>
<p>The first big change was a proper split of the repositories, before you had the option to go to the DMS repository where all the code would reside together, this gave me a huge overhead in management having to do sub-directory splits all the time and just slowing down releases as a whole.</p>
<p>Now the core library and the Bundle reside in their own repositories and issues are moved there. What does this mean to you? It just means you should report issues and follow releases in these new repositories.</p>
<ul>
<li><strong>DMS\Filter</strong> can be found at: <a
  href="https://github.com/rdohms/dms-filter"target="_blank" rel="noopener"
  >https://github.com/rdohms/dms-filter</a
></li>
<li><strong>DMSFilterBundle</strong> can be found at: <a
  href="https://github.com/rdohms/dms-filter-bundle"target="_blank" rel="noopener"
  >https://github.com/rdohms/dms-filter-bundle</a
></li>
</ul>
<h2 id="dmsfilter">DMS\Filter</h2>
<h3 id="rules-rewrite">Rules rewrite</h3>
<p>I&rsquo;m a big preacher of Object Calisthenics, you may have seen my <a
  href="http://protalk.me/your-code-sucks-lets-fix-it"target="_blank" rel="noopener"
  >talk</a
> around. And now of the OOP practices described by this is the SOLID acronym. The &ldquo;S&rdquo; stands for Single Responsibility, and as it happens my Rules were violating exactly that aspect of it, they were handling both the Annotation aspect of it, and the actual filtering of values. They are now split into two folders <code>Rules</code>, which holds the Annotations and their configuration settings, and <code>Filters</code> holds the classes that actually do filtering, and can even be used apart from the annotations.</p>
<p>This makes little difference to users, unless they were using the classes in a standalone way, but it also allows me more flexibility to provide annotations that work in providing other types of filters, as we will see in the Bundle. This brings a bit more quality to the code, I hope you all like it.</p>
<p>To import annotations, use:</p>
<p><code>use DMS\\Filter\Rules as Filter;</code></p>
<h3 id="new-filters-zend-and-callback">New Filters: Zend and Callback</h3>
<p>I have introduced two new filters into the fold. The Zend Filter allows you to refer to Zend Framework Filters directly form DMS\Filter, this means you can stick to using annotations and a single entry point to get all you filtering news, even if you have need of a Zend Filter. Below is an example of how to use it:</p>
<p><code>@Filter\Zend('Zend\Filter\HtmlEntities') // options may be passed as the second parameter</code></p>
<p>The Callback filter supports three types of input:</p>
<ul>
<li><code>string</code>: name of a method on this same object</li>
<li><code>array</code>: standard PHP call type: <code>{'classname', 'method name'}</code></li>
<li><code>closure</code>: a closure, which is not supported in case you are using annotations</li>
</ul>
<p>The callback filter gives you flexibility to create filters that depend on multiple properties of the object.</p>
<h2 id="dmsfilterbundle">DMSFilterBundle</h2>
<h3 id="new-filter-service">New Filter: Service</h3>
<p>A new filter is available using the Bundle in Symfony. The service filter allows you to identify a service/method to be called. This gives you the freedom to create your own filters, without having to create all the annotation support it would require. Just use this one annotation and point it to your new service. Below is an example of its usage, beware that you need to import a separate annotation namespace in order to use this filter.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">namespace</span> <span style="color:#a6e22e">App\\Entity</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Import Annotations use DMS\\Filter\\Rules as Filter;
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Import Symfony Rules use DMS\\Bundle\\FilterBundle\\Rule as SfFilter;
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">class</span> <span style="color:#a6e22e">User</span> { <span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Filter\\StripTags</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">SfFilter\\Service</span>(<span style="color:#a6e22e">service</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;dms.sample&#34;</span>, <span style="color:#a6e22e">method</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;filterIt&#34;</span>) <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#66d9ef">var</span> <span style="color:#a6e22e">string</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span> <span style="color:#66d9ef">public</span> $name; }
</span></span></code></pre></div><h3 id="integration-improvements">Integration Improvements</h3>
<p>The bundle was updated for newer versions of Symfony, as well as implementing proper support for cascade filtering. This means that if you forms use sub-forms which define child entities, these will also be filtered by the automatic form filter. This can also be disabled by setting the <code>cascade_filter</code> to <code>false</code>.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">TaskType</span> <span style="color:#66d9ef">extends</span> <span style="color:#a6e22e">AbstractType</span> { <span style="color:#75715e">// ... public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver-&gt;setDefaults(array( &#39;cascade\_filter&#39; =&gt; false, )); }
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ...
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><h3 id="bug-fixes">Bug fixes</h3>
<p>The bundle was not caching its annotation use, we have now fixed that and made use of the same strategy as Symfony uses internally, so you should see improvements if you were looking at this level.</p>
<h2 id="enjoy">Enjoy!</h2>
<p>I hope these new improvements give you a boost in filtering and open up new worlds of amazing possibilities. Not really. But I still hope it helps you. So go, update!</p>
]]></content:encoded></item><item><title>Using Git Hooks to delegate routine tasks</title><link>https://doh.ms/2013/11/15/using-git-hooks-to-delegate-routine-tasks/</link><pubDate>Fri, 15 Nov 2013 00:00:00 -0200</pubDate><guid>https://doh.ms/2013/11/15/using-git-hooks-to-delegate-routine-tasks/</guid><dc:language>en-US</dc:language><category>git</category><category>php</category><description>My team currently uses GitHub as the center of our development process, taking full advantage of Pull Requests and all that. That means we use git and our process is to always develop using feature-branches, making PRs for each feature and then merging them in after code review.</description><content:encoded><![CDATA[<p>My team currently uses GitHub as the center of our development process, taking full advantage of Pull Requests and all that. That means we use git and our process is to always develop using feature-branches, making PRs for each feature and then merging them in after code review.</p>
<p>This means we switch branches a lot, either to see someone&rsquo;s code and review it or to kickoff a new branch for a new feature. Over time this scenario seemed to happen a few times:</p>
<ul>
<li>Switch to master and pull in updates</li>
<li>Start working in a new feature in a new branch</li>
<li>Write something and run tests or view the site</li>
<li><strong>OMG!! everything is broken!</strong></li>
<li>turn to team: &ldquo;I&rsquo;m getting an error on the stuff you added, did you get it?&rdquo;</li>
<li>team says: &ldquo;No&rdquo;</li>
<li>me: &ldquo;ah dammit, did not pull in required dependencies&rdquo; or &ldquo;ah dammit, I did not regenerate assets&rdquo; (this may or not be preceded by hours of pointless debugging)</li>
</ul>
<p>Basically I keep forgetting that every time I switch branches I should get up-to-date dependencies and compile a new CSS to get all the latest shiny. So in order to make this automatic I decided to setup a git hook that did that for me.</p>
<h2 id="creating-a-git-hook">Creating a Git Hook</h2>
<p>Git has lots of <a
  href="https://www.kernel.org/pub/software/scm/git/docs/githooks.html"target="_blank" rel="noopener"
  >hook points</a
>, so just pick one that fits your flow. In my case I picked the <code>post-checkout</code> hook, since I want this to happen every time I switch to another branch.</p>
<p>To create a new hook, you need to create a file in the <code>.git/hooks</code> folder with the name of the hook you want to attach to, in my case <code>post-checkout</code>, make sure this file is executable and then code your hook in shell script format.</p>
<p><code>chmod +x .git/hooks/post-checkout</code></p>
<h2 id="writing-a-on-demand-hook">Writing a on-demand hook</h2>
<p>Sometimes you just flip between branches to check up on things and get some updated code, so you may not always need to run composer and install assets, so I also baked in a confirmation step to allow me to abort in case I&rsquo;m doing something else.</p>
<p>For now all I needed was to run Composer and generate my assets (less to css and such), so this is what I got:</p>
<pre tabindex="0"><code>#!/bin/bash
#

# Allows us to read user input below, assigns stdin to keyboard
exec &lt; /dev/tty

while true; do
    read -p &#34;Run Composer install and Assetic Dump? [Y/n]: &#34; yn
    case $yn in
        [Yy]* ) composer install; php app/console assetic:dump; break;;
        [Nn]* ) exit;;
        * ) echo &#34;Please answer yes or no.&#34;;;
    esac
done
</code></pre><h2 id="wrap-up">Wrap up</h2>
<p>Git Hooks are pretty cool, if your workflow is build around git like lots of team do nowadays the hooks are a cool place to tie in your day to day stuff that tends to be forgotten and generate unneeded debugging and such. Take a look at available hooks and think about your routine, I&rsquo;m pretty sure you will find something you can delegate out to git and stop worrying about it everyday.</p>
]]></content:encoded></item><item><title>Meetup API Client v1.0.0</title><link>https://doh.ms/2013/03/29/meetup-api-client-v1-0-0/</link><pubDate>Fri, 29 Mar 2013 00:00:00 -0300</pubDate><guid>https://doh.ms/2013/03/29/meetup-api-client-v1-0-0/</guid><dc:language>en-US</dc:language><description>I love APIs, but I honestly hate having to deal with signing, auth, and curl inside my controllers or services, which means I end up wrapping all of that into something that provides easy access in my controllers. I also love Meetup.com since it really makes managing User Groups …</description><content:encoded><![CDATA[<p>I love APIs, but I honestly hate having to deal with signing, auth, and curl inside my controllers or services, which means I end up wrapping all of that into something that provides easy access in my controllers. I also love <a
  href="http://www.meetup.com"target="_blank" rel="noopener"
  >Meetup.com</a
> since it really makes managing User Groups pretty cool, even with some bad UI choices, which is exactly where their API comes in, it allows me to provide a decent interface to their features from my own UG page and do all the communication via API.</p>
<p>I was curious about the <a
  href="http://guzzlephp.org/"target="_blank" rel="noopener"
  >Guzzle</a
> library and how many people mentioned it would make API wrapper so much simpler, so I decided to put all of those together and write my own wrapper that would have complete support for the API (other wrappers only had read-only).</p>
<p>It was a simple process, I prepared 2 basic clients to deal with the auth options available: key auth and OAuth. This was pretty simple with the use of Plugins and the existing OAuth plugin. Next up I tackled the operation definitions, for which i ended up with a screen scraper that would get me most of the information from the Meetup.com Docs, and tweak it from there.</p>
<p>Once the definitions were done I started testing out my use cases and realized that always having to read the &lsquo;results&rsquo; item of the response array was tiresome and led to useless code, so I wrote a few custom responses that allow me to directly iterate or access the data with array access and iterators. This proved to be useful and my use cases became much more simpler on the consumption side.</p>
<p>To this I also added a &lsquo;__call&rsquo; method that can call any operation and generated proper phpDoc for each method so that IDE&rsquo;s can easily provide autocomplete for this.</p>
<p>This is a sample of it in action:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>$client <span style="color:#f92672">=</span> <span style="color:#a6e22e">MeetupKeyAuthClient</span><span style="color:#f92672">::</span><span style="color:#a6e22e">factory</span>(<span style="color:#66d9ef">array</span>(<span style="color:#e6db74">&#39;key&#39;</span> <span style="color:#f92672">=&gt;</span> <span style="color:#e6db74">&#39;my-meetup-key&#39;</span>));
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Use our \_\_call method (auto-complete provided) $response = $client-&gt;getRSVPs(array(&#39;event\_id&#39; =&gt; &#39;the-event-id&#39;));
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">foreach</span> ($response <span style="color:#66d9ef">as</span> $responseItem) { <span style="color:#66d9ef">echo</span> $responseItem\[<span style="color:#e6db74">&#39;member&#39;</span><span style="color:#a6e22e">\</span>]<span style="color:#a6e22e">\</span>[<span style="color:#e6db74">&#39;name&#39;</span><span style="color:#a6e22e">\</span>] <span style="color:#f92672">.</span> <span style="color:#a6e22e">PHP\_EOL</span>; }
</span></span></code></pre></div><p>This has been very useful for AmsterdamPHP since we use the Meetup API heavily and I hope its also useful to more people using that API, installation is also pretty simple since it supports composer, and a Symfony Bundle is in the works. If you want more details go check out the <a
  href="https://github.com/rdohms/meetup-api-client"target="_blank" rel="noopener"
  >github repository</a
> and its README file. Or check it out on <a
  href="https://packagist.org/packages/dms/meetup-api-client"target="_blank" rel="noopener"
  >Packagist</a
>.</p>
]]></content:encoded></item><item><title>Of Creating User Groups and Physics</title><link>https://doh.ms/2013/02/14/of-creating-user-groups-and-physics/</link><pubDate>Thu, 14 Feb 2013 00:00:00 -0200</pubDate><guid>https://doh.ms/2013/02/14/of-creating-user-groups-and-physics/</guid><dc:language>en-US</dc:language><category>community</category><category>php</category><category>phparch</category><category>user-groups</category><description>Note: This article was originally published on the october/2011 issue of php-architect. If you like it keep a close eye on the Community Column in the magazine, where I get the chance to write alongside other awesome community people.</description><content:encoded><![CDATA[<p><em>Note: This article was originally published on the <a
  href="http://www.phparch.com/magazine/2011-2/october/"target="_blank" rel="noopener"
  >october/2011 issue of php-architect</a
>. If you like it keep a close eye on the Community Column in the magazine, where I get the chance to write alongside other awesome community people.</em></p>
<p>Vacuums are a very interesting part of physics. From the latin vacuum means “empty”, basically describing an empty space, which is very similar to what happens to an area where there is not a User Group present. Its empty, its PHP developers are looking for support and sharing their ideas in some other place, probably even neighboring user groups. This does not mean the talented people are not there, it really means that they are not taking full advantage of their potential and getting to know each other.</p>
<p>Some developers may notice this absence of “particles” and interaction between them in their local area, this may even cause them enough of an itch that it needs to be scratched, and thus a User Group starts forming. But how hard is it to start a group? Can anyone do it? what really am I going to have to do to get all these particles into my vacuum and end this “empty space” in my region?</p>
<p>Well that’s where a different characteristic of vacuums come in, suction. You probably remember this from school, vacuum containers are always trying to implode, the explanation is quite simple, a vacuum causes a lower pressure inside its container, and matter has a tendency to move into lower pressure areas trying to equalize the environment, this causes suction.</p>
<p>What does that mean for User Groups? Well the same applies, this vacuum of community activity causes a lower pressure environment and eventually it will start sucking in new contributors, new developer and generate more and more activity. As Kevin Costner said in that long ago movie “Build it and they will come”, that is very true for starting new communities, you just need to give the first few steps and very soon, you will not be walking alone anymore.</p>
<p>The firsts steps are always simple, your first objective should be to find developers in you area, give them a place to discuss, to get together. Its easier if you start this virtually, create a forum or a discussion list. Somewhere they can trade their ideas and get opinions. Of course just creating this is not enough, you need to make people aware of this list, its much like applying heat to particles. Back to school, do you remember what heat was to matter and how it spread? Let me remind you, its all about movement. Heat causes one molecule to start moving more then usual, which makes it bump into another which then bumps into another and pretty soon everyone is bouncing around like bumper cars in a circus.</p>
<p>The same principle will spread your virtual meeting place. Talk to one developer, your co-worker for example, tell him to tell his friends who are also developers. This will start the chain reaction, but don’t stop there, look for companies that have PHP developers, find them in job boards, talk to recruiters, just get the word out. As much as recruiters can be a pain, good recruiters will love to have a place to find out the names of new PHP developers, so they will actively broadcast your meeting place. After you have a lively group in your virtual meeting place, take it to real life, suggest a meeting at a pub, or if you got someone interested in speaking, host a talk at a local company.</p>
<p>One thing will lead to another, all the entropy and vacuum talk we did before will start applying, activity will start bringing in new contributors and before you know it, you have and active User Group in your hands. Even better, you are not alone, leaders from around the world are out there ready to give you ideas and help you kickoff new activities in your group. Come join the talk at <a
  href="https://wiki.php.net/usergroups"target="_blank" rel="noopener"
  >https://wiki.php.net/usergroups</a
>.</p>
<p>Also, this is not a one man job, count on your members at least one of them will have the “built of a leader”, bring him on board. As I said in my first column, we are not Leaders, we are just cat herders and temporary, we will come and go, but the group needs to stay. So share responsibility, look for partners and sponsors, recruiters can be very good partners, if they respect the limits imposed by you. Local companies will probably also be looking for talent, so taking the event to their headquarters is even better then handing them a resume or giving them a job board to advertise spots, all they need to do is open their door and pay attention, surely they will be glad to help.</p>
<p>These are all lessons I learnt from the past, I have actively participated in the creation of two User Groups and this is how it started. Every group will find its own sweet spot on how meetings are held and how its managed, I remember participating at the community panel at php|tek one year with my colleagues from this column and answering questions about each of our user groups and how they worked. I was really intrigued to see that each one had its own quirks, but all of them shared similar starts or building blocks. And it was during this panel that another batch of them started. This shows how much its important to share, especially with new groups. We do this very actively in Brazil where all the user group leaders are in a mailing list that we use to talk to each other and share ideas, possible sponsors, plans and tips.</p>
<p>So, do you think you are ready to start a User Group in your area? Wait, there is one already? Well awesome, are you there? Are you helping? Why not? Come join the fun, being in a user group and participating is a very good, professionally and personally, you are not just helping others, you are learning, teaching and expanding you set of tools. Come join us! .. oh and I promise, no more physics lessons!</p>
]]></content:encoded></item><item><title>Mimicking TravisCI with Jenkins</title><link>https://doh.ms/2013/02/06/mimicking-travisci-with-jenkins/</link><pubDate>Wed, 06 Feb 2013 00:00:00 -0200</pubDate><guid>https://doh.ms/2013/02/06/mimicking-travisci-with-jenkins/</guid><dc:language>en-US</dc:language><description>We are all awaiting the day when all of us can get TravisCI Pro and get all of that testing goodness into our private repositories right? And by that I mean, having our PRs annotated with build status, running automated tests and such.</description><content:encoded><![CDATA[<p>We are all awaiting the day when all of us can get <a
  href="http://beta.travis-ci.com/"target="_blank" rel="noopener"
  >TravisCI Pro</a
> and get all of that testing goodness into our private repositories right? And by that I mean, having our PRs annotated with build status, running automated tests and such.</p>
<p>Well, there is a work around to it, if you use Jenkins as your CI server. We have now set this up on our private repositories and it works like a charm!</p>
<p><strong>Setting up Jenkins to annotate PRs</strong></p>
<p>Considering you already have a setup of Jenkins that works with GitHub repositories but does builds based on watching master, this is what you need to get going with annotating PRs:</p>
<ol>
<li>Upgrade Jenkins to v1.500+</li>
<li>Install the <a
  href="https://wiki.jenkins-ci.org/display/JENKINS/GitHub&#43;pull&#43;request&#43;builder&#43;plugin"target="_blank" rel="noopener"
  >GitHub pull request builder plugin</a
></li>
<li>Follow the setup steps detailed on that page.
<ul>
<li>Admins and whitelist users should be placed <strong>one per line</strong>.</li>
<li>In global settings: you can leave Access Token blank</li>
<li>Your &ldquo;bot&rdquo; user <strong>must have pull/push permissions</strong></li>
</ul>
</li>
<li>Sit back and watch PR annotation goodness</li>
<li>I do recommend that you make this a simple build: unit tests and coding standard checks only, you want this to be quick, so I also turn off code coverage analysis.</li>
</ol>
<p>This is what shows up on our PRs:</p>
<p><a
  href="http://blog.doh.ms/wp-content/uploads/Screen-Shot-2013-02-06-at-10.40.51-.png"target="_blank" rel="noopener"
  >





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        

        
        
        
          
        
        
        
        
        
        
        


        
        


        <picture>
          <source
            
              srcset="/images/blog/Screen-Shot-2013-02-06-at-10.40.51-_hu_63aa37b3ce254a62.webp"
            
            media="(max-width: 575px)" />
          <source
            
              srcset="/images/blog/Screen-Shot-2013-02-06-at-10.40.51-_hu_8bd527d770336cd9.webp"
            
            media="(max-width: 767px)" />
          <source
            
              srcset="/images/blog/Screen-Shot-2013-02-06-at-10.40.51-_hu_5cdb9287a4ffe36c.webp"
            
            media="(max-width: 991px)" />
          <source
            
              srcset="/images/blog/Screen-Shot-2013-02-06-at-10.40.51-_hu_f54173a6552bec5b.webp"
             />
          <img
            
              loading="lazy" decoding="async"
              src="/images/blog/Screen-Shot-2013-02-06-at-10.40.51-_hu_47d26598c6835a12.png"
            
            
            class=" rounded img"
            alt="Build Status by Jenkins"
            width="815"
            height="98" />
        </picture>
      
      
    
    
  


  

</a
></p>
<p>You can also use comments to trigger re-builds, or allow builds on non-whitelist uses.</p>
]]></content:encoded></item><item><title>We are all PHP Evangelists</title><link>https://doh.ms/2013/01/04/we-are-all-php-evangelists/</link><pubDate>Fri, 04 Jan 2013 00:00:00 -0200</pubDate><guid>https://doh.ms/2013/01/04/we-are-all-php-evangelists/</guid><dc:language>en-US</dc:language><category>community</category><category>php</category><category>phparch</category><description>Note: This article was originally published on the april/2012 issue of php-architect. If you like it subscribe to the magazine and keep a close eye on the Community Column in the magazine, where I get the chance to write alongside other awesome community people.</description><content:encoded><![CDATA[<p><em>Note: This article was originally published on the <a
  href="http://www.phparch.com/magazine/2012-2/april/"target="_blank" rel="noopener"
  >april/2012 issue of php-architect</a
>. If you like it subscribe to the magazine and keep a close eye on the Community Column in the magazine, where I get the chance to write alongside other awesome community people.</em></p>
<p>There is a lot more to being part of this great community we call the PHP community than just learning, sharing and contributing. There is much to be said about our role in expanding PHP&rsquo;s reach into companies, markets and everywhere else. Every PHP Developer is at core a PHP evangelist, someone who is ready to raise the PHP flag and defend it. This does not mean your answer to everything is PHP, as a true evangelist you know the strengths and shortcomings of your own language, and when to just say &ldquo;don&rsquo;t use it&rdquo;, but you are also ready to defend it and prove its worthiness when its misjudged or just plainly misunderstood.</p>
<p>The PHP community in Brazil was once &ldquo;called to arms&rdquo; after a potentially catastrophic event, I would like to tell you this tale of unity, if you can spare me a few words.</p>
<p>Brazil&rsquo;s biggest TV and media network has a lunchtime newscast which usually has some editorial pieces nearing the end. Last year they had a editorial on security, trying to demystify the &ldquo;World Network of Computers&rdquo; to the common folk. A honorable effort, teaching people about common attacks like phishing scams, and the likes. Usually they bring in an expert on the topic to do the &ldquo;for dummies&rdquo; translation, this time was no different. While explaining phishing scams the expert was giving a few tips on how to identify emails that are not really sent from their bank, this is the point when everything went bad. Both network and expert can be blamed equally but after editing was done a loose phrase came out, while pointing to a link he said: &ldquo;&hellip; and if it ends in .php its usually a virus&rdquo;.</p>
<p>The sentence in itself is not totally wrong, there are indeed many ill-intended websites developed in PHP, but given the context and the audience this had all the elements of trouble. Here was this expert on TV saying that every site that ends in .php is probably a phishing website or a virus. You can imagine how many mothers out there now thought their dear sons were virus developers, but all kidding aside, this was very bad for the overall image of PHP, especially in a market where .NET and Java still have a big hold of corporations. I was not watching the live broadcast, but it was all over twitter instantly, as well as in video on the news company website.</p>
<p>I felt i needed to do something, so after a few tweets correcting the sentence and pinging the expert and the news company I also put up a detailed blog post to try and explain PHP and the misunderstanding, trying to do &ldquo;damage control&rdquo;. This blog post along with the #phpvirus hashtag (this could have been done better) quickly made the trending topics in Brazil with the sheer support of the community looking out for its &ldquo;dear language&rdquo;. A few hours later we had the first signs that the news agency had understood the problem, removing the wrong parts of the article and removing the video. To me this was already a victory, we had moved enough people to be heard by a major news company and had at least stopped propagation of the error.</p>
<p>We were then taken completely by surprise the very next day, when at the same time slot the agency put up a &ldquo;mea culpa&rdquo;, explaining the mistake and what PHP was. It had actually worked, we had made a giant organization feel enough pressure to look into the mistake and correct it. I was very happy with the outcome, but I was even more amazed at the movement behind it, so many developers acting towards a common goal and actually coming out victorious.</p>
<p>So why the tale? Well this is what being a PHP Developer is to me, its more then just being a member, its like a family. And like any family you need to be there for the bad and the good, and watch out for each other. That means you must really embrace the language, learn about it. The outcome is positive in many ways, at the very least you will become a better developer. Every boss wants to have a developer who knows the twists and turns of the language, how to overcome problems or just plain when to avoid them. Its very easy to know all this about PHP when you involve yourself in it.</p>
<p>Everyone is very accessible around here, you can talk to a core developer or a framework leader just as you speak to your co-worker, its all very open and welcoming. Ok, there are bad moments, but they are still far surpassed by the great moments. Talk to these people, understand why the language is what it is today, how it came to grow in that direction. Note that you do not need to agree with it, but knowledge is power and its gonna make a difference in your professional life.</p>
<p>Most of us veteran developers have seen more then one PHP bashing go around the internet, its almost like a cycle. And yes, PHP does have flaws, some things could be better, but there are reasons behind it, and knowing those reasons is as important as knowing its functions. PHP is &ldquo;a ball of nails&rdquo;, as Terry Chay once put it, but that does not mean you should swing it at every problem. That is part of your role, to tell people when to choose PHP and when to just walk away from it. We are all mature developers and that means owning up to a few problems and choices. We are the ones that drive PHP adoption and best practices, not the language, the community.</p>
<p>So, if I may do a &ldquo;call for action&rdquo;, get out there, participate, chat, learn and start making a difference, you career will thank you and so will all of us. Let&rsquo;s take PHP further, teach people about it, make our code better, and one day we will be collecting the &ldquo;rewards&rdquo; for this.</p>
<p>Go. Share and Learn.</p>
]]></content:encoded></item><item><title>Being an Enabler</title><link>https://doh.ms/2012/12/19/being-an-enabler/</link><pubDate>Wed, 19 Dec 2012 00:00:00 -0200</pubDate><guid>https://doh.ms/2012/12/19/being-an-enabler/</guid><dc:language>en-US</dc:language><category>amsterdamphp</category><category>community</category><category>enablers</category><category>php</category><description>When you look around at user groups you will notice that many groups have “leaders” or “managers”, this is usually the person who started the group and is not really calling the shots, but usually is giving direction to the group. This is an usual model and it works pretty well …</description><content:encoded><![CDATA[<p>When you look around at user groups you will notice that many groups have &ldquo;leaders&rdquo; or &ldquo;managers&rdquo;, this is usually the person who started the group and is not really calling the shots, but usually is giving direction to the group. This is an usual model and it works pretty well in most cases, however I have ran into situations where this causes some misconceptions.</p>
<p>The first misconception is that the &ldquo;leader&rdquo; is calling the shots. This usually comes along with the &ldquo;manager/leader&rdquo; title, its what people expect when you are in this position. Mostly its not the case, the leader is only helping things along, and usually doing them, but not really &ldquo;giving orders&rdquo;. Another misconception, at least in some cultures, is that the leader wants to get all the credit and do some self-promotion. Yes, I have seen this happen and its a shame, working with the community has that effect of promoting the people who are doing something. That actually goes for anything, if you are making things happen, you are in the spotlight, its not a goal but a consequence. Whatever the case is, no, leaders do not want to be the center of attention.</p>
<p>This was discussed in our PHPSP UG and we tried to think of different structures to get past these issues, some ideas came and went but I also left and moved to Amsterdam. As it happens my community-drive did not stop and I started to feel that old itch, and ended up causing the start of <a
  href="http://amsterdamphp.nl"target="_blank" rel="noopener"
  >AmsterdamPHP</a
>. As is usually the case I did not do that alone, I merely gathered a number of interested people and helped them find the first steps. While thinking about how to get this started i recalled a article i wrote about a year ago where I used the term &ldquo;Enablers&rdquo; to describe us leaders. That&rsquo;s when it hit me, I&rsquo;m not a leader or manager, I&rsquo;m an enabler. I found people interested in working with the community and basically removed obstructions from their path, I &ldquo;enabled&rdquo; them to get a group going.</p>
<p>So we do not have leaders, we just have a group of enablers, people who want to help, or do, or have great ideas or contacts, and that seems to be a great title and description for what we are doing. It removes those misconceptions and it opens space for anyone to be an enabler, all the time, some of the time, whenever they want. It still gives credit where credit is due and it allows the people who deserve to help the group find a direction do exactly that. I have really come to love the title and all the &ldquo;meaning&rdquo; it holds, maybe it even takes the pressure off the usual labels and let&rsquo;s us focus on breaking down barriers.</p>
<p>The community is already awesome and it is ready to do great things, it only needs that push, or for someone to tell them to turn left at the traffic light and go for it. And that is something I love doing, finding potential and directing it, using the resources I have to either get people what they need, or introducing them to people who can do that, and the beauty is we can do that anywhere, we just need to be ready to listen and pay attention to those pools of potential.</p>
<p>Does this sound like you? <strong>Then let&rsquo;s go be enablers.</strong></p>
]]></content:encoded></item><item><title>The DMSTwigExtensionBundle</title><link>https://doh.ms/2012/11/30/the-dmstwigextensionbundle/</link><pubDate>Fri, 30 Nov 2012 00:00:00 -0200</pubDate><guid>https://doh.ms/2012/11/30/the-dmstwigextensionbundle/</guid><dc:language>en-US</dc:language><category>bundle</category><category>php</category><category>symfony</category><category>twig</category><description>When I started using Symfony one of the aspects that really caught my eye was Twig, it really got me back into using a template engine and I don’t think i can ever go back to mixing my HTML and PHP again.</description><content:encoded><![CDATA[<p>When I started using Symfony one of the aspects that really caught my eye was Twig, it really got me back into using a template engine and I don’t think i can ever go back to mixing my HTML and PHP again.</p>
<p>Twig’s extensibility is also something truly awesome and powerful when developing for Symfony, it allows me to easily whip up an extension that get information from the right place in the right way without having to pollute the controller with excessive interactions, or quickly provide a filter to hammer data into the format I need it to be in.</p>
<p>So I created the <a
  href="https://github.com/rdohms/DMSTwigExtensionBundle"target="_blank" rel="noopener"
  >DMSTwigExtensionBundle</a
> to do two things: hold my custom extensions that I use in various projects and enable other extensions, like the non-core extensions written by Fabien Potencier.</p>
<p>Fabien distributes a few extensions which he deemed should not be in core, but are very useful, these are in his own <a
  href="https://github.com/fabpot/Twig-extensions"target="_blank" rel="noopener"
  >repository</a
> and they do thinks like: truncate text, wordwrap, localized date formatting, amongst other things.</p>
<p>I usually have these enabled in my projects, but that means that every time I need to add the composer dependency and then pick one of my bundles to add the service calls with the “twig.extension” tag, which is a pain and out of place. With this bundle I can just drop it in and it will create all of those for me and even give me the option of turning them on or off via configuration, all in one single place.</p>
<p>As time goes i’ll be adding more useful extensions, either that I find or create myself, hopefully making it easy for you to just drop it into your project and start using them, but leaving it flexible enough that you can easily switch them on or off individually.</p>
<p>So check out the Repository at: <a
  href="https://github.com/rdohms/DMSTwigExtensionBundle"target="_blank" rel="noopener"
  >https://github.com/rdohms/DMSTwigExtensionBundle</a
> Remember to open issues at the main DMS repository: <a
  href="https://github.com/rdohms/DMS"target="_blank" rel="noopener"
  >https://github.com/rdohms/DMS</a
></p>
<p>If you want to use it, just drop it into your composer file, more instructions in the README.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> { &#34;require&#34;: { &#34;dms/twig-extension-bundle&#34;: &#34;1.\*&#34; } }
</span></span></code></pre></div>]]></content:encoded></item><item><title>Slapping some Varnish on WordPress</title><link>https://doh.ms/2012/10/15/slapping-some-varnish-on-wordpress/</link><pubDate>Mon, 15 Oct 2012 00:00:00 -0300</pubDate><guid>https://doh.ms/2012/10/15/slapping-some-varnish-on-wordpress/</guid><dc:language>en-US</dc:language><description>So last week I published my review of PHPNW12 and instantly my whole server went down in flames. My current WP setup has a few issues with multi-lingual plugins which I can’t get over yet, as it requires a bit more of invested time. But this can’t go on, I needed a solution, a …</description><content:encoded><![CDATA[<p>So last week I published my review of PHPNW12 and instantly my whole server went down in flames. My current WP setup has a few issues with multi-lingual plugins which I can’t get over yet, as it requires a bit more of invested time. But this can’t go on, I needed a solution, a fast and simple one to give my blog a fighting chance.</p>
<p>As it stood I already had caching, but i’m guessing that was not enough or decently handled, so I gave a shout out to <strong><a
  href="http://twitter.com/thijsferyn"target="_blank" rel="noopener"
  >@thijsferyn</a
></strong> to see if putting up Varnish would be a simple enough task. This is BTW one of the reasons I dedicate so much time to helping and growing the community, because when I tread into new waters like this, I can call on smart people who are always willing to lend me a hand. It was no different with Thijs and by the next day I had a recommended setup to try and get Varnish up.</p>
<h2 id="varnish--wp--servergrove">Varnish + WP + ServerGrove</h2>
<p>My server is a 1Gb VPS with Servergrove and it runs 3 blogs and a personal website, all smallish with the occasional peak access, so I went on to get things up. Thijs had recommended running Apache on 8080 and leaving Varnish on port 80, but Servergrove is still working on alternative port configuration in their dashboard and they quickly got back to me with the suggestion of putting Apache to listen to localhost on 80 and leaving varnish to handle outside requests. This change was pretty simple I just had to tell Apache to listen to that and change my <em>vhosts</em>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> NameVirtualHost 127.0.0.1:80 Listen 127.0.0.1:80
</span></span></code></pre></div><p>Problem solved. Now to get varnish. Thijs pointed me to some easy to follow tutorials for each common OS: <a
  href="https://www.varnish-cache.org/installation/ubuntu"target="_blank" rel="noopener"
  >Ubuntu</a
>, <a
  href="https://www.varnish-cache.org/installation/debian"target="_blank" rel="noopener"
  >Debian</a
>, <a
  href="https://www.varnish-cache.org/installation/redhat"target="_blank" rel="noopener"
  >Redhat or CentOS</a
>.</p>
<p>Once that was done, I needed to do was configure the basic setup, so I basically had to edit <code>/etc/default/varnish</code> to listen to external requests on port 80:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> DAEMON\_OPTS=&#34;-a &lt;external-ip&gt;:80 \\ -T localhost:6082 \\ -f /etc/varnish/default.vcl \\ -S /etc/varnish/secret \\ -s malloc,256m&#34;
</span></span></code></pre></div><p>This is enough to get Varnish listening and do the trick, but now the important part is to get the right VCL configuration so that you don’t run into troubles with your admin pages, cookies being ignored and so forth. If you want more details on the out-of-the-box setup, go see Thijs’ <a
  href="https://speakerdeck.com/u/thijsferyn/p/varnish-in-action-phpnw12"target="_blank" rel="noopener"
  >Vanish in Action slides</a
>. So next step, the vcl: I had a gist from Thijs to get is sorted, but I had to make a few changes to it to get it just right, but in general its very straight forward, the main highlights are:</p>
<ul>
<li>It ignores admin pages</li>
<li>It ignores logged users</li>
<li>It allows purges from WP</li>
<li>It adds a HIT/MISS header you can track to see if its being effective.</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> backend default { .host = &#34;127.0.0.1&#34;; .port = &#34;80&#34;; } acl purge { &#34;localhost&#34;; &#34;&lt;external-ip&gt;&#34;; } sub vcl\_recv {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>\# Allow purging if(req.request == &#34;PURGE&#34;){ if(!client.ip ~ purge){ error 405 &#34;Purging not allowed.&#34;; } return(lookup); }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>\# Always cache the following file types for all users. if ( req.url ~ &#34;(?i)\\.(png|gif|jpeg|jpg|ico|swf|css|js|html|htm)(\\?\[a-z0-9\]+)?$&#34; ) { unset req.http.cookie; }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>\# Don&#39;t serve cached pages to logged in users if ( req.http.cookie ~ &#34;wordpress\_logged\_in&#34; || req.url ~ &#34;vaultpress=true&#34; ) { return( pass ); }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>\# Drop any cookies sent to WordPress. if ( ! ( req.url ~ &#34;wp-(login|admin)&#34; ) ) { unset req.http.cookie; }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>\# Handle compression correctly. Different browsers send different # &#34;Accept-Encoding&#34; headers, even though they mostly all support the same # compression mechanisms. By consolidating these compression headers into # a consistent format, we can reduce the size of the cache and get more hits. # @see: http://varnish.projects.linpro.no/wiki/FAQ/Compression if ( req.http.Accept-Encoding ) {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>if ( req.http.Accept-Encoding ~ &#34;gzip&#34; ) { # If the browser supports it, we&#39;ll use gzip. set req.http.Accept-Encoding = &#34;gzip&#34;; }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>else if ( req.http.Accept-Encoding ~ &#34;deflate&#34; ) { # Next, try deflate if it is supported. set req.http.Accept-Encoding = &#34;deflate&#34;; }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>else { # Unknown algorithm. Remove it and send unencoded. unset req.http.Accept-Encoding; }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sub vcl\_fetch {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>\# Allow items to be stale if needed. set beresp.grace = 2m;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>\# Drop any cookies WordPress tries to send back to the client. if ( ! req.url ~ &#34;wp-(login|admin)&#34; &amp;&amp; ! req.http.cookie ~ &#34;wordpress\_logged\_in&#34; ) { unset beresp.http.set-cookie; }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sub vcl\_miss { if(req.request == &#34;PURGE&#34;){ purge; error 200 &#34;Purged&#34;; } }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sub vcl\_hit { if(req.request == &#34;PURGE&#34;){ purge; error 200 &#34;Purged&#34;; } }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sub vcl\_deliver { if(obj.hits &gt; 0) { set resp.http.X-Varnish-Cache = &#34;HIT (&#34;+obj.hits+&#34;)&#34;; } else { set resp.http.X-Varnish-Cache = &#34;MISS&#34;; } }
</span></span></code></pre></div><p>That was pretty much it. It was then a matter of restarting the services, getting rid of WP cookies so it would not ignore me and asking people to hit the blog up, which showed me a nicely growing hit count on the HIT header and a significant lack of stress on the server. As an extra resource, check this <a
  href="http://ocaoimh.ie/2011/08/09/speed-up-wordpress-with-apache-and-varnish/"target="_blank" rel="noopener"
  >post</a
> it has some nice information and configuration settings.</p>
<p>Hopefully the result will be that when I release this post, I will not get lots of replies of my blog being down, but rather Varnish will take care of all of you. The PHP community is truly a remarkable one and it never ceases to amaze me how much we are willing to do for each other and lend a helping hand, so thank you Thijs for the leads.</p>
<p>Also, if you are looking for VPS hosting, I can recommend two services for you: <a
  href="http://www.combell.com/en"target="_blank" rel="noopener"
  >Combell</a
> employers of Thijs and <a
  href="http://www.servergrove.com"target="_blank" rel="noopener"
  >Servergrove</a
> current hosters of this blog.</p>
]]></content:encoded></item><item><title>PHPNW12 - One Conference, so much good stuff</title><link>https://doh.ms/2012/10/10/phpnw12-one-conference-so-much-good-stuff/</link><pubDate>Wed, 10 Oct 2012 00:00:00 -0300</pubDate><guid>https://doh.ms/2012/10/10/phpnw12-one-conference-so-much-good-stuff/</guid><dc:language>en-US</dc:language><description>This year I spent more time replying “I don’t know yet” to people who were asking if I was going to PHPNW12 then I did submitting to conferences. I think 75% of all the prominent members of the European Community told me at one point or another that i simply could not miss this …</description><content:encoded><![CDATA[<p>This year I spent more time replying &ldquo;I don&rsquo;t know yet&rdquo; to people who were asking if I was going to <a
  href="http://conference.phpnw.org.uk/phpnw12/"target="_blank" rel="noopener"
  >PHPNW12</a
> then I did submitting to conferences. I think 75% of all the prominent members of the European Community told me at one point or another that i simply could not miss this conference. After stalling everyone for a while until I sorted out other problems i finally decided (yes, on the week before the conference) that I should go and got budget approval from my employers.</p>
<p>The Conference crew showed just how awesome they are right there, after me doing the &ldquo;I suck at reading text&rdquo; dance, they were more then prestative to reach out to me and point to me that I had actually failed to get a conference ticket and had only gotten a tutorials ticket so that I could fix the situation. That is called pro-activity and taking care of our own. They also helped me sort this out as I continued to cause trouble. After we got everything sorted out, with the help of the #php_bnl channel crew also, I got my flights sorted and aligned so that I would fly in with <a
  href="https://twitter.com/skoop"target="_blank" rel="noopener"
  >@skoop</a
> and <a
  href="https://twitter.com/Michelle_Sanver"target="_blank" rel="noopener"
  >geekie</a
>. Out little airport adventure I can tell you personally sometime, but lets say I finally heard my name being said in the airport speakers.</p>
<p>After being received at the airport by the awesome <a
  href="https://twitter.com/miss_jwo"target="_blank" rel="noopener"
  >@miss_jwo</a
>, and having the chance to &ldquo;pilot&rdquo; the BBQ at her place at night I got ready for tutorials and the conference. Over the next three days followed an incredible amount of laughs, learning, meeting new people and just general conference awesomeness. The talks were all great, from tutorials to regular sessions and I even got a chance to throw out my &ldquo;Composer for Busy Developers&rdquo; talk in the UnCon, great times. The conference also provided multiple opportunities to contribute to projects in official and ad-hoc Hackathons, and I finally got started with some contributions to <a
  href="http://protalk.me"target="_blank" rel="noopener"
  >ProTalk</a
>.</p>
<p>The socials and in general the time I spent talking to old friends, new people and PHP developers in general were all great. Community conferences are usually great at this, giving us space to talk, hack, discuss, plan and just generally have fun. PHPNW was a great example of this and the space was very well used for it. Sure there were hiccups, some room size issues and a complete crash of the internet during the hackathon, but those are small close to the passion and dedication shown by the crew and volunteers.</p>
<p>I need to stop and mention these people, they are a key part of this. The PHPNW crew were simply awesome at their job, taking care of problems, reacting fast to them and fixing them whenever possible. When you can say one of your volunteers spent 14 hours in a car picking up speakers from the airport, you can say that you took care of you speakers, really well. I was not a speaker, but I didn&rsquo;t feel that for a second, I was very well treated by everyone, and especially <a
  href="https://twitter.com/miss_jwo"target="_blank" rel="noopener"
  >@miss_jwo</a
> and Andy who had me over for BBQ. Congratulations to everyone, you make this conference have the reputation it has.</p>
<p>If you want to know how the technical content was, go check <a
  href="https://joind.in/event/view/986"target="_blank" rel="noopener"
  >Joind.in</a
>, its full of thumbs up. I was particularly impressed by a few talks: The keynote, making us think about our &ldquo;developer&rdquo; users when designing our APIs (code and web), <a
  href="https://twitter.com/ianbarber"target="_blank" rel="noopener"
  >Ian Barber</a
>&rsquo;s great talk on Building a Firehose, it just blew my mind and how BBC built their new Responsive Website. My list of talks I still need to see is huge, and since they will all be out in video, i will be watching them.</p>
<p>So if you are anywhere near the UK and want to learn, grow, meet great developers, have fun and be a better developer, then PHPNW is the place to be in the first weeks of October, trust me, keep an eye out for <a
  href="http://conference.phpnw.org.uk/"target="_blank" rel="noopener"
  >PHPNW13</a
>.</p>
]]></content:encoded></item><item><title>Deploying a Symfony2 and Composer app on PagodaBox</title><link>https://doh.ms/2012/04/16/deploying-a-symfony2-and-composer-app-on-pagodabox/</link><pubDate>Mon, 16 Apr 2012 00:00:00 -0300</pubDate><guid>https://doh.ms/2012/04/16/deploying-a-symfony2-and-composer-app-on-pagodabox/</guid><dc:language>en-US</dc:language><category>composerphp</category><category>orchestra</category><category>paas-2</category><category>pagodabox</category><category>php</category><category>symfony</category><description>I have been working on a little pet project and wanted to put it up somewhere to show to a few people how it was going. I wanted something really simple so I decided to give the PHP PaaS solutions a try. Its a very simple Symfony 2.1 based app using Composer for vendor …</description><content:encoded><![CDATA[<p>I have been working on a little pet project and wanted to put it up somewhere to show to a few people how it was going. I wanted something really simple so I decided to give the PHP PaaS solutions a try. Its a very simple Symfony 2.1 based app using Composer for vendor management, so I went on a quest to see what could be done and how.</p>
<p>I have always liked Orchestra, especially because I know the whole crew, but I was left stranded on how I could run the composer commands I needed after deploy. The feature was not done <strong>yet</strong>, so I moved onto Pagoda Box, thinking I was going to hit the same wall. I was pleasantly surprised that there was a solution and decided to give it a try.</p>
<p>It was mostly painless, but a few quirks kept me up late chatting with their excellent and very friendly support staff. So I decided to write up a few line about it.</p>
<h2 id="boxfile">Boxfile</h2>
<p>The Boxfile defines all the config for your app and that’s where the magic happens. This is basically the extent of changes you need to make to your application.</p>
<h3 id="basic-configuration">Basic configuration</h3>
<p>Some of the configuration is straight forward, so let’s get them out of the way. Be sure to adjust between app and app_dev accordingly.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> web1: name: mysf2site document\_root: web default\_gateway: app.php index\_list: \[app.php\] php\_version: 5.3.8
</span></span></code></pre></div><h3 id="writable-directories">Writable directories</h3>
<p>As soon as you deploy a Symfony app you remember that you need to make the cache and logs folders writable or you will get a very nice blowup in your face. Pagoda let’s you do this but there is a couple thing you should know.</p>
<p><strong>The writable directories configuration is meant for directories your “Web” role will write into.</strong> This means uploads, caching and related events, its does not relate to build steps. During the “build” step of your application (this is when you run Composer), everything is writable, so you don’t need to make your <em>vendor</em> folder writable for example.</p>
<p><strong>Writable folders are emptied after initial deploy.</strong> This means if you decide to make your <em>app</em> folder writable because you have the crazy idea that it will be needed for bootstrap.php.cache, your deploy will give you a nice big empty <em>app</em> directory. So remember to only use this config for the folders that need it. <strong>Update:</strong> The nice folks at Pagoda explained to me that the &ldquo;empty folder&rdquo; effect is only after initial deploy, subsequent deploys don&rsquo;t empty the directories for obvious reasons (i.e. you can use this for uploads).</p>
<p>This is what it should look like:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> shared\\\_writable\\\_dirs: - app/cache - app/logs
</span></span></code></pre></div><h3 id="extensions">Extensions</h3>
<p>So it might be a good idea to make sure all the extensions are there, this is very easy, and this is the list i came up with:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> php\_extensions: - intl - mbstring - xsl - apc - mysql - pdo\_mysql - zip
</span></span></code></pre></div><p>Notice <strong>zip</strong>, this is very important as Composer depends on this extension or falls back onto <em>unzip</em>, which is not a valid executable in a Pagoda server. The rest is standard Symfony stuff and personal choices.</p>
<h3 id="the-configuration-and-database">The Configuration and Database</h3>
<p>Personally I like to keep my parameters.yml file out of my repositories, to this was a challenge here, how do I create or copy in this configuration or how do i keep my config out of there.</p>
<p>Getting values into the system was a very nice <a
  href="http://help.pagodabox.com/customer/portal/articles/175128-symfony2"target="_blank" rel="noopener"
  >suggestion</a
> on the Pagoda Help site. Using ENV variables you can inject this straight into the Symfony2 parameters.yml file, so i setup my database stuff for now with: SYMFONY__DATABASE__NAME which becomes %database.name% in the yml file. Rinse and repeat for all DB variables and create these in the Dashboard with the proper values.</p>
<p>But I still needed to write the parameters.yml file to the system, and that’s where afer_build comes in. I needed to write multiple lines, so i cheated and went for a few <strong>echo</strong> calls.</p>
<p><strong>Update:</strong> It appears you do not even need to have a parameters.yml file, you can go straight from ENV to Symfony as <a
  href="https://twitter.com/#!/igorwesome"target="_blank" rel="noopener"
  >@igorwesome</a
> pointed out to me and <a
  href="http://symfony.com/doc/current/cookbook/configuration/external_parameters.html"target="_blank" rel="noopener"
  >this article</a
></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>&lt;/pre&gt; after\_build: - &#34;echo &#39;parameters:&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; database\_driver: pdo\_mysql&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; database\_host: %database.host%&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; database\_port: 3306&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; database\_name: %database.name%&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; database\_user: %database.user%&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; database\_password: %database.password%&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; mailer\_transport: smtp&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; mailer\_host: localhost&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; mailer\_user: ~&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; mailer\_password: ~&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; locale: en&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;echo &#39; secret: \[secret\]&#39; &gt;&gt; app/config/parameters.yml&#34; - &#34;php bin/composer.phar install&#34; &lt;pre&gt;
</span></span></code></pre></div><p>This is also where you call Composer and let it do its thing on your vendors. I had also added my doctrine call here to generate and update my DB schema, but that proved to be a failure.</p>
<p><strong>The Database is not available during the after_build step.</strong> Looking back this is kind of obvious as stuff only goes live after its built and ready. Luckily they also offer the before_deploy step, so this is where you want your doctrine calls to go.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span> before\_deploy: - &#34;php app/console doctrine:schema:update --force&#34;
</span></span></code></pre></div><h2 id="conclusion">Conclusion</h2>
<p>After playing around with those settings and learning the quirks about the steps and the writable directories it was smooth sailing and the app came up nice and clean as expected.</p>
<p>I must say that the Pagoda Box Support crew was really nice during my trials and errors and really helped me get over the problems. Hopefully this will give you a little heads up if you attempt the same thing. Enjoy!</p>
]]></content:encoded></item><item><title>The IDEs of March</title><link>https://doh.ms/2012/03/15/the-ides-of-march/</link><pubDate>Thu, 15 Mar 2012 00:00:00 -0300</pubDate><guid>https://doh.ms/2012/03/15/the-ides-of-march/</guid><dc:language>en-US</dc:language><category>code</category><category>ide</category><category>ideasofmarch</category><category>php</category><category>phpstorm</category><description>Last Year, Chris Shiflett started the “Ideas of March” movement, and Jon Tangerine quickly coined the “Ides of March” twist and some people followed him. This year, here we are again and while reading my twitter feed I saw Cal Evans’ post with Jon Tangerine’s line. Of course it …</description><content:encoded><![CDATA[<p>Last Year, Chris Shiflett started the <a
  href="http://shiflett.org/blog/2012/mar/ideas-of-march"target="_blank" rel="noopener"
  >“Ideas of March”</a
> movement, and Jon Tangerine quickly coined the <a
  href="http://jontangerine.com/log/2011/03/ides-of-march"target="_blank" rel="noopener"
  >“Ides of March”</a
> twist and some people followed him. This year, here we are again and while reading my twitter feed I saw Cal Evans’ post with Jon Tangerine’s line. Of course it was early and I read “IDEs”. Since last year I defended the Ideas of March with why you should blog, and I still believe the reasons stand, this year I’ll just make my own twist and talk about IDEs. Yes, its a shameless sorry attempt at a joke.</p>
<p><em><strong>“My IDEs of March is <a
  href="http://www.jetbrains.com/phpstorm/"target="_blank" rel="noopener"
  >PHPStorm</a
>” —</strong></em> @rdohms</p>
<p>This year I decided that NetBeans was just too heavy and when it started getting lost in my Symfony projects I decided it was time to shop around again. I asked a few people what their choice IDE was and then got into testing them. I wanted a full fledged IDE, I still use TextMate on the side for quick editing and for some HTML stuff, but I wanted the full deal: auto complete, debugging, profiling … .</p>
<p>A huge group of people suggested PHPStorm, which is a paid IDE and that had turned me off the first time I saw it. This time I decided to go deeper and try it out, after all my IDE had gone completely bananas, so i gave it a full work day which i ended up spending more time tweaking then coding. I tweaked a bit of colors, settings and such and by the second day it actually felt very comfortable to work with, and most important faster and lighter then my previous IDEs.</p>
<p><a
  href="http://blog.doh.ms/wp-content/uploads/Settings.jpg"target="_blank" rel="noopener"
  >





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        
        
        
        
        
        


        
        


        <img
          
            src="/images/blog/Settings-225x300_hu_2180238eeed98d39.webp" loading="lazy"
            decoding="async" alt=""
          
          
          class=" rounded img"
          width="225"
          height="300"
          onerror="this.onerror='null';this.src='\/images\/blog\/Settings-225x300.jpg';" />
      
      
    
    
  


  

</a
></p>
<p>I had a few problems, sure, they were fixed in the next release, I decided to try out the Early Access version and was blown away. Day after day it felt more comfortable. A few tweaks to shortcuts, and I started looking at other features. And then, i fell in love. To sum up a few nice things:</p>
<ul>
<li>Inspections: a series of inspections that can validate, code, phpDoc and little things like unused vars. The nice twist is it can generate a search-result like report, letting you go fix stuff file by file.</li>
<li>PHPUnit coverage plugin: this is cool, this plugin reads a clover.xml report and highlights the actual files in the IDE for code coverage. It also does that natively in the new version, but you must run tests inside the IDE.</li>
<li>Test folder highlight: you can tag test folders and test files have a slight color in the tabs, actually handy.</li>
<li>Support got {@inheritDoc}</li>
</ul>
<p>Those are a few topics, but it really feels nice, has not freaked out on me yet, cleans up memory use pretty well and is just fast and responsive. The company behind it is awesome as well, they are willing to give free licenses to OpenSource developers, which is a plus in my book.</p>
<p>So, take this March the 15th and make it your IDEs of March day, and try out a new IDE.</p>
]]></content:encoded></item><item><title>Book Review: The Art of Readable Code</title><link>https://doh.ms/2012/02/27/book-review-art-of-readable-code/</link><pubDate>Mon, 27 Feb 2012 00:00:00 -0300</pubDate><guid>https://doh.ms/2012/02/27/book-review-art-of-readable-code/</guid><dc:language>en-US</dc:language><category>php</category><category>readable-code</category><description>Lately I have been very involved with code quality, not just in terms of testing and actually working, but also on a deeper level, readability and plain good architecture. At my previous employer we had been working for a good while already applying rules from “Object …</description><content:encoded><![CDATA[<p>Lately I have been very involved with code quality, not just in terms of testing and actually working, but also on a deeper level, readability and plain good architecture. At my previous employer we had been working for a good while already applying rules from “Object Calisthenics” a concept by Jeff Bay, a simple set of exercises that helped identify bad code and improvements points. Once I saw this book show up at O’Reilly I did not blink and made a purchase.</p>
<p>“The Art of Readable Code” was written by Dustin Bowell and Trevor Foucher and basically focuses on concepts and suggestions to make you code not just readable, but comprehendible by other developers, or as the author’s suggest, yourself in six months. Code readability is a topic that I truly believe the PHP community does not focus enough on and i really wanted a look at this book to see what kind of ideas it had and what I could do my best to bring to the attention of other developers.</p>
<p>The book does not focus on any one language and has examples from PHP, Python, Java, Javascript, C and C++, which is great. But the concepts are presented in a very verbose and conversational form so that the pieces of code really play a small part and it does not matter if you do or do not know any of these languages, any developer should be able to pick it up. The book goes from variable naming, to commenting, to refactoring and even into transforming ideas into code and testing, it really does a great job of describing various developer downfalls. I even picked up a few tips and added them to my talks about refactoring and writing better code, its will surely be on the recommendation page at the end.</p>
<p>After reading this book you will look at you code a little different, I can assure you. I agree with most of what’s on the book (except part of the test chapter) and i really believe more developers should see these points and work on them. So if you write code, pick up this book, its a very light read and very pleasant one as well. It kept me good company on the trams to and from work, and even walking, that’s how easy going it is. So go get it, read it, learn from it and make your code better.</p>
<p><strong><a
  href="http://blog.doh.ms/wp-content/uploads/8677004.jpg"target="_blank" rel="noopener"
  >





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        
        
        
        
        
        


        
        


        <img
          
            src="/images/blog/8677004-228x300_hu_9a871d59564470b9.webp" loading="lazy"
            decoding="async" alt=""
          
          
          class=" rounded img"
          width="228"
          height="300"
          onerror="this.onerror='null';this.src='\/images\/blog\/8677004-228x300.jpg';" />
      
      
    
    
  


  

</a
>The Art of Readable Code</strong> <em>Simple and Practical Techniques for Writing Better Code</em> By Dustin Boswell, Trevor Foucher Publisher: O’Reilly Media Released: November 2011 Pages: 204 Print ISBN:978-0-596-80229-5 | ISBN 10:0-596-80229-3 Ebook ISBN:978-1-4493-1417-0 | ISBN 10:1-4493-1417-1 <a
  href="http://goo.gl/oZJKf"target="_blank" rel="noopener"
  >Buy it on Amazon</a
></p>
]]></content:encoded></item><item><title>PHP Community: Of Leaders, conferences and Union</title><link>https://doh.ms/2012/02/24/php-community-of-leaders-conferences-and-union/</link><pubDate>Fri, 24 Feb 2012 00:00:00 -0200</pubDate><guid>https://doh.ms/2012/02/24/php-community-of-leaders-conferences-and-union/</guid><dc:language>en-US</dc:language><category>community</category><category>php</category><category>phpbc</category><category>phpconfbr</category><category>phpsp</category><description>Note: This article was originally published on the march/2011 issue of php-architect. If you like it keep a close eye on the Community Column in the magazine, where i get the chance to write alongside other awesome community people.</description><content:encoded><![CDATA[<p><em>Note: This article was originally published on the <a
  href="http://www.phparch.com/magazine/2011-2/march/"target="_blank" rel="noopener"
  >march/2011 issue of php-architect</a
>. If you like it keep a close eye on the Community Column in the magazine, where i get the chance to write alongside other awesome community people.</em></p>
<p><em><strong>&ldquo;Our function as community leaders is to enable people to be the best they can in the community that they have chosen to be part of.&rdquo;</strong> -- Jono Bacon</em></p>
<p>This quote comes from Jono Bacon&rsquo;s book: &ldquo;<a
  href="http://blog.doh.ms/2010/08/11/review-the-art-of-community-jono-bacon/"target="_blank" rel="noopener"
  >The Art of Community</a
>&rdquo;, and I like it because it puts somethings in perspective. Communities are a interesting manifestation of human social skills, a truly incredible joining of people by a single motivation, in our case the motivation is PHP, be it helping, learning, self-promotion, work or any more of a wide gamma of roads that lead to getting in touch with this great force. Community leaders are even more intriguing species, people who try to lead and organize this controlled chaos, and they don&rsquo;t even get paid for it.</p>
<p>But as Jono puts it, the Community leader is really not a leader, someone on top of the stage with all the flood lights on him. The leader is a catalyst, that spark that can lead to a forest fire, ok not the best reference, but you get the point. Leaders are there to inspire people, give them the initial push and then literally get out of their way and let them go where their inspiration and self-drive takes them, as Jono says, an &ldquo;enabler&rdquo;.</p>
<p>Its very interesting to observe Communities, their manifestations and their growth. They seem to have life of their own, to grow, mature and expand as a group in this kind of biological process, leaders are always present, but they are a cyclic occurrence, old ones move on, new ones take over and yet the community keeps going. I have been observing communities for a long while, here in Brazil and a few overseas also, thanks to opportunities from all the major conferences that help all of us &ldquo;community geeks&rdquo; get together and start brainstorming, sort of like this column.</p>
<p>Our community seems to have started somewhere in 2006, the first User Group showed up with what was, back then, this crazy idea to hold a national PHP Conference. They started small with a few local events in São Paulo. By the time the conference came around there was this great sense of awareness that we were not alone. I quickly made the wise choice to gather a few savings and get myself a ticket over. It was truly an incredible experience for me, my first PHP Conference, this incredible feeling of being in a place with so many other people speaking the same language, same topics and understanding when I started talking about frameworks, mvc patterns and how to deal with heavy traffic. See, back then I was a one-man team and had barely started using mailing lists, that conference was an eye opener, it showed me that I was naught but a mere beginner in this great career of a PHP Developer. It showed me there was this incredible source out there, one you could tap into and get this amazing collection of knowledge. I stood there watching all of those speakers talk about these incredible things, sharing all of this information, an overdrive of ideas and inspiration.</p>
<p>By the end of the conference I had one clear though: &ldquo;I need to learn, and I want to share, next year I want to be a speaker&rdquo;. That moment changed my life professionally and that conscious decision to be part of this &ldquo;community&rdquo; has been paid back in much more then triple. As history goes that year along with two great friends (<a
  href="https://twitter.com/#!/adlermedrado"target="_blank" rel="noopener"
  >Adler Medrado</a
> and Pablo Sanchez) we founded our first User Group, PHPDF on Brazil&rsquo;s capital. And we were not alone, that single conference put so many ideas in so many heads that User Groups started popping up all over the country. The PHP community in Brazil started taking shape, we started to see that we were not quite the &ldquo;few and scattered&rdquo; group we believed, we were huge and ready to move to new heights.</p>
<p>Fast forward to 2010. Brazil has over 21 User Groups, almost one in every single state, from the amazon to the atlantic forest and going through all our huge metropoles. That national conference is now just the crowning conference at the end of the year, numerous other smaller conference are held during the year, producing new ideas and more and more groups every year, not to mention launching new speakers and bringing great members of the worldwide community to com inspire our masses. One of the side effects of this reunions is something I like to talk about to every community leader that gives me a chance to talk about community.</p>
<p>Its called <strong>PHP Brazil Communities</strong> (<a
  href="http://www.php.org.br"target="_blank" rel="noopener"
  >PHPBC</a
>). Its not a User Group, its just a simple idea, a communication channel. Building and maintaining a UG has a few distinct challenges, mostly the same for every group, save for a few exceptions. After all we are <em>&ldquo;enablers&rdquo;</em> right? Its what needs to be done, take down obstacles and let the community be their awesome selves. PHPBC unites all of our community &ldquo;enablers&rdquo; under one roof and gives them an opportunity to talk, to ask questions, to listen and to be inspired, its enablers enabling enablers. The result was beyond any expectation we had, a constant growth of members, meetings, activities and new User Groups. Everyone shared: this is how we solved problem X, this is company Y who can give you a place for meetings, this is event format Z that can work with that goal. It turns out that collectively solving problems is very productive, who could guess? The great momentum and huge mass also made it easy for us to reach out to companies, to get support and to become a pool of talent for the job marketplace. Union was our solution and our catalyst, it helped new groups be born, it helped old groups come back and it helped new leaders take the place of other leaders.</p>
<p>If you would like to take anything away from this article with you, take this: Being a community leader or a community member remember that there is great strength in numbers, as a developer there is this great source of untapped knowledge, this insane problem solving bio-computer that you can reach out to and get answers, tips and ideas from. As a leader this great union can push you to become a better &ldquo;enabler&rdquo;, to push the limits of your community and grow, solve problems and mature.</p>
<p>If you are a leader, <strong>come join us</strong> on the UG Admins list at: <a
  href="http://phpgroups.org/"target="_blank" rel="noopener"
  >http://phpgroups.org/</a
>. If you are not in a User Group, <strong>go find the closest one</strong> to you and let the professional growth start.</p>
]]></content:encoded></item><item><title>DMS\\Filter Library 1.0.1 and Bundle</title><link>https://doh.ms/2012/02/02/dmsfilter-library-1-0-1-and-bundle/</link><pubDate>Thu, 02 Feb 2012 00:00:00 -0200</pubDate><guid>https://doh.ms/2012/02/02/dmsfilter-library-1-0-1-and-bundle/</guid><dc:language>en-US</dc:language><description>The past weeks I finally had some time to invest in the DMS library again, so i got busy with a few things. I also had to fix a big problem which had gone unnoticed to me, so i have to thank Mr. Guilherme Blanco for pointing it out.</description><content:encoded><![CDATA[<p>The past weeks I finally had some time to invest in the DMS library again, so i got busy with a few things. I also had to fix a big problem which had gone unnoticed to me, so i have to thank <a
  href="https://twitter.com/#!/guilhermeblanco"target="_blank" rel="noopener"
  >Mr. Guilherme Blanco</a
> for pointing it out.</p>
<p>Sadly this means a BC break, so please follow and make adjustments.</p>
<h3 id="the-bc-break--filter-becomes--filterentity">The BC break: -&gt;filter() becomes -&gt;filterEntity()</h3>
<p>The reasoning here is simple, PHP still supports legacy from PHP4 meaning a function with the same name as the class is understood as a constructor. This generates a few nasty notices, and it made enough sense to rename the function, making it clear like the other ones.</p>
<h3 id="the-dmsfilterbundle">The DMSFilterBundle</h3>
<p>Along with this i had time to work on building a Bundle so you can plug filtering into Symfony 2 just as you would with validation.</p>
<h3 id="composer-support">Composer support</h3>
<p>This bundle is also available on Packagist, making it easy to install, i&rsquo;ll also add the DMS and Filter library as standalones to this soon.</p>
<h3 id="tags">Tags</h3>
<p>I finally tagged the releases as <em>1.0</em>, or rather <em>1.0.1</em> as i quickly found a few fixes to put in.</p>
<p>The rest remains, here are the links:</p>
<p><strong>DMS Library:</strong> <a
  href="https://github.com/rdohms/DMS"target="_blank" rel="noopener"
  >github</a
></p>
<p><strong>DMS Filter Library (sub-tree split):</strong> <a
  href="https://github.com/rdohms/DMS-Filter"target="_blank" rel="noopener"
  >github</a
></p>
<p><strong>DMS Filter Bundle (sub-tree split):</strong> <a
  href="https://github.com/rdohms/DMSFilterBundle"target="_blank" rel="noopener"
  >github</a
> | <a
  href="http://packagist.org/packages/dms/dms-filter-bundle"target="_blank" rel="noopener"
  >packagist/composer</a
> | <a
  href="http://knpbundles.com/rdohms/DMSFilterBundle"target="_blank" rel="noopener"
  >knpbundles page</a
> (please recommend it if you like it)</p>
]]></content:encoded></item><item><title>PHP Benelux 2012 - Learning lessons</title><link>https://doh.ms/2012/01/31/php-benelux-2012-learning-lessons/</link><pubDate>Tue, 31 Jan 2012 00:00:00 -0200</pubDate><guid>https://doh.ms/2012/01/31/php-benelux-2012-learning-lessons/</guid><dc:language>en-US</dc:language><category>conference</category><category>php</category><category>phpbenelux</category><category>phpbnl12</category><category>tips</category><description>After hearing about how great PHP Benelux Conferences were I finally made it over to Belgium to check it out, and i was impressed. To catch you up on the new, I moved to Amsterdam last december and thus had the chance of attending the conference which is now 2 hours away on a …</description><content:encoded><![CDATA[<p>After hearing about how great <a
  href="http://phpbenelux.eu/"target="_blank" rel="noopener"
  >PHP Benelux</a
> Conferences were I finally made it over to Belgium to check it out, and i was impressed. To catch you up on the new, I <a
  href="http://blog.doh.ms/2011/11/08/back-to-the-old-continent/"target="_blank" rel="noopener"
  >moved to Amsterdam</a
> last december and thus had the chance of attending the conference which is now 2 hours away on a train ride.</p>
<p>I could not expect less of a wonderful conference when names like <a
  href="https://twitter.com/#!/dragonbe"target="_blank" rel="noopener"
  >Michelangelo van Dam</a
> are involved and this was no exception. Its a community conference, planned and organized by community leaders and for community members, this is what makes it so amazing that even without a big name behind it this conference can put up quite a show and bring so many sponsors. As I sat there watching the closing remarks I realized other User Groups and conferences have lots of lessons to pickup from this conference. Let me name a few:</p>
<p><strong>1. Value your sponsors.</strong> This was very well executed, during the whole event the sponsors had their logos all over the place and the ones who were present had plenty one on one time with conference attendees. Finally during closing remarks each one was mentioned and with a touch of genius their contributions were described, talk about being thankful.</p>
<p><strong>2. Value your speakers.</strong> Who would not want to be a speaker at a conference where you get free belgian beer and chocolates at the end? I know i would, and i&rsquo;m not even a beer drinker. The amount of care put into the speakers is legendary, pickups, great hotel and i can only imagine what else I did not see myself as a non-speaker.</p>
<p><strong>3. Value your attendees.</strong> This should be easy, but lots of conferences fail at it. Good sessions, good venue, good food and infrastructure, just make your client feel confortable. Don&rsquo;t make him <em>want</em>, make everything available to him <em>at the venue</em> and keep him around for more networking and fun.</p>
<p><strong>4. Awesome socials are awesome.</strong> The social events around a conference are the crowning jewel to the experience, it allows for much more networking and just plain fun and bonding. This is great for speakers and attendees alike, and is usually the moment where great projects take shape. There is a lot to learn from a chat with <a
  href="https://twitter.com/#!/ianbarber"target="_blank" rel="noopener"
  >Ian Barber</a
> about public speaking, he even put it in <a
  href="http://phpir.com/presentation-tips-from-benelux"target="_blank" rel="noopener"
  >writing</a
>. And there was so much more.</p>
<p><strong>5. Make your attendees pay.</strong> Yeah, I said pay. Many conferences think that being &ldquo;open source&rdquo; means having a free conference, I say &ldquo;ppfffff&rdquo;. Charge a reasonable &ldquo;I&rsquo;m a beginner developer with low income&rdquo;-price and put up a great conference using that money, and people will pay. If they do not pay their employers will, if neither of them does, the problem is bigger. Surely the people who will be leaving the conference better then they came in will be willing to pay. This also adds value to the conference, makes it an investment.</p>
<p><strong>6. Value the organizers and your volunteers.</strong> There was no single-man effort in the conference, they (from what i saw) worked together like a very well oiled machine. Many times did i see all organizers united discussing something and no man was left trying to solve everything alone. Expand your group, get more people, get volunteer and be sure to thank them, give them their &ldquo;dues&rdquo;, they will give you their all.</p>
<p><strong>7. Have Fun!</strong> Events are always stressful, but you would never guess this from seeing the PHP Benelux crew at work. They just had fun with it, enjoyed, worked, solved solvable problems and apologized for unsolvable ones, what more do we need?</p>
<p>There are probably more lessons to be learnt here, it was a very well executed event, with great speakers, great guests. Coming from Brazil to such a rich network of PHP events is very exciting for me, I love events and now i have multiple large events all around me.</p>
<p>In Belgium I got to see great friends, make new ones, ans most of all realize that it will not be a year before I see them again (yay!). I also picked up quite a few topics to research more and study, as well as being inspired to kickoff new projects and old ideas, the keynotes really did an awesome job to get us inspired.</p>
<p>You can be sure to find me around PHP Benelux 2013, I will be putting out my best to be either a speaker or an attendee, but I&rsquo;ll be there for sure. Congratulations PHP Benelux Crew, it was a wonderful show and a great experience.</p>
]]></content:encoded></item><item><title>Back to the Old Continent</title><link>https://doh.ms/2011/11/08/back-to-the-old-continent/</link><pubDate>Tue, 08 Nov 2011 00:00:00 -0200</pubDate><guid>https://doh.ms/2011/11/08/back-to-the-old-continent/</guid><dc:language>en-US</dc:language><description>“Your life begins where your comfort zone ends” (@elizabethN’s mother)</description><content:encoded><![CDATA[<p><em>&ldquo;Your life begins where your comfort zone ends&rdquo; (<a
  href="http://twitter.com/#!/ElizabethN/status/131029849417592832"target="_blank" rel="noopener"
  >@elizabethN&rsquo;s mother</a
>)</em></p>
<p>My time at <a
  href="http://www.mihswat.com/"target="_blank" rel="noopener"
  >SWAT</a
>ends just shy of four years, and I can truly say it has been the biggest, most wonderful and most amazing professional experience of my life. I joined swat as a small user group manager and I am leaving as an international speaker, OSS contributor and manager of a awesome user group.Time has knocked on my door, I&rsquo;m no longer 20 and time is not waiting around for me, so its time to kick my life&rsquo;s plan back into gear and proceed to the next steps. Working for SWAT with such incredible and inspiring people, enabled me to reach a very comfortable point in my career, to expand my network over the borders of Brazil, getting to know so many awesome people, literally from the US all the way around to the Philippines.</p>
<p>I was given a chance to challenge myself and follow in the lines of SWAT&rsquo;s CEO, <a
  href="http://twitter.com/#!/gustible"target="_blank" rel="noopener"
  >Jacques van Niekerk</a
>, an amazing leader who inspired me to always express myself when my area of expertise was the topic. And many other amazing co-workers, experienced in so many fields. My direct team in the Brazil office with experts minds in PHP, Architecture and UX kept me on my toes and I&rsquo;m very grateful for working with all these professionals.But <a
  href="http://twitter.com/#!/ElizabethN"target="_blank" rel="noopener"
  >@ElizabethN</a
>&rsquo;s mom had it right from the beginning and I have decided its time to seek new challenges, become a small fish in a bigger pond once again and learn from so many other great minds out there. Brazil has a huge and wonderful PHP community, which I watched and helped grow over these years, but so much is happening outside and I want to immerse myself in these &ldquo;new waters&rdquo; to take that next professional step.</p>
<p>As of the end of this year, I will be taking my place at <a
  href="http://www.webclusive.com/"target="_blank" rel="noopener"
  >WEBclusive</a
> in Amsterdam, The Netherlands. This is a huge and exciting step for me and my wife, but one that comes after much pondering and at a very good time, moving to outside of Brazil was a old plan of ours and Europe is the right place at the right time. Both a culturally amazing region and also a florishing PHP community with so many conferences and the epicenter of the latest developments in frameworks and the language.</p>
<p>I hope to be able to reach out and talk to so many of my European development buddies and hang out much more often with them and my US friends as well, for sure i will be bothering names like <a
  href="http://twitter.com/Skoop"target="_blank" rel="noopener"
  >@skoop</a
>, <a
  href="http://twitter.com/DragonBe"target="_blank" rel="noopener"
  >@dragonbe</a
>, <a
  href="http://twitter.com/lornajane"target="_blank" rel="noopener"
  >@lornajane</a
>, <a
  href="http://twitter.com/derickr"target="_blank" rel="noopener"
  >@derickr</a
>, <a
  href="http://twitter.com/akrabat"target="_blank" rel="noopener"
  >@akrabat</a
> and <a
  href="http://twitter.com/#!/davidcoallier"target="_blank" rel="noopener"
  >@davidcoallier</a
> much more now, and that&rsquo;s just to name a few.</p>
<p>Thank you SWAT team for these awesome years, and thank you to the Brazilian PHP Community, we have grown so much over the last years, I&rsquo;m very proud of the work done by so many people, I can only hope this work keeps going and that I can help as much as possible from the outside.</p>
<p><em>Note: Why &ldquo;back to the old continent&rdquo;? Little known fact is that i&rsquo;m a german citizen (by right not birth) and lived there for 3 years in my childhood.</em></p>
]]></content:encoded></item><item><title>De volta ao Velho Continente</title><link>https://doh.ms/2011/11/08/de-volta-ao-velho-continente/</link><pubDate>Tue, 08 Nov 2011 00:00:00 -0200</pubDate><guid>https://doh.ms/2011/11/08/de-volta-ao-velho-continente/</guid><dc:language>pt-BR</dc:language><category>amsterdam</category><category>mudanca</category><category>php</category><category>swat</category><description>“Your life begins where your comfort zone ends” (@elizabethN’s mother)</description><content:encoded><![CDATA[<p><em>&ldquo;Your life begins where your comfort zone ends&rdquo; (<a
  href="http://twitter.com/#!/ElizabethN/status/131029849417592832"target="_blank" rel="noopener"
  >@elizabethN&rsquo;s mother</a
>)</em></p>
<p>Próximo de completar 4 anos trabalhando na <a
  href="http://www.mihswat.com/"target="_blank" rel="noopener"
  >SWAT</a
>minha jornada chega a um final. Neste tempo posso garantir que esta foi a melhor e mais incrível experiência profissional que já tive. Comecei a trabalhar na SWAT como um líder de um pequeno grupo e usuários e saio como um palestrante internacional, contribuidor de projetos Open Source e lider de um incrível grupo de usuários.Chegou a hora de mudança, os anos estão se acumulando sobre mim e esta na hora de botar o meu plano de vida de volta nos trilhos. Neste tempo da SWAT as oportunidade que me foram oferecidas me permitiram expandir minha rede de contatos desde os EUA até as Filipinas.</p>
<p>Tive a oportunidade de trabalhar com pessoas incríveis durante meu tempo na SWAT, e aprender com pessoas como o CEO da SWAT, Jacques van Niekerk. Dentro e fora do trabalho conheci pessoas de todas comunidades como a galera da WebCo e as incriveis cabeças do time SWAT Brasil, que me mantiveram acordado e aprendendo.Ao final deste ano, assumo uma nova posição na WEBClusive em Amsterdam, Holanda. Vai ser uma mudança radical, mas uma que eu e minha esposa planejamos e pensamos cuidadosamente antes de decidir. Muito tempo atrás eu e minha esposa decidimos que iríamos passar um tempo fora do Brasil, aproveitar novas culturas, viajar, aprender e expandir nossas vidas profissionais e pessoais, e agora a oportunidade bateu na porta. Este é um momento para mim profissionalmente, de voltar a ser um peixe pequeno e um grande lago, e aprender de novos grandes profissionais. Aproveitar o momento do PHP na Europa onde grandes mudanças do PHP e dos Frameworks estão começando.</p>
<p>Além disso tenho a oportunidade de encontrar e interagir mais com meus colegas da Europa e EUA, aproveitar esta rede de contatos que construi nestes anos. Eu agradeço muito a todos com quem interagi neste tempo em São Paulo, a SWAT pelos incríveis anos de trabalho e a Comunidade PHP do Brasil, que vi crescer e pude contribuir com este crescimento, e é hoje uma comunidade de respeito muito bem conhecida fora do país.</p>
<p>Aos que interessar estarei vendendo muita coisa para a mudança, fiquem de olho por aqui e no meu twitter para novidades. Farei de novembro e inicio de Dezembro meu mês de despedidas, então fique de olho nisso também.</p>
<p><em>Nota: Porque &ldquo;de volta ao velho continente&rdquo;? Fato pouco conhecido, sou cidadão Alemão (por direito não nascimento) e morei 3 anos durante minha infância na Alemanha.</em></p>
]]></content:encoded></item><item><title>Como escrever artigos técnicos (melhores) em 10 passos</title><link>https://doh.ms/2011/09/27/como-escrever-artigos-tecnicos-melhores-em-10-passos/</link><pubDate>Tue, 27 Sep 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/09/27/como-escrever-artigos-tecnicos-melhores-em-10-passos/</guid><dc:language>pt-BR</dc:language><category>dicas</category><category>escrevendo-artigos</category><category>php</category><description>Blogs. A internet nos últimos anos tem visto o crescimento disparado destes sites, desde o desenvolvedor que escreve no finais de semana até o colunista que ganha para fazer isso. E não é por menos, eles são sim uma ótima ferramenta para divulgar seu trabalho e agregar valor ao …</description><content:encoded><![CDATA[<p>Blogs. A internet nos últimos anos tem visto o crescimento disparado destes sites, desde o desenvolvedor que escreve no finais de semana até o colunista que ganha para fazer isso. E não é por menos, eles são sim uma ótima ferramenta para divulgar seu trabalho e agregar valor ao seu nome no mercado, porém apenas se utilizado de forma correta. Vou me restringir obviamente a falar de blogs sobre tecnologia e desenvolvimento, embora outras áreas tenham muitas historias de sucesso desta plataforma também. Eu realmente não saberia como comentar por exemplo o mercado de esmaltes e como escrever artigos sobre eles.</p>
<p>Recentemente tenho esbarrado com alguns artigos que me deixam na dúvida se seus autores realmente entendem o que é o papel de um blog e de artigos técnicos, ou se o foco deles seria menos honrado e apenas uma forma de atrair mais visitas. Sim, falo do que já conhecemos hoje na internet como ‘flame-baits’ ou seja, iscas para discussões (negativas). São geralmente posts polêmicos, sem embasamento, movidos por uma opinião pessoal e carregados de termos clichê e piadinhas. Menos mal se estes posts fossem apenas ferramentas de autores de blogs pessoais, muito pior quando aparecem em grandes “veículos” de comunicação ou sites especializados.</p>
<p>Dois exemplos me passaram pelo browser recentemente, um artigo gringo sobre PHP x Python, cujo embasamento completo era um tirinha XKCD, um pato e um pedaço de código ilegível. O segundo, brazuca, intitulado <a
  href="http://imasters.com.br/artigo/21865/php/phpog-uma-questao-de-design"target="_blank" rel="noopener"
  >PHPog, uma questão de design</a
>, publicado recentemente na iMasters. O grande centro do artigo é uma comparação entre PHP OO e Java OO, como as coisas deveriam ser feitas no PHP, e a grande reação dos leitores foi a de que certas coisas no PHP são diferentes e isso não é negativo (tem mais, mas vamos resumir assim). O questionamento é válido, e as discussões sobre a implementação de OO do PHP também, porém o artigo vai além disso, usando temos como o POG (programação orientada a gambiarras) para descrever a implementação e outras formas pejorativas de tratar a linguagem e seus programadores.</p>
<p>Neste ponto mora o problema. Ao agredir a linguagem com piadinhas o resultado esperado pelo post não é mais uma discussão séria sobre o assunto, e sim atrair milhares de fãs sedentos por sangue para defender sua linguagem e retribuir palavras não carinhosas ao autor do artigo. Este foi exatamente o resultado de ambos artigos, sim eles tiveram muitas visitas, sim tiveram muitos comentários, mas isso realmente é bom? Compare 1000 visitas de xiitas revoltados com 200 visitas de pessoas querendo mostrar um ponto de vista diferente sobre um assunto, com qual você aprenderá mais? E a imagem de sua empresa/sua pessoa, como ela vai ficar após esse barulho todo? Pra mim os resultados de ambos artigos poderiam ser muito mais instrutivo, foco na discussões técnicas e menos barulho de “extremistas” e “ativistas” além de exaltarem a imagem dos sites envolvidos por iniciarem discussões de alto nível.</p>
<p>Por isso, uso este meu espaço para ponderar sobre o assunto, e tentar mostrar minha opinião sobre o que seria um artigo técnico bem escrito.</p>
<h2 id="como-escrever-artigos-técnicos-melhores">Como escrever artigos técnicos melhores?</h2>
<p><strong>1. Evite usar tirinhas cômicas.</strong> Sim é divertido, e vai “quebrar o gelo”, mas se você precisa quebrar algum gelo, repense suas intenções com o artigo, elas podem já estar erradas.</p>
<p><strong>2. Fuja de palavras polemicas e pejorativas.</strong> Evite usar termos como o POG citado acima, se o artigo fosse chamado “Aplicando Design Patterns usando PHP: qual a melhor forma?” a discussão final teria se focado muito mais em discutir as implementações de OO do PHP do que comentários como “Como se POG existisse só no PHP”, ou “&lt; ?php print “Calma galera” ?&gt;” e até “Nunca vi tanta ignorância incorporada em um único texto.”. Você pode discordar da linguagem e de como algo foi implementado, deve!, porém faça isso com o devido respeito e seriedade.</p>
<p><strong>3. Expresse sua opinião, mas deixe isso claro.</strong> Cal Evans uma vez falou que um desenvolvedor só pode ser considerado Sênior, se o mesmo souber se expressar, ou seja, escrever artigos e mostrar seu trabalho e seu raciocínio através disso. Porém ele deve saber também defender suas ideias e mais importante ainda, saber quando admitir o erro. Lembre-se disso, sempre ˜haverá opiniões contrárias, as vezes todas corretas em sua forma, mas as vezes você realmente estará errado, saiba aceitar isso. Atualize o post se for o caso.</p>
<p><strong>4. Pesquise. Estude. Pesquise. Escreva.</strong> Mesmo que sempre que você for falar de um assunto o artigo não passe de sua interpretação sobre o mesmo, é sempre uma boa ideia se precaver. Portanto pesquise muito sobre o assunto, procure opiniões contrárias e analise de outros pontos de vista. Caso esteja aberto a admitir o erro depois lembre-se das regras acima, elas irão potencializar uma resposta positiva e o aprendizado.</p>
<p><strong>5. Referências == credibilidade.</strong> Se o que você quer explicar se baseia em algum material que leu, faça sempre referências ao material, aponte de onde ele veio, isso trará para o seu conteúdo mais relevância e agregará os argumentos do outro autor aos seus.</p>
<p><strong>6. Quantidade não significa Qualidade.</strong> Ter 1001 visitas não significa que seu artigo é bom, ou ruim. Artigos polêmicos, ou sem embasamento e agressivos acabam atraindo muitas visitas, pessoas que querem ver pra acreditar, ou deixar um comentário agressivo. Se o seu objetivo é ter muitas visitas isso realmente funciona, porém qual foi a impressão que as pessoas tiveram de você ao sair de lá? Agora um artigo que deveria divulgar seu trabalho e te projetar como profissional, acabou de mudar a opinião de pessoas para não mais te considerar para uma possível vaga.</p>
<p><strong>7. Não critique, compare. Respeite.</strong> Muitas vezes vejo artigos escritos apenas para debochar ou ridicularizar algo, ou a forma como alguém fez algo. Quer fazer algo construtivo? Faça uma comparação sobre como o artigo foi escrito e como ele poderia ser escrito, talvez até de umas dicas de como melhorar. Além de tudo, respeite o profissional que escreveu ou criou aquilo que é alvo de seu artigo, nem todos concordamos em tudo, mas isso não é motivo para chacota e desrespeito.</p>
<p><strong>8. Exemplos práticos.</strong> Nem todo tema é passível de um exemplo prático, mas em se falar de tecnologia e desenvolvimento isso geralmente é possível, então faça! Anexe um código, aponte um repositório, um diagrama de classes ou um ERM. Ilustre seu artigo com exemplos e gráficos, a leitura fica mais agradável e coerente.</p>
<p><strong>9. Começo, meio e fim.</strong> Pense e planeje seu artigo. Todo artigo tem um objetivo. Para chegar nele o artigo precisa de um começo ou uma introdução, um meio ou o desenvolvimento do tema, e um fim, a conclusão. Isso se aplica a todos artigos, mas também vale pra artigos técnicos. Por exemplo: Descreva o problema que vai resolver, mostre como resolver e conclua se foi ou não uma boa escolha. Garanto que se o seu artigo passa 5 parágrafos contanto a historia do John Armless e no final não explica onde ele se encaixa no tema nem porque, seus leitores vão ficar confusos, e indignados.</p>
<p><strong>10. Don’t be a douchebag.</strong> Eu gosto desta frase em inglês por ela ser a forma mais ofensiva sem ser ofensiva de se dizer, não seja um chato. Acalme o ego, baixe a crista, seja sério e respeitoso, receba comentários bem, mesmo os mal educados.</p>
<p>Bem, seguindo minha própria receita, esta é minha opinião, assim são construídos os artigos que eu respeito e gosto de comentar e discutir. Posso estar errado, então por favor comente sua visão do assunto nos comentários, faltou alguma regra? Espero que este artigo possa inspirar artigos melhores de valor técnico e que discussões possam brotar destes.</p>
]]></content:encoded></item><item><title>Filtering objects using annotations</title><link>https://doh.ms/2011/08/11/filtering-objects-using-annotations/</link><pubDate>Thu, 11 Aug 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/08/11/filtering-objects-using-annotations/</guid><dc:language>en-US</dc:language><category>annotations</category><category>filtering</category><category>php</category><category>security</category><description>Filtering with Annotations PHP does not have native Annotations support, however many projects have been using doc blocks to add value and semantics to code, like PHPUnit, Doctrine and Symfony. The Doctrine did a really good job in making available a Annotation parser kit, which …</description><content:encoded><![CDATA[<h1 id="filtering-with-annotations">Filtering with Annotations</h1>
<p>PHP does not have native Annotations support, however many projects have been using doc blocks to add value and semantics to code, like PHPUnit, Doctrine and Symfony. The Doctrine did a really good job in making available a Annotation parser kit, which allows you to bring the power of annotations into you own project. This opens up a few possibilities.</p>
<h2 id="input-validation-and-filtering">Input Validation and Filtering</h2>
<p>Rule #1 of the developer is “Filter input, escape output”. To me treating input has two distinct steps which are very important: Filtering and Validation. Symfony 2 has come out with a very cool Validation library which makes validation possible using annotations. It relies on a set of constraints which can be attached to properties of your object, allowing you to simply pass your objects to a validation service and it will do the rest for you. Like this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span> <span style="color:#75715e">// src/Acme/BlogBundle/Entity/Author.php use Symfony\\Component\\Validator\\Constraints as Assert;
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">class</span> <span style="color:#a6e22e">Author</span> { <span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Assert\\NotBlank</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span> <span style="color:#66d9ef">public</span> $name; } <span style="color:#75715e">?&gt;</span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">``` ```php
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010"> &lt;?php $author = new Author();
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">
</span></span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">$validator = $this-&gt;get(&#39;validator&#39;); $errorList = $validator-&gt;validate($author); ?&gt;
</span></span></span></code></pre></div><p>This is a very nice and clean way of handling validation, it allows all rules to be centered on the entities, making maintenance easy. A nice complement is that constraints can be added to the class so they use more then one variable, as well as allowing you to create your own contraints.</p>
<p>However the library lacks one thing, which Zend_Filter_Input does very well, <strong>Filtering</strong>. Most data needs to be filtered before going in for validation, and even of Symfony2 offers a Data Transformer, that is not quite what is needed here, so I came out with the only other solution, build one myself.</p>
<h2 id="dmsfilter">DMS\Filter</h2>
<p>I wanted a library with all the power of the filters out there and the advantage of using annotations to provide its interface. So i set about studying the annotations implementation in doctrine and the Symfony2 Validator and came up with my own Filter library. It was designed to be simple and to be used alongside doctrine and symfony validator, so it depends on Doctrine Common.</p>
<p>Its composed of a filter service which is capable of reading “filter rules” from object properties and iterate over them, even private and protected ones, filtering the values. It works based on the object instance which is not cloned, so the object is altered and does not need to be returned nd re-assigned.</p>
<p>To add rules to you properties, just declare the namespace use and go for it, like this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">namespace</span> <span style="color:#a6e22e">App\\Entity</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Import Annotations use DMS\\Filter\\Rules as Filter;
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">class</span> <span style="color:#a6e22e">User</span> {
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Filter\\StripTags</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Filter\\Trim</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Filter\\StripNewlines</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#66d9ef">var</span> <span style="color:#a6e22e">string</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span> <span style="color:#66d9ef">public</span> $name;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Filter\\StripTags</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Filter\\Trim</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">Filter\\StripNewlines</span>() <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#66d9ef">var</span> <span style="color:#a6e22e">string</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span> <span style="color:#66d9ef">public</span> $email;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>} <span style="color:#75715e">?&gt;</span><span style="color:#960050;background-color:#1e0010">
</span></span></span></code></pre></div><p>To filter your instance, just do it like this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span> <span style="color:#75715e">//Get Doctrine Reader $reader = new Annotations\\AnnotationReader(); $reader-&gt;setEnableParsePhpImports(true);
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Load AnnotationLoader $loader = new Mapping\\Loader\\AnnotationLoader($reader); $this-&gt;loader = $loader;
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Get a MetadataFactory $metadataFactory = new Mapping\\ClassMetadataFactory($loader);
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Get a Filter $filter = new DMS\\Filter\\Filter($metadataFactory);
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Get your Entity $user = new App\\Entity\\User(); $user-&gt;name = &#34;My &lt;b&gt;name&lt;/b&gt;&#34;; $user-&gt;email = &#34; email@mail.com&#34;;
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Filter you entity $filter-&gt;filter($user);
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">echo</span> $user<span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">name</span>; <span style="color:#75715e">//&#34;My name&#34; echo $user-&gt;email; //&#34;email@mail.com&#34; ?&gt;
</span></span></span></code></pre></div><p>You can also recycle an AnnotationReader already in use by Symfony Validator for example. The AnnotationReader is currently changing in Doctrine Common, but DMS\Filter tries to auto-configure its namespace, I will be keeping an eye on this in the future.</p>
<p>The project is available in two forms, inside the <a
  href="https://github.com/rdohms/DMS"target="_blank" rel="noopener"
  >DMS library on github</a
>, or as a <a
  href="https://github.com/rdohms/DMS-Filter"target="_blank" rel="noopener"
  >standalone component, also on github</a
> (sub tree split FTW!). It has a limited number of filters, but you can develop your own filters to use or just open up <a
  href="https://github.com/rdohms/DMS/issues"target="_blank" rel="noopener"
  >an issue</a
> and i&rsquo;ll create them.</p>
<p>Hope the library is useful and you enjoy it.</p>
]]></content:encoded></item><item><title>PHP Development in the Cloud by Ivo Jansch and Vito Chin</title><link>https://doh.ms/2011/08/05/php-development-in-the-cloud-by-ivo-jansch-and-vito-chin/</link><pubDate>Fri, 05 Aug 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/08/05/php-development-in-the-cloud-by-ivo-jansch-and-vito-chin/</guid><dc:language>en-US</dc:language><category>book</category><category>cloud</category><category>php</category><category>review</category><description>Cloud computing is finally reaching a point of maturity and leaving its early “hype” years behind. Ivo and Vito do a very good job of bringing the topic into a PHP developer’s world in a very concise and objective manner, without leaving important platforms and concepts behind.</description><content:encoded><![CDATA[<p>Cloud computing is finally reaching a point of maturity and leaving its early “hype” years behind. Ivo and Vito do a very good job of bringing the topic into a PHP developer’s world in a very concise and objective manner, without leaving important platforms and concepts behind.</p>
<p>From the top the book sets down the glossary and explains very clearly what Cloud computing is and where it stands, which is very important if you are to decide wether its the solution for you or not. It also brings the concept into technical view reviewing the differences between a regular hosting environment and a elastic cloud structure. This is very important to architects building new applications that mean to take full advantage of the cloud. Finally the book overviews a few examples and most importantly a few providers and solutions, such as Amazon, Windows Azure and Google App Engine.</p>
<p>The book was a very pleasant read, not thick and not too thin. It helped me greatly as I prepared to give a presentation on Cloud Computing, allowing me to see different points of view as well as compare other technologies i had not had time or chance to try. I recommend this for any application architect who is thinking if the cloud is the right solution, but even if its not on your mind yet. Its very important to know where the cloud fits in so that when given a choice you will know the cloud is an option to be considered.</p>
<p><a
  href="http://www.phparch.com/books/php-development-in-the-cloud-a-phparchitect-guide/"target="_blank" rel="noopener"
  ><img
    src="http://www.phparch.com/wp-content/themes/phpa/thumb.php?src=http://www.phparch.com/wp-content/uploads/2011/02/PHPCloud-cover-small.jpg&amp;w=260"
    alt="Book Cover"
    title="Book Cover"
    loading="lazy"
    decoding="async" /></a
><strong>Title: PHP Development in the Cloud - a php|architect Guide</strong> <strong>By: Ivo Jansch and Vito Chin</strong> Publisher: Blue Parabola</p>
<p>Pages: 172 ISBN: 9780981034522</p>
<p>Buy it: <a
  href="http://www.phparch.com/books/php-development-in-the-cloud-a-phparchitect-guide/"target="_blank" rel="noopener"
  >At php|architect</a
></p>
]]></content:encoded></item><item><title>Desinformação na mídia: PHP rotulado como vírus</title><link>https://doh.ms/2011/07/29/desinformacao-na-midia-php-rotulado-como-virus/</link><pubDate>Fri, 29 Jul 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/07/29/desinformacao-na-midia-php-rotulado-como-virus/</guid><dc:language>pt-BR</dc:language><category>erros-da-midia</category><category>php</category><category>seguranca</category><description>Recebi hoje pelo twitter (do colega @leoviena) um link para uma matéria da do Jornal Hoje na Rede Globo, ao assitir a matéria fiquei abismado com as informações dadas na matéria. (UPDATE: matéria em texto)</description><content:encoded><![CDATA[<p>Recebi hoje pelo twitter (do colega <a
  href="http://www.twitter.com/leoviena"target="_blank" rel="noopener"
  >@leoviena</a
>) um link para uma matéria da do Jornal Hoje na Rede Globo, ao assitir a matéria fiquei abismado com as informações dadas na <a
  href="http://g1.globo.com/videos/jornal-hoje/v/veja-dicas-para-nao-cair-na-armadilha-de-mensagens-eletronicas-falsas/1580356/"target="_blank" rel="noopener"
  >matéria</a
>. (UPDATE: <a
  href="http://g1.globo.com/jornal-hoje/noticia/2011/07/saiba-como-nao-cair-na-armadilha-de-mensagens-eletronicas-falsas.html"target="_blank" rel="noopener"
  >matéria em texto</a
>)</p>
<p>A matéria sobre segurança procurava informar o usuário da internet como evitar problemas de segurança e emails de &ldquo;phishing&rdquo;. O termo descreve ações onde usuários mal intencionados enviam email falsos, com links para sites que imitam, com intuito de roubar informações da vítima.</p>
<p>As dicas foram bem simplórias e de forma geral corretas, porém aos 2:15 da matéria o Sr. Jeferson D&rsquo;Addario (<a
  href="http://twitter.com/#!/jefebrasil"target="_blank" rel="noopener"
  >@jefebrasil</a
>), especialista em segurança convidado pelo jornal comete um grave deslize, a frase:</p>
<p>&ldquo;&hellip; quando for .php, pode ser em grande maioria, um virus &hellip;&rdquo;</p>
<p>Esta informação, especialmente no contexto que foi dada é extremamente incorreta, e causa alarde desnecessário.</p>
<p>O <a
  href="http://www.php.net"target="_blank" rel="noopener"
  >PHP</a
> se trata de uma linguagem de computação utilizada para criar sites na internet, linguagem na qual trabalho a 12 anos já. Estima-se que mais de 26 milhões de dominios na internet sejam feitos com PHP (<a
  href="http://trends.builtwith.com/framework/PHP"target="_blank" rel="noopener"
  >fonte</a
>, <a
  href="http://php.net/usage.php"target="_blank" rel="noopener"
  >fonte 2007</a
>), dentre esses grande sites como o Facebook e a maior parte dos blogs, que utilizam a plataforma WordPress, escrita em PHP.</p>
<p>Com isso a afirmação do Sr. Jeferson de que podemos identificar um virus pela extensão .php é absurda e pode causar danos a muitos sites.</p>
<p>No exemplo dado, que aparece acima a verificação da URL fraudolenta pode ser feita pelp dominio apresentado <em>&ldquo;nyamphande.com&rdquo;</em> que não pertence ao Serasa. Este mesmo ataque pode ser feito com arquivos de extensão .asp, .py até .html ou se o ataquende desejar, .css, .js .globo, .qualquercoisa . Pois esta extensão é configurada no servidor.</p>
<p>É pratica comum no PHP utilizar configurações para ocultar este suffixo &ldquo;.php&rdquo;, porém muitos sites não utilizam esta pratica e nem por isso são sites de Phishing. Muito menos a &ldquo;maioria&rdquo; destes sites é malicioso.</p>
<p>Espero que este artigo rápido esclareça a dúvida criada pelo profiossional, e que a <strong>extensão .php</strong> que pode ser usada pelo seu site favorito <strong>não seja motivo de alarde</strong>.</p>
<p><strong>UPDATE:</strong></p>
<p>Após publicação deste artigo pude acompanhar a repercursão do assunto na internet, inclusive em sites como o Twitter onde a hashtag #phpvirus foi para os Trending Topics rapidamente. Programadores PHP e de diveras linguagems demonstraram indignação pela desinformação prestada na matéria. Foi possivel também ver tirinhas como <a
  href="http://vidadeprogramador.com.br/2011/07/29/phpvirus/"target="_blank" rel="noopener"
  >esta do ProgramadorReal</a
>.</p>
<p>Poucas horas depois estava no ar um <a
  href="http://www.peticaopublica.com.br/PeticaoVer.aspx?pi=PHPJHOJE"target="_blank" rel="noopener"
  >abaixo assinado</a
> feito pela <a
  href="http://www.php.org.br"target="_blank" rel="noopener"
  >comunidade de programadores PHP</a
> pedindo uma retratação. Faça sua parte, aguardaremos a Rede Globo se manifestar.</p>
<p><strong>UPDATE 2:</strong></p>
<p>Neste sábado o jornal hoje apresentou nota corrigindo a citação acima e deixando claro que páginas terminadas em .php não são geralmente ameaças e sim parte comum da internet. Aproveito para agradecer o jornal hoje por corrigir a matéria e por soltar esta nota hoje. <a
  href="http://g1.globo.com/videos/jornal-hoje/v/veja-como-paginas-de-internet-programadas-em-php-nao-oferecem-risco/1581419/"target="_blank" rel="noopener"
  >Veja o video</a
></p>
]]></content:encoded></item><item><title>php|tek 2011 and what's trending</title><link>https://doh.ms/2011/06/01/phptek-2011-and-whats-trending/</link><pubDate>Wed, 01 Jun 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/06/01/phptek-2011-and-whats-trending/</guid><dc:language>en-US</dc:language><description>Another edition of php|tek has come and gone and this year some very amazing topics came into view. The conference itself was once again a great experience, great people, incredible speakers, lots of activities and incredible hack-a-thons and unconference sessions.</description><content:encoded><![CDATA[<p>Another edition of php|tek has come and gone and this year some very amazing topics came into view. The conference itself was once again a great experience, great people, incredible speakers, lots of activities and incredible hack-a-thons and unconference sessions.</p>
<p>Cloud computing is reaching a level of maturity in the technology market as a whole, finally finding its place and purpose and dropping the “silver bullet” tag. This seems to reflect on the language as well and many sessions revolved around using the cloud to complement projects and on how to take advantage of cloud aspects in a PHP architecture, as well as the many cloud offerings available.</p>
<p>Another topic that kept us all busy was Mobile development, which following the incredible rise of the smartphones and the various systems like iOS, Android and WP7 was also present in multiple tags teaching how to architect your app and create solutions that would work for all smartphone users out there.</p>
<p>I was very surprised this year to see a the clear presence of Applications in the event. Wordpress, Drupal and sites like joind.in made their presence in various aspects, ranging from talks, to coding sessions and especially to representatives who took their time to talk to the speakers and attendees.</p>
<p>APIs and integration with external tools was also a hot topic. Many sessions described the many tools that can be used to improve your application, like queues, protocols, services and so many more, also how to develop api into your code so that your application can also be used as an external tool in another project.</p>
<p>One topic that i would love to see more and more was also present: Soft skills. This is a very important area to be explored by the community in general, some conferences like <a
  href="http://daycamp4developers.com/"target="_blank" rel="noopener"
  >DayCamp 4 Developers</a
> already do a great job of covering them but they also grow in various others. These skills or just plain recommendations are fundamental to new and old developers so they can find new paths and grow in their own careers as they do it.</p>
<p>I must also reserve space for the Hack-a-thon which was a complete surprise and success this year, seeing somewhere around 90 developers hacking into the night or just plain learning from each other was quite a pleasing experience. I myself had a great time explaining the importance and the first steps needed to develop PHPT tests to cover PHP’s source code, its not about how much work is done in these events, but its about planting that very important seed that will keep growing after the event, and I was very glad to see so many reach that stage during the event.</p>
<p>Congratulations to the organizers and to all the speakers for delivering incredible content and for taking all developers under their wing to teach and interact. I had a great time also speaking to everyone about Windows Azure and architecting for the cloud, and I hope everyone at the session had a great time learning, even tough my voice decided to play a hoax on me and make me sound like a game of “fill in the blanks”. If you were at the session I would love to hear your feedback, please do it over at <a
  href="http://joind.in/talk/view/3417"target="_blank" rel="noopener"
  >joind.in</a
>, also you may want to see the slides, so please go ahead and see them <a
  href="http://www.slideshare.net/rdohms/open-a-window-see-the-clouds"target="_blank" rel="noopener"
  >here</a
> or below.</p>
<p><strong><a
  href="http://www.slideshare.net/rdohms/open-a-window-see-the-clouds"title="Open a window, see the clouds - php|tek 2011"target="_blank" rel="noopener"
  >Open a window, see the clouds - php|tek 2011</a
></strong></p>
<iframe src="http://www.slideshare.net/slideshow/embed_code/8102545" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<p>View more <a
  href="http://www.slideshare.net/"target="_blank" rel="noopener"
  >presentations</a
> from <a
  href="http://www.slideshare.net/rdohms"target="_blank" rel="noopener"
  >Rafael Dohms</a
></p>
]]></content:encoded></item><item><title>Debugging PHPUnit Tests in NetBeans with XDebug</title><link>https://doh.ms/2011/05/13/debugging-phpunit-tests-in-netbeans-with-xdebug/</link><pubDate>Fri, 13 May 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/05/13/debugging-phpunit-tests-in-netbeans-with-xdebug/</guid><dc:language>en-US</dc:language><category>debugging</category><category>netbeans</category><category>phpunit</category><category>tests</category><category>tips</category><category>xdebug</category><description>Every now and then you run into this weird situation in your code, where something that was supposed to zig is now zagging and it makes no sense whatsoever. For me this ends up happening in my unit tests since i’m not running everything in the browser everytime and since my tests …</description><content:encoded><![CDATA[<p>Every now and then you run into this weird situation in your code, where something that was supposed to zig is now zagging and it makes no sense whatsoever. For me this ends up happening in my unit tests since i’m not running everything in the browser everytime and since my tests usually run more scenarios then a regular browser run, that’s where the weird stuff happens.</p>
<p>So your obvious way out is to add a few var_dumps into the code and try to understand what is happening, if you are doing that: <strong>STOP!</strong></p>
<p>Drop that mouse and step away from your keyboard, you should be debugging not adding code to the mix. So debugging in a browser is a piece of cake in most IDEs like NetBeans and Zend Studio and so forth, but debugging your tests that are running on the command line take a few more cards up your sleeve. So this is how i configured my NetBeans IDE and my PHPUnit tests to communicate and let me debug what happens inside that crazy world.</p>
<h3 id="configure-your-netbeans-debugging-configuration">Configure your NetBeans Debugging configuration</h3>
<p>This is very straight forward, go to <em>Preferences &gt; PHP</em> and set the debug settings, namely the port and a session id. For example: port 9000 and Session ID netbeans-xdebug.</p>
<p><a
  href="http://blog.rafaeldohms.com.br/wp-content/uploads/Screen-shot-2011-05-04-at-11.36.39-PM.png"target="_blank" rel="noopener"
  ></a
><a
  href="http://blog.rafaeldohms.com.br/wp-content/uploads/Screen-shot-2011-05-04-at-11.36.39-PM.png"target="_blank" rel="noopener"
  >





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        

        
        
        
          
        
        
        
        
        
        
        


        
        


        <picture>
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-04-at-11.36.39-PM_hu_d5730741c7aff51c.webp"
            
            media="(max-width: 575px)" />
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-04-at-11.36.39-PM_hu_7009e4a7bb8a4d7.webp"
            
            media="(max-width: 767px)" />
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-04-at-11.36.39-PM_hu_84b0bbb0097f88c5.webp"
            
            media="(max-width: 991px)" />
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-04-at-11.36.39-PM_hu_e121efa03d062afc.webp"
             />
          <img
            
              loading="lazy" decoding="async"
              src="/images/blog/Screen-shot-2011-05-04-at-11.36.39-PM_hu_199f98007157b47e.png"
            
            
            class=" rounded img"
            alt=""
            width="755"
            height="325" />
        </picture>
      
      
    
    
  


  

</a
></p>
<h3 id="tell-xdebug-what-you-want-it-to-do">Tell Xdebug what you want it to do</h3>
<p>This is done by adding a few settings in you php.ini or if you use additional ini files, I recommend you create a xdebug.ini. You need to configure a few things here, we want xdebug to have remote debugging always enabled and we want to configure the port and ide keys we used in netbeans as well as configuring the output to be “dbgp”. This is how it will look in you ini:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-plain" data-lang="plain"><span style="display:flex;"><span> xdebug.idekey=netbeans-xdebug xdebug.remote\_enable= On xdebug.remote\_handler=dbgp xdebug.remote\_mode=req xdebug.remote\_host=127.0.0.1 xdebug.remote\_port=9000
</span></span></code></pre></div><h3 id="make-phpunit-send-stuff-to-netbeans">Make PHPUnit send stuff to NetBeans</h3>
<p>So this is enough for you to do URL based debugging, but we want to debug our unit tests to pick up on those weird bugs with a easy to repeat script to lock down on it. For this to work you need to export a xdebug config variable in your local environment, so that XDebug kicks off the debugging based on this command line script. You will need to set XDEBUG_CONFIG to “idekey=netbeans-xdebug”, but setting it everytime is a nuisance, so my approach is to create a phpunit-debug file that can do this for me and allows me to kick off debugging by simply changing the executable. This is the content of this file:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span> export XDEBUG<span style="color:#ae81ff">\_</span>CONFIG<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;idekey=netbeans-xdebug&#34;</span>; phpunit $@
</span></span></code></pre></div><h3 id="make-netbeans-start-a-debug-session-and-not-open-a-browser-window">Make NetBeans start a debug session and not open a browser window</h3>
<p>One last thing is needed for things to run smoothly. When you click on debug in Netbeans the usual process is for it to open up a browser window and debug from there, but we don’t want that, so we need to tell it to not open a browser. This is done by accessing <em>File &gt; Project Properties &gt; Run Configuration</em> and clicking on the “Advanced” button, here you can select “Do no open a browser” and you are set. <a
  href="http://blog.rafaeldohms.com.br/wp-content/uploads/Screen-shot-2011-05-05-at-12.02.36-AM.png"target="_blank" rel="noopener"
  >





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      
      
        

        
        
        
          
        
        
        
        
        
        
        


        
        


        <picture>
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-05-at-12.02.36-AM_hu_1cc5fe518c0e1bff.webp"
            
            media="(max-width: 575px)" />
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-05-at-12.02.36-AM_hu_2741cf8276c3aa16.webp"
            
            media="(max-width: 767px)" />
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-05-at-12.02.36-AM_hu_22f491153fa515e3.webp"
            
            media="(max-width: 991px)" />
          <source
            
              srcset="/images/blog/Screen-shot-2011-05-05-at-12.02.36-AM_hu_33438b3566a8f0cf.webp"
             />
          <img
            
              loading="lazy" decoding="async"
              src="/images/blog/Screen-shot-2011-05-05-at-12.02.36-AM_hu_fcca02599eb965f6.png"
            
            
            class=" rounded img"
            alt=""
            width="549"
            height="224" />
        </picture>
      
      
    
    
  


  

</a
></p>
<h3 id="running-debugging">Running Debugging</h3>
<p>To start a debugging session you will need to follow these steps:</p>
<ol>
<li>Click on “Debug Project” button. Now Netbeans will start waiting for a connection.</li>
<li>Go to command line and run phpunit-debug. Now debugging starts, if you selected “Stop on first line” phpunit file will be opened on your IDE, click play and you are off.</li>
</ol>
<p>There you go. Now you are all set to debug your tests and understand better what is triggering that failure deep down inside your suite.</p>
]]></content:encoded></item><item><title>Book Review: Being Geek by Michael Lopp</title><link>https://doh.ms/2011/03/24/book-review-being-geek-by-michael-lopp/</link><pubDate>Thu, 24 Mar 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/03/24/book-review-being-geek-by-michael-lopp/</guid><dc:language>en-US</dc:language><description>I was very pleased with Being Geek, the author - Michael Lopp - does a great job of taking us on a tour of the geek’s perspective on life and career. The idea behind the book is to reflect on your career, as it is now and what you want it to be, and its a great read for anyone …</description><content:encoded><![CDATA[<p>I was very pleased with <strong>Being Geek</strong>, the author - <strong>Michael Lopp</strong> - does a great job of taking us on a tour of the geek’s perspective on life and career. The idea behind the book is to reflect on your career, as it is now and what you want it to be, and its a great read for anyone starting on a software development career and even for long time developer who have already walked a big chunk of the road.</p>
<p>The reading was not exactly smooth for me, sometimes i had to stop and remember what the initial topic being talked about was to not loose track, but that might have been more fault of my reading method (bite-size bits at random moments) then the actual author’s. I did like the narrative and the way everything is explained with an example, either from his career or a moment of reflection on your own. This was also interesting because it was very easy to draw parallels from my career to the points described in the book. These moments were for me the best thing i took away from the book, moments to reflect on my own career, its path, current downfalls or surprises and past mistakes or wins.</p>
<p>The chapters on management were an excellent exercise to analyze my own profile in team meetings and think about what i can do better from an outside perspective. Also the various ideas on how to manage your day, ideas and how to make sure you are hitting all essential parts of a day, were very good to have as reference and even inspired some changes to my own strategies. The real fun part of it was actually Michael’s read on “The Geek”, how we think, how we operate and how our significant others should &ldquo;handle us&rdquo;. It was mind boggling to see myself so well described in some points and it made me feel good to be a geek.</p>
<p>If you are planning a Software Developer career or have already started one, check this book out, it will provide you at the very least with lots of topics to think about on the never ending drama of “leaving one job and starting a new gig”, when to leave, where to go and so forth. But much more you should be able to get a great perspective on other aspects of your career and a feel for a Manager’s position and how they work. Pick it up and check it out.</p>
<p>





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      <img
        src="/images/blog/cat.gif"
        loading="lazy"
        decoding="async"
        
        alt="Being Geek Cover"
        class="rounded img"
        width=""
        height="" />
    
    
  


  

 <strong>Title: Being Geek</strong> <strong>By: Michael Lopp</strong> Publisher: O’Reilly Media Print: August 2010 Ebook: July 2010 Pages: 336 Print ISBN:978-0-596-15540-7 | ISBN 10: 0-596-15540-9 Ebook ISBN:978-1-4493-9403-5 | ISBN 10: 1-4493-9403-5</p>
<p>Buy it: <a
  href="http://www.amazon.com/gp/product/0596155409/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=rafadohm-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596155409"target="_blank" rel="noopener"
  >On Amazon</a
> or <a
  href="http://www.amazon.com/gp/product/B003XDUCEU/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=rafadohm-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B003XDUCEU"target="_blank" rel="noopener"
  >On the Kindle</a
> or <a
  href="http://oreilly.com/catalog/9780596155414/"target="_blank" rel="noopener"
  >On O’Reilly</a
></p>
]]></content:encoded></item><item><title>The ideas of March</title><link>https://doh.ms/2011/03/15/the-ideas-of-march/</link><pubDate>Tue, 15 Mar 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/03/15/the-ideas-of-march/</guid><dc:language>en-US</dc:language><category>blogging</category><category>ideasofmarch</category><category>php</category><category>professional-growth</category><description>This year my New Year’s resolution was to “write more” just as plain as that, blog more, write articles, maybe even a book can fit in there. Now it seems that resolution is in sync with the rest of the PHP Community and Chris Shifflet has once again caused ripples to roam the …</description><content:encoded><![CDATA[<p>This year my New Year&rsquo;s resolution was to &ldquo;write more&rdquo; just as plain as that, blog more, write articles, maybe even a book can fit in there. Now it seems that resolution is in sync with the rest of the PHP Community and <a
  href="http://twitter.com/#!/shiflett"target="_blank" rel="noopener"
  >Chris Shifflet</a
> has once again caused ripples to roam the community with his <a
  href="http://shiflett.org/blog/2011/mar/ideas-of-march"target="_blank" rel="noopener"
  >Ideas of March</a
> initiative.</p>
<p>This blog for me is a crucial part of my professional self, hence the determination to revive the blog and the website in this year. &ldquo;Why?&rdquo;, you may ask. Well its very simple, blogs can withstand the test of time, they do not come and go or just vanish from the internet, like tweets do. Tweets are fine to get a message started, but they suck for getting into real discussions and for actual knowledge growth, it works, but its shallow at best, the 140 chars limit will do that to you. But on the blog your limits are gone, google will keep that blogpost relevant for years to come, my first post on the Google Maps API is living proof, still the most visited article here after 4 years.</p>
<p>In a world where saying you are good at something is falling into misuse and disbelief, an active blog can assert to your skills and your career work, even your passions and your motivation. It can do all of that much better then a CV can, it can also provide you with professional projection, throwing your name around until it hits your potential future employer.</p>
<p>Its also all about knowledge. A blog can spread your knowledge, it can bring you knowledge, in the format of comments, discussions and feedback (as <a
  href="http://seancoates.com/blogs/ideas-of-march"target="_blank" rel="noopener"
  >Sean Coates put it</a
>), and it can also help developers who, like me, suffer of cronic forgetfulness. Seriously, its a bitter-sweet feeling to search google for a topic and end up reading your own blogpost from years past.</p>
<p>So why should you blog, not just tweet? in summary:</p>
<ol>
<li>Timeless: Blogposts don&rsquo;t expire</li>
<li>Professional Projection: Get your name out there, show what you do well</li>
<li>Professional Growth: Learn, expand, teach and get feedback</li>
<li>Help yourself: store your knowledge in a searchable place</li>
<li>Details: Blogs allow you to do in-depth articles and discussions</li>
<li>Get evaluation going: start discussions, propose changes, make something happen</li>
</ol>
<p>So i&rsquo;ll take the pledge proposed by Chris (especially since i have already commited to it) and blog more actively this year. You can also check me up on php|arch every now and then (in the future) and in brazil in our PHP Review magazine. Want to watch twitter? please do, i&rsquo;ll always link off from there to these posts.</p>
<p>So don&rsquo;t let this stop here, take the &ldquo;Ideas of March&rdquo; challenge yourself.</p>
]]></content:encoded></item><item><title>Como foi palestrar na Campus Party 2011</title><link>https://doh.ms/2011/03/14/como-foi-palestrar-na-campus-party-2011/</link><pubDate>Mon, 14 Mar 2011 00:00:00 -0300</pubDate><guid>https://doh.ms/2011/03/14/como-foi-palestrar-na-campus-party-2011/</guid><dc:language>pt-BR</dc:language><category>cparty2011</category><category>cpbr4</category><category>php</category><category>trilhando-o-caminho-php</category><description>Este ano tive a oportunidade de voltar a Campus Party e mais uma vez palestrar na área de Desenvolvimento. Antes de mais nada, obrigado ao David Ruiz e ao Ricardo Martins pela oportunidade novamente.</description><content:encoded><![CDATA[<p>Este ano tive a oportunidade de voltar a Campus Party e mais uma vez palestrar na área de Desenvolvimento. Antes de mais nada, obrigado ao <a
  href="http://twitter.com/#!/wupsbr"target="_blank" rel="noopener"
  >David Ruiz</a
> e ao <a
  href="http://twitter.com/#!/r_martins"target="_blank" rel="noopener"
  >Ricardo Martins</a
> pela oportunidade novamente.</p>
<p>No ano anterior minha palestra foi uma introdução ao PHP, este ano tive o prazer de apresentar a palestra <a
  href="http://www.slideshare.net/rdohms/trilhando-o-caminho-php-20-campus-party-2011"target="_blank" rel="noopener"
  >“Trilhando o caminho PHP”</a
>, de longe minha palestra favorita. Eu gosto dela pois não é uma palestra técnica e embora todos exemplos sejam geralmente voltados ao PHP ela é uma palestra que pode se aplicar a todo profissional da área de TI e até mesmo de outras áreas. Nela eu procuro apresentar ideias e sugestões de caminhos a serem tomados para o crescimento e sucesso profissional, como aumentar seu conhecimento, divulgar seu nome, conhecer as pessoas certas e eventualmente empregos melhores. Ela nasceu inspirada em minha carreira, mas foi se transformando ao longo do tempo com inputs de diversos profissionais da área e da comunidade, trazendo novas dicas e historias de sucesso.</p>
<p>Por esses motivos foi um prazer palestrar no evento, ver a platéia cheia e a presença de não-phpzeiros e especialmente o feedback pós-palestras, as perguntas e as conversas que se seguiram foram muito legais e eu senti que refletiram a mensagem passada na palestra. Mas a Campus Party me trouxe algo diferente este ano, além da presença de minha esposa e meu irmão na platéia, por ser um ambiente de extrema produtividade social ou sei lá como descrever isso acabei por poder assistir um video que comentava minha palestra. A <a
  href="http://twitter.com/#!/JulyRowvlock"target="_blank" rel="noopener"
  >Juliana Santos Flor Moreira</a
> estava na platéia conferindo a palestra e no dia seguinte postou um <a
  href="http://makestokyo.blogspot.com/2011/01/2-dia-na-campus-party-brasil_20.html"target="_blank" rel="noopener"
  >video</a
> onde fazia sua considerações sobre a palestra, o feedback foi excelente para mim, enquanto tentava explicar para outros o conteúdo da minha palestra foi possível ver exatamente quais pontos marcaram ela durante a palestra e já me deram ideias de como melhorar ela e fazer com que a mensagem fique mais clara.</p>
<p>Se ainda não participou de uma Campus Party, não deixe de participar no futuro, é um evento incrível e maluco ao mesmo tempo, com um pouco de maturidade e foco é possível dar um bom gás em sua vida profissional e aprender muito.</p>
<p>[slickr-flickr search=sets set=72157626245464674]</p>
]]></content:encoded></item><item><title>Usando o PHP-SDK para rodar FQL na API do Facebook</title><link>https://doh.ms/2011/02/15/usando-o-php-sdk-para-rodar-fql-na-api-do-facebook/</link><pubDate>Tue, 15 Feb 2011 00:00:00 -0200</pubDate><guid>https://doh.ms/2011/02/15/usando-o-php-sdk-para-rodar-fql-na-api-do-facebook/</guid><dc:language>pt-BR</dc:language><category>contribute</category><category>facebook</category><category>github</category><category>graph-api</category><category>php</category><category>sdk</category><category>tips</category><description>Desde a migração do Facebook para a nova Graph API e o protocolo OAuth 2.0, sua documentação para desenvolvedores virou uma grande confusão, sem eira nem beira, de artigos depreciados, e isso se eu for otimista. O problema é que muitos artigos antigos ainda apontam para práticas …</description><content:encoded><![CDATA[<p>Desde a migração do Facebook para a nova Graph API e o protocolo OAuth 2.0, sua documentação para desenvolvedores virou uma grande confusão, sem eira nem beira, de artigos depreciados, e isso se eu for otimista. O problema é que muitos artigos antigos ainda apontam para práticas não mais recomendadas e muitos deles não possuem alertas sobre estas mudanças, em casos extremos funções que em breve serão removidas da API ainda não possuem equivalentes nas novas APIs.</p>
<p>As novas bibliotecas, ou SDKs, seguem o velho ditado do &ldquo;filho de peixe, peixinho é&rdquo;. Embora estejam novas e com cheirinho de carro novo, a documentação de como utlizar elas eficientemente está vaga, ausente ou espalhada em diversos blogs, como este, em posts de usuários que querem compartilhar a informação com futuros sofredores desenvolvedores ou apenas ter a anotação para uso posterior.</p>
<p>Então isto se trata de um exemplo desta situação, tenho usado os novos recursos e as novas bibliotecas e tenho tido diversas dificuldades, portanto decidi começar a colocar algumas destas coisas em meu blog, por dois motivos: espalhar a informação, e ter anotações pra eu me lembrar depois.</p>
<p><strong>Como posso executar queries em FQL usando a nova SDK?</strong></p>
<p>FQL é a alternativa do Facebook para o SQL, permitindo que você busque dados como se estivesse acessando um banco de dados gigante, <a
  href="http://developers.facebook.com/docs/reference/fql/"target="_blank" rel="noopener"
  >esta documentação</a
> felizmente ainda esta atualizada e você pode ver uma lista de &ldquo;tabelas&rdquo; de onde pode buscar informações, o restante dos truques você vi aprendendo enquanto usa.</p>
<p>Na biblioteca antiga, baseada na API REST, era bem simple rodar uma FQL:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> $facebook<span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">api</span><span style="color:#a6e22e">\_client</span><span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">fql</span><span style="color:#a6e22e">\_query</span>(<span style="color:#e6db74">&#34;SELECT uid, pic, pic\_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 111111111)&#34;</span>);
</span></span></code></pre></div><p>Porém isto (e muitos outros métodos) não está mais disponivel na nova <a
  href="https://github.com/facebook/php-sdk"target="_blank" rel="noopener"
  >PHP SDK</a
> então eu demorei um bucado de tempo para descobrir como poder enviar uma requisição de execução de uma FQL, já que o único método disponível era o <em>api(),</em> um método polimorfíco e não-documentado. Eu finalmente achei a resposta em um <a
  href="http://www.wickedbrilliant.com/2010/08/using-the-php-sdk-to-run-fql-queries-using-the-facebook-graph-api/"target="_blank" rel="noopener"
  >blog semelhante ao meu</a
>, com alguém que teve a mesma experiência. A requisição é feita assim:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span> <span style="color:#75715e">//Get Facebook SDK Object $config = array( &#39;appId&#39; =&gt; APP\_ID, &#39;secret&#39; =&gt; API\_SECRET, &#39;cookie&#39; =&gt; true, );
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>$facebook <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">Facebook</span>($config);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Create Query $params = array( &#39;method&#39; =&gt; &#39;fql.query&#39;, &#39;query&#39; =&gt; &#34;SELECT uid, pic, pic\_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 111111111)&#34;, );
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Run Query $result = $facebook-&gt;api($params); ?&gt;
</span></span></span></code></pre></div><p>Uma vez que você finalmente descobre que deve passar o parametro &ldquo;method&rdquo; para definir o método da API que pode ser executado, e ai descobre que deve passar sua busca em um parametro chamado &ldquo;query&rdquo;, você tem a faca e o queijo na mão. Não preciso nem dizer que isso pode demorar um pouco mais do que esperado.</p>
<p>No meu ponto de vista este pedaço de código porém é horrivel, não gosto de criar arrays para poder passar parametros para uma função, cada vez que for rodar ela. Então decidi que para usar essa SDK corretamente eu ia precisar extender ela e implementar algumas correções, neste caso um <strong>Helper Method para FQL</strong>. Veja como ficou:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">namespace</span> <span style="color:#a6e22e">App\\Facebook</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">include</span><span style="color:#a6e22e">\_once</span> <span style="color:#a6e22e">\\ROOT\_PATH</span> <span style="color:#f92672">.</span> <span style="color:#e6db74">&#39;library/vendor/facebook/facebook.php&#39;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">class</span> <span style="color:#a6e22e">Client</span> <span style="color:#66d9ef">extends</span> <span style="color:#a6e22e">\\Facebook</span> { <span style="color:#66d9ef">private</span> $config; <span style="color:#66d9ef">private</span> $reqPerms;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">Runs</span> <span style="color:#a6e22e">a</span> <span style="color:#a6e22e">FQL</span> <span style="color:#a6e22e">query</span> <span style="color:#a6e22e">agains</span> <span style="color:#a6e22e">the</span> <span style="color:#a6e22e">API</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">param</span> <span style="color:#a6e22e">string</span> $query <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#66d9ef">return</span> <span style="color:#66d9ef">array</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span> <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">fql</span>($query) { $params <span style="color:#f92672">=</span> <span style="color:#66d9ef">array</span>( <span style="color:#e6db74">&#39;method&#39;</span> <span style="color:#f92672">=&gt;</span> <span style="color:#e6db74">&#39;fql.query&#39;</span>, <span style="color:#e6db74">&#39;query&#39;</span> <span style="color:#f92672">=&gt;</span>$query, );
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">return</span> $this<span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">api</span>($params); }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>} $config <span style="color:#f92672">=</span> <span style="color:#66d9ef">array</span>(<span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">insert</span> <span style="color:#a6e22e">config</span> <span style="color:#a6e22e">here</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Using client $fb = new App\\Facebook\\Client($config);
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>$query <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;SELECT uid, pic, pic\_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 111111111)&#34;</span>; $result <span style="color:#f92672">=</span> $fb<span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">fql</span>($query);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">?&gt;</span><span style="color:#960050;background-color:#1e0010">
</span></span></span></code></pre></div><p>Isso faz chamar uma FQL rápido e simples, além de te dar a vantagem de ter a SDK embrulhada dentro do seu próprio namespace e, de bonus, ter uma forma mais simples de mockar e testar código relacionado, isso porque temos agora um método para mockar e não mais nos preocupar com paramentros passados.</p>
<p>Eu dei um passo além e aproveitando que o SDK esta no GitHub, comitei esta alteração em um <a
  href="https://github.com/facebook/php-sdk/pull/295"target="_blank" rel="noopener"
  >pull request</a
>. Ele ainda não foi aceito, mas espero que ele seja em breve e que mais pessoas possam se beneficiar com ele.</p>
<p>Espero que gostem e que isso lhe dê mais ideias de como melhorar o uso da nova SDK e eu voltarei em breve com mais dicas.</p>
]]></content:encoded></item><item><title>Managing Test Users in Facebook</title><link>https://doh.ms/2011/02/07/managing-test-users-in-facebook/</link><pubDate>Mon, 07 Feb 2011 00:00:00 -0200</pubDate><guid>https://doh.ms/2011/02/07/managing-test-users-in-facebook/</guid><dc:language>en-US</dc:language><category>application</category><category>dms</category><category>facebook</category><category>graph-api</category><category>php</category><category>test-users</category><description>Recently Facebook implemented a new and more secure way of creating test users for your applications using the new Graph API. This new resource creates test users per application, allowing the developers of these apps to login as these users and test out their app’s functionality …</description><content:encoded><![CDATA[<p>Recently Facebook implemented a new and more secure way of creating <a
  href="http://developers.facebook.com/docs/test_users"target="_blank" rel="noopener"
  >test users</a
> for your applications using the new Graph API. This new resource creates test users per application, allowing the developers of these apps to login as these users and test out their app’s functionality without using their own accounts and throwing test information into their live activity feed, this makes it very easy and clean to test new applications.</p>
<p>Its possible to create up to 100 test users per app, creation allows you to choose whether the user already should have the application installed and which permissions you want them to have, using API calls like:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>POST /app\_id/accounts/test-users?installed=true&amp;permissions=read\_stream
</span></span></code></pre></div><p>You can also remove users, list all of your app’s test users and even create friend connections between them using the API. This really is a great resource, but using an API to get this information all the time is cumbersome and might take time away from your time to develop the application itself.</p>
<p><strong>This is where the Test User Manager comes in.</strong></p>
<p>Having ran into this exact issue when developing for Facebook, I wished i could have a “phpMyAdmin”-like application to handle these requests for me and just give me a simple interface to work with. That’s when the idea was born an i decided to use the idea and opportunity to simplify my life and also learn/research a few other libraries and such.</p>
<p>I decided to create a very simple app, without a large MVC framework, just a bunch of actions. I also took the opportunity to use a simple template engine to see how it behaves, so i chose <a
  href="http://www.twig-project.org/"target="_blank" rel="noopener"
  >Twig</a
> for this. Since i did not have the comfort of large MVC framework to handle my requests, i also decided to look at funkatron’s <a
  href="https://github.com/funkatron/inspekt"target="_blank" rel="noopener"
  >Inspekt</a
> library to handle input security. Since i did not want to go through some troubles I also imported a limited set of tools from <a
  href="http://framework.zend.com"target="_blank" rel="noopener"
  >Zend Framework</a
> to handle autoloading and smaller tasks. Also having not worked with front-end too much in a while I took hold of jQuery and a few plugins to see what they could do.</p>
<p>All in all i had a very simple but effective app. Right now (version <a
  href="https://github.com/rdohms/facebook-testuser-manager/archives/v0.9"target="_blank" rel="noopener"
  >0.9</a
>) it does the basics, add, lists, deletes and creates relationships between Test Users. But it handles exactly the most boring and annoying tasks. Let me show you a bit:</p>
<p><strong>Listing/Managing Users</strong></p>
<p>The user list will show you all of your test users, their IDs, name and permissions. With the command icons you can see the access_token, login on Facebook as the user, delete him or add new friends. Since this is a API heavy process to get all information loading is done in parallel using ajax.</p>
<p><strong>Creating a User</strong></p>
<p>The for to add new users is straight forward, you can add permissions and decide if the app will be installed or not for the user.</p>
<p><strong>Viewing and Creating relationships</strong></p>
<p>Clicking on the “add friend” icon you can view a list of existing relationships and choose a new user to associate with this user.</p>
<p>All the source code for this application is on <a
  href="https://github.com/rdohms/facebook-testuser-manager"target="_blank" rel="noopener"
  >GitHub</a
>, feel free to open feature requests and bug reports and of course pull requests at will. I hope this app can help you as a Facebook developer and make everyday life easier.</p>
<p><a
  href="https://github.com/rdohms/facebook-testuser-manager/archives/v0.9"target="_blank" rel="noopener"
  >Download version 0.9 here</a
></p>
]]></content:encoded></item><item><title>Problem solving technique #1: Taking a mental break</title><link>https://doh.ms/2011/02/04/taking-a-break-to-solve-problems/</link><pubDate>Fri, 04 Feb 2011 00:00:00 -0200</pubDate><guid>https://doh.ms/2011/02/04/taking-a-break-to-solve-problems/</guid><dc:language>en-US</dc:language><category>angry-birds</category><category>career</category><category>development</category><category>php</category><category>process</category><category>puzzle</category><description>Developers are modern day artists whose masterpieces are not hung on walls but stretched out thin on web servers all over the world, yes that is very poetic, but I really try to look at developers as artists and puzzle solvers. To become better developers your skill-set must …</description><content:encoded><![CDATA[<p>Developers are modern day artists whose masterpieces are not hung on walls but stretched out thin on web servers all over the world, yes that is very poetic, but I really try to look at developers as artists and puzzle solvers. To become better developers your skill-set must include creativity and problem solving skills and of course a artistic touch.</p>
<p>Writing a piece of code is an ever evolving process and never ending, its a puzzle. Let’s think of it in modern terms, writing a code is like solving a level in <a
  href="http://en.wikipedia.org/wiki/Angry_Birds"target="_blank" rel="noopener"
  >Angry Birds</a
>, your primary objective is to get it done and working, i.e. solve the level and go on. But it does not stop there, you often do not get it perfect on the first try, so you need to go back and do more work on it, make it perform better, use less memory, its like going back to that level in Angry Birds and trying to get a 3 star rating.</p>
<p>Somewhere along this process you will run into every artist’s greatest fear, the mental block. Once you hit a problem you often get to a point that you have so exhaustively thought of why and how to solve it that it simply becomes impossible to find a solution while still looking at that code. This is where the “mental breaks” come in. A different activity, to most its the simple act of going to get coffee or water, taking a stroll outside in the fresh air, some like sports, some like games.. everyone has their escape valve.</p>
<p>I once worked with a good friend and an incredible developer and problem solver, he went simply by the name of “<a
  href="http://chester.blog.br/"target="_blank" rel="noopener"
  >Chester</a
>”. It was really interesting to see how he worked a problem mentally and I had some of my best whiteboard coloring brain jamming sessions discussing architecture with him, but his block solving strategy was even cooler. Whenever he got stuck and brain crunching failed to find the solution he simply stopped and picked up a bucket of lego blocks. He sat there building whatever came to his mind until he came to that Eureka moment and the solution came up.</p>
<p>This strategy is something I see more and more in various development companies, like Google, Microsoft and so many others. The colorful rooms with beanbags, video games, or just plain outdoor places, little parks, sport courts and toys. Nerf guns, lego, desktop catapults, iPads with games these are just some of the examples that are out there. All of these have the same purpose as that bucket of building blocks my friend used, get your conscious mind off the problem and let your subconscious take a whack at it.</p>
<p>While this may not work for everyone or they may not be responsible enough to handle it, I believe advanced and competent developers are a perfect match for this, why? Firstly, the developer needs to be mature and responsible, otherwise all of the above are distractions from work, not breaks to solve problems. This is very crucial, if your developer is working to have a break and not taking a break to be able to work more, you have a team with low productivity or even worse with crappy code quality. Their minds are not in it, the code is now an obstacle in their way of the “free time”. Be careful to understand your team and select the right distraction, maybe lego’s will be productive and video games disruptive, or maybe its the other way around, there is no recipe, its all about knowing who works with you.</p>
<p>I truly believe in this process and have had some of the best professional years of my life in companies that understand the importance of this break and the flexibility of time in the office, right now we have a <a
  href="http://mindstorms.lego.com/"target="_blank" rel="noopener"
  >Lego NXT</a
> and an iPad and they work great for me whenever I hit a wall in my code. Does it work for you? Is your company in on this? Leave your comments.</p>
]]></content:encoded></item><item><title>Using the Facebook PHP-SDK to run FQL</title><link>https://doh.ms/2011/01/12/using-the-facebook-php-sdk-to-run-fql/</link><pubDate>Wed, 12 Jan 2011 00:00:00 -0200</pubDate><guid>https://doh.ms/2011/01/12/using-the-facebook-php-sdk-to-run-fql/</guid><dc:language>en-US</dc:language><category>facebook</category><category>fql</category><category>php</category><category>php-sdk</category><description>As of Facebook’s migration to the new Graph API and its OAuth 2.0 protocols, I can say that their Developer documentation has become a confusing, misleading and generally unstrung pile of semi-deprecated articles, and I’m being optimistic in doing so. Problem is lots of old …</description><content:encoded><![CDATA[<p>As of Facebook’s migration to the new Graph API and its OAuth 2.0 protocols, I can say that their Developer documentation has become a confusing, misleading and generally unstrung pile of semi-deprecated articles, and I’m being optimistic in doing so. Problem is lots of old articles are still in there pointing to old practices and recommendations and most of these do not come with disclaimers pointing to new recommendations, and in some extremes old soon-to-be-deprecated methods do not even have equivalents in the new APIs.</p>
<p>The new SDKs have not, as you can say, fallen far from the tree. While they are really great new and shiny, documentation on how to use them is still vague, missing or spread out in the internet in blogs like these, in posts from us users trying to share the information with other soon-to-be-suffering developers.</p>
<p>So this is an example of this, i have been using these new resources and the new PHP-SDK and have ran into various walls, so I decided to start putting some of this on my blog, for 2 reasons: to spread the word, and to have notes for myself when I come back to this.</p>
<p><strong>How can I run FQL queries using the new SDK?</strong></p>
<p>FQL is Facebook’s SQL alernative, allowing you to query information as you would from a huge database, <a
  href="http://developers.facebook.com/docs/reference/fql/"target="_blank" rel="noopener"
  >this documentation</a
> is thankfully still up to date and you can see a list of “tables” you can query from, and the rest of the little tweaks you will pick up on a trial and error basis.</p>
<p>The old Facebook library, based on their REST API had a fairly easily and accessible method to run FQL</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> $facebook<span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">api</span><span style="color:#a6e22e">\_client</span><span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">fql</span><span style="color:#a6e22e">\_query</span>(<span style="color:#e6db74">&#34;SELECT uid, pic, pic\_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 111111111)&#34;</span>);
</span></span></code></pre></div><p>However this (and many other methods) is no longer available in the new <a
  href="https://github.com/facebook/php-sdk"target="_blank" rel="noopener"
  >PHP SDK</a
> so it took me a while to figure out how to get a FQL call into the library, since the only method available in this new library was <em>api()</em> a polymorphic and non-documented method. I finally was able to find the answer somewhere on a <a
  href="http://www.wickedbrilliant.com/2010/08/using-the-php-sdk-to-run-fql-queries-using-the-facebook-graph-api/"target="_blank" rel="noopener"
  >similar blog</a
> that ran into the same issue. This is how its done:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span> <span style="color:#75715e">//Get Facebook SDK Object $config = array( &#39;appId&#39; =&gt; APP\_ID, &#39;secret&#39; =&gt; API\_SECRET, &#39;cookie&#39; =&gt; true, );
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>$facebook <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">Facebook</span>($config);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Create Query $params = array( &#39;method&#39; =&gt; &#39;fql.query&#39;, &#39;query&#39; =&gt; &#34;SELECT uid, pic, pic\_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 111111111)&#34;, );
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Run Query $result = $facebook-&gt;api($params); ?&gt;
</span></span></span></code></pre></div><p>So once you do figure out that you can pass in the “method” parameter to define a API method to be called and then figure out that the query should be in a “query” parameter, you are set. Needless to say this might take a little longer to figure out then you would expect.</p>
<p>So this piece of code actually looks pretty horrid from my point of view, I don’t like having to create the array all the time to be passed to the function, so I decided to instead of using facebook’s SDK straight as is, I was going to extend it and push in some helper methods, namely a <strong>FQL helper method</strong>, this is what it looks like:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-php" data-lang="php"><span style="display:flex;"><span> <span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">namespace</span> <span style="color:#a6e22e">App\\Facebook</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">include</span><span style="color:#a6e22e">\_once</span> <span style="color:#a6e22e">\\ROOT\_PATH</span> <span style="color:#f92672">.</span> <span style="color:#e6db74">&#39;library/vendor/facebook/facebook.php&#39;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">class</span> <span style="color:#a6e22e">Client</span> <span style="color:#66d9ef">extends</span> <span style="color:#a6e22e">\\Facebook</span> { <span style="color:#66d9ef">private</span> $config; <span style="color:#66d9ef">private</span> $reqPerms;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">Runs</span> <span style="color:#a6e22e">a</span> <span style="color:#a6e22e">FQL</span> <span style="color:#a6e22e">query</span> <span style="color:#a6e22e">agains</span> <span style="color:#a6e22e">the</span> <span style="color:#a6e22e">API</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#a6e22e">param</span> <span style="color:#a6e22e">string</span> $query <span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#f92672">@</span><span style="color:#66d9ef">return</span> <span style="color:#66d9ef">array</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span> <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">fql</span>($query) { $params <span style="color:#f92672">=</span> <span style="color:#66d9ef">array</span>( <span style="color:#e6db74">&#39;method&#39;</span> <span style="color:#f92672">=&gt;</span> <span style="color:#e6db74">&#39;fql.query&#39;</span>, <span style="color:#e6db74">&#39;query&#39;</span> <span style="color:#f92672">=&gt;</span>$query, );
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">return</span> $this<span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">api</span>($params); }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>} $config <span style="color:#f92672">=</span> <span style="color:#66d9ef">array</span>(<span style="color:#f92672">/</span><span style="color:#a6e22e">\</span><span style="color:#f92672">*</span> <span style="color:#a6e22e">insert</span> <span style="color:#a6e22e">config</span> <span style="color:#a6e22e">here</span> <span style="color:#a6e22e">\</span><span style="color:#f92672">*/</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">//Using client $fb = new App\\Facebook\\Client($config);
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>$query <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;SELECT uid, pic, pic\_square, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 111111111)&#34;</span>; $result <span style="color:#f92672">=</span> $fb<span style="color:#f92672">-&gt;</span><span style="color:#a6e22e">fql</span>($query);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">?&gt;</span><span style="color:#960050;background-color:#1e0010">
</span></span></span></code></pre></div><p>So this makes it now nice and clean to use FQL as well as having the upside that the class is now nicely packed inside my namespace and as an added bonus, this class is now much easier to mock for unit testing, since i have a direct method to test for and not have to filter out params sent to the method.</p>
<p>I did go one step further with this and submitted this change to Facebook&rsquo;s SDK on github as a <a
  href="https://github.com/facebook/php-sdk/pull/295"target="_blank" rel="noopener"
  >pull request</a
>. It has not yet been replied to but i hope that soon it will make it into the actual code and more people will be able to benefit from it.</p>
<p>Hope you enjoy this and it gives you ideas on how to improve your usage of the Facebook PHP SDK and i&rsquo;ll come back with more in the future.</p>
]]></content:encoded></item><item><title>Como a Microsoft esta facilitando o desenvolvimento com PHP</title><link>https://doh.ms/2011/01/06/como-a-microsoft-esta-facilitando-o-desenvolvimento-com-php/</link><pubDate>Thu, 06 Jan 2011 00:00:00 -0200</pubDate><guid>https://doh.ms/2011/01/06/como-a-microsoft-esta-facilitando-o-desenvolvimento-com-php/</guid><dc:language>pt-BR</dc:language><category>iis</category><category>microsoft</category><category>php</category><category>webpi</category><description>Recentemente tive a oportunidade de conversar bastante com a Microsoft, junto com outros membros da comunidade PHP. Fomos recebidos por Josh Holmes (Evangelista de Arquitetos / EUA) e Rogério Cordeiro (Evangelista de Desenvolvedores / Brasil) na sede da Microsoft aqui em São …</description><content:encoded><![CDATA[<p>Recentemente tive a oportunidade de conversar bastante com a Microsoft, junto com outros membros da comunidade PHP. Fomos recebidos por <a
  href="http://joshholmes.com/"target="_blank" rel="noopener"
  >Josh Holmes</a
> (Evangelista de Arquitetos / EUA) e <a
  href="http://twitter.com/rogerioc"target="_blank" rel="noopener"
  >Rogério Cordeiro</a
> (Evangelista de Desenvolvedores / Brasil) na sede da Microsoft aqui em São Paulo, e fomos encaminhados ao auditório onde iniciamos uma conversa informal, mas muito interessante, por algumas horas. A ideia básica por trás da visita: nos mostrar algumas de suas novas ferramentas e receber um retorno e opiniões do que nós desenvolvedores pensamos de suas ferramentas, o que falta, o que esta quebrado e como arrumar.</p>
<p>A minha impressão sobre as novas ferramentas foi bem clara, ele cuidaram de problemas muito importantes, mas mais que isso, problemas que foram citados no Microsoft Web Developer Summit (MSWDS) que <a
  href="http://blog.rafaeldohms.com.br/2009/12/04/microsoft-web-developer-summit-2009-in-review/"target="_blank" rel="noopener"
  >pude participar em 2009</a
>, foi muito gratificante perceber isto, pois significava que eles estavam prontos para escutar e realmente estavam levando nossas opiniões em consideração, tornando esta reunião muito mais importante e mostrando que temos uma parcela de participação no assunto (obviamente não longe o bastante para afetar o plano de negócios deles).</p>
<p><strong>Então, como a Microsoft esta facilitando o desenvolvimento com PHP?</strong></p>
<p>Montar uma pilha LAMP (Linux, Apache, MySQL, PHP) completa em um servidor linux é algo relativamente simples se você possui conhecimentos básicos de Linux a da linha de comando, mas aqui no Brasil temos uma grande parcela de programadores PHP usando Windows como seu primeiro ambiente de desenvolvimento, especialmente se analisarmos o nível mais iniciante da comunidade (desenvolvedores experientes geralmente estão em linux ou mac hoje em dia). Isso significa que no nível de entrada a primeira experiência de um programador com PHP é em uma pilha WAMP (Windows, …). Sem dúvida você pode usar soluções como o XAMPP ou WAMP Server para instalar a pilha completa, mas convenhamos <strong>Apache e PHP no Windows é no máximo horrível</strong>, e isso deixa uma má impressão nos desenvolvedores. Qual é a solução? Bem, é o IIS, mas levanta a mão ai os iniciantes que tem a mínima idéia de gerenciamento de IIS ou configuração, ou até mesmo quem <em>quer</em> saber disso. Estou chutando, mas aposto que poucas mão estão levantadas agora.</p>
<p>Entra em cena o Web Plataform Installer, lançado alguns anos atrás ele resolve este problema muito bem, instala a pilha e aplicações como Drupal ou Wordpress ou qualquer software relacionado e configuração necessária. Ele ataca diretamente na raiz o problema de se ter uma pilha funcionando, e ele faz isso muito bem na versão 2.0. O que vimos na reunião me fez acreditar que isso vai melhorar ainda mais: WebPI 3.0, atualmente em beta.</p>
<p>Esta versão também marca o lançamento do <a
  href="http://ruslany.net/2010/08/php-manager-for-iis-7-beta-release/"target="_blank" rel="noopener"
  >PHP Manager</a
> que faz a tarefa de configurar e gerenciar instalações de PHP mamão com açúcar, e ainda nos dá outra possibilidade muito bacana, ter múltiplas versões de PHP rodando lado a lado na mesma máquina, cada site rodando em uma versão, isso significa que você pode hospedar sua aplicação legado e ter uma novinha em folha rodando PHP 5.3 na mesma máquina. Isso é realmente bom para aquele perfil de iniciante que agora pode ter em suas mãos muito poder e com uma curva de entrada muito baixa. Isto também ajuda outra camada de desenvolvedores, os criadores de frameworks a aplicações, pois isso torna muito fácil o processo de subir máquinas virtuais com Windows e testar seu novo release em diversas versões do PHP, quantas vezes você já sofreu pra fazer isso?</p>
<p>Outro pacote bem interessante é o <a
  href="http://www.microsoft.com/web/webmatrix/features/"target="_blank" rel="noopener"
  >WebMatrix</a
>, que fornece um ambiente de desenvolvimento completo com todos os pacotes “Express” e inclui uma IDE leve e simples para trabalhar com código. Mas a parte mais legal é que ele também cuida de um problema que todos nós no MSWDS falamos em coro, <em>“fazer deploy para servidores Windows é doloroso”</em>. É a função “publicar” que permite conectar sua máquina com um servidor Windows e fazer o deploy completo direto da ferramenta, um simples apertar de botão, que tal isso para facilitar a vida?</p>
<p>Ainda falando de WebPI outra funcionalidade muito bacana: Galeria de Aplicativos. Imaginem um feed com centenas de aplicativos a um simples clique de uma instalação completa, isso é muito bom para aquelas rotinas diárias e simples, como subir uma instancia de Wordpress para sua vó. Mas ela vai muito além disso para aquela parcela de desenvolvedores que baseia sua carreira em vender aplicativos comerciais ou gratuitos. O motivo é simples, se você entra em programas como o Website Spark, você pode colocar seu sistema/aplicação lá, a um clique de distancia do seu público alvo. Que tal isso para espalhar sua aplicação?</p>
<p>A Microsoft também foi além e deu a nós programadores PHP uma solução de “cloud”, já que o Google fez cara feia no Google App Engine, podemos olhar melhor para o Azure, mas deixarei isso para um post dedicado.</p>
<p>Como uma pessoa que participou da iniciativa da Microsoft de extender a mão para a comunidade PHP e que teve a oportunidade de apontar os erros deles e aplaudir seus sucessos, eu realmente queria compartilhar esta mensagem com vocês, pois acrdito que chegamos a um ponto “divisor de águas” onde o Windows se torna um jogador titular na pilha PHP, junto do Linux, como o Rasmus mesmo <a
  href="http://twitter.com/rasmus/status/10325288521"target="_blank" rel="noopener"
  >falou</a
>.</p>
]]></content:encoded></item><item><title>Meme: Seu Ambiente de Desenvolvimento em 7 items</title><link>https://doh.ms/2010/12/17/meme-seu-ambiente-de-desenvolvimento-em-7-items/</link><pubDate>Fri, 17 Dec 2010 00:00:00 -0200</pubDate><guid>https://doh.ms/2010/12/17/meme-seu-ambiente-de-desenvolvimento-em-7-items/</guid><dc:language>pt-BR</dc:language><category>ambiente</category><category>ferramentas</category><category>meme</category><category>php</category><description>Esta ideia originou com o Duodraco e o Augusto Pascutti. Simples e direta, escreva sobre o seu ambiente de trabalho, suas ferramentas do dia a dia de programador, vamos conhecer um pouco melhor nossas opções, vejam as regras</description><content:encoded><![CDATA[<p>Esta ideia originou com o <a
  href="http://duodra.co"target="_blank" rel="noopener"
  >Duodraco</a
> e o <a
  href="http://blog.augustopascutti.com"target="_blank" rel="noopener"
  >Augusto Pascutti</a
>. Simples e direta, escreva sobre o seu ambiente de trabalho, suas ferramentas do dia a dia de programador, vamos conhecer um pouco melhor nossas opções, vejam as regras</p>
<blockquote>
<p>1ª – escreva sobre 7 itens de seu ambiente de trabalho – fale sobre qualquer ponto que quiser; 2ª – indique de 3 a 5 pessoas para que possivelmente façam um artigo sobre seu ambiente.</p>
</blockquote>
<p>Como fui indicado, aqui vai minha parte</p>
<p><strong>1. SO: Mac OS X</strong> Pode chamar de fanboy, mas a realidade é que o Mac pra mim reuniu tudo que eu procurava, uma interface amigável, uma linha de comando e menos stress no quesito drivers. Sim, eu sei que o hardware é amarrado, bla bla bla, mas isso funciona para mim, os softwares como o Textmate são incríveis e eu me acostumei. Acho o Windows careta e fechado demais e o Linux “faça você mesmo” demais.</p>
<p><strong>2. VCS: SVN e Git</strong> Quiserá eu listar somente o git, mas na realidade pelo meu emprego ainda conta com o bom e velho SVN. Porém fora disso todos meus repositórios são ou git ou git-svn. Juntamente com o <a
  href="http://github.com"target="_blank" rel="noopener"
  >GitHub</a
> o conjunto de ferramentas agilizou meu trabalho e ainda pro cima aumentou minha quantidade de contribuições com projetos OSS.</p>
<p><strong>3. IDE: NetBeans e Zend Studio / Textmate</strong> Este é um ponto complicado, ambas IDEs são carregadas e pesadas enquanto o Textmate possui features limitadas mas voa baixo. Basicamente o Textmate eu uso para consultas e codadas rápidas e HTML/CSS e as IDEs para PHP mesmo. Estou migrando pro NetBeans desde o PHP 5.3 mas ainda preciso voltar e testar a nova versão do Zend Studio. Adoraria achar uma IDE leve e nativa com o feature set destas duas, especialmente um auto-complete decente com namespaces bem implementado, Komodo falhou por pouco no auto-complete.</p>
<p><strong>4. Testes: PHPUnit + Mockery</strong> Não podem faltar na minha caixa de ferramentas. Testes são lindos e mocks são necessários, até pouco tempo não conhecia o <a
  href="https://github.com/padraic/mockery"target="_blank" rel="noopener"
  >Mockery</a
> mas agora descobri e estou adorando a facilidade dele. Já o PHPUnit não tem competição ao meu ver, completo, robusto, fácil, linha de comando e rápido. Não saia de casa sem eles.</p>
<p><strong>5. Continuos Integration: Hudson</strong> Eu diria que não há competição aqui, mas o <a
  href="http://arbitracker.org/"target="_blank" rel="noopener"
  >Arbit</a
>, nativo em PHP, tem bastante potencial para os projetos que estou cuidando. Porém, atualmente o Hudson é pau pra toda obra e sua coleção de um gazilhão de plugins tem opções para tudo e todas funcionalidades que possa imaginar. Sim é Java, mas nem parece, longe do que é o CruiseControl e o seu Terror de instalação e manutenção</p>
<p><strong>6. Frameworks: ZF e Dcotrine 2</strong> Não rola, depois de ver a dupla em ação não tem pra mais ninguém. Ok, quem sabe o Symfony 2 quando estabilizar, mas pra produção hoje, não consigo mais sobreviver sem estes dois, tudo fica tão simples, fácil, rápido e produtivo que nem tento mais outra coisa, salvo em projetos para pesquisa. Com a integração feita pelo Guilherme Blanco, sugestivamente chamada de <a
  href="https://github.com/guilhermeblanco/ZendFramework1-Doctrine2"target="_blank" rel="noopener"
  >Bisna</a
>, a combinação é perfeita e indolor.</p>
<p><strong>7. IRC: Colloquy</strong> Esse é menção honrosa, e se você perguntar mas que infernos isso tem a ver com ambiente de desenvolvimento eu te respondo: tudo! O IRC é minha fonte principal de resolução de dúvidas, meu canal de comunicação direto com os criadores do PHP, do ZF, do Doctrine, enfim de todo meu escopo de ferramentas praticamente. O colloquy é simples, rápido e elegante o bastante pra me permitir ter 15 canais abertos 24/7</p>
<p>E lá vamos nós, minha vitimas serão:</p>
<ol>
<li><a
  href="http://twitter.com/#!/arglbr"target="_blank" rel="noopener"
  >Adriano Laranjeira</a
></li>
<li><a
  href="http://chester.blog.br/"target="_blank" rel="noopener"
  >Chester</a
></li>
<li><a
  href="http://about.me/silvanojr"target="_blank" rel="noopener"
  >Silvano Jr.</a
></li>
<li><a
  href="http://about.me/alganet"target="_blank" rel="noopener"
  >Alexandre Gaigalas</a
></li>
<li><a
  href="http://marcelioleal.com/"target="_blank" rel="noopener"
  >Marcelio Leal</a
></li>
</ol>
]]></content:encoded></item><item><title>How Microsoft is making PHP Development easier</title><link>https://doh.ms/2010/12/09/how-microsoft-is-making-php-development-easier/</link><pubDate>Thu, 09 Dec 2010 00:00:00 -0200</pubDate><guid>https://doh.ms/2010/12/09/how-microsoft-is-making-php-development-easier/</guid><dc:language>en-US</dc:language><category>iis</category><category>microsoft</category><category>php</category><category>webpi</category><category>windows</category><description>Recently i had an opportunity to have a chat with Microsoft, along with a few PHP community members. We were greeted by Josh Holmes (Architect Evangelist / US) and Rogerio Cordeiro (Developer Evangelist / Brasil) at the Microsoft HQ in São Paulo and headed over to a auditorium …</description><content:encoded><![CDATA[<p>Recently i had an opportunity to have a chat with Microsoft, along with a few PHP community members. We were greeted by <a
  href="http://joshholmes.com/"target="_blank" rel="noopener"
  >Josh Holmes</a
> (Architect Evangelist / US) and Rogerio Cordeiro (Developer Evangelist / Brasil) at the Microsoft HQ in São Paulo and headed over to a auditorium where we started off a informal but very interesting talk for a few hours. This was the basic idea behind the visit: to show us a few of their new tools and get feedback from what we developers think or their tools, what is missing, what is broke, how to fix it.</p>
<p>The main impression I got from the new tools was pretty clear, they had addressed important issues, but most importantly they had addressed the issues which were raised at the Microsoft Web Developer Summit (MSWDS) which <a
  href="http://blog.rafaeldohms.com.br/2009/12/04/microsoft-web-developer-summit-2009-in-review/"target="_blank" rel="noopener"
  >I had attended in 2009</a
>, it was quite impressive to note this, because it meant that they were really listening to this kind of feedback, making this meeting even more important and showing us developers that we really have a say in the matter (yes, obviously not as far as messing with their business plan).</p>
<p><strong>So, how is Microsoft making PHP Development easier?</strong></p>
<p>Deploying a full LAMP stack on a linux server is something relatively simple if you have some basic knowledge of Linux and the command line, but in Brasil we have quite a big chunk of PHP Developers using Windows as their development platform, especially if you look at the beginner level of the community (most advanced developers are on linux or mac nowadays). This means that at an entry level the developer’s first experience with PHP is on a WAMP stack. Sure you can use solutions like XAMPP or WAMP Server to install a full stack, but <strong>Apache + PHP performance on the Windows platform is horrid at best</strong>, and that leaves a bad impression on developers. What is the solution? Well, its IIS, but show me a raise of hands of how many beginners have the slightest idea of IIS Management or configuration, or even those who <em>want</em> to have that knowledge. My guess is very few hands are up right now.</p>
<p>In comes the Web Platform Installer, released a few years back it solves this problem pretty well, install the whole stack, any applications like Drupal or Wordpress or any related software or configuration needed. It takes an axe straight to the root of getting a development stack up and running, and it does all that very well in version 2.0. What we got a glimpse at during the meeting made me believe this is going to get even better: WebPI 3.0, currently in beta.</p>
<p>This version marks also the release of <a
  href="http://ruslany.net/2010/08/php-manager-for-iis-7-beta-release/"target="_blank" rel="noopener"
  >PHP Manager</a
> which makes it really easy to manage PHP installs and gives us a very cool possibility, have multiple versions of PHP running side by side on the same machine, each website running its own version, this means you can support your legacy application alongside your new toy all shiny and new and using PHP 5.3. This is really good for that beginner profile who can now have all this power in his hands at a very low entry cost. It also helps another layer of developers, the framework and application designers, this makes it really easy to fire up a VM with windows and test the software you are about to release with various PHP versions, how many times have you had to struggle to do this?</p>
<p>Another very cool part of this package is <a
  href="http://www.microsoft.com/web/webmatrix/features/"target="_blank" rel="noopener"
  >WebMatrix</a
>, it gives you a full dev environment with all the Express packages and it includes a lightweight IDE for code development. But the coolest part of this is on that addresses a message we all agreed on at MSWDS, <em>“deploying to a windows server is a pain”</em>. This is the publish feature that allows you to connect to a windows server and direct the full deploy straight from the tool, a button push away, how’s that for making stuff easy?</p>
<p>Still on WebPI there is another cool feature: the Application Gallery. Imagine a feed with hundreds of applications just a click away from install, that is really good for those everyday routine deploys like getting wordpress up and running for your grandma. But it goes much further for that layer of developers that base their business around selling commercial or free web applications. The reason is pretty straight forward, if you join programs like Website Spark, you can get your application listed in the gallery, just one click away from your user base. How’s that for spreading applications?</p>
<p>Microsoft has also gone further and given us PHP devs a cloud solution where we can use PHP, since Google has frowned upon our language on Google App Engine, we can have a closer look at Azure, but i’ll leave this to a post in itself.</p>
<p>As someone who took part in Microsoft reach for the PHP community and who had the chance of pointing out their mistakes and applauding there successes I really wanted to share this message with you, because i think we have reached a turning point where Windows is now a First-Class Citizen in the PHP stack, alongside Linux, as Rasmus himself <a
  href="http://twitter.com/rasmus/status/10325288521"target="_blank" rel="noopener"
  >has said</a
>.</p>
]]></content:encoded></item><item><title>Changes on their way</title><link>https://doh.ms/2010/11/22/changes-on-their-way/</link><pubDate>Mon, 22 Nov 2010 00:00:00 -0200</pubDate><guid>https://doh.ms/2010/11/22/changes-on-their-way/</guid><dc:language>en-US</dc:language><description>So over the next few weeks this space right here is going to be seeing lots of changes. This is just a warning that any broken links should be ignored over these weeks and will be promptly migrated to the new structure, but changes might take some time to go around.</description><content:encoded>&lt;p>So over the next few weeks this space right here is going to be seeing lots of changes. This is just a warning that any broken links should be ignored over these weeks and will be promptly migrated to the new structure, but changes might take some time to go around.&lt;/p>
&lt;p>So keep an eye on this spot, hopefully the new changes will mean a more active blog and much more content for all of you. Hope you like it.&lt;/p>
</content:encoded></item><item><title>Mudanças a caminho</title><link>https://doh.ms/2010/11/22/mudancas-a-caminho/</link><pubDate>Mon, 22 Nov 2010 00:00:00 -0200</pubDate><guid>https://doh.ms/2010/11/22/mudancas-a-caminho/</guid><dc:language>pt-BR</dc:language><description>Fiquem de olho nesse espaço, nas proximas semanas muitas coisas irão mudar por aqui. Esse post é somente um aviso para ignorarem links quebrados e instabilidades, tudo será portado, mas as mudanças podem demorar um pouco mais a se refletirem pra todo canto.</description><content:encoded>&lt;p>Fiquem de olho nesse espaço, nas proximas semanas muitas coisas irão mudar por aqui. Esse post é somente um aviso para ignorarem links quebrados e instabilidades, tudo será portado, mas as mudanças podem demorar um pouco mais a se refletirem pra todo canto.&lt;/p>
&lt;p>Eu espero que as mudanças signifiquem atualizações mais frequentes deste blog e mais conteudo para voces, em breve mais posts falando sobre as mudanças.&lt;/p>
</content:encoded></item><item><title>Review: The Art of Community - Jono Bacon</title><link>https://doh.ms/2010/08/11/review-the-art-of-community-jono-bacon/</link><pubDate>Wed, 11 Aug 2010 00:00:00 -0300</pubDate><guid>https://doh.ms/2010/08/11/review-the-art-of-community-jono-bacon/</guid><dc:language>en-US</dc:language><category>book</category><category>community</category><category>jono-bacon</category><category>php</category><category>review</category><description>I must confess that Jono Bacon actually caught me by surprise. While I was following the creation process of the book (O’Reilly invited UG leaders to send feedback) I could have never imagined I would one day have something so useful for someone who deals with communities on a …</description><content:encoded><![CDATA[<p>





























  





  

  
  
    
      
    


    
    


    
    
      
      
    
    
    


    
    
      <img
        src="/images/blog/cat.gif"
        loading="lazy"
        decoding="async"
        
        alt="cover"
        class="rounded img"
        width=""
        height="" />
    
    
  


  

</p>
<p>I must confess that Jono Bacon actually caught me by surprise. While I was following the creation process of the book (O’Reilly invited UG leaders to send feedback) I could have never imagined I would one day have something so useful for someone who deals with communities on a day to day basis. In this universe Jono is a well known figure, with vast experience in managing and participating in online communities, which credits him as a perfect candidate to write a book like this one.</p>
<p>A book about how to manage and live amongst virtual communities has all the elements to be a boring book full of “do’s and don’t’s”, in summary a very repetitive and unpleasant book. However Jono proves his understanding of the communication channels (important part of any community) right off the bat in the book’s introduction. Here he showcases his writing strategy, <em>telling personal experiences</em>. Building on top of this premise the author goes throughout the book presenting us with new concepts or strategies and following it up with a real life example from his and others’ experience in communities. This makes the book a delightful read, easy and flowing, the kind of book you can pickup anywhere and have fun while you plow through the pages, perfect for the everyday life of lines and waiting. I recommend loading it up on your e-reader if you got one.</p>
<p>The book is incredibly broad and valid for numerous roles inside every community, from managers to members, volunteers, to the regular Open Source developer. Each level of the community stands to gain from this book and even people who work with or use the community, such as marketing people, and activists who need to learn how to communicate and win-over the communities. Each chapter dives into a different and fundamental aspect, like communication, building buzz, measuring, events and handling conflicts.</p>
<p>Anyone who has ever managed a community and looks at this table of contents will surely have a few flashbacks of various moments in their experience, I know I for one identified myself in quite a few situations, from my motivation to participate in the PHP community to the conflicts and the experience of contributing to Open Source. I usually like to give more details of each chapter when I do reviews like this one, but in this case that feels like I would be cheating the reader from the amazing experience of having Jono lead you through his experiences and concepts, so i’ll not do it.</p>
<p>In summary, if you have any involvement with virtual communities, be it as a manager, member or just someone who interacts with them, this book should have its place in your shelf. Buy it, read it, enjoy it an have fun while you learn to take your community to the next level.</p>
<blockquote>
<p><strong>The Art of Community</strong></p>
<p>Author: Jono Bacon ISBN: 978-0-596-15671-8 Pages: 400 Year: 2009 Publisher: O’Reilly <a
  href="http://oreilly.com/catalog/9780596157234/"target="_blank" rel="noopener"
  >On O’Reilly</a
> <a
  href="http://goo.gl/MPN4z"target="_blank" rel="noopener"
  >On Amazon</a
></p>
</blockquote>
]]></content:encoded></item></channel></rss>