Skip to content

Instantly share code, notes, and snippets.

🖥
Virtualizing virtuals

Michael Babker mbabker

🖥
Virtualizing virtuals
Block or report user

Report or block mbabker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mbabker
mbabker / batch-process.php
Created Jun 21, 2011
Batch Processing Boilerplate
View batch-process.php
/**
* Method to run batch operations.
*
* @return void
* @since 1.7
*/
public function batch($model)
{
JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
@mbabker
mbabker / twitter.php
Created Aug 6, 2011
A simple class to retreive the latest tweets for a user.
View twitter.php
<?php
define('_JEXEC', 1);
require_once __DIR__ . '/libraries/import.legacy.php';
/**
* Simple class to retreive some tweets from Twitter and display using the Joomla! Platform CLI
*
* Note: This file must be placed at the root of your Joomla! Platform checkout
@mbabker
mbabker / gist:2793664
Created May 26, 2012
Display compatibility badges on Akeeba Release System "Latest Releases" view
View gist:2793664
/*
* Create an HTML Layout Override for components/com_ars/views/latest/tmpl/category.php
* and insert the below snippet just below the $released = new JDate... line
* A live example of this can be found on http://www.babdev.com/extensions/latest
*/
// Additons to get all supported versions per release (for when multiple items support different versions)
$i = 0;
$versions = array();
foreach ($cat->release->files as $environment)
@mbabker
mbabker / gist:2902581
Created Jun 9, 2012
Example JHttp Use
View gist:2902581
// Set up our JRegistry object for the HTTP connector
$options = new JRegistry;
// Set the user agent
$options->set('userAgent', 'JInstallation/3.0');
// Use a 120 second timeout
$options->set('timeout', 120);
// Instantiate our JHttp object
@mbabker
mbabker / gist:3211464
Created Jul 30, 2012
Creating a category via component postflight
View gist:3211464
// 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 / fetchController.php
Created Oct 2, 2012
fetchController method for CMS Admin application to find classes using the new MVC paradigm
View fetchController.php
/**
* Method to get a controller object.
*
* @param string $task The task being executed
*
* @return JController
*
* @since x.y
* @throws RuntimeException
*/
@mbabker
mbabker / pagination.php
Created Apr 3, 2013
Joomla methods to render active and inactive pagination objects in the template
View pagination.php
/**
* Renders an active item in the pagination block
*
* @param JPaginationObject $item The current pagination object
*
* @return string HTML markup for active item
*
* @since 3.0
*/
function pagination_item_active(&$item)
View tags.diff
diff --git a/libraries/cms/helper/tags.php b/libraries/cms/helper/tags.php
index 607bc9f..bd6cd35 100644
--- a/libraries/cms/helper/tags.php
+++ b/libraries/cms/helper/tags.php
@@ -20,6 +20,14 @@ defined('JPATH_PLATFORM') or die;
class JHelperTags
{
/**
+ * A list of tag IDs
+ *
View routingDiff
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
@mbabker
mbabker / cms-app
Last active Dec 19, 2015
This is a comparison of the loading time/memory for the legacy JApplication based app classes versus the proposed app classes built on JApplicationWeb.
View cms-app
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.
You can’t perform that action at this time.