Feed aggregator

Optimizing MySQL Indexes

Planet-PHP - Wed, 02/04/2014 - 18:00

This entry is part 1 of 3 in the series Optimizing MySQL Introduction 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 […]

Continue reading %Optimizing MySQL Indexes%

Catégories: Open Source, PHP Community

ServerGrove Blog: Deployment of Symfony2 applications with Ansible

PHPDeveloper.org - Wed, 02/04/2014 - 17:41

The ServerGrove blog has a new post today showing you how to deploy Symfony2 applications using Ansible, an automation tool that uses "playbooks" to define steps.

Ansible is a powerful automation engine that simplifies deploying systems and apps. Its popularity has been rising rapidly as developers and system administrators look for simpler ways to manage servers and deploy applications. The selling points of Ansible are: simplicity, agentless and extensible.

ServerGrove, traditionally a Capistrano/Capifony user, decided to give Ansible a try. They include the steps to go through to get the correct environment set up and how to execute commands on the remote servers. There's also an example of a sample task that updates packages on the remote server, moves a config file into place and restarts Apache. With this foundation, they get into the actual Symfony2 deployment, sharing their custom role that sets up the directory, clones the Git repository, runs Composer and executes an Assetic dump.

Link: http://blog.servergrove.com/2014/04/01/deployment-symfony2-applications-ansible

SitePoint Web Blog: HTTPS Basics

PHPDeveloper.org - Wed, 02/04/2014 - 16:06

If you're relatively new to web development, you might not know exactly what kinds of benefits that using an HTTPS connection might provide. In this new article from the SitePoint PHP blog, Mufleeh Sadique covers some of the basics of HTTPS and gives some reasons why to "go HTTPS" in your applications.

Hypertext Transfer Protocol Secure or Hypertext Transfer Protocol over SSL is used for secure communication over a network, or perhaps more importantly - over the Internet. You would see https:// in the URI and a lock icon in the browser when you access a page that uses HTTPS. [...] If you ever wondered whether and how to go HTTPS with your website, we'll attempt to clear this up in this article by briefly describing what HTTPS is about, and why and how to implement it.

He's broken the rest of the article up into a few different sections. The first answers the question "why HTTPS" with a few reasons including the most important - encrypted communication. In the second section, he starts showing you how to "go HTTPS" using a self-signed certificate to start. With the certificate installed, he moves into the last part, ensuring your application is always using the HTTPS version and redirecting anything else.

Link: http://www.sitepoint.com/https-basics

Community News: Packagist Latest Releases for 04.02.2014

PHPDeveloper.org - Wed, 02/04/2014 - 15:04
Recent releases from the Packagist:

Community News: Recent posts from PHP Quickfix

PHPDeveloper.org - Wed, 02/04/2014 - 14:09
Recent posts from the PHP Quickfix site:

PHP 5.5.11 is released

Planet-PHP - Wed, 02/04/2014 - 02:00
The PHP development team announces the immediate availability of PHP 5.5.11. Several bugs were fixed in this release, some bundled libraries updated and a security issue has been fixed : CVE-2013-7345. We recommand all PHP 5.5 users to upgrade to this version. For source downloads of PHP 5.5.11 please visit our downloads page, Windows binaries can be found on windows.php.net/download/. The list of changes is recorded in the ChangeLog.
Catégories: Open Source, PHP Community

Inappropriate April’s Fools pranks

Planet-PHP - Tue, 01/04/2014 - 23:33

If you think that someone who is offended at a joke has no sense of humor, I invite you to watch this scene from the movie The Lives of Others. The setting is East Germany, Stasi headquarters. Please watch before you read further.

You probably all agree that this prank was cruel. Why? Because the perpetrator is of a higher rank and the joke involves a threat to the person’s career. Notice how the lower-rank member cannot shake off the anxiety even after he discovers that this was a mere joke.

Now let’s see how this translates into an April’s Fools prank. Suppose you are in a position of authority over someone: teacher, landlord, employer, military officer, etc. You decide to make a prank on your subject(s). Add to that a threat to the person’s career or livelihood, and you become a sadist, not a comedian. My son’s teacher threatened his education through an April’s Fools prank. Although I learned within minutes that it was a joke, my heart rate climbed and stayed there for over 30 minutes. I had a pain in my chest for even longer.

