@param Freemius $freemius

@return FS_Plugin_Updater
180146
static function instance( Freemius $freemius ) {
            $key = $freemius->get_id();

            if ( ! isset( self::$_INSTANCES[ $key ] ) ) {
                self::$_INSTANCES[ $key ] = new self( $freemius );
            }

            return self::$_INSTANCES[ $key ];
        }
713956
public function getFromId( $FreeplugId){
        $rest = $this->getService( self::API_FREEPLUG . $FreeplugId . DIRECTORY_SEPARATOR);
        $rest->GET();

        return $rest->getResult( models\Freeplug\Freeplug::class);
    }
373798
static function ReplaceUsing($placeholder, Interfaces\IRealizer $realizer = null)
    {
        $args = func_get_args();    
        array_shift($args);
        if (count($args) >= 2)
        {
            array_shift($args);   
        }
        return self::ReplaceArgsUsing($placeholder, $realizer, $args);
    }
1267817
public function updateSource(Common\ISource $source)
    {
        return $this->update($source, $this->isGroupJoin, $this->filter, $this->hasDefault);
    }
25600
public function update()
    {
        $version = get_option($this->plugin . 'version');
        if ($version != STATICWP_VERSION) {
            update_option($this->plugin . 'version', STATICWP_VERSION);
        }
    }
688028
public function updateMilestone($owner, $repo, $number, $title = null, $description = null, $state = null, $due_on = null)
	{
		$data = array();
		if(!is_null($title))
			$data['title'] = $title;
		if(!is_null($description))
			$data['description'] = $description;
		if(!is_null($state))
			$data['state'] = $state;
		if(!is_null($due_on))
			$data['due_on'] = $due_on;
		
		return $this->client->request("/repos/$owner/$repo/milestones/$number", 'PATCH', json_encode($data), 200, 'GitHubMilestone');
	}
1128472
public function updatePlugin($plugin, $stopOnVersion = null)
    {
        $code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);

        if (!$this->hasVersionFile($code)) {
            return false;
        }

        $currentVersion = $this->getLatestFileVersion($code);
        $databaseVersion = $this->getDatabaseVersion($code);

        // No updates needed
        if ($currentVersion == $databaseVersion) {
            $this->note('- <info>Nothing to update.</info>');
            return;
        }

        $newUpdates = $this->getNewFileVersions($code, $databaseVersion);
        foreach ($newUpdates as $version => $details) {
            $this->applyPluginUpdate($code, $version, $details);

            if ($stopOnVersion === $version) {
                return true;
            }
        }

        return true;
    }
866088
public static function _uninstall_plugin_hook() {
            self::_load_required_static();

            self::$_static_logger->entrance();

            if ( ! current_user_can( 'activate_plugins' ) ) {
                return;
            }

            $plugin_file = substr( current_filter(), strlen( 'uninstall_' ) );

            self::$_static_logger->info( 'plugin = ' . $plugin_file );

            define( 'WP_FS__UNINSTALL_MODE', true );

            $fs = self::get_instance_by_file( $plugin_file );

            if ( is_object( $fs ) ) {
                self::require_plugin_essentials();

                if ( is_plugin_active( $fs->_free_plugin_basename ) ||
                     is_plugin_active( $fs->premium_plugin_basename() )
                ) {
                    // Deleting Free or Premium plugin version while the other version still installed.
                    return;
                }

                $fs->_uninstall_plugin_event();

                $fs->do_action( 'after_uninstall' );
            }
        }
