1. PHPUnit’s HTML code coverage reports don’t play nicely with GitHub pages “main branch /docs folder” by default, as they store CSS, JS and icon assets in folders prefixed with underscores.

    Here’s a little bash script to run tests with code coverage enabled, then move the assets around:

    rm -rf docs/coverage/
    XDEBUG_MODE=coverage  ./vendor/bin/phpunit tests --coverage-filter src --coverage-html docs/coverage
    mv docs/coverage/_css docs/coverage/phpunit_css
    mv docs/coverage/_icons docs/coverage/phpunit_icons
    mv docs/coverage/_js docs/coverage/phpunit_js
    grep -rl _css docs/coverage | xargs sed -i "" -e 's/_css/phpunit_css/g'
    grep -rl _icons docs/coverage | xargs sed -i "" -e 's/_icons/phpunit_icons/g'
    grep -rl _js docs/coverage | xargs sed -i "" -e 's/_js/phpunit_js/g'
    

    That allows you to use GitHub pages to show code coverage reports as well as docs, as I’m doing for taproot/indieauth.

  2. php-mf2 v0.3.0 is released! This long overdue update contains a variety of bugfixes and new features:

    • Requires PHP 5.4 at minimum (PHP 5.3 is EOL)
    • Licensed under CC0 rather than MIT
    • Merges Pull requests #70, #73, #74, #75, #77, #80, #82, #83, #85 and #86.
    • Variety of small bug fixes and features including improved whitespace support, removal of style and script contents from plaintext properties
    • All PHPUnit tests passing finally
    • Many thanks to @aaronpk, @diplix, @dissolve, @dymcx @gRegorLove, @jeena, @veganstraightedge and @voxpelli for all your hard work opening issues and sending and merging PRs!

      github

      packagist

  3. Much as I like docblocks, the phpdoc proposal reads like an attempt to recreate the semantics which staticly typed languages give us, but outside the language in verbose comments and requiring extra tools to use for some reason.

  4. Jan B.: @BarnabyWalters @ZacharyTong but doesn't work on Debian Squeeze and depends on a specific minor version of PHP

    @bracki pity it doesn’t work on Squeeze (why is that?), as far as I can see it doesn’t depend on a particular version of PHP, just anything greater than 5.3.9 — "php": ">=5.3.9", to be exact.

  5. Igor Wiedler: @BarnabyWalters regarding your #stackphp question, I believe this answers it: https://github.com/stackphp/run 

    @igorwhiletrue thanks! I was aware of stackphp/run, but wondered if there was an alternative which left the run method in place — Silex is such an exquisitely designed and concise abstraction it’s a pity to have to give that up and introduce extra packages, namespaces and functions (more surface area to learn and remember).

  6. Emil Björklund: #PHP folks: when fetching from an API, would it be wise to use function_exists to check for cURL, and else fall back to file_get_contents()?

    @thatEmil that should work fine — one thing to bear in mind is that by default they both treat redirects differently. IIRC, cURL doesn’t follow redirects by default whereas file_get_contents will.

  7. New in this version of :

    • Improved styling (still WIP, as always)
    • stream on homepage, currently just notes but will add other things too
    • content creation/editing UIs publicly viewable (take a peek!)
    • profile photo as the icon
    • complete code restructure, now using silex for HTTP routing
    • removed tonnes of nonsense framework code, replaced with small number of ≈200 line functional libraries. Clearer, easier to navigate and much more fun to work with
    • no more SQL databases — content is indexed using a custom built 209 LOC CSV index which is surprisingly speedy, and suits my needs perfectly
    • no more support for rendering content in many forms using content negotiation (HTML, JSON, ATOM etc.) — now only HTML+microformats2 representations of content are given
    • ATOM feed shimmed with microformats2 to ATOM converter
    • Pingbacks no longer natively accepted (though they are sent), using webmention.io to shim them into webmentions for easier handling

    The local maximum has been overcome, for now. There is still much to do.

  8. psysh.org is the REPL shell we have been waiting for. How to start an interactive shell with a given context:

    <?php
    require 'vendor/autoload.php';
    $app = require 'src/app.php';
    Psy\Shell::debug(['app' => $app]);
    

    Supports readline, pcntl, registering custom commands, automatic semicolon insertion, clean+concise string representations of evaluated values. Amazing work Justin Hileman!

  9. Had many basic software development lessons hammered in by personal experience over the last couple of years: hierarchy bad. side effects bad. many moving parts bad. undue complexity bad. inconsistency bad. SQL databases fragile. always be reducing.

    It’s amazing just how seductive complex, unproductive tools can be. Successfully overcome+abandoned:

    • Codeigniter
    • Doctrine ORM
    • Bootstrap
    • Backbone, Ember, Angular
    • Symfony Security component

    PHP remains productive and speedy (with composer, delightful dependency management), python nice with some irritations. jQuery useful when absolutely necessary, plain with small libraries loaded via requirejs handle most progressive enhancement concisely. node.js nice for some things, preferring go’s approach to async programming but still not much everyday need for it.

    Avoiding middlemen: LESS, SASS, Coffeescript. Unnecessary for most of my work, and more moving parts is bad.

    Now bothering me is the frameworky nonsense accumulating in . Need to cleanse.