List system settings bundle

@param GetSettingRequest $request
@return JsonResponse
482271
public function index(GetSettingRequest $request)
    {
        $bundle = $this->repository->getBundle(new System(), $request->isDefault());
        return $this->sendResponse($bundle, 'System settings bundle');
    }
1000825
public function setAction(Request $request)
    {
        $ids = $request->get('ids');
        $ids = explode(',', $ids);

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');
        $metaSets = [];
        foreach ($ids as $id) {
            $metaSets[] = $metaSetManager->find($id);
        }

        $config = $this->createMetasetConfig($metaSets);

        return new JsonResponse($config);
    }
256746
protected function retrieveSettings()
    {
        if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['phpunit'])) {
            $this->cachedSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['phpunit']);
        } else {
            $this->cachedSettings = [];
        }

        $this->settingsHaveBeenRetrieved = true;
    }
1179723
protected function createCurlSettingsArray(RequestInterface $request): array
    {
        $settings = $this->curlSettings;

        switch ($request->getMethod()) {
            case 'HEAD':
                $settings[CURLOPT_NOBODY] = true;
                $settings[CURLOPT_CUSTOMREQUEST] = 'HEAD';
                break;
            case 'GET':
                $settings[CURLOPT_CUSTOMREQUEST] = 'GET';
                break;
            default:
                $body = $request->getBody();
                if (is_resource($body)) {
                    // This needs to be set to PUT, regardless of the actual
                    // method used. Without it, INFILE will be ignored for some
                    // reason.
                    $settings[CURLOPT_PUT] = true;
                    $settings[CURLOPT_INFILE] = $request->getBody();
                } else {
                    // For security we cast this to a string. If somehow an array could
                    // be passed here, it would be possible for an attacker to use @ to
                    // post local files.
                    $settings[CURLOPT_POSTFIELDS] = (string) $body;
                }
                $settings[CURLOPT_CUSTOMREQUEST] = $request->getMethod();
                break;
        }

        $nHeaders = [];
        foreach ($request->getHeaders() as $key => $values) {
            foreach ($values as $value) {
                $nHeaders[] = $key.': '.$value;
            }
        }
        $settings[CURLOPT_HTTPHEADER] = $nHeaders;
        $settings[CURLOPT_URL] = $request->getUrl();
        // FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM
        if (defined('CURLOPT_PROTOCOLS')) {
            $settings[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
        }
        // FIXME: CURLOPT_REDIR_PROTOCOLS is currently unsupported by HHVM
        if (defined('CURLOPT_REDIR_PROTOCOLS')) {
            $settings[CURLOPT_REDIR_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
        }

        return $settings;
    }
573381
public function update($name, UpdateSettingItemRequest $request, System $systemBundle)
    {
        $this->repository->updateByBundle($systemBundle, $name, $request->input('value'));
        $setting = $systemBundle->getSetting($name);

        return $this->sendResponse($setting, 'Setting item updated successfully.');
    }
294490
public function setSettingsByRequest()
    {
        $allAllowedSettings = array_keys($this->allSettings()->toArray());

        return $this->settings()->set(request()->only($allAllowedSettings));
    }
20960
public function store(Request $request)
    {
        // insert key and value in settings table
        $settings = Settings::all()->keyBy('settingsKey')->toArray();

        foreach ($request->form as $key => $value){
            if(!isset($settings[$key])) {
                $settings[$key] = ["settingsKey" => $key, "value" => $value];
            }
            $settings[$key]['value'] = ($value ? $value : null);
        }

        if(Settings::truncate()) {
            Settings::insert($settings);
        }

        // if request is being made from general settings
        if($request->settingsType == 'general') {
            if(isset($settings['defaultLanguage']) 
                && ((int) $settings['defaultLanguage']['value'] !== Language::getDefault()->languageID)
            ) {
                    // remove the current default language ( set it to non-default ) if this new one is the default
                    Language::where('isDefault', 1)->update(['isDefault' => 0]);
                    // set the new default language
                    $defaultLanguage = $request->form['defaultLanguage'];
                    Language::find($defaultLanguage)->update(['isDefault' => 1]);
            }

        }

        return $this->response('Settings are saved', 200);
    }
663269
public function listJsonAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var \AdminBundle\Services\DataTables\JsonList $jsonList */
        $jsonList = $this->get('json_list');
        $jsonList->setRepository($em->getRepository('CoreBundle:Page'));
        $jsonList->setLocale($request->getLocale());
        $response = $jsonList->get();
        

        return new JsonResponse($response);
    }
17109
public function showSettings()
    {
        // Get dependencies
        $settingMapper = ($this->container->dataMapper)('SettingMapper');
        $json = $this->container->json;

        // Fetch settings from database
        $allSettings = $settingMapper->findSiteSettings();

        // Fetch custom settings
        $jsonFilePath = ROOT_DIR . "structure/definitions/customSettings.json";
        if (null === $customSettings = $json->getJson($jsonFilePath, 'setting')) {
            $this->setAlert('danger', 'Custom Settings Error', $json->getErrorMessages());
        } else {
            // Merge saved settings with custom settings
            $allSettings = $this->mergeSettings($allSettings, $customSettings->settings);
        }

        return $this->render('editSettings.html', $allSettings);
    }
290838
public function deleteSettingsAction(Request $request)
    {
        $key = $request->get('key');

        try {
            if (!$key) {
                throw new MissingArgumentException(static::$entityNameUserSetting, 'key');
            }

            $user = $this->tokenStorage->getToken()->getUser();

            // get setting
            // TODO: move this logic into own service (UserSettingManager?)
            $setting = $this->userSettingRepository->findOneBy(['user' => $user, 'key' => $key]);

            if ($setting) {
                $this->objectManager->remove($setting);
                $this->objectManager->flush();
                $view = View::create(null, 204);
            } else {
                $view = View::create(null, 400);
            }
        } catch (RestException $exc) {
            $view = View::create($exc->toArray(), 400);
        }

        return $this->viewHandler->handle($view);
    }
326806
public function update_item( $request ) {
		$options = $this->get_registered_options();
		$params = $request->get_params();

		foreach ( $options as $name => $args ) {
			if ( ! array_key_exists( $name, $params ) ) {
				continue;
			}

			/**
			 * Filters whether to preempt a setting value update.
			 *
			 * Allow hijacking the setting update logic and overriding the built-in behavior by
			 * returning true.
			 *
			 * @since 4.7.0
			 *
			 * @param boolean $result Whether to override the default behavior for updating the
			 *                        value of a setting.
			 * @param string  $name   Setting name (as shown in REST API responses).
			 * @param mixed   $value  Updated setting value.
			 * @param array   $args   Arguments passed to `register_setting()` for this setting.
			 */
			$updated = apply_filters( 'rest_pre_update_setting', false, $name, $request[ $name ], $args );
			if ( $updated ) {
				continue;
			}

			// A null value means reset the option, which is essentially deleting it
			// from the database and then relying on the default value.
			if ( is_null( $request[ $name ] ) ) {
				delete_option( $args['option_name'] );
			} else {
				update_option( $args['option_name'], $request[ $name ] );
			}
		}

		return $this->get_item( $request );
	}
448972
public function getOptions(HCUserRequest $request): JsonResponse
    {
        return $this->response->success('OK', $this->service->getRepository()->getOptions($request));
    }
1322282
protected function getSettings() {
        if (!$this->_settings) {
            $this->_settings = new SettingsList($this->version);
        }

        return $this->_settings;
    }
126086
public function downloadSettings() : DownloadSettingsResponse
    {
        $request = new DownloadSettings();
        return $this->service->execute($request, $this->position);
    }
213072
public function getAction(Request $request)
    {
        $structureProvider = $this->get('sulu.content.structure_manager');
        $type = $request->get('type', 'default');

        $templates = [];
        foreach ($structureProvider->getStructures('article') as $structure) {
            if ($this->getType($structure->getStructure()) !== $type) {
                continue;
            }

            $templates[] = [
                'internal' => $structure->getInternal(),
                'template' => $structure->getKey(),
                'title' => $structure->getLocalizedTitle($this->getUser()->getLocale()),
            ];
        }

        return new JsonResponse(
            [
                '_embedded' => $templates,
                'total' => count($templates),
            ]
        );
    }
1229338
public function listAction(Request $request)
    {
        $objects = $this->get('doctrine.orm.default_entity_manager')->getRepository($request->get('class'))->findAll();
        // Fix for FOSRestBundle use
        if ($this->container->has('jms_serializer')) {
            return new Response($this->get('jms_serializer')->serialize($objects, 'json', SerializationContext::create()->setGroups(array('Default'))));
        }

        return new JsonResponse($objects);
    }
1357976
public function blendManySystemSettings($settings = [], $seeds_dir = '')
    {
        $success = true;
        // will update if system setting does exist or create new
        foreach ($settings as $data) {
            if (isset($data['columns'])) {
                $setting = $data['columns'];
            } else {
                $setting = $data;
                $data['columns'] = $data;
            }

            if (isset($setting['key'])) {
                $key = $setting['key'];

            } elseif (isset($setting['name'])) {
                $key = $setting['name'];

            } else {
                // Error: no name/key
                $success = false;
                continue;
            }

            $systemSetting = $this->getBlendableSystemSetting($key);
            if (!empty($seeds_dir)) {
                $systemSetting->setSeedsDir($seeds_dir);
            }

            if ($systemSetting->blendFromArray($data, true)) {
                $this->blender->out($systemSetting->getFieldName().' setting has been blended');
            } else {
                $success = false;
            }
        }

        return $success;
    }