mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-03 22:01:45 +01:00
17 lines
379 B
JavaScript
17 lines
379 B
JavaScript
|
import * as fs from 'fs';
|
||
|
import { Engine } from 'php-parser';
|
||
|
|
||
|
const parser = new Engine({
|
||
|
parser: {
|
||
|
extractDoc: false,
|
||
|
},
|
||
|
ast: {
|
||
|
withPositions: true,
|
||
|
},
|
||
|
})
|
||
|
|
||
|
const phpFile = fs.readFileSync("./config/2fauth.php")
|
||
|
const phpContent = parser.parseCode(phpFile)
|
||
|
const version = phpContent.children[0].expr.items[0].value.value
|
||
|
|
||
|
export default version
|