-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating to FRITZ!OS 7.50 new services; code review; minor optimizati…
…ons and improvements; updating READ.ME
- Loading branch information
1 parent
ad533ff
commit 8ee3712
Showing
40 changed files
with
723 additions
and
179 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/generator.php | ||
/composer.lock | ||
/test.php | ||
/tester.php | ||
/auto/ | ||
/vendor/ | ||
/src/classgenerator.php | ||
/docs/auraSCPD.docx | ||
/legacy |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
namespace blacksenator\fritzsoap; | ||
|
||
/** | ||
* This trait provides basic functions to adress the FRITZ!Box properly | ||
* | ||
* Copyright (c) 2023 Volker Püschel | ||
* @license MIT | ||
*/ | ||
|
||
use blacksenator\fbvalidateurl\fbvalidateurl; | ||
|
||
trait AdressTrait | ||
{ | ||
/** | ||
* sets the adresses fo the FRITZ!Box resources to access descritions (XML) | ||
* aswell as SOAP interfaces (services and actions) | ||
* | ||
* @param string $url | ||
* @return void | ||
*/ | ||
protected function setResourceAdresses(string $url) | ||
{ | ||
$validator = new fbvalidateurl; | ||
$this->url = $validator->getValidURL($url); | ||
$this->assembleServerAdress(); | ||
} | ||
|
||
/** | ||
* assemble the correct server address, depending on whether it is encrypted | ||
* or not | ||
* | ||
* @return void | ||
*/ | ||
private function assembleServerAdress() | ||
{ | ||
if ($this->url['scheme'] == 'http') { | ||
$this->fritzBoxURL = 'http://' . $this->url['host'] . ':' . self::HTTP_PORT; | ||
} elseif ($this->url['scheme'] == 'https') { | ||
$this->fritzBoxURL = 'https://' . $this->url['host'] . ':' . self::HTTPS_PORT; | ||
} else { | ||
throw new \Exception ('Could not assemble valid server address!'); | ||
} | ||
} | ||
|
||
/** | ||
* get the validated URL parameters | ||
* | ||
* @return array | ||
*/ | ||
public function getURL(): array | ||
{ | ||
return $this->url; | ||
} | ||
|
||
/** | ||
* get the server adress | ||
* | ||
* @return string | ||
*/ | ||
public function getServerAdress(): string | ||
{ | ||
return $this->fritzBoxURL; | ||
} | ||
} |
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
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
Oops, something went wrong.