...
 
Commits (8)
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# CSS-Files
[*.css]
indent_style = space
indent_size = 4
# HTML-Files
[*.html]
indent_style = space
indent_size = 4
# TMPL-Files
[*.tmpl]
indent_style = space
indent_size = 4
# SCSS-Files
[*.scss]
indent_style = space
indent_size = 4
# JS-Files
[*.js]
indent_style = space
indent_size = 4
# JSON-Files
[*.json]
indent_style = space
indent_size = 4
# PHP-Files
[*.php]
indent_style = space
indent_size = 4
# ReST-Files
[*.rst]
indent_style = space
indent_size = 3
# MD-Files
[*.md]
indent_style = space
indent_size = 4
# YAML-Files
[{*.yaml,*.yml}]
indent_style = space
indent_size = 2
# package.json
# .travis.yml
# bower.json
[{package.json,.travis.yml,bower.json}]
indent_style = space
indent_size = 4
# TypoScript
[*.ts]
indent_style = space
indent_size = 4
[*.typoscript]
indent_style = space
indent_size = 4
# XLF-Files
[*.xlf]
indent_style = space
indent_size = 4
# SQL-Files
[*.sql]
indent_style = space
indent_size = 2
This diff is collapsed.
......@@ -19,7 +19,7 @@
},
"license": "GPL-2.0+",
"require": {
"typo3/cms-core": ">= 8.7.0, <= 8.7.99"
"typo3/cms-core": "^8.7 || ^9.5"
},
"autoload": {
"psr-4": {
......
......@@ -24,6 +24,7 @@ class ExtensionController
{
/**
* TODO: Do we still need this?
* @var \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected $databaseConnection;
......
......@@ -15,6 +15,8 @@ namespace T3o\TerFe2\Controller;
*/
use T3o\TerFe2\Validation\Validator\ComposerNameValidator;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Controller for the extension object
......@@ -579,23 +581,28 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
/**
* Check if current frontend user can upload given extension
*
* There is no better (and faster) way to do this at the momement.
* There is no better (and faster) way to do this at the moment.
*
* @param string $extensionKey The extension key
* @return bool TRUE if upload is allowed
*/
protected function userIsAllowedToUploadExtension($extensionKey)
protected function userIsAllowedToUploadExtension($extensionKey): bool
{
$this->frontendUser = (!empty($GLOBALS['TSFE']->fe_user->user) ? $GLOBALS['TSFE']->fe_user->user : []);
if (empty($this->frontendUser['username'])) {
return false;
}
$isAllowedToUploadKey = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_ter_extensionkeys');
$isAllowedToUploadKey = $connection->count(
'uid',
'tx_ter_extensionkeys',
'ownerusername LIKE "' . $GLOBALS['TYPO3_DB']->quoteStr($this->frontendUser['username'], 'foo') . '"
AND extensionkey LIKE "' . $GLOBALS['TYPO3_DB']->quoteStr($extensionKey, 'foo') . '"'
[
'ownerusername' => $this->frontendUser['username'],
'extensionkey' => $extensionKey
]
);
return !empty($isAllowedToUploadKey);
}
......@@ -614,24 +621,31 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
/**
* Check if an version does not exist for extension
*
* There is no better (and faster) way to do this at the momement.
* There is no better (and faster) way to do this at the moment.
*
* @param string $extensionKey The extension key
* @param string $versionString The extension version
* @return bool TRUE if version already exists
*
* TODO: Discuss with Thomas, logic looks incorrect with naming and return value.
*/
protected function versionIsPossibleForExtension($extensionKey, $versionString)
{
if (empty($extensionKey) || empty($versionString)) {
return false;
}
$versionExistsForExtension = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_ter_extensions');
$versionExistsForExtension = $connection->count(
'uid',
'tx_ter_extensions',
'extensionkey = "' . $GLOBALS['TYPO3_DB']->quoteStr($extensionKey, 'foo') . '"
AND version LIKE "' . $GLOBALS['TYPO3_DB']->quoteStr($versionString, 'foo') . '"'
[
'extensionkey' => $extensionKey,
'version' => $versionString
]
);
return empty($versionExistsForExtension);
return $versionExistsForExtension;
}
/**
......
......@@ -107,6 +107,19 @@ class ExtensionRepository extends \T3o\TerFe2\Domain\Repository\AbstractReposito
return $query->execute()->getFirst();
}
/**
* Returns extension by extension key
*
* @param $extensionKey
* @return int
*/
public function countByExtKey($extensionKey)
{
$query = $this->createQuery(0, 1);
$this->match($query, $query->equals('extKey', $extensionKey));
return $query->execute()->count();
}
/**
* Returns new and updated extensions
*
......
......@@ -14,6 +14,8 @@ namespace T3o\TerFe2\Provider;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Abstract extension provider
*/
......@@ -123,7 +125,7 @@ abstract class AbstractProvider implements \T3o\TerFe2\Provider\ProviderInterfac
*/
protected function getVersionByRange($version)
{
$version = \TYPO3\CMS\Extbase\Utility\ArrayUtility::trimExplode('-', $version);
$version = GeneralUtility::trimExplode('-', $version);
$minimum = (!empty($version[0]) ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version[0]) : 0);
$maximum = (!empty($version[1]) ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version[1]) : 0);
......
......@@ -219,7 +219,7 @@ class MirrorService implements \TYPO3\CMS\Core\SingletonInterface
$url = \T3o\TerFe2\Utility\FileUtility::getAbsolutePathFromUrl($url);
$content = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($url);
} else {
$content = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($url, 0, [TYPO3_user_agent]);
$content = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($url, 0, $GLOBALS['TYPO3_CONF_VARS']['HTTP']['headers']['User-Agent']);
}
if (empty($content)) {
......
......@@ -15,6 +15,7 @@ namespace T3o\TerFe2\Solr\IndexQueue;
*/
use ApacheSolrForTypo3\Solr\IndexQueue\Item;
use ApacheSolrForTypo3\Solr\System\Solr\Document\Document;
use T3o\TerFe2\Utility\VersionUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
......@@ -55,14 +56,14 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer
*
* @param Item $item An index queue item
* @param int $language Language Id
* @return \Apache_Solr_Document The Solr document converted from the record
* @return \ApacheSolrForTypo3\Solr\System\Solr\Document\Document The Solr document converted from the record
*/
protected function itemToDocument(Item $item, $language = 0)
protected function itemToDocument(Item $item, $language = 0): Document
{
$document = null;
$itemRecord = $this->getFullItemRecord($item, $language);
if (!is_null($itemRecord)) {
if ($itemRecord !== null) {
$itemIndexingConfiguration = $this->getItemTypeConfiguration(
$item,
$language
......@@ -77,11 +78,11 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer
}
/**
* @param \Apache_Solr_Document $document
* @param \ApacheSolrForTypo3\Solr\System\Solr\Document\Document $document
* @param array $itemRecord
* @return \Apache_Solr_Document
* @return \ApacheSolrForTypo3\Solr\System\Solr\Document\Document
*/
public function addSpecialFields(\Apache_Solr_Document $document, array $itemRecord)
public function addSpecialFields(Document $document, array $itemRecord): Document
{
$extension = $this->extensionRepository->findByUid($itemRecord['uid']);
......
......@@ -14,6 +14,13 @@ namespace T3o\TerFe2\Task;
* The TYPO3 project - inspiring people to share!
*/
use T3o\TerFe2\Domain\Model\Extension;
use T3o\TerFe2\Domain\Repository\ExtensionRepository;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository;
/**
* This is a one-time task to get all extension keys from ter tables
* to the new ter_fe2 tables.
......@@ -31,6 +38,24 @@ class ImportAllExtensionKeysTask extends \TYPO3\CMS\Extbase\Scheduler\Task
*/
protected $pid = 2;
/**
* @var ObjectManager
*/
protected $objectManager;
/**
* @var ExtensionRepository
*/
protected $extensionRepository;
/**
* @param ObjectManager $objectManager
*/
protected function injectObjectManager(ObjectManager $objectManager)
{
$this->objectManager = $objectManager;
}
/**
* executes the importer
*
......@@ -38,6 +63,7 @@ class ImportAllExtensionKeysTask extends \TYPO3\CMS\Extbase\Scheduler\Task
*/
public function execute()
{
$this->extensionRepository = $this->objectManager->get(RepositoryRepository::class);
$extensionKeysFromTer = $this->getAllExtensionKeysFromTer();
foreach ($extensionKeysFromTer as $extensionData) {
......@@ -59,31 +85,35 @@ class ImportAllExtensionKeysTask extends \TYPO3\CMS\Extbase\Scheduler\Task
*/
public function getAllExtensionKeysFromTer(): array
{
$extData = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
'tx_ter_extensionkeys',
'',
false,
'crdate'
$extData = [];
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_ter_extensionkeys');
$result = $connection->select(
['*'],
'tx_ter_extensionkeys'
);
while ($row = $result->fetch()) {
$extData[] = $row;
}
return $extData;
}
/**
* @param array $extData
*
* @return int $uid extension uid
* @return bool|int
* @deprecated Will be removed June 2020
*/
public function extensionExists($extData)
{
$extRec = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
'uid',
'tx_terfe2_domain_model_extension',
'NOT deleted AND ext_key = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($extData['extensionkey'], 'tx_terfe2_domain_model_extension')
);
$extensionRepository = $this->objectManager->get(ExtensionRepository::class);
$extension = $extensionRepository->findOneByExtKey($extData['extensionkey']);
return !empty($extRec);
if ($extension instanceof Extension) {
return $extension->getUid();
}
return false;
}
/**
......@@ -92,13 +122,8 @@ class ImportAllExtensionKeysTask extends \TYPO3\CMS\Extbase\Scheduler\Task
*/
public function getVersionCount($extensionKey)
{
$versionCounter = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
'uid',
'tx_ter_extensions',
'extensionkey = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($extensionKey, 'tx_ter_extensions')
);
return (int)$versionCounter;
$extensionRepository = $this->objectManager->get(ExtensionRepository::class);
return $extensionRepository->countByExtKey($extensionKey);
}
/**
......@@ -118,6 +143,10 @@ class ImportAllExtensionKeysTask extends \TYPO3\CMS\Extbase\Scheduler\Task
];
$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_terfe2_domain_model_extension', $insertExtension);
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_terfe2_domain_model_extension');
$connection->insert(
'tx_terfe2_domain_model_extension',
$insertExtension
);
}
}
......@@ -520,7 +520,7 @@ $EM_CONF[$_EXTKEY] = ' . self::arrayToCode($emConfArray, 0) . ';
} elseif (strlen($k)) {
$lines .= str_repeat(TAB, $level) . "'" . $k . "' => "
. (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($v) ? intval($v) : "'"
. \TYPO3\CMS\Core\Utility\GeneralUtility::slashJS(trim($v), 1) . "'") . ',' . LF;
. str_replace('\\', '\\\\', trim($v))) . ',' . LF;
}
}
......
......@@ -47,7 +47,7 @@ class ArrayAssurer extends \PhpParser\NodeVisitorAbstract
}
}
// We must not have another assignment
throw new \UnexpectedValueException();
return \PhpParser\NodeTraverser::REMOVE_NODE;
}
if (!(
$node instanceof Node\Name
......@@ -57,9 +57,10 @@ class ArrayAssurer extends \PhpParser\NodeVisitorAbstract
|| $node instanceof Expr\ArrayItem
|| $node instanceof Expr\ConstFetch
|| $node instanceof Expr\Variable
|| $node instanceof Node\Stmt\Expression
)
) {
return false;
return \PhpParser\NodeTraverser::REMOVE_NODE;
}
}
}
......@@ -16,7 +16,7 @@ return [
'enablecolumns' => [
'disabled' => 'hidden'
],
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Icons/author.gif',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('ter_fe2') . 'Resources/Public/Icons/author.gif',
],
'interface' => [
'showRecordFieldList' => 'name,email,company,forge_link,username,versions,frontend_user,author_type',
......
......@@ -16,7 +16,7 @@ return [
'enablecolumns' => [
'disabled' => 'hidden'
],
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Icons/extension.gif',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('ter_fe2') . 'Resources/Public/Icons/extension.gif',
],
'interface' => [
'showRecordFieldList' => 'ext_key,forge_link,last_update,last_maintained,tags,versions,last_version,frontend_user,downloads,composer_name,repository_url,paypal_url,external_manual,expire',
......
......@@ -16,7 +16,7 @@ return [
'enablecolumns' => [
'disabled' => 'hidden'
],
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Icons/relation.gif',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('ter_fe2') . 'Resources/Public/Icons/relation.gif',
],
'interface' => [
'showRecordFieldList' => 'relation_type,relation_key,minimum_version,maximum_version',
......
......@@ -16,7 +16,7 @@ return [
'enablecolumns' => [
'disabled' => 'hidden'
],
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Icons/tag.gif',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('ter_fe2') . 'Resources/Public/Icons/tag.gif',
],
'interface' => [
'showRecordFieldList' => 'title,extensions',
......
......@@ -18,7 +18,7 @@ return [
'enablecolumns' => [
'disabled' => 'hidden'
],
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Icons/version.gif',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('ter_fe2') . 'Resources/Public/Icons/version.gif',
],
'interface' => [
'showRecordFieldList' => 'title,description,version_number,version_string,upload_date,upload_comment,download_counter,frontend_download_counter,state,em_category,load_order,priority,shy,internal,do_not_load_in_fe,uploadfolder,clear_cache_on_load,module,create_dirs,modify_tables,lock_type,cgl_compliance,cgl_compliance_note,review_state,manual,has_manual,software_relations,author,file_hash,extension_provider,has_zip_file,has_images,composer_info',
......
plugin {
tx_solr {
solr {
host = solr
port = 8983
path = solr/t3o/
}
index {
queue {
ter_extension = 1
ter_extension.table = tx_terfe2_domain_model_extension
ter_extension.additionalWhereClause = last_version > 0
ter_extension.indexer = T3o\TerFe2\Solr\IndexQueue\TerIndexer
ter_extension.fields {
setRegister_ignored = LOAD_REGISTER
setRegister_ignored {
extensionVersion.cObject = SOLR_RELATION
extensionVersion.cObject {
localField = last_version
foreignLabelField = version_string
}
extensionKey.cObject = TEXT
extensionKey.cObject.field = ext_key
extensionState.cObject = SOLR_RELATION
extensionState.cObject {
localField = last_version
foreignLabelField = state
}
}
author = SOLR_CONTENT
author {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = author
}
}
title = SOLR_CONTENT
title {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = title
}
}
sortTitle_stringS = SOLR_CONTENT
sortTitle_stringS {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = title
}
}
content = SOLR_CONTENT
content {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = description
}
}
url = TEXT
url {
typolink.parameter = {$plugin.tx_solr.ter_detailpage}
typolink.additionalParams = &tx_terfe2_pi1[controller]=Extension&tx_terfe2_pi1[action]=show&tx_terfe2_pi1[extension]={field:uid}
typolink.additionalParams.insertData = 1
typolink.useCacheHash = 1
typolink.returnLast = url
}
extensionKey_textS = ext_key
extensionKey_stringS = ext_key
extensionVersion_stringS = TEXT
extensionVersion_stringS {
value = {register:extensionVersion}
insertData = 1
}
extensionState_stringS = TEXT
extensionState_stringS {
value = n/a
override {
data = register:extensionState
if {
isInList.data = register:extensionState
value = alpha,beta,stable,test,experimental,obsolete
}
}
}
extensionLastUpload_intS = SOLR_RELATION
extensionLastUpload_intS {
localField = last_version
foreignLabelField = upload_date
}
extensionLastUpload_tDateS = TEXT
extensionLastUpload_tDateS {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = upload_date
}
date = Y-m-d\TH:i:s\Z
}
extensionDownloads_intS = downloads
extensionDownloadZipUrl_stringS = TEXT
extensionDownloadZipUrl_stringS {
typolink.parameter = {$plugin.tx_solr.ter_detailpage}
typolink.additionalParams = &tx_terfe2_pi1[controller]=Extension&tx_terfe2_pi1[action]=download&tx_terfe2_pi1[extension]={field:uid}&tx_terfe2_pi1[versionString]={register:extensionVersion}&tx_terfe2_pi1[format]=zip
typolink.additionalParams.insertData = 1
typolink.useCacheHash = 1
typolink.returnLast = url
}
keywords = SOLR_RELATION
keywords {
localField = tags
multiValue = 1
}
keywords_stringM = SOLR_RELATION
keywords_stringM {
localField = tags
multiValue = 1
}
}
}
}
search {
query {
// qf parameter http://wiki.apache.org/solr/DisMaxQParserPlugin#qf_.28Query_Fields.29
queryFields = extensionKey_stringS^200.0, extensionKey_textS^1.0, keywords^55.0, title^50.0, content^20.0, author_textWstM^1.0
boostQuery = outdated_boolS:"0"^500
sortBy = extensionLastUpload_tDateS desc
}
}
}
}
[globalVar = GP:tx_solr|q =]
[else]
plugin.tx_solr.search.query.sortBy =
[global]
plugin {
tx_solr {
solr {
host = solr
port = 8983
path = solr/t3o/
}
index {
queue {
ter_extension = 1
ter_extension.table = tx_terfe2_domain_model_extension
ter_extension.additionalWhereClause = last_version > 0
ter_extension.indexer = T3o\TerFe2\Solr\IndexQueue\TerIndexer
ter_extension.fields {
setRegister_ignored = LOAD_REGISTER
setRegister_ignored {
extensionVersion.cObject = SOLR_RELATION
extensionVersion.cObject {
localField = last_version
foreignLabelField = version_string
}
extensionKey.cObject = TEXT
extensionKey.cObject.field = ext_key
extensionState.cObject = SOLR_RELATION
extensionState.cObject {
localField = last_version
foreignLabelField = state
}
}
author = SOLR_CONTENT
author {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = author
}
}
title = SOLR_CONTENT
title {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = title
}
}
sortTitle_stringS = SOLR_CONTENT
sortTitle_stringS {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = title
}
}
content = SOLR_CONTENT
content {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = description
}
}
url = TEXT
url {
typolink.parameter = {$plugin.tx_solr.ter_detailpage}
typolink.additionalParams = &tx_terfe2_pi1[controller]=Extension&tx_terfe2_pi1[action]=show&tx_terfe2_pi1[extension]={field:uid}
typolink.additionalParams.insertData = 1
typolink.useCacheHash = 1
typolink.returnLast = url
}
extensionKey_textS = ext_key
extensionKey_stringS = ext_key
extensionVersion_stringS = TEXT
extensionVersion_stringS {
value = {register:extensionVersion}
insertData = 1
}
extensionState_stringS = TEXT
extensionState_stringS {
value = n/a
override {
data = register:extensionState
if {
isInList.data = register:extensionState
value = alpha,beta,stable,test,experimental,obsolete
}
}
}
extensionLastUpload_intS = SOLR_RELATION
extensionLastUpload_intS {
localField = last_version
foreignLabelField = upload_date
}
extensionLastUpload_tDateS = TEXT
extensionLastUpload_tDateS {
cObject = SOLR_RELATION
cObject {
localField = last_version
foreignLabelField = upload_date
}
date = Y-m-d\TH:i:s\Z
}
extensionDownloads_intS = downloads
extensionDownloadZipUrl_stringS = TEXT
extensionDownloadZipUrl_stringS {
typolink.parameter = {$plugin.tx_solr.ter_detailpage}
typolink.additionalParams = &tx_terfe2_pi1[controller]=Extension&tx_terfe2_pi1[action]=download&tx_terfe2_pi1[extension]={field:uid}&tx_terfe2_pi1[versionString]={register:extensionVersion}&tx_terfe2_pi1[format]=zip
typolink.additionalParams.insertData = 1
typolink.useCacheHash = 1
typolink.returnLast = url
}
keywords = SOLR_RELATION
keywords {
localField = tags
multiValue = 1
}
keywords_stringM = SOLR_RELATION
keywords_stringM {
localField = tags
multiValue = 1
}
}
}
}
search {
query {
// qf parameter http://wiki.apache.org/solr/DisMaxQParserPlugin#qf_.28Query_Fields.29
queryFields = extensionKey_stringS^200.0, extensionKey_textS^1.0, keywords^55.0, title^50.0, content^20.0, author_textWstM^1.0
boostQuery = outdated_boolS:"0"^500
sortBy = extensionLastUpload_tDateS desc
}
}
}
}
[globalVar = GP:tx_solr|q =]
[else]
plugin.tx_solr.search.query.sortBy =
[global]
......@@ -2,6 +2,6 @@
# JSON output configuration ot the extension "ter_fe2"
# ======================================================================
plugin.tx_terfe2.jsonOutput {
# cat=TER Frontend - JSON/json/100; type=int+; label=Type number of the JSON page object
typeNum = 95832
}
\ No newline at end of file
# cat=TER Frontend - JSON/json/100; type=int+; label=Type number of the JSON page object
typeNum = 95832
}
......@@ -2,19 +2,19 @@
# JSON output configuration ot the extension "ter_fe2"
# ======================================================================
plugin.tx_terfe2.settings.jsonOutput {
typeNum = {$plugin.tx_terfe2.jsonOutput.typeNum}
typeNum = {$plugin.tx_terfe2.jsonOutput.typeNum}
}
jsonOutput = PAGE
jsonOutput {
typeNum = {$plugin.tx_terfe2.jsonOutput.typeNum}
typeNum = {$plugin.tx_terfe2.jsonOutput.typeNum}
10 =< tt_content.list.20.terfe2_pi1
10 =< tt_content.list.20.terfe2_pi1
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/json
xhtml_cleaning = 0
admPanel = 0
}
}
\ No newline at end of file
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/json
xhtml_cleaning = 0
admPanel = 0
}
}
......@@ -2,36 +2,36 @@
# RSS output configuration ot the extension "ter_fe2"
# ======================================================================
plugin.tx_terfe2.rssOutput {
# cat=TER Frontend - RSS/rss/100; type=int+; label=Type number of the RSS page object
typeNum = 837
# cat=TER Frontend - RSS/rss/100; type=int+; label=Type number of the RSS page object
typeNum = 837
# cat=TER Frontend - RSS/rss/110; type=string; label=Title of the RSS feed
title = TYPO3 - Latest 50 extensions
# cat=TER Frontend - RSS/rss/110; type=string; label=Title of the RSS feed
title = TYPO3 - Latest 50 extensions
# cat=TER Frontend - RSS/rss/120; type=string; label=Link to website
link = http://extensions.typo3.org/
# cat=TER Frontend - RSS/rss/120; type=string; label=Link to website
link = http://extensions.typo3.org/
# cat=TER Frontend - RSS/rss/130; type=string; label=Description
description = latest 50 extensions on extensions.typo3.org
# cat=TER Frontend - RSS/rss/130; type=string; label=Description
description = latest 50 extensions on extensions.typo3.org
# cat=TER Frontend - RSS/rss/140; type=string; label=Language
language = en
# cat=TER Frontend - RSS/rss/140; type=string; label=Language
language = en
# cat=TER Frontend - RSS/rss/150; type=string; label=Small image
image =
# cat=TER Frontend - RSS/rss/150; type=string; label=Small image
image =
# cat=TER Frontend - RSS/rss/160; type=int+; label=Image width
imageWidth =
# cat=TER Frontend - RSS/rss/160; type=int+; label=Image width
imageWidth =
# cat=TER Frontend - RSS/rss/170; type=int+; label=Image height
imageHeight =
# cat=TER Frontend - RSS/rss/170; type=int+; label=Image height
imageHeight =
# cat=TER Frontend - RSS/rss/180; type=string; label=RSS documentation
docs = http://blogs.law.harvard.edu/tech/rss
# cat=TER Frontend - RSS/rss/180; type=string; label=RSS documentation
docs = http://blogs.law.harvard.edu/tech/rss
# cat=TER Frontend - RSS/rss/190; type=string; label=Webmaster email address
webmaster =
# cat=TER Frontend - RSS/rss/190; type=string; label=Webmaster email address
webmaster =
# cat=TER Frontend - RSS/rss/200; type=string; label=Date format
dateFormat = D, j M Y H:i:s O
# cat=TER Frontend - RSS/rss/200; type=string; label=Date format
dateFormat = D, j M Y H:i:s O
}
......@@ -2,53 +2,53 @@
# RSS output configuration ot the extension "ter_fe2"
# ======================================================================
plugin.tx_terfe2.settings.rss.channel {
typeNum = {$plugin.tx_terfe2.rssOutput.typeNum}
title = {$plugin.tx_terfe2.rssOutput.title}
link = {$plugin.tx_terfe2.rssOutput.link}
description = {$plugin.tx_terfe2.rssOutput.description}
language = {$plugin.tx_terfe2.rssOutput.language}
image = {$plugin.tx_terfe2.rssOutput.image}
imageWidth = {$plugin.tx_terfe2.rssOutput.imageWidth}
imageHeight = {$plugin.tx_terfe2.rssOutput.imageHeight}
docs = {$plugin.tx_terfe2.rssOutput.docs}
webmaster = {$plugin.tx_terfe2.rssOutput.webmaster}
dateFormat = {$plugin.tx_terfe2.rssOutput.dateFormat}
typeNum = {$plugin.tx_terfe2.rssOutput.typeNum}
title = {$plugin.tx_terfe2.rssOutput.title}
link = {$plugin.tx_terfe2.rssOutput.link}
description = {$plugin.tx_terfe2.rssOutput.description}
language = {$plugin.tx_terfe2.rssOutput.language}
image = {$plugin.tx_terfe2.rssOutput.image}
imageWidth = {$plugin.tx_terfe2.rssOutput.imageWidth}
imageHeight = {$plugin.tx_terfe2.rssOutput.imageHeight}
docs = {$plugin.tx_terfe2.rssOutput.docs}
webmaster = {$plugin.tx_terfe2.rssOutput.webmaster}
dateFormat = {$plugin.tx_terfe2.rssOutput.dateFormat}
}
[globalVar = TSFE:type = {$plugin.tx_terfe2.rssOutput.typeNum}]
config {
disableAllHeaderCode = 1
xhtml_cleaning = none
admPanel = 0
debug = 0
disablePrefixComment = 1
metaCharset = utf-8
additionalHeaders.10.header = Content-Type:application/rss+xml;charset=utf-8
absRefPrefix = {$plugin.tx_terfe2.rssOutput.link}
}
config {
disableAllHeaderCode = 1
xhtml_cleaning = none
admPanel = 0
debug = 0
disablePrefixComment = 1
metaCharset = utf-8
additionalHeaders.10.header = Content-Type:application/rss+xml;charset=utf-8
absRefPrefix = {$plugin.tx_terfe2.rssOutput.link}
}
terRss = PAGE
terRss {
typeNum = {$plugin.tx_terfe2.rssOutput.typeNum}
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = T3o
extensionName = TerFe2
pluginName = Pi1
controller = Extension
switchableControllerActions {
Extension {
1 = listLatest
}
}
terRss = PAGE
terRss {
typeNum = {$plugin.tx_terfe2.rssOutput.typeNum}
10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = T3o
extensionName = TerFe2
pluginName = Pi1
controller = Extension
switchableControllerActions {
Extension {
1 = listLatest
}
}
settings < plugin.tx_terfe2.settings
settings {
limit = 50
detailPid = {$plugin.tx_terfe2.settings.pages.extensionDetailPID}
startingpoint = {$plugin.tx_terfe2.persistence.storagePid}
}
}
settings < plugin.tx_terfe2.settings
settings {
limit = 50
detailPid = {$plugin.tx_terfe2.settings.pages.extensionDetailPID}
startingpoint = {$plugin.tx_terfe2.persistence.storagePid}
}
}
}
[global]
......@@ -73,10 +73,9 @@ class ArchiveUtilityTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
/**
* @test
*/
public function extractEmConfReturnsSaveArrayOnlyForInvalidNodeFunction()
public function extractEmConfReturnsNullForInvalidNodeFunction()
{
$code = '<?php $EM_CONF[$_EXTKEY] = array(\'bar\' => \'baz\'); function foo() {} ?>';
$expected = ['bar' => 'baz'];
$subject = $this->getAccessibleMock(
\T3o\TerFe2\Utility\ArchiveUtility::class,
......@@ -84,8 +83,7 @@ class ArchiveUtilityTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
);
$emConf = $subject->_call('extractEmConf', $code);
$this->assertNotNull($emConf);
$this->assertSame($expected, $emConf);
$this->assertNull($emConf);
}
/**
......
......@@ -19,7 +19,7 @@
},
"license": "GPL-2.0+",
"require": {
"typo3/cms-core": ">= 8.7.0, <= 8.7.99"
"typo3/cms-core": "^8.7 || ^9.5"
},
"autoload": {
"psr-4": {
......
......@@ -30,7 +30,7 @@ call_user_func(function () {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
mod.wizards.newContentElement.wizardItems.special {\n
elements.' . $extIdent . ' {\n
icon = ' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Images/Wizard.gif\n
icon = ' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('ter_fe2') . 'Resources/Public/Images/Wizard.gif\n
title = LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xlf:newContentElement.wizardItem.title\n
description = LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xlf:newContentElement.wizardItem.description\n\n
tt_content_defValues {\n
......
config {
doctype = html5
absRefPrefix = /
language = en
locale_all = en_US
tx_realurl_enable = 1
compressCss = 1
compressJs = 1
concatenateCss = 1
concatenateJs = 1
}
\ No newline at end of file
......@@ -16,5 +16,13 @@ plugin.tx_ter_pi1.pid = 2
# wsdl Namespace for the soap server
plugin.tx_ter_pi1.wsdlNamespace = https://extensions.typo3.org/wsdl/tx_ter/
[applicationContext = Production/Stage]
plugin.tx_ter_pi1.wsdlNamespace = https://extensions-stage.typo3.org/wsdl/tx_ter/
plugin.tx_ter_pi1.wsdlNamespace = https://extensions-stage.typo3.org/wsdl/tx_ter/
[global]
plugin.tx_solr {
view {
templateRootPath = EXT:ter_layout/Resources/Private/Templates/Solr/
partialRootPath = EXT:ter_layout/Resources/Private/Partials/Solr/
layoutRootPath = EXT:ter_layout/Resources/Private/Layouts/Solr/
}
}
......@@ -4,5 +4,5 @@
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ter/resources/static/setup.txt">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ter_fe2/Configuration/TypoScript/Default/setup.txt">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ter_layout/Configuration/TypoScript/Page.ts">
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:ter_layout/Configuration/TypoScript/Ext/" extensions="ts">
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:ter_layout/Configuration/TypoScript/Page.typoscript">
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:ter_layout/Configuration/TypoScript/Ext/" extensions="typoscript">
page {
headerData {
1501157682 = TEXT
1501157682.value(
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setVisitorCookieTimeout', '2592000']);
_paq.push(['setSessionCookieTimeout', '0']);
_paq.push(['setDoNotTrack', true]);
(function() {
var u="//piwik.typo3.org/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '38']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src=//piwik.typo3.org/piwik.php?idsite=39&rec=1” style=“border:0;” alt=“” /></p></noscript>
<!-- End Piwik Code -->
)
}
}
page {
headerData {
1501157682 = TEXT
1501157682.value (
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['setVisitorCookieTimeout', '2592000']);
_paq.push(['setSessionCookieTimeout', '0']);
_paq.push(['setDoNotTrack', true]);
(function() {
var u="//piwik.typo3.org/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '38']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src=“//piwik.typo3.org/piwik.php?idsite=39&rec=1” style=“border:0;” alt=“” /></p></noscript>
<!-- End Piwik Code -->
)
}
}
plugin.tx_solr {
view {
layoutRootPaths {
0 = EXT:solr/Resources/Private/Layouts
}
partialRootPaths {
0 = EXT:solr/Resources/Private/Partials
100 = EXT:ter_layout/Resources/Private/Partials/Solr/
}
templateRootPaths {
0 = EXT:solr/Resources/Private/Templates
100 = EXT:ter_layout/Resources/Private/Templates/Solr/
}
}
cssFiles.results =
settings.maximumNumberOfLinks = 6
}
plugin.tx_solr.search {
ignoreGlobalQParameter = 1
query {
allowEmptyQuery = 1
}
results {
resultsHighlighting = 1
resultsHighlighting {
wrap = <mark>|</mark>
}
}
faceting = 1
faceting {
facetLimit = 25
facets >
facets {
typo3 {
label = Works with TYPO3
field = typo3support_stringM
partialName = OptionsTypo3
itemClass = success
sortBy = alpha
}
tags {
label = Extension tags
field = keywords_stringM
partialName = OptionsTags
itemClass = dark
prefix = #
}
}
}
}
plugin.tx_solr {
search {
ignoreGlobalQParameter = 1
query {
allowEmptyQuery = 1
}
results {
resultsHighlighting = 1
resultsHighlighting {
wrap = <mark>|</mark>
}
}
faceting = 1
faceting {
facetLimit = 25
facets >
facets {
typo3 {
label = Works with TYPO3
field = typo3support_stringM
partialName = OptionsTypo3
itemClass = success
sortBy = alpha
}
tags {
label = Extension tags
field = keywords_stringM
partialName = OptionsTags
itemClass = dark
prefix = #
}
}
}
}
cssFiles.results =
settings.maximumNumberOfLinks = 6
}
page {
includeCSS {
ter = EXT:ter_layout/Resources/Public/Css/ter.css
}
}
page {
includeCSS {
ter = EXT:ter_layout/Resources/Public/Css/ter.css
}
}
lib {
AsideMenu = HMENU
AsideMenu {
entryLevel = 0
wrap (
<div class="a" id="aside">
<ul id="nav-aside">
|
</ul>
<div class="aside-shade-head"></div>
<div class="aside-shade-cont"></div>
<div class="aside-shade-foot"></div>
</div>
)
1 = TMENU
1 {
expAll = 1
NO = 1
NO {
linkWrap = <li class="nav-aside-lvl1"> | </li>
}
}
}
Logo = IMAGE
Logo {
file = EXT:ter_layout/Resources/Public/Images/typo3-logo.png
titleText = TYPO3
altText = TYPO3
stdWrap {
typolink {
parameter = https://www.typo3.org _top
ATagParams = id="logo"
}
}
}
FooterSponsorLogos = COA
FooterSponsorLogos {
# 10: punkt.de
10 = IMAGE
10 {
file = EXT:ter_layout/Resources/Public/Images/footer-punkt.de.png
altText =
titleText =
stdWrap {
typolink {
parameter = http://www.punkt.de _blank
wrap (
<div class="csc-textpic-image csc-textpic-firstcol" style="width:126px;">
<div>
|
</div>
</div>
)
}
}
}
# 20: SourceForge
20 = IMAGE
20 {
file = EXT:ter_layout/Resources/Public/Images/footer-sourceforge.png
altText =
titleText =
stdWrap {
typolink {
parameter = http://www.sourceforge.net/projects/typo3 _blank
wrap (
<div class="csc-textpic-image csc-textpic-lastcol" style="width:162px;">
<div>
|
</div>
</div>
)
}
}
}
wrap (
<div class="csc-textpic csc-textpic-left csc-textpic-above">
<div class="csc-textpic-imagewrap">
|
</div>
</div>
)
}
SolrSearch < plugin.tx_solr_PiSearch_Search
}
<div class="tx_solr">
<div class="row">
<div class="col-md-12">
<f:render section="content" />
</div>
</div>
</div>
......@@ -6,7 +6,7 @@
<div id="tx-solr-faceting" class="d-none d-lg-block d-xl-block">
<div class="card-container">
<f:if condition="{resultSet.facets.used -> f:count()}">
<div class="card card-size-large" id="tx-solr-facets-in-use">
<div class="card card-size-large mb-3" id="tx-solr-facets-in-use">
<div class="card-header">
<s:translate key="faceting_resultsNarrowedBy">Used facets</s:translate>
</div>
......@@ -24,7 +24,7 @@
</ul>
</div>
<div class="">
<a href="{s:uri.facet.removeAllFacets()}" class="btn btn-primary btn-block solr-ajaxified">
<a href="{s:uri.facet.removeAllFacets()}" class="btn btn-primary btn-block solr-ajaxified mb-0">
<strong><i class="fa fa-times"></i>
<s:translate key="faceting_removeAllFilters">Remove all filters</s:translate>
</strong>
......@@ -37,7 +37,7 @@
<div class="facet-area-main">
<div class="solr-facets-available secondaryContentSection">
<f:for each="{areaFacets}" as="facet">
<div class="card card-size-large">
<div class="card card-size-large mb-3">
<f:render partial="Facets/{facet.partialName}" arguments="{resultSet:resultSet, facet:facet}" />
</div>
</f:for>
......
......@@ -2,14 +2,14 @@
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/">
<f:layout name="Main" />
<f:layout name="Fullwidth" />
<f:section name="main">
<f:section name="content">
<div class="container-fluid">
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace: pluginNamespace, resultSet: resultSet}" />
<f:if condition="{resultSet.usedSearch.numberOfResults}">
<f:if condition="{resultSet.allResultCount}">
<f:else>
<div class="alert alert-danger mt-3">
<s:translate key="no_results_nothing_found" arguments="{0: resultSet.usedQuery.queryString}">Nothing found for "%s".</s:translate>
......@@ -41,10 +41,10 @@
</f:then>
</f:if>
<f:if condition="{hasSearched}">
<f:if condition="{resultSet.hasSearched}">
<s:widget.resultPaginate resultSet="{resultSet}" configuration="{maximumNumberOfLinks: settings.maximumNumberOfLinks, templatePath:'EXT:ter_layout/Resources/Private/Templates/Solr/ViewHelpers/Widget/ResultPaginate/Index.html'}">
<f:variable name="exactMatchFound" value="0" />
<f:if condition="{resultSet.usedQuery.queryString -> f:format.case(mode:'lower')} == {documents.0.extensionKey_stringS}">
<f:if condition="{resultSet.usedQuery.options.query -> f:format.case(mode:'lower')} == {documents.0.extensionKey_stringS}">
<f:render partial="Result/Document" section="DocumentWrap" arguments="{resultSet:resultSet, document:documents.0, exactMatchFound: 1}" />
<f:variable name="exactMatchFound" value="1" />
</f:if>
......
......@@ -19,7 +19,7 @@
},
"license": "GPL-2.0+",
"require": {
"typo3/cms-core": ">= 8.7.0, <= 8.7.99"
"typo3/cms-core": "^8.7 || ^9.5"
},
"replace": {
"ter_layout": "self.version"
......
# t3olayout loads its typoscript via ext_typoscript_setup.txt which is a bad implementation and prevents
# overriding in many cases, so we also have to provide an ext_typoscript_setup.txt
[page|uid = 3] && [globalString = GP:tx_terfe2_pi1|action = ?*]
page.meta {
og:title >
og:title >
}
[global]
paths:
- extensions/
filePatterns:
- "*.tsconfig"
- "*.typoscript"
- "ext_typoscript_*.txt"
sniffs:
- class: Indentation
parameters:
useSpaces: true
indentPerLevel: 2
indentConditions: false
- class: DeadCode
- class: OperatorWhitespace
- class: RepeatingRValue
disabled: true
- class: EmptySection
- class: NestingConsistency
parameters:
commonPathPrefixThreshold: 1