PHP register_globals is ON

I started writing PHP when I was at University, in 2001 or thereabouts. Having checked the dates it looks like I did technically write PHP before PHP 4.3 was released and register_globals went out of fashion. I don’t recall it though and obviously its been a while!

Today I was trying to debug a script which uses register_globals on, virtually for the first time. Its a new working environment for me and a situation where support is still being provided for some legacy systems. Trying to track where values are coming from, or might be coming from, was quite mind-bending. Its like having voices inside my head while I’m trying to concentrate on something!

There’s more where that came from so if anyone has any suggestions for debugging a language where the variables seem to come from nowhere, or can remember how to work with PHP with register_globals turned on, I’d be grateful :)

UK PHP Conference: The Roundup

As promised, here’s a more in-depth update on our trip to the PHP London Conference last week. I’m sure there are others who will write more fluently and accurately about the talks, but here’s what I brought home from it.

Cal Evans: My First Mashup

Cal is a personal hero of mine, as I said earlier, so I was really looking forward to his talk. He did a simple mashup of two APIs which tracked a UPS package to its destination on a Google Map. He used APIs from both companies and had a working demo to show.

Although he showed JSON and XML data formats, he mostly seemed to be using XML and had some good things to say about the SimpleXML functions now in PHP 5. For making the API calls he used script.aculo.us.

From the talk I came away with a clear picture of how a mashup goes together and a sense of confidence that when a project comes along for me that needs it I’ll just dive right in. I saw the whole API idea in action when writing PlayTAG for the PHP Throwdown. Cal also pointed us at http://www.programmableweb.com/ which looks like a good resource.

Simon Laws: Web Services

Simon was talking about a project he and his colleagues have been working on to create consumable services, which followed on nicely from Cal’s talk. The project is a PECL module and their page is at www.osoa.org, its good to see business contributing so nicely to the community.

The idea of the project is that you can write some class-based functionality and then expose that to be called as a service by some external script. It was interesting and the talk was well-prepared with demonstrations and code snippets all at different points along the development that Simon walked us through. My personal favourte moment was him typing “phuk” rather than “phpuk” into a sample input … perhaps that just my twisted sense of humour. One thing that really impressed me was that they had spent a lot of consideration about making different formats available and providing various bindings for accessing the services. Some of that information about what’s available for what type of service is held in phpDocumentor-style comments at the moment but it could easily be generated as a static companion file or something further along the line.

Best of all was getting to catch up with Simon and his colleague Caroline (a PHP Women friend of mine) at the event after the conference and ask them a bit more about their job. They were both interesting and friendly people.

Kevlin Henney: Objects of Desire

Kevlin was very brave to come and speak as he’s not a PHP-er himself most of the time (or so he claimed). He was talking about the PHP implementation of Object Oriented Programming in comparison with other languages including Java and C++. His talk was based around a series of questions and he was a very entertaining speaker.

His perspective of coming from a wider background than just the single language was very interesting and I did feel that it gave a much more balanced perspective on the topic. The talk was based on answering a series of questions and this worked very well. In particular he was talking about unintended properties of objects and illustrated this by showing that his bottle of cough mixture had the property “throwable”, as it was quite small and aerodynamic … I did warn you he was entertaining :)

Rasmus Lerdorf: Fast and Rich Web Applications with PHP 5

Rasmus Lerdorf is the godfather of PHP and a nice guy. I’ve heard him on podcasts, own some of his many books, and have even corresponded on forums with him but not seen him in the flesh before so this was interesting. He was talking about PHP5 and then went on to answer quite a few questions which was very interesting. At the beginning there was a problem with the wireless in the venue and he raised a smile around the room by putting up a slide which showed photographs of:

  • a ship in the Mediterranean
  • a field in India
  • a mountain in Cambodia

And then explained that these are all places where he has given talks and wireless internet access had been arranged … we were in Central London!!

