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

PHPMaster.com:
Data Structures for PHP Devs Trees
July 08, 2013 @ 11:20:29

PHPMaster.com has posted their second article in their "data structures" series, this time focusing on trees - a structure for effectively storing related data in an easier to access format.

In a previous article I introduced two basic data structures: stack and queue. The article was well received so I've decided to share data structures in an intermittent on-going series here at PHPMaster. In this entry I'll introduce you to trees, another data structure used in software design and architecture.

He helps you get your head around the concept of trees using the idea of searching data, nothing that a stack or queue aren't exactly the right tools for the job. He talks about the basic concepts behind trees including "leaves" and "root nodes." He includes sample code showing how to make a simple node, insert some child nodes and "walking the tree" to find the information you're looking for.

0 comments voice your opinion now!
data structure tree tutorial introduction

Link: http://phpmaster.com/data-structures-2

Rashaud Teague's Blog:
Basic Data Trees
August 21, 2009 @ 11:41:08

Rashaud Teague has posted a new tutorial to his blog about data trees and parent/child relationships in PHP applications:

Displaying data in data trees showing parent/child relationships can be important to your application for when users are looking for data. [...] Here I will be showing you (most likely a beginner programmer) how to display data from a database (MySQL) using PHP. In the this example I'm using the data from Maris SimpleDocu, a "simple" documentation system.

His simple table holds data for a series of pages linked by a "parent" key column. Back in the PHP he uses a recursive function to pull in a subset of the data. The end result is output showing the levels of the data, spaced out by dashes.

0 comments voice your opinion now!
data tree simpledocu tutorial


Robert Basic's Blog:
Playing with Zend_Navigation and routes
August 10, 2009 @ 08:13:12

In this new post to his blog Robert Basic looks at the Zend_Navigation component of the Zend Framework and how it can be used to more correctly handle bad requests.

I wanted to set up routes in such way that when a user requests a page, all requests for non-existing controllers/modules are directed to a specific controller (not the error controller). In other words, if we have controllers IndexController, FooController and PageController, anything but http://example.com/index and http://example.com/foo is directed to the PageController.

Using the Zend_Controller_Router_Route_Regex component he creates an expression that matches anything but the two allowed controllers and pushes them back over to the "page" controller. The new route is put in place via an addRoute call. He also shows how to use the Zend_Navigation component to manage the navigation structure for this application, defining a PHP array of the nested sitemap if the site.

0 comments voice your opinion now!
zendnavigation route regex tree


Daniel Cousineau's Blog:
Displaying N-Deep Trees (Remember Your Algorithms Course?)
August 07, 2008 @ 12:03:23

On his Tower of Power blog Daniel Cousineau has written up a look at using a more detailed categorization method than just a parent/child relationship on your data - Tree Traversals.

If the software calls for only 2 levels of categorization (Parent and Child only), a simple nested for loop will suffice. However, software requirements change and you'll soon find yourself up shit creek without a paddle if you need to support 3 or 4 levels of nesting. [...] To those who's training is less formal (most web developers I meet have practical training, not formal), I'll help you out: Tree Traversals (or if you are completely lost, Recursion).

He creates a recursive function that, when passed in a category set with different types in it, can handle each of them and then calls itself again with the new child data. His sample code creates url out of a set of categories.

0 comments voice your opinion now!
tree category recursion tutorial parent child loop treetraversal


Expirmentalworks.net:
Inofficial PHP GIT repositories - Importing large trees
January 08, 2008 @ 10:24:00

David has posted an article to the Expirmentalworks.net blog about a task that he and Johannes Schluter have finished up - importing the PHP CVS tree over into Git.

A few month ago Johannes Schluter and I started discussing about GIT and other decentralized version control systems. During our exploration of GIT we thought about importing the PHP CVS tree into git. A few weeks later and a lot of wasted cpu time, we finally managed to provide an inofficial GIT mirror of the PHP CVS repository. It's provided by Johannes Schluter and mirrored by me.

