Skip to content

Commit 1ed18a2

Browse files
committed
v102
0 parents  commit 1ed18a2

File tree

488 files changed

+90181
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

488 files changed

+90181
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": [ "env" ]
3+
}

.editorconfig

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 4
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
# TS/JS-Files
16+
[*.{ts,js}]
17+
indent_size = 2
18+
19+
# JSON-Files
20+
[*.json]
21+
indent_style = tab
22+
23+
# ReST-Files
24+
[*.rst]
25+
indent_size = 4
26+
max_line_length = 80
27+
28+
# YAML-Files
29+
[*.{yaml,yml}]
30+
indent_size = 2
31+
32+
# NEON-Files
33+
[*.neon]
34+
indent_size = 2
35+
indent_style = tab
36+
37+
# package.json
38+
[package.json]
39+
indent_size = 2
40+
41+
# TypoScript
42+
[*.{typoscript,tsconfig}]
43+
indent_size = 2
44+
45+
# XLF-Files
46+
[*.xlf]
47+
indent_style = tab
48+
49+
# SQL-Files
50+
[*.sql]
51+
indent_style = tab
52+
indent_size = 2
53+
54+
# .htaccess
55+
[{_.htaccess,.htaccess}]
56+
indent_style = tab

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* text eol=lf
2+
3+
*.png binary
4+
*.jpg binary
5+
*.ttf binary
6+
*.woff binary
7+
*.woff2 binary
8+
*.eot binary
9+
*.otf binary

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*~
2+
*.bak
3+
*.map
4+
.DS_Store
5+
/.idea
6+
/node_modules/
7+
/Resources/Private/MailTemplates/app.css
8+
/.Build/
9+
/composer.lock

.gitlab-ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
image: git.reelworx.net:5001/reelworx/infrastructure/docker-library/php74dev
2+
3+
before_script:
4+
- eval $(ssh-agent -s)
5+
- echo "$SSH_PRIVATE_KEY" | base64 -d | ssh-add -
6+
- echo "$SSH_TYPO3GMBH_PRIVATE_KEY" | base64 -d | ssh-add -
7+
- mkdir -p ~/.ssh
8+
- chmod 700 ~/.ssh
9+
- rm -f ~/.ssh/known_hosts
10+
- ssh-keyscan -H -p 2222 $CI_SERVER_HOST >> ~/.ssh/known_hosts
11+
- ssh-keyscan -H github.com >> ~/.ssh/known_hosts
12+
- chmod 644 ~/.ssh/known_hosts
13+
14+
test:
15+
stage: test
16+
services:
17+
- mysql:5.7
18+
cache:
19+
paths:
20+
- .Build/vendor/
21+
variables:
22+
MYSQL_DATABASE: test_db
23+
MYSQL_ROOT_PASSWORD: mysql_strong_password
24+
typo3DatabaseHost: mysql
25+
typo3DatabaseName: test_db
26+
typo3DatabasePassword: mysql_strong_password
27+
typo3DatabaseUsername: root
28+
before_script:
29+
- composer install --no-ansi --no-progress
30+
script:
31+
- .Build/bin/phpunit --configuration .Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml --colors=never Tests/Unit/
32+
- .Build/bin/phpunit --configuration .Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml --colors=never Tests/Functional/
33+
34+
update_dev:
35+
stage: deploy
36+
only:
37+
- dev
38+
environment:
39+
name: Development
40+
script:
41+
- git clone --branch development --single-branch --no-tags ssh://git@git.reelworx.net:2222/skilldisplay/sitesetup.git
42+
- cd sitesetup/web
43+
- composer update --no-ansi --no-progress -w skilldisplay/skills
44+
- git config user.email "support@reelworx.at"
45+
- git config user.name "gitlab ci"
46+
- git add composer.lock && git commit -m "[TASK] Update skills extension"
47+
- git push
48+
49+
update_staging:
50+
stage: deploy
51+
only:
52+
- staging
53+
environment:
54+
name: Staging
55+
script:
56+
- git clone --branch staging --no-tags ssh://git@git.reelworx.net:2222/skilldisplay/sitesetup.git
57+
- cd sitesetup/web
58+
- git config user.email "support@reelworx.at"
59+
- git config user.name "gitlab ci"
60+
- git merge origin/development
61+
- git push

Classes/AuthenticationException.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace SkillDisplay\Skills;
4+
5+
class AuthenticationException extends \RuntimeException
6+
{
7+
}

