Skip to content

Instantly share code, notes, and snippets.

@AmyStephen
AmyStephen / AuthorisationService.php
Created April 28, 2012 20:26
Molajo AuthorisationService -- implements ACL for all Cataloged Content (ex. sites, applications, content, extensions, groups, and so on.)
<?php
/**
* @package Molajo
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU General Public License Version 2, or later http://www.gnu.org/licenses/gpl.html
*/
namespace Molajo\Service\Services;
use Molajo\Service\Services;
@AmyStephen
AmyStephen / ModelController.php
Created May 19, 2012 03:48
Molajo ModelController
<?php
/**
* @package Molajo
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU General Public License Version 2, or later http://www.gnu.org/licenses/gpl.html
*/
namespace Molajo\MVC\Controller;
use Molajo\Service\Services\Configuration\ConfigurationService;
use Molajo\Service\Services;
@AmyStephen
AmyStephen / ConfigurationService.php
Created May 19, 2012 04:06
Molajo Configuration Service
<?php
/**
* @package Molajo
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU General Public License Version 2, or later http://www.gnu.org/licenses/gpl.html
*/
namespace Molajo\Service\Services\Configuration;
use Molajo\Application;
use Molajo\Service\Services;
@AmyStephen
AmyStephen / Messages.xml
Created May 19, 2012 13:32
Molajo Data Sources
<?xml version="1.0" encoding="utf-8"?>
<model
name="Messages"
catalog_type_id="0"
table="#__dummy"
primary_key=""
primary_prefix=""
get_customfields="0"
get_item_children="0"
use_special_joins="0"
@AmyStephen
AmyStephen / LanguageServices.php
Created June 11, 2012 01:36
Molajo Language Services
<?php
/**
* @package Molajo
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU General Public License Version 2, or later http://www.gnu.org/licenses/gpl.html
*/
namespace Molajo\Service\Services\Language;
use Molajo\Service\Services;
use Molajo\Extension\Helper\ExtensionHelper;
@AmyStephen
AmyStephen / untested
Created June 29, 2012 12:13
Untested example of how to set/get Session data in Joomla
$session = JFactory::getSession();
$value = $session->get('first_article_found', 0);
if ($value == 0) {
$session->set('first_article_found', 1);
} else {
return;
}
//do your thing.
@AmyStephen
AmyStephen / cacheservice.php
Created July 11, 2012 19:06
Molajo Cache Services
<?php
/**
* @package Molajo
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU GPL v 2, or later and MIT, see License folder
*/
namespace Molajo\Service\Services\Cache;
use Molajo\Service\Services;
@AmyStephen
AmyStephen / list.php
Created August 1, 2012 12:47
To create a .gitignore with a list of all files in Repository
<?php
/**
* @package Molajo
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU GPL v 2, or later and MIT, see License folder
*
* Place in the root of your website - execute it - and copy the results into your .gitignore
*/
$current_path = __DIR__;
@AmyStephen
AmyStephen / mysqli.php
Created November 8, 2012 22:29
Joomla Platform MySQLI DB Driver - overlays error
/**
* Execute the SQL statement.
*
* @return mixed A database cursor resource on success, boolean false on failure.
*
* @since 12.1
* @throws RuntimeException
*/
public function execute()
@AmyStephen
AmyStephen / ExceptionService.php
Created November 28, 2012 19:05
Custom Exception Handler
<?php
/**
* @package Molajo
* @copyright 2012 Individual Molajo Contributors. All rights reserved.
* @license GNU GPL v 2, or later and MIT, see License folder
*/
namespace Molajo\Service\Services\Exception;
use Molajo\Service\Services;
use \Exception;