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 / 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)
Homebrew build logs for [email protected] 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 / keybase.md
Created October 16, 2015 19:58
keybase.md

Keybase proof

I hereby claim:

  • I am mbabker on github.
  • I am mbabker (https://keybase.io/mbabker) on keybase.
  • I have a public key whose fingerprint is EED9 6707 E398 8018 9C02 A87D 00E1 51E3 933D B00B

To claim this, I am signing this object:

@mbabker
mbabker / existing.php
Created June 13, 2015 22:47
getInstance Comparision
public static function getInstance($options = array())
{
// Sanitize the database connector options.
$options['driver'] = (isset($options['driver'])) ? preg_replace('/[^A-Z0-9_\.-]/i', '', $options['driver']) : 'mysqli';
$options['database'] = (isset($options['database'])) ? $options['database'] : null;
$options['select'] = (isset($options['select'])) ? $options['select'] : true;
// If the selected driver is `mysql` and we are on PHP 7 or greater, switch to the `mysqli` driver.
if ($options['driver'] === 'mysql' && PHP_MAJOR_VERSION >= 7)
{
@mbabker
mbabker / podmanBatchSave.php
Created December 30, 2014 04:22
Podcast Manager Batch Resave Script
<?php
/**
* Podcast Manager Batch Save Script
*
* @copyright Copyright (C) 2014 Michael Babker. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
// Set flag that this is a parent file.
const _JEXEC = 1;
@mbabker
mbabker / Factory.php
Created October 26, 2014 14:44
Factory Class
<?php
/**
* Application powering http://michaels.website
*
* @copyright Copyright (C) 2014 Michael Babker. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
namespace BabDev\Website;
<?php
/**
* Joomla! Framework Status Application
*
* @copyright Copyright (C) 2014 Open Source Matters, Inc. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
namespace Joomla\Status\View;
@mbabker
mbabker / wtf.php
Created July 8, 2014 18:26
You can't make this up...
// Instead of a simple call to JHtml::_('behavior.framework') I have to deal with this...
if (JVERSION >= '1.6.0') {
$file = JUri::root() . '/media/system/js/core.js';
$loaded = false;
foreach ($document->_scripts as $key => $value) {
if ($key == $file) {
$loaded = true;
}
@mbabker
mbabker / moduleSave.php
Created April 29, 2014 21:17
CLI Script to resave all modules
<?php
/**
* Module Resave Script
*
* @copyright Copyright (C) 2014 Michael Babker. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
// Set flag that this is a parent file.
const _JEXEC = 1;