News Feed
Sections

News Archive
feed this:

Developer Tutorials Blog:
Port Scanning and Service Status Checking in PHP
June 10, 2008 @ 08:46:08

The Developer Tutorials blog has posted a new tutorial covering how to scan ports and checking a remote service's status with PHP.

Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.

They show how to check a remote instance (a socket open with a timeout) and how to run through a list of ports, looping from one to one-thousand and running an fsockopen on each. They make a sample script to show these two combined - a simple page that loops through the common protocols (HTTP, FTP, SSH, etc) and checks to see if the remote machine is running something on that port.

0 comments voice your opinion now!
port scan service status check fsockopen http ftp ssh



Alex Netkachov's Blog:
BAT file tips
June 06, 2008 @ 07:58:08

Alex Netkachov has updated a post he made a while back (in 2006 in fact) about making Windows batch files (.BAT) that would do the same thing as some of the functions in PHP. He's added two more to it today - one for string replace and another for splitting a string.

The replace is as simple three line call, much the same as PHP's and the split call, while a bit more complex, is still pretty straight forward (it just needs a few extra variables).

Other methods in the post include a "switch" method, defining a procedure and updating variable by its name.

0 comments voice your opinion now!
bat file tip string replace split function port


Harry Roberts' Blog:
Manipulating PHP arrays with SQL
May 22, 2008 @ 14:39:54

Harry Roberts has a quick post to his blog today showing a method he's come up with to handle PHP arrays from inside of SQL statements (a port of the JsonSQL library to PHP).

Trent Richardson created a very small and simple JsonSQL library for JavaScript which allows you to run an extremely limited subset of SQL against a Json array/object. I quickly ported it over to PHP 5 and it works like a charm, although the syntax for the WHERE clause isn't exactly the same but the rest ported across properly.

He's included some sample source code of it in action - selecting information out of an array of user information, once changing their order and the other grabbing a username. Complete source for the library is included too.

0 comments voice your opinion now!
manipulate array sql statement phpsql library port jsonsql


Kevin van Zonneveld's Blog:
Porting PHP to Javascript
January 08, 2008 @ 08:47:00

The Zend Developer Zone has pointed out several code snippets from Kevin van Zonneveld that are ports of some favorites from the world of PHP over to Javascript.

They're broken up into a series of posts to his blog and include:

Each post includes a description, the parameters the function takes in, return values, credits for the code and the Javascript code to make it work. For a library with the complete list of ported functions, you can download this .js file (or the compressed version).

You can check out the full list of ported functions in this category on his blog.

0 comments voice your opinion now!
port javascript function library download port javascript function library download


Sebastian Bergmann's Blog:
Hamcrest
January 01, 2008 @ 14:16:00

In a new post to his blog, Sebastian Bergmann mentions a new effort he's undertaken - the porting of the Hamcrest library of matcher objects to PHP.

I have begun to port Hamcrest, which provides a library of matcher objects (also known as constraints or predicates) allowing "match" rules to be defined declaratively, to be used in other frameworks. Typical scenarios include testing frameworks, mocking libraries and UI validation rules, to PHP.

The hamcrest-php project compliments other current hamcrest-related projects and his ultimate goal is to make it available to the PHPUnit testing community (as well as with the PHPMock effort).

0 comments voice your opinion now!
hamcrest phpunit matcher constraint object phpmock port hamcrest phpunit matcher constraint object phpmock port


Ben Vinegar's Blog:
ActiveSupport for PHP - Ruby style
August 14, 2007 @ 12:57:00

Ben Vinegar, having come from Rails to PHP was missing something - the ActiveSupport functionality Rails had natively that PHP doesn't. So, he's written up his own support for it and shares it in his latest blog post.

One of the things I miss most from Rails is ActiveSupport, the module that modifies Ruby's core classes (numbers, strings, more) with handy utility methods. They tie so well into the language, most Rails developers don't realize they aren't core methods.

He starts with a Ruby example, showing how they work to show things like camelized strings, times and evaluations. Since PHP doesn't support the same syntax, he had to work around it with some "PHP trickery" in PHP5 to handle it similarly. You can check out the results in the examples in his blog or by downloading the library and trying it out for yourself.

0 comments voice your opinion now!
activesupport ruby chaining port php5 activesupport ruby chaining port php5


ActsAsFlinn Blog:
PHP and ActiveRecord
August 09, 2007 @ 10:12:00

On the ActsAsFlinn blog, a new article's been posted talking about ActiveRecord and some of the problems with implementing it in PHP.

I'm starting a new job soon and I'll be working primarily with PHP. Since I've been a rubyist for the last 2 years I'm looking at PHP from a Rails development perspective. Before working exclusively with Ruby I hung onto to PHP (because of the project I was working on) by porting Rails bits to PHP. I eventually gave up on porting Rails to PHP after my project's funding was cut.

His experience found that there were a few things that caused the problem in the transition between Ruby and PHP like "in Ruby everything is an object" and some Reflection differences between the two languages. He has a little sample object he's created the code for, but it still doesn't work quite right.

In the end, he points out that the Row Data Gateway is a much easier method to get working in PHP (complete with sample code).

2 comments voice your opinion now!
activerecord designpattern ruby port database activerecord designpattern ruby port database


Roadsend.com:
SiteManager Library Being Ported to PHP5
July 26, 2007 @ 09:33:00

As mentioned by the International PHP Magazine site and on this Trac page for the Roadsend SiteManager software, they're working on porting it up to PHP5.

The latest available version, Roadsend PHP SiteManager 4.0.0 beta, was ported to PHP5. Database access has switched from PEAR to PDO. A script is included to help port existing projects. This version of SiteManager no longer uses PEAR DB - it uses the PDO database routines in PHP5 so there are a few changes to make. There is a script included in bin/php4tophp5.php which you can run on your current scripts to make most of the changes

Currently, you can download the latest beta from their website and check out the Trac website for the project to keep up with the latest advancements.

0 comments voice your opinion now!
roadsend sitemanager library php5 port roadsend sitemanager library php5 port


Wiadomosc.info:
phpQuery - jQuery port for PHP
June 19, 2007 @ 09:20:00

A new project has been pointed out to us today - phpQuery, a port of jQuery to PHP:

phpQuery is PHP-port of well known and great web2.0 JS library, which jQuery is. It's not something like JQPie, which is form of JS code generator and server-client layer.

They include a short example of adding content to a page (a new list element) that uses the DOM extension in PHP5 to make the action happen. You can check out the library as a part of their plainTemplate package.

0 comments voice your opinion now!
jquery port plaintemplate library package jquery port plaintemplate library package


Vinu Thomas' Blog:
PHP and Serial Ports
April 16, 2007 @ 10:18:00

In a recent post to his blog, Vinu Thomas posted about a PHP extension that allows your scripts to directly interact with the serial ports on the web server its running on.

Last month there were at least two inquiries at the Bangalore PHP UG on how to get PHP to communicate with the server's serial port. I didn't think it was possible, but here's what a quick google search turned up...

Two tools popped up on the radar - the PHP Serial Extension and the PHP Serial Class. Both have their benefits, and both can be used for the same kinds of functionality - one for the Windows side and the other for Linux-ish machines. The first seems to be a bit more flexible in its approach, though.

4 comments voice your opinion now!
serial port class extension interface windows linux serial port class extension interface windows linux



Community Events











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


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

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