Skip to content

Commit

Permalink
#534: Add Koowa::isDebug and Koowa::setDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
ercanozkaya committed Sep 9, 2021
1 parent d0ee439 commit 87bcf48
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions code/libraries/joomlatools/library/koowa.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ class Koowa
*/
const VERSION = '3.5.6';


/**
* Debug state
*
* @var boolean
*/
protected static $_debug;

/**
* The root path
*
Expand Down Expand Up @@ -66,6 +74,12 @@ class Koowa
*/
private function __construct($config = array())
{
if(isset($config['debug'])) {
self::$_debug = $config['debug'];
} else {
self::$_debug = (bool) getenv('KOOWA_DEBUG');
}

//Initialize the root path
if(isset($config['root_path'])) {
$this->_root_path = $config['root_path'];
Expand Down Expand Up @@ -197,6 +211,27 @@ public function getBasePath()
return $this->_base_path;
}

/**
* Enable or disable debug
*
* @param bool $debug True or false.
* @return Kodekit
*/
public static function setDebug($debug)
{
return self::$_debug = (bool) $debug;
}

/**
* Check if debug is enabled
*
* @return bool
*/
public static function isDebug()
{
return self::$_debug;
}

/**
* Proxy static method calls to the object manager
*
Expand Down

0 comments on commit 87bcf48

Please sign in to comment.