PHP.js – A cool project recreating PHP function is Javascript

While checking out the new release of the PHP extension for Aptana I came across this cool project –

PHP.js

which is looking to recreate PHP functions in Javascript. Now while it’s better to just handle these
things with proper JS, it is nice to use when you already know the php syntax for a function. What I really want out of this is the print_r function because I’m always running into issues with trying to figure out an object in JS and there aren’t any ways I have found that are as nice as the print_r in PHP. I only use that in debugging and development and will be a great thing to have around for that.

So overall an interesting project to watch.

A great example of opensource at work

Just saw this interesting article on what Facebook was doing to help increase the performance of their memcache servers. Because of the outstanding talk I saw from Brian Shire of Facebook back at PHP|Tek 2007 I at least understood what was being discussed here. Though understanding the idea and being able to “actually” do anything about it are to completely different things. But because of the great concept that is called open source that doesn’t matter.

First, if it wasn’t for the open source development that is going on, Facebook would not be able to have this great app to start with. They would either have to write their own or purchase a solution, which from others similar ones I’ve seen advertised, never seemed cheap. Extra costs like those can easily turn an extremely profitable company into one that is barely scraping by. That doesn’t even include all the other issues of relying on closed 3rd party apps, but I’ll save that rant for another day.

Second, Facebook is willing to share the wealth and have released their source modifications for the rest of the world to have (from the talk I knew they were directly contributing back to the project but I think this is more for the real power hungry people out there.) Now while I’ll never be lucky enough to have a project that would need this kind of power, it’s nice to know that if I did run into this issue I don’t have to reinvent the wheel or pony up a ton of cash.

This is just another great example of how open source can really help the greater good. Now, if only everyone would jump on this concept.

What’s been keeping me away

Well realized I hadn’t posted anything lately so I figured I should do an update.

Been playing a lot with Flex and can’t wait to get some real work done with it. Played around and got it talking to a Database through PHP and that was cool. Been looking at how to skin the apps so we can make some nice looking ones.

Started writing a Groupwise Flex Chat client and hit a pretty big road block. The issue is when making the login request to the server they want you to identify the local port you assigned to talk to it (which is stupid since the server already knows this information because I’m talking to it from that port) which unfortunately it seems I can’t get that information from the socket. Still poking around trying to find somewhere to get it but no luck so far. This doesn’t stop the project but changes how it would work. Now it would have to talk to a middle man that handles all this stuff which makes it not as “flex”able as I had intended because I was wanting to convert it to an AIR app that people could use from their desktop to connect. Now we could open up the middleman to the outside world to handle this but I really wished for a way around it.

Lately a big thing that’s been taking up a bunch of my time is that we are moving our CMS from Solaris to Linux. This is a big annoyance because the software provider says they support Solaris but it’s pretty obvious they don’t after having them attempt to troubleshot our “Going Live” issue. They said they couldn’t duplicate the issue on an OSX machine????????? We are now looking to move to a Suse machine and the test server I setup on a past dump of the database (running on the same MySQL server on the same Solaris box) and have had no issues. Should be a simple move once we have our live server up and going and the longest part will be waiting on the dns change for the name.

Still trying to figure out what I want to give presentations on next semester. Probably talk about RIA’s and hopefully I hear something that others might want to hear about so we can have talks on it.

Other then that hopefully I’ll catch some tutorials that really peak my interest and I’ll share but been kind of stale lately out there with things.

Have a good holidays if I don’t post before then.

One Small Step for man

On giant leap for integrating with the worst documented POS messaging service ever, Groupwise Messenger.

After much research and finally just breaking down and fumbling through the Kopete Source (which was 100 times easier to read then the GAIM source) I finally figured out that all they were doing was using HTTP to send things. Not very complex at all but really a waste.

So I now have officially logged in through PHP (which I could tell cause it logged me off GAIM) which made me very happy. After doing that I tested if it was using TLS or not which it isn’t which gives me a reasonable shot at actually integrating it straight with Flex instead of needing PHP as a middleman. Not saying there couldn’t be some cool uses for bot and running fake users through PHP, or even just using that for a simple AJAX chat script. Next is the step of actually creating functions out of what I did to make it a lot simpler to create.

But seeing it work makes me a VERY happy person. If anyone has a want to play with a GW Messenger client let me know and I’ll share with you what I have. And once I have it actually all nice and functionalized I’ll let it out there for others to play with.

PDT Webinar / Tools for the future

We are going to be pushing PDT as the php ide to use when working for us. Mainly because it’s free and because it’s a plugin to eclipse it will also act as the base for adding in Subclipse for subversion access and flex builder for doing flex apps.

There is a webinar about pdt from Zend which you can watch and get an overview of the system.

I currently have this setup on my Ubuntu install on my laptop and it works great. I need to play with the subversion side to see how that works but the PHP and Flex parts work great. We will get more into this later but this is a good preview of a great tool you can use for development.

Mix this with XAMPP and you can turn your local machine into a great development environment.

Also once I work more with Flex we will also look at adding Adobe Air to the mix for application development.

PHP Seminar Slides

Well since I have time before the presentation starts I figured I could throw the slides up now and not have to worry about it later.

Slides

Example (functional)

Example (code)

Since the PHP is processed so you can’t see the code behind it I have made a zip of the entire project and that is available in the last link.

Hope this helps some of you out.

Rounded corners and drop shadows not in CSS

Here is an interesting idea for making the images you have people upload look better without having to do all this in CSS.

There are pluses and minuses to both ways.

It takes more server load to do it the first way and should likely not be used verbatim from the example but should be used to create the image and saved for later use. This could even be run when the image is uploaded and stored this way. This saves the extra CSS we would use for creating the effect and running the risk that it doesn’t work correctly on all browsers.

The CSS way is nice though in that it takes no extra code and later if we want to change our look to no longer include the shadow it’s as simple as removing the CSS. Though if we keep the original OR a thumbnail for that purpose it’s not as much of a risk.

In a high use situation, you would have a separate server delivering this content. This server would not have it’s CPU being taxed so there would not be a significant issue letting that server handle the conversion.

Enforcing our Coding Standards

Pretty soon we will have our coding standards set in place and released for all the students to see.

To actively enforce that procedures are being followed I’ve found this nice PEAR package – PHP_CodeSniffer

This will be something we can actively use to go through the code submitted by ourselves and students to make sure everything follows proper standards and makes it so it’s easy for all to read.