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

Zend Blog:
Rise of the Native Cloud Developer - ZendCon Keynote
October 11, 2013 @ 12:54:22

If you weren't able to make it to this year's ZendCon conference that just happened in Santa Clara, you can get at least a little piece of it from this new post to the Zend blog. It's a video from a keynote session from Peter Magnusson titled "Rise of the Native Cloud Developer."

At his keynote session at ZendCon, he shared some of the important and sometimes unexpected lessons Google learned while building for the cloud - such as the importance of lightweight execution containers, relying on failure, and how to overcome the speed of light when building distributed systems.

And then he went ahead to discuss about the rise of the "Cloud Native" developer - how engineers and organisations large and small now using these principles to build truly robust and scalable services, and businesses.

You can watch it embedded in the post or full size on Youtube.

0 comments voice your opinion now!
zend zendcon13 cloud native developer keynote video

Link: http://blog.zend.com/2013/10/10/rise-native-cloud-developer/

Systems Architect Blog:
Apache2 vs Nginx for PHP application
March 29, 2013 @ 10:41:38

On the Systems Architect blog there's a recent post from Lukasz Kujawa about comparing Apache2 and Nginx for PHP applications, specifically when using the PHP-FPM module. His tests are based on the results from three different application types - a large Zend Framework 1 app, a small PHP script and a WordPress installation.

If you've ever been trying to squeeze more out of hardware you must have come across Nginx (engine x). Nginx usually appears in context of PHP-FPM (FastCGI Process Manager) and APC (Alternative PHP Cache). This setup is often pitched to be the ultimate combo for a web server but what that really means? How much faster a PHP application is going to be on a different web server? I had to check it and the answer as often is - that depends.

He ran the tests on an Amazone EC2 instance and optimized the server to ensure that there was a little interference as possible. The used the Zend Optimizer Plus opcode cache and PHP 5.4 and set the logs to go to memory instead of disk. Graphs included in the post show the results of the benchmarking of each application, with the differences (in most cases) not being that wide of a gap.

There isn't big difference between Apache2 and Nginx in PHP context. Yes, Nginx can be much faster when delivering static content but it won't speed up PHP execution. Running a PHP script seams to be so CPU challenging task that it completely eclipse any gain from a web server.
0 comments voice your opinion now!
apache2 nginx performance benchmark zendframework1 wordpress native


Timothy Boronczyk:
PHP Assertions
November 08, 2012 @ 11:43:49

Timothy Boronczyk has written up a new post that looks at using assertions in PHP - the actual use of the assert function to evaluate values in your code.

I stumbled upon assertions in PHP today, though why I didn't know they existed after working with the language for so long and what I was looking for originally when I came across them are both mysteries. And with the increasing focus on software quality in the PHP community, I wondered why I hadn't seen them used by others. I decided to ask around, look into PHP's implementation of assertions, and do some tinkering.

He talks some about their usage, some of the common issues surrounding them and compares using them directly on return values vs evaled strings. He also includes an implementation of them in a bit of sample code - a class that uses them (and an assertion callback) to handle the throwing of exceptions.

Assertions are meant to identify program logic/design bugs, not as a run-time error handling mechanism. Isn't this why we do unit testing? Playing devil's advocate, what's wrong with pushing unit tests directly into your code if we have doc comments that are extracted for documentation?
0 comments voice your opinion now!
assertions native function overview exception error


Miro Svrtan:
PHP Fatal errors into exceptions natively
August 28, 2012 @ 10:08:39

Miro Svrtan has a new post today proposing something that could be added to help handle bad method calls in PHP apps - using the BadMethodCallException (pre-existing) instead of throwing fatal errors.

Using getter method that is not implemented will get you fatal error saying how undefined method is called and request will stop. [...] On the other hand if you would use public property all you would get is a notice saying how this property does not exist and rest of request would be completed. [...] I know that this is due to dynamic typing behavior of PHP and no I am not suggesting raising a notice if undefined method gets called but since 5.1.0 there is a BadMethodCallException class which would be perfect for this situation.

There's been other people that have proposed the same idea as a bug, but nothing formal has been submitted as an RFC to make the change. Miro is looking for feedback to find if others would be interested in this feature and want to make the proposal (leave comments here).

0 comments voice your opinion now!
exception native badmethodcallexception fatal error rfc


Nikita Popov's Blog:
A plea for less (XML) configuration files
July 10, 2012 @ 10:09:27

Nikita Popov has posted a plea to developers and project maintainers alike to stop using XML for their configuration files in their PHP-based applications.

I recently tried using Phing (a PHP build system) to do some simple release automation. Just creating a PEAR package and doing a few string replacements here and there. The result? After several wasted hours I ended up using Phing only for PEAR packaging and doing everything else in a custom PHP build script. The reason? Phing uses XML files to configure what it should do during a build.

He advocates a more native solution - a PHP script that defines the configuration options as a part of an object that can be injected into the parts of your app without the need for external dependencies.