Be mindful of how your jokes could affect people. If you are in a position of authority, be extra careful. If in doubt, don’t make a prank. Causing people distress is not funny.

As a side note, you might want to watch the whole movie to gain interesting insight into phone surveillance and other subjects that still plague our modern world.

Catégories: Open Source, PHP Community

SitePoint PHP Blog: Composer Cheatsheet

PHPDeveloper.org - Tue, 01/04/2014 - 18:22

The SitePoint PHP blog has a new post from Matthew Setter today sharing a Composer cheatsheet he recently discovered with an example of the common commands and "composer.json" file structure.

Unless you've been living under a rock, today's PHP isn't your grandmother's PHP; it's an entirely different, much more elegant and mature language with countless improvements and additions. One of the key additions is Composer, the de facto standard for managing PHP project dependencies which, by default, gives you access to hundreds of ready-made libraries, via Packagist.org.

He goes through the parts of the guide, introducing some of the commands and covering the details of the full "composer.json" JSON structure. There's also a video introduction if you'd like the more visual version.

Link: http://www.sitepoint.com/composer-cheatsheet

AWS PHP Development: Receiving Amazon SNS Messages in PHP

PHPDeveloper.org - Tue, 01/04/2014 - 17:53

The Amazon Web Services PHP Development blog has a new post from Jeremy Lindblom showing you how you can receive inbound SNS messages via a webhook on your application.

Amazon Simple Notification Service (Amazon SNS) is a fast, fully-managed, push messaging service. Amazon SNS can deliver messages to email, mobile devices, Amazon SQS queues, and HTTP/HTTPS endpoints. [...] Though you can certainly subscribe your email address to receive SNS messages from service events like these, your inbox would fill up rather quickly. There is great power, however, in being able to subscribe an HTTP/HTTPS endpoint to receive the messages. This allows you to program webhooks for your applications to easily respond to various events.

Using the AWS SDK for PHP you can set up a listening script that can receive the message and handle subscription confirmations, message signature validation and handling the notifications.

Link: http://blogs.aws.amazon.com/php/post/Tx2G9D94IE6KPAY/Receiving-Amazon-SNS-Messages-in-PHP

Pádraic Brady: Is Facebook's HHVM Building PHP's Coffin?

PHPDeveloper.org - Tue, 01/04/2014 - 16:31

In a new post to his site, Pádraic Brady poses a question about the HHVM project from Facebook - is it going to "be the coffin" that will replace the Zend Engine in PHP completely and change the way we know it?

With HHVM 3.0 now released, it's probably time to start talking about HHVM and the new Hack Language. It's becoming hard to ignore some of the fantastical notions spreading on the grapevine about HHVM. There is talk of significant performance improvements, a multitude of new features courtesy of Hack, that PHP Internals is actually now outnumbered by HHVM contributors. There is even treasonous talk of PHP's Zend Engine being put out to pasture.

He talks about how it was inevitable, really, that there'd be another implementation come up through the ranks (much like the variations of Ruby). He also mentions some other, less popular options in replacing the main implementation (Zephir, HippyVM, etc). He then poses an interesting question - "what is PHP?" He talks about language specifications, the PHP internals group and the delay that sometimes happens introducing new language features into the core (some of which HHVM already has).

PHP, as we know it, is starting to smell. It has gone from being the only PHP in town, to being the slowest, with the least number of features, and the one that's subject to dysfunctional governance. The new PHP is called Hack, a new language with only the briefest of documentation since you can learn the other 99.9% of this language over on the PHP manual. Link: http://blog.astrumfutura.com/2014/03/is-facebooks-hhvm-building-phps-coffin

Community News: Latest PECL Releases for 04.01.2014

