15echo
"Making dist for $build_dir\n";
22@
mkdir(
"$dist_dir/ext");
23@
mkdir(
"$dist_dir/dev");
24@
mkdir(
"$dist_dir/extras");
34 static $no_dist = array(
36 'advapi32.dll',
'comdlg32.dll',
'crypt32.dll',
'gdi32.dll',
'kernel32.dll',
'ntdll.dll',
37 'odbc32.dll',
'ole32.dll',
'oleaut32.dll',
'rpcrt4.dll',
38 'shell32.dll',
'shlwapi.dll',
'user32.dll',
'ws2_32.dll',
'ws2help.dll',
39 'comctl32.dll',
'winmm.dll',
'wsock32.dll',
'winspool.drv',
'msasn1.dll',
40 'secur32.dll',
'netapi32.dll',
'dnsapi.dll',
'psapi.dll',
'normaliz.dll',
41 'iphlpapi.dll',
'bcrypt.dll',
47 'libhttpd.dll',
'libapr.dll',
'libaprutil.dll',
'libapr-1.dll',
'libaprutil-1.dll',
50 'oci.dll',
'ociw32.dll',
53 'libcs.dll',
'libct.dll',
67 static $no_dist_re = array(
68 "api-ms-win-crt-.+\.dll",
76 $cmd =
"$GLOBALS[build_dir]\\deplister.exe \"$module\" \"$GLOBALS[build_dir]\"";
78 array(1 => array(
"pipe",
"w")),
82 while (($line =
fgetcsv($pipes[1]))) {
99 foreach ($no_dist_re as $re) {
135 foreach (
$list as $item) {
139 echo
"WARNING: $item not found\n";
143 echo
"Copying $item from $source_dir to $dest_dir\n";
146 $itemdb =
preg_replace(
"/\.(exe|dll|lib)$/i",
".pdb", $item);
148 copy(
"$source_dir/$itemdb",
"$dist_dir/dev/$itemdb");
173 $name = $pkg .
'-' . $packages[$pkg];
174 $tarball = $dest_dir .
"/" .
$name .
'.tgz';
184 if (
strlen($hdr_data) == 0)
187 for ($i = 0; $i < 148; $i++)
188 $checksum +=
ord($hdr_data[$i]);
189 for ($i = 148; $i < 156; $i++)
191 for ($i = 156; $i < 512; $i++)
192 $checksum +=
ord($hdr_data[$i]);
194 $hdr =
unpack(
"a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor", $hdr_data);
196 $hdr[
'checksum'] =
octdec(
trim($hdr[
'checksum']));
198 if ($hdr[
'checksum'] != $checksum) {
199 echo
"Checksum for $tarball $hdr[filename] is invalid\n";
205 echo
"File: $hdr[filename] $hdr[size]\n";
208 echo
"Found the file we want\n";
209 $dest =
fopen($destfilename,
'wb');
212 echo
"Wrote $x bytes into $destfilename\n";
217 $size = 512 *
ceil((
int)$hdr[
'size'] / 512);
218 echo
"Skipping $size bytes\n";
227copy(
"$build_dir/php.exe",
"$dist_dir/php.exe");
233copy(
"$build_dir/$phplib",
"$dist_dir/dev/$phplib");
237 copy(
"$build_dir/$phppdb",
"$dist_dir/dev/$phppdb");
252 "LICENSE" =>
"license.txt",
253 "NEWS" =>
"news.txt",
254 "README.md" =>
"README.md",
255 "README.REDIST.BINS" =>
"readme-redist-bins.txt",
256 "php.ini-development" =>
"php.ini-development",
257 "php.ini-production" =>
"php.ini-production"
266 "$GLOBALS[build_dir]\\deplister.exe" =>
"deplister.exe",
278This snapshot was automatically generated on
290fwrite(
$fp,
"===========================\r\n");
291foreach (
$exts as $ext) {
303 fwrite(
$fp,
"===========================\r\n");
304 foreach ($deps as
$dll) {
319 echo
"WARNING: distro depends on $dll, but could not find it on your system\n";
336 array(
'',
'glib-2.dll'),
337 array(
'',
'gmodule-2.dll'),
339if (
file_exists(
"$php_build_dir/bin/libenchant2.dll")) {
340 $ENCHANT_DLLS[] = array(
'lib/enchant',
'libenchant2_hunspell.dll');
342 $ENCHANT_DLLS[] = array(
'lib/enchant',
'libenchant_myspell.dll');
346 $dest =
"$dist_dir/$dll[0]";
350 if (!
mkdir(
"$dest", 0777,
true)) {
351 echo
"WARNING: couldn't create '$dest' for enchant plugins ";
356 echo
"WARNING: couldn't copy $filename into the dist dir";
363 $openssl_dest_dir =
"$dist_dir/extras/ssl";
365 if (!
mkdir($openssl_dest_dir, 0777,
true)) {
366 echo
"WARNING: couldn't create '$openssl_dest_dir' for OpenSSL providers ";
369 foreach (
$fls as $fl) {
371 echo
"WARNING: couldn't copy $fl into the $openssl_dest_dir";
379 $sasl_dest_dir =
"$dist_dir/sasl2";
381 if (!
mkdir(
"$sasl_dest_dir", 0777,
true)) {
382 echo
"WARNING: couldn't create '$sasl_dest_dir' for SASL2 auth plugins ";
385 foreach (
$fls as $fl) {
387 echo
"WARNING: couldn't copy $fl into the $sasl_dest_dir";
402 echo
"WARNING: distro depends on $dll, but could not find it on your system\n";
419 while (($f =
readdir($d)) !==
false) {
420 if ($f ==
'.' || $f ==
'..' || $f ==
'.svn') {
424 $fd = $dest .
'/' . $f;
438 if(
substr($directory,-1) ==
'/') {
439 $directory =
substr($directory,0,-1);
442 if ($directory ==
'tests' || $directory ==
'examples') {
443 if (!
is_dir($dest .
'/tests')) {
444 mkdir($dest .
'/tests', 0775,
true);
446 copy_dir($directory, $dest .
'/tests/');
452 echo
"failed... $directory\n";
456 $directory_list =
opendir($directory);
459 $full_path = $directory .
'/' .
$file;
461 if (
$file ==
'tests' ||
$file ==
'examples') {
462 if (!
is_dir($dest .
'/' . $full_path)) {
463 mkdir($dest .
'/' . $full_path , 0775,
true);
465 copy_dir($full_path, $dest .
'/' . $full_path .
'/');
482 $path_to_phar =
realpath(__DIR__ .
'/../../ext/phar');
484 echo
"Generating pharcommand.phar\n";
485 $phar =
new Phar(
$dist_dir .
'/pharcommand.phar', 0,
'pharcommand');
492 echo
'adding ',
$file,
"\n";
497 $stub =
file($path_to_phar .
'/phar/phar.php');
502 echo
"Creating phar.phar.bat\n";
527 mkdir(
"$dist_dir/PEAR");
528 mkdir(
"$dist_dir/PEAR/go-pear-bundle");
531 echo
"Downloading go-pear\n";
532 copy(
"https://pear.php.net/go-pear.phar",
"$dist_dir/PEAR/go-pear.php");
535 include
"pear/go-pear-list.php";
538 echo
"Fetching packages\n";
540 foreach ($packages as
$name => $version) {
542 $destfilename =
"$dist_dir/PEAR/go-pear-bundle/$filename";
545 $url =
"http://pear.php.net/get/$filename";
546 echo
"Downloading $name from $url\n";
548 copy($url, $destfilename);
551 echo
"Download complete. Extracting bootstrap files\n";
562 $items =
glob(
"$snapshot_template/*");
565 foreach ($items as $item) {
568 if ($bi ==
'dlls' || $bi ==
'symbols') {
570 }
else if ($bi ==
'PEAR') {
577 copy_dir($item,
"$dist_dir/extras/$bi");
580 if ($bi ==
'go-pear.bat') {
582 copy($item,
"$dist_dir/$bi");
585 copy($item,
"$dist_dir/extras/$bi");
591 $items =
glob(
"$snapshot_template/dlls/*.CRT");
593 foreach ($items as $item) {
597 copy_dir($item,
"$dist_dir/ext/$bi");
601 echo
"WARNING: you don't have a snapshot template, your dist will not be complete\n";
proc_open(array|string $command, array $descriptor_spec, &$pipes, ?string $cwd=null, ?array $env_vars=null, ?array $options=null)
octdec(string $octal_string)
implode(string|array $separator, ?array $array=null)
readdir($dir_handle=null)
fprintf($stream, string $format, mixed ... $values)
trim(string $string, string $characters=" \n\r\t\v\0")
in_array(mixed $needle, array $haystack, bool $strict=false)
file_exists(string $filename)
file_get_contents(string $filename, bool $use_include_path=false, $context=null, int $offset=0, ?int $length=null)
file(string $filename, int $flags=0, $context=null)
explode(string $separator, string $string, int $limit=PHP_INT_MAX)
fgetcsv($stream, ?int $length=null, string $separator=",", string $enclosure="\"", string $escape="\\")
stream_copy_to_stream($from, $to, ?int $length=null, int $offset=0)
str_replace(array|string $search, array|string $replace, string|array $subject, &$count=null)
closedir($dir_handle=null)
opendir(string $directory, $context=null)
copy(string $from, string $to, $context=null)
file_put_contents(string $filename, mixed $data, int $flags=0, $context=null)
is_file(string $filename)
fwrite($stream, string $data, ?int $length=null)
strtolower(string $string)
unpack(string $format, string $string, int $offset=0)
fopen(string $filename, string $mode, bool $use_include_path=false, $context=null)
glob(string $pattern, int $flags=0)
print_r(mixed $value, bool $return=false)
mkdir(string $directory, int $permissions=0777, bool $recursive=false, $context=null)
basename(string $path, string $suffix="")
substr(string $string, int $offset, ?int $length=null)
if(isset($argc) && $argc > 1) $proc
const DIRECTORY_SEPARATOR
if(!extension_loaded('zip')) $fp
if(! $pass2) elseif( $pass2==1) elseif( $pass2==2)
copy_text_file($source, $dest)
if(!empty($fls)) $SASL_DLLS
foreach($ENCHANT_DLLS as $dll) $OPENSSL_DLLS
copy_test_dir($directory, $dest)
extract_file_from_tarball($pkg, $filename, $dest_dir)
foreach($extra_dll_deps as $dll) $ENCHANT_DLLS
foreach($text_files as $src=> $dest) $general_files
make_phar_dot_phar($dist_dir)
if(!empty($fls)) foreach( $pecl_dll_deps as $dll) copy_dir($source, $dest)
foreach($general_files as $src=> $dest) $branch
if(!is_dir($test_dir)) $dirs
if(sizeof($pecl_targets)) $text_files
copy_file_list($source_dir, $dest_dir, $list)
date(string $format, ?int $timestamp=null)
preg_replace(string|array $pattern, string|array $replacement, string|array $subject, int $limit=-1, &$count=null)
preg_match(string $pattern, string $subject, &$matches=null, int $flags=0, int $offset=0)
get_loaded_extensions(bool $zend_extensions=false)
extension_loaded(string $extension)
gzopen(string $filename, string $mode, int $use_include_path=0)
gzread($stream, int $length)
gzseek($stream, int $offset, int $whence=SEEK_SET)