<commit_before><?php
namespace wcf\system\cache\builder;
use wcf\data\package\Package;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\package\PackageDependencyHandler;
use wcf\system\WCF;
use wcf\util\FileUtil;

/**
 * Caches the paths of icons.
 * 
 * @author	<NAME>
 * @copyright	2001-2011 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	com.woltlab.wcf
 * @subpackage	system.cache.builder
 * @category 	Community Framework
 */
class IconCacheBuilder implements ICacheBuilder {
	/**
	 * @see wcf\system\cache\ICacheBuilder::getData()
	 */
	public function getData(array $cacheResource) {
		list($cache, $packageID, $styleID) = explode('-', $cacheResource['cache']); 
		$data = array();

		// get active package
		$activePackage = new Package($packageID);
		$activePackageDir = FileUtil::getRealPath(WCF_DIR.$activePackage->packageDir);
		
		// get package dirs
		$packageDirs = array();
		$conditionBuilder = new PreparedStatementConditionBuilder();
		$conditionBuilder->add("dependency.packageID IN (?) AND package.packageDir <> ''", array(PackageDependencyHandler::getDependencies()));
		$sql = "SELECT		DISTINCT package.packageDir
			FROM		wcf".WCF_N."_package_dependency dependency
			LEFT JOIN	wcf".WCF_N."_package package
			ON		(package.packageID = dependency.dependency)
			".$conditionBuilder->__toString()."<commit_msg>Fixed a PostgreSQL issue<commit_after><?php
namespace wcf\system\cache\builder;
use wcf\data\package\Package;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\package\PackageDependencyHandler;
use wcf\system\WCF;
use wcf\util\FileUtil;

/**
 * Caches the paths of icons.
 * 
 * @author	<NAME>
 * @copyright	2001-2011 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	com.woltlab.wcf
 * @subpackage	system.cache.builder
 * @category 	Community Framework
 */
class IconCacheBuilder implements ICacheBuilder {
	/**
	 * @see wcf\system\cache\ICacheBuilder::getData()
	 */
	public function getData(array $cacheResource) {
		list($cache, $packageID, $styleID) = explode('-', $cacheResource['cache']); 
		$data = array();

		// get active package
		$activePackage = new Package($packageID);
		$activePackageDir = FileUtil::getRealPath(WCF_DIR.$activePackage->packageDir);
		
		// get package dirs
		$packageDirs = array();
		$conditionBuilder = new PreparedStatementConditionBuilder();
		$conditionBuilder->add("dependency.packageID IN (?) AND package.packageDir <> ''", array(PackageDependencyHandler::getDependencies()));
		$sql = "SELECT		DISTINCT package.packageDir, dependency.priority
			FROM		wcf".WCF_N."_package_dependency dependency
			LEFT JOIN	wcf".WCF_N."_package package
			ON		(package.packageID = dependency.dependency)
			".$conditionBuilder->__toString()."
{'fraction_non_alphanumeric': 0.1315426997245179, 'fraction_numerical': 0.005509641873278237, 'mean_word_length': 5.154661016949152, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '261003', 'n_tokens_mistral': 964, 'n_tokens_neox': 875, 'n_words': 185}