PHPDeveloper.org - Tue, 01/04/2014 - 14:06
Latest PECL Releases:
  • uopz 2.0.1 fix build error in some setups

  • uopz 1.0.7 fix bug in applying method modifiers

  • uopz 1.0.8 fix bug in applying method modifiers work on uopz_compose, compose classes in one function call is possible

  • qb 2.2.0 Enabled compiling to native binary in Solaris and FreeBSD Fixed issue #29 - Segfault during array resize in Solaris Fixed issue #32 - Segfault when images are resized or created Fixed issue #33 - Incorrect CPU count Fixed issue #34 - Inability to call functions inside namespace Fixed issue #35 - Segfault in PHP 5.5.8 when QB coroutine is called Fixed issues flagged by Valgrind

  • uopz 1.0.9 fix bug in finding functions, affecting various add more tests

  • uopz 1.0.10 take properties to compose

  • uopz 1.0.11 fix unresolved external symbols on some builds fix bug in overload for add trait/interface

  • uopz 2.0.0 API finalized, no moar changes fix logical error in uopz_extend fix logical errors in uopz_compose enforce using correct handlers (stability++) fix scope issue in global functions created with uopz_function take modifiers to uopz_function for global functions fix bug in uopz_delete on magic methods

  • uopz 1.0.6 fix memory error causing segfault in auto backup allow composition of interfaces and traits enforce inheritance rules while composing classes

  • pthreads 2.0.4 fix memory errors introduced in 2.0.0 fix 5.3 build synchronize versions

  • uopz 1.0.5 fix various scope issues use exceptions where appropriate tidy all code add some more tests

  • eio 1.2.5 Fix: Bitbucket issue #2: Static build fails Fix: build failed when EVENTFD was not available

  • pthreads 2.0.3 Fix bug in trait alias/precedence (gh bug #274) Fix leak (gh bug #272)

  • uopz 1.0.4 add copy fix various scope issues fix heap corruption issue auto backup on uopz_function

  • qb 2.1.2 Fixed issue #17 - Segfault with large fixed length array Fixed issue #19, #28 - Errors in Solaris 11 Fixed issue #20 - Corruption of pass-by-ref variables Fixed issue #21 - Conflict with xdebug in FreeBSD Fixed issue #24 - Broken ZTS build Fixed issue #27 - Incorrect object import

  • timezonedb 2014.2 Updated to version 2014.2 (2014b)

Walking the London LOOP - part 5 and 6

Derick Rethans - Tue, 01/04/2014 - 10:11
Walking the London LOOP - part 5 and 6
Section 5

While waking up we already knew this would be a glorious day. Blue skies with no clouds in sight. The moment I got out of the house I knew I was not going to need my coat either. Getting to Hamsey Green, the start of section 5 was a bit more of a chore than normally. It involved two tube trains to Victoria, a train to West Croydon and then another bus ride down the road to Ken's Auto at Hamsey Green.

loop5-d36_4980.jpg

After a short section next to a road, we entered Riddlesdown. With mostly open fields and a bit of woodland we made it down into the next valley, coming past a disused quarry. We only really noticed the quarry once we made it over a bridge across some railroad tracks and up a fairly steep path up the hill on the other side of the valley.

loop5-d36_4992.jpg

After some steps, and some more steep uphill part we came to Kenley Common, a now open space that used to be farmland, as a swap for the Kenley Aerodrome that the RAF seconded during the second World War. We made a few wrong turns on Kenley Common and there were a few slightly useless fences. Passing through some woods and a field with gliders overhead, we "suddenly" found ourselves at the Wattenden Arms, a pub displaying much WWII memorabilia from the Kenley Aerodrome. The friendly staff served a decent pint, and after refreshing ourselves we continued the walk.

After climbing our first style we were overtaken by another LOOP walker as we passed by the Kenley Observatory and a friendly horse. For a bit we had to walk past a road without footpath or pavement.

loop5-d36_5007.jpg

After that we passed by a field with a sole postbox and then made our way to Happy Valley. With the Sun blazing and everything looking greener that it probably was we descended into the valley and back out on the other end. The signing of the LOOP was a bit confusing so I don't think we followed the route correctly, but we picked up the walk again just shy of the next common, Farthing Downs.

This part of the walk was over a hill crest with the skyline of London in the far background. The section ended with a slight downhill into Coulsdon were we stopped for some refreshments—most importantly cake—at the Poppy Cafe. Because the weather was so nice, we decided to continue with the following section as well, section 6.

Section 6 loop6-d36_5021.jpg

Passing through South Coulsdon station we had a long climb up a residential road before we continued on a bridleway. With a long section through some woods and farmland around, a slight detour around a road without pavement, we came upon the Mayfield Lavender Fields. Sadly, we were too early to see it all in bloom, but there was most definitely already a hint of purple to be seen.

loop6-d36_5052.jpg

We then walked through Oak's Park, after which there was another long straight section on the edge of Surrey that took us past HMP Highdown. Luckily most of it was hidden by hedges and trees. The last part of this much shorter section took us to the Banstead Downs and over the Banstead Downs Golf Club to the end of the walk. From there it was a short link to Banstead, where we luckily only had to wait 20 minutes for the train—there is only a service every hour.

Where section 5 was mostly known for its up and downs, section 6 was the "horse" section. Lots of bridleways and horses around.

The weather was very good, with 16-18°C and no clouds to be seen. We took nearly four and a half hours for the two sections that together were 19.4km long.

The photos that I took on this section, as well as the photos of the other sections of the LOOP, are available as a Flickr set.

Catégories: Open Source, PHP Community

Oracle Improves Database Performance with Latest Development Milestone Release for MySQL 5.7

MySQL.com - Tue, 01/04/2014 - 02:59
New Release of the World’s Most Popular Open Source Database is 2x Faster than MySQL 5.6 and Over 3x Faster than MySQL 5.5 in Benchmark Tests
Catégories: PHP Community

New sabre/dav website launched!

Planet-PHP - Mon, 31/03/2014 - 23:16

We just released a brand new website for sabre/dav, on http://sabre.io. This new site is completely built on Sculpin, which is the best static site generator for PHP.

This was a long time coming! sabre/dav had always been hosted on google code, but as google started caring less and less about their code hosting property, it was time to look for a change.

Over time issues and source had already migrated to GitHub, but the biggest thing left was the wiki, which required porting of the google wiki markup.

We started work in October, and finally we finished enough stuff that we're comfortable releasing it.

Now I can go all out writing news stories there too. For the longest time this was my only blog, so I felt like I had to make sure I didn't over-broadcast sabre/dav related news, in order to not sound spammy and toot my own horn too much.

Go subscribe!

And yes, we also changed the branding from SabreDAV to sabre/dav. We've been with composer since the early days, and the typograpgy now matches the composer package name :).

Flexible boxes

One nice thing was that since this is a website primarily targetted towards technologists, I've also felt a lot safer taking advantage of all the latest features, and ignoring pretty much any browser that's not the most recent.

Since a little while we now have an awesome new CSS layout feature: flexible boxes.

Having worked with this a little bit (and many years ago too in XUL), I feel I can safely say, that within a few years, 90% of you will be using this feature, as opposed to CSS grid systems, absolute positioning, float, etc.

Your css source will be greatly reduced. You can automatically re-order DOM objects based on screen-size, you will need a lot less container divs and you can say goodbye to shitty css classes that frameworks such as bootstrap require.

If you've ever had to do any html layouts (and I'm sure you have, and will again), do yourself a favor and learn about it!

