public function updateSourceCode($branch = CFG_GIT_BRANCH)
    {
        // Check that name is not any other command
        if (!FileSystem::checkFileName($branch)) {
            return $this;
        }

        // To use this command owner of folder and git repository must be the same as web user
        exec('git reset --hard origin/' . $branch . ' 2>&1; git pull -v origin ' . $branch . ' 2>&1', $out);
        if ($out) {
            $this->result_message[] = $out;
        }

        // Clear all caches - may be required to show fresh data
        @Cacher::getInstance()->clearAllCaches();

        // Invalidate all frontend assets
        $setting = SettingEntityRepository::findOneEntityByCriteria(['name' => 'last_assets_invalidate_time']);
        if (!$setting) {
            $setting = new SettingEntity();
            $setting->setName('last_assets_invalidate_time');
        }

        $setting->setValue(NOW);
        $setting->save();

        return $this;
    }
public function updateSourceCode($branch = CFG_GIT_BRANCH)
    {
        // Check that name is not any other command
        if (!FileSystem::checkFileName($branch)) {
            return $this;
        }

        // To use this command owner of folder and git repository must be the same as web user
        exec('git reset --hard origin/' . $branch . ' 2>&1; git pull -v origin ' . $branch . ' 2>&1', $out);
        if ($out) {
            $this->result_message[] = $out;
        }

        // Clear all caches - may be required to show fresh data
        @Cacher::getInstance()->clearAllCaches();

        // Invalidate all frontend assets
        $setting = SettingEntityRepository::findOneEntityByCriteria(['name' => 'last_assets_invalidate_time']);
        if (!$setting) {
            $setting = new SettingEntity();
            $setting->setName('last_assets_invalidate_time');
        }

        $setting->setValue(NOW);
        $setting->save();

        return $this;
    }
public function updateSourceCode ( $ branch = CFG_GIT_BRANCH ) { // Check that name is not any other command if ( ! FileSystem :: checkFileName ( $ branch ) ) { return $ this ; } // To use this command owner of folder and git repository must be the same as web user exec ( 'git reset --hard origin/' . $ branch . ' 2>&1; git pull -v origin ' . $ branch . ' 2>&1' , $ out ) ; if ( $ out ) { $ this -> result_message [ ] = $ out ; } // Clear all caches - may be required to show fresh data @ Cacher :: getInstance ( ) -> clearAllCaches ( ) ; // Invalidate all frontend assets $ setting = SettingEntityRepository :: findOneEntityByCriteria ( [ 'name' => 'last_assets_invalidate_time' ] ) ; if ( ! $ setting ) { $ setting = new SettingEntity ( ) ; $ setting -> setName ( 'last_assets_invalidate_time' ) ; } $ setting -> setValue ( NOW ) ; $ setting -> save ( ) ; return $ this ; }
Updates files from git repository
Make sure user have access to repository and command is run as this user

@param string $branch
@return $this
Updates files from git repository Make sure user have access to repository and command is run as this user