diff options
-rw-r--r-- | maintenance/generateSchemaChangeSql.php | 8 | ||||
-rw-r--r-- | maintenance/generateSchemaSql.php | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/maintenance/generateSchemaChangeSql.php b/maintenance/generateSchemaChangeSql.php index 870dbe04e87f..31587029c95f 100644 --- a/maintenance/generateSchemaChangeSql.php +++ b/maintenance/generateSchemaChangeSql.php @@ -61,7 +61,13 @@ class GenerateSchemaChangeSql extends Maintenance { public function execute() { global $IP; $jsonPath = $this->getOption( 'json' ); - $relativeJsonPath = str_replace( "$IP/", '', $jsonPath ); + $installPath = $IP; + // For windows + if ( DIRECTORY_SEPARATOR === '\\' ) { + $installPath = strtr( $installPath, '\\', '/' ); + $jsonPath = strtr( $jsonPath, '\\', '/' ); + } + $relativeJsonPath = str_replace( "$installPath/", '', $jsonPath ); $sqlPath = $this->getOption( 'sql' ); $abstractSchemaChange = json_decode( file_get_contents( $jsonPath ), true ); diff --git a/maintenance/generateSchemaSql.php b/maintenance/generateSchemaSql.php index 0108be85e85c..14583828603e 100644 --- a/maintenance/generateSchemaSql.php +++ b/maintenance/generateSchemaSql.php @@ -62,8 +62,14 @@ class GenerateSchemaSql extends Maintenance { global $IP; $platform = $this->getOption( 'type', 'mysql' ); $jsonPath = $this->getOption( 'json', __DIR__ . '/tables.json' ); + $installPath = $IP; + // For windows + if ( DIRECTORY_SEPARATOR === '\\' ) { + $installPath = strtr( $installPath, '\\', '/' ); + $jsonPath = strtr( $jsonPath, '\\', '/' ); + } $relativeJsonPath = str_replace( - [ "$IP/extensions/", "$IP/" ], + [ "$installPath/extensions/", "$installPath/" ], '', $jsonPath ); |