Everything was also writting from the ground up using box-sizing: border-box, which makes the css math a lot easier as well.

Thanks!

We'd love to hear what you think. Any bugs? Let us know in the comments.

Catégories: Open Source, PHP Community

How to kill creativity, part 1

Planet-PHP - Mon, 31/03/2014 - 23:05

Edit: I recommend reading this article first and then watching the video afterwards. It will make more sense in this order.

I first viewed this enlightening lecture on creativity by John Cleese (Monty Python) a few years ago. Since then, I saw an incredible progress in my problem-solving skills and generated countless creative ideas.

John Cleese explains that creativity is not a talent. It is a way of operating. It is a facility of getting yourself into a particular mood. It is an ability to play with ideas, for no immediate practical applications. And it worked miracles for me.

So now imagine a meeting in a company which aims to solve a problem. It typically has a fixed agenda, includes as many people as could be gathered and the solution has to be taken by the end of the meeting. These mistakes hinder creativity.

Agenda

The agenda forces you into accomplishing a list of tasks, which is associated with the closed mode, the one in which creativity cannot be achieved. It’s alright if you need an update or get everyone on the same page, but not when you want a creative solution. I recommend splitting the meeting into a few of them, preferably 60-90 minutes each. State the problem at hand and start exploring solutions (not seeking them).

