Append or Create a task to the transformation url for this filelink

@param array $options    task options, e.g. ['b' => '00FF00', 'd' => '45']

@throws FilestackException   if API call fails, e.g 404 file not found

@return void
543391
public function setTransformUrl($method, $options = [])
    {
        $this->initTransformUrl();
        $this->transform_url = $this->insertTransformStr($this->transform_url,
            $method, $options);
    }
345166
public function open(array $options = [])
    {
        $method = array_get($options, 'method', 'post');

        // We need to extract the proper method from the attributes. If the method is
        // something other than GET or POST we'll use POST since we will spoof the
        // actual method since forms don't support the reserved methods in HTML.
        $attributes['method'] = $this->getMethod($method);

        $attributes['action'] = $this->getAction($options);

        $attributes['accept-charset'] = 'UTF-8';

        if (isset($options['files']) && $options['files']) {
            $options['enctype'] = 'multipart/form-data';
        }

        // Finally we're ready to create the final form HTML field. We will attribute
        // format the array of attributes. We will also add on the appendage which
        // is used to spoof requests for this PUT, PATCH, etc. methods on forms.
        $attributes = array_merge(

            $attributes, array_except($options, $this->reserved)

        );

        // Finally, we will concatenate all of the attributes into a single string so
        // we can build out the final form open statement. We'll also append on an
        // extra value for the hidden _method field if it's needed for the form.
        $attributes = $this->html->attributes($attributes);

        return '<form'.$attributes.'>';
    }
341066
protected function setOptions($options)
    {
        foreach (array('directory', 'path', 'ignore', 'allowed_errors') as $key) {
            if (array_key_exists($key, $options)) {
                $this->{$key} = $options[$key];
            }
        }
    }
265046
public function migrationTask(Option $option)
    {
        $database = $option->get('database');
        $current = $this->getCurrentAppDir($option);
        $migration_dir = $this->loader->find($current . DS . $this->application->config('directory.database.migration'))->first();
        $migration_dir->absolutize();

        foreach ($option->getArgs() as $arg) {

            $name = $this->migrationHelper->nameStrategy($arg);
            $filename = $this->migrationHelper->fileNameStrategy($database, $name);
            $classname = $this->migrationHelper->classNameStrategy($database, $name);
            $namespace = $this->migrationHelper->namespaceStrategy($migration_dir, $database, $name);

            $skeleton = $this->getSkeleton('Migration');

            $base_dir = clone $migration_dir;
            
            $skeleton->assign('namespace', $namespace ? $namespace . '\\' : '');
            $skeleton->assign('class', $classname);
            
            $migration_file = $migration_dir->getRealPath() . DS . $filename;
            $this->fileUtil->mkdirP(dirname($migration_file));
            $this->fileUtil->putContents($migration_file, $skeleton->render());

            $this->sendMessage('created migration file. -> %s', $migration_file);
        }
    }
320860
public function createOutputStream($target, array $options = []): OutputStream
    {
        if (isset($options['createDirIfNotExists']) && true === $options['createDirIfNotExists']) {
            $dir = dirname($target);
            if (!file_exists($dir)) {
                $filemode = $options['dirPermissions'] ?? $this->fileMode;
                mkdir($dir, $filemode, true);
            }
        }

        $filemode = $options['filemode'] ?? 'wb';
        $delayed  = $options['delayed']  ?? false;
        return new FileOutputStream($target, $filemode, $delayed);
    }
213713
public function createSymbolicLinksOnProject(array $options)
    {
        $project_root = ProjectX::projectRoot();

        $excludes = isset($options['excludes'])
            ? $options['excludes']
            : [];

        $includes = isset($options['includes'])
            ? $options['includes']
            : [];

        $target_dir = isset($options['target_dir'])
            ? $options['target_dir']
            : null;

        $source_dir = isset($options['source_dir'])
            ? $options['source_dir']
            : $project_root;

        $symlink_command = new SymlinkCommand();

        /** @var SplFileInfo $file_info */
        foreach (new \FilesystemIterator($project_root, \FilesystemIterator::SKIP_DOTS) as $file_info) {
            $filename = $file_info->getFilename();

            if (strpos($filename, '.') === 0
                || in_array($filename, $excludes)) {
                continue;
            }

            if (!empty($includes) && !in_array($filename, $includes)) {
                continue;
            }

            $symlink_command->link("{$source_dir}/{$filename}", "{$target_dir}/{$filename}");
        }

        return $symlink_command;
    }
1321312
function write($options = array())
    {
        $dir = @$options["dir"];
        $compress = @$options["compress"] ?: false;
        $includeDigest = @$options["include_digest"] ?: false;

        $filename = Path::join(array($dir, ($includeDigest ? $this->getDigestName() : $this->logicalPath)));

        if (!is_dir(dirname($filename))) {
            mkdir(dirname($filename), 0777, true);
        }

        $body = $this->getBody();

        if ($compress) {
            $body = gzencode($body, 9);
            $filename .= ".gz";
        }

        @file_put_contents($filename, $body);
    }
703059
public function addOptions(array $options = []): void
    {
        foreach ($options as $name => $opt) {
            $opt = $this->mergeArgOptConfig($opt);
            $this->addOption($name, $opt['mode'], $opt['description'], $opt['default']);
        }
    }
15925
public static function createFromOptions(array $options)
    {
        Validate::notNull(
            $options['NumberofInputAssets'],
            'options[NumberofInputAssets]'
        );
        Validate::notNull(
            $options['NumberofOutputAssets'],
            'options[NumberofOutputAssets]'
        );

        $taskTemplate = new self(
            $options['NumberofInputAssets'],
            $options['NumberofOutputAssets']
        );
        $taskTemplate->fromArray($options);

        return $taskTemplate;
    }
