Flush webroot/assets/

@return string execute message
331673
protected function flushAssets()
    {
        $message = '';
        $except = [Yii::getAlias('@webroot/assets/.gitignore'), Yii::getAlias('@webroot/assets/index.html')];
        $dir = Yii::getAlias('@webroot/assets');
        $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
        /* @var RecursiveDirectoryIterator[] $files */
        $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
        $hasErrors = false;
        if (stristr(PHP_OS, 'WIN') === false) {
            foreach ($files as $file) {
                if (!in_array($file->getRealPath(), $except)) {
                    if ($file->isDir() && $file->isLink() === false) {
                        $result = @rmdir($file->getRealPath());
                    } elseif ($file->isLink() === true) {
                        $result = @unlink($file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename());
                    } else {
                        $result = @unlink($file->getRealPath());
                    }
                    if (!$result) {
                        $hasErrors = true;
                    }
                }
            }
        }
        $message .= $hasErrors ?
            '<p>' . Yii::t('wocenter/app', 'Some assets are not flushed.') . '</p>' :
            '<p>' . Yii::t('wocenter/app', 'Assets are flushed.') . '</p>';
        
        return $message;
    }
234159
public function flush()
    {
        if ($this->useCache) {
            foreach ($this->configFiles as $configFile) {
                if (function_exists('apc_delete')) {
                    \apc_delete($configFile);
                }
            }
        }
        $this->config = array();
    }
827837
private function flush()
    {
        $keepWriting = true;
        while ($keepWriting) {
            $message = $this->messages[0]['message'];
            $promise = $this->messages[0]['promise'];

            $bytesWritten = @fwrite($this->output, $message);

            if ($bytesWritten > 0) {
                $message = substr($message, $bytesWritten);
            }

            // Determine if this message was completely sent
            if (strlen($message) === 0) {
                array_shift($this->messages);

                // This was the last message in the queue, remove the write handler.
                if (count($this->messages) === 0) {
                    Loop\removeWriteStream($this->output);
                    $keepWriting = false;
                }

                $promise->fulfill();
            } else {
                $this->messages[0]['message'] = $message;
                $keepWriting = false;
            }
        }
    }
497519
public function flush()
    {
        parent::flush();

        $this->booted = false;
        $this->hasBeenBootstrapped = false;

        $this->bootingCallbacks = [];
        $this->bootedCallbacks = [];
        $this->reboundCallbacks = [];
        $this->resolvingCallbacks = [];
        $this->terminatingCallbacks = [];
        $this->afterResolvingCallbacks = [];
        $this->globalResolvingCallbacks = [];

        $this->serviceProviders = [];
        $this->deferredServices = [];
        $this->buildStack = [];
    }
507891
public function flush()
    {
        if (! $this->files->isDirectory($this->directory)) {
            return false;
        }

        foreach ($this->files->directories($this->directory) as $directory) {
            if (! $this->files->deleteDirectory($directory)) {
                return false;
            }
        }

        return true;
    }
362108
public function flush()
    {
        $buffer = '';
        while (!$this->eof()) {
            $buffer .= $this->read($this->_bufferSize);
        }
        return $buffer;
    }
520159
public function flush()
    {
        $count = xcache_count(XC_TYPE_PHP);
        for ($i = 0; $i < $count; $i++) {
            // XCache PHP cache temizle.
            xcache_clear_cache(XC_TYPE_PHP, $i);
        }

        $count = xcache_count(XC_TYPE_VAR);
        for ($i = 0; $i < $count; $i++) {
            // XCache degisken cache temizle.
            xcache_clear_cache(XC_TYPE_VAR, $i);
        }

        return true;
    }
1272921
public function flush()
    {
        if ($this->fileSystem->isDirectory($this->directory))
        {
            $this->fileSystem->deleteDirectory($this->directory, true);
        }
    }
714018
public function flush()
    {
        if (null === $this->routesFactory) {
            $routes = new RouteCollection();
        } else {
            $routes = $this->routesFactory;
        }

        return $this->doFlush('', $routes);
    }
1337046
public function flush() {
		$pattern = $this->getCachePath() . DIRECTORY_SEPARATOR . $this->prefix . '_*';
		
		if (self::isExecAvailable()) {
			exec('rm ' . $pattern);
			return true;
		}
		
		$list = glob($pattern);
		
		if ($list === false) {
			return false;
		}
		
		if (empty($list)) {
			return true;
		}
		
		$result = true;
		
		foreach ($list as $path) {
			if (! unlink($path)) {
				$result = false;
			}
		}
		
		return $result;
	}
1121657
public function flush()
    {
        $this->buffer = array_merge($this->cache, $this->buffer);

        return file_put_contents($this->options->get('store'), json_encode($this->buffer));
    }
866526
public function flush()
    {
        $id = $this->batchRunner
            ->getJobFromId($this->identifier)
            ->id();

        return $this->batchRunner
            ->getProcessor()
            ->flush($id);
    }
1296949
public function flush()
    {

        $files = $this->getFileSystem()->files($this->getFolder());
        foreach($files as $file)
        {
            $this->delete($file);
        }

        return true;
    }
1050983
public function flush() {

		if(false !== $this -> file -> getExists()) {

			if(false === is_writable($this -> file -> getBasepath())) {
				return trigger_error(sprintf('File "%s" passed to %s() is not writable', $this -> file -> getBasepath(), __METHOD__), E_USER_ERROR);
	    	}

			$fh = fopen($this -> file -> getBasepath(), 'w');
			
			if(flock($fh, LOCK_EX)) {

    			ftruncate($fh, 0);
			    fflush($fh);
    			flock($fh, LOCK_UN);
    		}

			fclose($fh);

			$this -> refresh();
		}

		return $this;
	}
648580
private function flush()
    {
        $currentConfigurationHash = $this->getCurrentConfigurationState();

        if ($currentConfigurationHash !== get_option('strata_rewrite_state')) {
            update_option('strata_rewrite_state', $currentConfigurationHash);
            flush_rewrite_rules();
            return true;
        }

        return false;
    }
829684
public function flushOutput()
    {
        switch ($this->_sOutputFormat) {
            case self::OUTPUT_FORMAT_JSON:
                echo getStr()->jsonEncode($this->_aBuffer);
                break;
            case self::OUTPUT_FORMAT_HTML:
            default:
                break;
        }
    }
716711
public function flush()
	{
		$index	= new DirectoryIterator( $this->path );
		$number	= 0;
		foreach( $index as $entry )
		{
			if( $entry->isDot() || $entry->isDir() )
				continue;
			if( substr( $entry->getFilename(), -7 ) == ".serial" )
				$number	+= (int) @unlink( $entry->getPathname() );
		}
		$this->data	= array();
		return $number;
	}