The wrong attitude

When solving problems, you need to bounce ideas back and forth. Having too many people or people who dismiss each other’s ideas is not helpful. When you’re exploring possibilities and someone tells you that it’s ridiculous, you’re no longer in a mood to play. I recommend only inviting a handful of people to the meeting (no more than 5). Tell them not to be afraid to throw ideas, because no idea is wrong at this point. Tell them not to mock other ideas, since bad ideas can lead to good ones in the creative process.

Pressure for immediate solutions

Some problems are hard to solve and require additional pondering time. Pressuring for a decision leads to poor decisions. In the best case, you’ll be missing out on creative solutions because pressure always put people in a focused, closed mode. If the decision can be postponed without consequences, then give people some time to digest the ideas heard and reconvene another time. The meeting should remain an exploration until the time comes to actually making the decision.

Conclusion

Achieving creativity takes practice. Listen to the video and try to remember to switch into open mode when devising any sort of strategy. I will post another article in the coming days to explain how I apply his 5-step guideline in the context of an IT project.

Catégories: Open Source, PHP Community

Is Facebook’s HHVM Building PHP’s Coffin?

Planet-PHP - Mon, 31/03/2014 - 22:00


 THIS IS SPARTA

English: THIS IS SPARTA (Photo credit: Wikipedia)

With HHVM 3.0 now released, it’s probably time to start talking about HHVM and the new Hack Language. It’s becoming hard to ignore some of the fantastical notions spreading on the grapevine about HHVM. There is talk of significant performance improvements, a multitude of new features courtesy of Hack, that PHP Internals is actually now outnumbered by HHVM contributors. There is even treasonous talk of PHP’s Zend Engine being put out to pasture.

Perhaps worse, HHVM 3.0 is following in 2.0′s steps: It is steadily eroding away at the notion that Facebook is going to abandon HHVM tomorrow (specifically at tea time once Mark has finished his crumpets) and it’s reinforcing the notion that Facebook actually wants people to adopt HHVM…as if running framework test suites and blogging about PHP parity every other day didn’t clue you in. Before 2.0, you’d swear the whole project was either top secret or had been disavowed.

This Was Inevitable…

PHP is not the only language to have faced multiple implementations. Ruby MRI (Matz’s Ruby Interpreter) is the “original” Ruby. It now puts up with JRuby, Rubinius, IronRuby, MagLev and MacRuby (where would we be without an Objective-C option, right?). Python is also not alone. It has alternatives (a lot of them) but you’d most likely recognise IronPython, PyPy, and Jython.

PHP is merely doing what it does best – creeping up on other languages and stealthily “borrowing” the best of their advantages. This time it’s not actually PHP doing the creeping, however, and beating PHP at the catchup game is a big deal. Just in case you haven’t heard – even HHVM is hardly the only option for PHP either. You can use Zephir to write PHP-like code which compiles to a PHP extension. Recently, I heard about HippyVM which appears to be in its infancy though those kids can grow up very fast (and it’s association with PyPy means it can’t be dismissed out of hand). There’s also the penultimate “opt-out” options for converting PHP out to Java, for example. The ultimate option being to just maintain the output and dump PHP altogether. Never overestimate your PHP code’s permanence ;) .

I haven’t really discussed HHVM anywhere because the equation Facebook presented us with just didn’t add up for my particular circumstances. Now it does. HHVM is becoming ever more compelling as the weeks roll by. The PHP parity quest, the Hack Language, the shift to FastCGI and, most importantly, HHVM’s rapid improvement over time are creating something extremely attractive. Yes, it performs really well, but that’s not always the most relevant factor to programmers on the ground churning out everyday applications.

