Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sergey Zhuk:
Managing ReactPHP Promises
Jan 18, 2018 @ 16:50:01

In a new post to his site Sergey Zhuk has a tutorial showing you how to manage promises in ReactPHP. Since promises are fired asynchronously they can be difficult to manage and use their output across the application.

Asynchronous application is always a composition of independently executing things. In concurrency, we are dealing with a lot of different things at once. [...] So, to make concurrency work you have to create a communication between these independent parts to coordinate them. And here come promises. They are the basic unit of concurrency in an asynchronous application. They are the blood of the asynchronous application and move the results between different tasks across the code.

He then covers a few different situations and offers advice on how to more correctly handle them:

  • I don’t know exactly what the resolver will give me
  • I want to reject a promise but without throwing an exception
  • I want to run multiple tasks and when they all finish do something else
  • I have some pending tasks and want to continue once I receive the first feedback
  • I have some pending tasks and want to continue once the first one is completed
  • I have some pending tasks and want to continue once a certain number of tasks will be completed

Code is provided for each of the situations giving you an easy, ready to use example for your application. Most require only a few lines to get the job done and can be very useful in the right circumstances.

tagged: reactphp manage promises situation code example tutorial

Link: http://sergeyzhuk.me/2018/01/16/reactphp-managing-promises/

JoliCode Blog:
How to properly manage translations in Symfony?
Dec 14, 2017 @ 16:13:31

The JoliCode site has posted a tutorial for the Symfony users out there sharing their method for properly managing translations when using the framework.

We already wrote about our Symfony translation workflow some years ago. But since 2015, lots of things have evolved and it was time to update this workflow.

The aim stays the same, keeping app translation simple and fluent for all stakeholders of the project. To achieve this, we had chosen an external tool: Loco, which centralizes translation data, and a piece of code written to synchronize it with Symfony translation files.

The article talks about the two main methods (bundles) used in the Symfony ecosystem to manage translations but they couldn't connect them with their chosen tool (Loco). The tutorial then shows how they moved to using the php-translation bundle and how to use the Loco UI to manage the keys connected to it. It also covers the use in testing, migrating to production and what's currently missing from Loco they'd like to see.

tagged: manage translation symfony framework tutorial loco bundle

Link: https://jolicode.com/blog/how-to-properly-manage-translations-in-symfony

Théo Fidry:
Managing your dependencies in PHP
Dec 04, 2017 @ 18:55:12

In a recent article Théo Fidry covers a topic that's become common with the use of Composer and various PHP packages: managing dependencies.

When you are creating a PHP application or library, you usually have 3 kinds of dependencies:
  • Hard dependencies: what your application/library needs to be able to run
  • Optional dependencies: for example a PHP library can provide a bridge for different frameworks
  • Development dependencies: debugging tools, test frameworks…

He then works through several of the issues involved with using each including having too many dependencies, untestable dependencies and conflicts. He then counters these with some helpful suggestions around them including the use of phars and using multiple repositories to break down the package and make it easier to manage their dependencies.

tagged: manage dependency composer problem solution example

Link: https://medium.com/@tfidry/managing-your-dependencies-in-php-321d584441ab

Toptal.com:
Tips to Attract, Manage, and Retain Software Developers
Nov 30, 2017 @ 16:57:01

On the Toptal.com site they've posted an article from Fernando Martinez with some suggestions about how to attract and retain software developers. The ideas cover the full range - all the way from the job posting/interview process out to how to keep them with the company and help them thrive in their role.

Management is all about people. Whether managers or employees, both are thinking about how to achieve their personal and professional goals. The combination of these goals and the personal traits of the people involved give shape to relationships that, in time, can be positive, productive, and fulfilling, or sometimes just plain stressful, demanding, and conflict-prone.

[...] This is especially true in managing software developers, because of their job’s technical complexity and creative nature, compressed into often narrow timelines for producing results. [...] In this article, we will focus on the main management aspects, rather than on the technical ones, that we think should be considered by anyone who wants to be successful in managing to retain software developers.

He starts with a look at how to attract and hire the right people for the roles you're trying to fill with suggestions about the interview process and the job offer. Next he gets into recommendations about managing the team itself and the importance of training, organization and communication. The article then goes on to cover other topics like conflict management, keeping up motivation and assigning objectives/follow up.

tagged: attract manage retain software developer opinion recommendation

Link: https://www.toptal.com/software/attract-retain-software-developers

TutsPlus.com:
How to Manage Multiple Applications in CodeIgniter
Nov 28, 2017 @ 16:29:11

The TutsPlus.com site has posted a new tutorial showing the CodeIgniter users out there how to manage multiple sites written using the framework. Traditionally CodeIgniter applications needed to be run as separate instances but their method simplifies the setup by needing only one instance for all.

Today, we’re going to explore how you can manage multiple applications in the CodeIgniter web framework using a single codebase. In the course of that, we’ll go ahead and create two different CodeIgniter applications that will share the core CodeIgniter codebase.

Sharing the core codebase across different applications is not something new as it’s already practiced by different frameworks and open-source systems, and CodeIgniter is no different. It easily allows you to manage multiple applications that share the core CodeIgniter library and API files, and at the same time you could use different databases and site-specific configurations.

The article then starts with some of the benefits of using a multisite setup including simpler maintenance and the ability to use different databases for each. It then gets into the process for creating multiple applications using separate directories under an "applications" directory and creating sample "welcome" content under each. Finally, they make some changes to the configuration to use an environment variable to switch out which front controller (index.php) file to direct the request to (as set up in the web server config).

tagged: manage multiple application codeigniter tutorial website

