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

Rob Allen:
Converting a Composer dependency to git for editing
Oct 04, 2017 @ 14:50:40

Rob Allen has a quick post to his site that could help out Composer users when they need to transition to a git copy of a repository rather than an export.

I'm adding a new feature to ZF's Problem-Details component and it's easiest to do this within the context of the application I'm developing.

The component lives in vendor/zendframework/zend-problem-details and was installed using composer require so doesn't have its own git repository as the distribution zip file was used to install it.

He shows how to use the built-in --prefer-source option for Composer to pull down a clone of the repository rather than the copy. This allows you do develop right in the same environment without having to re-clone the repository somewhere else and work from there.

tagged: composer git clone source preference

Link: https://akrabat.com/converting-a-composer-dependency-to-git-for-editing/

Benjamin Eberlei:
Symfony All The Things (Web)
Oct 27, 2014 @ 14:18:52

In his latest post Benjamin Eberlei talks about some of his reasoning to want to Symfony all the things when it comes to building web applications. Actually, it's the results of a discussion he had with a coworker about when is the right point to move from a micro-services infrastructure to a full-stack framework like Symfony.

We use microservice architectures for the bepado and PHP Profiler projects that Qafoo is working on at the monent. For the different components a mix of Symfony Framework, Silex, Symfony Components and our own Rest-Microframework (RMF) are used. This zoo of different solutions sparked a recent discussion with my colleague Manuel about when we would want to use Symfony for a web application.

He talks about some of his own reasons for making the choice including things like the HttpKernel and having a well documented and standardized solution. He notes that most of his reasons are more because of his previous exposure to the framework and could be very similar for others and other frameworks, though. He then extends on the "Hello World" code from the previous post and makes an improved minimal Symfony app with just seven basic parts (including configuration files).

tagged: symfony framework minimal reasons preference webapp

Link: http://www.whitewashing.de/2014/10/26/symfony_all_the_things_web.html

Derick Rethans:
Read Preferences wth the MongoDB PHP driver
Dec 20, 2012 @ 19:41:24

Derick Rethans has a new post to his site detailing some of the "read" preferences that you can customize in the latest versions of the MongoClient functionality in the MongoDB PHP extension for replica sets and sharing setups.

Read Preferences are a new Replica Set and Sharding feature implemented by most MongoDB drivers that are supported by 10gen. This functionality requires MongoDB 2.2. In short, Read Preferences allow you to configure from which nodes you prefer the driver reads data from. In a Replica Set environment it is the driver that does the selection of the preferred node, and in a Sharded environment it is the mongos process that routes queries according to the defined Read Preferences.

He starts with a look at the read preference types (like "primary", "secondary" and "nearest") how the connection manager works to handle each type. He includes some code samples showing how to configure your MongoClient connections to use these various types of preferences. He also introduces the concept of "tags" for the replica set - aliases to make them a bit easier to identify when making a connection and how to define them in the connection string.

tagged: mongodb mongoclient read preference replicaset sharding connection tutorial

Link:


Trending Topics: