PHP Class Symfony\Installer\Manager\ComposerManager

Show file Open project: symfony/symfony-installer Class Usage Examples

Public Methods

Method Description
__construct ( $projectDir )
createPackageName ( $projectName ) : string Generates a good Composer project name based on the application name and on the user name.
getPackageVersion ( $packageName )
initializeProjectConfig ( )
updateProjectConfig ( array $newConfig )

Private Methods

Method Description
fixPackageName ( string $name ) : string Transforms a project name into a valid Composer package name.
getComposerContentHash ( string $composerJsonFileContents ) : string Returns the md5 hash of the sorted content of the composer file.
getProjectConfig ( ) : array It returns the project's Composer config as a PHP array.
saveProjectConfig ( array $config ) It saves the given PHP array as the project's Composer config. In addition to JSON-serializing the contents, it synchronizes the composer.lock file to avoid out-of-sync Composer errors.
syncComposerLockFile ( ) Updates the hash values stored in composer.lock to avoid out-of-sync problems when the composer.json file contents are changed.

Method Details

__construct() public method

public __construct ( $projectDir )

createPackageName() public method

Generates a good Composer project name based on the application name and on the user name.
public createPackageName ( $projectName ) : string
$projectName
return string The generated Composer package name

getPackageVersion() public method

public getPackageVersion ( $packageName )

initializeProjectConfig() public method

updateProjectConfig() public method

public updateProjectConfig ( array $newConfig )
$newConfig array