Tasks.php
public function fructifyUpdate(string $versionContraint = '*')
    {
        // Lets attempt to update wordpress
        if (file_exists('./wp-includes/version.php'))
        {
            // Grab the version of wordpress that is installed
            require('./wp-includes/version.php');
            $installed_version = $wp_version;

            // Get the version we want to update to
            $new_version = $this->wpResolveVersionNo($versionContraint);

            // Nothing to do, same version.
            if ($installed_version == $new_version) return;

            // Now lets download the version of wordpress that we already have,
            // sounds silly I know but it will make sense soon I promise.
            $temp = sys_get_temp_dir().'/'.md5(microtime());
            $this->_mkdir($temp);
            $this->_exec
            (
                './vendor/bin/wp core download'.
                ' --version='.$installed_version.
                ' --path='.$temp
            );

            // Now lets delete all the files that are stock wordpress files
            $finder = new Finder();
            $finder->files()->in($temp);
            foreach ($finder as $file)
            {
                if (file_exists($file->getRelativePathname()))
                {
                    unlink($file->getRelativePathname());
                }
            }

            // Clean up
            $this->_deleteDir(['./wp-admin', './wp-includes', $temp]);
        }

        // Either we just deleted the old wordpress files or it didn't exist.
        // Regardless lets run the install functionality.
        $this->fructifyInstall($versionContraint);
    }
public function fructifyUpdate(string $versionContraint = '*')
    {
        // Lets attempt to update wordpress
        if (file_exists('./wp-includes/version.php'))
        {
            // Grab the version of wordpress that is installed
            require('./wp-includes/version.php');
            $installed_version = $wp_version;

            // Get the version we want to update to
            $new_version = $this->wpResolveVersionNo($versionContraint);

            // Nothing to do, same version.
            if ($installed_version == $new_version) return;

            // Now lets download the version of wordpress that we already have,
            // sounds silly I know but it will make sense soon I promise.
            $temp = sys_get_temp_dir().'/'.md5(microtime());
            $this->_mkdir($temp);
            $this->_exec
            (
                './vendor/bin/wp core download'.
                ' --version='.$installed_version.
                ' --path='.$temp
            );

            // Now lets delete all the files that are stock wordpress files
            $finder = new Finder();
            $finder->files()->in($temp);
            foreach ($finder as $file)
            {
                if (file_exists($file->getRelativePathname()))
                {
                    unlink($file->getRelativePathname());
                }
            }

            // Clean up
            $this->_deleteDir(['./wp-admin', './wp-includes', $temp]);
        }

        // Either we just deleted the old wordpress files or it didn't exist.
        // Regardless lets run the install functionality.
        $this->fructifyInstall($versionContraint);
    }
public function fructifyUpdate ( string $ versionContraint = '*' ) { // Lets attempt to update wordpress if ( file_exists ( './wp-includes/version.php' ) ) { // Grab the version of wordpress that is installed require ( './wp-includes/version.php' ) ; $ installed_version = $ wp_version ; // Get the version we want to update to $ new_version = $ this -> wpResolveVersionNo ( $ versionContraint ) ; // Nothing to do, same version. if ( $ installed_version == $ new_version ) return ; // Now lets download the version of wordpress that we already have, // sounds silly I know but it will make sense soon I promise. $ temp = sys_get_temp_dir ( ) . '/' . md5 ( microtime ( ) ) ; $ this -> _mkdir ( $ temp ) ; $ this -> _exec ( './vendor/bin/wp core download' . ' --version=' . $ installed_version . ' --path=' . $ temp ) ; // Now lets delete all the files that are stock wordpress files $ finder = new Finder ( ) ; $ finder -> files ( ) -> in ( $ temp ) ; foreach ( $ finder as $ file ) { if ( file_exists ( $ file -> getRelativePathname ( ) ) ) { unlink ( $ file -> getRelativePathname ( ) ) ; } } // Clean up $ this -> _deleteDir ( [ './wp-admin' , './wp-includes' , $ temp ] ) ; } // Either we just deleted the old wordpress files or it didn't exist. // Regardless lets run the install functionality. $ this -> fructifyInstall ( $ versionContraint ) ; }
Updates Wordpress.

This task will update the core wordpress files for you. It is
automatically run by composer as a post-update-cmd so you really
shouldn't need to worry about it.

But if you do want to call it, usage would look like:

```
./robo fructify:update v4.*
```

@param  string $versionContraint A semantic version contraint.
@return void
Updates Wordpress .