Skip to content

Commit

Permalink
Merge pull request #50 from yogendra-revanna/#issue-38
Browse files Browse the repository at this point in the history
added php ini values to runtime config
  • Loading branch information
roberto-butti authored Apr 18, 2021
2 parents 19dd30e + d061771 commit 14538f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/Lens/Traits/RuntimeLens.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ private function appCaller($results, $functions)
}
}

private function getIniValues($results)
{
$labels = [
"post_max_size",
"upload_max_filesize",
];
foreach ($labels as $label) {
$results->add(
$label,
ini_get($label)
);
}
}

public function getRuntimeConfigs()
{
$results = new ResultLens();
$results->add(
"PHP Version",
phpversion()
);
$this->getIniValues($results);
$results->add(
"Current Directory",
getcwd()
Expand Down
2 changes: 1 addition & 1 deletion tests/ConsistencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function test_runtimeconfig_array()
$l = new LaraLens();
$a = $l->getRuntimeConfigs();
$this->assertIsArray($a->toArray());
$this->assertCount(20, $a->toArray());
$this->assertCount(22, $a->toArray());
}
/** @test */
public function test_database_array()
Expand Down

0 comments on commit 14538f8

Please sign in to comment.