Classes/Command/CleanupController.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace SkillDisplay\Skills\Command;
5+
6+
use Symfony\Component\Console\Command\Command;
7+
use Symfony\Component\Console\Input\InputInterface;
8+
use Symfony\Component\Console\Output\OutputInterface;
9+
use TYPO3\CMS\Core\Database\ConnectionPool;
10+
use TYPO3\CMS\Core\Utility\GeneralUtility;
11+
12+
class CleanupController extends Command
13+
{
14+
/**
15+
* Configure the command by defining the name, options and arguments
16+
*/
17+
protected function configure()
18+
{
19+
$this->setDescription('Removes stale _mm records and removes invalid tag_mm records pointing to wrong languages.');
20+
}
21+
22+
protected function execute(InputInterface $input, OutputInterface $output)
23+
{
24+
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME);
25+
26+
$clean_mm_statements = [
27+
'delete FROM `tx_skills_skill_tag_mm` WHERE not exists (select uid from tx_skills_domain_model_skill where uid_local = uid);',
28+
'delete FROM `tx_skills_skill_tag_mm` WHERE not exists (select uid from tx_skills_domain_model_tag where uid_foreign = uid);',
29+
'delete FROM `tx_skills_skill_brand_mm` WHERE not exists (select uid from tx_skills_domain_model_skill where uid_local = uid);',
30+
'delete FROM `tx_skills_skill_brand_mm` WHERE not exists (select uid from tx_skills_domain_model_brand where uid_foreign = uid);',
31+
'delete FROM `tx_skills_skillset_brand_mm` WHERE not exists (select uid from tx_skills_domain_model_skillpath where uid_local = uid);',
32+
'delete FROM `tx_skills_skillset_brand_mm` WHERE not exists (select uid from tx_skills_domain_model_brand where uid_foreign = uid);',
33+
'delete from `tx_skills_skillpath_skill_mm` WHERE not exists (select uid from tx_skills_domain_model_skillpath where uid_local = uid);',
34+
'delete from `tx_skills_skillpath_skill_mm` WHERE not exists (select uid from tx_skills_domain_model_skill where uid_foreign = uid);',
35+
'delete from `tx_skills_skillgroup_skill_mm` WHERE not exists (select uid from tx_skills_domain_model_skillgroup where uid_local = uid);',
36+
'delete from `tx_skills_skillgroup_skill_mm` WHERE not exists (select uid from tx_skills_domain_model_skill where uid_foreign = uid);',
37+
'delete FROM `tx_skills_user_brand_mm` WHERE not exists (select uid from fe_users where uid_local = uid);',
38+
'delete FROM `tx_skills_user_brand_mm` WHERE not exists (select uid from tx_skills_domain_model_brand where uid_foreign = uid);',
39+
'delete FROM `tx_skills_user_certifier_mm` WHERE not exists (select uid from fe_users where uid_local = uid);',
40+
'delete FROM `tx_skills_user_certifier_mm` WHERE not exists (select uid from tx_skills_domain_model_certifier where uid_foreign = uid);',
41+
'delete FROM `tx_skills_user_organisation_mm` WHERE not exists (select uid from fe_users where uid_local = uid);',
42+
'delete FROM `tx_skills_user_organisation_mm` WHERE not exists (select uid from tx_skills_domain_model_brand where uid_foreign = uid);',
43+
'delete FROM `tx_skills_patron_mm` WHERE not exists (select uid from tx_skills_domain_model_brand where uid_local = uid);',
44+
'delete FROM `tx_skills_patron_mm` WHERE not exists (select uid from tx_skills_domain_model_brand where uid_foreign = uid);',
45+
];
46+
foreach ($clean_mm_statements as $statement) {
47+
$connection->exec($statement);
48+
}
49+
50+
// remove all relations from skills to translated tags
51+
$connection->exec('delete tx_skills_skill_tag_mm
52+
FROM tx_skills_skill_tag_mm
53+
join tx_skills_domain_model_skill s on s.uid = tx_skills_skill_tag_mm.uid_local
54+
join tx_skills_domain_model_tag t on t.uid = tx_skills_skill_tag_mm.uid_foreign
55+
where s.sys_language_uid = 0 AND t.sys_language_uid > 0');
56+
return 0;
57+
}
58+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace SkillDisplay\Skills\Command;
5+
6+
use Symfony\Component\Console\Command\Command;
7+
use Symfony\Component\Console\Input\InputInterface;
8+
use Symfony\Component\Console\Output\OutputInterface;
9+
use TYPO3\CMS\Core\Database\ConnectionPool;
10+
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
11+
use TYPO3\CMS\Core\Utility\GeneralUtility;
12+
13+
class DomainTagController extends Command
14+
{
15+
/**
16+
* Configure the command by defining the name, options and arguments
17+
*/
18+
protected function configure()
19+
{
20+
$this->setDescription('Set all tags as domain tag if they are currently used as domain tag');
21+
}
22+
23+
protected function execute(InputInterface $input, OutputInterface $output)
24+
{
25+
/** @var QueryBuilder $qb */
26+
$qb = GeneralUtility::makeInstance(ConnectionPool::class)
27+
->getQueryBuilderForTable('tx_skills_domain_model_tag');
28+
29+
$qb
30+
->update('tx_skills_domain_model_tag')
31+
->set('domain_tag', 1)
32+
->where(
33+
$qb->expr()->in(
34+
'uid',
35+
'select domain_tag from tx_skills_domain_model_skill where domain_tag > 0 group by domain_tag'
36+
)
37+
)
38+
->execute();
39+
return 0;
40+
}
41+
}

Classes/Command/ExportController.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace SkillDisplay\Skills\Command;
5+
6+
use SkillDisplay\Skills\Service\Importer\ExportService;
7+
use Symfony\Component\Console\Command\Command;
8+
use Symfony\Component\Console\Input\InputArgument;
9+
use Symfony\Component\Console\Input\InputInterface;
10+
use Symfony\Component\Console\Input\InputOption;
11+
use Symfony\Component\Console\Output\OutputInterface;
12+
use TYPO3\CMS\Core\Utility\GeneralUtility;
13+
use TYPO3\CMS\Extbase\Object\ObjectManager;
14+
15+
class ExportController extends Command
16+
{
17+
/**
18+
* Configure the command by defining the name, options and arguments
19+
*/
20+
protected function configure()
21+
{
22+
$this
23+
->setDescription('Export a given list of SkillSets to a file')
24+
->addArgument(
25+
'skillSets',
26+
InputArgument::REQUIRED | InputArgument::IS_ARRAY,
27+
'Specify the list of SkillSet UIDs to export'
28+
)
29+
->addOption(
30+
'output',
31+
null,
32+
InputOption::VALUE_REQUIRED,
33+
'Specify the target file name',
34+
'skillsets.json'
35+
)
36+
->addUsage('--output=skillsets_demo.json 1 2 4');
37+
}
38+
39+
/**
40+
* Executes the command for adding the lock file
41+
*
42+
* @param InputInterface $input
43+
* @param OutputInterface $output
44+
*/
45+
protected function execute(InputInterface $input, OutputInterface $output)
46+
{
47+
$skillSets = $input->getArgument('skillSets');
48+
$targetFileName = $input->getOption('output');
49+
$exportService = GeneralUtility::makeInstance(ObjectManager::class)->get(ExportService::class);
50+
$exportService->doExport($targetFileName, $skillSets);
51+
return 0;
52+
}
53+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php declare(strict_types=1);
2+
3+
/**
4+
*
5+
* This file is part of the "Skills" Extension for TYPO3 CMS.
6+
*
7+
* For the full copyright and license information, please read the
8+
* LICENSE.txt file that was distributed with this source code.
9+
*
10+
* (c) 2020 Johannes Kasberger <support@reelworx.at>, Reelworx GmbH
11+
*
12+
**/
13+
14+
namespace SkillDisplay\Skills\Command;
15+
16+
use SkillDisplay\Skills\Service\GuestUserCleanupService;
17+
use Symfony\Component\Console\Command\Command;
18+
use Symfony\Component\Console\Input\InputInterface;
19+
use Symfony\Component\Console\Output\OutputInterface;
20+
21+
class GuestUserController extends Command
22+
{
23+
/**
24+
* Configure the command by defining the name, options and arguments
25+
*/
26+
protected function configure()
27+
{
28+
$this->setDescription('Cleanup old guest users');
29+
}
30+
31+
/**
32+
* @param InputInterface $input
33+
* @param OutputInterface $output
34+
* @return int|void
35+
* @throws \Exception
36+
*/
37+
protected function execute(InputInterface $input, OutputInterface $output)
38+
{
39+
(new GuestUserCleanupService())->run();
40+
return 0;
41+
}
42+
}

0 commit comments

Comments
 (0)