Posts tagged php
May 4th: It's been three and a half months since I got PHP CI working on Travis, so of course it's now broken. Github Actions are the new hotness, so I figured out the right magical config to run multi-version CI for PHP over there instead, and it runs much faster too.
Jul 6th: A future note to self - if you're trying to build and install PECL modules but your /tmp is mounted as noexec, you can manually set PECL's temp dir using pear. Yes, this makes little sense.
I've posted a bunch of projects to Github in the last few months and haven't linked to them anywhere, so here's a quick roundup of recently notable projects:
- [lib_timezones](https://github.com/iamcal/lib_timezones) - A PHP and JS library to handle user-specified timezones properly, with reasonable client-side auto detection.
- [lib_classsify](https://github.com/iamcal/lib_classify) - A partial PHP port of Github's own [linguist](https://github.com/github/linguist) which can automatically detect the programming language, given a code fragment.
- [js-emoji](https://github.com/iamcal/js-emoji) - A JavaScript library to allow display of Emoji in then browser for OSs without native support (anything that's not OSX 10.8 or iOS 6)
- [lib_autolink](https://github.com/iamcal/lib_autolink) - My old PHP URL-detection and linking library, updated to handle multiple protocols.
- [lib_solr_query](https://github.com/iamcal/lib_solr_query) - A PHP library to turn user-entered complex search queries into valid SOLR query syntax. Supports phrases, booleans, nesting, assertions and more.
With all the current excitement about leaked password databases, I thought I'd take the time to make doing it the right way a bit easier. If you're working on a PHP app, start using lib_bcrypt right now.
A nice read about facebook's release engineering approach. This should all sound very familiar to Flickr alumni.
twig looks neat, if i ever get sick of smarty. syntax is a little odd though
php sadness points out a lot of real issues, but it's still the best tool for many problems
i'm still using smarty and you're no longer on the internet. i think i win this round
i'm generally skeptical of new things, but fire php seems pretty nice. stuffing that in headers is a lovely way to debug json ajax responses
a couple of interesting alternatives to phpMyAdmin, both simpler: sqlbuddy looks like a really well done minimalist effort, while phpMiniAdmin like like PMA from 10 years ago.
interested in using emoji in your web app? then you should read this guide and then take a look at the code
a little project from last week - iTunesRemote. control iTunes over the web
hackernews is just full of morons on most days
i'm the king of php! err, sorry rasmus
a couple of patches for my php4 OAuth library - it now correctly url-encodes spaces (that explains the intermittent failure!) and works with E_WARNINGS. now with a test case too :)
after a weekend of dorking around with bidirectional text on the web, i've put together a short guide to understanding bidirectional text in unicode. comments welcome
i've been going back and forth with dominic sayers for the last couple of weeks on RFC-based email validation. we both have php functions (mine, his) that pass a huge (and esoteric) test suite. who says RFCs are dull? (hint: they are)
backslash as the namespace separator in php 5? that's actually retarded. err, hey guys, we use that one for escaping characters in strings. i understand the issue, but there are lots of other symbols. like a single colon. or anything really. gah!
dwoo is a smarty-like template engine for php5. looks interesting. anyone have any experience with it?
the PHP_Debug bar is kinda neat. very ugly, but packed with useful info
announcing lib_oauth - an OAuth library for PHP4, requiring no extra extensions, pear modules, etc.
bookmarking for a later - fb code leaks
lots of good stuff in the facebook apc talk. worth a read
i hadn't noticed before, but using the smarty logo requires agreeing to the draconian trademark policies of new digital group. they appear to be quite evil.
from a php disucssion at work: "If you're willing to continually do the heavy lifting of ensuring that your version of Smalltalk96 on Rails stays concurrent with the latest patches". omg, how awesome would that be?
eric's been digging up a couple of really neat http upload related tools lately - two ajax progress meters for php and this neat multi-file upload ui.
found by eric and pretty cool - a php extension to allow you to track file upload progress. very very nice.
man, joyce sure hates templates. i suspect anyone how really wants to use xslt in a real application is fundamentally sadistic
php annoyance of the day: "If you compare two numerical strings, they are compared as integers" ... even if we can't convert those strings to numerics without losing precision.
mike b pointed me to this bizarre article from IBM's daniel sabbah describes lamp as "going to have to grow up at some point". err, right. because lamp clearly doesn't scale. it's not like the biggest websites in the world use it. ryan tomayko's response is on the mark.
php diary is good. and linking to an old article of mine. which surely makes me more likely to lonk to them ;)
i present a short lession in turning RFC BNF into perl regular expressions: Parsing Email Adresses in PHP
and here's that code in php for your enjoyment.
smarty syntax i wasn't aware of - you can nest array indexes using square brackets like so. the smarty manual needs some serious fleshing out :)
php in perl. excellent. now to make the flickr core even more confusing ^_^.
for your coding pleasure - porter stemmer in php
a new release of lib_filter (only 2 months late) to avoid the br tag being removed when the b tag should be (bad regexp - no cookie for you!).
just bookmarking jeff's notes of phpwest.
david ascher picks out the best quotes from my presentation at phpwest.
dude. i am on the front page of php.net. i am l33t haxxor (if you're in vancouver on friday, come and listen to me talk crap at phpwest)
savant seems like a good idea, but basically just sucks. php is too syntax heavy for templating. a six character sequence to open a tag? ffs
and someone else is getting offended by my like a sieve comment (or, at least, taking it out of context).
the newly launched php wtf seem to be struggling for content - maybe there's not as many bad php programmers as one would imagine, or (as i find that hard to believe), the people running the site are finding bad code tough to spot ;)
at least someone took my comments about PEAR's failing to heart.
what. the. fuck. i did a "pear upgrade-all" and it first failed because of dependencies. fair enough - stupid that it didn;t automatically install the dependency, but forgivable. but then once finished, pear was broken because it used php 4.2.0 only features. how fucking stupid is that? the people in charge or pear are braindead idiots.
stupid stupid pear doesn't have an atom parser yet (and wont for ages - their standards and approval process greatly discourage people writing for it - there's no way i ever will :/) so i wrote one with the same interface as XML::RSS, for drop in replacement (it's going to be used in an upcoming aggregator project).
check out my rtf tokeniser in perl which i wrote many years ago and just remembered about (although we now have RTF::Tokenizer on cpan which didn't exist when i wrote my tokenizer).
george schlossnagle writes about php and scaling in response to the rather crazy friendster/joyce/php/jsp stuff going on right now.