Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ on:
types: [ assigned, opened, synchronize, reopened ]

schedule:
- cron: '30 1 * * *'
- cron: '30 1 * * MON'

jobs:
build:

runs-on: ubuntu-24.04
runs-on: ubuntu-26.04

strategy:
matrix:
versions: [{php: '8.1', solr: '9.10.1'}, {php: '8.2', solr: '9.10.1'}]
versions: [{php: '8.1', solr: '9.10.1'}, {php: '8.2', solr: '9.10.1'}, {php: '8.3', solr: '9.10.1'}, {php: '8.4', solr: '9.10.1'}]
fail-fast: false

name: PHP ${{ matrix.versions.php }} Test
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
run: sudo systemctl start mysql.service

- name: Prepare database
run: export MYSQL_PWD=root && mysql --default-character-set=utf8 -h 'localhost' -P '3306' -u 'root' -v -e "CREATE DATABASE IF NOT EXISTS opusdb DEFAULT CHARACTER SET = UTF8 DEFAULT COLLATE = UTF8_GENERAL_CI; CREATE USER 'opus4admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT ALL PRIVILEGES ON opusdb.* TO 'opus4admin'@'localhost'; CREATE USER 'opus4'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT SELECT,INSERT,UPDATE,DELETE ON opusdb.* TO 'opus4'@'localhost'; FLUSH PRIVILEGES;"
run: export MYSQL_PWD=root && mysql --default-character-set=utf8 -h 'localhost' -P '3306' -u 'root' -v -e "CREATE DATABASE IF NOT EXISTS opusdb DEFAULT CHARACTER SET = UTF8 DEFAULT COLLATE = UTF8_GENERAL_CI; CREATE USER 'opus4admin'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'root'; GRANT ALL PRIVILEGES ON opusdb.* TO 'opus4admin'@'localhost'; CREATE USER 'opus4'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'root'; GRANT SELECT,INSERT,UPDATE,DELETE ON opusdb.* TO 'opus4'@'localhost'; FLUSH PRIVILEGES;"

- name: Lint PHP files
run: ant lint
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fi
SCRIPT

$database = <<SCRIPT
export MYSQL_PWD=root && mysql --default-character-set=utf8 -h 'localhost' -P '3306' -u 'root' -v -e "CREATE DATABASE IF NOT EXISTS opusdb DEFAULT CHARACTER SET = UTF8 DEFAULT COLLATE = UTF8_GENERAL_CI; CREATE USER IF NOT EXISTS 'opus4admin'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT ALL PRIVILEGES ON opusdb.* TO 'opus4admin'@'%'; CREATE USER IF NOT EXISTS 'opus4'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT SELECT,INSERT,UPDATE,DELETE ON opusdb.* TO 'opus4'@'%'; FLUSH PRIVILEGES;"
export MYSQL_PWD=root && mysql --default-character-set=utf8 -h 'localhost' -P '3306' -u 'root' -v -e "CREATE DATABASE IF NOT EXISTS opusdb DEFAULT CHARACTER SET = UTF8 DEFAULT COLLATE = UTF8_GENERAL_CI; CREATE USER IF NOT EXISTS 'opus4admin'@'%' IDENTIFIED WITH caching_sha2_password BY 'root'; GRANT ALL PRIVILEGES ON opusdb.* TO 'opus4admin'@'%'; CREATE USER IF NOT EXISTS 'opus4'@'%' IDENTIFIED WITH caching_sha2_password BY 'root'; GRANT SELECT,INSERT,UPDATE,DELETE ON opusdb.* TO 'opus4'@'%'; FLUSH PRIVILEGES;"
SCRIPT

