diff --git a/lib/gpio/source/Pin.php b/lib/gpio/source/Pin.php index 6e5fb4a..7403885 100755 --- a/lib/gpio/source/Pin.php +++ b/lib/gpio/source/Pin.php @@ -15,7 +15,7 @@ private $value; public function __construct($pin){ - if( !is_int($pin) ) + if( !preg_match('@^\d+$@', $pin) ) throw new Exception("pin must be an integer"); diff --git a/lib/gpio/source/high.php b/lib/gpio/source/high.php index 6f6790b..45e6fe1 100755 --- a/lib/gpio/source/high.php +++ b/lib/gpio/source/high.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->value = Pin::GPIO_HIGH; + return 0; + } diff --git a/lib/gpio/source/in.php b/lib/gpio/source/in.php index 4a74ccf..7dca599 100755 --- a/lib/gpio/source/in.php +++ b/lib/gpio/source/in.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->mode = Pin::GPIO_IN; + return 0; + } diff --git a/lib/gpio/source/low.php b/lib/gpio/source/low.php index 552bc91..3ab526d 100755 --- a/lib/gpio/source/low.php +++ b/lib/gpio/source/low.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->value = Pin::GPIO_LOW; + return 0; + } diff --git a/lib/gpio/source/out.php b/lib/gpio/source/out.php index 087bb2b..3909207 100755 --- a/lib/gpio/source/out.php +++ b/lib/gpio/source/out.php @@ -22,6 +22,8 @@ /* (2) Set mode to in */ $gpio->mode = Pin::GPIO_OUT; + return 0; + } diff --git a/lib/include/php/const b/lib/include/php/const index 29db023..ca62ae7 100755 --- a/lib/include/php/const +++ b/lib/include/php/const @@ -9,11 +9,11 @@ define('DATA_DIR', ROOT_DIR.'/data'); define('CONF_DIR', ROOT_DIR.'/conf'); #define('SOURCE_DIR', ROOT_DIR.'/source'); - define('SOURCE_DIR', ROOT_DIR.'/source'); + define('SOURCE_DIR', '/home/xdrm-brackets/Desktop/git.xdr/home/xdrm-brackets/Desktop/git.xdrm.io/logauth-sats'); define('TMP_DIR', ROOT_DIR.'/tmp'); # CONFIGURATION FILES - define('SECRET_CONF', '/home/xdrm-brackets/Desktop/git.xdr/home/xdrm-brackets/Desktop/git.xdrm.io/logauth-sats'); + define('SECRET_CONF', CONF_DIR.'/machine.secret'); define('STATE_CONF', CONF_DIR.'/machine.state'); define('BRANCH_CONF', CONF_DIR.'/machine.branch'); define('ID_CONF', CONF_DIR.'/machine.id');