The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
 - Revised date: 15/12/2013
 - Original post
 
| <?php | |
| /** | |
| * A helper class for use in the Symfony Framework. Although there's no restriction to use it in | |
| * any other framework or script. Just the autoloader needs to be setup before using this class. | |
| * Sample code for initializing XenForo from your own script: | |
| * | |
| * <code> | |
| * $startTime = microtime(true); | |
| * $xenforoRoot = '/absolute/path/to/xenforo/root/directory'; | 
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" | 
| global $wpdb; | |
| $query = "SELECT meta_value, meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata'"; | |
| $result = $wpdb->get_results($query); | |
| foreach ($result as $item) { | |
| $meta = unserialize($item->meta_value); | |
| unset($meta['sizes']); | |
| $wpdb->update( 'wp_vira_postmeta', array('meta_value' => serialize($meta)), array('meta_id' => $item->meta_id) ); | |
| } | 
| # === Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers) === | |
| # | |
| # by Fotis Evangelou, developer of Engintron (engintron.com) | |
| # | |
| # ~ Updated February 2021 ~ | |
| # | |
| # | |
| # The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores. | |
| # If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
| # |