-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from myaaghubi/v1.4
V1.4
- Loading branch information
Showing
13 changed files
with
349 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,34 @@ | ||
{ | ||
"name": "myaaghubi/debench", | ||
"name": "myaaghubi/debench", | ||
"description": "A small debug/benchmark helper for PHP", | ||
"keywords": ["benchmark", "debug", "tool", "debench"], | ||
"homepage": "https://github.com/myaaghubi/Debench", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Mohammad Yaaghubi" | ||
} | ||
], | ||
"homepage": "https://github.com/myaaghubi/Debench", | ||
"support": { | ||
"issues": "https://github.com/myaaghubi/debench/issues", | ||
"source": "https://github.com/myaaghubi/debench" | ||
}, | ||
"keywords": [ | ||
"benchmark", | ||
"debug", | ||
"tool", | ||
"debench" | ||
], | ||
"autoload": { | ||
"classmap": ["lib/"] | ||
"classmap": [ | ||
"lib/" | ||
] | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.0" | ||
}, | ||
"config": { | ||
"platform": { | ||
"php": "8.0" | ||
} | ||
} | ||
"config": { | ||
"platform": { | ||
"php": "8.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @package Debench, SystemInfo | ||
* @link http://github.com/myaaghubi/debench Github | ||
* @author Mohammad Yaaghubi <[email protected]> | ||
* @copyright Copyright (c) 2024, Mohammad Yaaghubi | ||
* @license MIT License | ||
*/ | ||
|
||
namespace DEBENCH; | ||
|
||
class SystemInfo | ||
{ | ||
/** | ||
* Get the php version | ||
* | ||
* @return string | ||
*/ | ||
public static function getPHPVersion(): string | ||
{ | ||
return PHP_VERSION; | ||
} | ||
|
||
|
||
/** | ||
* Get the system api | ||
* | ||
* @return string | ||
*/ | ||
public static function getSystemAPI(): string | ||
{ | ||
return php_sapi_name(); | ||
} | ||
|
||
|
||
/** | ||
* Get OPCache status | ||
* | ||
* @return string | ||
*/ | ||
public static function getOPCacheStatus(): bool | ||
{ | ||
return function_exists('opcache_get_status') && is_array(opcache_get_status()) && opcache_get_status()['opcache_enabled'] == true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<div> | ||
<span title='{{@path}}:{{@lineNumber}}'>{{@name}}</span> | ||
=> Time: <b>{{@timestamp}} ms</b> ({{@percent}}%), Memory: <b>{{@memory}}</b> | ||
</div> | ||
<tr> | ||
<td title="{{@path}}:{{@lineNumber}}">{{@name}}</td> | ||
<td> => </td> | ||
<td>Time: <b>{{@timestamp}} ms</b> ({{@percent}}%)</td> | ||
<td> | </td> | ||
<td>Memory: <b>{{@memory}}</b></td> | ||
<td> | </td> | ||
<td>{{@fileName}}:{{@lineNumber}}</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<tr> | ||
<td title="PHP Version">PHP</td> | ||
<td> => </td> | ||
<td><b>{{@phpVersion}}</b></td> | ||
</tr> | ||
<tr> | ||
<td title="OPCache Status">OPCache</td> | ||
<td> => </td> | ||
<td><b>{{@opcache}}</b></td> | ||
</tr> | ||
<tr> | ||
<td title="System API">System API</td> | ||
<td> => </td> | ||
<td><b>{{@systemAPI}}</b></td> | ||
</tr> | ||
|
Oops, something went wrong.