Exemplo n.º 1
0
 public TestPhpPlatform(
     IOptions <PhpScriptGeneratorOptions> phpScriptGeneratorOptions,
     IOptions <BuildScriptGeneratorOptions> commonOptions,
     IPhpVersionProvider phpVersionProvider,
     ILogger <PhpPlatform> logger,
     PhpPlatformDetector detector,
     PhpPlatformInstaller phpInstaller,
     PhpComposerInstaller phpComposerInstaller)
     : base(
         phpScriptGeneratorOptions,
         commonOptions,
         phpVersionProvider,
         logger,
         detector,
         phpInstaller,
         phpComposerInstaller)
 {
 }
Exemplo n.º 2
0
        private PhpPlatform CreatePhpPlatform(
            string[] supportedPhpVersions                       = null,
            string defaultVersion                               = null,
            BuildScriptGeneratorOptions commonOptions           = null,
            PhpScriptGeneratorOptions phpScriptGeneratorOptions = null,
            bool?isPhpVersionAlreadyInstalled                   = null,
            string phpInstallationScript                        = null,
            bool?isPhpComposerAlreadyInstalled                  = null,
            string phpComposerInstallationScript                = null)
        {
            commonOptions                 = commonOptions ?? new BuildScriptGeneratorOptions();
            phpScriptGeneratorOptions     = phpScriptGeneratorOptions ?? new PhpScriptGeneratorOptions();
            isPhpVersionAlreadyInstalled  = isPhpVersionAlreadyInstalled ?? true;
            phpInstallationScript         = phpInstallationScript ?? "default-php-installation-script";
            isPhpComposerAlreadyInstalled = isPhpComposerAlreadyInstalled ?? true;
            phpComposerInstallationScript = phpComposerInstallationScript ?? "default-php-composer-installation-script";
            var versionProvider = new TestPhpVersionProvider(supportedPhpVersions, defaultVersion);
            var detector        = new PhpPlatformDetector(
                Options.Create(phpScriptGeneratorOptions),
                versionProvider,
                NullLogger <PhpPlatformDetector> .Instance,
                new DefaultStandardOutputWriter());
            var phpInstaller = new TestPhpPlatformInstaller(
                Options.Create(commonOptions),
                isPhpVersionAlreadyInstalled.Value,
                phpInstallationScript);
            var phpComposerInstaller = new TestPhpComposerInstaller(
                Options.Create(commonOptions),
                isPhpComposerAlreadyInstalled.Value,
                phpComposerInstallationScript);

            return(new TestPhpPlatform(
                       Options.Create(phpScriptGeneratorOptions),
                       Options.Create(commonOptions),
                       versionProvider,
                       NullLogger <TestPhpPlatform> .Instance,
                       detector,
                       phpInstaller,
                       phpComposerInstaller));
        }