Enable the Uploadable extension.

@return void
512324
public static function enable()
    {
        Builder::macro(self::MACRO_METHOD, function (Builder $builder) {
            return new static($builder->getClassMetadata());
        });

        UploadableFile::enable();
    }
1074019
public function editionMode() {
		if (isset($_SESSION["FINE_MESSAGE_EDITION_MODE"])) {
			$this->isMessageEditionMode = true;
		}
		$this->content->addFile('../utils.i18n.fine/src/views/enableDisableEdition.php', $this);
		$this->template->toHtml();
	}
1138472
protected function _enable($exts)
    {
        if (!empty($exts) && $this->_capability('ENABLE')) {
            $c = $this->_capability();
            $todo = array();

            // Only enable non-enabled extensions.
            foreach ($exts as $val) {
                if (!$c->isEnabled($val)) {
                    $c->enable($val);
                    $todo[] = $val;
                }
            }

            if (!empty($todo)) {
                $cmd = $this->_command('ENABLE')->add($todo);
                $cmd->on_error = function() use ($todo, $c) {
                    /* Something went wrong... disable the extensions. */
                    foreach ($todo as $val) {
                        $c->enable($val, false);
                    }
                };
                $this->_cmdQueue[] = $cmd;
            }
        }
    }
1053090
public function upload()
    {
        if ($this->isValid() === false) {
            throw new \Upload\Exception('File validation failed');
        }

        foreach ($this->objects as $fileInfo) {
            $this->applyCallback('beforeUpload', $fileInfo);
            $this->storage->upload($fileInfo);
            $this->applyCallback('afterUpload', $fileInfo);
        }

        return true;
    }
815783
public function setAllowedFileExtensions($extensions)
    {
        $this->allowedFileExtensions = [];
        $token = ' ,;';
        $ext = strtok($extensions, $token);
        while ($ext !== false) {
            $this->allowedFileExtensions[] = $ext;
            $ext = strtok($token);
        }
    }
902213
protected function constructUploadReceiver()
    {
        // Set Upload instance
        $this->setUpload(Upload::create());

        // filter out '' since this would be a regex problem on JS end
        $this->getValidator()->setAllowedExtensions(
            array_filter(File::config()->allowed_extensions)
        );

        // get the lower max size
        $maxUpload = File::ini2bytes(ini_get('upload_max_filesize'));
        $maxPost = File::ini2bytes(ini_get('post_max_size'));
        $this->getValidator()->setAllowedMaxFileSize(min($maxUpload, $maxPost));
    }
715597
public static function enable(): void
    {
        self::$debugbar = new StandardDebugBar();
        self::$debugbar->addCollector(new ViewCollector());

        self::$renderer = self::$debugbar->getJavascriptRenderer('./vendor/maximebf/debugbar/src/DebugBar/Resources/');
    }
319148
public function enable()
    {
        if ($this->enabled) {
            return;
        }
        if (!$this->fd) {
            return;
        }
        $this->enabled = true;

        if ($this->ev === null) {
            if ($this->eventLoop === null) {
                // @TODO нужно перенести куда-то выше, не годиться тут инициировать
                $this->eventLoop = EventLoop::$instance;
            }

            $this->ev = $this->eventLoop->event($this->fd, \Event::READ | \Event::PERSIST, [$this, 'onReadUdp']);
            $this->onBound();
        } else {
            $this->onAcceptEv();
        }
        $this->ev->add();
    }
441120
public function handleUpload(): void
	{
		if ($this->request->isAjax()) {
			$file = $this->request->getFile('file');
			if ($file->error !== UPLOAD_ERR_OK) {
				header('HTTP/1.1 500 Internal Server Error');
				header('Content-type: text/plain');
				switch ($file->error) {
					case UPLOAD_ERR_INI_SIZE:
					case UPLOAD_ERR_FORM_SIZE:
						$msg = 'tooBig';
						break;
					case UPLOAD_ERR_NO_FILE:
						$msg = 'noFile';
						break;
					case UPLOAD_ERR_PARTIAL:
					case UPLOAD_ERR_NO_TMP_DIR:
					case UPLOAD_ERR_CANT_WRITE:
					case UPLOAD_ERR_EXTENSION:
						$msg = 'failedUpload';
						break;
				}
				exit($this->translator->translate('nattreid.gallery.error.' . $msg));
			}

			$resource=$this->imageStorage->createResource($file->temporaryFile,$file->sanitizedName);
			$resource->setNamespace($this->namespace);
			$this->imageStorage->save($resource);

			$this->getStorage()->add($resource->getIdentifier());
		}
		throw new AbortException;
	}
1146076
public function canUpload()
    {
        $access = eZUser::instance()->hasAccessTo( 'content', 'create' );
        if ( $access['accessWord'] === 'no' )
        {
            return false;
        }
        $ini = eZINI::instance( 'upload.ini' );
        $uploadableClassList = $ini->variable( 'CreateSettings', 'MimeClassMap' );
        $uploadableClassList[] = $ini->variable( 'CreateSettings', 'DefaultClass' );
        $classContent = $this->attribute->attribute( 'class_content' );

        $intersect = array_intersect( $classContent['class_constraint_list'], $uploadableClassList );
        if ( !empty( $classContent['class_constraint_list'] ) && empty( $intersect ) )
        {
            return false;
        }
        return true;
    }
78454
public function enableVerboseOutput()
    {
        $this->verboseFileHandle = tmpfile();
        $this->setOpt(CURLOPT_VERBOSE, true);
        $this->setOpt(CURLOPT_STDERR, $this->verboseFileHandle);
    }
1205837
protected function handleUpload()
    {
        $this->uploadedField = array_keys($_FILES)[0];
        //check if any uploaded file for a defined field
        $this->uploadOk = $this->checkUpload();
        if(!$this->uploadOk) {
            return;
        }
        //exec upload
        $this->uploadOk = $this->uploadFields[$this->uploadedField]->handleUpload($this->uploader);
        if(!$this->uploadOk) {
            return;
        }
        //outputs post processing
        $outputs = $this->uploadFields[$this->uploadedField]->getOutputsFiles();
        foreach($this->uploadFieldsDefinitions[$this->uploadedField]['outputs'] as $output => $outputDefinition) {
            if(isset($outputDefinition['processor'])) {
                $this->{$outputDefinition['processor']}($outputs[$output]['path']);
            }
        }
    }
1334113
public static function enable()
    {
        Field::macro(self::MACRO_METHOD, function (Field $builder) {
            return new static($builder->getClassMetadata(), $builder->getName());
        });

        Timestamps::enable();
    }
1281866
def _set_upload_url(self):
        """"""
        # pylint: disable=protected-access
        self._upload_url = "/".join(
            [self.jss._url, self._url, self.resource_type, self.id_type,
             str(self._id)])
869950
protected function registerFileExtensions()
    {
        $this->app->extend('view', function ($env, $app) {
            $fileexts = $app['config']['handlebars.fileext'];

            foreach ($fileexts as $fileext) {
                $env->addExtension(trim($fileext, '.'), 'handlebars');
            }

            return $env;
        });
    }
690446
private function enable_thumbnail_support()
    {
        $enabled_thumbnails = Config::get('images.supports_featured_images');

        if (! empty($enabled_thumbnails)) {
            if (\is_array($enabled_thumbnails)) {
                \add_theme_support('post-thumbnails', $enabled_thumbnails);
            } elseif ($enabled_thumbnails === true) {
                \add_theme_support('post-thumbnails');
            }
        }
    }
753949
public function enable()
    {
        $this->manager->enable($this);

        if ($this->referenced) {
            $this->manager->reference($this);
        }
    }