PeachPie - the PHP compiler and runtime for .NET and .NET Core

Overview


PeachPie
PeachPie Compiler

The open-source PHP compiler to .NET

If you run into any inconsistencies, bugs or incompatibilities, kindly let us know and we'll do our best to address them. Take a look at our Roadmap to see which features and extensions we still have to implement.

We are now a member of the .NET Foundation!

Continuous Integration

Service Platform Build Status
AppVeyor Visual Studio 2019 AppVeyor Build status
Azure DevOps Windows VSTS Build Status
GitHub Actions Ubuntu 18 .NET Core

What is PeachPie?

PeachPie is a modern PHP compiler based on the Microsoft Roslyn compiler platform and drawing from our popular Phalanger project. It allows PHP to be executed within the .NET framework, thereby opening the door for PHP developers into the world of .NET – and vice versa.

Status and Compatibility

You can find an up-to-date status of the project in our Roadmap section. Please note that the status is dynamic; PeachPie is a work in progress, which means that the list of finished and planned features frequently changes and will be updated on a regular basis. To see the current status of compatibility with the PHP language, please refer to our Compatibility overview.

Project goals

  • Increased performance: PeachPie's extensive type analysis and the influence of Microsoft Roslyn should provide an improved performance of PHP applications and components.

  • Security: since programs run within the standardized and manageable .NET or .NET Core environment, the code is fully verifiable without any unsafe constructs. In addition, PHP applications can be distributed source-lessly for added security benefits.

  • Cross-platform development: the project compiles legacy PHP code into portable class libraries, enabling developers to build cross-platform apps and libraries for Microsoft platforms.

  • Full .NET compatibility: compiled programs run on the reimplemented PeachPie runtime, fully compatibly with the PHP runtime.

  • Both-way interoperability: the project allows for hybrid applications, where parts are written in C# and others in PHP. The parts will be entirely compatible and can communicate seamlessly, all within the .NET framework.

How to use PeachPie

There are currently two ways of using PeachPie via dotnet: in your favorite shell or comfortably in Visual Studio 2017/Visual Studio Code using our official extensions.

Visual Studio

Download our official Visual Studio extension, which makes working with PeachPie compiler as convenient as possible. The extension allows you to easily create a new project using our templates, build & debug, profile your PHP code using the VS diagnostic tools and deploy your project to Azure:

Peachpie Extension

Visual Studio Code

Grab our VSCode extension to quickstart your development with a more lightweight editor. The extension automatically installs all required dependencies, enables the PeachPie: Create project command, syntax error underlining and PeachPie analytics:

Peachpie Extension

Command line building

Alternatively, you can also work with PeachPie on the command line. Please refer to our short introduction video to see how to run the compiler on the command line and to the Getting Started section in our documentation.

Nightly build

NuGet feed: https://ci.appveyor.com/nuget/peachpie

Version: 1.0.0-appv****

dotnet nuget add source https://ci.appveyor.com/nuget/peachpie -n appveyor-peachpie

How to contribute?

We can use all the help we can get. You can contribute to our repository, spread the word about this project, or give us a small donation to help fund the development. If you believe you have valuable knowledge and experience to add to this project, please do not hesitate to contribute to our repo – your help is much appreciated.

However, please read the Contribution Guidelines first and ensure you are following them. Also, we kindly ask you to respect our Code of Conduct when posting or interacting with other users.

You can also contribute by donating a dollar or two to the development of PeachPie:

Providing feedback

If you found a bug, have a question or if you have an improvement suggestion, the easiest way of providing feedback is to post it on Gitter or submit an issue here on GitHub. We try to respond as quickly as possible.

.NET Foundation

.NET Foundation
This project is supported by the .NET Foundation.

How to get in touch?

If you have a problem or question, the easiest way is to submit an issue here. You can also follow us on Twitter or Facebook and contact us there regarding your questions or ask the community for support on Gitter, but please understand that we do not provide email support.

For partnership inquiries, commercial support or other questions, please contact us via email at [email protected].

