Feed aggregator

Symfony Blog: New in Symfony 2.3: Small things matter

PHPDeveloper.org - Mon, 20/05/2013 - 19:23

On the Symfony blog today Fabien Potencier talks about some small things that matter - some of the smaller updates that have been made to the Symfony 2 framework recently that have helped to make it better and more flexible.

Every new Symfony release tries to brings some small but useful improvements. Let's dive into some of them for Symfony 2.3 (in no particular order).

Things in his list include:

  • A text-based output of the exception handling stack trace
  • A default configuration for the Serializer component
  • The ability to run the framework in a production environment in development
  • An update to make debugging configuration parameters easier
  • Conversion process of short controller names
  • Overload generated code in the bundle bootstrapping code

Check out the post for the rest of the changes on his list and check out the RC1 of Symfony 2.3.0 to see some of them in action.

Link: http://symfony.com/blog/new-in-symfony-2-3-small-things-matter

PHP Town Hall Podcast: Episode #7 - Web Sockets Are Fast

PHPDeveloper.org - Mon, 20/05/2013 - 18:41

The PHP Town Hall podcast has posted a new episode - Episode #7: "Web Sockets Are Fast".

Chris Boden joins us to talk about a Ratchet and React. The conversation is basically Ben and Phil asking a bunch of questions about how Ratchet works, pretending we know what is going on while Chris uses lots of words like "concurrency" and "non-blocking". We decide that PHP is web-scale, event-driven programming is not just for NodeJS hipsters, we all take the "Are You a Brogrammer" test and Michael Wales crashes the show half way through like a ninja.

You can listen to this latest episode either through the in-page player or by downloading the episode directly. You can also subscribe to their feed if you'd like the latest shows as they're released.

Link: http://phptownhall.com//blog/2013/06/18/episode-7-web-sockets-are-fast

Dear Ed (A response to Open Sourcing Mental Illness at php[tek] 2013)

Planet-PHP - Mon, 20/05/2013 - 18:00

Note: this post is personal, and may contain triggers for those suffering through grief. Due to it’s nature, I did pass it by Ed before posting it publicly, as every body is different when dealing with their mental illnesses, and this is such a complex topic that it’s difficult to talk about without drawing broad brush strokes that may offend some people. Please keep in mind that this is [some of] my thoughts on this very complicated subject, and you are free to disagree.

Dear Ed,

I felt that I needed to write this letter to you, and I wanted it to be open because I think it’s an appropriate way to participate in open sourcing mental illness. Consider this a pull request of sorts. The only way to remove the stigma around this topic is by talking frankly and openly about it.

I’m writing this (specifically) in response to the talk you gave at php[tek] last week. I remember first meeting you, at php|tek (as it was then known) in Chicago, sometime around 2003-4, one of my first conferences. You had some local friends meeting you there and we all hung out at the hotel bar. It was fun. But I remember the intimidation of meeting this hard core rock looking dude that I didn’t think I could possibly fit in with and relate to.

I was expecting to find a rough biker type dude, that would beat me up if I said the wrong thing… And I remember you were very intense (which I now know was passion) and I remember the change that came over your entire demeanor when you started talking about your son… The warmth and joy that I saw made me think “holy crap, this guy is just an awesome dad. I like this guy!”. Someone else has described this phenomenon as you turning into a pile of goo. As a fairly new father myself I now understand that so much better — thanks for being one of my first peer role models for being a father.

I don’t suffer from the kinds of mental illness you (we?) are trying to help, I have some very irrational (but “normal”) fears – needles and bugs, especially wasps and spiders – and travel stresses me out (TripIt Pro is so fantastic for helping me with that, ask me if you want details :) .

I do however have experience with depression, and related things. I lost my father at age 11, and I lost my (first) wife at 22. These were traumatic, depressive, insane things to go through.

But I did get through them, and I feel stronger and happier at this end of that path. Thanks to folks like Ligaya Turmelle, Joey Smith, Matthew Turland and all three Elizabeths (Smith, Naramore and Tucker-Long), who have all at one time or another been a shoulder for me, I am now in a place where I can be laid back about most issues that many people simply can’t (the things that stress you out and cause anxiety on a daily basis). I live by “It is what it is”. But most folks can’t do that.

