Category Archives: PHP

Deprecated error with Lemonstand V1 and Braintree Payments

If you’re running an eCommerce website using Lemonstand V1 (which is now unsupported since their V2 is the new hot stuff) and have recently upgraded your server to PHP 5.5+, you may run into a deprecated error when using Braintree Payments. The error is in /modules/shop/payment_types/shop_braintree_transpredirect_payment/Braintree/Util.php and is pretty easy to fix. There are two functions using the deprecated /e modifier: delimiterToCamelCase & camelCaseToDelimiter. The fixed versions of these methods are: delimiterToCamelCase public static function…

Read More

LEMP vs LAMP

Interesting results trying to optimise a website for a client. This is the blitz.io results before and after. In both cases the website run the same Lemonstand installation. The before setup had a standard cPanel installation with: Apache 2.2.25 PHP 5.4.21 with XCache MySQL 5.0.96 2GB Ram The after setup has: nginx 1.0.15 PHP 5.5.15 with Zend OPcache (running as php-fpm) MySQL 5.5.39 6GB Ram There is obviously a lot of difference between the two…

Read More

Compiling webpay on a cPanel based server

This is more of note-to-self for future reference but other people might appreciate it. If you have to use the St George webpay API, high five to you first and you’ve probably suffered through trying to install it. Assuming that you have all the requirements to compile it (swig, php), the only things you need to remember are: You need to compile it using the active php installation from cPanel/WHM, which includes the correct extension…

Read More

Lemonstand Module – Dog Tools

Started a Lemonstand Module where I plan to add a few helpful developer items. Just one helper in there, the Dumb Gateway payment type: Dumb Gateway was never the smartest in class. Dumb Gateway goes nowhere and does as it feels. Add Dumb Gateway and set the mood. When Dumb Gateway is Happy, payment goes well. When Dumb Gateway is Sad, payment goes poorly. Sometimes Dumb Gateway is undecided. Dumb Gateway likes developers, but Dumb…

Read More

Adding conditions to relationships in Laravel

Currently playing with the Laravel php framework. It’s been said by many already, it’s a really cool framework. Well designed and documented. Coming from a CodeIgniter background, it’s easy to jump in and refreshing to get all the new cool features. The Eloquent ORM has a nice minimalist approach to writing database abstraction. If you’re coming from Propel or Doctrine it’s crazy how little you actually need to get Eloquent going. Eloquent supports relationships between…

Read More

Extended ASCII characters are valid php variable names

A curiosity… I was looking on the php.net website for what qualifies as a valid PHP class name, which they qualify as: A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. came across this statement Source PHP reference page But they then add the following: As a regular expression, it would be expressed thus: [a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff]* \x7f-\xff … really? (\x7f-\xff is the extended ascii character set)…

Read More