News Feed
Sections




News Archive
feed this:

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

Master Zend Framework:
Easy Cache Configuration With StorageCacheAbstractServiceFactory
August 07, 2014 @ 14:46:54

The Master Zend Framework site has posted a tutorial centered around caching in Zend Framework 2 applications. In this new post Matthew Setter looks at using the StorageCacheAbstractServiceFactory to handle the configuration and management of caching. The method is already implemented in the skeleton ZF2 application, so it makes it even easier to get started.

If you've been playing with Zend Framework 2 for some time, specifically the ZF2 Skeleton Application, you still may not have come across some of the pre-registered service manager abstract factory options. As I was browsing through the Application module's module.config.php recently, I came across this snippet [setting up the StorageCacheAbstractServiceFactory]. It was at that point I wondered why I'd spent time setting up caching using other methods, when this approach was already there and seemed to do a lot of the heavy lifting for me. So in this week's tutorial, I'm going to take you through how to use it, working with the default configuration provided in the manual.

He shows how to update the default configuration for the caching service including the caching type (the technology) and the configuration options to use. He mentions the kinds of caching available and provides a more "real world" example. This example uses the Laravel Homestead VM and a simple Redis server as the caching datastore. He sets up the configuration and shows how to access the caching service in both the controller and via dependency injection. He finishes off with a few lines of code showing how to use the caching to check for an item and, if not found, add it to the dataset.

0 comments voice your opinion now!
zendframework2 tutorial cache configuration storagecacheabstractfactory

Link: http://www.masterzendframework.com/servicemanager/storage-cache-abstract-service-factory-easy-cache-configuration

PHPBuilder.com:
Using PHP Configuration Patterns Properly
April 16, 2014 @ 11:52:11

On PHPBuilder.com today they have a new post showing different configuration patterns for getting localized settings into your applications. They show the use of INI files, PHP scripts, text files, XML data and a database call.

PHP is a cross platform language. It is a server based application so we must think about the configuration settings of the PHP software. There are various ways of creating configurable PHP applications. The configuration flexibility comes as a built in feature in PHP. But we must understand the requirement clearly before making an application configurable. This article explores different PHP configuration patterns and their implementation.

For each of the options mentioned, there's a brief description of what the method is, some of the common uses and a code example showing a basic implementation. The database pattern is the only one without a code example as the database interface varies widely from application to application.

0 comments voice your opinion now!
configuration pattern ini script text xml database

Link: http://www.phpbuilder.com/articles/application-architecture/using-php-configuration-patterns-properly.html

SitePoint PHP Blog:
Optimizing MySQL
April 04, 2014 @ 11:54:48

The SitePoint PHP blog has posted the first two parts of their "Optimizing MySQL" tutorial series by Peter Nijssen. The first looks at general tips around indexes and the second shows some configuration tips to get the most from your database systems.

MySQL is one of the most used databases in conjunction with PHP. Making sure that your MySQL databases are running at their best is one of the most important aspects you have to consider whenever your web application grows. In this series of 3 standalone articles, we will have a look at how we can optimize our MySQL installation. We will take a look at which optimizations we can perform on our database, on our MySQL configuration and how we can find potential problems when MySQL is not performing well.

The first tutorial walks you through a brief introduction to indexes, shows you how to find duplicates and unused indexes that might be hanging around. The second post deals with the configuration topics using the Percona pt-variable-advisor. They also make use of the MySQLTuner tool for even further enhancement. Finally, the article finishes with a look at cross-server configuration comparison and how to see the differences.

0 comments voice your opinion now!
mysql series performance percona configuration indexes

Link: http://www.sitepoint.com/series/optimizing-mysql/

Ralph Schindler:
Authentication & Authorization in Apigility
March 27, 2014 @ 11:04:21

Those interested in the Apigility project from Zend might want to check out this new post from Ralph Schindler on how it handles authentication and authorization for all of the requests.

