-
Notifications
You must be signed in to change notification settings - Fork 0
/
fb2make.php
50 lines (49 loc) · 1.38 KB
/
fb2make.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
$docArray = array(
'<?xml version="1.0" encoding="utf-8"?>',
'<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">',
' <description>',
' <title-info>',
' <genre></genre>',
' <author>',
' <first-name></first-name>',
' <middle-name></middle-name>',
' <last-name></last-name>',
' </author>',
' <book-title></book-title>',
' <annotation></annotation>',
' <date value="00-00-00"/>',
' <coverpage>',
' <image l:href="#cover.jpg"/>',
' </coverpage>',
' <lang>ru</lang>',
' <src-lang>ru</src-lang>',
' <sequence name="" number=""/>',
' </title-info>',
' <document-info>',
' </document-info>',
' <publish-info>',
' </publish-info>',
' </description>',
' <body>',
' <image xlink:href="" />',
' <title>',
' <p></p>',
' </title>',
' <epigraph>',
' <p></p>',
' <text-author></text-author>',
' </epigraph>',
' <section>',
' </section>',
' </body>',
' <binary id="cover.jpg" content-type="image/jpeg"></binary>',
'</FictionBook>',
);
$docString = implode("\n", $docArray);
$fileName = isset($argv[1]) ? $argv[1] : 'empty.fb2';
if (substr($fileName, -4) != '.fb2') {
$fileName .= '.fb2';
}
file_put_contents($fileName, $docString);
chmod($fileName, 0666);