Conditions | 7 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
58 | public function getVersion() |
||
59 | { |
||
60 | $filename = dirname( $this->container->get( 'kernel' )->getProjectDir() ) . DIRECTORY_SEPARATOR . 'composer.lock'; |
||
61 | |||
62 | if( file_exists( $filename ) === true && ( $content = file_get_contents( $filename ) ) !== false |
||
63 | && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
||
64 | ) { |
||
65 | foreach( (array) $content['packages'] as $item ) |
||
66 | { |
||
67 | if( $item['name'] === 'aimeos/aimeos-symfony' ) { |
||
68 | return $item['version']; |
||
69 | } |
||
70 | } |
||
71 | } |
||
72 | |||
73 | return ''; |
||
74 | } |
||
76 |