Opensource: be grateful for enterprisey mess

Apparently, it has taken almost a year for the most popular PHP mailing library to support TLS v1.1 and v1.2 !? https://github.com/swiftmailer/swiftmailer/issues/933 (Packagist says it is downloaded almost 73 million times! https://packagist.org/packages/swiftmailer/swiftmailer) … only after PHP geeks freaked out, started screaming, running like headless chickens (online), including me, maybe because some paranoid security guys turned … Read moreOpensource: be grateful for enterprisey mess

Poor man’s full text search for SuiteCRM

The poor man’s CRM, a.k.a SuiteCRM, is great (… was great for its time!); that’s another story. One of the features provided is “unified search”, as the geeks call it; some may call it global/universal search across many tables and records in the database. What it does is simply as follows: Loop over a list … Read morePoor man’s full text search for SuiteCRM

MySQL Error: Thread stack overrun

Recently, I’ve come across this error: MySQL error 1436: Thread stack overrun: 164720 bytes used of a 196608 byte stack, and 32000 bytes needed. Use ‘mysqld –thread_stack=#’ to specify a bigger stack. I am using PHP 7.0 and MySQL 5.7 on a Ubuntu 16.04 VM. Basically, I was dynamically creating more than 5 long SQL … Read moreMySQL Error: Thread stack overrun

Drupal 8 – Amazing progress!?

Drupal 8 (cash-cow of digital agencies)… after so many years, they cannot event get the basics right: no dedicated public HTTP folder, entire codebase is exposed relies on (Apache) .htaccess, serious issue for security and performancewhat about Nginx? writable code folders for sites, modules, themes, etc. – not dev-friendly at all what’s the place of … Read moreDrupal 8 – Amazing progress!?

The cost of a million objects – revisited for PHP7

PHP 7 is out there finally and I am sure the adoption rate will be very slow especially because of legacy code. Here is a repetition of my simple tests I’ve done before (PHP Memory Usage: The cost of a million objects) and comparison of those results between PHP 5.6.18 and PHP 7.0.3. path-to-php5/php.exe test-path/memory_test_v4_objects_with_myclass_simple.php … Read moreThe cost of a million objects – revisited for PHP7

Full-text search using PostgreSQL: simple, fast, cached

Let’s find out what can we achieve; using what we already have, without adding other layers, servers or applications: PostgreSQL. It will help us keep the architecture simple, please be patient 🙂 We need to prepare records for full-text search using 1-to-1 relationship for relevant records in other tables with search term vector from one … Read moreFull-text search using PostgreSQL: simple, fast, cached

PHP: The cost of a million objects on function calls

Especially, if you are a start-up, all it takes is a fine combination of: a bad coder (with an arrogant attitude of “code first + optimize later”) and 1000 simultaneous requests to bring each of your servers to its “knees”. On part 1, I’ve mentioned the cost of a million items when we are using … Read morePHP: The cost of a million objects on function calls

PHP Memory Usage: The cost of a million objects

Even though memory is getting cheaper, our applications are becoming more complicated and we need to write our code more carefully. I’d like to share some surprising tests I’ve written recently. The sample code files are also on github: https://github.com/muratyaman/php-tips. The tests are very simple: let’s create an array of million items to process: version … Read morePHP Memory Usage: The cost of a million objects

How good are the abstraction layers?

Choosing the features based on the lowest common denominator of X number of database systems is not the right approach in implementing an ORM! https://github.com/laravel/framework/pull/8400 This forces us to question the value of database abstraction layers and other abstraction layers in general. If one database system does not support a feature, the abstraction layer developer … Read moreHow good are the abstraction layers?

Managing date fields properly with correct time zones in PostgreSQL

In apps for users all around the world (even in apps for local users where DST applies) correct time zones should be set, after database connection is established, based on the user’s time zone setting (rather than hard-coded setting in app). Then, data read/write ops should be automatically handled by the database. For example, in … Read moreManaging date fields properly with correct time zones in PostgreSQL