_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q23800 | EscapeFormula.escapeField | train | protected function escapeField($cell)
{
if (!$this->isStringable($cell)) {
return $cell;
}
$str_cell = (string) $cell;
| php | {
"resource": ""
} |
q23801 | CompareSchemaCommand.filterQueries | train | protected function filterQueries($queries)
{
$app = Application::getFacadeApplication();
$config = $app->make('config');
$textIndexDrops = [];
foreach ($config->get('database.text_indexes') as $indexTable => $indexDefinition) {
foreach (array_keys($indexDefinition) as $i... | php | {
"resource": ""
} |
q23802 | Number.trim | train | public function trim($value)
{
$result = '';
$value = (string) $value;
if ($value !== '') {
// Temporarily remove leadin sign
$sign = $value[0];
if ($sign === '-' || $sign === '+') {
$value = substr($value, 1);
} else {
... | php | {
"resource": ""
} |
q23803 | AccessTokenRepository.getNewToken | train | public function getNewToken(ClientEntityInterface $clientEntity, array $scopes, $userIdentifier = null)
{
$token = new | php | {
"resource": ""
} |
q23804 | AccessTokenRepository.persistNewAccessToken | train | public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity)
{
$this->getEntityManager()->transactional(function(EntityManagerInterface $em) use | php | {
"resource": ""
} |
q23805 | AccessTokenRepository.isAccessTokenRevoked | train | public function isAccessTokenRevoked($tokenId)
{
/** @var \Concrete\Core\Entity\OAuth\AccessToken $token */
$token = $this->find($tokenId);
if (!$token) {
// The token was manually removed.
return true;
}
| php | {
"resource": ""
} |
q23806 | Detector.setupSiteInterfaceLocalization | train | public function setupSiteInterfaceLocalization(Page $c = null)
{
$app = Facade::getFacadeApplication();
$loc = $app->make(Localization::class);
$locale = null;
if ($c === null) {
$c = Page::getCurrentPage();
}
if ($c) {
$pageController = $c->ge... | php | {
"resource": ""
} |
q23807 | Detector.isEnabled | train | public static function isEnabled()
{
$app = Facade::getFacadeApplication();
$cache = $app->make('cache/request');
$item = $cache->getItem('multilingual/enabled');
if (!$item->isMiss()) {
return $item->get(); | php | {
"resource": ""
} |
q23808 | LimitedSmtp.trackLimit | train | private function trackLimit()
{
++$this->sent;
if ($this->sent >= $this->limit) {
$this->sent = 0; | php | {
"resource": ""
} |
q23809 | AbstractTranslatableValidator.getErrorString | train | protected function getErrorString($code, $value, $default = null)
{
if (array_key_exists($code, $this->translatable_errors)) {
$resolver = $this->translatable_errors[$code];
| php | {
"resource": ""
} |
q23810 | PrivateMessage.getFormattedMessageBody | train | public function getFormattedMessageBody()
{
$msgBody = $this->getMessageBody();
$txt = Loader::helper('text');
$repliedPos = strpos($msgBody, $this->getMessageDelimiter());
if ($repliedPos > -1) {
$repliedText = substr($msgBody, $repliedPos);
$messageText = s... | php | {
"resource": ""
} |
q23811 | AggregateTracker.addTracker | train | public function addTracker($tracker, callable $creator)
{
$this->creators[$tracker] = $creator;
$this->map[] = $tracker;
| php | {
"resource": ""
} |
q23812 | AggregateTracker.tracker | train | public function tracker($tracker)
{
// We've already made this tracker, so just return it.
if ($cached = array_get($this->trackers, $tracker)) {
return $cached;
}
// We've got a creator, lets create the tracker
if ($creator = array_get($this->creators, $tracker))... | php | {
"resource": ""
} |
q23813 | DatabaseManager.reconnect | train | public function reconnect($name = null)
{
$this->disconnect($name = $name ?: $this->getDefaultConnection());
if (!isset($this->connections[$name])) {
| php | {
"resource": ""
} |
q23814 | LocaleTrait.getLanguageText | train | public function getLanguageText($locale = null)
{
try {
$text = PunicLanguage::getName($this->getLanguage(), $locale ?: '');
} catch (Exception $e) {
$text = $this->getLanguage();
| php | {
"resource": ""
} |
q23815 | Request.triggerRequest | train | protected function triggerRequest(\PermissionKey $pk)
{
if (!$this->wrID) {
$this->save();
}
if (!$pk->canPermissionKeyTriggerWorkflow()) {
throw new \Exception(t('This permission key cannot start a workflow.'));
}
$pa = $pk->getPermissionAccessObjec... | php | {
"resource": ""
} |
q23816 | AbstractValue.getPlainTextValue | train | public function getPlainTextValue()
{
$controller = $this->getController();
if (method_exists($controller, 'getPlainTextValue')) {
return $controller->getPlainTextValue();
}
if ($this->getValueObject()) {
return (string) $this->getValueObject(); | php | {
"resource": ""
} |
q23817 | TreeCollectionTransformer.transformEntry | train | private function transformEntry(Entry\EntryInterface $entry)
{
return [
'id' => $entry->getID(),
| php | {
"resource": ""
} |
q23818 | EmailValidator.checkEmail | train | protected function checkEmail($mixed)
{
$result = false;
if (is_string($mixed) && $mixed !== '') {
$eev = $this->getEguliasEmailValidator();
$testMX = $this->isTestMXRecord();
if ($eev->isValid($mixed, $testMX, $this->isStrict())) {
if ($testMX) {
... | php | {
"resource": ""
} |
q23819 | Navigation.getTrailToCollection | train | public function getTrailToCollection($c)
{
$db = Database::connection();
$cArray = array();
$currentcParentID = $c->getCollectionParentID();
if ($currentcParentID > 0) {
while (is_numeric($currentcParentID) && $currentcParentID > 0 && $currentcParentID) {
... | php | {
"resource": ""
} |
q23820 | OpCache.clear | train | public static function clear($file = null)
{
if (static::hasEAccelerator()) {
if (function_exists('eeaccelerator_clear')) {
$paths = @ini_get('eaccelerator.allowed_admin_path');
if (is_string($paths) && ($paths !== '')) {
$myPath = str_replace(... | php | {
"resource": ""
} |
q23821 | UserNotificationEventHandler.deactivated | train | public function deactivated(DeactivateUser $event)
{
/** @var UserDeactivatedType $type */
$type = $this->notificationManager->driver(UserDeactivatedType::IDENTIFIER);
$notifier = $type->getNotifier();
if (method_exists($notifier, 'notify')) {
$subscription = $type->getS... | php | {
"resource": ""
} |
q23822 | Response.getResponse | train | public static function getResponse($object)
{
$cache = Core::make('cache/request');
$identifier = sprintf('permission/response/%s/%s', get_class($object), $object->getPermissionObjectIdentifier());
$item = $cache->getItem($identifier);
if (!$item->isMiss()) {
return $item... | php | {
"resource": ""
} |
q23823 | Response.validate | train | public function validate($permissionHandle, $args = array())
{
$u = new User();
if ($u->isSuperUser()) {
return true;
}
if (!is_object($this->category)) {
throw new Exception(t('Unable to get category for permission %s', $permissionHandle));
}
... | php | {
"resource": ""
} |
q23824 | BlockController.performSave | train | protected function performSave($args, $loadExisting = false)
{
//$argsMerged = array_merge($_POST, $args);
if ($this->btTable) {
$db = Database::connection();
$columns = $db->MetaColumnNames($this->btTable);
$this->record = new BlockRecord($this->btTable);
... | php | {
"resource": ""
} |
q23825 | BlockController.load | train | protected function load()
{
if ($this->btTable) {
if ($this->btCacheBlockRecord && $this->btCachedBlockRecord && Config::get('concrete.cache.blocks')) {
$this->record = unserialize(base64_decode($this->btCachedBlockRecord));
} else {
$this->record = ne... | php | {
"resource": ""
} |
q23826 | BlockController.getActionURL | train | public function getActionURL($task)
{
try {
if (is_object($this->block)) {
if (is_object($this->block->getProxyBlock())) {
$b = $this->block->getProxyBlock();
} else {
$b = $this->block;
}
$... | php | {
"resource": ""
} |
q23827 | BlockController.getBlockObject | train | public function getBlockObject()
{
if (is_object($this->block)) {
return $this->block;
| php | {
"resource": ""
} |
q23828 | BlockController.delete | train | public function delete()
{
if ($this->bID > 0) {
if ($this->btTable) {
$ni = new BlockRecord($this->btTable);
$ni->bID = $this->bID;
| php | {
"resource": ""
} |
q23829 | Import.setViewHelpers | train | protected function setViewHelpers()
{
$this->set('token', $this->app->make('token'));
$this->set('form', $this->app->make('helper/form'));
$this->set('ui', | php | {
"resource": ""
} |
q23830 | Import.setViewSets | train | protected function setViewSets()
{
$config = $this->app->make('config');
$this->set('formID', 'ccm-file-manager-import-files-' . $this->app->make(Identifier::class)->getString(32));
$this->set('currentFolder', $this->getCurrentFolder());
$this->set('originalPage', $this->getOriginalP... | php | {
"resource": ""
} |
q23831 | Import.getCurrentFolder | train | protected function getCurrentFolder()
{
if ($this->currentFolder === false) {
$currentFolder = null;
$fID = $this->request->request->get('currentFolder', $this->request->query->get('currentFolder'));
if ($fID && is_scalar($fID)) {
$fID = (int) $fID;
... | php | {
"resource": ""
} |
q23832 | Import.setCurrentFolder | train | protected function setCurrentFolder(FileFolder $value = null)
{
if ($value !== $this->currentFolder) {
$this->currentFolder = $value;
| php | {
"resource": ""
} |
q23833 | Import.getCurrentFolderPermissions | train | protected function getCurrentFolderPermissions()
{
if ($this->currentFolderPermissions === null) {
$folder = $this->getCurrentFolder();
if ($folder === null) {
$folder = $this->app->make(Filesystem::class)->getRootFolder();
if ($folder === null) {
... | php | {
"resource": ""
} |
q23834 | Import.getOriginalPage | train | protected function getOriginalPage()
{
if ($this->originalPage === false) {
$originalPage = null;
$ocID = $this->request->request->get('ocID', $this->request->query->get('ocID'));
if ($ocID && is_scalar($ocID)) {
$ocID = (int) $ocID;
if ($o... | php | {
"resource": ""
} |
q23835 | Import.setOriginalPage | train | protected function setOriginalPage(Page $value = null)
{
$this->originalPage = $value === null | php | {
"resource": ""
} |
q23836 | Import.getAutomaticChunkSize | train | protected function getAutomaticChunkSize()
{
$nh = $this->app->make('helper/number');
// Maximum size of an uploaded file, minus a small value (just in case)
$uploadMaxFilesize = (int) $nh->getBytes(ini_get('upload_max_filesize')) - 100;
// Max size of post data allowed, minus enough... | php | {
"resource": ""
} |
q23837 | Import.getIncomingFiles | train | protected function getIncomingFiles()
{
$fh = $this->app->make('helper/validation/file');
$nh = $this->app->make('helper/number');
$incoming = $this->app->make(Incoming::class);
$files = $incoming->getIncomingFilesystem()->listContents($incoming->getIncomingPath());
foreach (... | php | {
"resource": ""
} |
q23838 | FileUsageRepository.findByFile | train | public function findByFile($file)
{
if ($file instanceof File) {
$file = $file->getFileID();
} | php | {
"resource": ""
} |
q23839 | FileUsageRepository.findByCollection | train | public function findByCollection($collection, $version = null)
{
if ($collection instanceof Collection) {
$collection = $collection->getCollectionID();
}
$criteria = [
'collection_id' => $collection
];
if ($version && | php | {
"resource": ""
} |
q23840 | FileUsageRepository.findByBlock | train | public function findByBlock($block)
{
if ($block instanceof Block) {
$block = $block->getBlockID();
} elseif ($block instanceof BlockController) {
$block | php | {
"resource": ""
} |
q23841 | ConfigServiceProvider.register | train | public function register()
{
$this->registerFileConfig();
$this->registerDatabaseConfig();
// Bind the concrete types
$this->app->bind('Concrete\Core\Config\Repository\Repository', 'config');
| php | {
"resource": ""
} |
q23842 | ConfigServiceProvider.registerFileConfig | train | private function registerFileConfig()
{
$this->app->singleton('config', function ($app) {
$loader = $app->make('Concrete\Core\Config\FileLoader');
$saver = $app->make('Concrete\Core\Config\FileSaver');
| php | {
"resource": ""
} |
q23843 | ConfigServiceProvider.registerDatabaseConfig | train | private function registerDatabaseConfig()
{
$this->app->bindShared('config/database', function ($app) {
$loader = $app->make('Concrete\Core\Config\DatabaseLoader');
$saver = $app->make('Concrete\Core\Config\DatabaseSaver');
| php | {
"resource": ""
} |
q23844 | DatabaseItemList.filter | train | public function filter($column, $value, $comparison = '=')
{
$foundFilterIndex = -1;
if ($column) {
foreach ($this->filters as $key => $info) {
if ($info[0] == $column) {
$foundFilterIndex = $key;
break;
}
... | php | {
"resource": ""
} |
q23845 | AdvancedConfiguration.prepareConfig | train | protected function prepareConfig($config)
{
if (isset($config['loggers']) && is_array($config['loggers'])
&& array_key_exists(Channels::META_CHANNEL_ALL, $config['loggers'])) {
$allConfig = $config['loggers'][Channels::META_CHANNEL_ALL];
| php | {
"resource": ""
} |
q23846 | FolderItemList.filterByExtension | train | public function filterByExtension($extension)
{
$extensions = is_array($extension) ? $extension : [$extension];
if (count($extensions) > 0) {
$expr = $this->query->expr();
$or = $expr->orX();
foreach ($extensions as $extension) {
$extension = ltrim... | php | {
"resource": ""
} |
q23847 | RequestBase.getPath | train | public function getPath()
{
$pathInfo = rawurldecode($this->getPathInfo());
$path | php | {
"resource": ""
} |
q23848 | RequestBase.post | train | public static function post($key = null, $defaultValue = null)
{
if ($key == null) {
return $_POST;
| php | {
"resource": ""
} |
q23849 | Pile.delete | train | public function delete()
{
$db = Loader::db();
$v = array($this->pID);
$q = "delete from Piles where pID = ?";
$db->query($q, $v);
| php | {
"resource": ""
} |
q23850 | Ajax.isAjaxRequest | train | public function isAjaxRequest(Request $request)
{
$result = false;
$requestedWith = $request->server->get('HTTP_X_REQUESTED_WITH');
if | php | {
"resource": ""
} |
q23851 | Ajax.sendResult | train | public function sendResult($result)
{
if (@ob_get_length()) {
@ob_end_clean();
}
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
header('Content-Type: application/json; charset=' . APP_CHARSET, true);
} el... | php | {
"resource": ""
} |
q23852 | Ajax.sendError | train | public function sendError($error)
{
if (@ob_get_length()) {
@ob_end_clean();
}
if ($error instanceof \Concrete\Core\Error\ErrorList\ErrorList) {
$error->outputJSON();
} else {
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request', true, 400);
... | php | {
"resource": ""
} |
q23853 | Arrays.containsString | train | public function containsString($needle, $haystack = array(), $recurse = true)
{
/** @var \Concrete\Core\Utility\Service\Validation\Strings $stringHelper */
$stringHelper = Core::make('helper/validation/strings');
if (!$stringHelper->notempty($needle)) {
return false;
}
... | php | {
"resource": ""
} |
q23854 | Arrays.parseKeys | train | private function parseKeys($keys)
{
if (is_string($keys)) {
if (strpos($keys, '[') !== false) {
$keys = str_replace(']', | php | {
"resource": ""
} |
q23855 | Arrays.flatten | train | public function flatten(array $array)
{
$tmp = array();
foreach ($array as $a) {
if (is_array($a)) {
| php | {
"resource": ""
} |
q23856 | Sanitizer.sanitizeFile | train | public function sanitizeFile($inputFilename, SanitizerOptions $options = null, $outputFilename = '')
{
$data = is_string($inputFilename) && $this->filesystem->isFile($inputFilename) ? $this->filesystem->get($inputFilename) : false;
if ($data === false) {
throw SanitizerException::create(... | php | {
"resource": ""
} |
q23857 | Sanitizer.sanitizeData | train | public function sanitizeData($data, SanitizerOptions $options = null)
{
$xml = $this->dataToXml($data);
if ($options === null) {
$options = new SanitizerOptions();
}
| php | {
"resource": ""
} |
q23858 | Sanitizer.getLoadFlags | train | protected function getLoadFlags()
{
$flags = LIBXML_NONET | LIBXML_NOWARNING;
foreach ([
'LIBXML_PARSEHUGE', // libxml >= 2.7.0
'LIBXML_HTML_NOIMPLIED', // libxml >= 2.7.7
'LIBXML_HTML_NODEFDTD', // libxml >= 2.7.8
'LIBXML_BIGLINES', // libxml | php | {
"resource": ""
} |
q23859 | Sanitizer.dataToXml | train | protected function dataToXml($data)
{
if (!is_string($data)) {
throw SanitizerException::create(SanitizerException::ERROR_FAILED_TO_PARSE_XML);
}
$xml = new DOMDocument();
$error = null;
try {
$loaded = $xml->loadXML($data, $this->getLoadFlags());
... | php | {
"resource": ""
} |
q23860 | Sanitizer.xmlToData | train | protected function xmlToData(DOMDocument $xml)
{
$data = $xml->saveXML();
if ($data === | php | {
"resource": ""
} |
q23861 | Resolver.getDefaultCharacterSet | train | public function getDefaultCharacterSet()
{
$characterSet = $this->config->get('database.preferred_character_set');
$characterSet | php | {
"resource": ""
} |
q23862 | Resolver.setCharacterSet | train | public function setCharacterSet($characterSet)
{
if ($characterSet !== null) {
| php | {
"resource": ""
} |
q23863 | Resolver.getDefaultCollation | train | public function getDefaultCollation()
{
$collation = $this->config->get('database.preferred_collation');
$collation | php | {
"resource": ""
} |
q23864 | Resolver.setCollation | train | public function setCollation($collation)
{
if ($collation !== null) {
| php | {
"resource": ""
} |
q23865 | Resolver.resolveCharacterSetAndCollation | train | public function resolveCharacterSetAndCollation(Connection $connection)
{
$characterSet = $this->getCharacterSet();
$collation = $this->getCollation();
if ($collation !== '') {
$collations = $connection->getSupportedCollations();
if (!isset($collations[$collation])) {... | php | {
"resource": ""
} |
q23866 | EntityManagerConfigFactory.getConfiguration | train | public function getConfiguration()
{
$driverChain = $this->getMetadataDriverImpl();
// Inject | php | {
"resource": ""
} |
q23867 | MiniSurvey.questionCleanup | train | public static function questionCleanup($qsID = 0, $bID = 0)
{
$db = Database::connection();
//First make sure that the bID column has been set for this questionSetId (for backwards compatibility)
$vals = array(intval($qsID));
$questionsWithBIDs = $db->fetchColumn('SELECT count(*) FR... | php | {
"resource": ""
} |
q23868 | DatabaseSaver.save | train | public function save($item, $value, $environment, $group, $namespace = null)
{
$builder = $this->getConnection()->createQueryBuilder();
$query = $builder->delete('Config')
->where('configNamespace = :namespace',
'configGroup = :group',
'configItem... | php | {
"resource": ""
} |
q23869 | Inspect.view | train | public function view($pThemeID = null, $message = false)
{
if (!$pThemeID) {
$this->redirect('/dashboard/pages/themes/');
}
$v = Loader::helper('validation/error');
$pt = PageTheme::getByID($pThemeID);
if (is_object($pt)) {
$files = $pt->getFilesInThe... | php | {
"resource": ""
} |
q23870 | Connection.createTextIndexes | train | public function createTextIndexes(array $textIndexes)
{
if (!empty($textIndexes)) {
$sm = $this->getSchemaManager();
foreach ($textIndexes as $tableName => $indexes) {
if ($sm->tablesExist([$tableName])) {
$existingIndexNames = array_map(
... | php | {
"resource": ""
} |
q23871 | Connection.replace | train | public function replace($table, $fieldArray, $keyCol, $autoQuote = true)
{
$qb = $this->createQueryBuilder();
$qb->select('count(*)')->from($table, 't');
$where = $qb->expr()->andX();
$updateKeys = [];
if (!is_array($keyCol)) {
$keyCol = [$keyCol];
}
... | php | {
"resource": ""
} |
q23872 | Connection.getSupportedCharsets | train | public function getSupportedCharsets()
{
if ($this->supportedCharsets === null) {
$supportedCharsets = [];
$rs = $this->executeQuery('SHOW CHARACTER SET');
while (($row = $rs->fetch(PDO::FETCH_ASSOC)) !== false) {
if (!isset($row['Charset']) || !isset($row... | php | {
"resource": ""
} |
q23873 | Connection.getSupportedCollations | train | public function getSupportedCollations()
{
if ($this->supportedCollations === null) {
$supportedCollations = [];
$rs = $this->executeQuery('SHOW COLLATION');
while (($row = $rs->fetch(PDO::FETCH_ASSOC)) !== false) {
if (!isset($row['Collation']) || !isset(... | php | {
"resource": ""
} |
q23874 | Connection.isCollationSupportedForKeys | train | public function isCollationSupportedForKeys($collation, $fieldLength)
{
$sm = $this->getSchemaManager();
$existingTables = array_map('strtolower', $sm->listTableNames());
for ($i = 0; ; ++$i) {
$tableName = 'tmp_checkCollationFieldLength' . $i;
if (!in_array(strtolowe... | php | {
"resource": ""
} |
q23875 | IPRangesCsvWriter.projectRange | train | private function projectRange(IPRange $range)
{
$result = [
$range->getIpRange()->toString(),
$range->getIpRange()->getComparableStartString(),
$range->getIpRange()->getComparableEndString(),
];
if ($this->type === IPService::IPRANGETYPE_BLACKLIST_AUTOMATI... | php | {
"resource": ""
} |
q23876 | IPRangesCsvWriter.getHeaders | train | private function getHeaders()
{
$headers = [t('IP Range'), t('Start address'), t('End address')];
| php | {
"resource": ""
} |
q23877 | Area.showControls | train | public function showControls()
{
if ($this->showControls === true || $this->showControls === false) {
return $this->showControls;
} else {
| php | {
"resource": ""
} |
q23878 | Area.getTotalBlocksInArea | train | public function getTotalBlocksInArea($c = false)
{
if (!$c) {
$c = $this->c;
}
// exclude the area layout proxy block from counting.
$this->load($c);
$db = Database::connection();
$r = $db->fetchColumn(
'select count(b.bID) from CollectionVers... | php | {
"resource": ""
} |
q23879 | Area.getTotalBlocksInAreaEditMode | train | public function getTotalBlocksInAreaEditMode()
{
$db = Database::connection();
return (int) $db->fetchColumn(
'select count(b.bID) from CollectionVersionBlocks cvb inner join Blocks b on cvb.bID = b.bID inner join BlockTypes bt on b.btID = bt.btID where | php | {
"resource": ""
} |
q23880 | Area.get | train | final public static function get($c, $arHandle)
{
if (!is_object($c)) {
return false;
}
$identifier = sprintf('/page/area/%s', $c->getCollectionID());
$cache = \Core::make('cache/request');
$item = $cache->getItem($identifier);
if (!$item->isMiss()) {
... | php | {
"resource": ""
} |
q23881 | Area.create | train | public function create($c, $arHandle)
{
$db = Database::connection();
$db->Replace(
'Areas',
array('cID' => $c->getCollectionID(), 'arHandle' => $arHandle, 'arIsGlobal' => $this->isGlobalArea() ? 1 : 0),
array('arHandle', 'cID'),
true | php | {
"resource": ""
} |
q23882 | Area.getAreaBlocksArray | train | public function getAreaBlocksArray($c = false)
{
if (!$c) {
$c = $this->c;
| php | {
"resource": ""
} |
q23883 | Area.getHandleList | train | public static function getHandleList()
{
$db = Database::connection();
$r = $db->executeQuery('select distinct arHandle from Areas where arParentID = 0 and arIsGlobal = 0 order by arHandle asc');
$handles = array();
while ($row = $r->FetchRow()) {
| php | {
"resource": ""
} |
q23884 | Area.revertToPagePermissions | train | public function revertToPagePermissions()
{
// this function removes all permissions records for a particular area on this page
// and sets it to inherit from the page above
// this function will also need to ensure that pages below it do the same
$db = Database::connection();
... | php | {
"resource": ""
} |
q23885 | Area.rescanAreaPermissionsChain | train | public function rescanAreaPermissionsChain()
{
$db = Database::connection();
if ($this->overrideCollectionPermissions()) {
return false;
}
// first, we obtain the inheritance of permissions for this particular collection
$areac = $this->getAreaCollectionObject();
... | php | {
"resource": ""
} |
q23886 | Area.rescanSubAreaPermissionsMasterCollection | train | public function rescanSubAreaPermissionsMasterCollection($masterCollection)
{
// like above, but for those who have setup their pages to inherit master collection permissions
// this might make more sense in the collection class, but I'm putting it here
if (!$masterCollection->isMasterCollec... | php | {
"resource": ""
} |
q23887 | Area.export | train | public function export($p, $page)
{
$area = $p->addChild('area');
$area->addAttribute('name', $this->getAreaHandle());
$blocks = $page->getBlocks($this->getAreaHandle());
$c = $this->getAreaCollectionObject();
$style = $c->getAreaCustomStyle($this);
if (is_object($sty... | php | {
"resource": ""
} |
q23888 | Option.isRequired | train | public function isRequired()
{
$result = $this->required;
if (is_callable($result)) {
$result = | php | {
"resource": ""
} |
q23889 | ClassLoader.enableLegacyNamespace | train | public function enableLegacyNamespace()
{
$this->enableLegacyNamespace = true;
$this->disable();
| php | {
"resource": ""
} |
q23890 | ClassLoader.disableLegacyNamespace | train | public function disableLegacyNamespace()
{
$this->enableLegacyNamespace = false;
$this->disable();
| php | {
"resource": ""
} |
q23891 | Stylesheet.getCss | train | public function getCss()
{
$parser = new \Less_Parser(
array(
'cache_dir' => Config::get('concrete.cache.directory'),
'compress' => (bool) Config::get('concrete.theme.compress_preprocessor_output'),
'sourceMap' => !Config::get('concrete.theme.compr... | php | {
"resource": ""
} |
q23892 | Date.getGroupedTimezones | train | public function getGroupedTimezones()
{
$groups = [];
$generics = [];
$genericGroupName = tc('GenericTimezonesGroupName', 'Others');
foreach ($this->getTimezones() as $id => $fullName) {
$chunks = explode('/', $fullName, 2);
if (!isset($chunks[1])) {
... | php | {
"resource": ""
} |
q23893 | Date.getTimezoneDisplayName | train | public function getTimezoneDisplayName($timezone)
{
$displayName = '';
if (is_object($timezone)) {
if ($timezone instanceof \DateTimeZone) {
$displayName = $timezone->getName();
} elseif ($timezone instanceof \DateTime) {
$displayName = $timezo... | php | {
"resource": ""
} |
q23894 | Date.describeInterval | train | public function describeInterval($diff, $precise = false)
{
$secondsPerMinute = 60;
$secondsPerHour = 60 * $secondsPerMinute;
$secondsPerDay = 24 * $secondsPerHour;
$days = floor($diff / $secondsPerDay);
$diff = $diff - $days * $secondsPerDay;
$hours = floor($diff / $... | php | {
"resource": ""
} |
q23895 | Date.getTimezoneID | train | public function getTimezoneID($timezone)
{
$app = Facade::getFacadeApplication();
/** @var Repository $config */
$config = $app->make('config');
switch ($timezone) {
case 'system':
$timezone = $config->get('app.server_timezone', @date_default_timezone_get... | php | {
"resource": ""
} |
q23896 | Date.getTimezone | train | public function getTimezone($timezone)
{
$tz = null;
$phpTimezone = $this->getTimezoneID($timezone);
if (is_string($phpTimezone) && strlen($phpTimezone)) {
try {
$tz = new | php | {
"resource": ""
} |
q23897 | Date.toDateTime | train | public function toDateTime($value = 'now', $toTimezone = 'system', $fromTimezone = 'system')
| php | {
"resource": ""
} |
q23898 | Date.getDeltaDays | train | public function getDeltaDays($from, $to, $timezone = 'user')
{
$dtFrom = $this->toDateTime($from, $timezone);
$dtTo = $this->toDateTime($to, $timezone);
if (is_null($dtFrom) || is_null($dtTo)) {
return null;
}
// Re-create DateTime | php | {
"resource": ""
} |
q23899 | Date.getPHPTimePattern | train | public function getPHPTimePattern()
{
$isoFormat = Calendar::getTimeFormat('short');
$result = Calendar::tryConvertIsoToPhpFormat($isoFormat);
if ($result === null) {
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.