当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseConnection::cleanIntList方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Database\DatabaseConnection::cleanIntList方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseConnection::cleanIntList方法的具体用法?PHP DatabaseConnection::cleanIntList怎么用?PHP DatabaseConnection::cleanIntList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Database\DatabaseConnection的用法示例。


在下文中一共展示了DatabaseConnection::cleanIntList方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: expectOutput

 /**
  * Check if the note plugin expects output. If there are no sys_note records on the given
  * pages, the extbase bootstrap doesn't have to run the complete plugin.
  * This mechanism should increase the performance of the hooked backend modules heavily.
  *
  * @param array $arguments Arguments for the extbase plugin
  * @return bool
  */
 protected function expectOutput(array $arguments = array())
 {
     // no pids set
     if (!isset($arguments['pids']) || empty($arguments['pids']) || empty($GLOBALS['BE_USER']->user['uid'])) {
         return false;
     }
     $pidList = $this->databaseConnection->cleanIntList($arguments['pids']);
     if (empty($pidList)) {
         return false;
     }
     // check if there are records
     return $this->databaseConnection->exec_SELECTcountRows('*', 'sys_note', 'pid IN (' . $pidList . ')' . BackendUtility::deleteClause('sys_note')) > 0;
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:21,代码来源:Bootstrap.php

示例2: loginAfterCreate

 /**
  * Login FE-User after creation
  *
  * @param \SLUB\Vk2\Domain\Model\User $user
  * @return void
  */
 protected function loginAfterCreate(\SLUB\Vk2\Domain\Model\User $user)
 {
     $GLOBALS['TSFE']->fe_user->checkPid = FALSE;
     $info = $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
     $pids = $this->vk2Config['persistence']['storagePid'];
     $extraWhere = ' AND pid IN (' . $this->databaseConnection->cleanIntList($pids) . ')';
     $user = $GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'], $user->getUsername(), $extraWhere);
     //DebuggerUtility::var_dump($user);
     $GLOBALS['TSFE']->fe_user->createUserSession($user);
     $GLOBALS['TSFE']->fe_user->user = $GLOBALS['TSFE']->fe_user->fetchUserSession();
     // enforce session so we get a FE cookie, otherwise autologin does not work (TYPO3 6.2.5+)
     $GLOBALS['TSFE']->fe_user->setAndSaveSessionData('dummy', TRUE);
 }
开发者ID:slub,项目名称:vk2-extension,代码行数:19,代码来源:AuthController.php

示例3: initAuth

 public function initAuth($mode, $loginData, $authInfo, $pObj)
 {
     $this->singleSignOnUtility = $this->objectManager->get('Portrino\\PxHybridAuth\\Utility\\SingleSignOnUtility');
     if (isset($_REQUEST['pid'])) {
         $this->db_user['check_pid_clause'] = ' AND pid IN (' . $this->db->cleanIntList($_REQUEST['pid']) . ')';
     }
     if (isset($_REQUEST['tx_pxhybridauth_login']['redirect_url'])) {
         $this->redirectUrl = $_REQUEST['tx_pxhybridauth_login']['redirect_url'];
     }
     if (isset($_REQUEST['tx_pxhybridauth_login']['redirect_pid'])) {
         $this->redirectPid = $_REQUEST['tx_pxhybridauth_login']['redirect_pid'];
     }
     if (isset($_REQUEST['tx_pxhybridauth_login']['provider'])) {
         $this->provider = $_REQUEST['tx_pxhybridauth_login']['provider'];
     }
     parent::initAuth($mode, $loginData, $authInfo, $pObj);
 }
开发者ID:kalypso63,项目名称:px_hybrid_auth,代码行数:17,代码来源:SocialLoginAuthenticationService.php

示例4: getNeighbours

    /**
     * @param \GeorgRinger\News\Domain\Model\News $news
     * @param $pidList
     * @param $sortField
     * @return array
     */
    protected function getNeighbours(\GeorgRinger\News\Domain\Model\News $news, $pidList, $sortField)
    {
        $pidList = empty($pidList) ? $news->getPid() : $pidList;
        $select = 'SELECT tx_news_domain_model_news.uid,tx_news_domain_model_news.title ';
        $from = 'FROM tx_news_domain_model_news';
        $whereClause = 'tx_news_domain_model_news.pid IN(' . $this->databaseConnection->cleanIntList($pidList) . ') ' . $this->getEnableFieldsWhereClauseForTable();
        $query = $select . $from . '
					WHERE ' . $whereClause . ' && ' . $sortField . ' >= (SELECT MAX(' . $sortField . ')
						' . $from . '
					WHERE ' . $whereClause . ' AND ' . $sortField . ' < (SELECT ' . $sortField . '
						FROM tx_news_domain_model_news
						WHERE tx_news_domain_model_news.uid = ' . $news->getUid() . '))
					ORDER BY ' . $sortField . ' ASC
					LIMIT 3';
        $query2 = $select . $from . '
			WHERE ' . $whereClause . ' AND ' . $sortField . '= (SELECT MIN(' . $sortField . ')
				FROM tx_news_domain_model_news
				WHERE ' . $whereClause . ' AND ' . $sortField . ' >
					(SELECT ' . $sortField . '
					FROM tx_news_domain_model_news
					WHERE tx_news_domain_model_news.uid = ' . $news->getUid() . '))
			';
        $res = $this->databaseConnection->sql_query($query);
        $out = array();
        while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
            $out[] = $row;
        }
        $this->databaseConnection->sql_free_result($res);
        if (count($out) === 0) {
            $res = $this->databaseConnection->sql_query($query2);
            while ($row = $this->databaseConnection->sql_fetch_assoc($res)) {
                $out[] = $row;
            }
            $this->databaseConnection->sql_free_result($res);
            return $out;
        }
        return $out;
    }
