<?php
/**
 * @package    Joomla.Cli
 *
 * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

// We are a valid entry point.
const _JEXEC = 1;

// Define the application's minimum supported PHP version as a constant so it can be referenced within the application.
const JOOMLA_MINIMUM_PHP = '7.2.5';

if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<'))
{
	echo 'Sorry, your PHP version is not supported.' . PHP_EOL;
	echo 'Your command line php needs to be version ' . JOOMLA_MINIMUM_PHP . ' or newer to run the Joomla! CLI Tools' . PHP_EOL;
	echo 'The version of PHP currently running this code, at the command line, is PHP version ' . PHP_VERSION . '.' . PHP_EOL;
	echo 'Please note, the version of PHP running your commands here, may be different to the version that is used by ';
	echo 'your web server to run the Joomla! Web Application' . PHP_EOL;

	exit;
}

// Load system defines
if (file_exists(dirname(__DIR__) . '/defines.php'))
{
	require_once dirname(__DIR__) . '/defines.php';
}
if (!defined('_JDEFINES'))
{
	define('JPATH_BASE', dirname(__DIR__));
	require_once JPATH_BASE . '/includes/defines.php';
}

// Get the framework.
require_once JPATH_BASE . '/includes/framework.php';

// Get the framework
//require_once JPATH_LIBRARIES . '/import.legacy.php';

// Bootstrap the CMS libraries
//require_once JPATH_LIBRARIES . '/cms.php';

// Import the configuration
require_once JPATH_CONFIGURATION . '/configuration.php';

// System configuration
$config = new JConfig;
define('JDEBUG', $config->debug);

// Configure error reporting to maximum for CLI output.
error_reporting('E_ALL');
ini_set('display_errors', 1);



use Joomla\CMS\Access\Access;
use Joomla\CMS\Application\AdministratorApplication;
use Joomla\CMS\Application\CliApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Table\Table;
use Joomla\CMS\User\User;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\MediaHelper;


class profuctLoader extends CliАpplication {
	
	public function justSomething() {
		print_r("just something");
		
		$this->out('jdfnbd');
		
		
		$file = 'people.txt';
		// Открываем файл для получения существующего содержимого
		$current = file_get_contents($file);
		// Добавляем нового человека в файл
		$current .= "John Smith\n";
		// Пишем содержимое обратно в файл
		file_put_contents($file, $current);
		
		
	}	
}

CliApplication::getInstance('profuctLoader')->execute();


