Phelio Gnomi

My words from my mind

Category Archives: Web Trends

PHP Unit Testing : Installing PHPUnit in Windows 7

After playing with Ruby on Rails (RoR) for a while, I’m now back to PHP again. Since PHP is the language that I am using in my job, I have to come back anyway. I’m gonna miss RoR nevertheless. But who cares, I don’t need her right now. And she’s got a little too complicated to understand lately. Probably I will give her another chance if I got a RoR job in the future.

But one thing that RoR keep telling me (even after we broke up) is that I need to test my codes. RoR has this build in Testing module that is just awesome and beautifully made. That bring me to the needs of doing some automated testing for PHP too. So now, let’s welcome PHPUnit *crowd  applauding*.

To begin with, I will first need to install PHPUnit on my computer. Since most of the PHP people out there uses Linux, the installation tutorials are mostly in Linux. While I’m using Windows 7, I need to put some crack on googling it. And that brought me to Joshua Doodnauth’s WebLife. The post is about installing PHPUnit in wamp server. So, it’s exactly what I needed since I’m using wamp server too. However, the post is kind of outdated, so it’s only 70% accurate. But it’s still helpful because the only thing outdated is the PEAR installation part. Yes, you need to install PEAR first. So, if you having problem finding the go-pear.bat file, you should read on.

I do another round of googling, and found out that the latest WAMP server doesn’t include the go-pear.bat in the PHP bin. So, you got to get it yourself from PEAR website here. After you got the file, follow the instruction below which I got it from the Wamp Forum.

NOTE: As Samuel has pointed it out on the comment section, if you already has the php bin folder in your environment variable, you can ignore the phrase “C:\wamp\bin\php\php<your php version>\” in step number four, so it become “php go-pear.phar” (without the double quotes).

1> download latest go-pear.phar from pear.php.net
2> save that in directory” C:\wamp\bin\php\php<your php version>”
3> in run type ‘cmd’.
4> in comand prompt type: “C:\wamp\bin\php\php<your php version>\php.exe C:\wamp\bin\php\php<your php version>\go-pear.phar”
5> type in “system” in first option
6> change $prefix by pressing 1 and a file explorer will pop out. and browse to “C:\wamp\bin\php\php<your php version>” and press OK
7> now type 11 and change it to “$prefix\pear.ini”
8> now press enter and installation will begin.
9>enter Y and then press enter when it asks to alter php.ini
10> after installation run this file “C:\wamp\bin\php\php<your php version>\PEAR_ENV.reg”
11> add include_path = “.;c:\wamp\bin\php\php<your php version>\pear” to C:\wamp\bin\apache\Apache<your apache version>\bin\php.ini. Practically below the line ; Windows: “\path1;\path2”

After that, you can continue the instruction from Joshua’s blog after the part where PEAR is installed. Have fun and good luck.

iOS 5 and its Safari

I am not really a Apple Fan, but by owning an iPod Touch, I’m kind of bound to the Apple products. To avoid being dragged deeper to the hole, I try to resist myself from buying any other Apple products like iPad 2 and iMac (which I wish I did). They are simply too expensive for me.

The announcement of iOS 5 makes me excited and want to quickly install it on my iPod Touch. The previous updates are mainly for iPhone and iPad. So, I was quite disappointed. But the iOS 5 seems to have many things for iPod Touch. One of it surely is the Notification Center and it will probably makes me love my iPod Touch even more. There are over 200 new updates as you can see some of them on Apple website.

Beside using it for entertainment, I did build a web app for it. It was a mini website that is optimized for iOS. The web app is quite satisfying except some limitation that the current iOS has. If you have a small container and your content is very long, you will find difficulty in viewing it. Safari on iOS just doesn’t support scrolling very nicely. It will not show you the scroll bar and to scroll it, you will need to use two fingers.

The good news is iOS 5 come with improvement on its Safari too. Apple added more support for the current already available HTML 5 standard. So now, you can scroll the overflowed content with just one finger. That will mean a lot for my tiny web app. There are also support for various date input format that will display various kind of drop down list for date or time which you can read more about them here.

However, it’s still quite disappointing that it will not support file upload yet. Despite of the disappointment, I’m still very excited for its release around August this year.

Soon, everybody will carry a tablet

I still can remember when mobile phones or cell phones started to be so popular. Nokia, Sony Ericsson, Samsung and many others. Model after model every few weeks or months keep popping up to the market. I can’t even afford one that time, and we actually share one Nokia 3210 for the whole family. But now, every one of us has at least one.

Now, people are crazy about tablets. It was probably started by the Apple iPad and the Samsung Galaxy Tab, now everybody is making tablets. Not to speak about touch screen phones, which is quite common already and almost everybody will carry one.

So, looking back at the history, soon enough, tablets will become one of the ‘must have’ along with your touch screen phone and a notebook.

What does it have to do with web development? Good question Fendy!

It was the battle of touch screen phones (and probably still ongoing) and now the tablets. They are quite similar, but tablets are normally bigger. It made a major swift for mobile websites since the appearance of iPhone. From the so limited version of websites (before iPhone) to some optimized for touch screen websites like one that Facebook and Twitter have. But this might not have the same impact with the birth of tablets era.

