News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

AskAboutPHP.com:
Codeigniter Helpers, Plugins and Libraries
December 03, 2008 @ 07:57:15

On the AskAboutPHP.com blog eldee takes a look at helpers, plugins and libraries in the CodeIgniter PHP framework including some examples.

With so many published PHP classes and functions, it would be a shame if we couldn't use them in CI. Fortunately CI (like all good frameworks) provides not one but three ways to integrate 3rd code, by using Helpers, Plugins and Libraries. [...] As I found out during the course of my CI project, Helpers, Plugins and Libraries are nothing more than glorified includes. I can pretty much take any 3rd party code and integrate into my application using any of the 3 methods.

His example uses the Google Graph class as each type (helper, library and plugin) with some example code.

0 comments voice your opinion now!
codeigniter library plugin helper include google graph



AskAboutPHP.com:
CodeIgniter Extending the native 'Model' and make it your own.
November 12, 2008 @ 09:31:24

The AskAboutPHP.com blog has posted a helpful new tutorial for those using CodeIgniter out there - how to extend the native Model class to bend it to your will.

I'm in the process of creating models for my CI project, and realized that certain functions within the models were getting repetitive. Using CI's ability to create my own custom libraries, I was able to create my own custom 'Model' which extends from the core 'Model' object. How this simple architecture has cleaned up my code is simply remarkable.

Rather than overwriting the main Model.php file with some of your own changes, he suggests creating a new library, a "parent model" that can be extended instead to provide some common functions that all of your application's models might need. For something a bit more complex, he also points to this library that extends the models to give it CakePHP-like functionality.

0 comments voice your opinion now!
codeigniter framework model extend custom parent library


NETTUTS.com:
Twitter Emulation Using MooTools 1.2 and PHP
November 11, 2008 @ 14:18:35

NETTUTS.com has a new tutorial posted today showing how to combine some simple PHP scripts with the MooTools Javascript library to emulate the popular social site Twitter.

People all over the world love Twitter because of how easy it is to use. All you need to do is type in your current status, click "Update", and you're done. What most people probably don't know is how simple it is to emulate Twitter's functionality. Using PHP, MySQL, and MooTools javascript, you can implement a Twitter-like status system in no time.

Their mini-application (download the source here) creates a basic input box and a list of messages below. The MooTools library is used to send the message back to the PHP script and update the messages list with the latest from the current user. Complete code and screenshots of examples are included.

0 comments voice your opinion now!
mootools tutorial twitter emulate source javascript library


Stubbles Blog:
State of annotations in the PHP world
November 10, 2008 @ 13:32:59

In this new post to the Stubbles blog Frank Kleine looks at the current state of annotations in the PHP language and applications.

Annotations are a really helpful feature in present-day development. An annotation is a special form of syntactic metadata that can be added to source code elements such as classes, methods, properties and parameters. They do not affect the program semantic directly, but can be used by tools and libraries to handle such annotated code in a certain way.

He notes that, as of right now, PHP doesn't naively support anything like this but that there are additional libraries that can be used to augment the standard PHP performance and use them (like a feature in PHPUnit with @assert and @test). He also go through several of the other libraries that make it possible including Addendum, FLOW3 and the XP-Framework.

0 comments voice your opinion now!
state annotation language library external compare


Rudi's Blog:
Get torrent data with PHP
November 06, 2008 @ 13:50:39

This new post to Rudi's blog shows how, with the help of an external class you can use PHP to grab information from a torrent file.

To use this code you first need to include a file with the benc, bdec and hex2bin functions. To get the torrent data (like the announce url, the files etc) it is enough if we decode the content of the torrent. On the other hand, if we want to read the number of seeds, leechs and downloads, we must encode the info part of the torrent, encrypt it with the sha1 function and convert the result to lowercase.

He includes the code to make the decoding/encryption of the results a copy and paste away (once you have these functions to work from). He's even provided an example using the code that gets the information from a torrent on the Pirate Bay website.

1 comment voice your opinion now!
torrent data library class tutorial bdec hex2bin


