peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.33k stars 202 forks source link

Disable library #1061

Closed N0zzy closed 2 years ago

N0zzy commented 2 years ago

I am addressing a question about the module (library) of the pie. I have settings in this situation: \<Project Sdk="Peachpie.NET.Sdk/1.0.23"> How can I disable the mssql or mysql module/library that I don't need (Peachpie.Library.MsSql/1.0.x and Peachpie.Library.MySql/1.0.x)? Thank you.

jakubmisek commented 2 years ago

The Sdk implicitly references the runtime and libraries (packages Peachpie.Runtime and Peachpie.Library.*)

You can disable this behavior (no packages will be referenced), and reference them by yourself:

<Project Sdk="Peachpie.NET.Sdk/1.0.23">
  <PropertyGroup>
    <DisableImplicitPeachpieReferences>true</DisableImplicitPeachpieReferences>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Peachpie.Runtime" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library.Network" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library.XmlDom" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library.Graphics" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library.Scripting" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library.MySql" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library.MsSql" Version="$(PeachpieVersion)" />
    <PackageReference Include="Peachpie.Library.PDO" Version="$(PeachpieVersion)" />
  </ItemGroup>
</Project>

remove any reference you don't need from this :-)

N0zzy commented 2 years ago

thx