$databaseConfiguration = <<SCRIPT
Expand Down
4 changes: 2 additions & 2 deletions bin/install-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ mysqlRoot() {

mysqlRoot <<LimitString
CREATE DATABASE IF NOT EXISTS $DBNAME DEFAULT CHARACTER SET = UTF8MB4 DEFAULT COLLATE = UTF8MB4_UNICODE_CI;
CREATE USER '$DB_ADMIN'@'$MYSQLHOST' IDENTIFIED WITH mysql_native_password BY '$DB_ADMIN_PASSWORD';
CREATE USER '$DB_ADMIN'@'$MYSQLHOST' IDENTIFIED WITH caching_sha2_password BY '$DB_ADMIN_PASSWORD';
GRANT ALL PRIVILEGES ON $DBNAME.* TO '$DB_ADMIN'@'$MYSQLHOST';
CREATE USER '$DB_USER'@'$MYSQLHOST' IDENTIFIED WITH mysql_native_password BY '$DB_USER_PASSWORD';
CREATE USER '$DB_USER'@'$MYSQLHOST' IDENTIFIED WITH caching_sha2_password BY '$DB_USER_PASSWORD';
GRANT SELECT,INSERT,UPDATE,DELETE ON $DBNAME.* TO '$DB_USER'@'$MYSQLHOST';
FLUSH PRIVILEGES;
LimitString
Expand Down
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
"ext-readline": "*",
"ext-sockets": "*",
"ext-yaml": "*",
"opus4/zf1-future": "1.25.*",
"opus4/zf1-future": "*",
"jpgraph/jpgraph": "dev-master",
"opus4-repo/opus4-common": "^4.10.1",
"opus4-repo/framework": "^4.10.1",
"opus4-repo/search": "^4.10",
"opus4-repo/opus4-bibtex": "^4.10",
"opus4-repo/opus4-common": "dev-master as 4.11",
"opus4-repo/framework": "dev-master as 4.11",
"opus4-repo/search": "dev-master as 4.11",
"opus4-repo/opus4-bibtex": "dev-master as 4.11",
"opus4-repo/opus4-import": "dev-main as 4.11",
"opus4-repo/opus4-pdf": "^4.9",
"opus4-repo/opus4-job": "^4.9",
"opus4-repo/opus4-security": "^4.9",
"opus4-repo/opus4-sword": "^4.9",
"opus4-repo/opus4-app-common": "^4.10",
"opus4-repo/opus4-deepgreen": "^4.10",
"opus4-repo/opus4-i18n": "^4.10",
"opus4-repo/opus4-pdf": "dev-main as 4.11",
"opus4-repo/opus4-job": "dev-main as 4.11",
"opus4-repo/opus4-security": "dev-main as 4.11",
"opus4-repo/opus4-sword": "dev-main as 4.11",
"opus4-repo/opus4-app-common": "dev-main as 4.11",
"opus4-repo/opus4-deepgreen": "dev-main as 4.11",
"opus4-repo/opus4-i18n": "dev-main as 4.11",
"components/jquery": "3.4.*",
"components/jqueryui": "1.12.*",
"oomphinc/composer-installers-extender": "^2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Application_Console_Admin_ChangePasswordCommand extends Command

public const OPTION_PASSWORD = 'password';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ abstract class Application_Console_Collection_AbstractCollectionCommand extends
/** @var bool */
protected $updateDateModified = false;

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Collection/CopyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

class Application_Console_Collection_CopyCommand extends Application_Console_Collection_AbstractCollectionCommand
{
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Collection/MoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

class Application_Console_Collection_MoveCommand extends Application_Console_Collection_AbstractCollectionCommand
{
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Collection/RemoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Application_Console_Collection_RemoveCommand extends Command
/** @var bool */
protected $updateDateModified = false;

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Console/ConsoleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
class Application_Console_Console_ConsoleCommand extends Command
{
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Console/ExecCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Application_Console_Console_ExecCommand extends Command
/** Argument for the PHP code snippet file(s) to be executed */
public const ARGUMENT_SNIPPET_FILES = 'SnippetFile';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Debug/DocumentXmlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Application_Console_Debug_DocumentXmlCommand extends Command
{
public const ARGUMENT_DOC_ID = 'DocID';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Document/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Application_Console_Document_DeleteCommand extends AbstractDocumentCommand
{
public const OPTION_PERMANENT = 'permanent';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Document/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Application_Console_Document_DiffCommand extends Command

public const ARGUMENT_DOC_ID = 'DocID';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Document/DuplicatesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Application_Console_Document_DuplicatesCommand extends Command

public const OPTION_REMOVE = 'remove';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Application_Console_Model_EnrichmentDeleteCommand extends Command

public const OPTION_FORCE = 'force';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Application_Console_Model_EnrichmentExportCommand extends Command

public const OPTION_OUTPUT_FILE = 'outputFile';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Application_Console_Model_EnrichmentImportCommand extends Command
{
public const ARGUMENT_FILE = 'config_file';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
class Application_Console_Model_EnrichmentListCommand extends Command
{
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Application_Console_Model_EnrichmentRenameCommand extends Command

public const ARGUMENT_NEW_KEY = 'newKey';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Orcid/InfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
class Application_Console_Orcid_InfoCommand extends Command
{
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Orcid/NormalizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Application_Console_Orcid_NormalizeCommand extends Command
{
public const OPTION_FIX = 'fix';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Orcid/ValidateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Application_Console_Orcid_ValidateCommand extends Command
{
public const OPTION_TAG = 'tag';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Person/CleanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Application_Console_Person_CleanCommand extends Command
{
public const OPTION_KEEP = 'keep';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Task/InfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Application_Console_Task_InfoCommand extends Command
{
public const ARGUMENT_TASK_NAME = 'TaskName';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Task/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/
class Application_Console_Task_ListCommand extends Command
{
protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
2 changes: 1 addition & 1 deletion library/Application/Console/Task/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Application_Console_Task_RunCommand extends Command
{
public const ARGUMENT_TASK_NAME = 'TaskName';

protected function configure()
protected function configure(): void
{
parent::configure();

Expand Down
36 changes: 30 additions & 6 deletions library/Application/Translate/TmxParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ public function __construct()
{
$this->parser = xml_parser_create();

xml_set_object($this->parser, $this);
xml_set_element_handler($this->parser, "tagOpen", "tagClose");
xml_set_character_data_handler($this->parser, "cdata");
xml_set_default_handler($this->parser, "handleDefault");
xml_set_element_handler($this->parser, [$this, 'elementOpen'], [$this, 'elementClose']);
xml_set_character_data_handler($this->parser, [$this, 'cdata']);
xml_set_default_handler($this->parser, [$this, 'handleDefault']);
}

public function __destruct()
Expand All @@ -79,6 +78,33 @@ public function parse($data)
return $this->translations;
}

/**
* @param resource $parser
* @param string $element
* @param array $attributes
*/
protected function elementOpen($parser, $element, $attributes)
{
if (! $this->inSeg) {
$this->tagOpen($parser, $element, $attributes);
} else {
$this->tagOpenSeg($parser, $element, $attributes);
}
}

/**
* @param resource $parser
* @param string $element
*/
protected function elementClose($parser, $element)
{
if (! $this->inSeg) {
$this->tagClose($parser, $element);
} else {
$this->tagCloseSeg($parser, $element);
}
}

/**
* @param resource $parser
* @param string $tag
Expand Down Expand Up @@ -109,7 +135,6 @@ protected function tagOpen($parser, $tag, $attributes)
break;

case 'SEG':
xml_set_element_handler($this->parser, 'tagOpenSeg', 'tagCloseSeg');
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
$this->inSeg = true;
break;
Expand Down Expand Up @@ -174,7 +199,6 @@ protected function tagCloseSeg($parser, $tag)
{
switch (strtoupper($tag)) {
case 'SEG':
xml_set_element_handler($this->parser, 'tagOpen', 'tagClose');
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 1);
$this->translations[$this->currentKey]['values'][$this->currentLang] = $this->currentValue;
$this->currentValue = null;
Expand Down
7 changes: 6 additions & 1 deletion library/Application/View/Helper/TranslateIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*/

use Opus\Common\Identifier;
use Opus\Common\Model\ModelException;

class Application_View_Helper_TranslateIdentifier extends Zend_View_Helper_Translate
{
Expand All @@ -45,7 +46,11 @@ public function translateIdentifier($type = null)

$translator = Application_Translate::getInstance();
// TODO map from Type to field name
$fieldname = Identifier::getFieldnameForType($type);
try {
$fieldname = Identifier::getFieldnameForType($type);
} catch (ModelException $me) {
$fieldname = 'Identifier';
}
return $translator->translate($fieldname);
}
}