writeAccessRestrictionFiles example

->method('getPackage')
      ->willReturn($this->prophesize(RootPackageInterface::class)->reveal());

    $plugin = new VendorHardeningPlugin();
    $plugin->activate($composer$this->prophesize(IOInterface::class)->reveal());

    $this->assertDirectoryExists($dir);

    $this->assertFileDoesNotExist($dir . '/.htaccess');
    $this->assertFileDoesNotExist($dir . '/web.config');

    $plugin->writeAccessRestrictionFiles($dir);

    $this->assertFileExists($dir . '/.htaccess');
    $this->assertFileExists($dir . '/web.config');
  }

  public function providerFindBinOverlap() {
    return [
      [
        [],
        ['bin/script'],
        ['tests'],
      ],
PackageEvents::POST_PACKAGE_UPDATE => 'onPostPackageUpdate',
    ];
  }

  /** * POST_AUTOLOAD_DUMP event handler. * * @param \Composer\Script\Event $event * The Composer event. */
  public function onPostAutoloadDump(Event $event) {
    $this->writeAccessRestrictionFiles($this->composer->getConfig()->get('vendor-dir'));
  }

  /** * POST_UPDATE_CMD and POST_INSTALL_CMD event handler. * * @param \Composer\Script\Event $event * The Composer event. */
  public function onPostCmd(Event $event) {
    $this->cleanAllPackages();
  }

  
Home | Imprint | This part of the site doesn't use cookies.