getExtensionById('tao'); $file = $taoExtension->getDir() . 'includes' . DIRECTORY_SEPARATOR . 'configGetFile.php'; //verify write access if (file_exists($file) && !is_writable($file)) { echo 'No write access to "' . $file . '", aborting.' . PHP_EOL; exit(1); } if ($taoExtension->hasConfig(tao_models_classes_fsAccess_Manager::CONFIG_KEY)) { $configData = []; foreach ($taoExtension->getConfig(tao_models_classes_fsAccess_Manager::CONFIG_KEY) as $serialized) { $provider = tao_models_classes_fsAccess_AccessProvider::restoreFromString($serialized); if ($provider instanceof tao_models_classes_fsAccess_TokenAccessProvider) { echo 'Restoring provider with Id ' . $provider->getId() . PHP_EOL; list($class, $id, $fsUri, $rawConfig) = explode(' ', $serialized, 4); $config = json_decode($rawConfig, true); if (!is_array($config)) { echo 'Unable to read config for access provider ' . $provider->getUri() . ', aborting.' . PHP_EOL; exit(1); } } $configData[$provider->getId()] = [ 'secret' => $config['secret'], 'folder' => $provider->getFileSystem()->getPath() ]; } $success = file_put_contents($file, "