Jump to content

HOW TO: Easy configuration for users [php]


Recommended Posts

Hey Everyone, 

I just wanted to share my solution for using a keyword to modify an option. I added a config.json file to my workflow and require it in my script filter. This allows me easily access and modify the values.

 

Hope it helps!

 

See how I did it in my workflow:

https://github.com/kkirsche/TVRage-Alfred_Workflow

 

For mine, for time's sake, I did:

$string = file_get_contents('config.json');

$decodedJSON = json_decode($string, true);
$decodedJSON['12hrtimezone'] = true;

$encodedJSON = json_encode($decodedJSON);

file_put_contents('config.json', $encodedJSON);
Edited by R4z3r
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...