Skip to content

Commit 8b1bc86

Browse files
author
André L F S Bacci
committed
Windows (and some ghosts)
1 parent 0bbe32b commit 8b1bc86

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

scripts/file-entities.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
ini_set( 'display_startup_errors' , 1 );
5757
error_reporting( E_ALL );
5858
set_time_limit( 0 );
59+
ob_implicit_flush();
5960

6061
// Usage
6162

@@ -139,6 +140,7 @@ function pushEntity( string $name , string $text = '' , string $path = '' )
139140
global $entities;
140141

141142
$name = str_replace( '_' , '-' , $name );
143+
$path = str_replace( '\\' , '/' , $path );
142144
$ent = new Entity( $name , $text , $path );
143145
$entities[ $name ] = $ent;
144146

@@ -147,6 +149,39 @@ function pushEntity( string $name , string $text = '' , string $path = '' )
147149
echo "Something went wrong on file-entities.php.\n";
148150
exit(-1);
149151
}
152+
153+
// While https://github.com/php/doc-en/pull/4288 is not
154+
// replicated on on all languages, let's sleeping dogs lies
155+
156+
$marks = ['!','@','#'];
157+
$parts = explode( '.' , $name );
158+
foreach( $parts as & $part )
159+
if ( strtolower( $part ) == 'pdo' )
160+
$part = array_shift( $marks );
161+
162+
$mixin = implode( '.' , $parts );
163+
$l1 = ['pdo','PDO'];
164+
$l2 = ['pdo','PDO'];
165+
$l3 = ['pdo','PDO'];
166+
167+
if ( str_contains( $mixin , '!' ) )
168+
{
169+
//echo "\n\n$mixin\n";
170+
foreach( $l1 as $s1 )
171+
foreach( $l2 as $s2 )
172+
foreach( $l3 as $s3 )
173+
{
174+
$tmp = $mixin;
175+
$tmp = str_replace( '!' , $s1 , $tmp );
176+
$tmp = str_replace( '@' , $s2 , $tmp );
177+
$tmp = str_replace( '#' , $s3 , $tmp );
178+
//echo "$tmp\n";
179+
180+
$ent = new Entity( $tmp , $text , $path );
181+
$entities[ $tmp ] = $ent;
182+
}
183+
//echo "\n";
184+
}
150185
}
151186

152187
function generate_file_entities( string $root , string $lang )

0 commit comments

Comments
 (0)