It is very difficult for me to relate to what people suffering from mental illness have been through in a lot of ways. The kinds of things I suffered from are considered “normal”, a part of the grieving process, and a temporary state; I personally don’t see it as the same thing as clinical depression — though they can lead to it — but “in the moment” they possibly are very similar.

I do however live with mental illness everyday day. My wife is bipolar (diagnosed and treated for about 6 years) and suffers from depression and anxieties. I see how it affects her, even with medication, and I really appreciate some more insight into a lot of things that she (like most people) has trouble verbalizing, so that I can help her handle it.

I don’t think I can help people suffering directly, I have no direct experience to draw from, other than my experiences with grief over a lost loved one… but I’m very open to any question about what I went through, and how I dealt with it from anyone (consider that an open invitation to anyone reading this.) But I wanted to let you know you have my support, admiration, and maybe even a little bit of love (OK a lot: internet hugs!) for opening yourself up to help this community we both hold so near and dear.

So, thank you!

  • Davey
Catégories: Open Source, PHP Community

7PHP.com: Know Thy PHP User Group Know The Leeds PHP User Group (LeedsPHP)

PHPDeveloper.org - Mon, 20/05/2013 - 17:38

On 7PHP.com today Khayrattee Wasseem has posted another community interview, this time with Craig Willis the organizer of the Leeds PHP user group in the UK (West Yorkshire).

This is the #1st set of 'Know Thy PHP Usergroup' in an attempt to create more awareness of: what is $this PHP UG about + get to know the leaders/Founders/Community behind it, what is a PHP User Group in general and to personally know all the PHP user goups Around The World - that excites me and I hope you too! This concept is also a good opportunity for new #elePHPants to know about PHP UGs.

They talk some about the group itself as well as some of Craig's thoughts about about leading the group. They talk some about the goals of the group, the usual activities of it and how the meetups are planned. There's also a bit about finding sponsors for the group and how it compares to other groups of the same type.

Link: http://7php.com/php-usergroup-leedsphp

Andrew Podner: Functional Testing to Improve Quality Assurance (part 1)

PHPDeveloper.org - Mon, 20/05/2013 - 16:19

Andrew Podner has posted the first part of a new series to his site today. He'll be looking at using functional testing to improve quality of the resulting code and full application.

For this week, I wanted to focus on some different types of automated testing other than unit testing that can help developers build more robust applications and improve both the speed and effectiveness of quality assurance. Specifically, this post is going to focus on functional testing. Functional testing is composed of the tests that you write which are from the user's point of view. A functional test is used to perform quality assurance on all or part of an application utilizing the user interface as a pathway to the application.

He gives some examples of functional tests like clicking on buttons, trying a login, checking that the contents of the page are correct. He talks some about the purpose of functional testing and how it differs from unit testing. He suggests the metaphor of a race car - the pit crew would be the "unit testers" and the driver would be the "functional tester", saying whether or not all of the parts of the car are working together as they should for the race. In the next part of the series, he'll talk some about the actual software to automate this process.

Link: http://unassumingphp.com/functional-testing-to-improve-quality-assurance-part-1

Community News: Packagist Latest Releases for 05.20.2013

PHPDeveloper.org - Mon, 20/05/2013 - 15:06
Recent releases from the Packagist:

Survived php tek 2013

Planet-PHP - Mon, 20/05/2013 - 14:14
If you were last week in Chicago, you've might felt the city was buzzing PHP all over the place. php[tek] 2013 was taking place at the Sheraton Gateway Suites Chicago O'Hare in Rosemont, just outside of Chicago city.

This year it was also the first time Musketeers.me, a php consulting team from the East Coast, was running the show, putting their own signature onto the event. And with great success I might add. A well deserved applause to Eli White, Kevin Bruce, Sandy Smith, Oscar Merida and of course the Beth Tucker Long for their unlocked achievement running a great conference.

For me was also the first time I was running the uncon, where attendees and conference speakers could propose talks they wanted to present at the uncon and have other attendees vote for them.

