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

Thomas Weinert:
FluentDOM 5 + XML Namespaces
August 07, 2014 @ 10:50:22

In this new post to his site Thomas Weinert shows how to use the FluentDOM library (a PHP implementation of a Javascript library by the same name) when XML namespaces are involved.

FluentDOM 5 allows to register namespaces on the DOM document class. These are not the namespaces of a loaded document, but a definition of namespaces for your programming logic.

He compares it to both a PHP example, using the DOMXpath handling and a Javascript sample using its own xmlDocument functionality. Finally he compares these examples to the few lines of FluentDOM code to handle the same kind of evaluation. He wraps up the post with a brief mention of the "appendElement" function that wraps serveral operations in one for easy element additions.

0 comments voice your opinion now!
fluentdom xml namespace tutorial javascript domxpath element

Link: http://www.a-basketful-of-papayas.net/2014/08/fluentdom-5-xml-namespaces.html

PHPBuilder.com:
Using PHP Configuration Patterns Properly
April 16, 2014 @ 11:52:11

On PHPBuilder.com today they have a new post showing different configuration patterns for getting localized settings into your applications. They show the use of INI files, PHP scripts, text files, XML data and a database call.

PHP is a cross platform language. It is a server based application so we must think about the configuration settings of the PHP software. There are various ways of creating configurable PHP applications. The configuration flexibility comes as a built in feature in PHP. But we must understand the requirement clearly before making an application configurable. This article explores different PHP configuration patterns and their implementation.

For each of the options mentioned, there's a brief description of what the method is, some of the common uses and a code example showing a basic implementation. The database pattern is the only one without a code example as the database interface varies widely from application to application.

0 comments voice your opinion now!
configuration pattern ini script text xml database

Link: http://www.phpbuilder.com/articles/application-architecture/using-php-configuration-patterns-properly.html

Tech.pro:
How to Create an RSS Feed Using PHP and PDO
December 04, 2013 @ 11:52:53

On the tech.pro site there's a recent tutorial posted showing you a basic way to create an RSS feed using data coming from a database accessed via PDO.

Using an RSS feed on your website is a great way of letting your visitors, search engines or directories get a hand on your content. RSS feeds are common practice on most blog and CMS platforms including Wordpress, Joomla and evenly the newly released Ghost. If you're using a CMS or similar platform, the likelihood is that you don't need to implement an RSS feed yourself. [...] Below you've got the step-by-step process to create anything from the simple, standard-compliant RSS feed - up to the more advanced.