PHPro.org:
Introduction to Standard PHP Library (SPL)
November 03, 2008 @ 11:19:58

Kevin Waterson has posted a new tutorial to the PHPro.org website today - a pretty comprehensive look at the DirectoryIterator in the Standard PHP Library (SPL).

SPL provides a standard set of interfaces for PHP5. The aim of SPL is to implement some efficient data access interfaces and classes for PHP. Functionally it is designed to traverse aggregate structures (anything you want to loop over). These may include arrays, database result sets, xml trees, directory listings or any list at all. Currently SPL deals with Iterators.

He looks at functionality like the Directory Iterator, getting the file owner, checking to see if a file is valid and how to rewind an iterator.

0 comments voice your opinion now!
spl standard library tutorial introduction directoryiterator


PHPBuilder.com:
Using the ADOdb library with Oracle and PHP
October 24, 2008 @ 09:35:14

On the PHPBuilder.com site today there's a new tutorial continuing in their Oracle theme about using the ADOdb libraries to access the database from your application.

Last week we discussed the use of the OCI8 extension and connection methods for using ADOdb to connect to an Oracle database. This week we'll delve further into the ADOdb library and will disect some example code to get you up to speed!

He gives an overview of some of the functions needed to make the connection and fetch results from a simple query. Some sample code and explanation is also included.

0 comments voice your opinion now!
adodb library database oracle tutorial example code


Christoph Dorn's Blog:
FirePHP 0.2 Released
October 23, 2008 @ 11:11:08

Christoph Dorn has posted about the latest release of a very handy PHP/Mozilla extension - FirePHP 0.2.

The release includes 27 bug fixes and feature enhancements. The scope of this release was primarily focused on improving the current feature set in terms of usability, reliability and support for logging complex objects. You can find the changelog here.

After installing the FirePHP 0.2 extension you will be directed to the Install page after your next Firefox restart. On this page you need to download the updated FirePHPCore library. Next you can visit the Learn page for information on how to get started with FirePHP. Finally refer to the Usage page as a reference for all supported features.

Some of the updates included in the release are for enhanced object logging, the addition of file and line information, full UTF-8 and Latin-1 support and an enhanced variable display in the console. Head over to the FirePHP.org website to get the latest version.

0 comments voice your opinion now!
firephp mozilla extension library download release version bugfix feature


Daniel Cousineau's Blog:
Serialize Python Variables To PHP
October 22, 2008 @ 08:47:39

As a part of a current project Daniel Cousineau came across the need to bridge two languages - PHP and Python - via some serialized variables. This new post on his blog shows how he did it.

So I'm in the planning stages of a project where I'll probably be doing some heavy lifting in Python and serving up the output through PHP. Obviously this will entail transmitting data between Python and PHP and while I haven't had a chance to do performance testing to see if it's worth it to save to a database, the only other option was to serialize the data to a file that PHP could parse quickly. Obviously, the output from serialize() is going to be the fastest way to recieved the data.

As he was working on his own implementation, he came across a currently existing Python library (that adds the serialize support) and but found it lacking for what he needed. He continued on, working up his own customized implementation with all the features he needed. He includes both the Python and PHP code (cut and paste ready) as well as the results from the serialization of different data types.

0 comments voice your opinion now!
serialize python variable library example code


Vinu Thomas' Blog:
pChart - PHP charting library
October 22, 2008 @ 07:53:00

Vinu Thomas points out a nice looking PHP charting library on his blog today - pChart.

Looking for some good looking graphs without having to pay for a library or resort to Flash graphs? Try creating your own using pChart. pChart is a PHP class oriented framework designed to create aliased charts. This project focuses on allowing developers to generate great looking graphs by increasing rendering quality introducing an aliasing algorithm.

It uses GD to create the graphs, so just about any PHP distribution out there will support it (if you're not sure, make a phpinfo() page to check out your setup). There's even some example graphs so you can get an idea of what some of the end results could be.

0 comments voice your opinion now!
pchart chart library gd graphics image render



Community Events







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


zendframework application mysql release releases code framework book PEAR developer job security example package PHP5 zend database conference ajax cakephp

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