One uncon talk really stood out: "Open Sourcing mental illness" by Ed Finkler (@funkatron) where he discussed the issues people face who suffer a mental illness. It was an emotional talk where Ed described his own experiences and how his mind made him think about things differently then the rest of us. For me it was a real eye-opener and made me understand that there are people that don't really take things for granted.

This year's edition was filed with very good talks and it's almost impossible to give my feedback on all of them. A few talks that I attended really stood out that I would really want to promote here.

Chris Cornut, the driving force behind phpdeveloper.org, talked about "Beyond the Basics: Security with PHP" where he did not just list the top 10 of OWASP, but also gave good advices on how to protect yourself against most of the common attacks. A good closing hint: be better secured than the next guy.

Jeremy Kendall was giving good advice on how to improve your code you wrote a couple of weeks or months ago in his talk "PHP 102: Out with the Bad, In with the Good". What I like about Jeremy is he can bring very complex subjects in an easy, understandable way that even a novice can understand complex software engineering stuff. And so he did with this talk.

One talk I missed which I really wanted to see was the Distractions talk of Sean Prunka, or how to deal with distractions when you're a developer. When I look at the reviews on joind.in I see he did an amazing good job giving this was his first conference talk ever. So hopefully he will do a webinar or an online recording of this talk *hint, hint*.

This year my company was sponsoring the hackathon and can be called a good success, knowing we had to compete against Lego fun party. According to Lorna a bunch of pull requests were made for joind.in (the community feedback platform for conference speakers). And we captured the first pull request on twitter.

Can I get a woot? First @joindin pull request of the night has been merged at #tek13 hackathon!
— Lorna Mitchell (@lornajane) May 16, 2013<script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"/>
At the introduction of the hackathon we also had a nice surprise for Mr. Keith Casey from his colleagues at Twillio where he worked 2 years now.

"/>

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

Catégories: Open Source, PHP Community

5 Reasons Why the Web Platform War is Over: PHP Won with 75% says Google

Planet-PHP - Mon, 20/05/2013 - 12:43
By Manuel Lemos
During Google I/O 2013 event a Google manager said PHP runs on 75% of the Web sites. So they decided to finally support PHP as in their AppEngine hosting service.

Read this article to understand why this puts an end to years of false claims that PHP was losing market, as well what it means to Web developers using PHP or other languages.
Catégories: Open Source, PHP Community

Community News: Packagist Latest Releases for 05.19.2013

PHPDeveloper.org - Sun, 19/05/2013 - 15:06
Recent releases from the Packagist:

Community News: Packagist Latest Releases for 05.18.2013

PHPDeveloper.org - Sat, 18/05/2013 - 15:00
Recent releases from the Packagist:

DZone.com: Cloning in PHP

PHPDeveloper.org - Fri, 17/05/2013 - 18:09

In this recent post over on DZone.com Giorgio Sironi takes a look at the "clone" feature of PHP - what it is, how it can be used and things to watch out for in its use.

Cloning is an operation consisting in the duplication of a data structure, usually to avoid the aliasing problem of having different code modify the same instance in inconsistent ways. In PHP, cloning can be accomplished in multiple ways - and in some cases it can be avoided altogether.

He talks some about how objects are passed around internally during the PHP execution and how you can tell if a function works with data by reference (from the manual). He then looks at the "clone" keyword and what kinds of things are duplicated from an object when it is used. He briefly touches on the "__clone" magic method for solving the "shallow clone" problem and how, possibly, serializing the object might be a better alternative for reproducing the entire object.

Link: http://css.dzone.com/articles/cloning-php

PHPMaster.com: Openbiz Cubi: A Robust PHP Application Framework, Part 1

PHPDeveloper.org - Fri, 17/05/2013 - 17:36

On PHPMaster.com today they've posted the first part of a series spotlighting Openbiz Cubi, a PHP "framework" with a business focus.

Openbiz Cubi is a robust PHP application framework giving developers the ability to create business applications with minimal effort. In this two-part series I'll explain the concepts and steps necessary to create your own business web applications with Cubi. We'll look first at the challenges web developers face and how Openbiz Cubi can help, and then how to install Cubi. In part 2 we'll see how to create our own modules.

They start off by describing the tool and some of the features that come with it (including user management and the XML data object structure). Complete installation instructions are included and a screenshot is included of the end result. They include a "quick tour" of Cubi's features and some of the modules that come with it like the System, Menu and User modules. In part two of the series, they'll show you how to create a custom module.