First of all, they are all mobile devices. Luckily enough that the tablets has web browser that support full-featured websites (support all the features that computer can display). But there are major changes in terms of user interaction. Just like touch screen phones, tablets’ main input is the touch screen. Features like sliding and multitouch are common. While in normal computer, you don’t normally use your mouse to slide the pages, or have multiple mouse pointer that can touch multiple places at one time. Tablets don’t normally have keyboard. It uses virtual keyboard which is not always available. It will only appear when you need it. So, keyboard shortcuts might not a good idea.

Some mobile web browsers doesn’t support certain features. For example for Safari in iOs (iPhone, iPad and iPod touch), it doesn’t support Flash. So, if you wan’t your websites to be viewed nicely on iPad, you better don’t put any flash content.

More devices means more thing to test. It was already quite frustrating to make a website that can be viewed nicely in all web browsers. With the trending of tablets computing, it means many more platforms to be tested on.

Some might prefer to maintain single design but optimzed for tablets, some keep many different versions, some may not even bother. For me, I don’t care much right now.

Affiliate Marketing? What the Heck is That?

My friend, who is an Internet Marketing victim, and also an enthusiastic person, recently introduced me to this phrase called the “Affiliate Marketing”. I’ve never heard of the word “Affiliate” nor how to spell it properly. But, I am actually one of the affiliates.

Affiliate Marketing (for me) simple means putting ads from other websites like Amazon, e-Bay or Google on your website. So, when your visitors click on the ads (from your website) and they happen to buy the product you are advertising, Amazon, e-Bay or Google will pay you commission.

So, this friend of mine started a website called affiliateinternetspot.com. It’s just recently published, so there is no much thing there yet. Just be patient and there will be things that will please your heart.

There are some tips on running this marketing. These tips are not from me. I read them somewhere and somehow will apply them in the future. And I am currently not an active Affiliates.

Draw visitor first

When I started a blog 4 years a go, I only have 3 or 4 posts by that time. I don’t have much things to post, so I only updates like once in a couple of months. But, there are google ads all over the blog. And my main visitor is myself and myself only. No one else.

So, don’t put any ads before you have visitors that really likes your website. Because, they will get irritated by the ads and feel like being spammed. They will probably never show up again.

Posts often

The mostly used methods in Affiliate Marketing is probably by creating a blog. There are plenty of free blogging services out there like blogger.com and wordpress.com. It’s very easy to start a blog, but it might be hard to keep it updated. Therefore, plan ahead on what you gonna do with your blog. See if you gonna have new things to share everyday. One of the example is to post pictures. You probably take pictures everyday. So, you gonna have plenty of resources to be posted. When you updates your website often, people will more likely to comeback to check for new things they haven’t read or see. So, this will create a returning visitors that will probably subscribe to your website as well. And hope that they will visit your blog everyday.

Linking and social networking

Search engines like Google, Bing and Yahoo!, they help you find what you needed. First, they will visits websites on the web, examine them, and put them on a ranking system. When you search on something, most probably you will find what you needed on the first page of the search (which are probably 20 results or the top 20 ranking). So, the higher your website ranking, the more likely people will find your website.

One of the criteria of search engine ranking is the amount of links from other websites that link to your website. If your website is good, people will put a link on their websites that link to your website. Therefore, the more links that link to websites, the higher your ranking will be.

One of the methods to create this linking network is though social networking. You probably have hundreds of facebook friends or twitter follower. By posting about your website/blog into facebook or twitter, you register a link on them as well. Your friends and follower might like your posts, and repost or retweet them, and therefore creating more links. In the other hands, you are also promoting your websites.

For more information, read more about SEO (Search Engine Optimization) and its various methods

Quality posts

A little market research might be required for this. Think about what are people looking for, what are their needs, and what are you capable of. Websites about “how to” are probably the most wanted one. People are looking for how to do this, and how to get rid of that. So, what is your field of expertise? apply them and see if you can share them with the world.

Don’t flood your websites with ads

You know that ads are annoying. I can’t stand of them. So, when I’m in a site, full of annoying and irritating ads, I will leave the site. So, even after you have a solid visitors group that visits your site everyday, they might just say good bye to you.

Be creative in putting the ads, keep the visitors as the priority, not the ads. There are many kinds of ads format you can choose from. There are vertical banner, horizontal, links only or flash ads etc. The most importantly, see how the ads fits on your site layout. Be careful not to irritate the visitors.

Angry Bird Chrome? or Just Web Angry Bird?

AngrybirdsAngry Birds’ developer Rovio is really angry right because they just released its “Google Chrome” version few days ago. And it’s also Free. This news had made headlines in several places including Twiter and Yahoo.

The whole world is angry about it because they got to play it on a bigger screen (probably 21″ or bigger) and on their favourite web browser “Google Chrome”.

Well, I was one of the angry one that installed the app the moment I read about it. Amazing, I didn’t got the chance to play it. Wait a moment, I probably can load it on my iPod Touch. Why not? and that’s what I’m angry about right now.

First of all, I want to object that this currently angry-ing Angry Birds Chrome is not a Chrome App. It’s just a web application that is being marketed on Chrome Web Store.

Secondly, you can launch this Angry Birds in any web browser. Yes, I’m saying about Firefox, Internet Explorer and so on. And probably on iOS safari.

Apparently, there are two types of Chrome Applications. Hosted App and Packaged App. Angry Bird Chrome is a Hosted App. It means,

a regular web app, plus some meta data

while Packaged App is something you really need to download and install it on your chrome browser. One of the great example of Packaged App and my favourite Chrome App so far is The Fancy Pants Adventure.

edit iOS Safari can’t run this game because it’s a flash based. So sad..