_is_cli = 'cli' === php_sapi_name(); } /** * Check if running command line session. * * @return bool Yes/No */ public function is_cli() { return $this->_is_cli; } /** * Disable DB debug when in command line session. * * @param bool $debug Current value. * * @return bool Optionally modified value. */ public function disable_db_debug( $debug ) { if ( $this->_is_cli ) { return false; } return $debug; } }