@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | // Remove a custom note type |
| 27 | 27 | $noteParameters = array( |
| 28 | - "id" => $randomCustomNoteID |
|
| 28 | + "id" => $randomCustomNoteID |
|
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | 31 | $address = new Address(); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Route; |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | $customNotes = $address->getAllCustomNoteTypes(); |
| 20 | 20 | |
| 21 | 21 | assert(!is_null($customNotes), "Can't retrieve all custom note types"); |
| 22 | -assert(sizeof($customNotes) > 0, "There is no custom note type in the user's account"); |
|
| 22 | +assert(sizeof($customNotes)>0, "There is no custom note type in the user's account"); |
|
| 23 | 23 | |
| 24 | -$randomCustomNoteID = $customNotes[rand(0,sizeof($customNotes)-1)]['note_custom_type_id']; |
|
| 24 | +$randomCustomNoteID = $customNotes[rand(0, sizeof($customNotes) - 1)]['note_custom_type_id']; |
|
| 25 | 25 | |
| 26 | 26 | // Remove a custom note type |
| 27 | 27 | $noteParameters = array( |
@@ -27,13 +27,13 @@ |
||
| 27 | 27 | |
| 28 | 28 | // Add an address note |
| 29 | 29 | $noteParameters = array( |
| 30 | - "route_id" => $route_id, |
|
| 31 | - "address_id" => $route_destination_id, |
|
| 32 | - "dev_lat" => 33.132675170898, |
|
| 33 | - "dev_lng" => -83.244743347168, |
|
| 34 | - "device_type" => "web", |
|
| 35 | - "strUpdateType" => "dropoff", |
|
| 36 | - "strNoteContents" => "Test" |
|
| 30 | + "route_id" => $route_id, |
|
| 31 | + "address_id" => $route_destination_id, |
|
| 32 | + "dev_lat" => 33.132675170898, |
|
| 33 | + "dev_lng" => -83.244743347168, |
|
| 34 | + "device_type" => "web", |
|
| 35 | + "strUpdateType" => "dropoff", |
|
| 36 | + "strNoteContents" => "Test" |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | $address = new Address(); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Route; |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // Add an address note |
| 30 | 30 | $noteParameters = array( |
| 31 | - "route_id" => $route_id, |
|
| 32 | - "address_id" => $route_destination_id, |
|
| 33 | - "dev_lat" => 33.132675170898, |
|
| 34 | - "dev_lng" => -83.244743347168, |
|
| 35 | - "device_type" => "web", |
|
| 36 | - "strUpdateType" => "dropoff", |
|
| 37 | - "strNoteContents" => "Test ". time() |
|
| 31 | + "route_id" => $route_id, |
|
| 32 | + "address_id" => $route_destination_id, |
|
| 33 | + "dev_lat" => 33.132675170898, |
|
| 34 | + "dev_lng" => -83.244743347168, |
|
| 35 | + "device_type" => "web", |
|
| 36 | + "strUpdateType" => "dropoff", |
|
| 37 | + "strNoteContents" => "Test ". time() |
|
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | $address = new Address(); |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | // Get address notes |
| 47 | 47 | $noteParameters = array( |
| 48 | - "route_id" => $route_id, |
|
| 49 | - "route_destination_id" => $route_destination_id |
|
| 48 | + "route_id" => $route_id, |
|
| 49 | + "route_destination_id" => $route_destination_id |
|
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | 52 | $address = new Address(); |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | echo "Destination note count --> ".$notes['destination_note_count']."<br>"; |
| 57 | 57 | |
| 58 | 58 | foreach ($notes['notes'] as $note) { |
| 59 | - echo "========== Notes ==================<br>"; |
|
| 60 | - echo "note_id --> ".$note['note_id']."<br>"; |
|
| 61 | - $content = isset($note['contents']) ? $note['contents'] : ""; |
|
| 62 | - if (strlen($content)>0) echo "contents --> $content"."<br>"; |
|
| 59 | + echo "========== Notes ==================<br>"; |
|
| 60 | + echo "note_id --> ".$note['note_id']."<br>"; |
|
| 61 | + $content = isset($note['contents']) ? $note['contents'] : ""; |
|
| 62 | + if (strlen($content)>0) echo "contents --> $content"."<br>"; |
|
| 63 | 63 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Route; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | "dev_lng" => -83.244743347168, |
| 35 | 35 | "device_type" => "web", |
| 36 | 36 | "strUpdateType" => "dropoff", |
| 37 | - "strNoteContents" => "Test ". time() |
|
| 37 | + "strNoteContents" => "Test ".time() |
|
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | $address = new Address(); |
@@ -59,5 +59,7 @@ |
||
| 59 | 59 | echo "========== Notes ==================<br>"; |
| 60 | 60 | echo "note_id --> ".$note['note_id']."<br>"; |
| 61 | 61 | $content = isset($note['contents']) ? $note['contents'] : ""; |
| 62 | - if (strlen($content)>0) echo "contents --> $content"."<br>"; |
|
| 63 | -} |
|
| 62 | + if (strlen($content)>0) { |
|
| 63 | + echo "contents --> $content"."<br>"; |
|
| 64 | + } |
|
| 65 | + } |
|
@@ -25,18 +25,18 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $addresses = array(); |
| 27 | 27 | foreach($json as $address) { |
| 28 | - $addresses[] = Address::fromArray($address); |
|
| 28 | + $addresses[] = Address::fromArray($address); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $parameters = RouteParameters::fromArray(array( |
| 32 | - "algorithm_type" => Algorithmtype::TSP, |
|
| 33 | - "route_name" => "Single Driver Multiple TimeWindows 12 Stops", |
|
| 34 | - "route_date" => time() + 24*60*60, |
|
| 35 | - "route_time" => 5 * 3600 + 30 * 60, |
|
| 36 | - "distance_unit" => DistanceUnit::MILES, |
|
| 37 | - "device_type" => DeviceType::WEB, |
|
| 38 | - "optimize" => OptimizationType::DISTANCE, |
|
| 39 | - "metric" => Metric::GEODESIC |
|
| 32 | + "algorithm_type" => Algorithmtype::TSP, |
|
| 33 | + "route_name" => "Single Driver Multiple TimeWindows 12 Stops", |
|
| 34 | + "route_date" => time() + 24*60*60, |
|
| 35 | + "route_time" => 5 * 3600 + 30 * 60, |
|
| 36 | + "distance_unit" => DistanceUnit::MILES, |
|
| 37 | + "device_type" => DeviceType::WEB, |
|
| 38 | + "optimize" => OptimizationType::DISTANCE, |
|
| 39 | + "metric" => Metric::GEODESIC |
|
| 40 | 40 | )); |
| 41 | 41 | |
| 42 | 42 | $optimizationParams = new OptimizationProblemParams; |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | $problem = OptimizationProblem::optimize($optimizationParams); |
| 47 | 47 | |
| 48 | 48 | foreach ((array)$problem as $key => $value) { |
| 49 | - if (is_string($value)) { |
|
| 50 | - echo $key." --> ".$value."<br>"; |
|
| 51 | - } else { |
|
| 52 | - echo "************ $key ************* <br>"; |
|
| 53 | - Route4Me::simplePrint((array)$value, true); |
|
| 54 | - echo "******************************* <br>"; |
|
| 55 | - } |
|
| 49 | + if (is_string($value)) { |
|
| 50 | + echo $key." --> ".$value."<br>"; |
|
| 51 | + } else { |
|
| 52 | + echo "************ $key ************* <br>"; |
|
| 53 | + Route4Me::simplePrint((array)$value, true); |
|
| 54 | + echo "******************************* <br>"; |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -24,14 +24,14 @@ discard block |
||
| 24 | 24 | $json = json_decode(file_get_contents('./addresses.json'), true); |
| 25 | 25 | |
| 26 | 26 | $addresses = array(); |
| 27 | -foreach($json as $address) { |
|
| 27 | +foreach ($json as $address) { |
|
| 28 | 28 | $addresses[] = Address::fromArray($address); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $parameters = RouteParameters::fromArray(array( |
| 32 | 32 | "algorithm_type" => Algorithmtype::TSP, |
| 33 | 33 | "route_name" => "Single Driver Multiple TimeWindows 12 Stops", |
| 34 | - "route_date" => time() + 24*60*60, |
|
| 34 | + "route_date" => time() + 24 * 60 * 60, |
|
| 35 | 35 | "route_time" => 5 * 3600 + 30 * 60, |
| 36 | 36 | "distance_unit" => DistanceUnit::MILES, |
| 37 | 37 | "device_type" => DeviceType::WEB, |
@@ -26,24 +26,24 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $addresses = array(); |
| 28 | 28 | foreach($json as $address) { |
| 29 | - $addresses[] = Address::fromArray($address); |
|
| 29 | + $addresses[] = Address::fromArray($address); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $parameters = RouteParameters::fromArray(array( |
| 33 | - "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
|
| 34 | - "route_name" => "Single Depot, Multiple Driver, No Time Window", |
|
| 35 | - "route_date" => time() + 24*60*60, |
|
| 36 | - "route_time" => 60 * 60 * 7, |
|
| 37 | - "rt" => TRUE, |
|
| 38 | - "distance_unit" => DistanceUnit::MILES, |
|
| 39 | - "device_type" => DeviceType::WEB, |
|
| 40 | - "optimize" => OptimizationType::TIME, |
|
| 41 | - "metric" => Metric::GEODESIC, |
|
| 42 | - "route_max_duration" => 86400, |
|
| 43 | - "travel_mode" => TravelMode::DRIVING, |
|
| 44 | - "vehicle_capacity" => 20, |
|
| 45 | - "vehicle_max_distance_mi" => 99999, |
|
| 46 | - "parts" => 4 |
|
| 33 | + "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
|
| 34 | + "route_name" => "Single Depot, Multiple Driver, No Time Window", |
|
| 35 | + "route_date" => time() + 24*60*60, |
|
| 36 | + "route_time" => 60 * 60 * 7, |
|
| 37 | + "rt" => TRUE, |
|
| 38 | + "distance_unit" => DistanceUnit::MILES, |
|
| 39 | + "device_type" => DeviceType::WEB, |
|
| 40 | + "optimize" => OptimizationType::TIME, |
|
| 41 | + "metric" => Metric::GEODESIC, |
|
| 42 | + "route_max_duration" => 86400, |
|
| 43 | + "travel_mode" => TravelMode::DRIVING, |
|
| 44 | + "vehicle_capacity" => 20, |
|
| 45 | + "vehicle_max_distance_mi" => 99999, |
|
| 46 | + "parts" => 4 |
|
| 47 | 47 | )); |
| 48 | 48 | |
| 49 | 49 | $optimizationParams = new OptimizationProblemParams; |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | $problem = OptimizationProblem::optimize($optimizationParams); |
| 54 | 54 | |
| 55 | 55 | foreach ((array)$problem as $key => $value) { |
| 56 | - if (is_string($value)) { |
|
| 57 | - echo $key." --> ".$value."<br>"; |
|
| 58 | - } else { |
|
| 59 | - echo "************ $key ************* <br>"; |
|
| 60 | - Route4Me::simplePrint((array)$value, true); |
|
| 61 | - echo "******************************* <br>"; |
|
| 62 | - } |
|
| 56 | + if (is_string($value)) { |
|
| 57 | + echo $key." --> ".$value."<br>"; |
|
| 58 | + } else { |
|
| 59 | + echo "************ $key ************* <br>"; |
|
| 60 | + Route4Me::simplePrint((array)$value, true); |
|
| 61 | + echo "******************************* <br>"; |
|
| 62 | + } |
|
| 63 | 63 | } |
| 64 | 64 | |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | $json = json_decode(file_get_contents('./addresses.json'), true); |
| 26 | 26 | |
| 27 | 27 | $addresses = array(); |
| 28 | -foreach($json as $address) { |
|
| 28 | +foreach ($json as $address) { |
|
| 29 | 29 | $addresses[] = Address::fromArray($address); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $parameters = RouteParameters::fromArray(array( |
| 33 | 33 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
| 34 | 34 | "route_name" => "Single Depot, Multiple Driver, No Time Window", |
| 35 | - "route_date" => time() + 24*60*60, |
|
| 35 | + "route_date" => time() + 24 * 60 * 60, |
|
| 36 | 36 | "route_time" => 60 * 60 * 7, |
| 37 | 37 | "rt" => TRUE, |
| 38 | 38 | "distance_unit" => DistanceUnit::MILES, |
@@ -27,19 +27,19 @@ discard block |
||
| 27 | 27 | $addresses = array(); |
| 28 | 28 | |
| 29 | 29 | foreach($json as $address) { |
| 30 | - $addresses[] = Address::fromArray($address); |
|
| 30 | + $addresses[] = Address::fromArray($address); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $parameters = RouteParameters::fromArray(array( |
| 34 | - "algorithm_type" => AlgorithmType::TSP, |
|
| 35 | - "distance_unit" => DistanceUnit::MILES, |
|
| 36 | - "device_type" => DeviceType::WEB, |
|
| 37 | - "optimize" => OptimizationType::DISTANCE, |
|
| 38 | - "travel_mode" => TravelMode::DRIVING, |
|
| 39 | - "route_max_duration" => 86400, |
|
| 40 | - "vehicle_capacity" => 1, |
|
| 41 | - "vehicle_max_distance_mi" => 10000, |
|
| 42 | - "rt" => true |
|
| 34 | + "algorithm_type" => AlgorithmType::TSP, |
|
| 35 | + "distance_unit" => DistanceUnit::MILES, |
|
| 36 | + "device_type" => DeviceType::WEB, |
|
| 37 | + "optimize" => OptimizationType::DISTANCE, |
|
| 38 | + "travel_mode" => TravelMode::DRIVING, |
|
| 39 | + "route_max_duration" => 86400, |
|
| 40 | + "vehicle_capacity" => 1, |
|
| 41 | + "vehicle_max_distance_mi" => 10000, |
|
| 42 | + "rt" => true |
|
| 43 | 43 | )); |
| 44 | 44 | |
| 45 | 45 | $optimizationParams = new OptimizationProblemParams; |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | $problems = OptimizationProblem::optimize($optimizationParams); |
| 50 | 50 | |
| 51 | 51 | foreach ($problems as $problem) { |
| 52 | - if (is_array($problem) || is_object($problem)) { |
|
| 53 | - foreach ($problem as $key => $value) { |
|
| 54 | - if (!is_object($value)) { |
|
| 55 | - echo $key." --> ".$value."<br>"; |
|
| 56 | - } |
|
| 57 | - } |
|
| 58 | - } |
|
| 52 | + if (is_array($problem) || is_object($problem)) { |
|
| 53 | + foreach ($problem as $key => $value) { |
|
| 54 | + if (!is_object($value)) { |
|
| 55 | + echo $key." --> ".$value."<br>"; |
|
| 56 | + } |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $addresses = array(); |
| 28 | 28 | |
| 29 | -foreach($json as $address) { |
|
| 29 | +foreach ($json as $address) { |
|
| 30 | 30 | $addresses[] = Address::fromArray($address); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -29,20 +29,20 @@ discard block |
||
| 29 | 29 | $addresses = array(); |
| 30 | 30 | |
| 31 | 31 | foreach($json as $address) { |
| 32 | - $addresses[] = Address::fromArray($address); |
|
| 32 | + $addresses[] = Address::fromArray($address); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $parameters = RouteParameters::fromArray(array( |
| 36 | - "algorithm_type" => AlgorithmType::TSP, |
|
| 37 | - "distance_unit" => DistanceUnit::MILES, |
|
| 38 | - "device_type" => DeviceType::WEB, |
|
| 39 | - "optimize" => OptimizationType::DISTANCE, |
|
| 40 | - "travel_mode" => TravelMode::DRIVING, |
|
| 41 | - "route_max_duration" => 86400, |
|
| 42 | - "vehicle_capacity" => 1, |
|
| 43 | - "vehicle_max_distance_mi" => 10000, |
|
| 44 | - "rt" => true, |
|
| 45 | - "optimized_callback_url" => "https://requestb.in/1o6cgge1" |
|
| 36 | + "algorithm_type" => AlgorithmType::TSP, |
|
| 37 | + "distance_unit" => DistanceUnit::MILES, |
|
| 38 | + "device_type" => DeviceType::WEB, |
|
| 39 | + "optimize" => OptimizationType::DISTANCE, |
|
| 40 | + "travel_mode" => TravelMode::DRIVING, |
|
| 41 | + "route_max_duration" => 86400, |
|
| 42 | + "vehicle_capacity" => 1, |
|
| 43 | + "vehicle_max_distance_mi" => 10000, |
|
| 44 | + "rt" => true, |
|
| 45 | + "optimized_callback_url" => "https://requestb.in/1o6cgge1" |
|
| 46 | 46 | )); |
| 47 | 47 | |
| 48 | 48 | $optimizationParams = new OptimizationProblemParams; |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | $problems = OptimizationProblem::optimize($optimizationParams); |
| 53 | 53 | |
| 54 | 54 | foreach ($problems as $problem) { |
| 55 | - if (is_array($problem) || is_object($problem)) { |
|
| 56 | - foreach ($problem as $key => $value) { |
|
| 57 | - if (!is_object($value)) { |
|
| 58 | - echo $key." --> ".$value."<br>"; |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - } |
|
| 55 | + if (is_array($problem) || is_object($problem)) { |
|
| 56 | + foreach ($problem as $key => $value) { |
|
| 57 | + if (!is_object($value)) { |
|
| 58 | + echo $key." --> ".$value."<br>"; |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | 62 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $addresses = array(); |
| 28 | 28 | |
| 29 | -foreach($json as $address) { |
|
| 29 | +foreach ($json as $address) { |
|
| 30 | 30 | $addresses[] = Address::fromArray($address); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 14 | 14 | |
| 15 | 15 | $recordParameters=Member::fromArray(array( |
| 16 | - 'device_id' => '546546516', |
|
| 17 | - 'device_type' => 'IPAD', |
|
| 18 | - 'format' => 'json', |
|
| 16 | + 'device_id' => '546546516', |
|
| 17 | + 'device_type' => 'IPAD', |
|
| 18 | + 'format' => 'json', |
|
| 19 | 19 | )); |
| 20 | 20 | |
| 21 | 21 | $member = new Member(); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Member; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | // Set the API key in the Route4Me class |
| 13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 14 | 14 | |
| 15 | -$recordParameters=Member::fromArray(array( |
|
| 15 | +$recordParameters = Member::fromArray(array( |
|
| 16 | 16 | 'device_id' => '546546516', |
| 17 | 17 | 'device_type' => 'IPAD', |
| 18 | 18 | 'format' => 'json', |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | // Get of a specified user with details |
| 35 | 35 | $param = array ( |
| 36 | - "member_id" => $randomUserID |
|
| 36 | + "member_id" => $randomUserID |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | $response = $member->getUser($param); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Member; |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | assert(isset($users['results']), "Cannot retrieve list of the users"); |
| 26 | 26 | assert(isset($users['total']), "Cannot retrieve list of the users"); |
| 27 | 27 | |
| 28 | -$randIndex = rand(0, $users["total"]-1); |
|
| 28 | +$randIndex = rand(0, $users["total"] - 1); |
|
| 29 | 29 | |
| 30 | 30 | $randomUserID = $users['results'][$randIndex]["member_id"]; |
| 31 | 31 | |
| 32 | 32 | echo "Random user ID -> $randomUserID <br><br>"; |
| 33 | 33 | |
| 34 | 34 | // Get of a specified user with details |
| 35 | -$param = array ( |
|
| 35 | +$param = array( |
|
| 36 | 36 | "member_id" => $randomUserID |
| 37 | 37 | ); |
| 38 | 38 | |