Link: https://code.tutsplus.com/tutorials/manage-multiple-applications-in-codeigniter--cms-29795

Laravel News:
Manage your Laravel Forge Sites and Servers through Alfred
Apr 17, 2017 @ 21:04:38

On the Laravel News site there's a quick post showing you how you can use the Alfred tool to manage your Forge created servers. Alfred is a productivity tool for OSX systems that makes it easier to create shortcuts and interface with external applications in a convenient way.

Since the release of the Forge API developers have started creating a lot of apps and integrations, as well as an unofficial SDK. For those that use Alfred on the Mac, Vince Mitchell, launched a Workflow so you can quickly run many Forge commands right from your desktop.

The post includes the list of commands that the workflow includes allowing you to perform operations like opening the server's page in a browser, rebooting a system and restarting the web server on a specific machine. You can grab the workflow from the Packal site and drop it into your Alfred installation for immediate use.

tagged: alfred manage server laravel forge workflow example api

Link: https://laravel-news.com/forge-alfred-app

Rob Allen:
Using Phive to manage PHPUnit
Jan 05, 2017 @ 16:36:41

Rob Allen has a new post to his site sharing the work he's done to get PHPUnit managed with Phive, an "installation and verification environment" that is used in the installation of Phar archives.

I recently came across the Phive project and have had a play with it. Phive is part of phar.io and is intended to manage development tools such as PHPUnit in preference to using Composer's dev dependencies. The main advantages of Phive are that it uses the phar file of the tool and only keeps one copy of each version rather than downloading a new copy into each project.

He starts off talking briefly about how the tool works and what it's doing behind the scenes to download the phar archives requested. He shows how to define a target directory, install for global use and explains how GPG signatures work into the installation process.

tagged: phive install phar manage gpg signature verification environment phpunit tutorial

Link: https://akrabat.com/using-phive-to-manage-phpunit/

MyBuilder Tech Blog:
Managing Background Processes within Symfony
Dec 02, 2016 @ 17:19:47

Edd Mann has written up a tutorial for the MyBuilder.com Tech blog about managing background processes in a Symfony application with the help of Supervisor.

When a web application reaches a sufficiently large size, it can become infeasible to perform all actions required within a single web request/response life-cycle. You may find yourself wishing to for example - batch up and send queued emails at particular intervals, or process payments asynchronous to the point in-time the user made the initial request. In this post I would like to discuss our changing use of background processes (both time-dependent and continuous) due to increasing throughput demands.

He starts out with the first approach most applications take when needing to run automated, asynchronous processes - cron. Using it and a custom bundle they created for it, Edd shows how to directly integrate the cron timing of commands into the class attributes. However, after a while the system grew and it needed something a bit more powerful than cron, something that could correctly handle long running processes. Ultimately they decided on Supervisor, a processes manager and control system that makes managing these processes simpler. He talks about the transition they made from cron over to Supervisor (safely) and how they integrated the signaling functionality Supervisor allows into their application.

tagged: symfony background process manage cron supervisor tutorial bundle

Link: http://tech.mybuilder.com/managing-background-processes-within-symfony/

NetTuts.com:
Building Your Startup With PHP: Collecting and Managing User Reports and Feedback
Oct 11, 2016 @ 17:13:05

TutsPlus.com has posted the latest part of their "Building Your Startup with PHP" series following along with the creation of a "meeting planner" application based on the Yii2 framework. In this new article the focus is on collecting and managing user feedback and reports for a simple support system.

In this series, I'm guiding you through launching a startup from concept to reality using my Meeting Planner app as a real-life example. Every step along the way, I'll release the Meeting Planner code as open-source examples you can learn from. I'll also address startup-related business issues as they arise.

In this tutorial, I'm going to guide you through how I quickly and economically launched a support system and knowledge base for the application as well as some of the issues and alternatives I considered.

He starts with some of the third-party options he considered including Zendesk, Grove and Freshdesk. In the end he decided to go with the last option as it had the startup-friendly combination of a free account for small business and good functionality at that level. He covers their pricing levels, the signup process and the basic usage of the account and hooking it into Mailgun for sending/receiving emails. He also walks you through customizing the domain to match yours and updating the code to make the "Support" URLs match the new Freshdesk setup.

tagged: collect manage user feedback report startup tutorial series

Link: https://code.tutsplus.com/tutorials/building-your-startup-with-php-collecting-and-managing-user-reports-and-feedback--cms-23356

Freek Van der Herten:
A modern package to generate html menus
Mar 25, 2016 @ 16:17:38

In this new post to his site Freek Van der Herten shares a new package he's worked up to help generate and maintain the status of menus in a Laravel application. While this example is Laravel-centric, there's also a framework-agnostic package that can be used in any application structure too.

Virtually every website displays some sort of menu. Generating html menus might seem simple, but it can become complex very quickly. Not only do you have to render some basic html, but you also have to manage which item is active. If a menu has a submenu you’ll also want the parents of an active item to be active. Sometimes you want to insert some html between menu items.

There are some packages out there that can help generating menus, but most of them have a messy API or have become victims of feature creep. Thanks why we decided to create our own modern menu package that has a beautiful API to work with.

He spends the rest of the post introducing the package, starting with the generation of a basic menu (and something a bit more complex). He also shows the use of the isActive method call to mark something as "active" but the package will handle that automatically for you if you'd like to keep it simple. He ends the post with a listing of the components that make this menu handling work (three of them) and some of the "modern PHP" functionality that they use.

tagged: menu package library html generate output manage active

Link: https://murze.be/2016/03/a-modern-package-to-generate-menus/


Trending Topics: