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

Sammy Powers:
Finding & patching a bug in php-src
Oct 10, 2017 @ 17:17:06

Sammy Powers has a new post to his site today showing you how to find and patch a bug in php-src, the source of the PHP language itself.

While he does provide all of the details in the post he also has created a screencast that walks you through the whole process as well. He breaks up the process into the different steps of the process:

  • Find the bug (his was with the JSON handling)
  • Submit a bug report (on bugs.php.net)
  • Make a patch
  • Run GDB
  • Make a test
  • Submit a PR and update the bug

He includes code and descriptions along the way and finishes out with further suggestions about feedback on the PR and how his own situation finished out.

tagged: phpsrc find patch bug pullrequest unittest patch tutorial

Link: https://www.sammyk.me/how-to-find-and-patch-a-bug-in-php-source-php-internals

FogCreek.com:
How to Find, Hire, and Retain Developers – Interview with Cal Evans
May 15, 2015 @ 13:58:54

On FogCreek.com they've posted a new interview they recorded with PHP community member Cal Evans about how to find, hire and retain developers for your business.

We’ve interviewed Cal Evans, author of ‘Culture of Respect’, and we discuss how to find, hire, and retain Developers. He gives tips on where to find great developers, how to write job ads which appeal to them and how best to interview them. We also discuss ways to build a great team culture that can help startups and growing businesses compete with the big guys for talent.

You can catch the interview in a few different ways - either through the in-page video recording, audio-only over on SoundCloud or you can download it for listening offline.

tagged: calevans interview video find hire retain developer cultureofrespect

Link: http://blog.fogcreek.com/how-to-find-hire-and-retain-developers-interview-with-cal-evans/

Andrew Podner:
Lithium: Getting Stuff From Your Database
Jan 14, 2013 @ 16:36:31

Andrew Podner has a new post for those wanting to find out more about the Lithium framework and using models to work with your database.

Today I want to provide a tutorial on how to do some basic interaction with a database in Lithium, and I am going to rely on MySQL as a database for the purposes of this tutorial, although you have other options like MongoDB, as an example.

His example script uses the idea of "blog posts" stored in a MySQL table and code snippets are included showing how to:

  • Create the model class based off of the core Lithium one
  • Select all of the records from the table
  • Filter down the returned values with "magic finder" methods (like "findAllByStatus")

You can find out more about the framework in the project's documentation section of their site.

tagged: database orm model find tutorial mysql

Link:

DZone.com:
Development Setup for Neo4j and PHP: Part 2
Aug 02, 2012 @ 15:11:10

On DZone.com today they've posted the second part of their series looking at using the Neo4j database from your PHP applications.

This is Part 2 of a series on setting up a development environment for building projects using the graph database Neo4j and PHP. In Part 1 of this series, we set up unit test and development databases. In this part, we'll build a skeleton project that includes unit tests, and a minimalistic user interface.

The post includes the code to create the testing harness, a bootstrap file and a basic test to handle the checks on deletion of an "Actor". The rest of the post shows how to use the connection to find an Actor based on input from the user via a form.

tagged: tutorial neo4j series setup unittest actor find

Link:

Sean Coates' Blog:
Use `env`
May 21, 2012 @ 16:58:34

Sean Coates has posted a reminder for PHP developers (and really anyone executing command-line scripts) to use "env" instead of hard-coding the path to the PHP interpreter.

These [support] scripts often run PHP in Gimme Bar land, and we make extensive use of the shebang syntax that uses common Unix practice of putting #!/path/to/interpreter at the beginning of our command-line code. Clearly, this is nothing special -lots of people do exactly this same thing with PHP scripts. One thing I have noticed, though, is that many developers of PHP scripts are not aware of the common Unix(y) environment helper, env.

The "env" alias makes use of your currently defined include path to track down a PHP binary to use to execute the script. Since there's only a "best practices" approach to places to put PHP on a server, the "env" usage makes your script more portable and it's one less thing to remember to change.

If you distribute a PHP application that has command-line scripts and shebang lines, I encourage you to adopt the practice of making your shebang line "#!/usr/bin/env php". Note that this doesn't just apply to PHP of course, but I've seen a definite lack of env in the PHP world.
tagged: env environment include path find executable shebang

Link:

