comune-desio / azuredesio

GNU General Public License v3.0
0 stars 0 forks source link

Setups Composer and DotEnv to handle sensitive vars #1

Closed olistik closed 8 years ago

olistik commented 8 years ago
  1. Installing composer: curl -s http://getcomposer.org/installer | php
  2. Populating the package.json with the required dependency: php composer.phar require vlucas/phpdotenv
  3. Setting up autoloading so that we can use classes transparently: require __DIR__ . '/vendor/autoload.php';

Based on:

  1. https://getcomposer.org/doc/01-basic-usage.md#autoloading
  2. https://github.com/vlucas/phpdotenv#installation-with-composer
olistik commented 8 years ago
  1. create a _env file with the following content:
WUNDERGROUND_API_TOKEN="XXX"
  1. run php plugindesio/now.php

You should expect this output:

Condizioni: Parzialmente nuvoloso :partly_sunny:
Temperatura: 23.5° C
Umidità: 67%
olistik commented 8 years ago

I forgot to add that to build a local copy of the dependencies you have to run php composer.phar update