Loading a Custom Config

By default, RocketShipIt loads default parameter values from config.php. There are two ways to override this.

  1. Set your OS’s enviornment variable to the directory of your config file:

    RS_CUSTOM_CONFIG_PATH="/Users/mark"
    
  2. Pass in a config option:

    <?php
    $config = new \RocketShipIt\Config;
    // Change individual aspects of config
    $config->setDefault('generic', 'shipper', 'My shipper');
    // Or load and entirely different config.php file
    $config->loadConfigFile('/Users/mark/config.php');
    $rate = new \RocketShipIt\Rate('Dhl', array('config' => $config));