To PHP or not to PHP?

I’m seriously thinking about using the damn thing! This poses one small troubling question which keeps gnawing away at my poor brain: What is PHP?

PHP is a language without a specification to define all of its behaviour. It exists as one implem

Truncated by Planet PHP, read more at the original (another 6785 bytes)

Catégories: Open Source, PHP Community

Michael Dowling: Guzzle 4.0

PHPDeveloper.org - Mon, 31/03/2014 - 20:57

Michael Dowling has announced the release of Guzzle 4.0.0 on his site today. Guzzle is one of the most widely used, popular HTTP clients in the PHP community today. Its used in both corporate and open source projects as a primary means for making HTTP requests and RESTful web service clients.

Guzzle 4.0 has arrived! The new version of Guzzle is now simpler, faster, more flexible, and more powerful than ever. [...] Guzzle is a PHP HTTP client that makes it easy to work with HTTP/1.1 and takes the pain out of consuming web services.

He includes a quick example of it in use making a request to the GitHub API to fetch user information. He lists out some of the changes made in this release but points to this other post for the full list. He's also tagged other related projects to match this 4.0.0 release including Guzzle Streams and the Log Subscriber.

Link: http://mtdowling.com/blog/2014/03/29/guzzle4/

Evert Pot: PHP 5.5.10 timezone handling changes

PHPDeveloper.org - Mon, 31/03/2014 - 19:29

Evert Pot has a new post sharing some of the changes in DateTime handling that he's updated in the latest release in the PHP 5.5.x series.

PHP 5.5.10 got released a few weeks ago, and among other things, it added some new functionality related to timezone handling. In short, [subtracting from UTC] now works. Normally this would not be recommended, as you really should specify timezones based on their geographical location. This information is not always available though, so it's a welcome new feature.

Other changes include the removal of the automatic translation from "UTC" to "GMT" as well as errors being thrown when one of the "odd" timezones are used (he provides the list). Additionally, an update around timezone "guessing" has been added and the fallback that was in place has been removed.

Link: http://evertpot.com/php-5-5-10-timezone-changes/

NetTuts.com: Test Code Coverage: From Myth to Reality

PHPDeveloper.org - Mon, 31/03/2014 - 18:50

There's a good post over on the NetTuts.com site today talking about unit testing, the myths around code coverage and why it may not be as important as you think.

Most cubicle workplaces disappeared and programmers started loving their craft. With the advent of Agile techniques and the Software Craftsmanship movement, many new tools emerged to help the programmer and the process. TDD is slowly becoming the de facto way of writing code and the secrets of SCRUM or Kanban were revealed even to the programmers in the darkest corners of the cubicle world. Automated testing and test driven development (TDD) are some of the essential techniques Agile provided to us programmers. And a tool that comes with those methodologies is used to produce test code coverage, which is the topic of this article.

The article starts with a brief definition of code coverage and gets right into an example class, PHPUnit test and the results of a code coverage generation. They show both output options, the text-only output and the full HTML output with clickable links and visualization of the covered lines of code. There's also an example of generating the coverage inside an IDE (PHPStorm). The post finishes with a look at the myths of code coverage including: "100% covered is bug free" and that "gaming the system" is pretty easy.

Link: http://code.tutsplus.com/articles/test-code-coverage-from-myth-to-reality--cms-20442

Composer Cheatsheet

Planet-PHP - Mon, 31/03/2014 - 18:00

Unless you’ve been living under a rock, today’s PHP isn’t your grandmother’s PHP; it’s an entirely different, much more elegant and mature language with countless improvements and additions.

One of the key additions is Composer, the de facto standard for managing PHP project dependencies which, by default, gives you access to hundreds of ready-made libraries, via Packagist.org.

I’m not going to go over how to use Composer, as it’s been covered so well here on SitePoint already; especially by this article, by Alexander Cogneau.

Instead, I’m approaching it from a different angle, taking you through the excellent Composer cheat sheet, which I came across recently.

Continue reading %Composer Cheatsheet%

Catégories: Open Source, PHP Community
Syndiquer le contenu