Upload a new context.

@param \Smartling\Context\Params\UploadContextParameters $params
@return array
@throws \Smartling\Exceptions\SmartlingApiException
548156
public function uploadContext(UploadContextParameters $params)
    {
        $requestData = $this->getDefaultRequestData('multipart', $params->exportToArray());

        return $this->sendRequest('contexts', $requestData, self::HTTP_METHOD_POST);
    }
726073
public function setParams(array $params = [])
    {

        //Process Params
        $params = $this->processParams($params);

        //Set the params
        $this->params = $params;

        return $this;
    }
219535
public function put($url, array $params = [])
    {
        return $this->request($this->createUrl($url), self::METHOD_PUT, $params);
    }
982515
public function submit(RequestParameters $params)
    {
        /**
         * PHP 5.6.0 changed the way you specify the peer name for SSL context options.
         * Using "CN_name" will still work, but it will raise deprecated errors.
         */
        $peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
        $options = array(
            'http' => array(
                'header' => "Content-type: application/x-www-form-urlencoded\r\n",
                'method' => 'POST',
                'content' => $params->toQueryString(),
                // Force the peer to validate (not needed in 5.6.0+, but still works)
                'verify_peer' => true,
                // Force the peer validation to use www.google.com
                $peer_key => 'www.google.com',
            ),
        );
        if (null !== $this->timeout) {
            $options['http']['timeout'] = $this->timeout;
        }
        $context = stream_context_create($options);
        return file_get_contents($this->recaptchaVerifyUrl, false, $context);
    }
407878
public function addParams($params)
    {
        if (is_null($params)) {
            return;
        }

        if(!is_array($params)) {
            $params = array($params);
        }

        $this->params = array_merge($this->params, $params);
    }
1233507
public function setParameters(array $params): self
    {
        foreach ($params as $key => $value) {
            $this->parameters[$key] = $value;
        }
        return $this;
    }
1113532
public static function create(array $aParams = null)
    {
        $params = new self();
        if ($aParams === null) {
            return $params;
        }

        foreach ($aParams as $name => $value) {
            $params->$name = $value;
        }

        return $params;
    }
897493
private static function transferParams($params): array
    {
        $newParams = [];
        foreach ($params as $key => $value) {
            list($nkey, $nvalue) = EntityHelper::transferParameter($key, $value, null);
            $newParams[$nkey] = $nvalue;
        }

        return $newParams;
    }
130476
public function addMember($params) 
    {
      $args = Ensure::Input($params);
      $url = URIResource::Make($this->path, array($this->id, "members"));
      $memberid = Locator::Find($this->client->post($url, $args->get()));
    
      return $this->member($memberid);
    }
257219
private static Context[] convertToContexts(TIntParamHashMap[] params) {
      Context[] contexts = new Context[params.length];
      for (int pi=0;pi<params.length;pi++) {
        int[] activeOutcomes = params[pi].keys();
        double[] activeParameters = new double[activeOutcomes.length];
        for (int oi=0;oi<activeParameters.length;oi++) {
          activeParameters[oi] = params[pi].get(activeOutcomes[oi]);
        }
        contexts[pi] = new Context(activeOutcomes,activeParameters);
      }
      return contexts;
    }
794357
public function uploadItem( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'domain' ) );
		$this->setLocale( $params->site );

		$context = $this->getContext();
		$manager = \Aimeos\MShop\Factory::createManager( $context, 'media' );
		$typeManager = \Aimeos\MShop\Factory::createManager( $context, 'media/type' );

		$item = $manager->createItem();
		$item->setTypeId( $typeManager->findItem( 'default', [], 'product' )->getId() );
		$item->setDomain( 'product' );
		$item->setStatus( 1 );

		$file = $this->getUploadedFile();

		\Aimeos\Controller\Common\Media\Factory::createController( $context )->add( $item, $file );
		$item = $manager->saveItem( $item );

		return (object) $item->toArray( true );
	}
