NuGet packages provide a standardized way of sharing a library functionality across .NET projects. In general, they contain the compiled code (assembly) and other files you want to deliver as a package. Packages are usually pushed to NuGet feeds (public or private), so that they can be referenced by other projects.

The process of creating packages is separated from the compilation itself and is fully managed by the build system. This means that projects containing PHP code can be packaged using a standard way, no different from packing other project types. This article summarizes the usual approaches and options.

Most PHP projects contain a decent amout of content that has to be published together with its compiled functionality. This usualy includes images, scripts and styles.

<ItemGroup><ContentInclude="**/*.jpg;**/*.png"/></ItemGroup>

Note

PHP files are compiled and their content is not copied to the package by default. Some functionalities may require the PHP file to be physically present within the target project. Include those required source files in the same way as you would any other content files.