Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F34916316
undelete-pagelinks.pl
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
tstarling
Jan 13 2022, 4:42 AM
2022-01-13 04:42:54 (UTC+0)
Size
612 B
Referenced Files
None
Subscribers
None
undelete-pagelinks.pl
View Options
#
!
/
usr
/
bin
/
perl
-
w
$
db
=
$
ARGV
[
0
];
$
table
=
'pagelinks'
;
while
(
<
STDIN
>
)
{
if
(
/
DELETE
FROM
`$
db
`
.
`$
table
`
/
)
{
<
STDIN
>
;
#
where
@values
=
[];
$
ok
=
1
;
for
(
$
i
=
1
;
$
i
<=
4
;
$
i++
)
{
$
valueLine
=
<
STDIN
>
;
if
(
$
valueLine
=~
/\@
$
i=
([
0
-
9
]
+
)
/
)
{
$
values
[
$
i
]
=
$
1
;
}
elsif
(
$
valueLine
=~
/\@
$
i='(.*)'
/
)
{
$
str
=
$
1
;
$
str
=~
s/'/\\'
/
g
;
$
values
[
$
i
]
=
"'$str'"
;
}
else
{
$
ok
=
0
;
}
}
if
(
$
ok
)
{
print
"INSERT IGNORE INTO pagelinks (pl_from, pl_namespace, pl_title, pl_from_namespace) "
.
"VALUES ($values[1], $values[2], $values[3], $values[4]);\n"
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9324019
Default Alt Text
undelete-pagelinks.pl (612 B)
Attached To
Mode
P18710 undelete-pagelinks.pl
Attached
Detach File
Event Timeline
Log In to Comment