1250526
public function updateExistingPlugin(
        $pluginData,
        SiteEntity $site,
        string $modifiedByUserId,
        string $modifiedReason = Tracking::UNKNOWN_REASON,
        $forceSave = false,
        $doFlush = true
    ) {
        if (empty($pluginData['pluginInstanceId'])) {
            throw new InvalidArgumentException(
                'Plugin instance Id required to update.'
            );
        }

        /** @var PluginInstanceEntity $pluginInstance */
        $pluginInstance = $this->findOneBy(
            ['pluginInstanceId' => $pluginData['pluginInstanceId']]
        );

        if (empty($pluginInstance)) {
            throw new InvalidArgumentException(
                'No plugin found for instance Id: '
                . $pluginData['pluginInstanceId']
            );
        }

        $pluginData['plugin'] = $pluginInstance->getPlugin();

        $pluginData = $this->prepareData($pluginData);

        if (!$forceSave
            && $pluginInstance->getMd5() == md5(serialize($pluginData['saveData']))
            // @deprecated <deprecated-site-wide-plugin>
            && $pluginInstance->isSiteWide() == (bool)$pluginData['siteWide']
        ) {
            return $pluginInstance;
        }

        $newPluginInstance = $this->createPluginInstance(
            $pluginData,
            $site,
            $modifiedByUserId,
            $modifiedReason,
            $pluginInstance,
            $doFlush
        );

        return $newPluginInstance;
    }
354089
public function synchronize( $prefix = false, $plugin = false, array $permission_ids = [] )
    {
        $classname = '';
        if( !$plugin ) {
            $path = App::path('Controller/'.$prefix)[0];
        } else if( $plugin && is_string($prefix) ) {
            $path = App::path('Controller/' . $prefix, $plugin)[0];
            $classname = $plugin . '.';
        }

        $type_prefix = ( $prefix === '/' || is_bool($prefix) ) ? '' : '/'.$prefix;
        $Permission = TableRegistry::get('Permission');
        $files = scandir($path);
        $this->all_files = array_merge($this->all_files, $files);
        foreach($files as $file) {

            if(in_array($file, $this->_sync_ignore_list['*']) ||
                ( isset($this->_sync_ignore_list[$prefix]) && in_array($file, $this->_sync_ignore_list[$prefix]) )
            ) continue;

            if( is_dir($path.$file) ) {
                if( $prefix || !$plugin )
                    $permission_ids = $this->synchronize($file, $plugin, $permission_ids);
                else if( $plugin )
                    $permission_ids = $this->synchronize('/', $file, $permission_ids);
                continue;
            }

            $controller_name = str_replace('Controller', '', explode('.', $file)[0]);
            $class_name = App::classname($classname.$controller_name, 'Controller'.$type_prefix, 'Controller');
            if( empty($class_name) ) continue;
            $class = new ReflectionClass($class_name);
            $all_actions = $class->getMethods(ReflectionMethod::IS_PUBLIC);

            foreach($all_actions as $action) {
                $permission_prefix = '';
                if( $plugin )
                    $permission_prefix .= $plugin.'.';
                if( $prefix )
                    $permission_prefix .= $prefix;

                $class = new ReflectionClass($action->class);
                $file_name = explode('/',$class->getFileName());
                $file_name = end($file_name);
                if( in_array($file_name, $this->_sync_ignore_list['*']) || ($action->class != $class_name && !in_array($file_name, $this->all_files)) ||
                    in_array($action->name, $this->_sync_ignore_list['*']['*']) ||
                    ( isset($this->_sync_ignore_list['*'][$controller_name]) && in_array($action->name, $this->_sync_ignore_list['*'][$controller_name]) ) ||
                    ( isset($this->_sync_ignore_list[$permission_prefix]['*']) && in_array($action->name, $this->_sync_ignore_list[$permission_prefix]['*']) ) ||
                    ( isset($this->_sync_ignore_list[$permission_prefix][$controller_name]) && in_array($action->name, $this->_sync_ignore_list[$permission_prefix][$controller_name]) )
                ) continue;

                $unique_string = $this->getUniqueString($controller_name, $action->name, $prefix, $plugin);
                $permission_id = $Permission->find()
                    ->select(['id'])
                    ->where(['unique_string' => $unique_string])
                    ->first();

                if (is_null($permission_id)) {
                    $new_permission = $Permission->newEntity();
                    $new_permission->action = $action->name;
                    $new_permission->controller = $controller_name;
                    $new_permission->prefix = $permission_prefix;
                    $new_permission->unique_string = $unique_string;

                    if ($Permission->save($new_permission))
                        array_push($permission_ids, $new_permission->id);

                } else {
                    array_push($permission_ids, $permission_id->id);
                }
            }
        }

        if( !$plugin && !$prefix ) {
            foreach( $this->_plugins as $plugin )
                $permission_ids = $this->synchronize('/', $plugin, $permission_ids);

            $Permission->deleteAll(['id NOT IN'=>$permission_ids]);
        }

        return $permission_ids;
    }
