 | News Feed |
Sections
|
| feed this: |  |
Developer Tutorials Blog: Port Scanning and Service Status Checking in PHP
by Chris Cornutt 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.
voice your opinion now!
port scan service status check fsockopen http ftp ssh
Alex Netkachov's Blog: BAT file tips
by Chris Cornutt 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.
voice your opinion now!
bat file tip string replace split function port
Harry Roberts' Blog: Manipulating PHP arrays with SQL
by Chris Cornutt 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.
voice your opinion now!
manipulate array sql statement phpsql library port jsonsql
Ben Vinegar's Blog: ActiveSupport for PHP - Ruby style
by Chris Cornutt 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.
voice your opinion now!
activesupport ruby chaining port php5 activesupport ruby chaining port php5
ActsAsFlinn Blog: PHP and ActiveRecord
by Chris Cornutt 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).
voice your opinion now!
activerecord designpattern ruby port database activerecord designpattern ruby port database
|
Community Events
Don't see your event here? Let us know!
|