Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7422075
LuaStandaloneInterpreterFunction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
LuaStandaloneInterpreterFunction.php
View Options
<?php
namespace
MediaWiki\Extension\Scribunto\Engines\LuaStandalone
;
class
LuaStandaloneInterpreterFunction
{
/** @var bool[] */
public
static
$anyChunksDestroyed
=
[];
/** @var int[][] */
public
static
$activeChunkIds
=
[];
/**
* @var int
*/
public
$interpreterId
;
/**
* @var int
*/
public
$id
;
/**
* @param int $interpreterId
* @param int $id
*/
public
function
__construct
(
$interpreterId
,
$id
)
{
$this
->
interpreterId
=
$interpreterId
;
$this
->
id
=
$id
;
$this
->
incrementRefCount
();
}
public
function
__clone
()
{
$this
->
incrementRefCount
();
}
public
function
__wakeup
()
{
$this
->
incrementRefCount
();
}
public
function
__destruct
()
{
$this
->
decrementRefCount
();
}
private
function
incrementRefCount
()
{
if
(
!
isset
(
self
::
$activeChunkIds
[
$this
->
interpreterId
]
)
)
{
self
::
$activeChunkIds
[
$this
->
interpreterId
]
=
[
$this
->
id
=>
1
];
}
elseif
(
!
isset
(
self
::
$activeChunkIds
[
$this
->
interpreterId
][
$this
->
id
]
)
)
{
self
::
$activeChunkIds
[
$this
->
interpreterId
][
$this
->
id
]
=
1
;
}
else
{
self
::
$activeChunkIds
[
$this
->
interpreterId
][
$this
->
id
]++;
}
}
private
function
decrementRefCount
()
{
if
(
isset
(
self
::
$activeChunkIds
[
$this
->
interpreterId
][
$this
->
id
]
)
)
{
if
(
--
self
::
$activeChunkIds
[
$this
->
interpreterId
][
$this
->
id
]
<=
0
)
{
unset
(
self
::
$activeChunkIds
[
$this
->
interpreterId
][
$this
->
id
]
);
self
::
$anyChunksDestroyed
[
$this
->
interpreterId
]
=
true
;
}
}
else
{
self
::
$anyChunksDestroyed
[
$this
->
interpreterId
]
=
true
;
}
}
}
// Alias exists due to serialization of class name into MWServer.lua
class_alias
(
LuaStandaloneInterpreterFunction
::
class
,
'Scribunto_LuaStandaloneInterpreterFunction'
);
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 05:50 (1 d, 1 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
61/ff/31d1eba9b39ceb91281e1c0a0d9f
Default Alt Text
LuaStandaloneInterpreterFunction.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment