-
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.
- Loading branch information
Showing
31 changed files
with
410 additions
and
111 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
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,18 @@ | ||
<?php | ||
|
||
namespace Controllers\Camera\Param; | ||
|
||
use Exception; | ||
|
||
class OnvifEnable | ||
{ | ||
/** | ||
* Check that Onvif enable is valid | ||
*/ | ||
public static function check(string $enable) : void | ||
{ | ||
if ($enable != "true" and $enable != "false") { | ||
throw new Exception('Onvif enable is invalid'); | ||
} | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Controllers\Camera\Param; | ||
|
||
use Exception; | ||
|
||
class OnvifPort | ||
{ | ||
/** | ||
* Check that port is valid | ||
*/ | ||
public static function check(string $port) : void | ||
{ | ||
if (empty($port)) { | ||
return; | ||
} | ||
|
||
if ($port < 0 or $port > 65535) { | ||
throw new Exception('Onvif port is invalid'); | ||
} | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
namespace Controllers\Camera\Param; | ||
|
||
use Exception; | ||
|
||
class OnvifUri | ||
{ | ||
/** | ||
* Check that URI is valid | ||
*/ | ||
public static function check(string $uri) : void | ||
{ | ||
if (empty($uri)) { | ||
return; | ||
} | ||
|
||
/** | ||
* Check that URI is valid | ||
* Should start with '/' or '?' and contain only allowed characters | ||
*/ | ||
if (!preg_match('/^[\?\/a-zA-Z0-9\-\_\&\=\%]+$/', $uri)) { | ||
throw new Exception('Invalid ONVIF URI'); | ||
} | ||
} | ||
} |
Oops, something went wrong.