for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Support\Mechanics;
class MacOs extends Untrained
{
/**
* Trust the given root certificate file in the Keychain.
*
* @param string $pem
* @return void
*/
public function trustCA($pem)
$this->consoleWriter->info('Auto Trust CA Certificate, needs sudo privilege. Please provide your sudo password.');
$command = "sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain {$pem}";
$this->cli->passthru($command);
}
* Trust the given certificate file in the Mac Keychain.
* @param string $crt
public function trustCertificate($crt)
$this->consoleWriter->info('Auto Trust Certificate, needs sudo privilege. Please provide your sudo password.');
$command = "sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain {$crt}";
* Return the User's home directory path.
* @return string
public function getUserHomePath()
return $this->serverBag->get('HOME');
* Flush the host system DNS cache.
public function flushDns()
$this->consoleWriter->info('Flushing DNS. Requires sudo permissions.');
$this->cli->passthru('sudo killall -HUP mDNSResponder');