0 comments voice your opinion now!
configuration file xml native object opinion


Ariz Jacinto's Blog:
Compiling PHP with MSSQL Server's Native ODBC Driver for Linux as a PDO Driver
January 10, 2012 @ 12:34:26

Ariz Jacinto has written up a new post with the commands you'll need to get PHP up and runnign with MSSQL Server's native ODBC driver working on linux (accessible through PDO).

Last month, MS announced the preview release of SQL Server ODBC Driver for Linux, a 64-bit binary driver for Red Hat Enterprise Linux 5. This is good news for companies using heterogenous platforms e.g. LAMP stack running a PHP application that connects to both MySQL and MSSQL Server. Meaning, these companies no longer have to use third-party drivers such as FreeTDS that MS doesn't support. Then a few days ago, MS released version 1 of the driver. I immediately downloaded the driver and recompiled PHP with it as a PDO (PHP Data Object) ODBC driver.

His process has five steps to it, including one for making a test script (code included) and another with a few gotchas/performance considerations to keep an eye out for when using the driver.

0 comments voice your opinion now!
compile sqlserver native driver odbc pdo tutorial


Symfony Blog:
Symfony2 Annotations gets better
May 23, 2011 @ 11:08:53

Fabien Potencier has posted another in his "getting better" series looking at the features that are included in the Symfony2 framework. In this new post he talks about the improvement annotation support.

Later today, I will release Symfony2 beta2. But first, I wanted to talk about a big change that landed into master yesterday. As you might know, Symfony2 uses annotations for Doctrine mapping information and validation configuration. Of course, it is entirely optional, and the same can be done with XML, YAML, or even PHP. But using annotations is convenient and allows you to define everything in the same file.

Two new bundles were added, SensioFrameworkExtraBundle and JMSSecurityExtraBundle, that let you use annotations in the controller for configuration. Examples of this new feature are included in the post giving the configuration settings a more "native" feel.

0 comments voice your opinion now!
annotations native controller configuration


Shay Ben Moshe's Blog:
PHP's native array vs SplFixedArray performance
April 28, 2011 @ 09:06:01

Shay Ben Moshe has put together a quick post today where he benchmarks array handling performance differences between PHP's native array and the newer SplFixedArray data structure that's a part of the Standard PHP Library that comes with any recent version of the language.

In PHP, arrays are one of the most fundamental data structures. We use them everywhere. They are very flexible, because they are implemented as associative arrays, and therefore let us use both string and integer keys. They are also unlimited in size, in most languages arrays are fixed-sized, but this is not the case in PHP. With that in mind, there still is a drawback. It damages performance. The solution for this problem may be SplFixedArray. But, it is not a perfect solution.

He points out two major differences - the SplFixedArray is, well, a fixed size and the fact that it can only use integer keys (no associative arrays here). He created three tests to compare the performance of the two:

  • Writing data to the array
  • Reading data from the array
  • Getting a random value from the array

Each of these are measured in terms of runtime and/or memory usage. If you'd like to try out the tests for yourself, you can download the files needed. I won't cover the results of the tests here, though - you'll need to visit the post for that!

0 comments voice your opinion now!
native array splfixedarray performance benchmark runtime memory


Kore Nordmann's Blog:
Native parallel PHP job queue
May 07, 2010 @ 14:40:29

Kore Nordmann has put together some scripts that will let you create a native parallel job queue using only PHP (and the PCTNL extension).

To make use of multiple cores for some rather long processing operations I needed a way to fork multiple workers from a single PHP script multiple times lately. So I created a small project on github which implements this in a way, so that it should reusable by anybody. This is far from being rocket science, but still might be useful to someone out there.

He uses the ShellJobProvider (extended from JobProvider) to handle the creation of the tasks. His simple example just spawns off a few echo statements and pushes the results to some files. You can get these libraries from hos github account. You'll need PHP 5.3 and the PCTNL extension installed to get it working.

0 comments voice your opinion now!
native parallel job queue pctnl


Brandon Savage's Blog:
Why Great Development Tools Don't Seem To Be Written In PHP
December 04, 2009 @ 09:06:13

In a new post to his blog Brandon Savage asks why some of the best development tools don't seem to be written in PHP.

Trac. CruiseControl. phpUnderControl. Jira. Bugzilla. These are all intensely popular development tools. And not a single one of them is written in PHP. Why? [...] Some might argue that PHP is a lesser language, and thus incapable of producing the results that Python and Java can produce. Others might argue that other languages are more mature. But the truth is that these applications don't exist in PHP simply because PHP wasn't previously capable of producing them.

He expresses a desire to work on some of these tools and to make them native to PHP, but several comments on the post steer him towards some projects that have already done this sort of thing including Xinc, ArbitTracker and sismo.

0 comments voice your opinion now!
development tool native opinion



Community Events





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


opinion tips deployment install list release series community language interview podcast library symfony api bugfix package framework voicesoftheelephpant introduction laravel

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