The post documents the path they followed - using git-cvsimport, parsecvs and a path they needed to make - to finally get the import working without any flaws. You can check out their unofficial repository here (it's updates twice a day from the live CVS).

0 comments voice your opinion now!
git version control cvs tree import patch gitcvsimport parsecvs git version control cvs tree import patch gitcvsimport parsecvs


Derick Rethans' Blog:
eZ Components 2007.2
December 18, 2007 @ 13:47:00

According to this new post from Derick Rethans, the eZ Components group has release the latest edition of their component set - version 2007.2.

Today we released the next version of eZ Components. In this release, there are two new components.

These two new components are:

  • Tree - enables you to create, manipulate and query tree structures (with multiple compatible backends for gathering the data from)
  • Webdav - allows for the quick and easy setup of a WebDAV-enabled server.

You can find out more about these components and many more included in the component library at the project's website (as well as this latest download).

0 comments voice your opinion now!
ezcomponents release component tree webdav ezcomponents release component tree webdav


Derick Rethans' Blog:
eZ Components 2007.2alpha1
November 15, 2007 @ 10:21:00

Derick Rethans has pointed out the release of the latest alpha version of the eZ Components framework - 2007.2alpha1.

We've just released the first alpha version of the new eZ Components release, for which the full version is due to be released somewhere next month. There are two new components, but also many improvements to existing components. The new components are: Tree and Webdav.

The Tree component makes working with tree-based structures (via two tieins for the component - TreeDatabaseTiein & TreePersistentObjectTiein) and the Webdav component allows for the quick and easy addition of WevDAV functionality to your application.

2 comments voice your opinion now!
ezcomponents framework release component webdav tree ezcomponents framework release component webdav tree


Kevin van Zonneveld's Blog:
Convert anything to Tree Structures in PHP
October 09, 2007 @ 16:38:00

Kevin van Zonneveld has posted a new example today of how to convert anything into a tree structure with PHP:

With a function on this site: explodeTree(), you can explode any single-dimensional array into a full blown tree. The function uses a user-specified delimiter found in the keys of the original array to separate nodes and determine hierarchy.

Sample: with 3 lines of code you could have a full directory hierarchy in a multi-dimensional array if you specify the delimiter to be a '/' (slash).

Not only is the code included to make the tree from the data, but an example block of code showing how to use the result.

0 comments voice your opinion now!
tree structure convert tutorial example usage tree structure convert tutorial example usage


Derick Rethans' Blog:
More goodies in the eZ Components
September 18, 2007 @ 19:44:00

As mentioned by Derick Rethans on his blog today, there's some new versions of several (five) of the components in the next version of the eZ Components framework:

In the just released alpha versions you can find new features, such as better support for OpenID, a Database backend for OpenID authentication, a validating method for e-mail addresses, SMTP authentication support for DIGEST-MD5, CRAM-MD5, NTLM and LOGIN and encoding support for e-mail headers.

He also mentions other goodies like tree structure handling and functionality to support WebDav connections. Check out their roadmap to get a better idea of what's to come.

0 comments voice your opinion now!
ezcomponents goodies authentication mail url tree webdav ezcomponents goodies authentication mail url tree webdav


Internet Super Hero:
PHP mysqlnd and its tests
July 30, 2007 @ 15:55:00

The Internet Super Hero blog has posted some new tests using the mysqlnd driver for PHP and shows you how it's all done for you to follow along at home.

PHP extensions can test their userland (PHP) functionality using so called "phpt Tests". phpt Tests consist of several parts with their main part being regular PHP code to test PHP. On the website of the PHP Quality Assurance Team you can find a documentation of the phpt Tests syntax on the page Writing Tests, if your are interested in the details. Most extensions contain a tests/ subdirectory in the PHP source code to ship the tests together with C code of the extensions. So do ext/mysql and ext/mysqli.

They show the testing structure they used and some of the stats they found from their runs. The rest of the post is dedicated to how it was all set up:

  • implemented as phpt Tests
  • which need new settings
  • Using run-tests.php to run the tests
  • Failing tests
  • Useful run-tests.php options and features

They also briefly mention what a typical set of test results are (for the time the post was made).

0 comments voice your opinion now!
mysqlnd test tutorial php6 tree phpt mysqlnd test tutorial php6 tree phpt



Community Events





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


testing symfony2 code language developer release podcast introduction opinion threedevsandamaybe configure framework series interview unittest community install refactor list laravel

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