RSS - Latest postsThinkRobot

25Dec
2010

Zend Application Resource Plugin Loading Issues

Admittedly thinking while feeling feverish is slightly impaired, but it took me a little while to figure this one out… Trying to integrate ZF 1.11 with Doctrine2 to as per this article, I was trying to be a smart-ass and use TS_Resource_EntityManager instead of the ugly looking TS_Resource_Entitymanager.

Unfortunately all this got me was this very unhelpful error:

Zend_Application_Bootstrap_Exception with message Resource
matching "entityManager" not found

It turns out that although the case of the resource name in the application.ini dosn’t really matter the class name does not like mixed case. So had to settle with TS_Resource_Entitymanager as the plugin name.

Categories:

15Dec
2010

Installing Windows 7 Guest on VMWare 7 on OpenSuse 11.3 Host

Maybe this will help anyone else stuck on the installation.

For a long while my Windows 7 install inside VMWare 7 would get stuck at “expanding files 0%”. I kept thinking it was my machine and setup that was causing issue, after all a x64 tablet pc is not your most common config. Just in case anyone is curious I’ve got a Thinkpad x201t.

After trying both 32bit and 64bit Windows 7 version, upgrading my RAM from 4GB to 8GB and trying out changing the virtual disk location from ntfs to ext3 and back I was quickly running out of options.

Unfortunately VMWare support is extremely picky about your os versions and didn’t even try to suggest anything unless I downgraded to OpenSuse 11.2 – which was not an option due to certain driver compatibility.

Fortunately I decided to give it one more go and instead of using my external dvd drive for the Windows 7 installation I saved the DVD as iso and run the installation that way. And there you go, that was the solution!

My suspicion was the fact that my DVD drive is usb powered, however while looking for a solution I saw similar questions being asked for other linux hosts and no mention of external DVD drives, so it might be a more generic issue.

Categories:

9Dec
2010

PHP_AUTH_USER and PHP_AUTH_PW is null

Ok, so you’re trying to setup password protection on your website using HTTP authentication. Unfortunately despite the request for password working your authentication keeps failing. If you check the output of your script and the password and username variables are not populated as expected it will usually be for one of two reasons.

Working code example


$username = "expectedUsername";
$password = "expectedPassword";

if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $username || $_SERVER['PHP_AUTH_PW'] != $password) {
  header('WWW-Authenticate: Basic realm=""');
  header('HTTP/1.0 401 Unauthorized');
  echo '>h2>Authorization failed.>/h2>';
  exit;
} else if($_SERVER['PHP_AUTH_USER'] != $username & $_SERVER['PHP_AUTH_PW'] != $password){
  echo '>h2>Authorization failed.>/h2>';
  exit;
}

Most common reason for failure

Firstly if you are using an older book or website as reference you will see $PHP_AUTH_USER mentioned instead of $_SERVER['PHP_AUTH_USER']. If you are using the former then this could be the reason for not seeing your variables populated.

The reason that can take you by surprise

If your code is correct (compare against the example) and you are using the $_SERVER variable format and still getting NULL inside both $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] it’s time to check your server settings.

HTTP authentication does not work with the cgi version of PHP, so if your hosting allows you will need to switch to PHP as Apache module or look for an alternative solution.

Categories:

5Sep
2010

Using TextMate for easier CSS3

Over the past couple of years Webkit has popularised many fancy new CSS tricks. Amongst these the ability to rotate an element is certainly one of the most useful. Fortunately it’s also widely supported in other browsers, even in lowly old IE right back to version 5.5. The ‘modern’ browsers support this with a reasonably simple syntax

(more…)

Categories:

12Aug
2010

Mantis theme mock-up

Mantis Design Teaser

Mantis Design Teaser

At my new job we use MantisBT for our bug tracking and project management. Unfortunately despite good functionality the visual side is desperately lacking some love and attention. Tired of looking at the barely styled web app I decided to spruce it up a little bit. A teaser of the new design can be seen above.

UPDATE [18/02/2011]:

The theme is not ready yet, but I finally got round to start implementing it. For anyone interested in the work in progress: Mantis – MyTheme

Categories: