Skip to content

Commit

Permalink
Fixes composer file inclusion error
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Sep 25, 2024
1 parent 9527614 commit 0ba3095
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Composer/Concerns/HasAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ protected function assertEnvironmentReady()
ini_set('max_input_time', 0);
ini_set('max_execution_time', 0);

// Fixes function throwing an error
require_once __DIR__ . '/../resources/file_get_contents.php';

// Function may be disabled for security reasons
if (!function_exists('putenv')) {
require_once __DIR__ . '/../resources/putenv.php';
Expand Down
15 changes: 15 additions & 0 deletions src/Composer/resources/file_get_contents.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* This prevents file_get_contents from throwing an exception.
*/
namespace Composer\Repository
{
/**
* file_get_contents is not suppressed in composer
*/
function file_get_contents(...$args)
{
return @\file_get_contents(...$args);
}
}

0 comments on commit 0ba3095

Please sign in to comment.