Rasmus talked about the movement to PHP5 and adopter rates and barriers. He recommended using the Filter functionality in PHP for all input variables and gave some good examples. His other recommendations included making use of the static keyword where appropriate to prevent unexpected usage or extension of methods, and also use of the -l switch for checking PHP4 code prior to deployment for PHP5.

Conclusion

For an even costing £50 and organised by volunteers it was an excellent day! There was coffee available at every turn and lunch was provided, they certainly knew how to take care of geeks. Attending the pre- and post-event socials definitely led us to get more out of the whole experience and meet some very interesting people. It was well worth the effort and I’d certainly recommend this to anyone interested in PHP for next year.

New Addition To The Family

I’m proud to announce that we are now the owners of a MacBook! Or rather, Kevin is the proud owner of one and I am being friends with it too. It arrived yesterday and is called Edoras. All our computers need names because we have too many to be able to refer to them otherwise!

I’m not too familiar with Macs but I’m looking forward to getting to know this one, not least because its little and sexy. Software recommendations are most welcome, if anyone has any favourites.

UK PHP Conference: The Highlights

I’ve been away for a couple of days at the UK PHP Conference in London. Due to the unique way that train ticket prices work here, it was wildly cheaper to travel a day either side of the day we actually wanted to be in London for which allowed us to take in some sights and socialise with some other PHP-ers.

I’ll post more about the conference itself but for now I’d like to leave you with the highlights.

  • Hearing Rasmus Lerdorf speak … he was interesting and entertaining and managed to out-geek everyone there all in one go.
  • Getting to say hi to Rasmus later on (I was probably quite star-struck but never mind! I do own a few of his books so I’m allowed to idolise slightly)
  • Getting to say hi to Cal Evans, editor of Dev Zone and all-round good guy. He helped phpwomen.org in its infancy. In addition Cal is now my hero as he gave me a pack of the PHP Playing Cards I have coveted for so long! He just had a few sets in his hand after his talk and gave them to bystanders, talk about the right place at the right time.
  • Meeting a phpwomen.org friend in real life for the first time :)

New Camera

We bought a new camera yesterday. Kevin has a good digital camera but its quite big and now quite old. He saw that Jessop’s was having a sale so we went and looked … we’ve now got a fujifilm finepix F650 [1]. Its quite small and quite powerful with simple enough interface for me to easily use it but enough override to keep Kevin happy too!

It has an internal lithium battery and takes XD cards as its memory. On the whole its got everything we wanted and has the biggest, nicest screen I’ve seen in a while. Its easy to set the flash settings and it has both macro and super-macro modes (useful for taking closeups of stitch patterns). There are also some presets for using it in different modes – like fireworks, sunset, flower, landscape and so on, including a museum mode where it turns off the keytones! There are also some presets for whitebalance which seem to really help with colour temperature when I photograph knitting without the flash.

The photographs that appear over the next few days were taken with the new toy, let me know what you reckon!

1 I know that link is to amazon but I can’t find either Jessop’s or the manufacturer’s page

Email Outage

Like the technical wizard that I am I’ve just spent 48 hours (almost) with all email to my lornajane.net domain getting lost in the ether somewhere. The story is one of those silly bureaucratic ones which I won’t repeat here because my hosting company, flump , have been all-round great for the six years I’ve been with them and their support people have got me sorted out politely and relatively quickly.

So, if you’ve been emailing me and I’ve been ignoring you, can you send it again please?

CMS Promiscuity

This site is run by textpattern, I’ve used it a few times and I love it. In addition you may have read about my recent encounters with Joomla! .