Comments
  • PDOStatement is not implemented

    PDOStatement is not implemented

    Hi again,

    when running $pdoObject->query() a NotImplementedException is thrown. I see there is code present in src\PDO\Peachpie.Library.PDO\PDO.cs so I assume the exception is thrown because query() is missing in src\PDO\Peachpie.Library.PDO.MySQL\PDOMySQLDriver.cs

    The full exception is this: CLR/System.NotImplementedException Exception thrown: 'System.NotImplementedException' in Peachpie.Library.PDO.dll: 'The method or operation is not implemented.'

    Kind regards

    • Tobi

    Please note: because Magento is so huge I can not test if every single function is actually called but the following functions are used:

    PDO => https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Adapter/Pdo/Mysql.php and https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Adapter/Pdo/Abstract.php:

    • [x] setAttribute
    • [x] query (I added the first call to this to make up the missing initStatements in Mysql Connector/NET, if this means trouble we can delay it a bit)
    • [x] lastInsertId
    • [x] exec
    • [x] quote
    • [x] beginTransaction
    • [x] commit
    • [x] rollBack
    • [x] getAttribute
    • [x] prepare
    • [x] getAvailableDrivers (static call)

    Statement => https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Statement.php and https://github.com/tobihille/magento-peachpie/blob/master/website/lib/Zend/Db/Statement/Pdo.php

    • [x] bindParam ~~prepare~~
    • [x] execute
    • [x] rowCount
    • [x] fetch ~~close~~
    • [x] setFetchMode
    • [x] fetchAll
    • [x] fetchColumn
    • [x] bindValue
    • [x] closeCursor
    • [x] columnCount
    • [x] errorCode
    • [x] errorInfo
    • [x] bindColumn
    • [x] fetchObject
    • [x] getAttribute
    • [ ] getColumnMeta (seems not used)
    • [x] nextRowset
    • [x] setAttribute
    opened by tobihille 41
  • System.StackOverflowException: serialize() of incorrectly constructed array object

    System.StackOverflowException: serialize() of incorrectly constructed array object

    The following code of two nested statements results into a "System.StackOverflowException":

    $hash = md5(serialize($array));
    

    Exception:

    2019-09-17_165338

    However, the unnested representation does not:

    $ser = serialize($array);
    $hash = md5($ser);
    

    I didn't get this issue before. Maybe a regression(?).

    opened by menturion 35
  • Installing Peachpie .NET templates doesn't work

    Installing Peachpie .NET templates doesn't work

    Issue

    When i ran dotnet new -i Peachpie.Templates::*, it just showed a list of available default built-in templates in .NET Core SDK:

    Template Name                                 Short Name           Language        Tags
    --------------------------------------------  -------------------  --------------  ----------------------
    Console Application                           console              [C#],F#,PHP,VB  Common/Console
    Class library                                 classlib             [C#],F#,PHP,VB  Common/Library
    WPF Application                               wpf                  [C#],VB         Common/WPF
    WPF Class library                             wpflib               [C#],VB         Common/WPF
    WPF Custom Control Library                    wpfcustomcontrollib  [C#],VB         Common/WPF
    WPF User Control Library                      wpfusercontrollib    [C#],VB         Common/WPF
    Windows Forms App                             winforms             [C#],VB         Common/WinForms
    Windows Forms Control Library                 winformscontrollib   [C#],VB         Common/WinForms
    Windows Forms Class Library                   winformslib          [C#],VB         Common/WinForms
    Worker Service                                worker               [C#],F#         Common/Worker/Web
    MSTest Test Project                           mstest               [C#],F#,VB      Test/MSTest
    NUnit 3 Test Item                             nunit-test           [C#],F#,VB      Test/NUnit
    NUnit 3 Test Project                          nunit                [C#],F#,VB      Test/NUnit
    xUnit Test Project                            xunit                [C#],F#,VB      Test/xUnit
    Razor Component                               razorcomponent       [C#]            Web/ASP.NET
    Razor Page                                    page                 [C#]            Web/ASP.NET
    MVC ViewImports                               viewimports          [C#]            Web/ASP.NET
    MVC ViewStart                                 viewstart            [C#]            Web/ASP.NET
    Blazor Server App                             blazorserver         [C#]            Web/Blazor
    Blazor WebAssembly App                        blazorwasm           [C#]            Web/Blazor/WebAssembly
    ASP.NET Core Empty                            web                  [C#],F#,PHP     Web/Empty
    ASP.NET Core Web App (Model-View-Controller)  mvc                  [C#],F#         Web/MVC
    ASP.NET Core Web App                          webapp               [C#]            Web/MVC/Razor Pages
    ASP.NET Core with Angular                     angular              [C#]            Web/MVC/SPA
    ASP.NET Core with React.js                    react                [C#]            Web/MVC/SPA
    ASP.NET Core with React.js and Redux          reactredux           [C#]            Web/MVC/SPA
    Razor Class Library                           razorclasslib        [C#]            Web/Razor/Library
    ASP.NET Core Web API                          webapi               [C#],F#         Web/WebAPI
    ASP.NET Core gRPC Service                     grpc                 [C#]            Web/gRPC
    dotnet gitignore file                         gitignore                            Config
    global.json file                              globaljson                           Config
    NuGet Config                                  nugetconfig                          Config
    Dotnet local tool manifest file               tool-manifest                        Config
    Web Config                                    webconfig                            Config
    Solution File                                 sln                                  Solution
    Protocol Buffer File                          proto                                Web/gRPC
    
    Examples:
        dotnet new mvc --auth Individual
        dotnet new web
        dotnet new --help
        dotnet new web --help
    

    System Information

    • Operating System: Windows 10 Version 21H1 (Build 19043.1083) - x86 64-bit
    • Installed .NET SDKs: .NET Core SDK 3.1.410 (x64), .NET SDK 5.0.301 (x64)
    • Command Line dotnet Version: 5.0.301
    opened by KygekDev 32
  • fastcgi_finish_request doesn't end the HTTP response

    fastcgi_finish_request doesn't end the HTTP response

    Hi, I'm porting Open Web Analytics to a .NET 5 (preview) process. Its all working nicely except for one thing, and maybe I am misunderstanding something but the following code does not end the http response as I would expect it to under PHP/PeachPie

    ob_flush();
    flush();
    ob_end_flush();
    

    I would expect this code to flush the response buffer and end the connection, but it doesn't. There is some more code to run after this (a sort of fire-and-forget) but the server is keeping the connection open until that code has finished running. Am I missing something? Thanks, O

    opened by oferns 30
  • Configuring wordpress with .net core

    Configuring wordpress with .net core

    I have downloaded the wordpress and copied it to website folder, I commenetd the code as suggested by article wp-includes/class-json.php: Commented condition if (!class_exists(...)) Commented first class Services_JSON_Error (we don’t have PEAR_Error yet), keeping the second one

    but when I am building the app I am getting follwoing error

    image

    opened by thakurankesh 27
  •  stream_socket_server

    stream_socket_server

    Have planned to implement the php stream class ?

    • [x] stream_socket_server
    • [x] stream_socket_client
    • [x] stream_set_blocking
    • [x] stream_socket_accept

    I need that for my project ;)

    :hand: up for grabs 
    opened by Arkantium 26
  • Malfunction in string operations

    Malfunction in string operations

    PeachPie still seems to be buggy with respect to string operations. This can be tested via the following simple test scenario, using the paragonie encryption lib https://github.com/paragonie/halite (https://packagist.org/packages/paragonie/halite):

    use ParagonIE\Halite\{
        File,
        KeyFactory,
        Symmetric\Crypto as Symmetric,
        Asymmetric\Crypto as Asymmetric
    };
    use ParagonIE\HiddenString\HiddenString as HiddenString;
    
    $encKey = KeyFactory::generateEncryptionKey();
    

    KeyFactory::generateEncryptionKey() instantiates a new EncryptionKey here https://github.com/paragonie/halite/blob/1fc48289b3759191c4f912d532b3691bf42a1eb4/src/KeyFactory.php#L87-L89 which invokes a key (i.e. string) check here https://github.com/paragonie/halite/blob/1fc48289b3759191c4f912d532b3691bf42a1eb4/src/Symmetric/EncryptionKey.php#L27

    The if condition in line 27 throws the exception ('Encryption key must be CRYPTO_STREAM_KEYBYTES (32) bytes long').

    The same malfunction can be seen in defuse/php-encryption lib (https://packagist.org/packages/defuse/php-encryption).

    :beetle: bug 
    opened by menturion 24
  • Web app issues

    Web app issues

    I've run into a couple of issues while trying to build an existing Web project with Peach Pie, and I'd appreciate it if I could get some help on this.

    1. [x] #861 Is DEBUG a special or reserved constant? This works fine in PHP:

      <?PHP
      echo "start";
      define('DEBUG', 1);
      echo "end";
      
      // curl localhost:5004 → startend
      

      However, in Peach Pie, it stops and exits right after the define() statement: start

    2. [x] [SOLVED] The pdo_mysql does not seem to be present within Peach Pie. Is this normal/intentional? My project fails to start if it's not detected:

      extension_loaded('pdo_mysql'); // false on PeachPie
      
    3. [x] #860 How can I replicate the following IIS web.config configuration for URL rewrite?

              <rule name="RewriteRule" enabled="true" stopProcessing="true">
                  <match url="^(.*)$" ignoreCase="true" />
                  <conditions>
                      <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                      <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                  </conditions>
                  <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
              </rule>
      

      This does not seem to work:

              var options = new RewriteOptions()
                  .AddRewrite(@"^(.*)$", "index.php/$1", skipRemainingRules: true);
      
              app.UseRewriter(options);
      
      
    4. [x] #863 json_encode() on simplexml_load_string() objects is not working

    There are more issues, but any help would be appreciated on these

    opened by DRSDavidSoft 23
  • Cannot run webapp

    Cannot run webapp

    When running web app sample [1] with "dotnet run, I get:

    Unable to run your project. Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. The current OutputType is 'Library'.

    Before trying this command, I synced lastest peachpie version from github and compiled with VS 2017.

    [1] : https://github.com/iolevel/peachpie-samples/tree/master/web-application

    :question: question 
    opened by kripper 23
  • Using Peachpie app as a NuGet package.

    Using Peachpie app as a NuGet package.

    This is probably more of a question than an issue - not sure if it's an issue or just me not knowing the answer.

    I have packaged the Website project into a NuGet .nupkg file and referenced it from another project. I then changed my configuration paths. They were previously as follows in my main test project:

    "ResponsiveFileManagerConfig": {
        "CurrentPath": "..\\..\\WebApplication\\wwwroot\\Media\\Uploads\\",
        "ThumbsBasePath": "..\\..\\WebApplication\\wwwroot\\Media\\Thumbs\\"
      }
    

    I simply changed "WebApplication" to "ConsoleApp1", which is what I am using to test the NuGet package:

    "ResponsiveFileManagerConfig": {
        "CurrentPath": "..\\..\\ConsoleApp1\\wwwroot\\Media\\Uploads\\",
        "ThumbsBasePath": "..\\..\\ConsoleApp1\\wwwroot\\Media\\Thumbs\\"
      }
    

    Now I get error messages from the file manager itself about the $current_path not existing. I guess because now the directory structure when referencing a NuGet package is a little bit different (but I am not sure how).. so I tried various combinations, like:

    "ResponsiveFileManagerConfig": {
        "CurrentPath": "..\\ConsoleApp1\\wwwroot\\Media\\Uploads\\",
        "ThumbsBasePath": "..\\ConsoleApp1\\wwwroot\\Media\\Thumbs\\"
      }
    

    and:

    "ResponsiveFileManagerConfig": {
        "CurrentPath": "..\\wwwroot\\Media\\Uploads\\",
        "ThumbsBasePath": "..\\wwwroot\\Media\\Thumbs\\"
      }
    

    and:

    "ResponsiveFileManagerConfig": {
        "CurrentPath": "\\wwwroot\\Media\\Uploads\\",
        "ThumbsBasePath": "\\wwwroot\\Media\\Thumbs\\"
      }
    

    Obviously none of those are working. Could you perhaps help me figure out the correct paths to use?

    NOTE: This is related to issue #185

    :question: question 
    opened by gordon-matt 23
  • Support for a self-contained assembly

    Support for a self-contained assembly

    While getting Responsive File Manager to work in Peachpie, I have come across another issue.. I keep receiving this error:

    "Language file is missing!"

    When I looked into it, I can see that it is trying to load some .php files from /filemanager/lang/[iso_code].php. I get that error every time I create a folder or delete a file, etc.

    Now, the problem is... I believe it is looking in the wwwroot of the main ASP.NET MVC project (named WebApplication), but the language files are in the Peachpie lib project (named Website). So I moved these .php language files to wwwroot/filemanager/lang... since the other static files are already there (wwwroot/filemanager/css, wwwroot/filemanager/js, etc). However, when I do this, I get an error message because the files no longer exist where they are supposed to. So in order to get everything to work nicely, I have to duplicate the files (have them all in both locations). Because I guess what's happening is this:

    1. For include 'something.php', it requires the file to be in the Peachpie library

    2. However, when the file manager uses file_exists() function, then it's looking in the /wwwroot/ of my MVC app.

    I hope I explained this properly. So, basically I don't have the error anymore, but it's an ugly workaround to have to duplicate the files. Is there anything you can do for future? Maybe you have a better idea, but I was thinking maybe some new option to tell peachpie to look for all .php files (or a specified collection of files?) in the Peachpie project and look for static files (js, css, etc) in the main MVC project. Is this possible?

    NOTE: This is related to issue #185

    opened by gordon-matt 22
  • How to call c# extension methods in php?

    How to call c# extension methods in php?

    Hello, dear developers peachpie. When I call c# extension methods, throws an exception: Error: Call to undefined method. How can I call them from php?

    opened by FibonacciFox 1
  • can not access the session variable if the session is not auto start.

    can not access the session variable if the session is not auto start.

    If the session is not set auto start at:

    class Startup
       {
           public void ConfigureServices(IServiceCollection services)
           {
               services.AddPhp(options =>
               {
                   //options.Session.AutoStart = true; //<==
               });
    

    Although I call session_start() before access session variable like this:

    //php
    session_start();
    $_SESSION['count']=0; // throw error here
    
    

    It throw error > System.NullReferenceException: Object reference not set to an instance of an object.

    I have not found this error for v1.1.0 ,v1.1.1 but found this error for v1.1.2, v1.1.3 I use net5.0

    opened by pmt66 0
  • hash_algos() doesn't include sha3-512

    hash_algos() doesn't include sha3-512

    I'm trying to hash a string with sha3-512 but as I see hash_algos() function doesn't have that. The PHP version is 7.4.69 (that probably includes sha3-512) and PeachPie version 1.0.9, tried it on 1.1.3 too. Is it not implemented yet, or something is wrong with my compiler? Thanks in advance.

    opened by Sekiraw 1
  • DllNotFoundException: Unable to load shared library 'MonoPosixHelper' or one of its dependencies.

    DllNotFoundException: Unable to load shared library 'MonoPosixHelper' or one of its dependencies.

    Hi, when running the command from a macbook air m2: dotnet run i get the following error in my browser:

    System.DllNotFoundException: Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMonoPosixHelper, 0x0001): tried: 'libMonoPosixHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache), 'libMonoPosixHelper' (no such file), '/usr/local/lib/libMonoPosixHelper' (no such file), '/usr/lib/libMonoPosixHelper' (no such file, not in dyld cache)
       at Peachpie.AspNetCore.Web.PhpHandlerMiddleware.InvokeScriptAsync(HttpContext context, ScriptInfo script, String path_info)
       at PeachPied.WordPress.AspNetCore.Internal.WpResponseCacheMiddleware.CaptureResponse(HttpContext context)
       at PeachPied.WordPress.AspNetCore.Internal.WpResponseCacheMiddleware.Invoke(HttpContext context)
       at PeachPied.WordPress.AspNetCore.Internal.DiagnosticExtensions.Middleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
    
    opened by Shingirai98 1
  • PDO.PgSQL returns numeric fields as C# strings, but is unable to query a numeric field using a C# string argument

    PDO.PgSQL returns numeric fields as C# strings, but is unable to query a numeric field using a C# string argument

    Currently, the PDO.PgSQL driver returns numeric field values as C# strings (eg: '1283923.124124124'). This is probably so, because native C# floating DataTypes are not capable to store big PgSQL numerics. Integer fields are returned as C# integers.

    But when we query a numeric field (eg: ... WHERE my_numeric_field = :arg), the statement will fail if :arg is a string, ie. it will throw an exception saying operator does not exist: integer = text.

    This is an inconsistency and will cause problems, because most of the time we will fetch values and use them as parameters in subsequent queries.

    I believe the solution is to allow the PDO driver to accept string parameters for querying integer and numeric fields. Zend's PDO driver is flexible and allows this.

    Note that $pdo->setAttribute(\PDO::ATTR_STRINGIFY_FETCHES, false) must be used (because Peachpie defaults to true while Zend defaults to false). Otherwise all values will be converted to strings, which currently will generate even more datatype missmatches when querying.

    opened by kripper 1
Releases(v1.0.25)
  • v1.0.25(Nov 16, 2022)

  • v1.1.3(Nov 16, 2022)

    maintenance release,

    • fixes header() function so it won't report warnings on CLI
    • fixes PDO execute() #1069
    • mysqli_report()
    • PHP 8 Attribute class
    • faster file_exists()
    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Oct 8, 2022)

    • fixes White Screen of Death when running from Visual Studio (reverts use of I/O pipelines) (https://github.com/peachpiecompiler/peachpie/issues/1070)
    • implements mysqli_report()
    • fixes PDO statement execute (https://github.com/peachpiecompiler/peachpie/issues/1069)
    • MySql and MySqli err code is correct (not -1 always)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Oct 5, 2022)

  • v1.1.0(Oct 3, 2022)

    Targeting net5.0 and newer now, so we can make use of the latest API. When running on older .NET runtimes, please use the 1.0.x versions.

    Sample project file .msbuildproj:

    <Project Sdk="Peachpie.NET.Sdk/1.1.0">
      <PropertyGroup>
        <OutputType>library</OutputType>
        <TargetFramework>net6.0</TargetFramework>
      </PropertyGroup>
      <ItemGroup>
        <Compile Include="**/*.php" />
      </ItemGroup>
    </Project>
    

    Breaking

    • Requires .NET Runtime 5.0 or higher.

    Optimizations

    • ASP.NET Core middleware takes advantage of I/O pipelines.
    • avoids allocations in ASP.NET Core request pipeline and string encoding.
    • avoids more allocations in request handling, hash, random_int, mbstring, stripcslashes, URL encoding, echo of complex strings, bin2hex.

    Fixes

    • Compiling of use of a trait whose definition is ambiguous (https://github.com/peachpiecompiler/peachpie/issues/1063)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.24(Sep 6, 2022)

    • custom PDO drivers can be registered by extensions (https://github.com/peachpiecompiler/peachpie/issues/1057)
    • compiler analyses types of varargs
    • mysqli options relative paths are resolved
    • PhpValue can be cast to decimal (in C#)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.23(Jul 25, 2022)

  • v1.0.22(Jul 21, 2022)

  • v1.0.20(May 6, 2022)

    Maintenance release including a fix for strtotime.

    • strtotime() handles invalid time during day-light-saving, does not throw, returns adjusted time instead (as in PHP).
    Source code(tar.gz)
    Source code(zip)
  • v1.0.19(Apr 16, 2022)

    Maintenance release of PeachPie;

    This fixes a very annoying issue where fatal exceptions are not logged and not even passed to the next request middleware (in the result they were not even shown by the developer's exception page).

    An option "mysql.default_command_timeout" was added, so it is possible to restrict MySql exec/query with a timeout. This works even after the connection was made.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.17(Feb 12, 2022)

  • v1.0.16(Feb 10, 2022)

  • v1.0.15(Feb 10, 2022)

  • v1.0.14(Jan 31, 2022)

  • v1.0.12(Jan 24, 2022)

    The release improves interoperability features and fixes compiler code analysis.

    Fixes

    • array item assignment compilation fix (https://github.com/peachpiecompiler/peachpie/issues/1015)
    • properly unboxing value types
    • compiler calls methods on enums and other value types properly
    • compiler allows calling methods/properties on CLR arrays (like $arr->Length)
    • runtime null-ref fixes

    New Features

    • MySql driver allows using .NET benchmarking tools like MiniProfiler
    • passing values from PHP to C# methods with object typed parameter boxes the PHP value into CLR object (does not convert it to PHP class)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.11(Jan 11, 2022)

    • fixes cURL cookie handling
    • fixes stream_select() when running for long time https://github.com/peachpiecompiler/peachpie/issues/1011
    • fixes class autoloading when class name is prefixed with \ https://github.com/peachpiecompiler/peachpie/issues/1012
    • avoids some allocations during string operations
    Source code(tar.gz)
    Source code(zip)
  • v1.0.10(Dec 29, 2021)

    Maintenance release containing bug fixes.

    • strtotime() respects current timezone (https://github.com/peachpiecompiler/peachpie/issues/1009)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.9(Dec 23, 2021)

    Improvements

    • properties from C#' explicit type declaration can be used in PHP
    • dynamic method call deals with CLR' ref parameters
    • PHP' array implicit cast to C# Dictionary<,> #997
    • dynamic method call implicitly casts between int/long and enum
    • generated IL of array initializers is smaller #1000
    • using MySqlConnector version 2.0.0

    Fixes

    • fixes chr() for ascii printable characters #981
    • fixes rawurlencode() to comply with RFC 3986 #998
    • fixes PDO's commit() and rollback() - pending data need to be disposed #990
    • class declaration done as it is in PHP #992
    • fixes type inferring in loops #993
    • cURL requests maintain cookies during subsequent execs #999
    • fixes type inferring in functions with indirect variable access and unset/export/eval/include #1002
    • fixes stream_socket_accept() and $timeout: previous unfinished accept was not ended, socket server was unusable
    • stream_socket_server() handles the stream context "socket" options
    Source code(tar.gz)
    Source code(zip)
  • v1.0.8(Oct 9, 2021)

    What's Changed

    • fixed empty() and isset() semantic with __isset() and __get() magic methods https://github.com/peachpiecompiler/peachpie/issues/979
    • fixed a few library functions argument handling
    • fixed nullability check https://github.com/peachpiecompiler/peachpie/commit/18924c998c4d51873e1b2f80460b79a7c8a81843
    • fixed bcmod https://github.com/peachpiecompiler/peachpie/commit/00d5cdb3b86845041ecfadc98e686cd2e3b902be
    • added mysqli_fetch_column, fetch_column
    • more fixes

    New Contributors

    • @andrew-demb made their first contribution in https://github.com/peachpiecompiler/peachpie/pull/976
    • @TomatorCZ for discovering issues and finding fixes
    • @Firensis for running semantic analysis on the peachpie code

    Full Changelog: https://github.com/peachpiecompiler/peachpie/compare/v1.0.6...v1.0.8

    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Jun 15, 2021)

    Next minor release of the PeachPie platform. Implements and fixes the following major issues:

    New Features

    • PHP 8.1 language syntax support (never, oct number syntax) (see #959 for progress)
    • smaller emitted IL in case of default value types
    • PdoStatement is enumerable
    • ArrayObject is enumerable
    • memory_limit not reported as unsupported
    • optimizations

    Fixes

    • #957 list with nested arrays does not crash the compiler
    • PDO FETCH_COLUMN
    • fixes ArrayObject
    • fixes array key numeric conversions

    https://github.com/peachpiecompiler/peachpie/compare/v1.0.5...v1.0.6

    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Apr 24, 2021)

    Next release of the PeachPie platform for .NET. New features, maintenance, mostly fixes.

    See the full list of changes at https://github.com/peachpiecompiler/peachpie/compare/v1.0.0...v1.0.5

    Features

    • number conversions are culture invariant
    • avoids some allocations
    • compatible DateTime representation
    • &new operation won't create a referenced value anymore, just a warning diagnostic
    • better debug sequence points
    • parser respects 8bit string literals
    • improved support for System.Nullable{T} CLR type
    • support for System.Decimal CLR type
    • support for value types (structs passed from outside)
    • "date.timezone" option
    • emits smaller IL in general

    Fixes

    • nullref issues with printf, spritnf, vsprintf
    • comparison of 8bit string values
    • compilation of ambiguous classes containing trait uses
    • and more!
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-preview5(Jan 11, 2021)

    https://www.nuget.org/packages/Peachpie.NET.Sdk/1.0.0-preview5

    5th preview release: mainly fixes bugs and implements more or PHP's BCL

    Release highlights:

    Improvements & Compatibility

    • casting double to string respects invariant culture https://github.com/peachpiecompiler/peachpie/commit/a960e1f51b1bbf4e877c420dc4860a0852c1214e
    • ReflectionAttribute::newInstance()
    • bcmath implementation
    • get_mangled_object_vars()
    • updates ini options
    • fscanf(), vfprintf()
    • password_algos()
    • PhpToken, token_name()

    ASP.NET

    • correct session_name() on asp.net https://github.com/peachpiecompiler/peachpie/commit/7416187b93ed8d9daf8497a50ddb5e607a45493c
    • session state is shared with $_SESSION items

    Fixes

    • NullReferenceException when compiling an empty attribute
    • NullReferenceException when function returns void https://github.com/peachpiecompiler/peachpie/issues/887
    • sscanf() with more than one output parameter https://github.com/peachpiecompiler/peachpie/issues/889
    • PCRE \p followed by single letter https://github.com/peachpiecompiler/peachpie/issues/886
    • duplicit Compile items https://github.com/peachpiecompiler/peachpie/issues/890
    • empty type information infered by compiler https://github.com/peachpiecompiler/peachpie/issues/882
    • .NET indexers readded (e.g. access to Dictionary) https://github.com/peachpiecompiler/peachpie/commit/65e01e3dbf66bdfeadf09b41d54fd19a07bccd98
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-preview4(Dec 5, 2020)

    The 4th preview release introduces performance improvements, new features, and fixes.

    New Features

    • emitting and understanding C#-8 like nullability context
    • compiler evaluates more expressions, arithmetic, file_exists(), constants, inclusions
    • simplified emitted code for functions that return a value or FALSE
    • improved type analysis
    • nested CLR classes can be used

    ASP.NET Core

    • PHP warnings and notices logged using Microsoft.Extensions.Logging.ILoggerFactory
    • enabled support for composer autoload-files
    • correct resolution of requested script

    PHP 8.0 Compatibility

    • initial support for PHP 8 attributes
    • constructor properties
    • union types
    • str_contains(), fdiv(), Stringable, ValueError, etc.
    • T_* constants
    • ReflectionAttribute

    see https://github.com/peachpiecompiler/peachpie/issues/765 for the progress on PHP 8 compatibility

    Fixes

    • library functions updated
    • library functions signature compatible with PHP
    • removed functions and classes that supposed to be internal
    • library functions categorized under correct extension names
    • PDO fetchAll() fix for FETCH_GROUP
    • DateInterval, curl_multi, wordwrap() fixes
    • each() correctly copies returned value
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-preview3(Oct 20, 2020)

    Third preview release fixes and implements the following features:

    • Implements curl_reset() (fixes guzzle)
    • asp net core request handler understands the requested path info
    • double to string conversion respect the PHP notation (INF, NAN)
    • fstat on Unix
    • SimpleXmlElement is json serializable
    • more eventual runtime error messages
    • fewer allocations in runtime and libraries
    • fixed autoloading mechanism when there are PHPDoc comment in the file (improves perf. of composer packages)
    • fixed invalid IL generated by typed __invoke function (fixes guzzle)
    • fixed stream_select() on SSL sockets (fixes SMTP plugin https://github.com/iolevel/wpdotnet-sdk/issues/70)
    • fixed array_merge and array_merge_recursive (fixes Elementor plugin https://github.com/iolevel/wpdotnet-sdk/issues/90)
    • fixed reflection of variadic function parameters (noticeable in case of max and min)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-preview2(Oct 4, 2020)

    This release fixes the previous 1.0.0-preview1 release.

    • PHP 8 Stringable interface
    • added set_time_limit()
    • added Sdk property: $(BasePath)
    • emits debug sequence points for property initializers
    • fixes run of phpunit project
    • DirectoryIterator and SplFileInfo uses internal stream wrappers
    • phar stream wrappers for file_exists()
    • fixes array_unique()
    • fixes DateInterval
    • fix: property initializer can be a conditional expression
    • fix: compile-time conversion from void to NULL
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-preview1(Sep 2, 2020)

    This release is the first preview of the upcoming version 1.0.0. NuGet packages are versioned as 1.0.0-preview1. See https://www.peachpie.io/getstarted for creating new projects with PeachPie. Update existing projects by changing the version accordingly.

    What's new

    Supported PHP 8.0 features

    • Non-capturing catches
    • Throw expression
    • match expression
    • ::class on variables
    • union types
    • Trailing comma in parameter lists
    • Constructor property promotion

    Improvements

    • base class library fixes
    • parsing HEREDOC fixes
    • parse_ini improvements
    • XML and DOM updates
    • stability improvements
    • performance improvements (fewer allocations)

    ASP.NET Core integration

    • add support for netstandard2.0 (netstandard2.0, netstandard2.1, netcoreapp3.0, netcoreapp3.1, net5.0)
    • new API for request handling app.UsePhp( options ) and services.AddPhp( options )
    • see https://docs.peachpie.io/net/hosting/aspnetcore/ for details
    Source code(tar.gz)
    Source code(zip)
  • v0.9.990(Jun 19, 2020)

    BCL

    • more image* functions
    • more PDO constants
    • some PHP 8 functions
    • pcre update, support for newline modifiers
    • SimpleXMLElement::saveXML

    Compiler:

    • include resolved in compile time if possible
    • more diagnostics
    • traits CLI names sanitized
    • cleaner compilation of func_get_args()
    • improved analysis perf
    • arrow functions support
    • PHP7+ doublequoted string unicode codepoints

    ASP.NET Core

    • AddPhp() with options
    • referenced PHP scripts added automatically (no need to specify website dll)

    PHP 8.0

    • bcl functions
    • property can be set to 8.0
    • throw expressions
    • non-capturing catch
    • trailing comma in param list
    • mixed type
    • constructor property promotion
    • all the syntax parsed, the rest of features ignored

    Fixes

    • json_last_error() resets after json_encode()
    • request handler nullref fix
    • deadlock fix in high load
    • nonblocking aspnetcore request handler
    • finally block fix in generators
    • indexer for CLR types

    Sdk:

    • checks composer.json versions and spdx validity
    • sdk adds references to specific PDO driver from information in "require" section
    Source code(tar.gz)
    Source code(zip)
  • v0.9.980(May 10, 2020)

    • BCL

      • shell_exec on Unix fixes (https://github.com/iolevel/wpdotnet-sdk/issues/76)
      • PDOStatement::errorInfo(), PDOStatement::errorCode(), PDOException::errorInfo (https://github.com/peachpiecompiler/peachpie/issues/234)
      • PDO named parameters in format :name supported (https://github.com/peachpiecompiler/peachpie/issues/748)
      • base64_decode() strictness (https://github.com/peachpiecompiler/peachpie/issues/739, https://github.com/iolevel/wpdotnet-sdk/issues/70)
      • fastcgi_finish_request() (https://github.com/peachpiecompiler/peachpie/issues/737)
      • updated MySql connector
      • PCRE support for UTF-8 byte sequences (https://github.com/peachpiecompiler/peachpie/issues/738)
    • Compiler

      • yield from try/catch/finally (https://github.com/peachpiecompiler/peachpie/issues/604)
      • return from finally
    • Composer Autoloading (https://docs.peachpie.io/php/composer-json/)

      • "autoload" section of composer.json is processed in build time
      • autoloaded classes annotated in build time
      • autoloading is optimized by compiler and runtime
      • autoloading does not need generated autoload stubs, handled in runtime implicitly
    • ASP.NET Core

      • referenced PHP projects loaded automatically (ScriptLibraries option only needed to restrict what assemblies to be loaded)
      • request timeout and request end support
      • $_SERVER['HTTPS'] set to '"on"' on secure connections (previously it was true)
    Source code(tar.gz)
    Source code(zip)
  • v0.9.970(Apr 27, 2020)

    Whats new:

    • PDO:
      • PDO::ATTR_STRINGIFY_FETCHES
    • Sdk:
      • resolves dependencies from composer.json
    • BCL
      • filter_var filters
      • preg_filter
      • sockets
      • lots of Core constants
      • ftp_exec, sapi_windows_vt100_support
      • getprotobyname, getprotobynumber
      • stream_socket_enable_crypto
      • shell_exec() on Unix
    Source code(tar.gz)
    Source code(zip)
  • 0.9.961(Apr 19, 2020)

Owner
PeachPie Compiler Platform
PeachPie Compiler Platform is a PHP 7 language implementation built on top of .NET and Roslyn. The project is currently maintained by the company iolevel.
PeachPie Compiler Platform
High performance view templating API for PHP applications using tags & expressions inspired by Java JSTL and C compiler

View Language API Table of contents: About Expressions Tags Configuration Compilation Installation Unit Tests Examples Reference Guide About This API

Lucian Gabriel Popescu 0 Jan 9, 2022
MassPlugCompiler - Textpattern CMS plugin compiler

mtxpc mtxpc compiles Textpattern CMS plugin sources into installer packages. Supports multi-file structure and a JSON manifest file. Install Using Com

Jukka Svahn 5 Apr 15, 2022
Run PHP scripts on the fly at runtime on a PocketMine-MP server (useful for debugging)

Scripter Run PHP scripts on the fly at runtime on a PocketMine-MP server. This is useful for runtime debugging, when you don't want to restart the ser

Dylan's PocketMine-MP Plugins 15 Jul 28, 2022
PHP Runtime Layer for AWS Lambda

PHP Layer For AWS Lambda Ever wanted to run PHP websites in AWS Lambda? It's your lucky day! This Lambda Runtime Layer runs the PHP 7.3/7.1 webserver

Stackery 319 Nov 30, 2022
A tool to create php lambda's in AWS via custom runtime api

Getting Started This composer library assists in the creation, configuration, and testing of an AWS Lambda function. It utilizes the AWS Lambda custom

Mike McGrath 0 Jul 13, 2022
Runtime Code Generator like Lombok for PocketMine-MP

PlumbokPM Runtime Code Generator like Lombok for PocketMine-MP. Code generation starts when additional autoloader detects class uses PlumbokPM annotat

OctoPush 4 Apr 18, 2022
A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.

Net A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package. Features: No hard dependencies; Favours

Minibase 16 Jun 7, 2022
A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.

Net A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package. Features: No hard dependencies; Favours

Minibase 16 Jun 7, 2022
Community-created, unofficial PHP SDK for the Skynet Decentralized Internet Network. siasky.net

Skynet PHP SDK This SDK is a community-created, unofficial SDK in PHP for the Skynet Decentralized Internet Network. It is taken as primarily a port f

Derrick Hammer 4 Dec 26, 2022
An open source Minecraft server (true-og.net)

true-og An open source Minecraft server (true-og.net) Website forked from aviel900 https://www.spigotmc.org/resources/minecraft-one-page-template.5973

Alex Noyle 0 Nov 28, 2022
A Slack integration to post GIF replies from replygif.net

Archibald Archibald is a Slack integration written in PHP to post tag-selected GIF replies from replygif.net into your current Slack channel or Direct

Lukas Gächter 11 Nov 1, 2020
This is Laravel Framework. Referral User Management System, Payment using Coinpayment.net. etc

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Worlddev5007 12 Aug 26, 2022
Plugin de Wordpress para criar um Hacker News-like para o ManualdoUsuario.net

?? Órbita Plugin de Wordpress para criar um painel de debates baseado em links, similar ao Hacker News, para o Manual do Usuário. Rodar o projeto Requ

Gabriel Nunes 7 Nov 14, 2022
🏆 Learn You PHP! - An introduction to PHP's core features: i/o, http, arrays, exceptions and so on.

Learn You PHP! The very first PHP School workshop. A revolutionary new way to learn PHP Bring your imagination to life in an open learning eco-system

PHP School 311 Dec 30, 2022
Minimalist PHP frame for Core-Library, for Developing PHP application that gives you the full control of your application.

LazyPHP lightweight Pre-Made Frame for Core-library Install Run the below command in your terminal $ composer create-project ryzen/lazyphp my-first-pr

Ry-Zen 7 Aug 21, 2022
Cadre is a free and open-source PHP staff management system that is built on Bootstrap and Core Boxx.

CADRE Cadre is a free and open-source PHP Staff Management System. Not the best in the world, but this simple portal has the basic features to help sm

Code Boxx 3 Sep 26, 2022
YesilCMS is based on BlizzCMS and specifically adapted for VMaNGOS Core and includes new features and many bug fixes.

YesilCMS · YesilCMS is based on BlizzCMS and specifically adapted for VMaNGOS Core and includes new features and many bug fixes. Features In addition

yesilmen 12 Jan 4, 2023
Core - ownCloud gives you freedom and control over your own data.

ownCloud Core ownCloud gives you freedom and control over your own data. A personal cloud which runs on your own server. Why is this so awesome? ?? Ac

ownCloud 7.9k Jan 4, 2023
Performance fixes for magento 2 core.

magento2-performance-fixes Performance fixes for magento 2 core. Problem and solution's concept - briefly PHP / Magento doesn't support concurency req

Mariusz Łopuch 48 Dec 30, 2022