News Feed
Jobs Feed
Sections




News Archive
feed this:

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

DZone.com:
Factory patterns Collaborators Map
October 24, 2012 @ 09:43:02

On DZone.com Giorgio Sironi has a new tutorial looking at the Factory design pattern, specifically the use of a "collaborators map" to create them inside of a dependency injection container.

Like for every library, you should first evaluate if the costs and benefit of integrating [a dependency injection container] are worth it. The alternative is to write your own factory classes, methods and closures: this article explains one of the patterns for building dynamic Factory objects, and as such lowers the cost of the second option. What you know how to do has a lower cost than what you still have to learn, considering risk and implementation time.

He talks about the "old way" of making your own factories to create objects and how the collaborators mapping can replace that. The collaboration mapping is passed in when the object is created and a "create" method is called when the objects (or sub-objects) are needed. He also mentions some of the "easy" and "hard" changes you could make to this setup to expand its functionality.

0 comments voice your opinion now!
factory designpattern collaborator map object create


PHPRiot.com:
Reducing a Map Path Using Douglas-Peucker Algorithm
April 29, 2011 @ 12:40:42

On PHPRiot.com there's a new tutorial showing you how to use the Douglas-Peucker algorithm to make the pathing on your map the simplest possible (the fewer points the better) having serious benefits a wide range of users, most notably those on mobile devices.

When drawing a path on a map (for instance, the directions from point A to point B) it is important to consider the limitations of the device you're drawing the path on. In this article, I will show you how to reduce the number of points in a path so the path can be displayed with minimal loss of quality on devices such as iPhone or Android-powered devices that may struggle with an extremely large set of points.

Using the GTFS service's data, he's been creating maps for an iPhone application. Naturally, a path with 700 points would take a lot of resources to render. Using the Douglas-Peucker algorithm he can reduce it down to a much more manageable 70 points. He explains the algorithm briefly and hows how to implement it in PHP with three classes - ShapePoint, Shape and ShapeReducer. The resulting reduced dataset is then passed directly over to a Google Maps for plotting.

0 comments voice your opinion now!
douglaspeucker algorithm reduce tutorial map point path


PHPMagazine.net:
Hello PHPUG ?!
September 29, 2010 @ 12:02:47

On the PHPMagazine.net site there's a new article about PHP user groups and some of the resources that can be used to help find one in your area.

Part of this community a lot of core developers, documentation editors, web application developers, hackers, Quality assurance team, tons of open source projects, PHP UG around the world, and many many other people contributing each one in its category, and even friends and family! Users Group are an active element of the PHP ecosystem, and I believe that everyone should be involved to contribute and keep these UG active around the world.

Some of the efforts that he's pointed out from the past are the phpgroups.org site, phpusergroups.com as well as the sharemymap.com effort to map the groups out. Unfortunately there's no single resource that you can point to that has a full listing.

0 comments voice your opinion now!
usergroup resource locate map


SitePoint PHP Blog:
How to Avoid 404s and Redirect Old URLs in PHP
August 03, 2010 @ 14:15:27

On the SitePoint PHP blog today there's a new post showing you how to create a 404 page that will redirect people back to the page they're looking for (that used to be there).

It's often necessary to reorganize your site and change the URL structure but, assuming you have similar content, users should rarely encounter a "page not found" error. Producing unnecessary 404 pages is one of my top 10 development mistakes. In this article, we'll create an automated PHP redirection system that converts old URLs to a new address. It's not production code, but it will illustrate the basics so that you can adapt it for your own website.

They walk you through the creation of a 404 error handling PHP page, configuring your server to use it and making the mapping of new URL to old URL. There's even a bit to include if there's not a mapping for a requested page - returning a 301 HTTP header.

0 comments voice your opinion now!
404 redirect map url tutorial


Developer.com:
Doctrine Object Relational Mapping for Your PHP Development
June 14, 2010 @ 10:22:06

New on Developer.com today there's a new article looking at one of the more powerful ORM tools available for PHP - Doctrine.

