PHP code example of javer / influxdb-data-fixtures-bundle

1. Go to this page and download the library: Download javer/influxdb-data-fixtures-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

javer / influxdb-data-fixtures-bundle example snippets


// config/bundles.php

return [
    // ...
    Javer\InfluxDB\DataFixturesBundle\JaverInfluxDBDataFixturesBundle::class => ['dev' => true, 'test' => true],
];



$files = [
    'path/to/tests/DataFixtures/InfluxDB/measurement1.yaml',
    'path/to/tests/DataFixtures/InfluxDB/measurement2.yaml',
];

$loader = $container->get('javer_influxdb_data_fixtures.loader.influxdb');

// Purge the objects, create PHP objects from the fixture files and persist them
$objects = $loader->load($files);

// $objects is now an array of persisted `Measurement1` and `Measurement2`