Link: http://phpmaster.com/openbiz-cubi-a-robust-php-application-framework-1

Chris Jones: Offline Processing in PHP with Advanced Queuing

PHPDeveloper.org - Fri, 17/05/2013 - 16:49

Chris Jones has a new post today showing you how to use Oracle and PHP together to process data offline via the Oracle Streams Advanced Queuing feature.

Offloading slow batch tasks to an external process is a common method of improving website responsiveness. One great way to initiate such background tasks in PHP is to use Oracle Streams Advanced Queuing in a producer-consumer message passing fashion. [...] The following example simulates an application user registration system where the PHP application queues each new user's street address. An external system monitoring the queue can then fetch and process that address. In real life the external system might initiate a snail-mail welcome letter, or do further, slower automated validation on the address.

He includes the SQL needed to create the database and configure the queue system as well as start it up and get it ready for requests. He shows how to push an address into the queue for processing and how to get the results once it has completed in both the SQL and from the oci_* functions in PHP.

Link: https://blogs.oracle.com/opal/entry/offline_processing_in_php_with

Community News: Packagist Latest Releases for 05.17.2013

PHPDeveloper.org - Fri, 17/05/2013 - 15:08
Recent releases from the Packagist:

Offline Processing in PHP with Advanced Queuing

Planet-PHP - Thu, 16/05/2013 - 22:14

Offloading slow batch tasks to an external process is a common method of improving website responsiveness. One great way to initiate such background tasks in PHP is to use Oracle Streams Advanced Queuing in a producer-consumer message passing fashion. Oracle AQ is highly configurable. Messages can queued by multiple producers. Different consumers can filter messages. From PHP, the PL/SQL interface to AQ is used. There are also Java, C and HTTPS interfaces, allowing wide architectural freedom.

The following example simulates an application user registration system where the PHP application queues each new user's street address. An external system monitoring the queue can then fetch and process that address. In real life the external system might initiate a snail-mail welcome letter, or do further, slower automated validation on the address.

The following SQL*Plus script qcreate.sql creates a new Oracle user demoqueue with permission to create and use queues. A payload type for the address is created and a queue is set up for this payload.

-- qcreate.sql

connect / as sysdba
drop user demoqueue cascade;

create user demoqueue identified by welcome;
grant connect, resource to demoqueue;
grant aq_administrator_role, aq_user_role to demoqueue;
grant execute on dbms_aq to demoqueue;
grant create type to demoqueue;

connect demoqueue/welcome@localhost/orcl

-- The data we want to queue
create or replace type user_address_type as object (
  name        varchar2(10),
  address     varchar2(50)
);
/

-- Create and start the queue
begin
 dbms_aqadm.create_queue_table(
   queue_table        =>  'demoqueue.addr_queue_tab',
   queue_payload_type =>  'demoqueue.user_address_type');
end;
/

begin
 dbms_aqadm.create_queue(
   queue_name         =>  'demoqueue.addr_queue',
   queue_table        =>  'demoqueue.addr_queue_tab');
end;
/

begin
 dbms_aqadm.start_queue(
   queue_name         => 'demoqueue.addr_queue',
   enqueue            => true);
end;
/

The script qhelper.sql creates two useful helper functions to enqueue and dequeue messages:

-- qhelper.sql
-- Helpful address enqueue/dequeue procedures

connect demoqueue/welcome@localhost/orcl

-- Put an address in the queue
create or replace procedure my_enq(name_p in varchar2, address_p in varchar2) as
  user_address       user_address_type;
  enqueue_options    dbms_aq.enqueue_options_t;
  message_properties dbms_aq.message_properties_t;
  enq_id             raw(16);
begin
  user_address := user_address_type(name_p, address_p);
  dbms_aq.enqueue(queue_name         => 'demoqueue.addr_queue',
                  enqueue_options    => enqueue_options,
                  message_properties => message_properties,
                  payload            => user_address,
                  msgid              => enq_id);
  commit;
end;
/
show errors

