Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TYPO3
Extensions
lock
Commits
eb04c4b5
Commit
eb04c4b5
authored
Nov 13, 2017
by
Daniel Hürtgen
Browse files
[FEATURE] Global locking default configuration applied
parent
a21a311d
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ext_localconf.php
View file @
eb04c4b5
...
...
@@ -11,5 +11,62 @@ call_user_func(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'Objects'
][
\
TYPO3\CMS\Core\Locking\LockFactory
::
class
]
=
[
'className'
=>
\
Higidi\Lock\LockFactory
::
class
,
];
if
(
is_array
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
]))
{
$getLockBuilder
=
function
()
{
/** @var \Higidi\Lock\Builder\LockBuilder $lockBuilder */
$lockBuilder
=
\
TYPO3\CMS\Core\Utility\GeneralUtility
::
makeInstance
(
\
Higidi\Lock\Builder\LockBuilder
::
class
);
return
$lockBuilder
;
};
$lockBuilder
=
[
\
NinjaMutex\Lock\DirectoryLock
::
class
=>
function
(
array
$configuration
)
use
(
$getLockBuilder
)
{
return
$getLockBuilder
()
->
buildDirectoryLock
(
$configuration
);
},
\
NinjaMutex\Lock\FlockLock
::
class
=>
function
(
array
$configuration
)
use
(
$getLockBuilder
)
{
return
$getLockBuilder
()
->
buildFlockLock
(
$configuration
);
},
\
NinjaMutex\Lock\MySqlLock
::
class
=>
function
(
array
$configuration
)
use
(
$getLockBuilder
)
{
return
$getLockBuilder
()
->
buildMySqlLock
(
$configuration
);
},
\
NinjaMutex\Lock\PhpRedisLock
::
class
=>
function
(
array
$configuration
)
use
(
$getLockBuilder
)
{
return
$getLockBuilder
()
->
buildPhpRedisLock
(
$configuration
);
},
NinjaMutex\Lock\PredisRedisLock
::
class
=>
function
(
array
$configuration
)
use
(
$getLockBuilder
)
{
return
$getLockBuilder
()
->
buildPredisRedisLock
(
$configuration
);
},
];
if
(
isset
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationBuilder'
])
&&
is_array
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationBuilder'
]))
{
\
TYPO3\CMS\Core\Utility\ArrayUtility
::
mergeRecursiveWithOverrule
(
$lockBuilder
,
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationBuilder'
],
true
,
false
);
}
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationBuilder'
]
=
$lockBuilder
;
$lockConfiguration
=
[
\
NinjaMutex\Lock\DirectoryLock
::
class
=>
[
'path'
=>
PATH_site
.
'typo3temp/locks/'
,
],
\
NinjaMutex\Lock\FlockLock
::
class
=>
[
'path'
=>
PATH_site
.
'typo3temp/locks/'
,
],
];
if
(
isset
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationConfiguration'
])
&&
is_array
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationConfiguration'
]))
{
\
TYPO3\CMS\Core\Utility\ArrayUtility
::
mergeRecursiveWithOverrule
(
$lockConfiguration
,
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationConfiguration'
],
true
,
false
);
}
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locking'
][
'lockImplementationConfiguration'
]
=
$lockConfiguration
;
}
}
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment