SatisAdmin\Model\ModelManager::getJson PHP Method

getJson() public method

public getJson ( ) : string
return string
    public function getJson()
    {
        return $this->filesystem->has($this->configFile) ? $this->filesystem->get($this->configFile, true)->getContent() : '{}';
    }

Usage Example

コード例 #1
0
 public function run()
 {
     $configFile = tempnam(sys_get_temp_dir(), 'satis-admin');
     file_put_contents($configFile, $this->manager->getJson());
     $process = ProcessBuilder::create(['php', $this->binDir . '/satis', 'build', $configFile, $this->outputDir])->getProcess();
     $this->logger->addInfo('Building config...', ['command-line' => $process->getCommandLine()]);
     if (0 === $process->run()) {
         $this->logger->addInfo('Config built.');
     } else {
         $this->logger->addError('Config not build', ['stdout' => $process->getOutput(), 'stderr' => $process->getErrorOutput()]);
     }
 }
All Usage Examples Of SatisAdmin\Model\ModelManager::getJson