Stefan Koopmanschap's Blog:
GlobIterator: Easy access to specific files
Apr 17, 2012 @ 17:43:42

Stefan Koopmanschap has a new post to his blog showing a handy use of the GlobIterator to access only certain files.

For a project I am working on I needed to iterate over all .xml files in a specific directory. I started out with a DirectoryIterator, then considered I didn't want the XML filtering to take place inside my foreach loop. I decided to add a FilterIterator to the setup, but then felt this was not the right solution either. So I turned to my favorite SPL guru, Joshua Thijssen, to see if I was overseeing some kind of filter-option in the DirectoryIterator. I didn't, but I did oversee something else: GlobIterator.

The GlobIterator lets you use functionality similar to the glob function (including being able to use wildcards in file searching) and get the resulting list back as a set of SplFileInfo objects, complete with additional metadata that can be extracted.

tagged: globiterator spl iterator glob filesystem find

Link:

Sharon Levy's Blog:
PHP Version
Jan 05, 2012 @ 19:20:40

Sharon Levy has a new post to her blog showing a trick she's come up with to show the PHP version information (usually found in the phpinfo) even when it's disabled.

Sometimes the most crucial, basic piece of information can seem so hard to find. For example, suppose you wanted to find out what version of PHP your remote webhost provides to shared hosting users? What would you do? [...] For development purposes it can be helpful having phpinfo() available, but on a live shared host, you may discover as I did recently that it is no longer available; your host may have disabled it.

She includes three other ways you can use to get the version of PHP you're working with:

  • If you have command line access, running "php -v"
  • Using the phpversion function (or PHP_VERSION constant)
  • Appending a certain value to the URL (only works in some cases)
tagged: find version language method phpinfo phpversion url

Link:

PHPClasses.org:
Talented Web Developers Are Easy to Hire, Employers Are Just Not Looking Right
Nov 30, 2011 @ 15:57:05

A new post on the PHPClasses blog today suggests that good, talented web developers are actually pretty easy to find, you just have to look in the right places.

Once in a while, we hear company managers and recruiters complaining about how hard is to find talented Web developers that are willing work for them. The problem is that they are not looking right. Not only there are plenty of talented Web developers out there, they are easy to find, and many of them are available for hire.

The key point in his "easy to find developers" argument is simple - be open to telecommuting. Too many companies shun it because of the lack of control it brings to a group, but it also shuts down so many possibilities. He offers a few of his own reasons for the hesitation: the need to see the employee frequently, security concerns and trust issues. He also includes a few of the success stories of PHP community members who telecommute including Eli White, Ernani Joppert and Arturs Sosins.

tagged: find developer company telecommute opinion

Link:

PHPBuilder.com:
PHP Simple HTML DOM Parser: Editing HTML Elements in PHP
Sep 08, 2011 @ 15:06:07

On PHPBuilder.com today there's a new tutorial from Vojislav Janjic about using a simple DOM parser in PHP to edit the markup even if it's not correctly W3C-formatted - the Simple HTML DOM Parser

Simple HTML DOM parser is a PHP 5+ class which helps you manipulate HTML elements. The class is not limited to valid HTML; it can also work with HTML code that did not pass W3C validation. Document objects can be found using selectors, similar to those in jQuery. You can find elements by ids, classes, tags, and much more. DOM elements can also be added, deleted or altered.

They help you get started using the parser, passing in the HTML content to be handled (either directly via a string or loading a file) and locating elements in the document either by ID, class or tag. Selectors similar to those in CSS are available. Finally, they show how to find an object and update its contents, either by adding more HTML inside or by appending a new object after it.

tagged: simple html dom parse tutorial selector find replace edit

Link:

Josh Adell's Blog:
Path finding with Neo4j
Jun 28, 2011 @ 17:38:01

In a follow up to his previous post on using Neo4j with PHP, Josh Adell looks in a bit more detail about how to find paths in the data via a REST interface to the database.

The thing that makes graphing databases useful is the ability to find relationship paths from one node to another. There are many algorithms for finding paths efficiently, depending on the use case.

He includes some code showing the REST request (made via this client) to fetch these street-based relationships. He then creates a little sample script that provides driving directions from one intersection to another with a "findPathsTo" call. He modifies it a bit later on to use the Dijkstra algorithm.

tagged: path find neo4j graph database tutorial rest client

Link:


Trending Topics: