-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Class headers and PSR 1+2 formatting fixes.
- Loading branch information
Showing
18 changed files
with
1,067 additions
and
916 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
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
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
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,55 +1,68 @@ | ||
<?php namespace Ballen\Senitor\Entities; | ||
|
||
use Ballen\Senitor\Entities\Target; | ||
|
||
class AuthBlock | ||
{ | ||
|
||
/** | ||
* Object storage for XMWS Target Entity. | ||
* @var \Ballen\Senitor\Entities\Target | ||
*/ | ||
private $target; | ||
|
||
public function __construct(Target $target) | ||
{ | ||
$this->target = $target; | ||
} | ||
|
||
/** | ||
* Retrieve the XML authentication block for the XMWS XML request. | ||
* @return string | ||
*/ | ||
public function getXmlBlock() | ||
{ | ||
return $this->build(); | ||
} | ||
|
||
/** | ||
* Builds the XML configuration block for the XMWS transmission message. | ||
* @return string | ||
*/ | ||
private function build() | ||
{ | ||
$conflines = [ | ||
'apikey' => $this->target->getApiKey(), | ||
'authuser' => $this->target->getUser(), | ||
'authpass' => $this->target->getPassword(), | ||
]; | ||
|
||
$xmlcontent = ""; | ||
foreach ($conflines as $ckey => $cvalue) { | ||
$xmlcontent .= "<{$ckey}>{$cvalue}</{$ckey}>" . PHP_EOL; | ||
} | ||
return $xmlcontent; | ||
} | ||
|
||
/** | ||
* Returns the generated XML auth block tags. | ||
* @return string | ||
*/ | ||
public function __toString() | ||
{ | ||
return $this->getXmlBlock(); | ||
} | ||
} | ||
<?php | ||
|
||
namespace Ballen\Senitor\Entities; | ||
|
||
use Ballen\Senitor\Entities\Target; | ||
|
||
/** | ||
* Senitor | ||
* | ||
* Senitor is a PHP API client for the Sentora Web Hosting Panel Web Service Layer (XMWS) | ||
* | ||
* @author Bobby Allen <ballen@bobbyallen.me> | ||
* @license https://github.com/bobsta63/senitor/blob/master/LICENSE | ||
* @link https://github.com/bobsta63/senitor | ||
* @link http://www.bobbyallen.me | ||
* | ||
*/ | ||
class AuthBlock | ||
{ | ||
|
||
/** | ||
* Object storage for XMWS Target Entity. | ||
* @var \Ballen\Senitor\Entities\Target | ||
*/ | ||
private $target; | ||
|
||
public function __construct(Target $target) | ||
{ | ||
$this->target = $target; | ||
} | ||
|
||
/** | ||
* Retrieve the XML authentication block for the XMWS XML request. | ||
* @return string | ||
*/ | ||
public function getXmlBlock() | ||
{ | ||
return $this->build(); | ||
} | ||
|
||
/** | ||
* Builds the XML configuration block for the XMWS transmission message. | ||
* @return string | ||
*/ | ||
private function build() | ||
{ | ||
$conflines = [ | ||
'apikey' => $this->target->getApiKey(), | ||
'authuser' => $this->target->getUser(), | ||
'authpass' => $this->target->getPassword(), | ||
]; | ||
|
||
$xmlcontent = ""; | ||
foreach ($conflines as $ckey => $cvalue) { | ||
$xmlcontent .= "<{$ckey}>{$cvalue}</{$ckey}>" . PHP_EOL; | ||
} | ||
return $xmlcontent; | ||
} | ||
|
||
/** | ||
* Returns the generated XML auth block tags. | ||
* @return string | ||
*/ | ||
public function __toString() | ||
{ | ||
return $this->getXmlBlock(); | ||
} | ||
} |
Oops, something went wrong.