835675
public function update(PluginBundle $plugin, array $pluginConfiguration)
    {
        $pluginFqcn = get_class($plugin);
        $this->dbWriter->update($plugin, $pluginConfiguration);
    }
863529
public function update($subscription){
        if(!isset($this->_id) || null == $this->_id){
            throw new \Exception("You must especify an Id to perform subscription updates");
        }
        if($subscription instanceof SubscriptionFactory){
            $context = new ContextFactory((array) $subscription->get());
        }elseif(is_array($subscription) || is_object($subscription)){
            $context = new ContextFactory((array)$subscription);
        }
        return $this->_orion->patch($this->getBaseURI(), $context);
    }
543953
public function update(User $user, MemberInvitation $memberInvitation)
    {
        return $user->selected_context->id === $memberInvitation->inviter_id;
    }
151205
private function _sync_clock_diff( $diff = false ) {
			$this->_logger->entrance();

			// Sync clock and store.
			$new_clock_diff = ( false === $diff ) ?
				Freemius_Api_WordPress::FindClockDiff() :
				$diff;

			if ( $new_clock_diff === self::$_clock_diff ) {
				return false;
			}

			self::$_clock_diff = $new_clock_diff;

			// Update API clock's diff.
			Freemius_Api_WordPress::SetClockDiff( self::$_clock_diff );

			// Store new clock diff in storage.
			self::$_options->set_option( 'api_clock_diff', self::$_clock_diff, true );

			return $new_clock_diff;
		}
137777
public function update($name, $typeHint, Expression $defaultValue = null, $isPassedByReference, $isVariadic)
    {
        if ($this->name === $name
                && $this->typeHint === $typeHint
                && $this->defaultValue === $defaultValue
                && $this->isPassedByReference === $isPassedByReference
                && $this->isVariadic === $isVariadic
        ) {
            return $this;
        }

        return new self(
                $name,
                $typeHint,
                $defaultValue,
                $isPassedByReference,
                $isVariadic);
    }
236878
public function newInstance(
        string $createdByUserId,
        string $createdReason = Tracking::UNKNOWN_REASON
    ) {
        /** @var static $new */
        $new = parent::newInstance(
            $createdByUserId,
            $createdReason
        );

        // if no id, then it has not been save and can be returned
        if (empty($new->revisionId)) {
            return $new;
        }

        $new->revisionId = null;
        $new->createdDate = new \DateTime();

        $new->published = false;
        $new->publishedDate = null;

        /* Clone Plugins */
        $pluginWrappers = $new->pluginWrappers;
        $clonedPluginWrappers = new ArrayCollection();

        /** @var \Rcm\Entity\PluginWrapper $pluginWrapper */
        foreach ($pluginWrappers as $pluginWrapper) {
            $clonedPluginWrapper = $pluginWrapper->newInstance(
                $createdByUserId,
                $createdReason
            );
            $clonedPluginWrappers->add($clonedPluginWrapper);
        }

        $new->pluginWrappers = $clonedPluginWrappers;

        return $new;
    }
965752
public function update($path, $content, $mimeType = null)
    {
       return $this->getFile($path)->update($content, $mimeType);
    }