This week I’m trying out Serendipity for another site and its quite a change. For a start I haven’t read a lot about it although there are a few places that I’ve notice it used (on Sara’s blog for example) and wondered about it. It turns out its templates use Smarty which is good for us as quite a few of our recent projects have (both woollyblanket, for its user management bit, and our recent experience creating playTAG.

First Impressions

Well the installation was a dream, which I kind of expected, but its great to see all the same and a nod to the team for that. Getting started with the admin side of things wasn’t too hard either – you install a plugin called “Spartacus” and then you are able to download and install any plugins and themes from their central respository. Its very convenient and perfect if you only have FTP access or just don’t want to mess about moving files from one place to another.

Getting a site running

The admin interface is quite simple – you add content items into categories in a way that will be familiar from other comparable CMS products. Getting some navigation to happen needed a selection of plugins but installing each one is pretty painless. The configuration screen shows the “sidebar” plugins in the location that they will appear followed by the “event” plugins which are the ones that modify the functionality.

What Next?

Well, I’m not posting the URL of the project I’m using Serendipity for just yet, because it’s not ready. I hope the suspense of wiating to find out what the site was and what I did to Serendipity in the process won’t be too much!

Feel the Freedom

I’ve just stumbled across Scott Carpenter’s site Moving to Freedom site and it reminded me something I meant to write about.

Some time ago, my little sister entered Further Education and needed her own computer. So I tarted up my desktop, reinstalled it, and dumped it in her bedroom with a wireless connection to the broadband. It wasn’t a new machine (bits were 8 years old!) and that was 18 months ago.

At Christmas I had to take the thing apart, dust some parts, drop other parts and coax it back into working… but it seemed OK. Last week it just died completely. So I went to my parents’ last weekend to try to breathe more life into it. But the hard drive was dead … I have another spare machine but I couldn’t lay my hands on a Windows license (not because I’m disorganised, I’ve been living out of boxes for a year).

Installing Linux

So I installed Linux. I downloaded a Kubuntu Live CD image and after half an hour of swearing at Windows managed to burn the image onto the CD correctly. I should point out at this stage that although I’m a very content Linux user, I don’t install or administrate it. So I put the live CD in, showed off a few odds and ends and asked my sister what she needed her PC to be able to do. Her wishlist is:

  1. Edit Office Documents. She knows about Open Office and says she will be able to work it
  2. Surf the internet.
  3. Use her ipod nano in an iTunes-a-like way
  4. Use Windows Messenger Live or equivalent

I had a quick google on the ipod front, I have an alternative gadget specifically because I use Linux, but apparently it can be done so I toddled off to install Kubuntu for the first time. I have no idea what I did on the first attempt but it froze part way through (possibly from the effort of reformatting the hard disk). The second time though it was quite successful and then the fun began.

Getting software

My Linux experience is quite patchy and also I’m a very command-line-happy user so I’ll get new stuff with an “apt-get” command and not worry about it. This isn’t going to work for my perfectly computer-literate but not geeky sister! After some grappling with the Adept Installer and realising I had to uncomment a config file to get the universe and multiverse repositories added, we were flying. She’s now got Firefox and a handful of games in addition to Kopete and the Open Office that Kubuntu installs with by default.

The wireless card

I had no idea (because I’ve never done it) that there was such contention with drivers for wireless cards. It took me two attempts and a couple of late-night phone calls to my sysadmin (thanks, Kevin!) to get it working. Apparently the key thing is to use pcils to see the card listed and grab its model number, then feed that into google along with the word ndiswrapper and hope you find some instructions on what to do next.

Moving forward.

Now its up and working I have to say I really hope she takes to the new set up. At the moment she’s without an iTunes-a-like (as she’s waiting for me to research it for her) unless she surprises me and sorts it out herself, and the monitor won’t go for a better resolution than 800 × 600 which is annoying. I’ve got The Linux Equivalent Project bookmarked and am trying to figure out which of the chat clients will give her the closest experience to what she is used to (the main requirement seems to be the emoticons!) and also what is going to be the easiest for her to use with the ipod nano.

I am enchanted with the idea that a normal person could just sit at a Linux machine and perform their usual functions without too much hassle. If she rises to the occasion then not only will she have saved a fortune in software costs, now and for the future, but I hope she’ll also embrace the idea that she is rewarding the community that worked so hard to create these products, rather than the corporate giants who would bring evil on the world.

Has anyone had any similar experiences of bringing their own software and beliefs to others? (Cait, do post and let us know how you are getting on!)