433759
public function uploadFile( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'parentid' ) );
		$this->setLocale( $params->site );

		if( ( $fileinfo = reset( $_FILES ) ) === false ) {
			throw new \Aimeos\Controller\ExtJS\Exception( 'No file was uploaded' );
		}

		$config = $this->getContext()->getConfig();

		/** controller/extjs/coupon/code/standard/uploaddir
		 * Upload directory for text files that should be imported
		 *
		 * The upload directory must be an absolute path. Avoid a trailing slash
		 * at the end of the upload directory string!
		 *
		 * @param string Absolute path including a leading slash
		 * @since 2014.09
		 * @category Developer
		 */
		$dir = $config->get( 'controller/extjs/coupon/code/standard/uploaddir', 'uploads' );

		/** controller/extjs/coupon/code/standard/enablecheck
		 * Enables checking uploaded files if they are valid and not part of an attack
		 *
		 * This configuration option is for unit testing only! Please don't disable
		 * the checks for uploaded files in production environments as this
		 * would give attackers the possibility to infiltrate your installation!
		 *
		 * @param boolean True to enable, false to disable
		 * @since 2014.09
		 * @category Developer
		 */
		if( $config->get( 'controller/extjs/coupon/code/standard/enablecheck', true ) ) {
			$this->checkFileUpload( $fileinfo['tmp_name'], $fileinfo['error'] );
		}

		$fileext = pathinfo( $fileinfo['name'], PATHINFO_EXTENSION );
		$dest = $dir . DIRECTORY_SEPARATOR . md5( $fileinfo['name'] . time() . getmypid() ) . '.' . $fileext;

		if( rename( $fileinfo['tmp_name'], $dest ) !== true )
		{
			$msg = sprintf( 'Uploaded file could not be moved to upload directory "%1$s"', $dir );
			throw new \Aimeos\Controller\ExtJS\Exception( $msg );
		}

		/** controller/extjs/coupon/code/standard/fileperms
		 * File permissions used when storing uploaded files
		 *
		 * The representation of the permissions is in octal notation (using 0-7)
		 * with a leading zero. The first number after the leading zero are the
		 * permissions for the web server creating the directory, the second is
		 * for the primary group of the web server and the last number represents
		 * the permissions for everyone else.
		 *
		 * You should use 0660 or 0600 for the permissions as the web server needs
		 * to manage the files. The group permissions are important if you plan
		 * to upload files directly via FTP or by other means because then the
		 * web server needs to be able to read and manage those files. In this
		 * case use 0660 as permissions, otherwise you can limit them to 0600.
		 *
		 * A more detailed description of the meaning of the Unix file permission
		 * bits can be found in the Wikipedia article about
		 * {@link https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation file system permissions}
		 *
		 * @param integer Octal Unix permission representation
		 * @since 2014.09
		 * @category Developer
		 */
		$perms = $config->get( 'controller/extjs/coupon/code/standard/fileperms', 0660 );
		if( chmod( $dest, $perms ) !== true )
		{
			$msg = sprintf( 'Could not set permissions "%1$s" for file "%2$s"', $perms, $dest );
			throw new \Aimeos\Controller\ExtJS\Exception( $msg );
		}

		$result = (object) array(
			'site' => $params->site,
			'items' => array(
				(object) array(
					'job.label' => 'Coupon code import: ' . $fileinfo['name'],
					'job.method' => 'Coupon_Code.importFile',
					'job.parameter' => array(
						'site' => $params->site,
						'parentid' => $params->parentid,
						'items' => $dest,
					),
					'job.status' => 1,
				),
			),
		);

		$jobController = \Aimeos\Controller\ExtJS\Admin\Job\Factory::createController( $this->getContext() );
		$jobController->saveItems( $result );

		return array(
			'items' => $dest,
			'success' => true,
		);
	}
623162
function upload($r, $param)
    {
        $this->setUp($param);

        if (isset($_FILES['files']['error'][0])
            && $_FILES['files']['error'][0] == UPLOAD_ERR_OK) {
            $name = basename($_FILES["files"]["name"][0]);

            $ext = explode('.', $name);
            $ext = '.'.end($ext);

            $name = md5($name);

            $a['files'][0] = [
               'name' => $name.$ext,
               'size' => $_FILES['files']['size'][0],
               'type' => $_FILES['files']['type'][0],
               'url'  => _URL.$this->articlePatch.$name.$ext];

            //Create a directory (if not exists)
            \Devbr\Cli\Main::checkAndOrCreateDir(_WWW.$this->articlePatch, true);

            //Save uploaded file
            move_uploaded_file($_FILES["files"]["tmp_name"][0], _WWW.$this->articlePatch.$name.$ext);

            //Resize image
            $canvas = new \Devbr\Canvas(_WWW.$this->articlePatch.$name.$ext);
            $canvas->set_quality(80)
                   ->resize('540')
                   ->save(_WWW.$this->articlePatch.$name.$ext);
            //Thumbnail
            $canvas->set_rgb('#000')
                   ->set_quality(70)
                   //->resize('265', '150', 'fill')
                   ->resize('120', '68', 'fill')
                   ->save(_WWW.$this->articlePatch.'mini_'.$name.$ext);

            //Send to javascript
            $this->send($a);
        }

        header('HTTP/1.1 403 Forbidden');
        exit();
    }
456435
public function setParams(array $params = array())
    {
        if (empty($params)) {
            throw new Exception('Unable to send exception. Invalid data provided.');
        }
        $this->description = isset($params['description']) ? $params['description'] : null;
        $this->url         = isset($params['url']) ? $params['url'] : null;
        $this->src         = isset($params['src']) ? $params['src'] : null;
        return $this;
    }
1280348
public function call(array $params)
    {
        $this->initResolver();

        /**
         * makes sure that 'format' is passed and that 'API' and 'method'
         * parameters are not overwritten by defaults nor by call parameters
         */
        $defaults = array_merge(array('format' => $this->format), $this->defaultParams);
        $this->resolver->setDefaults($defaults);
        $this->resolver->setMandatory(array(
            'module' => 'API',
            'method' => $this->name()
        ));

        return $this->piwikClient->call($this->url(), $this->resolver->resolve($params));
    }
1276651
public static function setContext($parameters, $prefix = '')
    {
        
        
    	self::$context = array();
    	
    	foreach($parameters as $key => $value){
    		self::$context[$prefix . $key] = $value;
    	}
    	
        
    }
574073
public static function all_update_init_params(array &$params,
            context $context, array $options = null) {
        global $CFG;

        // Get list of plugin directories.
        $plugins = core_component::get_plugin_list('tinymce');

        // Get list of disabled subplugins.
        $disabled = array();
        if ($params['moodle_config']->disabledsubplugins) {
            foreach (explode(',', $params['moodle_config']->disabledsubplugins) as $sp) {
                $sp = trim($sp);
                if ($sp !== '') {
                    $disabled[$sp] = $sp;
                }
            }
        }

        // Construct all the plugins.
        $pluginobjects = array();
        foreach ($plugins as $plugin => $dir) {
            if (isset($disabled[$plugin])) {
                continue;
            }
            require_once($dir . '/lib.php');
            $classname = 'tinymce_' . $plugin;
            $pluginobjects[] = new $classname($plugin);
        }

        // Sort plugins by sort order and name.
        usort($pluginobjects, array('editor_tinymce_plugin', 'compare_plugins'));

        // Run the function for each plugin.
        foreach ($pluginobjects as $obj) {
            $obj->update_init_params($params, $context, $options);
        }
    }