Created
March 13, 2016 11:59
-
-
Save yvesh/993c4a09f1ac8798b684 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Matukio | |
* @author Yves Hoppe <[email protected]> | |
* @date 07.07.14 | |
* | |
* @copyright Copyright (C) 2008 - 2014 compojoom.com . All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE | |
*/ | |
// We are a valid entry point. | |
const _JEXEC = 1; | |
// Load system defines | |
if (file_exists(dirname(__DIR__) . '/defines.php')) | |
{ | |
require_once dirname(__DIR__) . '/defines.php'; | |
} | |
if (!defined('_JDEFINES')) | |
{ | |
// Define the bath path | |
define('JPATH_BASE', dirname(__DIR__)); | |
require_once JPATH_BASE . '/includes/defines.php'; | |
} | |
// Get the framework. | |
if (file_exists(JPATH_LIBRARIES . '/import.legacy.php')) | |
{ | |
// Joomla 3 | |
require_once JPATH_LIBRARIES . '/import.legacy.php'; | |
} | |
else | |
{ | |
// Joomla 2.5 | |
require_once JPATH_LIBRARIES . '/import.php'; | |
} | |
// Bootstrap the CMS libraries. | |
require_once JPATH_LIBRARIES . '/cms.php'; | |
// Load the configuration | |
require_once JPATH_CONFIGURATION . '/configuration.php'; | |
// Import necessary classes not handled by the autoloaders | |
jimport('joomla.application.menu'); | |
jimport('joomla.environment.uri'); | |
jimport('joomla.event.dispatcher'); | |
jimport('joomla.utilities.utility'); | |
jimport('joomla.utilities.arrayhelper'); | |
jimport('joomla.application.component.helper'); | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
/** | |
* Class MatukioCli | |
* | |
* Cronjobs for various Matukio tasks, should be executed once (!) per day! | |
* | |
* @since 1.5 | |
*/ | |
class Test extends JApplicationCli | |
{ | |
/** | |
* Main entry point for executing the cronjob | |
* | |
* @return void | |
*/ | |
public function doExecute() | |
{ | |
$_SERVER['HTTP_HOST'] = 'domain.com'; | |
JFactory::getApplication('site'); | |
$db =JFactory::getDbo(); | |
$query = $db->getQuery(true); | |
$query->select("*")->from("#__users"); | |
$db->setQuery($query); | |
$this->out(print_r($db->loadObjectList(), true)); | |
$this->out("Allles" ); | |
} | |
} | |
JApplicationCli::getInstance('Test')->execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment