PHP GDAL/OGR library usage, which approach is cleaner?

后端 未结 2 989
北恋
北恋 2021-02-10 05:04

I will be using gdal/ogr for a new project. I want a lean but fully functional app, so will not be using other implementations such as mapserver, because they have extraneous co

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-10 05:41

    You can use the Symfony Process-Component, avoiding plain exec commands.
    It has a great syntax and is very easy to use.

    http://symfony.com/doc/current/components/process.html

    $process = new Process('ls -lsa');
    $process->run();
    
    // executes after the command finishes
    if (!$process->isSuccessful()) {
        throw new ProcessFailedException($process);
    }
    
    echo $process->getOutput();
    

提交回复
热议问题