The tutorial shows you how to pull the data from a simple database table (SQL not provided, but pretty easy to figure out(, including example PDO connections for several database types. This data is then manually appended into an XML string to build out the RSS feed correctly. They also talk about implementing the Dublin Core metadata as a way for providing more information about the feed and its contents (including an image and category details).

0 comments voice your opinion now!
rss feed introduction tutorial pdo xml dublincore

Link: http://tech.pro/tutorial/1722/how-to-create-an-rss-feed-using-php-and-pdo

Adam Culp:
Zend Framework 2 XML Sitemap
September 09, 2013 @ 11:15:09

In a new post to his site Adam Culp shares how he created an XML sitemap for his Zend Framework 2-based application as he made it (the SunshinePHP site) more SEO friendly.

I was pleasantly surprised to see the Navigation component of Zend Framework 2 includes a bunch of view helpers, including a Sitemap helper. So now I have an xml sitemap created by Zend Framework 2 that works hand in hand with the site navigation. However, the documentation was not complete as of this writing and caused me to do a bit of trial and error debugging to get it working. Below I will post how I got it working, in hopes it will help others.

The code to get it working is relatively simple - set it up in the module configuration, specify the navigation structure and add a route for the sitemap output. The view then accesses the navigation handling and calls a "sitemap" method to push the XML result out to the user.

0 comments voice your opinion now!
xml sitemap sunshinephp zendframework2 navigation helper

Link: http://www.geekyboy.com/archives/770

Lorna Mitchell:
First Phing Plugin
March 25, 2013 @ 10:49:23

In the latest post to her site, Lorna Mitchell walks you through the creation of a first Phing plugin, an extension to the popular PHP-based build tool.

I'm a huge fan of Phing and use it regularly for build and deployment tasks. Often, I'll ask about a plugin that I wish existed, and get a very courteous "patches welcome" from the nice people in the #phing channel on freenode. This has happened a few times, so I thought I should probably look at how to make a new phing plugin, this article shows you how to make the simplest thing I could think of: a simple "hello world" plugin.

She points you to the location to grab the latest version of the tool (the github repository) and how to define a configuration file for your test runs. Then she includes the sample code showing how to create the "HelloTask" plugin. It takes an input value of "name" and displays a greeting when executed. She shows the syntax for defining this in the XML build file and the sample result when executed.

0 comments voice your opinion now!
phing plugin install build configuration xml helloworld task


PHPMaster.com:
Parsing XML With SimpleXML
February 12, 2013 @ 12:48:34

On PHPMaster.com today there's a new tutorial introducing you to SimpleXML, a handy bit of functionality included with the base PHP install to make working with XML (well, reading it) much simpler.

Parsing XML essentially means navigating through an XML document and returning the relevant data. An increasing number of web services return data in JSON format, but a large number still return XML, so you need to master parsing XML if you really want to consume the full breadth of APIs available. Using PHP's SimpleXML extension that was introduced back in PHP 5.0, working with XML is very easy to do. In this article I'll show you how.

He starts with some basic usage of the SimpleXML parsing, giving an example XML to parse, the resulting object and how to access the data inside it. There's also a bit about dealing with namespaces in the XML you're parsing and a more practical example - parsing the output of a YouTube feed to get links to various videos.

0 comments voice your opinion now!
parse xml simplexml introduction tutorial


Andrew Podner:
Managing PHP Application Builds with Phing
February 04, 2013 @ 09:08:16

Andrew Podner has a new post to his site today introducing you to Phing, a PHP-based build tool (designed after on Apache Ant) that makes automating builds of your applications easy.

One of the things I have been focusing on lately is trying to to a better job of mechanizing and automating the process of building and deploying an application. The reason for this is pretty simple: applications just seem to keep getting more and more complicated and intricate as time goes on. [...] Phing is a "project build system" that helps developers manage repetitive tasks associated with preparation and deployment of applications. Phing uses XML based files to allow you the ability to customize the build process to the individual application.

He walks you through the Phing installation (from PEAR, note that you can install it via Composer now too) and how to set up your first project XML definition. He shows you how to add a "target" or step to the build with the basic example of running your app's PHPUnit tests. He also includes a list of other things Phing can do and work with including CodeSniffer checks, FTP handling, version control interfaces and automated documentation.

0 comments voice your opinion now!
application build phing tool introduction phpunit targer xml


Sherif Ramadan:
How to Write an Operator Precedence Parser in PHP
January 21, 2013 @ 11:21:22

Sherif Ramadan has a post looking at creating a better operator precedence parser in PHP. His example is a fully PHP implementation that takes equation strings and evaluates them to create the result.

Operator precedence parsers are very simple on the surface. So don't feel in the least bit intimidated, because by the time you've read through this I hope to have you walk away with a solid foundation on how to write your very own operator precedence parser. The goal is to understand how to solve the problem of operator precedence parsing, and not necessarily to write your own parser. Learning how the problem can be solved is the most important thing to take away from this article.

He starts with an introduction to the concepts behind "operator precedence" including processing order and grouping. He also mentions infix and postfix (RPN) notations for handling different formats of equations. He used the "Shunting-yard Algorithm" and how it relates to handling the different parts of the equation, one at a time, in the correct order. He rest of the post is dedicated to the details of the execution in the tool, including code examples and the tokenization of the strings passed into it.

0 comments voice your opinion now!
operator precedence parser string token shuntingyard algorithm


Ibuildings Blog:
DPCRadio Let's Build a Parser
October 24, 2012 @ 10:19:18

On the Ibuildings blog today they've released the latest episode of their DPC Radio podcast series as recorded at this year's Dutch PHP Conference (2012). In this new episode, they share Boy Baukema's session "Let's Build a Parser".

During this talk an introduction will be given to parsing. Terms like 'formal grammar', 'lexing / scanning', 'LL / LALR / PEG' will be explained and put into context. We will look at a recursive descent parsing as a practical way to parse languages. Finally the audience will be left with ways to get started with parsing structured text into memory.

You can listen to this latest episode either through the in-page player or by downloading the mp3. You can also see the slides from the presentation on Slideshare.

0 comments voice your opinion now!
dpcradio podcast dpc12 parser boybaukema tutorial


PHPMaster.com:
Explore Aspect Oriented Programming with CodeIgniter, Part 3
August 24, 2012 @ 11:56:29

PHPMaster.com is back with the third part of their series looking at Aspect Oriented Programming with the CodeIgniter framework. (Part 1, Part 2)

In the previous parts of the series we learned about AOP concepts and the need for using AOP in large scale projects and I introduced CodeIgniter's hooks as a convenient mechanism for creating AOP functionality from scratch. In this part I'll show you how to use both XML and comment-based techniques to create custom AOP functionality when a dedicated AOP framework is not available.

They start with the XML configuration that defines a few aspects and pointcuts for the application. This is then read in via the "applyBeforeAspects" and the aspects that should be executed first are extracted, loaded and run. Following this, they take the other approach - based on docblock comments - and pull in the comments (the @before and @after tags) and load/execute the aspects that way instead.

0 comments voice your opinion now!
aop aspectoriented programming tutorial xml docblock configuration



Community Events





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


language laravel package podcast library community symfony opinion introduction deployment series update release api tips install interview list zendserver framework

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