public function addPackageFromComposerFiles($composers)
    {
        settype($composers, 'array');
        foreach($composers as $file)
        {
            $data = (array)json_decode(file_get_contents($file));

            if (isset($data['type']) && $data['type'] == 'anahita-extension') {
                if (!isset($data['extension-source'])) {
                    $data['extension-source'] = 'src';
                }

                $data['extension-source'] = realpath(dirname($file).'/src');

                if (is_readable($data['extension-source'])) {
                    $parts = array_filter(explode('/', @$data['name']));
                    $name = strtolower(pick(@$parts[1], basename(dirname($file))));
                    $vendor = strtolower(pick(@$parts[0], $name));
                    $this[] = new Package(array(
                        'composer_file' => $file,
                        'name' => $name,
                        'vendor' => $vendor,
                        'source' => $data['extension-source']
                    ));
                }
            }
        }
    }
public function addPackageFromComposerFiles($composers)
    {
        settype($composers, 'array');
        foreach($composers as $file)
        {
            $data = (array)json_decode(file_get_contents($file));

            if (isset($data['type']) && $data['type'] == 'anahita-extension') {
                if (!isset($data['extension-source'])) {
                    $data['extension-source'] = 'src';
                }

                $data['extension-source'] = realpath(dirname($file).'/src');

                if (is_readable($data['extension-source'])) {
                    $parts = array_filter(explode('/', @$data['name']));
                    $name = strtolower(pick(@$parts[1], basename(dirname($file))));
                    $vendor = strtolower(pick(@$parts[0], $name));
                    $this[] = new Package(array(
                        'composer_file' => $file,
                        'name' => $name,
                        'vendor' => $vendor,
                        'source' => $data['extension-source']
                    ));
                }
            }
        }
    }
public function addPackageFromComposerFiles ( $ composers ) { settype ( $ composers , 'array' ) ; foreach ( $ composers as $ file ) { $ data = ( array ) json_decode ( file_get_contents ( $ file ) ) ; if ( isset ( $ data [ 'type' ] ) && $ data [ 'type' ] == 'anahita-extension' ) { if ( ! isset ( $ data [ 'extension-source' ] ) ) { $ data [ 'extension-source' ] = 'src' ; } $ data [ 'extension-source' ] = realpath ( dirname ( $ file ) . '/src' ) ; if ( is_readable ( $ data [ 'extension-source' ] ) ) { $ parts = array_filter ( explode ( '/' , @ $ data [ 'name' ] ) ) ; $ name = strtolower ( pick ( @ $ parts [ 1 ] , basename ( dirname ( $ file ) ) ) ) ; $ vendor = strtolower ( pick ( @ $ parts [ 0 ] , $ name ) ) ; $ this [ ] = new Package ( array ( 'composer_file' => $ file , 'name' => $ name , 'vendor' => $ vendor , 'source' => $ data [ 'extension-source' ] ) ) ; } } } }
Adds packages using the a set of composer files

@param string $composers

@return void
Adds packages using the a set of composer files