Twig PHP extension binaries for Windows

Twig PHP extension binaries for Windows

Difficulty: 
Piece of Cake

We were not able to find a compiled version of the Twig PHP C extension for windows so we compiled them from PHP 5.6 NTS. Download here.

If you need a binary for another platform or PHP version, contact us.

Are you running PHP on Windows or Azure? Consume the .Net framework from PHP thanks to NetPhp.

A piece of code writen in C# like this:

string javascript = "";
Microsoft.Ajax.Utilities.Minifier m = new Microsoft.Ajax.Utilities.Minifier();
Microsoft.Ajax.Utilities.CodeSettings settings = new Microsoft.Ajax.Utilities.CodeSettings();
settings.OutputMode = Microsoft.Ajax.Utilities.OutputMode.SingleLine;
settings.PreserveFunctionNames = false;
string minified = m.MinifyJavaScript(javascript, settings);

Will look like this on PHP:

$minifier = netMinifier::Minifier_Constructor();
$settings = netCodeSettings::CodeSettings_Constructor();
$csssettings = \ms\Microsoft\Ajax\Utilities\netCssSettings::CssSettings_Constructor();
$settings->OutputMode(\ms\Microsoft\Ajax\Utilities\netOutputMode::SingleLine());
$settings->PreserveFunctionNames(FALSE);
$settings->QuoteObjectLiteralProperties(TRUE);
$result = $minifier->MinifyStyleSheet($css, $csssettings, $settings)->Val();

Add new comment

By: root Wednesday, October 28, 2015 - 10:01