Skip to content

Commit

Permalink
**FIX** Update Tag info TasmoAdmin#180
Browse files Browse the repository at this point in the history
Former-commit-id: da2164d
  • Loading branch information
reloxx13 committed Jul 13, 2018
1 parent 88f59e8 commit 4400a06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,10 @@

## Upcoming

## v1.5.1
- **FIX** Update Tag info [#180](https://github.com/reloxx13/TasmoAdmin/issues/180)


## v1.5.0
- **NEW**: Link Tasmota Changelog Issues [#173](https://github.com/reloxx13/TasmoAdmin/issues/173)
- **NEW**: Use json file for for config data
Expand Down
18 changes: 10 additions & 8 deletions tasmoadmin/includes/Config.php
Expand Up @@ -39,7 +39,7 @@ private function setCacheConfig( $config ) {

$configJSON = json_encode( $config );

setcookie( "MyConfig", $configJSON, time()+(30*24*60*60), "/" );
setcookie( "MyConfig", $configJSON, time()+( 30*24*60*60 ), "/" );

return $configJSON;
}
Expand Down Expand Up @@ -119,7 +119,7 @@ function __construct() {
$config = $configJSON = NULL; //reset
$configJSON = file_get_contents( $this->cfgFile );
if( !$configJSON ) {
var_dump( debug_backtrace() );
// var_dump( debug_backtrace() );
die( "could not read MyConfig.json" );
} else {
$config = json_decode( $configJSON, TRUE );
Expand All @@ -128,7 +128,6 @@ function __construct() {
die( "JSON CONFIG ERROR: ".json_last_error()." => ".json_last_error_msg() );
}

$this->setCacheConfig( $config );
}

//write default config if does not exists in file
Expand All @@ -152,16 +151,19 @@ function __construct() {
}
file_put_contents( $this->cfgFile, $configJSON );

$this->setCacheConfig( $config );
}


if( empty( $config[ "current_git_tag" ] ) ) {
if( !empty( getenv( "BUILD_VERSION" ) ) ) {
$this->write( "current_git_tag", getenv( "BUILD_VERSION" ) );
}
if( !empty( getenv( "BUILD_VERSION" ) )
&& ( $config[ "current_git_tag" ] != getenv(
"BUILD_VERSION"
) ) ) {
$this->write( "current_git_tag", getenv( "BUILD_VERSION" ) );
}

$this->setCacheConfig( $config );


}

public function readAll( $inclPassword = FALSE ) {
Expand Down

0 comments on commit 4400a06

Please sign in to comment.