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

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 4 of 8)
September 05, 2014 @ 09:22:38

Matthew Weier O'Phinney has posted the latest tip in his Zend Server deployment series, part 4 related to securing the scripts you use for your jobs (like cron, but run through Zend Server).

This is the fourth in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed a trick I learned about when to execute a chmod statement during deployment. Today, I'm sharing a tip about securing your Job Queue job scripts.

He talks about the security concerns around the scripts you use for your jobs and how to protect them since they're exposed to the world as public scripts (if their URL can be tracked down, that is). He shares a few lines of code that can help prevent that, though - a check to see if it's running as a job (via getCurrentJobId) and returning a "403 Forbidden" if not.

0 comments voice your opinion now!
zendserver deployment tips series part3 security jobid

Link: https://mwop.net/blog/2014-09-04-zend-server-deployment-part-4.html

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 3 of 8)
September 03, 2014 @ 09:34:51

Matthew Weier O'Phinney has posted the third article in his "Deploying Zend Server Tips" series today. In this tip he talks about file permissions and execution of shell commands.

In the first tip, I detailed writing deployment scripts. One of the snippets I shared was a chmod routine. [...] The code is fine; what I did not share is where in the deployment script you should invoke it. As I discovered from experience, this is key.

He points out that the deployment is run under a different user than the web server user. Future writes to those files by the web server could fail because of it, so he recommends running the permission change as the last step of the deployment script. If this ti was interesting and you'd like to check out more, you can find them in the first and second parts of the series.

0 comments voice your opinion now!
zendserver deployment tips series part3 chmod script

Link: https://mwop.net/blog/2014-09-02-zend-server-deployment-part-3.html

Matthias Noback:
Symfony2 Framework independent controllers parts 2 & 3
June 19, 2014 @ 09:45:34

Matthias Noback has posted the next two parts of his "framework independent controllers" series (it started here) looking at avoiding annotations and tying up some loose ends.

From part two about annotations:

In the previous part of this series we decreased coupling of a Symfony controller to the Symfony2 framework by removing its dependency on the standard Controller class from the FrameworkBundle. Now we take a look at annotations. They were initially introduced for rapid development (no need to create/modify some configuration file, just solve the issues inline!) [...] This might not seem such a big problem at all, but the SensioFrameworkExtraBundle is a bundle, which means it only works in the context of a Symfony2 application. We don't want our controller to be coupled like this to the framework (at least, that is the point of this series!), so we need to remove the dependency.

He shows how to decouple this functionality through a proper routing configuration, fetching the needed data yourself for the request and generating the request object yourself. In part three he covers some of the comments already made about the series and how to take the final steps to abstracting out the controllers: removing bundle names from templates, removing the HttpFoundation dependency and letting go of "action methods".

0 comments voice your opinion now!
controller independent symfony series part2 part3

Link: http://php-and-symfony.matthiasnoback.nl/tags/controller/

NetTuts.com:
Refactoring Legacy Code Part 3 - Complex Conditionals
May 05, 2014 @ 10:43:20

The NetTuts.com site has posted the third part of their series sharing some tips for refactoring the code in a legacy application. In part one they looked at the "Golden Master" and in part two about moving away from magic strings and constants.

Old code. Ugly code. Complicated code. Spaghetti code. Gibberish nonsense. In two words, Legacy Code. This is a series that will help you work and deal with it. I like to think about code just as I think about prose. Long, nested, composed sentences with exotic words are hard to understand. From time to time you need one, but most of the time, you can just use plain simple words in short sentences. This is very true for source code also.

Continuing on with this "prose" theme, he gives an example of simplification and reducing the amount of validation needed before completing the task. He compares this to complex conditionals and shares something called the "extract method" to help simplify them. He also looks at directory and file structure and suggests cleanup there as well. The tutorial finishes with a few other suggestions, things like cleaning up "runner functions" reworking negative conditionals.

0 comments voice your opinion now!
refactor legacy code series part3 conditionals complex

Link: http://code.tutsplus.com/tutorials/refactoring-legacy-code-part-3-complex-conditionals-long-methods--cms-20944

SitePoint PHP Blog:
Becoming a PHP Professional Practical Teamwork
January 07, 2014 @ 13:35:12

In part four of his "Becoming a PHP Professional" post series Bruno Skvorc looks at the topic of "professional teamwork" , more so as it relates to a bit more practical things.

Last time, we discussed social aspects of teamwork, and how working in a team can both benefit and harm you. There's loads to take into consideration when working with other people, and lots to be gained. This time, let's talk about practical aspects of teamwork, particularly virtual teams or, in other words, teams with remote members.

He covers a three main topics (several that only relate to non-colocated teams):

  • Time Zone Difference and Broken Bottleneck in Teamwork
  • Organic Solutions (the importance of a technical lead and filter)
  • Inorganic solutions (technology to make life easier and remote workers more productive)
0 comments voice your opinion now!
professional developer series part3 practical teamwork solutions

Link: http://www.sitepoint.com/becoming-php-professional-practical-teamwork

SitePoint PHP Blog:
Becoming a PHP Professional Social aspects of teamwork
December 17, 2013 @ 14:16:31

