_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q23600
Page.moveToRoot
train
public function moveToRoot() { $db = Database::connection(); $db->executeQuery('update Pages set cParentID = 0 where cID = ?',
php
{ "resource": "" }
q23601
Page.setPageToDraft
train
public function setPageToDraft() { $db = Database::connection(); $db->executeQuery('update Pages set cIsDraft = 1 where cID = ?',
php
{ "resource": "" }
q23602
Page._associateMasterCollectionAttributes
train
protected function _associateMasterCollectionAttributes($newCID, $masterCID) { $mc = self::getByID($masterCID, 'ACTIVE'); $nc = self::getByID($newCID, 'RECENT'); $attributes = CollectionKey::getAttributeValues($mc); foreach($attributes as $attribute) { $value = $attribute...
php
{ "resource": "" }
q23603
Page.addHomePage
train
public static function addHomePage(TreeInterface $siteTree = null) { $app = Application::getFacadeApplication(); // creates the home page of the site $db = $app->make(Connection::class); $cParentID = 0; $uID = HOME_UID; $data = [ 'name' => HOME_NAME, ...
php
{ "resource": "" }
q23604
Page.acquireAreaStylesFromDefaults
train
protected function acquireAreaStylesFromDefaults(\Concrete\Core\Entity\Page\Template $template) { $pt = $this->getPageTypeObject(); if (is_object($pt)) { $mc = $pt->getPageTypePageTemplateDefaultPageObject($template); $db = Database::connection(); // first, we de...
php
{ "resource": "" }
q23605
Page.setPageDraftTargetParentPageID
train
public function setPageDraftTargetParentPageID($cParentID) { if ($cParentID != $this->getPageDraftTargetParentPageID()) { Section::unregisterPage($this); } $db = Database::connection(); $cParentID = intval($cParentID);
php
{ "resource": "" }
q23606
Bulk.getSiteNameForLocale
train
protected function getSiteNameForLocale($locale) { static $names = array(); if (!isset($names[$locale])) { $prevLocale = \Localization::activeLocale(); if ($prevLocale !== $locale) { \Localization::changeLocale($locale); }
php
{ "resource": "" }
q23607
Bulk.getSiteNameForPage
train
public function getSiteNameForPage(\Concrete\Core\Page\Page $page) { static $multilingual; static $defaultLocale; if (!isset($multilingual)) { $multilingual = $this->app->make('multilingual/detector')->isEnabled(); } if ($multilingual) { if (!isset($d...
php
{ "resource": "" }
q23608
Url.shortenURL
train
public function shortenURL($strURL) { $file = Loader::helper('file'); $url
php
{ "resource": "" }
q23609
Filesystem.create
train
public function create() { $type = NodeType::getByHandle('file'); if (!is_object($type)) { NodeType::add('file'); } $type = NodeType::getByHandle('file_folder'); if (!is_object($type)) { NodeType::add('file_folder'); }
php
{ "resource": "" }
q23610
Search.csv_export
train
public function csv_export() { $search = $this->app->make('Concrete\Controller\Search\Users'); $result = $search->getCurrentSearchObject(); $headers = [ 'Content-Type' => 'text/csv', 'Content-Disposition' => 'attachment; filename=concrete5_users.csv', ]; ...
php
{ "resource": "" }
q23611
AbstractImporter.process
train
public function process($dataRowsToSkip = 0, $maxDataRows = null, $collectData = false) { $result = $this->app->make(ImportResult::class); if ($this->processHeader($result)) { if ($this->dryRun !== false) { // Let's start a transaction. It shouldn't be necessary, but it d...
php
{ "resource": "" }
q23612
AbstractImporter.processHeader
train
protected function processHeader(ImportResult $importResult) { $result = false; $this->csvSchema = null; $csvSchema = null; $this->reader->each(function ($headerCells, $rowIndex) use (&$csvSchema) { $csvSchema = new CsvSchema($rowIndex, $headerCells, $this->getStaticHeade...
php
{ "resource": "" }
q23613
AbstractImporter.processData
train
protected function processData(ImportResult $importResult, $dataRowsToSkip, $maxDataRows, $collectData = false) { if ($collectData !== false) { $dataCollected = [ 'attributeKeys' => [], 'attributeControllers' => [], 'data' => [], ]; ...
php
{ "resource": "" }
q23614
AbstractImporter.setCategory
train
protected function setCategory(CategoryInterface $category) { $this->category = $category;
php
{ "resource": "" }
q23615
AbstractImporter.getAttributeKeysAndControllers
train
protected function getAttributeKeysAndControllers() { if ($this->attributeKeysAndControllers === null) { $list = []; foreach ($this->category->getList() as $attributeKey)
php
{ "resource": "" }
q23616
AbstractImporter.convertCsvDataForAttributeController
train
private function convertCsvDataForAttributeController(AttributeController $attributeController, $csvData) { $result = $csvData; if ($attributeController instanceof MulticolumnTextExportableAttributeInterface) { $attributeHeaders = $attributeController->getAttributeTextRepresentationHeade...
php
{ "resource": "" }
q23617
SessionValidator.hasActiveSession
train
public function hasActiveSession() { $cookie = $this->app['cookie'];
php
{ "resource": "" }
q23618
ErrorList.containsField
train
public function containsField($field) { $identifier = $field instanceof FieldInterface ? $field->getFieldElementName() : $field; foreach ($this->getList() as $error)
php
{ "resource": "" }
q23619
NginxDetector.detectFromServer
train
private function detectFromServer($value) { $result = null; if (is_string($value) && preg_match('/\bnginx\/(\d+(\.\d+)+)/i', $value, $m))
php
{ "resource": "" }
q23620
UserDeactivatedListView.getActionDescription
train
public function getActionDescription() { $entityManager = $this->getApplication()->make(EntityManagerInterface::class); /** @var User $user */ $user = $entityManager->find(User::class, $this->notification->getUserID()); $actor = null; $actorID = $this->notification->getActo...
php
{ "resource": "" }
q23621
UserDeactivatedListView.getUrlResolver
train
protected function getUrlResolver() { if (!$this->resolver) { $this->resolver
php
{ "resource": "" }
q23622
DatabaseStructureManager.refreshEntities
train
public function refreshEntities() { $metadatas = $this->clearCacheAndProxies(); // Finally, we update the schema
php
{ "resource": "" }
q23623
TextFormatter.getText
train
public function getText() { $lines = []; if ($this->error->has()) { foreach ($this->error->getList() as $error) { if ($error instanceof HtmlAwareErrorInterface && $error->messageContainsHtml()) { $lines[] = strip_tags((string) $error);
php
{ "resource": "" }
q23624
Archive.uploadZipToTemp
train
protected function uploadZipToTemp($file) { if (!file_exists($file)) { throw new Exception(t('Could not transfer to temp directory - file not found.')); } else { $dir = time();
php
{ "resource": "" }
q23625
Archive.install
train
protected function install($file, $inplace = false) { if (!$inplace) { $directory = $this->uploadZipToTemp($file); } else { $directory = $file; } $dir = $this->unzip($directory); $dirFull = $this->getArchiveDirectory($dir); $dirFull = str_repla...
php
{ "resource": "" }
q23626
Key.load
train
public function load($akID) { $em = $this->getFacadeApplication()->make('Doctrine\ORM\EntityManager'); $this->legacyAttributeKey
php
{ "resource": "" }
q23627
AbstractRepetition.dateDiffNoDST
train
protected function dateDiffNoDST(\DateTime $from, \DateTime $to) { $fromUTC = new \DateTime($from->format('Y-m-d\TH:i:s+00:00')); $toUTC
php
{ "resource": "" }
q23628
AbstractCategory.add
train
public function add($type, $key, $settings = null, $pkg = null) { if (is_string($type)) { $typeFactory = $this->application->make(TypeFactory::class); /* @var TypeFactory $typeFactory */ $type = $typeFactory->getByHandle($type); } // Legacy array support ...
php
{ "resource": "" }
q23629
AbstractCategory.import
train
public function import(AttributeType $type, SimpleXMLElement $element, Package $package = null) { $key = $this->createAttributeKey(); $loader = $this->getImportLoader(); $loader->load($key, $element);
php
{ "resource": "" }
q23630
Application.shutdown
train
public function shutdown($options = []) { \Events::dispatch('on_shutdown'); if ($this->isInstalled()) { if (!isset($options['jobs']) || $options['jobs'] == false) { $this->handleScheduledJobs(); }
php
{ "resource": "" }
q23631
Application.handleScheduledJobs
train
protected function handleScheduledJobs() { $config = $this['config']; if ($config->get('concrete.jobs.enable_scheduling')) { $c = Page::getCurrentPage(); if ($c instanceof Page && !$c->isAdminArea()) { // check for non dashboard page $jobs = J...
php
{ "resource": "" }
q23632
Application.isInstalled
train
public function isInstalled() { if ($this->installed === null) { if (!$this->isShared('config')) { throw new Exception('Attempting to check
php
{ "resource": "" }
q23633
Application.checkPageCache
train
public function checkPageCache(\Concrete\Core\Http\Request $request) { $library = PageCache::getLibrary(); if ($library->shouldCheckCache($request)) { $record = $library->getRecord($request); if ($record instanceof PageCacheRecord) {
php
{ "resource": "" }
q23634
Application.handleAutomaticUpdates
train
public function handleAutomaticUpdates() { $config = $this['config']; $installed = $config->get('concrete.version_db_installed'); $core = $config->get('concrete.version_db'); if ($installed < $core) {
php
{ "resource": "" }
q23635
Application.setupPackageAutoloaders
train
public function setupPackageAutoloaders() { $pla = \Concrete\Core\Package\PackageList::get(); $pl = $pla->getPackages(); $cl = ClassLoader::getInstance(); /** @var \Package[] $pl */ foreach ($pl as $p) { \Config::package($p); if ($p->isPackageInstalled...
php
{ "resource": "" }
q23636
Application.setupPackages
train
public function setupPackages() { $config = $this['config']; $loc = Localization::getInstance(); $entityManager = $this['Doctrine\ORM\EntityManager']; $configUpdater = new EntityManagerConfigUpdater($entityManager); foreach ($this->packages as $pkg) { if ($confi...
php
{ "resource": "" }
q23637
Application.setupFilesystem
train
public function setupFilesystem() { $config = $this['config']; if (!is_dir($config->get('concrete.cache.directory'))) { @mkdir($config->get('concrete.cache.directory'), $config->get('concrete.filesystem.permissions.directory'));
php
{ "resource": "" }
q23638
Application.handleURLSlashes
train
public function handleURLSlashes(SymfonyRequest $request, Site $site) { $path = $request->getPathInfo(); // If this isn't the homepage if ($path && $path != '/') { $config = $this->make('config'); $trailing_slashes = $config->get('concrete.seo.trailing_slash'); ...
php
{ "resource": "" }
q23639
Application.handleCanonicalURLRedirection
train
public function handleCanonicalURLRedirection(SymfonyRequest $r, Site $site) { $globalConfig = $this['config']; $siteConfig = $site->getConfigRepository(); if ($globalConfig->get('concrete.seo.redirect_to_canonical_url') && $siteConfig->get('seo.canonical_url')) { $requestUri = ...
php
{ "resource": "" }
q23640
Stack.getLocalizedStack
train
public function getLocalizedStack(Section $section, $cvID = 'RECENT') { $result = null; $mySectionID = $this->getMultilingualSectionID(); if ($mySectionID !== 0 && $section->getCollectionID() == $mySectionID) { $result = $this; } else { $neutralID = ($mySectio...
php
{ "resource": "" }
q23641
Command.writeError
train
protected function writeError(OutputInterface $output, $error) { $result = [trim($error->getMessage())]; // If the output is verbose, add file and location if ($output->isVerbose()) { $file = $error->getFile(); if ($file) { $result[] = "File: {$file}"...
php
{ "resource": "" }
q23642
Command.execute
train
protected function execute(InputInterface $input, OutputInterface $output) { if (!method_exists($this, 'handle')) {
php
{ "resource": "" }
q23643
Command.table
train
public function table(array $headers, array $rows, $tableStyle = 'default', array
php
{ "resource": "" }
q23644
Controller.getConcrete5ProfileURL
train
public function getConcrete5ProfileURL($user) { $result = null; $binding = $this->getBindingForUser($user); if ($binding !== null) { $concrete5UserID = (int) $binding; if ($concrete5UserID !== 0) {
php
{ "resource": "" }
q23645
InstallCommand.getQuestion
train
private function getQuestion($row, InputInterface $input) { $definition = $this->getDefinition(); // Define default values $row = (array) $row; $default = null; $mutator = null; // Grab the key which is always first $key = array_shift($row); // If t...
php
{ "resource": "" }
q23646
InstallCommand.getWizard
train
private function getWizard(InputInterface $input, OutputInterface $output, $firstKey = null) { $questions = $this->wizardSteps(); $tryAgain = false; $result = null; // Loop over the questions, parse them, then yield them out foreach ($questions as $question) { if...
php
{ "resource": "" }
q23647
InstallCommand.getQuestionString
train
private function getQuestionString(InputOption $option, $default) { if ('' !== (string) $default) { if (stripos($option->getName(), 'password') !== false) { return sprintf('%s? [<options=bold>HIDDEN</>]: ', $option->getDescription(), $default); }
php
{ "resource": "" }
q23648
ClientFactory.createClient
train
public function createClient($name, $redirect, array $scopes, $key, $secret) { $client = $this->app->make(Client::class); $client->setName($name); $client->setRedirectUri($redirect); // @TODO support scopes //$client->setScopes($scopes); $client->setClientKey($key); ...
php
{ "resource": "" }
q23649
ClientFactory.generateString
train
protected function generateString($length) { $bytes = ceil($length / 2);
php
{ "resource": "" }
q23650
Feed.getOutput
train
public function getOutput($request = null) { $pl = $this->getPageListObject(); $link = false; if ($this->cParentID) { $parent = Page::getByID($this->cParentID); $link = $parent->getCollectionLink(); } else { $link = \URL::to('/'); } ...
php
{ "resource": "" }
q23651
DeleteUserRequest.cancel
train
public function cancel(Progress $wp) { $ui = UserInfo::getByID($this->getRequestedUserID()); $wpr = parent::cancel($wp);
php
{ "resource": "" }
q23652
DefaultRunner.initializeLegacyURLDefinitions
train
protected function initializeLegacyURLDefinitions() { if (!defined('BASE_URL')) { $resolver = $this->getUrlResolver(); try { $url = rtrim((string) $resolver->resolve([]), '/');
php
{ "resource": "" }
q23653
DefaultRunner.setSystemLocale
train
protected function setSystemLocale() { $u = new User(); $lan = $u->getUserLanguageToDisplay(); $loc
php
{ "resource": "" }
q23654
DefaultRunner.registerLegacyConfigValues
train
protected function registerLegacyConfigValues() { $config = $this->getConfig(); $name
php
{ "resource": "" }
q23655
DefaultRunner.handleUpdates
train
protected function handleUpdates() { $config = $this->app->make('config'); if (!$config->get('concrete.maintenance_mode')) { try { $this->app->handleAutomaticUpdates(); } catch (MutexBusyException $x) { if ($x->getMutexKey() !== Update::MUTEX_K...
php
{ "resource": "" }
q23656
DefaultRunner.trySteps
train
protected function trySteps(array $steps) { foreach ($steps as $step) { // Run each step and return if there's a result
php
{ "resource": "" }
q23657
ConversationKey.getPermissionAssignmentObject
train
public function getPermissionAssignmentObject() { $targ = Core::make('\Concrete\Core\Permission\Assignment\ConversationAssignment'); if (is_object($this->permissionObject)) {
php
{ "resource": "" }
q23658
Set.getMySets
train
public static function getMySets($user = false) { $app = Facade::getFacadeApplication(); if ($user === false) { $user = $app->make(User::class); } /** @var $database \Concrete\Core\Database\Connection\Connection */ $database = $app->make('database')->connection(...
php
{ "resource": "" }
q23659
Set.createAndGetSet
train
public static function createAndGetSet($fs_name, $fs_type, $fs_uid = false) { if ($fs_uid === false) { $u = new User(); $fs_uid = $u->uID; } $db = Database::connection(); $criteria = array($fs_name,
php
{ "resource": "" }
q23660
Set.getByID
train
public static function getByID($fsID) { $db = Database::connection(); $row = $db->fetchAssoc('SELECT * FROM FileSets WHERE fsID = ?', array($fsID)); if (is_array($row)) { $fs = new static(); $fs = array_to_object($fs, $row); if ($row['fsType'] == static::T...
php
{ "resource": "" }
q23661
Set.create
train
public static function create($setName, $fsOverrideGlobalPermissions = 0, $u = false, $type = self::TYPE_PUBLIC) { if (is_object($u) && $u->isRegistered()) { $uID = $u->getUserID(); } else { if ($u) { $uID = $u; } else { $uID = 0; ...
php
{ "resource": "" }
q23662
Set.getFilesBySetID
train
public static function getFilesBySetID($fsID) { if (intval($fsID) > 0) { $fileset = self::getByID($fsID);
php
{ "resource": "" }
q23663
Set.getFilesBySetName
train
public static function getFilesBySetName($fsName, $uID = false) { if (!empty($fsName)) { $fileset = self::getByName($fsName, $uID); if ($fileset instanceof
php
{ "resource": "" }
q23664
Set.getByName
train
public static function getByName($fsName, $uID = false) { $db = Database::connection(); if ($uID !== false) { $row = $db->fetchAssoc('SELECT * FROM FileSets WHERE fsName = ? AND uID = ?', array($fsName, $uID)); } else { $row = $db->fetchAssoc('SELECT * FROM FileSets W...
php
{ "resource": "" }
q23665
Set.getFiles
train
public function getFiles() { if (!$this->fileSetFiles) { $this->populateFiles(); }
php
{ "resource": "" }
q23666
Set.update
train
public function update($setName) { $db = Database::connection(); $db->update(
php
{ "resource": "" }
q23667
Set.addFileToSet
train
public function addFileToSet($f_id) { $app = Application::getFacadeApplication(); if (is_object($f_id)) { $f = $f_id; if ($f instanceof FileEntity) { $file = $f; $fileVersion = $file->getApprovedVersion(); } else { $...
php
{ "resource": "" }
q23668
Set.shouldRefreshFileThumbnails
train
protected function shouldRefreshFileThumbnails($fileOperation) { $app = Application::getFacadeApplication(); $em = $app->make(EntityManagerInterface::class); $qb = $em->createQueryBuilder(); $qb ->select('ft.ftTypeID') ->from(ThumbnailType::class, 'ft') ...
php
{ "resource": "" }
q23669
Job.authenticateRequest
train
public static function authenticateRequest($auth) { // this is a little tricky. We have TWO ways of doing this // 1. Does the security token for jobs md5 correctly? If so, good. $val
php
{ "resource": "" }
q23670
Job.getAvailableList
train
public static function getAvailableList($includeConcreteDirJobs = 1) { $jobObjs = array(); //get existing jobs $existingJobHandles = array(); $existingJobs = static::getList(); foreach ($existingJobs as $j) { $existingJobHandles[] = $j->getJobHandle(); } ...
php
{ "resource": "" }
q23671
CustomLayout.enableAreaLayoutCustomColumnWidths
train
public function enableAreaLayoutCustomColumnWidths() { $db = Loader::db(); $db->Execute('update AreaLayouts set arLayoutIsCustom = ? where arLayoutID = ?',
php
{ "resource": "" }
q23672
CustomLayout.disableAreaLayoutCustomColumnWidths
train
public function disableAreaLayoutCustomColumnWidths() { $db = Loader::db(); $db->Execute('update AreaLayouts set arLayoutIsCustom = ? where arLayoutID = ?',
php
{ "resource": "" }
q23673
FunctionInspector.functionAvailable
train
public function functionAvailable($functionName) { $result = false; if (is_string($functionName)) { $functionName = trim($functionName); if ($functionName !== '') { if (function_exists($functionName)) { $disabledFunctions = $this->getDisabl...
php
{ "resource": "" }
q23674
BlockType.hasAddTemplate
train
public function hasAddTemplate() { $bv = new BlockView($this); $path = $bv->getBlockPath(FILENAME_BLOCK_ADD); if
php
{ "resource": "" }
q23675
BlockType.getBlockTypeComposerTemplates
train
public function getBlockTypeComposerTemplates() { $btHandle = $this->getBlockTypeHandle(); $files = array(); $fh = Loader::helper('file'); $dir = DIR_FILES_BLOCK_TYPES . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES_COMPOSER; if (is_dir($dir)) { $files = array_merge($...
php
{ "resource": "" }
q23676
BlockType.getBlockTypeClass
train
public function getBlockTypeClass() { return \Concrete\Core\Block\BlockType\BlockType::getBlockTyp
php
{ "resource": "" }
q23677
BlockType.getBlockTypeSets
train
public function getBlockTypeSets() { $db = Loader::db(); $list = array(); $r = $db->Execute( 'select btsID from BlockTypeSetBlockTypes where btID = ? order by displayOrder asc', array($this->getBlockTypeID())); while ($row =
php
{ "resource": "" }
q23678
BlockType.getCount
train
public function getCount($ignoreUnapprovedVersions = false) { $app = Application::getFacadeApplication(); $db = $app->make(Connection::class); $now = $app->make('date')->getOverridableNow(); if ($ignoreUnapprovedVersions) { $count = $db->GetOne(<<<'EOT' SELECT count(b...
php
{ "resource": "" }
q23679
BlockType.getBlockTypeCustomTemplates
train
public function getBlockTypeCustomTemplates(Block $b) { $btHandle = $this->getBlockTypeHandle(); $fh = Loader::helper('file'); $files = array(); $dir = DIR_FILES_BLOCK_TYPES . "/{$btHandle}/" . DIRNAME_BLOCK_TEMPLATES; if (is_dir($dir)) { $files = array_merge($fil...
php
{ "resource": "" }
q23680
BlockType.refresh
train
public function refresh() { $app = Facade::getFacadeApplication(); $db = $app->make('database')->connection(); $pkgHandle = false; if ($this->pkgID > 0) { $pkgHandle = $this->getPackageHandle(); } $class = \Concrete\Core\Block\BlockType\BlockType::getBloc...
php
{ "resource": "" }
q23681
BlockType.delete
train
public function delete() { $db = Loader::db(); $r = $db->Execute( 'select cID, cvID, b.bID, arHandle from CollectionVersionBlocks cvb inner join Blocks b on b.bID = cvb.bID where btID = ? union selec...
php
{ "resource": "" }
q23682
BlockType.add
train
public function add($data, $c = false, $a = false) { $app = Facade::getFacadeApplication(); $db = $app->make('database')->connection(); $u = new User(); if (isset($data['uID'])) { $uID = $data['uID']; } else { $uID = $u->getUserID(); } ...
php
{ "resource": "" }
q23683
ResponseAssetGroup.addOutputAssetAt
train
protected function addOutputAssetAt($item, $position) { if (!isset($this->outputAssets[$position])) {
php
{ "resource": "" }
q23684
ResponseAssetGroup.getAssetsToOutput
train
public function getAssetsToOutput() { $assets = $this->getRequiredAssetsToOutput(); foreach ($assets as $asset) { $this->addOutputAsset($asset); } $outputAssetsPre = array(); $outputAssets = array(); // now we create temporary objects to store assets and...
php
{ "resource": "" }
q23685
ResponseAssetGroup.markAssetAsIncluded
train
public function markAssetAsIncluded($assetType, $assetHandle = false) { $list = AssetList::getInstance(); if ($assetType && $assetHandle) { $asset = $list->getAsset($assetType, $assetHandle); } else { $assetGroup = $list->getAssetGroup($assetType); } ...
php
{ "resource": "" }
q23686
ResponseAssetGroup.getRequiredAssetsToOutput
train
public function getRequiredAssetsToOutput() { $required = $this->requiredAssetGroup->getAssetPointers(); $assetPointers = array_filter($required, array('\Concrete\Core\Http\ResponseAssetGroup', 'filterProvidedAssets')); $assets = array(); $al = AssetList::getInstance(); forea...
php
{ "resource": "" }
q23687
ObjectTrait.setAttribute
train
public function setAttribute($ak, $value) { $orm = \Database::connection()->getEntityManager(); $this->clearAttribute($ak); // Create the attribute category value. $attributeValue = $this->getAttributeValueObject($ak, true); $orm->persist($attributeValue); $orm->flu...
php
{ "resource": "" }
q23688
ConfigCommand.doGetAction
train
private function doGetAction($repository, $item) {
php
{ "resource": "" }
q23689
ConfigCommand.doSetAction
train
private function doSetAction(Repository $repository, $item) { if (!$this->hasArgument('value')) { $this->output->error('A value must be provided when using the "set" action.'); }
php
{ "resource": "" }
q23690
IndexedSearch.reindexAll
train
public function reindexAll($fullReindex = false) { Cache::disableAll(); /** @var IndexManagerInterface $indexStack */ $indexStack = Application::getFacadeApplication()->make(IndexManagerInterface::class); $db = Loader::db(); if ($fullReindex) { $db->Execute("tr...
php
{ "resource": "" }
q23691
Extractor.profileLoader
train
public function profileLoader() { $idTokenString = null; $token = $this->service->getStorage()->retrieveAccessToken($this->service->service()); if ($token instanceof StdOAuth2Token) { $idTokenString = array_get($token->getExtraParams(), 'id_token'); } // If we do...
php
{ "resource": "" }
q23692
AtomicThumbnailStream.getIterator
train
public function getIterator() { $db = $this->manager->connection(); // Make sure we have the proper columns before doing anything with SQL if (!$this->lockColumnsExist($db)) { return; } $qb = $db->createQueryBuilder(); $nextQuery = $this->getNextQuery($qb...
php
{ "resource": "" }
q23693
AtomicThumbnailStream.next
train
private function next(QueryBuilder $nextQuery) { $now = new \DateTime('now');
php
{ "resource": "" }
q23694
AtomicThumbnailStream.reserveNext
train
private function reserveNext(array $next, Connection $db) { $lockID = $this->getLockID(); // First update the table try { $date = new \DateTime('now'); $date->setTimestamp($date->getTimestamp() + $this->timeout);
php
{ "resource": "" }
q23695
AtomicThumbnailStream.matchingLock
train
private function matchingLock($lockID, array $next, Connection $db) { // Then go back and double check that we successfully locked it $qb = $db->createQueryBuilder(); $select = $qb ->select('*') ->from($this->table, 't') // Match the lock ID we just tried...
php
{ "resource": "" }
q23696
AtomicThumbnailStream.lockColumnsExist
train
private function lockColumnsExist(Connection $db) { $schema
php
{ "resource": "" }
q23697
AtomicThumbnailStream.getLockID
train
private function getLockID() { if ($this->lockID) { return $this->lockID; }
php
{ "resource": "" }
q23698
BlockType.getByHandle
train
public static function getByHandle($btHandle) { $result = null; $btHandle = (string) $btHandle; if ($btHandle !== '') { $app = Application::getFacadeApplication(); $em = $app->make(EntityManagerInterface::class); $repo = $em->getRepository(BlockTypeEntity:...
php
{ "resource": "" }
q23699
BlockType.getByID
train
public static function getByID($btID) { $result = null; $btID = (int) $btID; if ($btID !== 0) { $app = Application::getFacadeApplication();
php
{ "resource": "" }