Apigility takes a lightweight, layered, yet extensible approach to solving both problems of authentication and authorization. The infrastructure is already in place and ready to be configured to use, or for more advanced use cases: to be extended. Many of these feature can be easily explored through the Apigility user interface.

He gets into authentication first, defining it briefly before getting into the Apigility-specific implementation. He talks about the three methods (HTTP basic, HTTP digest and OAuth2) and mentions where it falls in the execution as well as some screenshots of its setup. Following this he talks about the other half of the equation, authorization. He covers the "Authentication" header, the identity types and where you can find the configuration settings. He finishes off the post with an in-depth look at the different components, events and services/models that make up the authentication and authorization system and make it work.

0 comments voice your opinion now!
authentication authorization apigility introduction configuration

Link: http://ralphschindler.com/2014/03/26/authentication-authorization-in-apigility

Master Zend Framework:
Make Module Configs Cacheable with the ZF2 Factory Interface
March 07, 2014 @ 11:25:09

Matthew Setter has a new post today on the "Master Zend Framework" site looking at the use of caching for Zend Framework 2 module configurations.

For the longest time, I've been using closures in my Zend Framework 2 Modules Module class. I know they're not always the best approach, but they're not necessarily wrong either. But after reviewing Gary Hockin's recent talk at PHP Conference UK, I was reminded that outside of APC and OPCache, closures aren't cacheable. [...] So in today's tutorial, I'm going to show you a simple example of how to migrate from closures using [caching with Memcached, Redis and so on].

He starts with an example of the standard closure approach, returning an array from his "getServiceConfig" method with sub-array and object creation nested inside. He then refactors it to use the "FactoryInterface" to handle the configuration setup for the "delete form" handling.

0 comments voice your opinion now!
module configuration cache zendframework2

Link: http://www.masterzendframework.com/tutorial/zf2-factory-interface-closure-migration

Allan MacGregor:
Magento and HHVM
February 18, 2014 @ 09:12:59

Allan MacGregor has a new post sharing some of his research into getting Magento working on the HHVM (the HipHop VM) and some of the benchmarks of the results.

Magento is (in)famous for its performance, specially when scaling to a large numbers products, transactions or even catalog rules, seasoned Magento developers have probably hit at least one of this performance bottle necks more than once. [...] And while all the optimizations help, in the end there is a major performance bottleneck that is not as easily surpassed and that is PHP performance, since PHP is an interpreted language there is price to pay in terms of speed of execution and overall performance.

He introduces the HHVM briefly for those not familiar with it and some of the work already in progress to make Magento cooperate. He walks you though a complete installation of both the HHVM, cloning it from GitHub, and configuring it with the settings needed for Magento to run correctly. Once the HHVM instance is started, he runs some tests with siege comparing the results from the built-in PHP web server versus the HHVM install.

0 comments voice your opinion now!
magento hhvm hiphop installation tutorial configuration

Link: http://coderoncode.com/2014/02/17/magento-hhvm.html

SitePoint PHP Blog:
Understanding Symfony Bundle Configuration and Service Container
February 04, 2014 @ 10:46:03

The SitePoint PHP blog has a post today for those that may be new to the Symfony framework or just wanting to get into it and having trouble understanding bundle configuration. In this new post Carl Vuorinen walks you through this process, combining an example bundle with its configuration.

In this post we'll cover different ways on how to configure Bundles in Symfony2 and how the dependency injection container works with the configuration. The Bundle configuration and Symfony dependency injection container (also known as service container) can be difficult concepts to grasp when first starting development with Symfony2, especially if dependency injection is not a familiar concept beforehand. [...] I am used to working with YAML because I think it's more readable than XML, but you do get the benefit of schema validation when using XML.

He briefly introduces the concepts behind "bundles" in Symfony and two ways to create one - either via the generator on the command line or manually. He also shows two ways to get a bundle's configuration loaded. There's the "easy way", configuring it inside the main "confix.yml", or the slightly harder way of adding a configuration file inside the bundle structure itself and using the "get" method to grab the values manually. With the location(s) of the configuration defined, he gets into the contents of the file and its structure. Finally, he shows the complete example, an "ExampleBundle" with a "greet" method that accepts the configuration value from the "cvuorinen_example.greeter" setting.

