Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge joomlatools-plugin into core #134

Merged
merged 2 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/Joomlatools/Console/Command/Connect/token.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* @copyright Copyright (C) 2015 Johan Janssens and Timble CVBA. (http://www.timble.net)
* @license Mozilla Public License, version 2.0
* @link http://github.com/joomlatools/joomla-console for the canonical source repository
*/

namespace JoomlatoolsExtended\Console\Command;

use Joomlatools\Console\Command\Site;
use Joomlatools\Console\Joomla\Bootstrapper;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ConnectToken extends Site\AbstractSite
{
protected function configure()
{
parent::configure();

$this->setName('connect:token')
->setDescription('Generate a JWT token');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
parent::execute($input, $output);

$this->check($input, $output);

Bootstrapper::getApplication($this->target_dir);

$output->writeln(\PlgKoowaConnect::generateToken());
}

public function check(InputInterface $input, OutputInterface $output)
{
if (!file_exists($this->target_dir)) {
throw new \RuntimeException(sprintf('Site not found: %s', $this->site));
}

if (!is_dir($this->target_dir.'/libraries/joomlatools/')) {
throw new \RuntimeException(sprintf('Koowa is not installed on site: %s', $this->site));
}
}
}
19 changes: 18 additions & 1 deletion src/Joomlatools/Console/Command/Extension/Symlink.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,24 @@ class Symlink extends AbstractSite
protected $projects = array();

protected static $_symlinkers = array();
protected static $_dependencies = array();

protected static $_dependencies = array(
'extman' => array('nooku-framework', 'com_files', 'com_activities'), // deprecated

'joomlatools-framework' => array(
'joomlatools-framework-files',
'joomlatools-framework-activities',
'joomlatools-framework-scheduler',
'joomlatools-framework-migrator',
'joomlatools-framework-tags'
),
'docman' => array('joomlatools-framework'),
'fileman' => array('joomlatools-framework'),
'leadman' => array('joomlatools-framework', 'joomlatools-framework-ckeditor'),
'logman' => array('joomlatools-framework'),
'textman' => array('joomlatools-framework', 'joomlatools-framework-ckeditor')
);

protected static $_relative = false;

public static function registerDependencies($project, array $dependencies)
Expand Down
51 changes: 51 additions & 0 deletions src/Joomlatools/Console/Command/Language/key.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* @copyright Copyright (C) 2015 Johan Janssens and Timble CVBA. (http://www.timble.net)
* @license Mozilla Public License, version 2.0
* @link http://github.com/joomlatools/joomla-console for the canonical source repository
*/

namespace JoomlatoolsExtended\Console\Command;

use Joomlatools\Console\Command\Site;
use Joomlatools\Console\Joomla\Bootstrapper;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class LanguageKey extends Site\AbstractSite
{
protected function configure()
{
parent::configure();

$this->setName('language:key')
->setDescription('Generate a language key from the given string')
->addArgument('string', InputArgument::REQUIRED, 'The string');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
parent::execute($input, $output);

$this->check($input, $output);

Bootstrapper::getApplication($this->target_dir);

$catalogue = \KObjectManager::getInstance()->getObject('com://admin/koowa.translator')->getCatalogue();

$output->writeln($catalogue->getPrefix().$catalogue->generateKey($input->getArgument('string')));
}

public function check(InputInterface $input, OutputInterface $output)
{
if (!file_exists($this->target_dir)) {
throw new \RuntimeException(sprintf('Site not found: %s', $this->site));
}

if (!is_dir($this->target_dir.'/libraries/joomlatools/')) {
throw new \RuntimeException(sprintf('Koowa is not installed on site: %s', $this->site));
}
}
}