public function updateStyleSheets()
	{
		$objStyleSheets = $this->Database->execute("SELECT * FROM tl_style_sheet");
		$arrStyleSheets = $objStyleSheets->fetchEach('name');

		// Make sure the dcaconfig.php file is loaded
		if (file_exists($this->strRootDir . '/system/config/dcaconfig.php'))
		{
			@trigger_error('Using the dcaconfig.php file has been deprecated and will no longer work in Contao 5.0. Create one or more DCA files in app/Resources/contao/dca instead.', E_USER_DEPRECATED);
			include $this->strRootDir . '/system/config/dcaconfig.php';
		}

		// Delete old style sheets
		foreach (scan($this->strRootDir . '/assets/css', true) as $file)
		{
			// Skip directories
			if (is_dir($this->strRootDir . '/assets/css/' . $file))
			{
				continue;
			}

			// Preserve root files (is this still required now that scripts are in assets/css/scripts?)
			if (\is_array(Config::get('rootFiles')) && \in_array($file, Config::get('rootFiles')))
			{
				continue;
			}

			// Do not delete the combined files (see #3605)
			if (preg_match('/^[a-f0-9]{12}\.css$/', $file))
			{
				continue;
			}

			$objFile = new File('assets/css/' . $file);

			// Delete the old style sheet
			if ($objFile->extension == 'css' && !\in_array($objFile->filename, $arrStyleSheets))
			{
				$objFile->delete();
			}
		}

		$objStyleSheets->reset();

		// Create the new style sheets
		while ($objStyleSheets->next())
		{
			$this->writeStyleSheet($objStyleSheets->row());
			$this->log('Generated style sheet "' . $objStyleSheets->name . '.css"', __METHOD__, TL_CRON);
		}
	}
public function updateStyleSheets()
	{
		$objStyleSheets = $this->Database->execute("SELECT * FROM tl_style_sheet");
		$arrStyleSheets = $objStyleSheets->fetchEach('name');

		
		if (file_exists($this->strRootDir . '/system/config/dcaconfig.php'))
		{
			@trigger_error('Using the dcaconfig.php file has been deprecated and will no longer work in Contao 5.0. Create one or more DCA files in app/Resources/contao/dca instead.', E_USER_DEPRECATED);
			include $this->strRootDir . '/system/config/dcaconfig.php';
		}

		
		foreach (scan($this->strRootDir . '/assets/css', true) as $file)
		{
			
			if (is_dir($this->strRootDir . '/assets/css/' . $file))
			{
				continue;
			}

			
			if (\is_array(Config::get('rootFiles')) && \in_array($file, Config::get('rootFiles')))
			{
				continue;
			}

			
			if (preg_match('/^[a-f0-9]{12}\.css$/', $file))
			{
				continue;
			}

			$objFile = new File('assets/css/' . $file);

			
			if ($objFile->extension == 'css' && !\in_array($objFile->filename, $arrStyleSheets))
			{
				$objFile->delete();
			}
		}

		$objStyleSheets->reset();

		
		while ($objStyleSheets->next())
		{
			$this->writeStyleSheet($objStyleSheets->row());
			$this->log('Generated style sheet "' . $objStyleSheets->name . '.css"', __METHOD__, TL_CRON);
		}
	}
public function updateStyleSheets ( ) { $ objStyleSheets = $ this -> Database -> execute ( "SELECT * FROM tl_style_sheet" ) ; $ arrStyleSheets = $ objStyleSheets -> fetchEach ( 'name' ) ; // Make sure the dcaconfig.php file is loaded if ( file_exists ( $ this -> strRootDir . '/system/config/dcaconfig.php' ) ) { @ trigger_error ( 'Using the dcaconfig.php file has been deprecated and will no longer work in Contao 5.0. Create one or more DCA files in app/Resources/contao/dca instead.' , E_USER_DEPRECATED ) ; include $ this -> strRootDir . '/system/config/dcaconfig.php' ; } // Delete old style sheets foreach ( scan ( $ this -> strRootDir . '/assets/css' , true ) as $ file ) { // Skip directories if ( is_dir ( $ this -> strRootDir . '/assets/css/' . $ file ) ) { continue ; } // Preserve root files (is this still required now that scripts are in assets/css/scripts?) if ( \ is_array ( Config :: get ( 'rootFiles' ) ) && \ in_array ( $ file , Config :: get ( 'rootFiles' ) ) ) { continue ; } // Do not delete the combined files (see #3605) if ( preg_match ( '/^[a-f0-9]{12}\.css$/' , $ file ) ) { continue ; } $ objFile = new File ( 'assets/css/' . $ file ) ; // Delete the old style sheet if ( $ objFile -> extension == 'css' && ! \ in_array ( $ objFile -> filename , $ arrStyleSheets ) ) { $ objFile -> delete ( ) ; } } $ objStyleSheets -> reset ( ) ; // Create the new style sheets while ( $ objStyleSheets -> next ( ) ) { $ this -> writeStyleSheet ( $ objStyleSheets -> row ( ) ) ; $ this -> log ( 'Generated style sheet "' . $ objStyleSheets -> name . '.css"' , __METHOD__ , TL_CRON ) ; } }
Update all style sheets in the scripts folder
Update all style sheets in the scripts folder