0 comments voice your opinion now!
symfony bundle configuration container service tutorial introduction

Link: http://www.sitepoint.com/understanding-symfony-bundle-configuration-service-container

SitePoint PHP Blog:
Build Virtual Machines Easily with PuPHPet - Part 2
December 26, 2013 @ 10:18:52

On the SitePoint PHP blog Matthew Setter is back with the second part of his series looking at using PuPHPet to make VMs easily. In this second part, he continues on and looks more at the configuration files generated and tweaking them a bit.

We looked at how to configure most of the options and how to use the generated configuration, with some basic vagrant commands. But that's as far as we went. So in this second part of the series, we're going further. Specifically, we're going to be looking at the two core files used: common.yaml, and Vagrantfile. We'll be making some changes to them, then provisioning the virtual machines to reflect the configuration changes.

He talks about some of the changes he'll be making including the location of the shared folder and some of the setup of the PHP installation. He also updates the XDebug and MySQL configurations to change a few other options for more control over the resulting instance.

0 comments voice your opinion now!
tutorial part2 series puphpet puppet vagrant configuration update

Link: http://www.sitepoint.com/build-virtual-machines-easily-puphpet-part-2/

Alex Bilbie:
Using Vagrant and Ansible for distributing educational course virtual machines
December 20, 2013 @ 11:23:40

in his latest post Alex Bilbie shares a guide for the steps he follows to create virtual machines for an educational course using Vagrant and Ansible with a PHP+Apache environment set up and ready to go.

In "Cursory Thoughts on Virtual Machines in Distance Education Courses" Tony discuses using virtual machines in courses to help distribute software and operating systems to students who increasingly more and more are bringing in very different devices. [...] At the very end of the article Tony mentions using Vagrant which is a small piece of software to help "create and configure lightweight, reproducible, and portable development environments". [...] A better option [for managing VM deployment] would be to use another devops tool called Ansible which "is a powerful automation engine that makes systems and apps simple to deploy".

He includes both a sample Vagrantfile for configuring Vagrant and a YAML configuration for Ansible that sets up the VM, opens the needed ports and installs and configures the needed software.

Together the playbooks and the Vagrantfile can be distributed to the students and assuming they've installed Vagrant and Virtualbox for their OS they can be up and running with identical environments in just a few minutes.
0 comments voice your opinion now!
vagrant virtualmachine vm ansible configuration example

Link: http://alexbilbie.com/2013/12/vagrant-ansible-courses/

Kevin Schroeder:
(Basic) Configuring the Magento 2 Dependency Injection Container
December 16, 2013 @ 12:03:22

Kevin Schroeder continues his series of posts looking at using Magento 2 and creating customizations of the application. In this latest post he builds on the previous post about dependency injection and shows how to configure Magento's container.

The purpose of that post was to, perhaps, make you less apprehensive about using DI combined with the DIC in Magento 2. However, in this post I want to go a little deeper into the DIC, implemented via the MagentoObjectManagerObjectManager class, and talk about how to configure it. Configuration for the DIC is done in each module's etc/di.xml file or etc//di.xml. Because you can split DIC configuration based on the area this tells you that the /config/ naming stuff is over; which I applaud.

He focuses more specifically on two of the child nodes that can be defined - "type" and "preference" (you can also have "virtualType" as well). First up is "type" and he gives a simple example class in his "HelloWorld" example that just takes in a message and returns it when asked. He shows it in use and how to set up the "di.xml" configuration for the class, defining the "message" parameter in the configuration instead of in the object fetch (like the first example).

0 comments voice your opinion now!
magento2 dependency injection container configuration usage tutorial

Link: http://www.eschrade.com/page/basic-configuring-the-magento-2-dependency-injection-container/


Community Events





Don't see your event here?
Let us know!


community unittest podcast list interview threedevsandamaybe introduction application library code framework api install configure series developer laravel language wordpress release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework