_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q18200
ClassInfo.ancestry
train
public static function ancestry($nameOrObject, $tablesOnly = false) { if (is_string($nameOrObject) && !class_exists($nameOrObject)) { return []; } $class = self::class_name($nameOrObject); $lowerClass = strtolower($class); $cacheKey = $lowerClass . '_' . (strin...
php
{ "resource": "" }
q18201
ClassInfo.classImplements
train
public static function classImplements($className, $interfaceName) { $lowerClassName = strtolower($className);
php
{ "resource": "" }
q18202
ClassInfo.classes_for_file
train
public static function classes_for_file($filePath) { $absFilePath = Director::getAbsFile($filePath); $classManifest = ClassLoader::inst()->getManifest(); $classes = $classManifest->getClasses(); $classNames = $classManifest->getClassNames(); $matchedClasses = []; for...
php
{ "resource": "" }
q18203
ClassInfo.classes_for_folder
train
public static function classes_for_folder($folderPath) { $absFolderPath = Director::getAbsFile($folderPath); $classManifest = ClassLoader::inst()->getManifest(); $classes = $classManifest->getClasses(); $classNames = $classManifest->getClassNames(); $matchedClasses = []; ...
php
{ "resource": "" }
q18204
ClassInfo.has_method_from
train
public static function has_method_from($class, $method, $compclass) { $lClass = strtolower($class); $lMethod = strtolower($method); $lCompclass = strtolower($compclass); if (!isset(self::$_cache_methods[$lClass])) { self::$_cache_methods[$lClass] = array(); } ...
php
{ "resource": "" }
q18205
ClassInfo.shortName
train
public static function shortName($nameOrObject) { $name = static::class_name($nameOrObject); $parts
php
{ "resource": "" }
q18206
ClassInfo.hasMethod
train
public static function hasMethod($object, $method) { if (empty($object)) { return false; } if (method_exists($object, $method)) { return true;
php
{ "resource": "" }
q18207
Member.isLockedOut
train
public function isLockedOut() { /** @var DBDatetime $lockedOutUntilObj */ $lockedOutUntilObj = $this->dbObject('LockedOutUntil'); if ($lockedOutUntilObj->InFuture()) { return true; } $maxAttempts = $this->config()->get('lock_out_after_incorrect_logins'); ...
php
{ "resource": "" }
q18208
Member.regenerateTempID
train
public function regenerateTempID() { $generator = new RandomGenerator(); $lifetime = self::config()->get('temp_id_lifetime'); $this->TempIDHash = $generator->randomToken('sha1'); $this->TempIDExpired = $lifetime
php
{ "resource": "" }
q18209
Member.logged_in_session_exists
train
public static function logged_in_session_exists() { Deprecation::notice( '5.0.0', 'This method is deprecated and now does not add value. Please use Security::getCurrentUser()' );
php
{ "resource": "" }
q18210
Member.encryptWithUserSettings
train
public function encryptWithUserSettings($string) { if (!$string) { return null; } // If the algorithm or salt is not available, it means we are operating // on legacy account with unhashed password. Do not hash the string. if (!$this->PasswordEncryption) { ...
php
{ "resource": "" }
q18211
Member.generateAutologinTokenAndStoreHash
train
public function generateAutologinTokenAndStoreHash($lifetime = null) { if ($lifetime !== null) { Deprecation::notice( '5.0', 'Passing a $lifetime to Member::generateAutologinTokenAndStoreHash() is deprecated, use the Member.auto_login_token_lif...
php
{ "resource": "" }
q18212
Member.validateAutoLoginToken
train
public function validateAutoLoginToken($autologinToken) { $hash = $this->encryptWithUserSettings($autologinToken); $member
php
{ "resource": "" }
q18213
Member.member_from_autologinhash
train
public static function member_from_autologinhash($hash, $login = false) { /** @var Member $member */ $member = static::get()->filter([ 'AutoLoginHash' => $hash, 'AutoLoginExpired:GreaterThan' => DBDatetime::now()->getValue(), ])->first(); if
php
{ "resource": "" }
q18214
Member.member_from_tempid
train
public static function member_from_tempid($tempid) { $members = static::get() ->filter('TempIDHash', $tempid); // Exclude expired if (static::config()->get('temp_id_lifetime')) { /** @var DataList|Member[] $members */ $members =
php
{ "resource": "" }
q18215
Member.create_new_password
train
public static function create_new_password() { $words = Security::config()->uninherited('word_list'); if ($words && file_exists($words)) { $words = file($words); list($usec, $sec) = explode(' ', microtime());
php
{ "resource": "" }
q18216
Member.deletePasswordLogs
train
protected function deletePasswordLogs() { foreach ($this->LoggedPasswords() as $password) { $password->delete();
php
{ "resource": "" }
q18217
Member.inGroups
train
public function inGroups($groups, $strict = false) { if ($groups) { foreach ($groups as $group) { if ($this->inGroup($group, $strict)) {
php
{ "resource": "" }
q18218
Member.inGroup
train
public function inGroup($group, $strict = false) { if (is_numeric($group)) { $groupCheckObj = DataObject::get_by_id(Group::class, $group); } elseif (is_string($group)) { $groupCheckObj = DataObject::get_one(Group::class, array( '"Group"."Code"' => $group ...
php
{ "resource": "" }
q18219
Member.addToGroupByCode
train
public function addToGroupByCode($groupcode, $title = "") { $group = DataObject::get_one(Group::class, array( '"Group"."Code"' => $groupcode )); if ($group) { $this->Groups()->add($group); } else { if (!$title) { $title = $groupcod...
php
{ "resource": "" }
q18220
Member.removeFromGroupByCode
train
public function removeFromGroupByCode($groupcode) { $group = Group::get()->filter(array('Code' => $groupcode))->first();
php
{ "resource": "" }
q18221
Member.setName
train
public function setName($name) { $nameParts = explode(' ', $name); $this->Surname
php
{ "resource": "" }
q18222
Member.map_in_groups
train
public static function map_in_groups($groups = null) { $groupIDList = array(); if ($groups instanceof SS_List) { foreach ($groups as $group) { $groupIDList[] = $group->ID; } } elseif (is_array($groups)) { $groupIDList = $groups; } ...
php
{ "resource": "" }
q18223
Member.mapInCMSGroups
train
public static function mapInCMSGroups($groups = null) { // non-countable $groups will issue a warning when using count() in PHP 7.2+ if (!$groups) { $groups = []; } // Check CMS module exists if (!class_exists(LeftAndMain::class)) { return ArrayList::...
php
{ "resource": "" }
q18224
Member.memberNotInGroups
train
public function memberNotInGroups($groupList, $memberGroups = null) { if (!$memberGroups) { $memberGroups = $this->Groups(); } foreach ($memberGroups as $group) { if (in_array($group->Code, $groupList)) {
php
{ "resource": "" }
q18225
Member.canView
train
public function canView($member = null) { //get member if (!$member) { $member = Security::getCurrentUser(); } //check for extensions, we do this first as they can overrule everything $extended = $this->extendedCan(__FUNCTION__, $member); if ($extended !==...
php
{ "resource": "" }
q18226
Member.validate
train
public function validate() { // If validation is disabled, skip this step if (!DataObject::config()->uninherited('validation_enabled')) { return ValidationResult::create(); } $valid = parent::validate(); $validator = static::password_validator(); if (!$t...
php
{ "resource": "" }
q18227
Member.changePassword
train
public function changePassword($password, $write = true) { $this->Password = $password; $valid = $this->validate(); $this->extend('onBeforeChangePassword', $password, $valid); if ($valid->isValid()) { $this->AutoLoginHash = null; $this->encryptPassword(); ...
php
{ "resource": "" }
q18228
Member.registerFailedLogin
train
public function registerFailedLogin() { $lockOutAfterCount = self::config()->get('lock_out_after_incorrect_logins'); if ($lockOutAfterCount) { // Keep a tally of the number of failed log-ins so that we can lock people out ++$this->FailedLoginCount; if ($this->Fai...
php
{ "resource": "" }
q18229
Member.registerSuccessfulLogin
train
public function registerSuccessfulLogin() { if (self::config()->get('lock_out_after_incorrect_logins')) {
php
{ "resource": "" }
q18230
Member.getHtmlEditorConfigForCMS
train
public function getHtmlEditorConfigForCMS() { $currentName = ''; $currentPriority = 0; foreach ($this->Groups() as $group) { $configName = $group->HtmlEditorConfig; if ($configName) { $config = HTMLEditorConfig::get($group->HtmlEditorConfig);
php
{ "resource": "" }
q18231
CustomMethods.registerExtraMethodCallback
train
protected function registerExtraMethodCallback($name, $callback) { if (!isset($this->extra_method_registers[$name])) {
php
{ "resource": "" }
q18232
CustomMethods.getExtraMethodConfig
train
protected function getExtraMethodConfig($method) { // Lazy define methods if (!isset(self::$extra_methods[static::class])) { $this->defineMethods(); }
php
{ "resource": "" }
q18233
CustomMethods.allMethodNames
train
public function allMethodNames($custom = false) { $class = static::class; if (!isset(self::$built_in_methods[$class])) { self::$built_in_methods[$class] = array_map('strtolower', get_class_methods($this)); } if ($custom && isset(self::$extra_methods[$class])) { ...
php
{ "resource": "" }
q18234
TextareaField.getSchemaDataDefaults
train
public function getSchemaDataDefaults() { $data = parent::getSchemaDataDefaults(); $data['data']['rows'] =
php
{ "resource": "" }
q18235
Cookie.set
train
public static function set( $name, $value, $expiry = 90, $path = null, $domain = null, $secure = false, $httpOnly = true ) {
php
{ "resource": "" }
q18236
Parser.getTranslatables
train
public static function getTranslatables($template, $warnIfEmpty = true) { // Run the parser and throw away the result $parser = new Parser($template, $warnIfEmpty); if (substr($template, 0, 3) == pack("CCC", 0xef, 0xbb,
php
{ "resource": "" }
q18237
RSSFeed.linkToFeed
train
public static function linkToFeed($url, $title = null) { $title = Convert::raw2xml($title); Requirements::insertHeadTags(
php
{ "resource": "" }
q18238
RSSFeed.Entries
train
public function Entries() { $output = new ArrayList(); if (isset($this->entries)) { foreach ($this->entries as $entry) { $output->push(
php
{ "resource": "" }
q18239
RSSFeed.Link
train
public function Link($action = null) { return
php
{ "resource": "" }
q18240
RSSFeed.outputToBrowser
train
public function outputToBrowser() { $prevState = SSViewer::config()->uninherited('source_file_comments'); SSViewer::config()->update('source_file_comments', false); $response = Controller::curr()->getResponse(); if (is_int($this->lastModified)) { HTTPCacheControlMiddlew...
php
{ "resource": "" }
q18241
ParameterConfirmationToken.backURLToken
train
protected function backURLToken(HTTPRequest $request) { $backURL = $request->getVar('BackURL'); if (!strstr($backURL, '?')) { return null; } // Filter backURL if
php
{ "resource": "" }
q18242
BulkLoader_Result.merge
train
public function merge(BulkLoader_Result $other) { $this->created = array_merge($this->created, $other->created); $this->updated
php
{ "resource": "" }
q18243
HTMLEditorField.getEditorConfig
train
public function getEditorConfig() { // Instance override if ($this->editorConfig instanceof HTMLEditorConfig) {
php
{ "resource": "" }
q18244
PDOConnector.getOrPrepareStatement
train
public function getOrPrepareStatement($sql) { // Return cached statements if (isset($this->cachedStatements[$sql])) { return $this->cachedStatements[$sql]; } // Generate new statement $statement = $this->pdoConnection->prepare( $sql, array...
php
{ "resource": "" }
q18245
PDOConnector.beforeQuery
train
protected function beforeQuery($sql) { // Reset state $this->rowCount = 0; $this->lastStatementError = null; // Flush if necessary
php
{ "resource": "" }
q18246
PDOConnector.exec
train
public function exec($sql, $errorLevel = E_USER_ERROR) { $this->beforeQuery($sql); // Directly exec this query $result = $this->pdoConnection->exec($sql); // Check for errors if ($result !== false) {
php
{ "resource": "" }
q18247
PDOConnector.bindParameters
train
public function bindParameters(PDOStatement $statement, $parameters) { // Bind all parameters $parameterCount = count($parameters); for ($index = 0; $index < $parameterCount; $index++) { $value = $parameters[$index]; $phpType = gettype($value); // Allow o...
php
{ "resource": "" }
q18248
PDOConnector.prepareResults
train
protected function prepareResults(PDOStatementHandle $statement, $errorLevel, $sql, $parameters = array()) { // Catch error if ($this->hasError($statement)) { $this->lastStatementError = $statement->errorInfo(); $statement->closeCursor();
php
{ "resource": "" }
q18249
PDOConnector.hasError
train
protected function hasError($resource) { // No error if no resource if (empty($resource)) { return false; } // If the error code is empty the statement / connection has not been run
php
{ "resource": "" }
q18250
HTTPResponse.output
train
public function output() { // Attach appropriate X-Include-JavaScript and X-Include-CSS headers if (Director::is_ajax()) { Requirements::include_in_response($this);
php
{ "resource": "" }
q18251
HTTPResponse.htmlRedirect
train
protected function htmlRedirect() { $headersSent = headers_sent($file, $line); $location = $this->getHeader('location'); $url = Director::absoluteURL($location); $urlATT = Convert::raw2htmlatt($url); $urlJS = Convert::raw2js($url); $title = (Director::isDev() && $head...
php
{ "resource": "" }
q18252
HTTPResponse.outputHeaders
train
protected function outputHeaders() { $headersSent = headers_sent($file, $line); if (!$headersSent) { $method = sprintf( "%s %d %s", $_SERVER['SERVER_PROTOCOL'], $this->getStatusCode(), $this->getStatusDescription() ...
php
{ "resource": "" }
q18253
ManifestFileFinder.isInsideVendor
train
public function isInsideVendor($basename, $pathname, $depth) { $base =
php
{ "resource": "" }
q18254
ManifestFileFinder.isInsideThemes
train
public function isInsideThemes($basename, $pathname, $depth) {
php
{ "resource": "" }
q18255
ManifestFileFinder.isInsideIgnored
train
public function isInsideIgnored($basename, $pathname, $depth) { return $this->anyParents($basename, $pathname, $depth, function ($basename, $pathname, $depth) {
php
{ "resource": "" }
q18256
ManifestFileFinder.isInsideModule
train
public function isInsideModule($basename, $pathname, $depth) { return $this->anyParents($basename, $pathname, $depth, function ($basename, $pathname, $depth) {
php
{ "resource": "" }
q18257
ManifestFileFinder.anyParents
train
protected function anyParents($basename, $pathname, $depth, $callback) { // Check all ignored dir up the path while ($depth >= 0) { $ignored = $callback($basename, $pathname, $depth); if ($ignored) { return true;
php
{ "resource": "" }
q18258
ManifestFileFinder.upLevels
train
protected function upLevels($pathname, $depth) { if ($depth < 0) { return null;
php
{ "resource": "" }
q18259
ManifestFileFinder.getIgnoredDirs
train
protected function getIgnoredDirs() { $ignored = [self::LANG_DIR, 'node_modules']; if ($this->getOption('ignore_tests')) {
php
{ "resource": "" }
q18260
ManifestFileFinder.isDirectoryIgnored
train
public function isDirectoryIgnored($basename, $pathname, $depth) { // Don't ignore root if ($depth === 0) { return false; } // Check if manifest-ignored is present if (file_exists($pathname . '/' . self::EXCLUDE_FILE)) { return true; } ...
php
{ "resource": "" }
q18261
DBDatetime.Date
train
public function Date() { $formatter = $this->getFormatter(IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE);
php
{ "resource": "" }
q18262
DBDatetime.FormatFromSettings
train
public function FormatFromSettings($member = null) { if (!$member) { $member = Security::getCurrentUser(); } // Fall back to nice if (!$member) { return $this->Nice(); } $dateFormat =
php
{ "resource": "" }
q18263
ViewableData.setFailover
train
public function setFailover(ViewableData $failover) { // Ensure cached methods from previous failover are removed if ($this->failover) {
php
{ "resource": "" }
q18264
ViewableData.escapeTypeForField
train
public function escapeTypeForField($field) { $class = $this->castingClass($field) ?: $this->config()->get('default_cast'); // TODO: It would be quicker not
php
{ "resource": "" }
q18265
ViewableData.objCacheGet
train
protected function objCacheGet($key) { if (isset($this->objCache[$key])) {
php
{ "resource": "" }
q18266
ViewableData.obj
train
public function obj($fieldName, $arguments = [], $cache = false, $cacheName = null) { if (!$cacheName && $cache) { $cacheName = $this->objCacheName($fieldName, $arguments); } // Check pre-cached value $value = $cache ? $this->objCacheGet($cacheName) : null; if ($...
php
{ "resource": "" }
q18267
ViewableData.XML_val
train
public function XML_val($field, $arguments = [], $cache = false) { $result = $this->obj($field, $arguments,
php
{ "resource": "" }
q18268
ViewableData.getXMLValues
train
public function getXMLValues($fields) { $result = []; foreach ($fields as $field) { $result[$field] =
php
{ "resource": "" }
q18269
ViewableData.CSSClasses
train
public function CSSClasses($stopAtClass = self::class) { $classes = []; $classAncestry = array_reverse(ClassInfo::ancestry(static::class)); $stopClasses = ClassInfo::ancestry($stopAtClass); foreach ($classAncestry as $class) { if (in_array($class, $stopClasses)) ...
php
{ "resource": "" }
q18270
Config.modify
train
public static function modify() { $instance = static::inst(); if ($instance instanceof MutableConfigCollectionInterface) { return $instance; } // By default nested configs should become mutable $instance = static::nest();
php
{ "resource": "" }
q18271
Config.unnest
train
public static function unnest() { // Unnest unless we would be left at 0 manifests $loader = ConfigLoader::inst(); if ($loader->countManifests() <= 1) { user_error( "Unable to unnest root Config, please make sure you
php
{ "resource": "" }
q18272
HTTPRequestBuilder.createFromEnvironment
train
public static function createFromEnvironment() { // Clean and update live global variables $variables = static::cleanEnvironment(Environment::getVariables()); Environment::setVariables($variables); // Currently necessary for SSViewer, etc to work
php
{ "resource": "" }
q18273
HTTPRequestBuilder.createFromVariables
train
public static function createFromVariables(array $variables, $input, $url = null) { // Infer URL from REQUEST_URI unless explicitly provided if (!isset($url)) { // Remove query parameters (they're retained separately through $server['_GET'] $url = parse_url($variables['_SERVE...
php
{ "resource": "" }
q18274
DBText.LimitSentences
train
public function LimitSentences($maxSentences = 2) { if (!is_numeric($maxSentences)) { throw new InvalidArgumentException("Text::LimitSentence() expects one numeric argument"); } $value = $this->Plain(); if (!$value) { return ""; } // Do a wor...
php
{ "resource": "" }
q18275
DBText.Summary
train
public function Summary($maxWords = 50, $add = '...') { // Get plain-text version $value = $this->Plain(); if (!$value) { return ''; } // Split on sentences (don't remove period) $sentences = array_filter(array_map(function ($str) { return tri...
php
{ "resource": "" }
q18276
DBText.FirstParagraph
train
public function FirstParagraph() { $value = $this->Plain(); if (empty($value)) { return ''; } // Split paragraphs and return first
php
{ "resource": "" }
q18277
DBText.ContextSummary
train
public function ContextSummary( $characters = 500, $keywords = null, $highlight = true, $prefix = "... ", $suffix = "..." ) { if (!$keywords) { // Use the default "Search" request variable (from SearchForm) $keywords = isset($_REQUEST['Search'...
php
{ "resource": "" }
q18278
Email.mergeConfiguredEmails
train
protected static function mergeConfiguredEmails($config, $env) { // Normalise config list $normalised = []; $source = (array)static::config()->get($config); foreach ($source as $address => $name) {
php
{ "resource": "" }
q18279
Email.obfuscate
train
public static function obfuscate($email, $method = 'visible') { switch ($method) { case 'direction': Requirements::customCSS('span.codedirection { unicode-bidi: bidi-override; direction: rtl; }', 'codedirectionCSS'); return '<span class="codedirection">' . strrev...
php
{ "resource": "" }
q18280
Email.removeData
train
public function removeData($name) { if (is_array($this->data)) { unset($this->data[$name]); } else {
php
{ "resource": "" }
q18281
Email.setHTMLTemplate
train
public function setHTMLTemplate($template) { if (substr($template, -3) == '.ss') { $template = substr($template, 0, -3);
php
{ "resource": "" }
q18282
Email.setPlainTemplate
train
public function setPlainTemplate($template) { if (substr($template, -3) == '.ss') { $template = substr($template, 0, -3);
php
{ "resource": "" }
q18283
Email.send
train
public function send() { if (!$this->getBody()) { $this->render(); } if (!$this->hasPlainPart()) { $this->generatePlainPartFromBody();
php
{ "resource": "" }
q18284
Email.render
train
public function render($plainOnly = false) { if ($existingPlainPart = $this->findPlainPart()) { $this->getSwiftMessage()->detach($existingPlainPart); } unset($existingPlainPart); // Respect explicitly set body $htmlPart = $plainOnly ? null : $this->getBody(); ...
php
{ "resource": "" }
q18285
Email.generatePlainPartFromBody
train
public function generatePlainPartFromBody() { $plainPart = $this->findPlainPart(); if ($plainPart) { $this->getSwiftMessage()->detach($plainPart); } unset($plainPart); $this->getSwiftMessage()->addPart(
php
{ "resource": "" }
q18286
InheritedPermissionFlusher.flushCache
train
public function flushCache() { $ids = $this->getMemberIDList();
php
{ "resource": "" }
q18287
InheritedPermissionFlusher.getMemberIDList
train
protected function getMemberIDList() { if (!$this->owner || !$this->owner->exists()) { return null; } if ($this->owner instanceof Group) {
php
{ "resource": "" }
q18288
LoginHandler.redirectAfterSuccessfulLogin
train
protected function redirectAfterSuccessfulLogin() { $this ->getRequest() ->getSession() ->clear('SessionForms.MemberLoginForm.Email') ->clear('SessionForms.MemberLoginForm.Remember'); $member = Security::getCurrentUser(); if ($member->isPasswo...
php
{ "resource": "" }
q18289
LoginHandler.redirectToChangePassword
train
protected function redirectToChangePassword() { $cp = ChangePasswordForm::create($this, 'ChangePasswordForm'); $cp->sessionMessage( _t('SilverStripe\\Security\\Member.PASSWORDEXPIRED', 'Your password has expired. Please choose a new one.'), 'good' );
php
{ "resource": "" }
q18290
CMSLoginHandler.redirectToChangePassword
train
protected function redirectToChangePassword() { // Since this form is loaded via an iframe, this redirect must be performed via javascript $changePasswordForm = ChangePasswordForm::create($this, 'ChangePasswordForm'); $changePasswordForm->sessionMessage( _t('SilverStripe\\Securit...
php
{ "resource": "" }
q18291
CMSLoginHandler.redirectAfterSuccessfulLogin
train
protected function redirectAfterSuccessfulLogin() { // Check password expiry if (Security::getCurrentUser()->isPasswordExpired()) { // Redirect the user to the external password change form if necessary return $this->redirectToChangePassword(); }
php
{ "resource": "" }
q18292
PrioritySorter.setItems
train
public function setItems(array $items) { $this->items = $items;
php
{ "resource": "" }
q18293
PrioritySorter.addVariables
train
protected function addVariables() { // Remove variables from the list $varValues = array_values($this->variables); $this->names = array_filter($this->names, function ($name) use ($varValues) { return !in_array($name, $varValues); });
php
{ "resource": "" }
q18294
PrioritySorter.includeRest
train
protected function includeRest(array $list) { $otherItemsIndex = false; if ($this->restKey) { $otherItemsIndex = array_search($this->restKey, $this->priorities); } if ($otherItemsIndex !== false) { array_splice($this->priorities, $otherItemsIndex,
php
{ "resource": "" }
q18295
PrioritySorter.resolveValue
train
protected function resolveValue($name) { return isset($this->variables[$name])
php
{ "resource": "" }
q18296
MySQLDatabaseConfigurationHelper.column
train
protected function column($results) { $array = array(); if ($results instanceof mysqli_result) { while ($row = $results->fetch_array()) { $array[] = $row[0]; }
php
{ "resource": "" }
q18297
MySQLDatabaseConfigurationHelper.requireDatabaseVersion
train
public function requireDatabaseVersion($databaseConfig) { $version = $this->getDatabaseVersion($databaseConfig); $success = false; $error = ''; if ($version) { $success = version_compare($version, '5.0', '>=');
php
{ "resource": "" }
q18298
MySQLDatabaseConfigurationHelper.checkDatabasePermissionGrant
train
public function checkDatabasePermissionGrant($database, $permission, $grant) { // Filter out invalid database names if (!$this->checkValidDatabaseName($database)) { return false; } // Escape all valid database patterns (permission must exist on all tables) $sqlDa...
php
{ "resource": "" }
q18299
MySQLDatabaseConfigurationHelper.checkDatabasePermission
train
public function checkDatabasePermission($conn, $database, $permission) { $grants = $this->column($conn->query("SHOW GRANTS FOR CURRENT_USER")); foreach ($grants as $grant) {
php
{ "resource": "" }