protected function execute(InputInterface $input, OutputInterface $output) { /** @var User $user */ $user = new User('tpateffoz', [], $this->getContainer()->getParameter('api_recolnat_user'), $this->getContainer()->getParameter('user_group')); $user->init($this->getContainer()->getParameter('export_path')); $testDir = $user->getDataDirPath() . 'test/'; $testFile = $testDir . 'test.txt'; $userGroup = $this->getContainer()->getParameter('user_group'); UtilityService::createDir($testDir, $userGroup); UtilityService::createFile($testFile, $userGroup); $output->writeln($testDir); }
/** * @param Prefs $prefs */ public function savePrefs(Prefs $prefs) { UtilityService::createFile($this->getPrefsFileName(), $this->userGroup); $handle = fopen($this->getPrefsFileName(), 'w'); fwrite($handle, $prefs->toJson()); fclose($handle); }
/** * @param string $dirPath * @param string $userGroup */ public function __construct($dirPath, $userGroup) { $path = UtilityService::createFile($dirPath . self::FILENAME, $userGroup); parent::__construct($path, 'c+'); }
/** * @param string $dirPath * @param string $userGroup */ public function __construct($dirPath, $userGroup) { $filePath = UtilityService::createFile($dirPath . '/choices.json', $userGroup); parent::__construct($filePath, 'c+'); }