Bruno Skvorc has posted his latest article in his "Becoming a PHP Professional" series to the SitePoint PHP blog today. This time he talks about the social aspects of teamwork, a look at three things to consider to make working on a team easier regardless of the size.

This article will focus on social aspects of teamwork and initiative, and will serve as an introduction into a more concrete and practical teamwork based article coming soon. t's important to note that when I say teamwork, I don't only mean teams while working for a larger entity - a corporation or company in which you're a minor sub-group. A team is also a group of freelancers working together on a project - either close by, or remotely. Whenever you work with someone in any capacity whatsoever - that's a team. A loose team, but a team nonetheless.

He makes three suggestions that can help you figure out how to interact with people both in your immediate team and those outside of it:

  • Knowing your role
  • Giving respect to superiors (to a degree)
  • Don't be afraid to leave
What I'd like you to take away from this part is - don't be a slave of circumstance. Be courteous, professional and honest, but don't be afraid to leave a poisonous environment - it harms you, the people who love and support you, and finally, the project you're working on.
0 comments voice your opinion now!
professional developer series part3 social aspects teamwork

Link: http://www.sitepoint.com/becoming-php-professional-social-aspects-teamwork/

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 3
December 11, 2013 @ 09:19:23

The Dutch Web Alliance has posted the latest part in their "remote debugging with PHPStorm" series (parts one & two are linked here) with part three. This time they focus on setting up Xdebug and configuring the connection in the IDE.

Let's start with probably the most important part of all: debugging your web applications. In this day and age, people still use var_dump() and die() to debug their application. A shame really, knowing that step-debugging through your code is made really easy with PHPStorm. Using var_dump() is very slow, error prone and you only get a small fraction of the context you need in order to debug correctly. And how many times did such a var_dump() hit your production environment?? Truth be told, implementing XDebug does need a little bit of work, but fortunately PHPStorm has made things super easy for us.

They don't go through the whole installation part of Xdebug - there's other guides for that - but do help you configure it correctly to work with a remote debugger in PHPStorm. They show you how to set various breakpoints and a "trick" to working with path mappings.

0 comments voice your opinion now!
phpstorm remote debugging unittest tutorial series part3

Link: http://dutchweballiance.nl/techblog/the-definitive-remote-debug-and-unittest-with-phpstorm-guide-part-3/

MaltBlue.com:
ZendDbSqlSelect - The Basics (Columns, Limit & Order)
July 02, 2013 @ 09:53:32

Matthew Setter has posted the third part of his series looking at the Zend Framework 2's DbSqlSelect component and its use. In this latest (and last) tutorial, he talks more specifically about columns, limiting and ordering.

Welcome to the third and last part in this series, introducing you to working with the ZendDbSqlSelect classes in Zend Framework 2. In part one we looked at building SQL Where clauses using the where related functions, predicates and closures, as well as compound queries. In part 2, we looked at all forms of SQL joins as well as a slightly more esoteric feature of SQL - UNIONS. Here, in part 3, in the words of Coldplay, we're going back to the start, and looking at the fundamentals.

He looks at three specific elements - the class constructor, the "limit" and "order" functions and the "Expression" class. He includes sample code showing how to create the class - one normally and one bound to a specific table. The next example shows how to define the columns to be selected using the "select" method. Finally, he shows the use of the "Expression" objects to perform SQL operations in the query (like "COUNT").

0 comments voice your opinion now!
zendframework2 db sql select series part3 column limit order

Link: http://www.maltblue.com/tutorial/zend-db-sql-the-basics

PHPMaster.com:
Localizing PHP Applications "The Right Way", Part 3
November 14, 2011 @ 08:38:48

PHPMaster.com has posted its third part of its "Localizing PHP Applications 'The Right Way'" series. In this third part you'll learn more about locales and message domain switching.

In Part 2 you gained more insight into using the gettext library by learning the most important functions of the extension. In this part you'll learn how to best use a fallback locale, switch between locales, and override the currently selected message domain.

They show you how to set up the directory structure to handle a fallback locale, a choice to use when the system can't determine which to use. By using a default, you also avoid having the system translate from the default language to...the default language (like "English" to "English"). Included are also the code bits you'll need to switch between locales (just using a different domain) and using the dgettext function to specify a different domain than the selected one.

0 comments voice your opinion now!
localize application gettext domain locale series part3


Stefan Mischook's Blog:
Video Tutorial Processing forms with PHP, Part 3
September 25, 2007 @ 10:28:00

Stefan Mischook has posted the third part of his latest video series - processing forms with PHP:

I just released part 3 on how to process forms with PHP: Processing forms with PHP - part 3. This video wraps up my introduction to forms and PHP where I also teach a little about functions along the way. It's about 8 minutes long.

You can check out the previous parts (part 1, part 2) of this series (and lots of other great PHP-related videos) in the PHP Videos section of Stefan's blog.

0 comments voice your opinion now!
video processing form tutorial part3 beginner video processing form tutorial part3 beginner



Community Events





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


symfony code series zendserver bugfix list community laravel voicesoftheelephpant interview conference language podcast release threedevsandamaybe framework deployment introduction api tips

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