开发者ID:r3h6,项目名称:news,代码行数:44,代码来源:SimplePrevNextViewHelper.php

示例5: initFrontendEuser

 /**
  * Initialize fe_user object
  *
  * @param array $userdata
  *
  * @return void
  */
 protected function initFrontendEuser(array $userdata)
 {
     /** @var $feUser \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication */
     $feUser = $this->objectManager->get(\TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class);
     $feUser->lockIP = $GLOBALS['TYPO3_CONF_VARS']['FE']['lockIP'];
     $feUser->checkPid = $GLOBALS['TYPO3_CONF_VARS']['FE']['checkFeUserPid'];
     $feUser->lifetime = intval($GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime']);
     // List of pid's acceptable
     $feUser->checkPid_value = $this->database->cleanIntList(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pid'));
     if ($GLOBALS['TYPO3_CONF_VARS']['FE']['dontSetCookie']) {
         $feUser->dontSetCookie = 1;
     }
     $feUser->start();
     $feUser->unpack_uc('');
     $feUser->fetchSessionData();
     $userdata[$feUser->lastLogin_column] = $GLOBALS['EXEC_TIME'];
     $userdata['is_online'] = $GLOBALS['EXEC_TIME'];
     $feUser->user = $userdata;
     $GLOBALS['TSFE']->fe_user =& $feUser;
     $this->updateLastLogin($feUser);
     $feUser->setKey('ses', 'SfRegisterAutoLoginUser', true);
     $this->signalSlotDispatcher->dispatch(__CLASS__, 'save', array('frontend' => &$GLOBALS['TSFE']));
 }
开发者ID:electricretina,项目名称:sf_register,代码行数:30,代码来源:Login.php

示例6: getAuthInfoArray

 /**
  * Returns an info array which provides additional information for auth services
  *
  * @return array
  * @internal
  * @todo Define visibility
  */
 public function getAuthInfoArray()
 {
     $authInfo = array();
     $authInfo['loginType'] = $this->loginType;
     $authInfo['refInfo'] = parse_url(GeneralUtility::getIndpEnv('HTTP_REFERER'));
     $authInfo['HTTP_HOST'] = GeneralUtility::getIndpEnv('HTTP_HOST');
     $authInfo['REMOTE_ADDR'] = GeneralUtility::getIndpEnv('REMOTE_ADDR');
     $authInfo['REMOTE_HOST'] = GeneralUtility::getIndpEnv('REMOTE_HOST');
     $authInfo['showHiddenRecords'] = $this->showHiddenRecords;
     // Can be overidden in localconf by SVCONF:
     $authInfo['db_user']['table'] = $this->user_table;
     $authInfo['db_user']['userid_column'] = $this->userid_column;
     $authInfo['db_user']['username_column'] = $this->username_column;
     $authInfo['db_user']['userident_column'] = $this->userident_column;
     $authInfo['db_user']['usergroup_column'] = $this->usergroup_column;
     $authInfo['db_user']['enable_clause'] = $this->user_where_clause();
     if ($this->checkPid && $this->checkPid_value !== NULL) {
         $authInfo['db_user']['checkPidList'] = $this->checkPid_value;
         $authInfo['db_user']['check_pid_clause'] = ' AND pid IN (' . $this->db->cleanIntList($this->checkPid_value) . ')';
     } else {
         $authInfo['db_user']['checkPidList'] = '';
         $authInfo['db_user']['check_pid_clause'] = '';
     }
     $authInfo['db_groups']['table'] = $this->usergroup_table;
     return $authInfo;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:33,代码来源:AbstractUserAuthentication.php

示例7: loginAfterCreate

 /**
  * Login FE-User after creation
  *
  * @param User $user
  * @return void
  */
 protected function loginAfterCreate($user)
 {
     if ($this->config['new.']['login'] != 1) {
         return;
     }
     $GLOBALS['TSFE']->fe_user->checkPid = FALSE;
     $info = $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
     $pids = $this->allConfig['persistence']['storagePid'];
     $extraWhere = ' AND pid IN (' . $this->databaseConnection->cleanIntList($pids) . ')';
     $user = $GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'], $user->getUsername(), $extraWhere);
     $GLOBALS['TSFE']->fe_user->createUserSession($user);
     $GLOBALS['TSFE']->fe_user->user = $GLOBALS['TSFE']->fe_user->fetchUserSession();
     // add login flashmessage
     $this->addFlashMessage(LocalizationUtility::translate('login', 'femanager'), '', FlashMessage::NOTICE);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:21,代码来源:AbstractController.php

示例8: cleanIntListReturnsCleanedString

 /**
  * @test
  *
  * @return void
  */
 public function cleanIntListReturnsCleanedString()
 {
     $str = '234,-434,4.3,0, 1';
     $result = $this->subject->cleanIntList($str);
     $this->assertSame('234,-434,4,0,1', $result);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:11,代码来源:DatabaseConnectionTest.php

示例9: getSelectConf


//.........这里部分代码省略.........
                    $selectConf['where'] .= ' AND tt_news.datetime<' . (intval($this->piVars['pS']) + $pL);
                }
            }
        }
        // filter Workspaces preview.
        // Since "enablefields" is ignored in workspace previews it's required to filter out news manually which are not visible in the live version AND the selected workspace.
        if ($this->tsfe->sys_page->versioningPreview) {
            // execute the complete query
            $wsSelectconf = $selectConf;
            $wsSelectconf['selectFields'] = 'uid,pid,tstamp,crdate,deleted,hidden,fe_group,sys_language_uid,l18n_parent,l18n_diffsource,t3ver_oid,t3ver_id,t3ver_label,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_count,t3ver_tstamp,t3_origuid';
            $wsRes = $this->exec_getQuery('tt_news', $wsSelectconf);
            $removeUids = array();
            while ($wsRow = $this->db->sql_fetch_assoc($wsRes)) {
                $orgUid = $wsRow['uid'];
                $this->tsfe->sys_page->versionOL('tt_news', $wsRow);
                if (!$wsRow['uid']) {
                    // if versionOL returns nothing the record is not visible in the selected Workspace
                    $removeUids[] = $orgUid;
                }
            }
            $removeUidList = implode(',', array_unique($removeUids));
            // add list of not visible uids to the whereclause
            if ($removeUidList) {
                $selectConf['where'] .= ' AND tt_news.uid NOT IN (' . $removeUidList . ')';
            }
        }
        if ($this->debugTimes) {
            $this->hObj->getParsetime(__METHOD__);
        }
        if ($this->conf['excludeAlreadyDisplayedNews'] && $this->theCode != 'SEARCH' && $this->theCode != 'CATMENU' && $this->theCode != 'AMENU') {
            if (!is_array($GLOBALS['T3_VAR']['displayedNews'])) {
                $GLOBALS['T3_VAR']['displayedNews'] = array();
            } else {
                $excludeUids = implode(',', $GLOBALS['T3_VAR']['displayedNews']);
                if ($excludeUids) {
                    $selectConf['where'] .= ' AND tt_news.uid NOT IN (' . $this->db->cleanIntList($excludeUids) . ')';
                }
            }
        }
        if ($this->theCode != 'AMENU') {
            if ($this->config['groupBy']) {
                $selectConf['groupBy'] = $this->config['groupBy'];
            }
            // 				else {
            // 					$selectConf['groupBy'] = 'tt_news.uid';
            // 				}
            if ($this->config['orderBy']) {
                if (strtoupper($this->config['orderBy']) == 'RANDOM') {
                    $selectConf['orderBy'] = 'RAND()';
                } else {
                    $selectConf['orderBy'] = $this->config['orderBy'] . ($this->config['ascDesc'] ? ' ' . $this->config['ascDesc'] : '');
                }
            } else {
                $selectConf['orderBy'] = 'datetime DESC';
            }
            // overwrite the groupBy value for categories
            if (!$this->catExclusive && $selectConf['groupBy'] == 'category') {
                $selectConf['leftjoin'] = 'tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local';
                $selectConf['groupBy'] = 'tt_news_cat_mm.uid_foreign';
            }
        }
        $selectConf['where'] .= $this->getLanguageWhere();
        $selectConf['where'] .= ' AND tt_news.pid > 0 ';
        // only online versions
        if ($this->theCode != 'LATEST') {
            // latest ignores search query
            $selectConf['where'] .= $addwhere;
        }
        if ($this->conf['restrictListToThisTypes'] != '') {
            $types = implode(',', \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['restrictListToTheseTypes'], 1));
            $where = ' AND tt_news.type IN (' . $types . ')';
        }
        // listing related news
        if ($this->theCode == 'RELATED' && $this->relNewsUid) {
            $where = $this->addFromTable . '.uid_local=' . $this->relNewsUid . '
						AND tt_news.uid=' . $this->addFromTable . '.uid_foreign
						AND ' . $this->addFromTable . '.tablenames!=' . $this->db->fullQuoteStr('pages', $this->addFromTable);
            if ($this->conf['useBidirectionalRelations']) {
                $where = '((' . $where . ')
						OR (' . $this->addFromTable . '.uid_foreign=' . $this->relNewsUid . '
							AND tt_news.uid=' . $this->addFromTable . '.uid_local
							AND ' . $this->addFromTable . '.tablenames!=' . $this->db->fullQuoteStr('pages', $this->addFromTable) . '))';
            }
            $selectConf['where'] .= ' AND ' . $where;
        }
        // function Hook for processing the selectConf array
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['selectConfHook'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_news']['selectConfHook'] as $_classRef) {
                $_procObj =& \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($_classRef);
                $selectConf = $_procObj->processSelectConfHook($this, $selectConf);
            }
        }
        //		debug($this->config['categoryMode'],'categoryMode');
        //		debug($this->catExclusive,'$this->catExclusive');
        //				debug($selectConf,'select_conf '.$this->theCode);
        if ($this->debugTimes) {
            $this->hObj->getParsetime(__METHOD__);
        }
        return $selectConf;
    }
开发者ID:mrmoree,项目名称:vkmh_typo3,代码行数:101,代码来源:class.tx_ttnews.php


注:本文中的TYPO3\CMS\Core\Database\DatabaseConnection::cleanIntList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。