Because of the relational database's pivotal role in driving Web applications, a great deal of time and effort has been put into creating tools that not only simplify the task of mapping database tables to a programming language's object-oriented class structure, but also facilitate the management of your data and schemas over the project lifecycle. [...] The PHP community also has a powerful database integration tool at their disposal: a project known as Doctrine.

They help you get started with this powerful tool by showing you how to get it installed, create a sample schema and loading some fixtures (base data). There's also a quick snippet of code showing you how to grab information from a sample user table and display the name of the user.

0 comments voice your opinion now!
doctrine object relational map orm tutorial


Zend Developer Zone:
Request parameter mapping to action method parameters
October 05, 2009 @ 08:04:54

The Zend Developer Zone has a quick post from albeva about an extension from the default controller in the Zend Framework to map URL parameters directly to the methods.

This not only makes parameter passing intuitive (rather than calling $this->_request->getParam() ) but also automatically uses the default value if provided and if typehinting is provided either via phpdoc comment or before the parameter (array or classname) it will do the required instantiation or type casting.

The post includes a snippet of sample code, but you can learn more about the script here.

0 comments voice your opinion now!
request parameter zendframework map


EasyPHPWebsites.com:
Creating a Website Visitor Map (Ajax, jQuery, Google Maps API)
June 22, 2009 @ 13:41:29

Jason Gilmore has posted the first tutorial in a series of tutorial combining PHP and jQuery, a look at creating a web site visitor map.

Have you ever wanted to create a map depicting the geographical origin of recent visitors to your website? In this tutorial I'll show you how to record these locations using the Google Ajax Search API, and then use a combination of PHP, MySQL, Ajax, and the Google Maps API to store these locations and build the map.

The tutorial shows how to use the Google Ajax API to locate the current visitor's spot in the world, store it into a MySQL database and then use a jQuery interface to pull the json-formatted details out of the system for display.

1 comment voice your opinion now!
map tutorial jquery googlemaps


PHP-GTK Community Site:
World map of PHP-GTK developers
January 28, 2009 @ 07:55:33

The PHP-GTK Community site has launched a new service to help PHP-GTKers out there find out other developers that might be in their area - a world map (based on Google maps) of other PHP-GTK developers around the world.

I reviewed the coordinates given by existing members and noticed a good number had visibly inverted latitude and longitude; so I inverted them again to place them where it appeared to make more sense (are there really PHP-GTK devs in the middle of the pacific, or near the South pole ?). So you may want to double-check your coordinates to make sure the values are correct, because it's likely I've not found every error.

He's also asking for the Brasil PHP-GTK community to include their information in the map as well as a request for anyone out there that might want to make a "prettier" icon for showing the developers on the map.

0 comments voice your opinion now!
world map phpgtk developer location brasil latitude longitude


Michelangelo van Dam's Blog:
Mapping Seven Things
January 05, 2009 @ 11:17:14

Since the Seven Things meme has been charging its way through the members of the PHP community (and some outside it), it's hard to keep track of who is tagging who and if those people have posted their "seven things" and tagged others. Michelangelo van Dam has tried to make things easier with his "Who Tagged Who" map mini-application that crawls through the posts looking for others who were tagged.

Trying to get a bit of overview of all people who have put up their "Seven Things" list, I created a little map that shows who tagged who with an overview of the most tagged persons.

You can also grab the XML source file if you'd like to manipulate it yourself.

0 comments voice your opinion now!
map seventhings blog tagged xml source dynamic


Asvin Balloo's Blog:
Geolocate your visitors with PHP (part 2)
July 30, 2008 @ 12:08:10

Asvin Balloo has posted the second part of his geolocate with PHP tutorial series - using the mapping information gathered from the previous article to plot them on a map.

In the first part of this series I showed how you could get the country of a visitor via his IP address. Now with this precious information, I'll show you how to map the visitor visually on the world map using Google Maps.

The full code is provided - the PHP to pull the latitude/longitude information from the GeoIP library and the Javascript to get the Google Map to plot the point. You can check out the live demo for an example or just grab the source and try it out for yourself.

0 comments voice your opinion now!
geolocate google map geoip javascript tutorial



Community Events











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


composer database podcast hhvm component release introduction unittest language facebook package application overview hack symfony2 performance install opinion security framework

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