Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mbabker's full-sized avatar
🖥️
Virtualizing virtuals

Michael Babker mbabker

🖥️
Virtualizing virtuals
View GitHub Profile
@mbabker
mbabker / gist:3211464
Created July 30, 2012 22:53
Creating a category via component postflight
// Get the database object
$db = JFactory::getDbo();
// JTableCategory is autoloaded in J! 3.0, so...
if (version_compare(JVERSION, '3.0', 'lt'))
{
JTable::addIncludePath(JPATH_PLATFORM . 'joomla/database/table');
}
// Initialize a new category
@mbabker
mbabker / RemoveSyliusMigrationsPass.php
Last active November 10, 2020 07:59
Compiler pass which removes migration paths added by SyliusCoreBundle and SyliusAdminApiBundle (or other third party packages), useful if you are manually managing all migrations within your Sylius application
<?php declare(strict_types=1);
namespace App\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
final class RemoveSyliusMigrationsPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
@mbabker
mbabker / # php@7.2 - 2019-07-02_12-35-57.txt
Created July 2, 2019 19:07
php@7.2 on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for php@7.2 on macOS 10.13.6
Build date: 2019-07-02 12:35:57
@mbabker
mbabker / notes.md
Last active July 21, 2016 18:30
Joomla! Prepared Statement Support

Joomla developers! Your support is needed to help make prepared statements in Joomla's database API a reality. I've started on some of this work but need help with testing and review.

Joomla's PDO driver already has provisions for prepared statement support written into it and the unsupported Oracle and SQLite drivers already make use of this.

In the Joomla! Framework Database Package I've started on work to expand this support. First, the PDO MySQL driver now has bound variable support and will fully support prepared statements.

I've opened pull requests for the MySQLi and PostgreSQL drivers to add support for prepared statements using the already defined interfaces in Joomla's database layer. Also, there is [a pull request](https://github.com/joomla

@mbabker
mbabker / queries.sql
Created November 3, 2013 20:09
Joomla Sample Data - Converting column data from MySQL to SQL Server
UPDATE `jos_banner_clients` SET `checked_out_time` = '1900-01-01 00:00:00';
UPDATE `jos_banners` SET `checked_out_time` = '1900-01-01 00:00:00';
UPDATE `jos_banners` SET `publish_up` = '1900-01-01 00:00:00';
UPDATE `jos_banners` SET `publish_down` = '1900-01-01 00:00:00';
UPDATE `jos_banners` SET `reset` = '1900-01-01 00:00:00';
UPDATE `jos_banners` SET `modified` = '1900-01-01 00:00:00';
UPDATE `jos_categories` SET `checked_out_time` = '1900-01-01 00:00:00';
UPDATE `jos_categories` SET `modified_time` = '1900-01-01 00:00:00';
UPDATE `jos_contact_details` SET `checked_out_time` = '1900-01-01 00:00:00';
UPDATE `jos_contact_details` SET `modified` = '1900-01-01 00:00:00';
@mbabker
mbabker / installController.php
Created August 22, 2013 20:42
Updated AJAX handling for app client
public function installfromweb() {
$model = $this->getModel('install');
$response = $model->installfromweb();
echo new JResponseJson($response['body'], $response['message'], $response['error']);
jexit();
}
@mbabker
mbabker / gist:6275111
Created August 19, 2013 22:47
GitHub Comment Payload
class stdClass#1 (5) {
public $comment =>
class stdClass#2 (6) {
public $created_at =>
string(20) "2012-10-28T02:50:43Z"
public $body =>
string(68) "OK, last one on this issue. I think I have the payload figured out."
public $updated_at =>
string(20) "2012-10-28T02:50:43Z"
public $url =>
@mbabker
mbabker / helper.php
Created August 8, 2013 21:52
Modified TDB helper.php file
<?php
/**
* Tweet Display Back Module for Joomla!
*
* @package TweetDisplayBack
*
* @copyright Copyright (C) 2010-2013 Michael Babker. All rights reserved.
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
*/
@mbabker
mbabker / cms-app
Last active December 19, 2015 13:29
This is a comparison of the loading time/memory for the legacy JApplication based app classes versus the proposed app classes built on JApplicationWeb.
This is a comparison of the loading time/memory for the legacy JApplication based app classes versus
the proposed app classes built on JApplicationWeb.
This comparison is taken on joomla/joomla-cms@d28d5d15073561cb4c79f3e7cbfa221119e11e0e (master)
compared to joomla-projects/joomla-cms@d849d4669b3b9f7684dd8dd54e396a859e4acde5 (feature-app)
For both tests, a fresh installation is performed and the "Learn Joomla English (GB) Sample Data" dataset is installed.
For the site tests, the homepage is compared.
For the administrator tests, the login page and control panel pages are compared.
Below are the debug console outputs comparing the current Joomla routing system versus Hannes' proposed improvements as collected on December 26, 2012. Tests were conducted on the CMS development HEAD with the "Learn Joomla English (GB) Sample Data" loaded.
Summary:
afterRender Time: 1.338 seconds (Current) vs. 0.542 seconds (Optimized)
Memory Usage: 2.84 MB (Current) vs. 2.61 MB (Optimized)
Current Routing:
Application 0.000 seconds (+0.000); 0.40 MB (+0.401) - afterLoad
Application 0.145 seconds (+0.145); 1.03 MB (+0.631) - afterInitialise
Application 0.557 seconds (+0.413); 2.07 MB (+1.043) - afterRoute