-- Get an address from the queue
create or replace procedure my_deq(name_p out varchar2, address_p out varchar2) as
  dequeue_options    dbms_aq.dequeue_options_t;
  message_properties dbms_aq.message_properties_t;
  user_address       user_address_type;
  enq_id             raw(16);
begin
  dbms_aq.dequeue(queue_name         => 'demoqueue.addr_queue',
                  dequeue_options    => dequeue_options,
                  message_properties => message_properties,
                  payload            => user_address,
                  msgid              => enq_id);
  name_p    := user_address.name;
  address_p := user_address.address;
  commit;
end;
/
show errors

The script newuser.php is the part of the PHP application that handles site registration for a new user. It queues a message containing their address and continues executing:

<?php
// newuser.php

$c = oci_connect("demoqueue", "welcome", "localhost/orcl");

// The new user details
$username = 'Fred';
$address  = '500 Oracle Parkway';

// Enqueue the address for later offline handling
$s = oci_parse($c, "begin my_enq(:username, :address); end;");
oci_bind_by_name($s, ":username", $username, 10);
oci_bind_by_name($s, ":address",  $address,  50);
$r = oci_execute($s);

// Continue executing
echo "Welcome $username\n";

?>

It executes an anonymous PL/SQL block to create and enqueue the address message. The immediate script output is simply the echoed welcome message:

Welcome Fred

Once this PHP script is executed, any application can dequeue the new message at its leisure. For example, the following SQL*Plus commands call the helper my_deq() dequeue function and displays the user details:

-- getuser.sql

connect demoqueue/welcome@localhost/orcl

set serveroutput on
declare
  name varchar2(10);
  address varchar2(50);
begin
  my_deq(name, address);
  dbms_output.put_line('Name     : ' || name);
  dbms_output.put_line('Address  : ' || address);
end;
/

The

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

Catégories: Open Source, PHP Community

NetTuts.com: How to Write Testable and Maintainable Code in PHP

PHPDeveloper.org - Thu, 16/05/2013 - 18:53

NetTuts.com has a new tutorial posted suggesting a few ways you can make testable and maintainable code in PHP applications.

Frameworks provide a tool for rapid application development, but often accrue technical debt as rapidly as they allow you to create functionality. Technical debt is created when maintainability isn't a purposeful focus of the developer. Future changes and debugging become costly, due to a lack of unit testing and structure. Here's how to begin structuring your code to achieve testability and maintainability - and save you time.

There's a few concepts they cover in the tutorial including DRY (don't repeat yourself), working with dependency injection and actually writing the tests with PHPUnit. They start with a bit of code that needs some work and use the tests to help refactor it into something that can be easily mocked (using Mockery).

Link: http://net.tutsplus.com/tutorials/php/how-to-write-testable-and-maintainable-code-in-php

Bob Majdak: On SQL in PHP

PHPDeveloper.org - Thu, 16/05/2013 - 17:11

In a new post to his site Bob Majdak looks at using SQL in PHP and some of the challenges he's come across (some of them with his own tools). He talks about things line inline SQL, loading SQL by unique key or creating a "build object".

There is no right or wrong way, but no matter what there is no *pretty* way to do SQL inside of a PHP application. I have been having a personal debate with myself all week about how to make SQL statements nicer in an application without going to a huge DBAL package like Doctrine.

He looks at each idea and provides some of the pros and cons about each of them, noting that he hasn't quite decided on which is the best method. Some sample code is included to help clarify the points, showing the "find by unique key" version and how a more complex query might be created with the "builder object."

Link: http://catch404.net/2013/05/on-sql-in-php

Community News: Google App Engine now Supports PHP runtime

PHPDeveloper.org - Thu, 16/05/2013 - 17:05

On the Google Developers Blog (and lots of places across the web) there's a major update that Google has done for their AppEngine service - the introduction of a PHP runtime to their offerings.

App Engine 1.8.0 is now available and includes a Limited Preview of the PHP runtime - your top requested feature. We're bringing one of the most popular web programming languages to App Engine so that you can run open source apps like Wordpress. It also offers deep integration with other parts of Cloud Platform including Google Cloud SQL and Cloud Storage.

You can get more information about how to use this new feature on Google App Engine site.

Link: https://gaeforphp.appspot.com
Syndiquer le contenu