Skip to content
cjhaas blog

Basically a place that Chris can post solutions to problems so he can easily find them later

cjhaas blog

Basically a place that Chris can post solutions to problems so he can easily find them later

Month: March 2017

PHP

XDebug code coverage in PHP 7 doesn’t reach all code

Posted on March 29, 2017 By [email protected]

I was noticing a lot of white (untouched) code in my XDebug code coverage reports however the method signatures at the top were all green and 100% covered. After some searching I found this thread (don’t bother reading) which led to this thread (scroll fast and occasionally read) which showed…

Read more
PHP

I finally get late static binding in PHP

Posted on March 28, 2017 By [email protected]

Static inheritance in PHP (and really any language) can get tricky sometimes, especially when you’re trying to figure out what self is currently referring to. In PHP, self is always applied to the class that has that declaration, not necessarily the child class. Hmm… that reads weird, let’s make an…

Read more
PHP

PHP: Unexpected behavior when using unset() on class properties

Posted on March 28, 2017 By [email protected]

When you unset a non-dynamic class property you apparently enter a weird limbo state. Take the following simple anonymous class: //Simple anonymous class, nothing to special $c = new class { public $alpha = ‘alpha’; }; Perform a property exists test and show the value: //Do we have the property? echo…

Read more
Fun links of the day

DOS wildcards were more complex than I thought

Posted on March 28, 2017 By [email protected]

Raymond has an excellent description here.

Read more
Random things I learned

Windows command line: assoc and ftype

Posted on March 23, 2017 By [email protected]

I never knew these commands even existed, I always just want to the registry. I wonder which versions of Windows they shipped with, I only have 10 available to test here. assoc Displays or modifies file extension associations ASSOC [.ext[=[fileType]]] .ext Specifies the file extension to associate the file type…

Read more
SSH

Have bash remember your SSH private key’s password for the current session

Posted on March 22, 2017January 8, 2020 By [email protected]

(wow, that was a long title) ssh-agent bash ssh-add ~/.ssh/id_rsa EDIT Since I come here every day, here’s an updated version: eval $(ssh-agent -s) ssh-add ~/.ssh/id_ed25519

Read more
Composer

Composer and private GitHub repos

Posted on March 13, 2017 By [email protected]

I fought this one for a while today. There’s lots of documentation out there for using Composer with private repos and I got everything to work except getting the autoloader wired up. What finally worked for me was setting “no-api”: true in the repositories key. { “repositories”: [ { “type”:…

Read more
Composer

Optimize composer’s autoloader

Posted on March 10, 2017 By [email protected]

Most people write really simple autoloaders for their PHP projects that look at a class or namespace prefix, perform a file_exists and finally require_once the file. Something like: //Register an autoloader for our plugin’s actual code spl_autoload_register( function ( $class ) { //PSR-4 compliant autoloader //See http://www.php-fig.org/psr/psr-4/ $prefixes = array(…

Read more
Random things I learned

Firefox “Containers”

Posted on March 10, 2017 By [email protected]

As of Firefox version 50 (version 52 is the current one) you can now open tabs in different “contexts” such as “work”, “personal” or “banking”. These “containers” as Firefox calls them are each isolated from each other which means that things like cookies aren’t shared between them. This means that…

Read more
PHP

strcspn

Posted on March 10, 2017 By [email protected]

Going on 10 years of PHP programming and I’m still finding functions that I never knew about. Today it was strcspn which is one of those functions that essentially maps directly to a C counterpart. int strcspn ( string $subject , string $mask [, int $start [, int $length ]] ) The formal description…

Read more
  • 1
  • 2
  • Next

Recent Posts

  • Google open redirect
  • How to use AI to write code
  • Doctrine/Symfony MariaDB DSN connection string
  • Creating a portable copy of pdftotext from source
  • Gravity Forms shortcode getting extra line breaks when used with ACF

Recent Comments

  • jose luis on #2 – VB.Net iTextSharp Tutorial – Add an image to a document
  • Eliezer Castanon on iTextSharp slightly smarter text extraction strategy
  • javad on How to recompress images in a PDF using iTextSharp
  • MANOUS3784 on Flock is awesome
  • Sang on Flock is awesome

Archives

  • June 2026
  • October 2025
  • November 2023
  • September 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • December 2022
  • September 2022
  • April 2022
  • October 2021
  • September 2021
  • April 2021
  • January 2021
  • October 2020
  • August 2020
  • June 2020
  • May 2020
  • December 2019
  • November 2019
  • October 2019
  • July 2019
  • May 2019
  • December 2018
  • October 2018
  • July 2018
  • November 2017
  • October 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • September 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • November 2013
  • May 2013
  • April 2013
  • March 2013
  • January 2013
  • November 2012
  • October 2012
  • July 2012
  • March 2012
  • January 2012
  • October 2011
  • September 2011
  • July 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • June 2010
  • April 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009

Categories

  • Accessibility
  • Advanced Custom Fields
  • Authorize.Net
  • BWP Minify
  • Composer
  • Crappy Google Search Results of the Day
  • CSS
  • Doctrine
  • Drupal
  • Drush
  • Elasticsearch
  • Fun links of the day
  • Google Analytics
  • Gravity Forms
  • HHVM
  • HTML
  • iTextSharp
  • JavaScript
  • Linux
  • mysql
  • nginx
  • Optimization
  • PDF
  • PdfPTable
  • PHP
  • Plugins
  • Ramblings
  • Random things I learned
  • Redis
  • Security
  • simplesamlphp
  • SQL Server
  • SSH
  • SSL/TLS/HTTPS
  • Stack Overflow
  • SVG
  • Symfony
  • Synology
  • Uncategorized
  • Unicode
  • Varnish
  • Vendi Best Practice
  • VIP
  • Weird Google Search Results
  • Windows
  • WordPress
  • WP-CLI

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2026 cjhaas blog | WordPress Theme by SuperbThemes