* @param string $archiveName
*/
public function __construct($archiveName) {
- $match = array();
if (!is_file($archiveName)) {
throw new SystemException("unable to find tar archive '".$archiveName."'");
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- $pattern = array();
+
$packageNames = array();
while ($row = $statement->fetchArray()) {
$packagePath = FileUtil::getRealPath(WCF_DIR.$row['packageDir']).'cache/';
* Executes cronjobs.
*/
public function execute() {
- $cronjob = $return = array();
+ $return = array();
foreach ($this->objects as $key => $cronjob) {
// skip jobs that are already being processed
// create template group
$templateGroupID = 0;
if (!empty($data['templates'])) {
- $originalTemplateGroupName = $templateGroupName = $data['name'];
+ $templateGroupName = $data['name'];
$templateGroupFolderName = preg_replace('/[^a-z0-9_-]/i', '', $templateGroupName);
if (empty($templateGroupFolderName)) $templateGroupFolderName = 'generic'.StringUtil::substring(StringUtil::getRandomID(), 0, 8);
$originalTemplatePackFolderName = $templateGroupFolderName;
*/
public function deleteFolders() {
// default template dir
- $folders = array(WCF_DIR . 'templates/' . $this->templateGroupFolderName);
+ $folders = array(WCF_DIR . 'templates/' . $this->templateGroupFolderName); // TODO: should this folder be deleted, too?
// get package dirs
$sql = "SELECT packageDir
*/
protected function selectLanguages() {
$errorField = $errorType = '';
- $illegalLanguages = array();
// skip step in developer mode
// select all available languages automatically
$indexName = $tableName.'_'.$indexName.'_key';
}
- $sql = '';
if ($indexData['type'] == 'FULLTEXT') {
$sql = "CREATE INDEX ".$indexName." ON ".$tableName." USING gin(to_tsvector('english', \"".implode('" || \' \' || "', $columns)."\"))";
}
* @see wcf\system\image\adapter\IImageAdapter::createThumbnail()
*/
public function createThumbnail($maxWidth, $maxHeight, $obtainDimensions = true) {
- $thumbnail = $this->imagick;
-
$thumbnail = $this->imagick;
$thumbnail->cropThumbnailImage($maxWidth, $maxHeight);
* @param string $archiveName
*/
public function __construct($archiveName) {
- $match = array();
if (!is_file($archiveName)) {
throw new SystemException("unable to find tar archive '".$archiveName."'");
}
$options = $option->parseMultipleEnableOptions();
foreach ($options as $key => $optionData) {
- $tmp = explode(',', $optionData);
+ $tmp = explode(',', $optionData); // TODO: is either optionData an array or tmp?
foreach ($optionData as $item) {
if ($item{0} == '!') {
* @return string path to the dowloaded file
*/
public function downloadArchive() {
- $parsedUrl = parse_url($this->archive);
$prefix = 'package';
// file transfer via hypertext transfer protocol.
* @return string
*/
protected function buildRequirementNodes() {
- $packageNodes = array();
$queue = $this->installation->queue;
// handle requirements
WHERE packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($this->package->packageID));
- $packages = array();
while ($row = $statement->fetchArray()) {
$this->dependentPackageIDs[] = $row['dependency'];
}
foreach ($styleList->getObjects() as $style) {
$styleEditor = new StyleEditor($style);
- $style->writeStyleFile();
+ $styleEditor->writeStyleFile();
}
}
}
);
if (!empty($row['optionID'])) {
- // update existing option
- $optionID = $row['optionID'];
-
$groupOption = new UserGroupOption(null, $row);
$groupOptionEditor = new UserGroupOptionEditor($groupOption);
$groupOptionEditor->update($data);
WHERE packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($this->installation->getPackageID()));
- $optionIDs = array();
while ($row = $statement->fetchArray()) {
WCF::getDB()->getEditor()->dropColumn('wcf'.WCF_N.'_user_option_value', 'userOption'.$row['optionID']);
}
* @param array $values
*/
protected static function calculateTime(array &$values) {
- $timestamp = false;
-
+
// calculation starts with month, thus start with
// month of $time (if within values)
$currentMonth = date('n', self::$timeBase);
}
// put the bytestream's first three bytes to an array.
- $workArray = array();
$workArray = unpack('C3', $sourceContent);
if (!is_array($workArray)) {
throw new SystemException("Unable to process bytestream.");
}
// detect the UTF-8 BOM.
- $destinationContent = '';
if (($workArray['1'] == $firstByte) && ($workArray['2'] == $secondByte) && ($workArray['3'] == $thirdByte)) {
$tmpname = FileUtil::getTemporaryFilename('stripBoms_');
$tmpStream = fopen($tmpname, 'w+');