Skip to content

Commit

Permalink
feat: update vendor name
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Neundorfer committed Feb 27, 2020
1 parent b28b282 commit fdfa5fc
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 66 deletions.
6 changes: 3 additions & 3 deletions Bugfixes/boxRendererFixes.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright 2019 LABOR.digital
* Copyright 2020 Martin Neundorfer (Neunerlei)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Last modified: 2019.05.16 at 17:02
* Last modified: 2020.02.27 at 11:49
*/

namespace Labor\Dbg;
namespace Neunerlei\Dbg;

use Kint\Renderer\CliRenderer;
use Kint\Renderer\TextRenderer;
Expand Down
50 changes: 25 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,103 +2,103 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.8.1](https://github.com/labor-digital/dbg/compare/v1.8.0...v1.8.1) (2020-02-19)
### [1.8.1](https://github.com/neunerlei/dbg/compare/v1.8.0...v1.8.1) (2020-02-19)

## [1.8.0](https://github.com/labor-digital/dbg/compare/v1.7.0...v1.8.0) (2020-02-19)
## [1.8.0](https://github.com/neunerlei/dbg/compare/v1.7.0...v1.8.0) (2020-02-19)


### Features

* prepare for publication on github and packagist ([016abee](https://github.com/labor-digital/dbg/commit/016abee6f93bd86409fb4f59f6932a5f71ae1f0f))
* prepare for publication on github and packagist (016abee)

# [1.7.0](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.7.0%0Dv1.6.0#diff) (2020-01-15)
# 1.7.0 (2020-01-15)


### Features

* **trace:** add more options to the trace output ([1119adc](https://bitbucket.org/labor-digital/labor-library-dbg/commits/1119adc))
* **trace:** add more options to the trace output (1119adc)



# [1.6.0](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.6.0%0Dv1.5.1#diff) (2019-09-25)
# 1.6.0 (2019-09-25)


### Features

* add additional $short option for backtrace generation ([f4db405](https://bitbucket.org/labor-digital/labor-library-dbg/commits/f4db405))
* add additional $short option for backtrace generation (f4db405)



## [1.5.1](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.5.1%0Dv1.5.0#diff) (2019-08-06)
## 1.5.1 (2019-08-06)



# [1.5.0](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.5.0%0Dv1.4.0#diff) (2019-07-18)
# 1.5.0 (2019-07-18)


### Bug Fixes

* avoid duplicate definition of ExtendedCliRenderer and ExtendedTextRenderer classes ([598adcb](https://bitbucket.org/labor-digital/labor-library-dbg/commits/598adcb))
* avoid duplicate definition of ExtendedCliRenderer and ExtendedTextRenderer classes (598adcb)


### Features

* add additional, low performance plugins back to Kint ([8d04e98](https://bitbucket.org/labor-digital/labor-library-dbg/commits/8d04e98))
* add additional, low performance plugins back to Kint (8d04e98)



# [1.4.0](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.4.0%0Dv1.3.1#diff) (2019-07-16)
# 1.4.0 (2019-07-16)


### Features

* add de-dupe plugin to make sure kint will not render the same object over and over again (the children of an already rendered object will not be rendered again) ([7e5d1eb](https://bitbucket.org/labor-digital/labor-library-dbg/commits/7e5d1eb))
* remove namespaces as they break kint to much to be used sustainably ([2e5a497](https://bitbucket.org/labor-digital/labor-library-dbg/commits/2e5a497))
* add de-dupe plugin to make sure kint will not render the same object over and over again (the children of an already rendered object will not be rendered again) (7e5d1eb)
* remove namespaces as they break kint to much to be used sustainably (2e5a497)



## [1.3.1](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.3.1%0Dv1.3.0#diff) (2019-05-28)
## 1.3.1 (2019-05-28)


### Bug Fixes

* ajax requests now correctly respond with the text renderer ([237611c](https://bitbucket.org/labor-digital/labor-library-dbg/commits/237611c))
* ajax requests now correctly respond with the text renderer (237611c)



# [1.3.0](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.3.0%0Dv1.2.2#diff) (2019-05-23)
# 1.3.0 (2019-05-23)


### Features

* add better implemented configuration options ([3f7b7a6](https://bitbucket.org/labor-digital/labor-library-dbg/commits/3f7b7a6))
* add better implemented configuration options (3f7b7a6)



## [1.2.2](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.2.2%0Dv1.2.1#diff) (2019-05-16)
## 1.2.2 (2019-05-16)


### Bug Fixes

* duplicate output when using dbge() ([88abd6f](https://bitbucket.org/labor-digital/labor-library-dbg/commits/88abd6f))
* duplicate output when using dbge() (88abd6f)



## [1.2.1](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.2.1%0Dv1.2.0#diff) (2019-05-16)
## 1.2.1 (2019-05-16)


### Bug Fixes

* select correct renderer for default html requests ([2177d17](https://bitbucket.org/labor-digital/labor-library-dbg/commits/2177d17))
* select correct renderer for default html requests (2177d17)



# [1.2.0](https://bitbucket.org/labor-digital/labor-library-dbg/branches/compare/v1.2.0%0Dv1.1.0#diff) (2019-05-16)
# 1.2.0 (2019-05-16)


### Features

* add main sources ([2c649df](https://bitbucket.org/labor-digital/labor-library-dbg/commits/2c649df))
* add main sources (2c649df)



Expand All @@ -107,7 +107,7 @@ All notable changes to this project will be documented in this file. See [standa

### Features

* initial commit ([471be0b](https://bitbucket.org/labor-digital/labor-library-dbg/commits/471be0b))
* initial commit (471be0b)



Expand Down
6 changes: 3 additions & 3 deletions Classes/Plugins/DedupePlugin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright 2019 LABOR.digital
* Copyright 2020 Martin Neundorfer (Neunerlei)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Last modified: 2019.07.07 at 23:03
* Last modified: 2020.02.27 at 11:49
*/

namespace Labor\Dbg\Plugins;
namespace Neunerlei\Dbg\Plugins;


use Kint\Kint;
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This library is basically just a wrapper around [Kint](https://github.com/kint-p
Install this package using composer:

```
composer require labor-digital/dbg
composer require neunerlei/dbg
```

## Environment detection
Expand Down Expand Up @@ -89,8 +89,9 @@ This will output something like:
Receives any number of arguments and will dump them into a plain log file.
The logfile will be located (in order of priority):

- LABOR_DBG_LOG_DIR/labor_debug_logfile.log if this constant contains a writable directory path
- /var/www/logs/labor_debug_logfile.log if the logs directory is writable
- $_ENV["_DBG_LOG_DIR"]/dbg_debug_logfile.log if this environment variable contains a writable directory path
- dbgConfig("logDir") /dbg_debug_logfile.log if the environment variable is empty and the directory is writable
- /var/www/logs/dbg_debug_logfile.log if the logs directory is writable
- /$SYS_TEMP_DIR/labor_debug_logfile.log

```php
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "labor-digital/dbg",
"name": "neunerlei/dbg",
"description": "PHP debugging suitcase for your daily work",
"type": "library",
"license": "Apache-2.0",
Expand All @@ -13,14 +13,14 @@
},
{
"name": "Martin Neundorfer",
"email": "[email protected]",
"email": "[email protected]",
"homepage": "https://www.neunerlei.eu",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/labor-digital/dbg/issues",
"source": "https://github.com/labor-digital/dbg"
"issues": "https://github.com/neunerlei/dbg/issues",
"source": "https://github.com/neunerlei/dbg"
},
"require": {
"kint-php/kint": "^3.3",
Expand All @@ -29,7 +29,7 @@
},
"autoload": {
"psr-4": {
"Labor\\Dbg\\": "Classes/"
"Neunerlei\\Dbg\\": "Classes/"
}
},
"extra": {
Expand Down
46 changes: 25 additions & 21 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright 2019 LABOR.digital
* Copyright 2020 Martin Neundorfer (Neunerlei)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Last modified: 2019.05.16 at 14:08
* Last modified: 2020.02.27 at 11:52
*/

use Kint\Kint;
Expand Down Expand Up @@ -176,9 +176,10 @@ function logConsole(...$args) {
* Dumps the given arguments into a logfile.
*
* The logfile will be created either at:
* * LABOR_DBG_LOG_DIR/labor_debug_logfile.log if this constant contains a writable directory path
* * /var/www/logs/labor_debug_logfile.log if the logs directory is writable
* * /$SYS_TEMP_DIR/labor_debug_logfile.log
* * $_ENV["_DBG_LOG_DIR"]/dbg_debug_logfile.log if this environment variable contains a writable directory path
* * dbgConfig("logDir") /dbg_debug_logfile.log if the environment variable is empty and the directory is writable
* * /var/www/logs/dbg_debug_logfile.log if the logs directory is writable
* * /$SYS_TEMP_DIR/dbg_debug_logfile.log
*
* @param array $args
*
Expand All @@ -192,13 +193,16 @@ function logFile(...$args): bool {
_dbgIntCallHooks("preHooks", __FUNCTION__, $args);

// Try to find logfile
$logDir = dbgConfig("logDir");
if (is_string($logDir) && (is_writable(rtrim($logDir, "/\\") . "/labor_debug_logfile.log") || is_writable($logDir)))
$logFile = rtrim($logDir, "/\\") . "/labor_debug_logfile.log";
else if (is_writable("/var/www/logs/labor_debug_logfile.log") || !file_exists("/var/www/logs/labor_debug_logfile.log") && is_writable("/var/www/logs/"))
$logFile = "/var/www/logs/labor_debug_logfile.log";
else if (is_writable(sys_get_temp_dir() . "/labor_debug_logfile.log") || !file_exists(sys_get_temp_dir() . "/labor_debug_logfile.log") && is_writable("/var/www/logs/"))
$logFile = sys_get_temp_dir() . "/labor_debug_logfile.log";
$ds = DIRECTORY_SEPARATOR;
$logDir = getenv("_DBG_LOG_DIR");
if (empty($logDir)) $logDir = dbgConfig("logDir");
$logfileName = "dbg_debug_logfile.log";
if (is_string($logDir) && (is_writable(rtrim($logDir, "/\\") . $ds . $logfileName) || is_writable($logDir)))
$logFile = rtrim($logDir, "/\\") . $ds . $logfileName;
else if (is_writable("/var/www/logs/" . $logfileName) || !file_exists("/var/www/logs/" . $logfileName) && is_writable("/var/www/logs/"))
$logFile = "/var/www/logs/" . $logfileName;
else if (is_writable(sys_get_temp_dir() . $ds . $logfileName) || !file_exists(sys_get_temp_dir() . $ds . $logfileName) && is_writable("/var/www/logs/"))
$logFile = sys_get_temp_dir() . "/" . $logfileName;
else
return FALSE;

Expand Down Expand Up @@ -262,28 +266,28 @@ function logFile(...$args): bool {
* @return bool|mixed
*/
function dbgConfig(string $key = "", $value = NULL) {
if (empty($key)) return $GLOBALS["LABOR_DBG_CONFIG"];
if (!array_key_exists($key, $GLOBALS["LABOR_DBG_CONFIG"]))
if (empty($key)) return $GLOBALS["_DBG_CONFIG"];
if (!array_key_exists($key, $GLOBALS["_DBG_CONFIG"]))
throw new InvalidArgumentException("The given config key: " . $key . " was not found!");
if ($value === NULL) return $GLOBALS["LABOR_DBG_CONFIG"][$key];
if ($value === NULL) return $GLOBALS["_DBG_CONFIG"][$key];

switch ($key) {
case "preHooks":
case "postHooks":
if (is_callable($value)) $GLOBALS["LABOR_DBG_CONFIG"][$key][] = $value;
else if (is_array($value)) $GLOBALS["LABOR_DBG_CONFIG"][$key] = $value;
if (is_callable($value)) $GLOBALS["_DBG_CONFIG"][$key][] = $value;
else if (is_array($value)) $GLOBALS["_DBG_CONFIG"][$key] = $value;
else throw new InvalidArgumentException("The given value for key: " . $key . " has to be an array or a callback!");
break;
case "enabled":
$GLOBALS["LABOR_DBG_CONFIG"][$key] = Kint::$enabled_mode = $value === TRUE;
$GLOBALS["_DBG_CONFIG"][$key] = Kint::$enabled_mode = $value === TRUE;
break;
default:
$GLOBALS["LABOR_DBG_CONFIG"][$key] = $value;
$GLOBALS["_DBG_CONFIG"][$key] = $value;
}
return TRUE;
}

if (!defined("LABOR_DBG_CONFIG_LOADED")) define("LABOR_DBG_CONFIG_LOADED", TRUE);
if (!defined("_DBG_CONFIG_LOADED")) define("_DBG_CONFIG_LOADED", TRUE);
}

if (!function_exists("isDbgEnabled")) {
Expand All @@ -292,7 +296,7 @@ function dbgConfig(string $key = "", $value = NULL) {
* @return bool
*/
function isDbgEnabled(): bool {
$conf = $GLOBALS["LABOR_DBG_CONFIG"];
$conf = $GLOBALS["_DBG_CONFIG"];
return
// Check if the debugging is enabled
$conf["enabled"] === TRUE && (
Expand Down
12 changes: 6 additions & 6 deletions init.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright 2019 LABOR.digital
* Copyright 2020 Martin Neundorfer (Neunerlei)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Last modified: 2019.05.16 at 12:45
* Last modified: 2020.02.27 at 11:49
*/

// Make sure kint does not register it's helpers
Expand All @@ -30,15 +30,15 @@
use Kint\Parser\TimestampPlugin;
use Kint\Parser\ToStringPlugin;
use Kint\Renderer\RichRenderer;
use Labor\Dbg\ExtendedCliRenderer;
use Labor\Dbg\ExtendedTextRenderer;
use Labor\Dbg\Plugins\DedupePlugin;
use Neunerlei\Dbg\ExtendedCliRenderer;
use Neunerlei\Dbg\ExtendedTextRenderer;
use Neunerlei\Dbg\Plugins\DedupePlugin;

if (!defined("KINT_SKIP_HELPERS")) define("KINT_SKIP_HELPERS", TRUE);
if (!defined("KINT_SKIP_FACADE")) define("KINT_SKIP_FACADE", TRUE);

// Prepare configuration
$GLOBALS["LABOR_DBG_CONFIG"] = [
$GLOBALS["_DBG_CONFIG"] = [
"enabled" => TRUE,
"environmentDetection" => FALSE,
"envVarKey" => "PROJECT_ENV",
Expand Down

0 comments on commit fdfa5fc

Please sign in to comment.