- I've never walked a dog which can't make it up a small hill without collapsing in a panting heap. #
- The neighbours are walking a young cat on a lead. Guess they're trying to keep up with the girl who walks a ferrett in town #bromsgrove #
- RT @GeneHunt A prisoner escaped last night, she's a clairvoyant midget. We're warning the public that there's a small medium at large. #
- RT @GeneHunt You know what it means when you come home to a little affection, tenderness and sympathy? It means you're in the wrong house. #
- RT @grifferz Believe me, it's possible. http://www.lamebook.com/wp-content/uploads/2010/05/PhoDohs1.jpg nice spelling. #
- RT @PalePurpleLtd Looking for professional php dev. Contract or full time. See http://bit.ly/cbk1H1 #
- I wonder how often someone types in a bit.ly URL incorrectly and gets/leaves a rude surprise. #
- I signed the petition to repeal the Digital Economy Act http://bit.ly/deapetition #DEBill #DEAct #GE2010 #
- Right, time to run off this stupid sore throat and looming crapiness. #
- I'm mentally washed out now. Time to degenerate down to a 2 year old's level soon. #
- Strange sales pitch about sales training with someone from Sandler Training (anyone come across them? http://uk.sandler.com/) #
- Everyone will suffer now; everyone will suffer now. You can't help yourself. #
- Run away (for 40 minutes) #
- Dear Twitterverse: Is Nightmare on Elm Street any good / worth watching?
http://bit.ly/9PrXdg # - Don't use phpunit from Debian Lenny (v3.3.16) – full of fail; Install via pear. My tests now pass; I now get code-coverage reports. Win. #
- Toddler clearly deciding that he should have a lie in. In the interests of Good parenting I can't get up till he does … 😉 #
- Today's discovery – orange marmalade with ginger. nom nom. #
- 35 weeks http://twitpic.com/1mn5vm #
Twitter Weekly Updates for 2010-05-09
- Just found Prey – remote tracking of laptop etc incase of theft … http://preyproject.com/ #osx #linux #windows #
- Stripping done, holes filled; now to get the gun out and do some kinky latex^h^h silicone sealant stuff … Then lawn mowing. #
- Roast lamb after 17 mile run seems good. (2.5 hours; worship me) #
- 10k isn't far enough – let's do http://gb.mapometer.com/en/running/route_578234.html instead. #
- RT @UKLabourParty We need 100,000 people to retweet if you want Proportional Representation #
- Suggestions on how to stop a dog chewing stuff when he's left alone welcome. (attention seeking?) has bone etc to chew …. #
- Think I'll wait for an android like ipad or spend the money on an iPhone v4. #
- My tummy and bed are now a drum with toddler hand sized drumsticks beating away. #
- Ah that's better. Second waking at 9am. This is more civilised. #
- Waking at 550 on a saturday is not ideal. #
- Right. Time to cudde up to the boss and fall asleep. #
- RT @GeneHunt Why is it that one careless match can start a forest fire, but it takes a whole box to start a barbeque? #
- Is rowan trying to give me a hint by the way he's washing the bath (as opposed to washing himself in the bath) #
- Emergency chocolate fix applied. Recovery underway. Now I want more …. #
- Sweet. I definitely don't need a tv license – http://bit.ly/3s3jM9 & still use iplayer #
- RT @alexmace This is exactly why I voted Lib Dem: http://bit.ly/bhfwgw RT if you did too. #votelibdem #
- #ukvote B61 #
- Git is too quick. I have difficulty accepting it's done anything – perhaps it should sleep(1) to give me confidence it's done something. #
- I've just registered my opinion for my constituency for #ge2010 at http://www.twitVoteUK.org.uk, why don't you? #twitVoteUK #
- Fixing your router's WIFI since 1903 #
- TV harms children / toddlers / babies – http://news.bbc.co.uk/1/hi/health/8654963.stm – no news (haha) there then (or surprise) #
- Haha. I've had the window open and blinds drawn in the office for at least an hour and the minions haven't noticed / burnt from sunlight. #
- Damn you ubuntu – updates to an existing release shouldn't break everything. Grr. #
- There's a horrible smell of burning plastic/dead computer in the office and my desktop is unwell. Are the two linked? Fuckitallnotagoodday #
- Guess I should run. 10k race this Sunday. Still doing 6 miles this morning isn't much shorter. #lazyweekend #
- RT @GeneHunt I'm proud of my Grandfather. He shot down two German planes. Admittedly that was in 1972 but you can't be too careful. #
- Iron man 2 perhaps. #
- Stupid hail. It's summer. Get lost. Come back in November. #
Twitter Weekly Updates for 2010-05-02
- Good luck with the #dyfienduro mtb'ers. #enduro #mountainbiking #Machynlleth #
- Time to say goodbye to "cd /pub; more beer" (t-shirt). You've lasted at least 10 years but now look a bit too old. #
- I tried to get some non-dull coloured clothes. http://twitpic.com/1k046l #
- Chewing my £15 (new) running hat is not smart or clever dog. http://twitpic.com/1k038b Maybe I'll forget to take you to the farm tomorrow? #
- Best add Predators To my list of films to watch. #
- RT @GeneHunt What's long, hard, easy to erect and makes women groan?…… An Ironing Board. #
- http://www.whatthefuckshouldimakefordinner.com/ – my biggest problem of the day is now solved!! 🙂 #
- The dog has a hard life. Eating a donut. http://twitpic.com/1jloat #
- Cameron was smarmy and didn't answer questions; Brown tired and boring. Clegg genuine but niave? Seeing DC may have put me off voting Tory. #
- Ought to find a running club/group in Bromsgrove…. and/or Squash. #
- welcome #ubuntu lucid …. time to upgrade desktop soon then. #
- This is how you to scream (while chasing a dog) – toddler style…. http://www.youtube.com/watch?v=9vDXZjnknoI #
- RT @GeneHunt 'Ultra-sensitive condoms?!' What do they do? Keep her talking after you've gone to sleep & ask how she's feeling? #
- RT @schmooster #bigotgate For the sake of balance, here's Cameron with the public. http://short.to/26n59 <- nice 'documentary' #
- wondering if I'm somehow damaged a nerve along the top of my foot; weird sensation occasionally…. still at least it's not my hand. #
- Anyway. Time to go running. 7 miles perhaps. Rests are for girls and babys. Sort of. #
- This is not orange (or any fruit) juice on my arm….. "bloody dog" http://twitpic.com/1iw4od #
- Avatar is only £8 on DVD on release. So it really was over hyped and not that good then? (3d ++; story —-) #
- I'm sheltering in the blind (warm) spot of an overactive aircon unit waiting for gparted to do succeed. Not quite
my idea of fun. # - Stupid Compaq server vs gparted. Gparted seems to be winning. Phew. #
- I wish I'd remember to upgrade $server before feeling tired at mid-night. #
- Woo… 148 out of 844 marathon wise (http://jand.co.uk/Results2010/ShakespeareFull.pdf); now my head has expanded. #stratford #marathon #
- Won't be voting for them…. http://twitpic.com/1iotli #bnp #
phing / unit tests and global variables
Yesterday I thought I’d move one project over to using phing (with the end goal of hopefully getting some sort of Continuous Integration setup in place, with graphs and stuff to show the customer).
All went reasonably well – svn update, php documentation generation, php code sniffer tasks etc were all in place. Unfortunately when I got to do the unit tests (simpletest) things failed, and it seemed to be the case that no global variables in use within the code base were available. As my brain finally realised why this is the case this morning, I thought I’d better write a blog post in the hope it may help someone else in the future.
The code base itself is ‘legacy’ – in that it’s been pulled in different directions over the years before we got our hands on it. There’s bits of procedural code (e.g. query(..) which seems to just be the same as calling mysql_query(..)) and object oriented ($db->query(..)). Mixed in with this is a liberal use of global variables (e.g. $db, $database_name, $software_root and so on).
My unit tests, when run via a script on the command line look like :
<?php require_once('common.php'); require_once('simpletest/reporter.php'); require_once('simpletest/unit_tester.php'); $test = new GroupTest('my tests'); $test->addTestFile('WhateverTest.php'); $test->addTestFile('FooTest.php'); exit($test->run(new TextReporter()) ? 0 : 1);
And worked fine.
Within the code base, there is one include file within the application which defines a number of variables, on the assumption it’s at the top level scope – e.g.
$database_name = "blahblah_live"; $db = new Database($database_name, $database_username, $database_password, $database_host);
Which works fine. However, because $db hasn’t been explicitly defined as a global variable, when the tests are run through phing – they run within the scope of a function, and hence the global variables aren’t available (because they’ve not been implicitly registered as globals – the code just makes an assumption that they are).
So, to fix it, I just need to find all the variables defined in the script, and make them explicitly global.
i.e.
global $db; global $database_name $database_name = "whatever"; $db = new Database(.....);
One step closer; perhaps soon I’ll be posting about getting Xinc or something similar working.
Twitter Weekly Updates for 2010-04-25
- Stratford marathon done – 3hrs 35m. Did first 12 miles in 1hr 30. Failed to pace myself. Legs enjoyed cramping for 30 mins after. Good fun #
- Podrunner's PowerTools mix – 174bpm; I wonder if this will help me run or not…. http://bit.ly/vXbcS #
- Hmmm. Not long now. Best pull finger out and move it. Alarms don't wake toddlers. An interesting fact perhaps. #
- Spoilt dog http://twitpic.com/1i3avu #
- Palringo seems pretty good (Im client for iPhone, pc, mac etc) #
- Marathon tomorrow. Better start peparing. Food. Food. Music 4 iPod and check schedule. #
- "this shirt would look good on your bedroom floor" – you're fat and ugly, so it's not going to happen for you mate, let's be honest. #
- Ah, tetris – http://www.last.fm/music/MidTown+Dickens/_/Tetris #
- I like playing tetris in the shower…. tetris is my favourite video game… (lyrics to a song being played in the office) #
- Since poundland opened in bromsgrove all other shops seem to have started to price things at £1. Wasn't it 99p before? 😉 #
- Reasons to be a dog: #1 good looking women pet you randomly and scratch your back. #2 you can't go in most shops. #
- Shorts. Thick jumper. Hmm. Dogs have it easy – none of this clothing nonsense. #
- Taking a day off work just so Eon can change the electric meter is not going to happen. FFS be more specific than 8-8pm. 1 hr slot perhaps? #
- Dog's hungry. #nickcleggsfault #
- I need to shave/shop/eat. #nickcleggsfault #
- RT @PalePurpleLtd Interviewing students for placement year – my findings – http://bit.ly/cSUD4v #
- RT @guardiantech Facebook introduces Docs, based on Microsoft Web Office http://bit.ly/cnHviA #
- Lunch time view. Bit better than normal. http://twitpic.com/1ha3r5 #
- RT @carolinegoodwin Spoof Daily Mail article http://twitpic.com/1h8ik8 Quite funny #
- More spam from prospective mps #bromsgrove #straight2recycling just have a f'ing web presence…. #bromsgrove #
- Bad things today: 1) diesel £1:20 a litre; car drank 45+ litres. 2) tired 3) poss. last run before Sunday – better make it count (7miles) #
- Pershore looks quote nice. Wish bromsgrove wad as good #jealousofcustomersoffice #
- Now, can I find a running hat in preparation for Sunday ? #
- Stourbridge road properly blocked; looks like they've nearly finished (hole filling up) http://twitpic.com/1gru97 no more cheating drivers! #
- Don't appreciate being overtaken by an old woman on an electric bike while running uphill. She got away on the downhill. Old fat lazy Cow. #
Post #1 on the UK Election…. (Bromsgrove)
So the Lib Dems might finally shake things up – I’ve not supported them before, and still dislike many of their policies – but I do feel that were they to get in, there would be an adequate shake up of the establishment in Westminster (PR or something similar would be a good move for a start – I’m increasingly fed up with (I feel) politicians getting ‘safe’ seats and effectively not listening to their constituents).
Unfortunately I suspect the polls will keep remain somewhat level, or Mr Clegg’s honeymoon will end as voters are either disillusioned by the ongoing press attention and we’ll just end up with Labour winning as our First Past the Post system seems to be favouring them for some reason.
At the moment I’m not sure who I’ll vote for; our local replacement Tory couldn’t be arsed to reply to an email I sent which just asked where he stood on DeBill / WhatDeBill etc – which didn’t particularly impress me. I’d expected to effectively get a copy+pasted generic reply saying whatever the party line was, but he couldn’t be bothered with that. Oh, and he also seems incapable of using Twitter/Facebook etc.
Having said that, my local LibDem candidate has figured such things out (website / facebook etc) but judging from what’s fallen through my letter box (and then straight into the recycling box) he is being outspent by the conservative campaign, in a seat where my vote counts for 0.09 of a ‘normal vote’ (clearly some votes are more equal than others?!) I can’t think he can be very optimistic.
Twitter Weekly Updates for 2010-04-18
- Sanders park is busy. Lovely day #
- Hmm. Lidl almond ice cream things. #
- Hockey match done. Lovely day. #
- The coffee which has been keeping me alert/awake at work turns out to be decaf. A definite #wtf moment. #
- I love chilli. #
- RT @carolinegoodwin they're a rough lot in Bromsgrove http://bit.ly/dg8Tzt (woman banned from alcohol buying) #
- So… The sky. Grey from ash? Is that what I can smell? Or is it just normal boring overcast Britian with local pollution? #ashtag #
- More & more drivers think "road closed" doesn't apply to them (Stourbridge road, bromsgrove). Why is it closed, why not traffic lights? #
- RT @poorlydressed Someone Get the Lifeguard – Poorly Dressed People of the World – Fashion Fails http://bit.ly/awSYm9 #
- RT @dvntownsend Today's FREE MP3 from @AOLRadio is "Hyperdrive" from @dvntownsend: http://ow.ly/1yve6 + free sampler from @AmazonMP3: … #
- Kick Ass is an excellent film – one of the best i've seen recently; def. better than avatar / green zone etc http://is.gd/bs2j0 #
- Stourbridge road is much nicer closed. Perhaps I need to buy some road closed signs and dig a big hole in it …. #bromsgrove #
- Not impressed that this stupid griffin iPhone case is broken. Can haz metal case plz? #
- The dog is changing career – cat chasing is so passé, fly catching is the way forward… #
- Wow. Bank paid me 14p in interest this last year on our current account. Why bother? #
- Potential office viewing booked for later today; <30 metres from telephone exchange; I'm not a bandwidth whore… honest. #
- Doesn't like being woken up, by his calf muscle cramping. #
- My MP Julie Kirkbride didn't bother voting on #debill Find yours http://www.VoteThemOut.co.uk #
Twitter Weekly Updates for 2010-04-11
- You'd think rubbing 24 miles would mean the dog wouldn't need walking again. Apparently not. #
- God. Can't put it off any longer. Must shower and cut the lawn, else it'll become hay. Hoping body works again. #
- Body now rebelling against 3hr 20 min run (bromsgrove -> Birmingham and back). Hope it was about 24-26 miles. #
- RT @glynmoody A letter to my MP – http://bit.ly/aeLsTh – brilliant letter about the Digital Economy Bill/Act; wish I'd written it #deact #
- Spotting the 10k runners go past sanders park. Lovely day. #bromsgrove #
- We're all going on a toddler hunt. What a beautiful day. We're not Ill. Uh oh. He is! Grump grump grump. #
- Stupid classic iPod. Just turn off ffs. *sigh* fine! I'll give you to a 7 year old who'll care and make full use of your abilities. So long! #
- Busy making single threaded perl backup scripts parallelised. #
- RT @loudmouthman hey O2 you just kept my business http://ow.ly/1wsHr #DeBill (not as good as talktalk tho..) #
- Digital Economy Bill it's a wash up – http://www.talktalkbog.co.uk/2010/04/08/digital-economy-bill-its-a-wash-up/ #debill #talktalk #
- Where I live I have the power of 0.1 votes. See your result at http://voterpower.org.uk #GE2010 #VPI #
- The dog has it in for me. Twice he tried to trip me up while running. Grr. #
- Morning motivation – coffee – http://www.myconfinedspace.com/2010/04/08/coffee-posters/ #
- Interesting southpark episode (s14e04) taking the piss out of facebook & tron …. #
- Upgraded Mac Mini's RAM to 4gb; shame none of the 'tutorials' online were up to date. Anyone want 1gb of DDR3 8500S RAM? #
- Oi! Don't piss there [door mat] you stupid dog! GRRR. (We'd only come back from a run 1-2 hours ago). He accidentally fell nose first on it. #
- Looks like a fine evening for a run. I wonder how many runners I can overtake….. #
- We won't be attending coilwindingexpo.com in Germany. They sure put plenty of effort into targeting that letter-shot #marketing #spam #fail #
- RT @loudmouthman I swear I was watching Scrapheap Challenge as MPs tried to make some sort of Copyright law from outdated ideas. #DeBill #
- .@Pewari I think mps pair off againt opposing parties so they don't need to turn up to everything, Plus someone has to feed the ducks#debill in reply to Pewari #
- It's all very well that you stock the best razor (kos azor) asda, but do you think you could sell blades for it too? #
- You know you're onto a "winner" when you see a html drop down containing values like "title ASC" "price DESC" etc #security #sqlinjection #
- RT @glynmoody Unknown root certificate in Firefox – http://bit.ly/9yeuw8 ouch #firefox #security #
- Finally found the eclipse 'accept remote session' xdebug setting. Now it's usable (xdebug, eclipse remains slow and nasty). #xdebug #php #
- id3tag – I am not impressed with your lame error message of "Abort trap". #
- It seems Dr @carolinegoodwin fixed the dog's limp yesterday; back to having four working legs etc etc 🙂 Woof! Woof! #
- Toddler tractor power http://twitpic.com/1dddwf #
- Looking forward to tractor assembly. 🙂 #
- Beer; Chocolate; Relaxation #
- I like the Tory election posters up ATM. They seemed everywhere in Kidderminster – is it a marginal seat or something? #
Twitter Weekly Updates for 2010-04-04
- Latest farm health and safety device 'promise' (this is real… Hang it on broken stuff so others know) http://twitpic.com/1d5w0u #
- Reason 501 that religion is bad – http://nsfw.myconfinedspace.com/2010/04/03/whip-it-whip-it-good (page decorations are nsfw, image is ok) #
- Good run – shame tripod couldn't keep up and had to be left behind. Dog seems to be going through a bad patch lately. #
- F.it. No blank CDs at home to burn ubuntu onto to do an install. Off to the office I go. #
- In my usual manner I'm fixated on one musical artist atm – Devin Townsend thanks @moobert & @aypok Plenty of bad air guitar/drums. #
- American deluxe sized burger – http://www.youtube.com/watch?v=XqIWPvCgi9g …. bigger than most men. #
- I've got swingers elbow :-/ #
- Bromgrove council have failed wrt the car park layout outside asda. Nice waste of money. Motorists can't get back to the empty part. #
- More hail / rain. Now if the dog would only let me pull the thorn out of his foot, and not throw up pork chop… we'd be onto a winner. #
- Everyone seems to be buying lots of crap. Wish they'd get out of my way. #
- RT @Surfrdan LOL Nice one RT @VecchioJo: wish i was this good an artist http://i.imgur.com/JEcO1.jpg ++ 🙂 #
- Perhaps I need to quit my peanut butter on toast addiction first though… 4 weeks to first marathon (Stratford) #
- Possible blisters between my legs; sore nipples and a filthy dog. Why do I bother? Oh, yeah, so I don't turn into http://bit.ly/cCWXi2 #
- Body appropriate tired after longish run; time to clean up, shop, mess with computers and eat. #
- Support world domination. Buy a book and t-shirt …. http://www.scottsigler.com/thestarter #thestarter #podcast #fakefootball #scifi #
- Potential office above chippy. Looks promising. We might get very fat though. Nice chips tho. #
- Twitter seems almost devoid of April fools. I'm not complaining. Toddler pulling one on me now – by having a lie in …. #
- Will anyone come up with a believable/original april fools prank? #
- 'NO!… Scissors do not go in the mouth Rowan!' #
- The dog's had a hair cut and now is attacking a gigantic chew http://twitpic.com/1c55e8 #
- Look prospect customer, if you have a rush job that needs completing in 32 hours, wasting 6 hours by not sending spec till 5pm does not help #
- I just donated to stop the Digital Economy Bill http://bit.ly/dc7B1u #38degrees #debill #
- RT @birminghampost Council blunders caused Brum municipal golf crisis, http://tinyurl.com/yabxvxz <- WTF? Slow news day? #
- Hmm fail me. Today is clearly a cottage pie DAY #
- Rowans asking for seconds. Clearly today is a cottage pie week. #
- Stupid American(s): I AM gingerdog@gmail.com – NOT YOU. Stop requesting password recovery. It's not going to work. KThxBai #
- Patch been to vet; lactulose is soln. #1 .. suspect a bone is stuck in his gut causing irritation. If no improvement by Weds, x-ray etc. #
- Hmmm. Awake. Listening to what sounds like a dog being sick. He seems to be sick a lot lately… 🙁 #
- RT @guardiantech Ofcom plans to cut cost of calls to mobiles http://bit.ly/b7EAs8 #
- Wholemeal toast + peanut butter FTW. #
- The dog instantly recognised the sound of a dog food can opening and appeared. Strange when I've hardly ever fed him canned meat before #
Twitter Weekly Updates for 2010-03-28
- work meeting over; time to go shopping or something. #
- Dear #Lazyweb I'm looking for 400-600sq feet of office space in/near Bromsgrove town centre (enough for 4 desks etc). #
- Google Chrome Still The Unhackable Browser http://thenextweb.com/google/2010/03/28/google-chrome-remains-unscathed/ are ff's days numbered? #
- the free @digg app is here for iphone! they're giving out 1 tricked ipad each day for 2 weeks to celebrate! http://bit.ly/diggapp #
- Bromsgrove hockey 4ths. Won 2-0. Yey. My first real game in 13 years… #
- It'll never cook if I keep stirring and watching… Apparently. #
- RT @guardiantech News Int. starts paywall for Times and Sunday Times (UK) from June. £1/day, £2/week. Will you pay? — hahaha. No. #
- Had 2 industrial year applicants so far; both with SQL injection flaws on their portfolio sites. #php #security #fun #
- Why do I always want more peanut butter on toast? #
- Just entered the Nottingham Marathon – http://www.experianfestivalofrunning.co.uk/ – September 12th 2010… #
- I've just asked Harriet Harman to give the #debill a real debate. Please join in and RT http://bit.ly/bJ3HwF #38degrees #debill #
- Soon it may be time to wake up. Soon. #
- Firefox 3.5 was almost unusable on this acer aspire one; switched to google-chrome – netbook becomes usable and responsive. #
- Patch enjoying the fruits of my labour http://twitpic.com/1aaiy8 #
- The dog is eating better than the toddler. Shepherds pie – rejected. The dog and I enjoyed it at least. #
- Anatomy education by colouring in parts of the dinosaur. Toddler style. #
- Hmm. Had better not tell anyone I turned the oven on but wasted 10 mins as it wasn't turned on right 'oven' just 'light+fan+pretend' #fail #
- Neighbour has what looks like a mountain bike with an engine. I tried not to stare #