X7ROOT File Manager
Current Path:
/opt/alt/php54/usr/share/pear/Symfony/Component/Form
opt
/
alt
/
php54
/
usr
/
share
/
pear
/
Symfony
/
Component
/
Form
/
ðŸ“
..
📄
AbstractExtension.php
(4.77 KB)
📄
AbstractRendererEngine.php
(7.46 KB)
📄
AbstractType.php
(1.05 KB)
📄
AbstractTypeExtension.php
(993 B)
📄
Button.php
(8.62 KB)
📄
ButtonBuilder.php
(18.09 KB)
📄
ButtonTypeInterface.php
(462 B)
📄
CallbackTransformer.php
(2.09 KB)
📄
ClickableInterface.php
(559 B)
📄
DataMapperInterface.php
(1.1 KB)
📄
DataTransformerInterface.php
(3.08 KB)
ðŸ“
Exception
ðŸ“
Extension
📄
Form.php
(34.05 KB)
📄
FormBuilder.php
(7.69 KB)
📄
FormBuilderInterface.php
(2.28 KB)
📄
FormConfigBuilder.php
(21.17 KB)
📄
FormConfigBuilderInterface.php
(8.46 KB)
📄
FormConfigInterface.php
(6.29 KB)
📄
FormError.php
(2.5 KB)
📄
FormEvent.php
(1.22 KB)
📄
FormEvents.php
(1.11 KB)
📄
FormExtensionInterface.php
(1.63 KB)
📄
FormFactory.php
(5.1 KB)
📄
FormFactoryBuilder.php
(3.52 KB)
📄
FormFactoryBuilderInterface.php
(2.99 KB)
📄
FormFactoryInterface.php
(4.14 KB)
📄
FormInterface.php
(8.13 KB)
📄
FormRegistry.php
(4.64 KB)
📄
FormRegistryInterface.php
(1.41 KB)
📄
FormRenderer.php
(11.67 KB)
📄
FormRendererEngineInterface.php
(6.9 KB)
📄
FormRendererInterface.php
(3.2 KB)
📄
FormTypeExtensionInterface.php
(2.08 KB)
📄
FormTypeGuesserChain.php
(2.81 KB)
📄
FormTypeGuesserInterface.php
(2.12 KB)
📄
FormTypeInterface.php
(3.15 KB)
📄
FormView.php
(3.44 KB)
📄
Forms.php
(5.76 KB)
ðŸ“
Guess
📄
NativeRequestHandler.php
(5.48 KB)
📄
PreloadedExtension.php
(2.26 KB)
📄
RequestHandlerInterface.php
(668 B)
📄
ResolvedFormType.php
(7.48 KB)
📄
ResolvedFormTypeFactory.php
(658 B)
📄
ResolvedFormTypeFactoryInterface.php
(1.27 KB)
📄
ResolvedFormTypeInterface.php
(3.23 KB)
ðŸ“
Resources
📄
ReversedTransformer.php
(1.23 KB)
📄
SubmitButton.php
(1.11 KB)
📄
SubmitButtonBuilder.php
(624 B)
📄
SubmitButtonTypeInterface.php
(474 B)
ðŸ“
Test
ðŸ“
Util
📄
autoloader.php
(334 B)
Editing: NativeRequestHandler.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form; use Symfony\Component\Form\Exception\UnexpectedTypeException; /** * A request handler using PHP's super globals $_GET, $_POST and $_SERVER. * * @author Bernhard Schussek <bschussek@gmail.com> */ class NativeRequestHandler implements RequestHandlerInterface { /** * The allowed keys of the $_FILES array. * * @var array */ private static $fileKeys = array( 'error', 'name', 'size', 'tmp_name', 'type', ); /** * {@inheritdoc} */ public function handleRequest(FormInterface $form, $request = null) { if (null !== $request) { throw new UnexpectedTypeException($request, 'null'); } $name = $form->getName(); $method = $form->getConfig()->getMethod(); if ($method !== self::getRequestMethod()) { return; } if ('GET' === $method) { if ('' === $name) { $data = $_GET; } else { // Don't submit GET requests if the form's name does not exist // in the request if (!isset($_GET[$name])) { return; } $data = $_GET[$name]; } } else { $fixedFiles = array(); foreach ($_FILES as $name => $file) { $fixedFiles[$name] = self::stripEmptyFiles(self::fixPhpFilesArray($file)); } if ('' === $name) { $params = $_POST; $files = $fixedFiles; } elseif (array_key_exists($name, $_POST) || array_key_exists($name, $fixedFiles)) { $default = $form->getConfig()->getCompound() ? array() : null; $params = array_key_exists($name, $_POST) ? $_POST[$name] : $default; $files = array_key_exists($name, $fixedFiles) ? $fixedFiles[$name] : $default; } else { // Don't submit the form if it is not present in the request return; } if (is_array($params) && is_array($files)) { $data = array_replace_recursive($params, $files); } else { $data = $params ?: $files; } } // Don't auto-submit the form unless at least one field is present. if ('' === $name && count(array_intersect_key($data, $form->all())) <= 0) { return; } $form->submit($data, 'PATCH' !== $method); } /** * Returns the method used to submit the request to the server. * * @return string The request method. */ private static function getRequestMethod() { $method = isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET'; if ('POST' === $method && isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { $method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); } return $method; } /** * Fixes a malformed PHP $_FILES array. * * PHP has a bug that the format of the $_FILES array differs, depending on * whether the uploaded file fields had normal field names or array-like * field names ("normal" vs. "parent[child]"). * * This method fixes the array to look like the "normal" $_FILES array. * * It's safe to pass an already converted array, in which case this method * just returns the original array unmodified. * * This method is identical to {@link Symfony\Component\HttpFoundation\FileBag::fixPhpFilesArray} * and should be kept as such in order to port fixes quickly and easily. * * @param array $data * * @return array */ private static function fixPhpFilesArray($data) { if (!is_array($data)) { return $data; } $keys = array_keys($data); sort($keys); if (self::$fileKeys !== $keys || !isset($data['name']) || !is_array($data['name'])) { return $data; } $files = $data; foreach (self::$fileKeys as $k) { unset($files[$k]); } foreach (array_keys($data['name']) as $key) { $files[$key] = self::fixPhpFilesArray(array( 'error' => $data['error'][$key], 'name' => $data['name'][$key], 'type' => $data['type'][$key], 'tmp_name' => $data['tmp_name'][$key], 'size' => $data['size'][$key] )); } return $files; } /** * Sets empty uploaded files to NULL in the given uploaded files array. * * @param mixed $data The file upload data. * * @return array|null Returns the stripped upload data. */ private static function stripEmptyFiles($data) { if (!is_array($data)) { return $data; } $keys = array_keys($data); sort($keys); if (self::$fileKeys === $keys) { if (UPLOAD_ERR_NO_FILE === $data['error']) { return null; } return $data; } foreach ($data as $key => $value) { $data[$key] = self::stripEmptyFiles($value); } return $data; } }
Upload File
Create Folder