691125
public function update($options = array()) {
        $options = new Values($options);

        $data = Values::of(array(
            'FriendlyName' => $options['friendlyName'],
            'AssignmentCallbackUrl' => $options['assignmentCallbackUrl'],
            'FallbackAssignmentCallbackUrl' => $options['fallbackAssignmentCallbackUrl'],
            'Configuration' => $options['configuration'],
            'TaskReservationTimeout' => $options['taskReservationTimeout'],
        ));

        $payload = $this->version->update(
            'POST',
            $this->uri,
            array(),
            $data
        );

        return new WorkflowInstance(
            $this->version,
            $payload,
            $this->solution['workspaceSid'],
            $this->solution['sid']
        );
    }
561933
public function addTask(Task $t)
    {
        if ($this->nestedTask !== null) {
            throw new BuildException(
                'The retry task container accepts a single nested task'
                . ' (which may be a sequential task container)'
            );
        }
        $this->nestedTask = $t;
    }
706553
public function renderFileFromHtml($html, $targetPath, Options $options = null)
    {
        $tmpFilePath = $this->createTempFilePath(self::HTML_EXTENSION);
        $this->createFile($tmpFilePath, $html);

        if ($options === null) {
            $options = new Options();
        }

        $options = $this->prepareOptions($options);

        $this->convertToPdf($tmpFilePath, $targetPath, $options);
    }
1072409
protected function callHttp(array $options)
    {
        $options += [
            'method' => 'post',
            'dataType' => 'json',
            'throwException' => false,
        ];
        $options['url'] = $this->baseUrl . $options['url'];
        $options['data'] = json_encode($options['data'], JSON_UNESCAPED_UNICODE);

        $http = $this->http($options);

        return $this->parseResponse($http, $options);
    }
1206798
public function createFromSymlink($options = [
    'project-dir' => self::BLT_PROJECT_DIR,
    'vm' => TRUE,
  ]) {
    $test_project_dir = $this->bltRoot . "/" . $options['project-dir'];
    $bin = $test_project_dir . "/vendor/bin";
    $this->prepareTestProjectDir($test_project_dir);
    $this->taskFilesystemStack()
      ->mkdir($test_project_dir)
      ->copy($this->bltRoot . '/subtree-splits/blt-project/composer.json', $test_project_dir . '/composer.json')
      ->run();

    $template_composer_json_filepath = $test_project_dir . '/composer.json';
    $template_composer_json = json_decode(file_get_contents($template_composer_json_filepath));
    $template_composer_json->repositories->blt = [
      'type' => 'path',
      'url' => '../blt',
      'options' => [
        'symlink' => TRUE,
      ],
    ];
    $template_composer_json->require->{'acquia/blt'} = '*@dev';

    file_put_contents($template_composer_json_filepath, json_encode($template_composer_json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));

    $this->taskExecStack()
      ->dir($test_project_dir)
      ->exec("git init")
      ->exec("git add -A")
      ->exec("git commit -m \"Initial commit.\"")
      ->run();
    if (!$options['vm']) {
      $this->taskReplaceInFile($test_project_dir . "/composer.json")
        ->from("../blt")
        ->to($this->bltRoot)
        ->run();
    }
    $task = $this->taskExecStack()
      ->dir($test_project_dir)
      // BLT is the only dependency at this point. Install it.
      ->exec("composer install");

    if ($options['vm']) {
      $task->exec("$bin/blt vm --no-boot --no-interaction -v")
        ->exec("$bin/yaml-cli update:value box/config.yml vagrant_synced_folders.1.local_path '../blt'")
        ->exec("$bin/yaml-cli update:value box/config.yml vagrant_synced_folders.1.destination '/var/www/blt'")
        ->exec("$bin/yaml-cli update:value box/config.yml vagrant_synced_folders.1.type nfs");
    }
    $task->run();
  }
1237039
protected function handleResponseCreateFilelink($response)
    {
        $status_code = $response->getStatusCode();

        if ($status_code !== 200) {
            throw new FilestackException($response->getBody(), $status_code);
        }

        $json_response = json_decode($response->getBody(), true);
        $url = $json_response['url'];
        $file_handle = substr($url, strrpos($url, '/') + 1);

        $filelink = new Filelink($file_handle, $this->api_key, $this->security);
        $filelink->metadata['filename'] = $json_response['filename'];
        $filelink->metadata['size'] = $json_response['size'];
        $filelink->metadata['mimetype'] = 'unknown';

        if (isset($json_response['type'])) {
            $filelink->metadata['mimetype'] = $json_response['type'];
        } elseif (isset($json_response['mimetype'])) {
            $filelink->metadata['mimetype'] = $json_response['mimetype'];
        }

        return $filelink;
    }
1292489
public function saveAttachments($options = null)
    {
        if(!isset($options['dir'])){
            $dir = __DIR__.DIRECTORY_SEPARATOR;
        }else{
            $dir = $options['dir'];
        };
        if(!isset($options['incomingMessage'])){
            $incomingMessage = $this->incomingMessage;
        }else{
            $incomingMessage = $options['incomingMessage'];
        };
        foreach ($incomingMessage->attachments as $key => $attachment) {
            $newFileName = $attachment->name;
            file_put_contents($dir.DIRECTORY_SEPARATOR.$newFileName, $attachment->body);
        };
    }
924357
private function callCommandFile($type, $name = null, $stub = null, $options = [])
    {
        $this->call('generate:file', array_merge($options, [
            'name'    => ($name ? $name : $this->argument('resource')),
            '--type'  => $type,
            '--force' => $this->optionForce(),
            '--plain' => $this->optionPlain(),
            '--stub'  => ($stub ? $stub : $this->optionStub()),
        ]));
    }