Crete temp notice list table for guest users and
returns temp table name.

@param array $aNoticeList

@return string
978510
protected function CreateTempNotice($aNoticeList)
    {
        $sTmpTableName = MySqlLegacySupport::getInstance()->real_escape_string('_tmp'.session_id().'noticelist');
        $query = "CREATE TEMPORARY  TABLE `{$sTmpTableName}` (
                              `date_added` datetime NOT NULL,
                              `shop_article_id` char(36) NOT NULL,
                              `amount` decimal(10,2) NOT NULL default '1.00',
                              KEY `shop_article_id` (`shop_article_id`),
                              KEY `date_added` (`date_added`)
                            ) ENGINE=MEMORY  DEFAULT CHARSET=utf8";
        MySqlLegacySupport::getInstance()->query($query);
        reset($aNoticeList);
        foreach ($aNoticeList as $iArticleId => $oNoteItem) {
            /** @var $oNoteItem TdbShopUserNoticeList */
            $query = "INSERT INTO `{$sTmpTableName}`
                  	                  SET `date_added` = '".MySqlLegacySupport::getInstance()->real_escape_string($oNoteItem->fieldDateAdded)."',
                  	                      `shop_article_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($oNoteItem->fieldShopArticleId)."',
                  	                      `amount` = '".MySqlLegacySupport::getInstance()->real_escape_string($oNoteItem->fieldAmount)."'
                  	         ";
            MySqlLegacySupport::getInstance()->query($query);
        }

        return $sTmpTableName;
    }
690125
public function all($includingRead = false, $participating = false, DateTime $since = null, DateTime $before = null)
    {
        $parameters = [
            'all' => $includingRead,
            'participating' => $participating,
        ];

        if ($since !== null) {
            $parameters['since'] = $since->format(DateTime::ISO8601);
        }

        if ($before !== null) {
            $parameters['before'] = $before->format(DateTime::ISO8601);
        }

        return $this->get('/notifications', $parameters);
    }
749840
public function listPages($listMode = PageOrder::LIST_ALL)
    {
        $retArray = array();
        if ($listMode == PageOrder::LIST_INACTIVE || $listMode == PageOrder::LIST_ALL) {
            foreach ($this->inactivePages as $page) {
                $retArray[] = $page;
            }
        }
        if ($listMode == PageOrder::LIST_ALL || $listMode == PageOrder::LIST_ACTIVE) {
            foreach ($this->activePages as $page) {
                $retArray[] = $page;
            }
        }

        return $retArray;

    }
1066154
protected function generateTempDirName()
    {
        // @todo to be extremely safe, we should use PID+time
        $tmpDir = sys_get_temp_dir() . '/' . uniqid( 'composer_ezlegacykernel_' );
        if ( $this->io->isVerbose() )
        {
            $this->io->write( "Temporary directory for ezpublish-legacy updates: $tmpDir" );
        }

        return $tmpDir;
    }
1259569
public static function get_user_dates($contextid, $contextlevel, $instanceid, $timestamps) {
        $params = self::validate_parameters(
            self::get_user_dates_parameters(),
            [
                'contextid' => $contextid,
                'contextlevel' => $contextlevel,
                'instanceid' => $instanceid,
                'timestamps' => $timestamps,
            ]
        );

        $context = self::get_context_from_params($params);
        self::validate_context($context);

        $formatteddates = array_map(function($timestamp) {
            return userdate($timestamp['timestamp'], $timestamp['format']);
        }, $params['timestamps']);

        return ['dates' => $formatteddates];
    }
1211215
protected function getLogFileName() 
    {
        if (!$this->notification->getOrderReference()->isSetAmazonOrderReferenceId()) {
            throw new InvalidArgumentException("OrderReferenceId is NULL");
        }

        return $this->notification->getOrderReference()->getAmazonOrderReferenceId() 
            . "_OrderReference.txt";
    }
1319128
public function listToText( $l ) {
		$s = '';
		$m = count( $l ) - 1;
		if ( $m == 1 ) {
			$s = $l[0] . $this->msg( 'and', [ 'domain' => 'general' ] ) .
				$this->msg( 'word-separator', [ 'domain' => 'general' ] ) .
				$l[1];
		} else {
			for ( $i = $m; $i >= 0; $i-- ) {
				if ( $i == $m ) {
					$s = $l[$i];
				} elseif ( $i == $m - 1 ) {
					$s = $l[$i] . $this->msg( 'and', [ 'domain' => 'general' ] ) .
						$this->msg( 'word-separator', [ 'domain' => 'general' ] ) .
						$s;
				} else {
					$s = $l[$i] .
						$this->msg( 'comma-separator', [ 'domain' => 'general' ] ) .
						$s;
				}
			}
		}
		return str_replace( '&#32;', ' ', $s );
	}
38425
protected function getBillingAddress(TdbShopOrder $order, $cachingEnabled, IMapperCacheTriggerRestricted $cacheTriggerManager)
    {
        $salutation = $order->GetFieldAdrBillingSalutation();
        if ($salutation && $cachingEnabled) {
            $cacheTriggerManager->addTrigger($salutation->table, $salutation->id);
        }
        $address = '';
        $address .= (null !== $salutation) ? $salutation->GetName().' ' : '';
        $address .= $this->getValueOrDefault($order->fieldAdrBillingFirstname, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrBillingLastname, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrBillingAdditionalInfo, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrBillingStreet, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrBillingStreetnr, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrBillingPostalcode, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrBillingCity);

        return $address;
    }
510234
public static function displayNotices()
    {
        if ($notices = get_option('staticwp_deferred_admin_notices')) {
            foreach ($notices as $notice) {
                $message = $notice;
                $type = 'updated';

                if (is_array($notice)) {
                    $message = isset($notice['message']) ? $notice['message'] : '';
                    $type = isset($notice['type']) ? $notice['type'] : $type;
                }

                echo '<div class="' . $type . '"><p>' . $message . '</p></div>';
            }
            delete_option('staticwp_deferred_admin_notices');
        }
    }
571029
function getFirstLastDate($dateA, $dFormat = "Y/m/d") {

//    $fDate = $lDate = date("m/d/y",time());
        $fDate = $lDate = date($dFormat, time());
        asort($dateA); // TODO
        $i = 0;
        $maxItem = count($dateA);
        foreach ($dateA as $k => $one) {
            if ($i == 0)
                $firstDate = $k;
            if ($i == $maxItem - 1)
                $lastDate = $k;
            $i++;
        }
        $fDate = date($dFormat, strtotime($firstDate));
        $lDate = date($dFormat, strtotime($lastDate));
        return array($fDate, $lDate);
    }
1059179
public static function getTempFile($allow_memory = true) {
    $f = null;

    if ($allow_memory) {
      $f = fopen("php://temp", "rb+");
    }
    else {
      $f = fopen(tempnam(sys_get_temp_dir(), "fnt"), "rb+");
    }

    return $f;
  }
41726
private function warmUpTemplate(TemplateReferenceInterface $template)
    {
        $templateTemp = [];

        /** @var ThemeInterface $theme */
        foreach ($this->themeRepository->findAll() as $theme) {
            $templateTempItem = $this->warmUpThemeTemplate($template, $theme);

            if ($templateTempItem) {
                $templateTemp[$template->getLogicalName()] = rtrim($templateTempItem, '/');
            }
        }

        return $templateTemp;
    }
861729
public static function getTempFn() {
		$tempFileName = BROOTPATH . 'temp' . DIRECTORY_SEPARATOR;
		$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		$charactersLength = strlen($characters);
		for ($i = 0; $i < 15; $i++) {
			$tempFileName .= $characters[rand(0, $charactersLength - 1)];
		}
		$tempFileName .= '.tmp';
		return $tempFileName;
	}
1303432
protected function listTempDir($dir = ''){
        $arrFiles = [];
        $scandir = ($dir != '')?$dir:'.';
        $objects = scandir($scandir);
        foreach ($objects as $object) {
            if ($object == "." || $object == "..") {
                continue;
            }
            $objectPath = ($dir != '')?$dir.DIRECTORY_SEPARATOR.$object:$object;
            if (is_dir($objectPath)) {
                $arrFiles = array_merge($arrFiles, $this->listTempDir($objectPath));
            } else {
                $arrFiles[] = $objectPath;
            }
        }
        return $arrFiles;
    }
255087
public function arrayToNumberedList(array $listItems)
    {
        $formattedList = '';
        $number = 1;

        foreach ($listItems as $listItem) {
            $formattedList .= sprintf("%d. %s\n", $number++, (string) $listItem);
        }

        return $formattedList;
    }
479958
public function displayHtmlTable($aColList = [])
    {
        $r = '';
        if (count($aColList) > 0) {
            $r .= '<table border="1">';
            $r .= '<thead>';
            $r .= '<tr>';
            foreach ($aColList[0] as $k => $v) {
                $r .= '<td>' . $k . '</td>';
            }
            $r .= '</tr>';
            $r .= '</thead>';
            $r .= '<tbody>';
            foreach ($aColList as $record) {
                $r .= '<tr>';
                foreach ($record as $data) {
                    $r .= '<td>' . $data . '</td>';
                }
                $r .= '</tr>';
            }
            $r .= '</tbody>';
            $r .= '<table>';
        } else {
            $r .= '<div class="no-results">No results found for query.</div>';
        }

        return $r;
    }
358422
public function listNotifications(bool $all = false, bool $participating = false, string $since = 'now',
                                      string $before = null): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/notifications?:args', http_build_query([
            'all'           => $all,
            'participating' => $participating,
            'since'         => (new DateTime($since))->format(DateTime::ATOM),
            'before'        => (new DateTime($before))->format(DateTime::ATOM)
        ])));
    }