_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q7800 | VersionCollection.getPreviousVersion | train | public function getPreviousVersion($from)
{
$lastTimestamp = 0;
foreach (array_keys($this->versions) as $timestamp) {
if ($timestamp == $from) {
return | php | {
"resource": ""
} |
q7801 | TranslationToFile.getAllLanguagesFromTable | train | protected function getAllLanguagesFromTable(): void
{
foreach($this->translations as $entry){
if(!in_array($entry->language, $this->languages)){
| php | {
"resource": ""
} |
q7802 | TranslationToFile.generateGroupFiles | train | protected function generateGroupFiles(): void
{
foreach($this->languages as $language){
foreach($this->translation_groups as $group){
$file = $this->language_folder . $language . "\\" . $group->name | php | {
"resource": ""
} |
q7803 | TranslationToFile.addTranslationsToArray | train | private function addTranslationsToArray($array = []): array
{
foreach($array as $language => $groups){
foreach($groups as $groupname => $entries){
$group_model = TranslationGroup::where('name', $groupname)->first();
$first_level_translations = Translation::where([
['parent', '=', NULL],
['translation_group', '=', $group_model->id],
['language', '=', $language]
| php | {
"resource": ""
} |
q7804 | TranslationToFile.addTranslationGroupsToArray | train | private function addTranslationGroupsToArray($array = []): array
{
foreach(array_keys($array) as $language){
| php | {
"resource": ""
} |
q7805 | Canvas.setFormat | train | public function setFormat($name)
{
if (!$this->hasFactory($name)) {
throw new \InvalidArgumentException(sprintf(
'Invalid Canvas Factory "%s"', $name
));
| php | {
"resource": ""
} |
q7806 | Canvas.setFactory | train | public function setFactory(array $factories)
{
foreach ($factories as | php | {
"resource": ""
} |
q7807 | Canvas.removeFactory | train | public function removeFactory($name)
{
if ($this->hasFactory($name)) {
unset($this->factories[$name]);
| php | {
"resource": ""
} |
q7808 | Canvas.show | train | public function show()
{
try {
header(sprintf('Content-Type: %s', $this->getMimeType(), true));
| php | {
"resource": ""
} |
q7809 | Update.buildAttribute | train | public function buildAttribute($property)
{
$attribute = '';
if (isset($this->$property)) {
$attribute .= ' ' . $property . '="';
if (is_bool($this->$property)) {
$attribute .= ($this->$property) ? 'true' : 'false';
| php | {
"resource": ""
} |
q7810 | PropertyAbstract.setPropertyDefaultValue | train | public function setPropertyDefaultValue($property)
{
if (isset($property->default)) {
// Use the defined default.
return true;
| php | {
"resource": ""
} |
q7811 | PropertyAbstract.prepareFactory | train | protected function prepareFactory()
{
if (empty($this->componentFactory) && isset($this->configuration)) {
| php | {
"resource": ""
} |
q7812 | PropertyAbstract.getValidator | train | public function getValidator()
{
if (!isset($this->validator) && isset($this->configuration)) {
// Initialize JSON validator.
$resolver = $this->configuration->getResolver();
if ($resolver && ($retriever = $resolver->getUriRetriever())) {
$check_mode | php | {
"resource": ""
} |
q7813 | PropertyAbstract.isEmpty | train | public function isEmpty($property_name = null)
{
$value = $this->get($property_name);
| php | {
"resource": ""
} |
q7814 | Timer.endIf | train | public function endIf(bool $condition, ?callable $callback = null): void
{
if ((bool) $condition) { | php | {
"resource": ""
} |
q7815 | Timer.endUnless | train | public function endUnless(bool $condition, ?callable $callback = | php | {
"resource": ""
} |
q7816 | IniRead.& | train | protected function & iniReadFilterEnvironmentSections (array & $rawIniData, $environment) {
$iniData = [];
foreach ($rawIniData as $keyOrSectionName => $valueOrSectionValues) {
if (is_array($valueOrSectionValues)) {
if (strpos($keyOrSectionName, '>') !== FALSE) {
list($envNamesStrLocal, $keyOrSectionName) = | php | {
"resource": ""
} |
q7817 | IniRead.iniReadExpandLevelsAndReType | train | protected function iniReadExpandLevelsAndReType (array & $iniData) {
//$this->objectTypes[''] = [0, & $this->data];
$oldIniScannerMode = $this->_iniScannerMode === 1;
foreach ($iniData as $rawKey => $rawValue) {
$current = & $this->data;
// prepare keys to build levels and configure stdClass/array types
$rawKeys = [];
$lastRawKey = $rawKey;
$lastDotPos = strrpos($rawKey, '.');
if ($lastDotPos !== FALSE) {
$rawKeys = explode('.', substr($rawKey, 0, $lastDotPos));
$lastRawKey = substr($rawKey, $lastDotPos + 1);
}
// prepare levels structure and configure stdClass or array type change where necessary
$levelKey = '';
$prevLevelKey = '';
foreach ($rawKeys as $key) {
$prevLevelKey = $levelKey;
$levelKey .= ($levelKey ? '.' : '') . $key;
if (!isset($current[$key])) {
$current[$key] = [];
$this->objectTypes[$levelKey] = [1, & $current[$key]]; // object type switch -> object by default
if (is_numeric($key) && isset($this->objectTypes[$prevLevelKey])) {
$this->objectTypes[$prevLevelKey][0] = 0; // object type switch -> set array if it was object
| php | {
"resource": ""
} |
q7818 | IniRead.getTypedValue | train | protected function getTypedValue ($rawValue) {
if (gettype($rawValue) == "array") {
foreach ($rawValue as $key => $value) {
$rawValue[$key] = $this->getTypedValue($value);
}
return $rawValue; // array
} else if (mb_strlen($rawValue) > 0) {
if (is_numeric($rawValue)) {
| php | {
"resource": ""
} |
q7819 | IniRead.getTypedValueFloatOrInt | train | protected function getTypedValueFloatOrInt ($rawValue) {
if (strpos($rawValue, '.') !== FALSE || strpos($rawValue, 'e') !== FALSE || strpos($rawValue, 'E') !== FALSE) {
return floatval($rawValue); // float
} else {
// int or | php | {
"resource": ""
} |
q7820 | IniRead.getTypedSpecialValueOrString | train | protected function getTypedSpecialValueOrString ($rawValue) {
$lowerRawValue = strtolower($rawValue);
if (isset(static::$specialValues[$lowerRawValue])) {
| php | {
"resource": ""
} |
q7821 | Starting.GetStarted | train | public static function GetStarted () {
if (static::$started === NULL) {
$req = self::$req ?: self::$req = & \MvcCore\Application::GetInstance()->GetRequest();
if (!$req->IsCli()) {
$alreadyStarted = session_status() === PHP_SESSION_ACTIVE && session_id() !== '';
if ($alreadyStarted) {
// if already started but `static::$started` property is `NULL`:
static::$sessionStartTime = time();
| php | {
"resource": ""
} |
q7822 | Box.scale | train | public function scale($ratio)
{
$this->getDimension()
->setWidth(
round($ratio * $this->getDimension()->getWidth()) | php | {
"resource": ""
} |
q7823 | Dispatching.Init | train | public function Init () {
if ($this->dispatchState > 0) return;
self::$allControllers[spl_object_hash($this)] = & $this;
if ($this->parentController === NULL && !$this->request->IsCli()) {
if ($this->autoStartSession)
$this->application->SessionStart();
$responseContentType = $this->ajax ? 'text/javascript' : 'text/html';
$this->response->SetHeader('Content-Type', $responseContentType);
}
if ($this->autoInitProperties) | php | {
"resource": ""
} |
q7824 | Dispatching.processAutoInitProperties | train | protected function processAutoInitProperties () {
$type = new \ReflectionClass($this);
/** @var $props \ReflectionProperty[] */
$props = $type->getProperties(
\ReflectionProperty::IS_PUBLIC |
\ReflectionProperty::IS_PROTECTED |
\ReflectionProperty::IS_PRIVATE
);
$toolsClass = $this->application->GetToolClass();
foreach ($props as $prop) {
$docComment = $prop->getDocComment();
if (mb_strpos($docComment, '@autoinit') === FALSE) continue;
$propName = $prop->getName();
$methodName = 'create' . ucfirst($propName);
$hasMethod = $type->hasMethod($methodName);
if (!$hasMethod) {
$methodName = '_'.$methodName;
$hasMethod = $type->hasMethod($methodName);
}
if ($hasMethod) {
$method = $type->getMethod($methodName);
if (!$method->isPublic()) $method->setAccessible(TRUE);
$instance = $method->invoke($this);
$implementsController = $instance instanceof \MvcCore\IController;
} else {
$pos = mb_strpos($docComment, '@var ');
if ($pos === FALSE) continue;
$docComment = str_replace(["\r","\n","\t", "*/"], " ", mb_substr($docComment, $pos + 5));
$pos = mb_strpos($docComment, ' ');
| php | {
"resource": ""
} |
q7825 | Dispatching.AssetAction | train | public function AssetAction () {
$ext = '';
$path = $this->GetParam('path', 'a-zA-Z0-9_\-\/\.');
$path = '/' . ltrim(str_replace('..', '', $path), '/');
if (
strpos($path, static::$staticPath) !== 0 &&
strpos($path, static::$tmpPath) !== 0
) {
throw new \ErrorException("[".get_class($this)."] File path: '$path' is not allowed.", 500);
}
$path = $this->request->GetAppRoot() . $path;
if (!file_exists($path)) {
throw new \ErrorException("[".get_class($this)."] File not found: '$path'.", 404);
}
$lastDotPos = strrpos($path, '.');
if ($lastDotPos !== FALSE) {
| php | {
"resource": ""
} |
q7826 | Theme.bootstrapApplication | train | protected function bootstrapApplication( $config ) {
if ( ! isset( $config['providers'] ) ) {
$config['providers'] = [];
}
$config['providers'] | php | {
"resource": ""
} |
q7827 | Theme.bootstrap | train | public function bootstrap( $config = [] ) {
if ( $this->isBootstrapped() ) {
throw new ConfigurationException( static::class . ' already bootstrapped.' );
} | php | {
"resource": ""
} |
q7828 | Environment.EnvironmentDetectByIps | train | public static function EnvironmentDetectByIps () {
if (static::$environment === NULL) {
$request = & \MvcCore\Application::GetInstance()->GetRequest();
$serverAddress = $request->GetServerIp();
$remoteAddress = $request->GetClientIp();
if ($serverAddress == $remoteAddress) {
| php | {
"resource": ""
} |
q7829 | Environment.EnvironmentDetectBySystemConfig | train | public static function EnvironmentDetectBySystemConfig (array $environmentsSectionData = []) {
$environment = NULL;
$app = self::$app ?: self::$app = & \MvcCore\Application::GetInstance();
$request = $app->GetRequest();
$clientIp = NULL;
$serverHostName = NULL;
$serverGlobals = NULL;
foreach ((array) $environmentsSectionData as $environmentName => $environmentSection) | php | {
"resource": ""
} |
q7830 | Environment.envDetectParseSysConfigEnvSectionData | train | protected static function envDetectParseSysConfigEnvSectionData ($environmentSection) {
$data = (object) [
'clientIps' => (object) [
'check' => FALSE,
'values' => [],
'regExeps' => []
],
'serverHostNames' => (object) [
'check' => FALSE,
'values' => [],
'regExeps' => []
],
'serverVariables' => (object) [
'check' => FALSE,
'existence' => [],
'values' => [],
'regExeps' => []
]
];
if (is_string($environmentSection) && strlen($environmentSection) > 0) {
// if there is only string provided, value is probably only
// about the most and simple way - to describe client IPS:
static::envDetectParseSysConfigClientIps($data, $environmentSection);
} else if (is_array($environmentSection) || $environmentSection instanceof \stdClass) {
foreach ((array) $environmentSection | php | {
"resource": ""
} |
q7831 | Environment.envDetectParseSysConfigClientIps | train | protected static function envDetectParseSysConfigClientIps (& $data, $rawClientIps) {
$data->clientIps->check = TRUE;
if (is_string($rawClientIps)) {
if (substr($rawClientIps, 0, 1) == '/') {
$data->clientIps->regExeps[] = $rawClientIps;
} else {
$data->clientIps->values = array_merge(
$data->clientIps->values,
explode(',', str_replace(' ', '', $rawClientIps))
);
}
} else if (is_array($rawClientIps) || $rawClientIps instanceof \stdClass) {
foreach ((array) | php | {
"resource": ""
} |
q7832 | Environment.envDetectParseSysConfigServerNames | train | protected static function envDetectParseSysConfigServerNames (& $data, $rawHostNames) {
$data->serverHostNames->check = TRUE;
if (is_string($rawHostNames)) {
if (substr($rawHostNames, 0, 1) == '/') {
$data->serverHostNames->regExeps[] = $rawHostNames;
} else {
$data->serverHostNames->values = array_merge(
$data->serverHostNames->values,
explode(',', str_replace(' ', '', $rawHostNames))
);
}
} else if (is_array($rawHostNames) || $rawHostNames instanceof \stdClass) {
foreach ((array) | php | {
"resource": ""
} |
q7833 | Environment.envDetectParseSysConfigVariables | train | protected static function envDetectParseSysConfigVariables (& $data, $rawServerVariable) {
$data->serverVariables->check = TRUE;
if (is_string($rawServerVariable)) {
$data->serverVariables->existence[] = $rawServerVariable;
} else if (is_array($rawServerVariable) || $rawServerVariable instanceof \stdClass) {
foreach ((array) $rawServerVariable as $key => $value) {
| php | {
"resource": ""
} |
q7834 | Helpers.EncodeJson | train | public static function EncodeJson (& $data) {
$flags = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP |
(defined('JSON_UNESCAPED_SLASHES') ? JSON_UNESCAPED_SLASHES : 0) |
(defined('JSON_UNESCAPED_UNICODE') ? JSON_UNESCAPED_UNICODE : 0) |
(defined('JSON_PRESERVE_ZERO_FRACTION') ? JSON_PRESERVE_ZERO_FRACTION | php | {
"resource": ""
} |
q7835 | Helpers.GetSystemTmpDir | train | public static function GetSystemTmpDir () {
if (self::$tmpDir === NULL) {
$tmpDir = sys_get_temp_dir();
if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
// Windows:
$sysRoot = getenv('SystemRoot');
// do not store anything directly in C:\Windows, use C\windows\Temp instead
if (!$tmpDir || $tmpDir === $sysRoot) {
$tmpDir = !empty($_SERVER['TEMP'])
? $_SERVER['TEMP']
: (!empty($_SERVER['TMP'])
? $_SERVER['TMP']
: (!empty($_SERVER['WINDIR'])
? $_SERVER['WINDIR'] . '/Temp'
: $sysRoot . '/Temp'
)
);
}
| php | {
"resource": ""
} |
q7836 | UrlBuilding.urlAbsPartAndSplit | train | protected function urlAbsPartAndSplit (\MvcCore\IRequest & $request, $resultUrl, & $domainParams, $splitUrl) {
$domainParamsFlag = $this->flags[1];
$basePathInReverse = FALSE;
if ($domainParamsFlag >= static::FLAG_HOST_BASEPATH) {
$basePathInReverse = TRUE;
$domainParamsFlag -= static::FLAG_HOST_BASEPATH;
}
if ($this->flags[0]) {
// route is defined as absolute with possible `%domain%` and other params
// process possible replacements in reverse result - `%host%`, `%domain%`, `%tld%` and `%sld%`
$this->urlReplaceDomainReverseParams($request, $resultUrl, $domainParams, $domainParamsFlag);
// try to find URL position after domain part and after base path part
if ($basePathInReverse) {
| php | {
"resource": ""
} |
q7837 | UrlBuilding.urlAbsPartAndSplitByReverseBasePath | train | protected function urlAbsPartAndSplitByReverseBasePath (\MvcCore\IRequest & $request, $resultUrl, & $domainParams, $splitUrl) {
$doubleSlashPos = mb_strpos($resultUrl, '//');
$doubleSlashPos = $doubleSlashPos === FALSE
? 0
: $doubleSlashPos + 2;
$router = & $this->router;
$basePathPlaceHolderPos = mb_strpos($resultUrl, static::PLACEHOLDER_BASEPATH, $doubleSlashPos);
if ($basePathPlaceHolderPos === FALSE) {
return $this->urlAbsPartAndSplitByRequestedBasePath(
$request, $resultUrl, $splitUrl
);
}
$pathPart = mb_substr($resultUrl, $basePathPlaceHolderPos + mb_strlen(static::PLACEHOLDER_BASEPATH));
$pathPart = str_replace('//', '/', $pathPart);
$basePart = mb_substr($resultUrl, 0, $basePathPlaceHolderPos); | php | {
"resource": ""
} |
q7838 | UrlBuilding.urlAbsPartAndSplitByRequestedBasePath | train | protected function urlAbsPartAndSplitByRequestedBasePath (\MvcCore\IRequest & $request, $resultUrl, $splitUrl) {
$doubleSlashPos = mb_strpos($resultUrl, '//');
$doubleSlashPos = $doubleSlashPos === FALSE
? 0
: $doubleSlashPos + 2;
if (!$splitUrl) {
$resultSchemePart = mb_substr($resultUrl, 0, $doubleSlashPos);
$resultAfterScheme = mb_substr($resultUrl, $doubleSlashPos);
$resultAfterScheme = str_replace('//', '/', $resultAfterScheme);
if ($this->flags[0] === static::FLAG_SCHEME_ANY) {
$resultUrl = $request->GetScheme() . '//' . $resultAfterScheme;
} else {
$resultUrl = $resultSchemePart . $resultAfterScheme;
}
return [$resultUrl];
} else {
$nextSlashPos = mb_strpos($resultUrl, '/', $doubleSlashPos);
if ($nextSlashPos === FALSE) {
$queryStringPos = mb_strpos($resultUrl, '?', $doubleSlashPos);
$baseUrlPartEndPos = $queryStringPos === FALSE
? mb_strlen($resultUrl)
: $queryStringPos;
} else {
$baseUrlPartEndPos | php | {
"resource": ""
} |
q7839 | Avatar.removeUserMetaKey | train | public function removeUserMetaKey( $user_meta_key ) {
$filter = function( $meta_key ) use ( $user_meta_key ) {
return $meta_key !== $user_meta_key; | php | {
"resource": ""
} |
q7840 | Avatar.idOrEmailToId | train | protected function idOrEmailToId( $id_or_email ) {
if ( is_a( $id_or_email, WP_Comment::class ) ) {
return intval( $id_or_email->user_id );
}
if ( ! is_numeric( $id_or_email ) ) {
| php | {
"resource": ""
} |
q7841 | Avatar.getAttachmentFallbackChain | train | protected function getAttachmentFallbackChain( $user_id ) {
$chain = [];
foreach ( $this->avatar_user_meta_keys as $user_meta_key ) {
$attachment_id = get_user_meta( $user_id, $user_meta_key, true );
if ( is_numeric( $attachment_id ) ) {
| php | {
"resource": ""
} |
q7842 | Avatar.getAvatarUrl | train | protected function getAvatarUrl( $id, $size ) {
$attachments_fallback_chain = $this->getAttachmentFallbackChain( $id );
foreach ( $attachments_fallback_chain as $attachment_id ) {
| php | {
"resource": ""
} |
q7843 | Avatar.filterAvatar | train | public function filterAvatar( $url, $id_or_email, $args ) {
if ( ! empty( $args['force_default'] ) ) {
return $url;
}
if ( $this->default_avatar_id === 0 && empty( $this->avatar_user_meta_keys ) ) | php | {
"resource": ""
} |
q7844 | Server.collection | train | public function collection(string $collection, ?string $format = null) : string {
list($collection, $extension) = preg_split('/\.(css|js)/', $collection, | php | {
"resource": ""
} |
q7845 | Server.stylesheets | train | public function stylesheets(string $collection, ?string $format = null) : string {
| php | {
"resource": ""
} |
q7846 | Server.javascripts | train | public function javascripts(string $collection, ?string $format = null) : string {
| php | {
"resource": ""
} |
q7847 | Server.serve | train | public function serve(string $collection, string $group, ?string $format = null) : string {
if ( ! isset($this->app['basset'][$collection])) {
return '<!-- Basset could not find collection: '.$collection.' -->';
}
// Get the collection instance from the array of collections. This instance will be used
// throughout the building process to fetch assets and compare against the stored
// manfiest of fingerprints.
$collection = $this->app['basset'][$collection];
| php | {
"resource": ""
} |
q7848 | Server.serveProductionCollection | train | protected function serveProductionCollection(Collection $collection, string $group, ?string $format) : string {
$entry = $this->getCollectionEntry($collection);
$fingerprint = $entry->getProductionFingerprint($group);
| php | {
"resource": ""
} |
q7849 | Server.serveDevelopmentCollection | train | protected function serveDevelopmentCollection(Collection $collection, string $group, ?string $format) : string {
$identifier = $collection->getIdentifier();
// Before we fetch the collections manifest entry we'll try to build the collection
// again if there is anything outstanding. This doesn't have a huge impact on
// page loads time like trying to dynamically serve each asset.
$this->tryDevelopmentBuild($collection, $group);
$entry = $this->getCollectionEntry($collection);
$responses = array();
foreach ($collection->getAssetsWithRaw($group) as $asset) {
if ( ! $asset->isRaw() and $path = $entry->getDevelopmentAsset($asset)) {
| php | {
"resource": ""
} |
q7850 | Server.serveRawAssets | train | protected function serveRawAssets(Collection $collection, string $group, ?string $format) : array {
$responses = array();
foreach ($collection->getAssetsOnlyRaw($group) as $asset) | php | {
"resource": ""
} |
q7851 | Server.formatResponse | train | protected function formatResponse() : string {
$responses = array();
foreach (func_get_args() as $response) {
$responses = array_merge($responses, | php | {
"resource": ""
} |
q7852 | Server.tryDevelopmentBuild | train | protected function tryDevelopmentBuild(Collection $collection, string $group) : void {
try {
$this->app['basset.builder']->buildAsDevelopment($collection, $group);
| php | {
"resource": ""
} |
q7853 | Server.prefixBuildPath | train | protected function prefixBuildPath(string $path) : string {
if ($buildPath = $this->app['config']->get('basset.build_path')) {
| php | {
"resource": ""
} |
q7854 | Server.createStylesheetsElement | train | protected function createStylesheetsElement(string $path, ?string $format) : string {
return | php | {
"resource": ""
} |
q7855 | Server.createJavascriptsElement | train | protected function createJavascriptsElement(string $path, ?string $format) : | php | {
"resource": ""
} |
q7856 | Server.buildAssetUrl | train | public function buildAssetUrl(string $path) : string {
return starts_with($path, '//') ? | php | {
"resource": ""
} |
q7857 | AbstractEnum.all | train | final public static function all() : array
{
static $all = null;
if ($all === null) {
foreach ((new \ReflectionClass(get_called_class()))->getConstants() as $constant) {
| php | {
"resource": ""
} |
q7858 | Rendering.& | train | public function & Render ($typePath = '', $relativePath = '') {
/** @var $this \MvcCore\View */
if (!$typePath) $typePath = static::$scriptsDir;
$result = '';
$relativePath = $this->_correctRelativePath(
$typePath, $relativePath
);
$viewScriptFullPath = static::GetViewScriptFullPath($typePath, $relativePath);
if (!file_exists($viewScriptFullPath)) { | php | {
"resource": ""
} |
q7859 | AssetFinder.find | train | public function find($name)
{
$name = $this->config->get("basset.aliases.assets.{$name}", $name);
// Spin through an array of methods ordered by the priority of how an asset should be found.
// Once we find a non-null path we'll return that path breaking from the loop.
foreach | php | {
"resource": ""
} |
q7860 | AssetFinder.findPackageAsset | train | public function findPackageAsset($name)
{
if (str_contains($name, '::'))
{
list($namespace, $name) = explode('::', $name);
if ( ! isset($this->hints[$namespace]))
{
return;
| php | {
"resource": ""
} |
q7861 | AssetFinder.findWorkingDirectory | train | public function findWorkingDirectory($name)
{
$path = $this->getWorkingDirectory().'/'.$name;
| php | {
"resource": ""
} |
q7862 | AssetFinder.findPublicPath | train | public function findPublicPath($name)
{
$path = $this->prefixPublicPath($name);
| php | {
"resource": ""
} |
q7863 | AssetFinder.setWorkingDirectory | train | public function setWorkingDirectory($path)
{
$path = $this->prefixDirectoryStack($path);
if ($this->files->exists($path))
{
return $this->directoryStack[] = $path;
}
| php | {
"resource": ""
} |
q7864 | AssetFinder.prefixDirectoryStack | train | public function prefixDirectoryStack($path)
{
if ($this->withinWorkingDirectory())
| php | {
"resource": ""
} |
q7865 | FileSystemAssertTrait.assertDirectoryNotEmpty | train | public static function assertDirectoryNotEmpty($filename, string $message = '')
{
| php | {
"resource": ""
} |
q7866 | FileSystemAssertTrait.assertFileIsNotLink | train | public static function assertFileIsNotLink($filename, string $message = '')
{
| php | {
"resource": ""
} |
q7867 | Instancing.constructVarAdvConf | train | protected function constructVarAdvConf (& $advCfg) {
$methodParam = static::CONFIG_METHOD;
if (isset($advCfg[$methodParam]))
$this->method = strtoupper((string) $advCfg[$methodParam]);
| php | {
"resource": ""
} |
q7868 | Converters.convertToType | train | protected static function convertToType ($rawValue, $typeStr) {
$conversionResult = FALSE;
$typeStr = trim($typeStr, '\\');
if ($typeStr == 'DateTime') {
$dateTimeFormat = 'Y-m-d H:i:s';
if (is_numeric($rawValue)) {
$rawValueStr = str_replace(['+','-','.'], '', strval($rawValue));
$secData = mb_substr($rawValueStr, 0, 10);
$dateTimeStr = date($dateTimeFormat, intval($secData));
if (strlen($rawValueStr) > 10)
$dateTimeStr .= '.' . mb_substr($rawValueStr, | php | {
"resource": ""
} |
q7869 | Converters.getKeyConversionMethods | train | protected static function getKeyConversionMethods ($keysConversionFlags = \MvcCore\IModel::KEYS_CONVERSION_CASE_SENSITIVE) {
$flagsAndConversionMethods = [
$keysConversionFlags & \MvcCore\IModel::KEYS_CONVERSION_UNDERSCORES_TO_PASCALCASE => 'keyConversionUnderscoresToPascalcase',
$keysConversionFlags & \MvcCore\IModel::KEYS_CONVERSION_UNDERSCORES_TO_CAMELCASE => 'keyConversionUnderscoresToCamelcase',
$keysConversionFlags & \MvcCore\IModel::KEYS_CONVERSION_PASCALCASE_TO_UNDERSCORES | php | {
"resource": ""
} |
q7870 | Converters.keyConversionCaseInsensitive | train | protected static function keyConversionCaseInsensitive ($key, & $toolsClass, & $csKeysMap) {
$keyPos = stripos($csKeysMap, ','.$key.',');
if ($keyPos === | php | {
"resource": ""
} |
q7871 | Jpeg.isJpegFile | train | public static function isJpegFile($filename)
{
try {
$image = new ImageFile($filename);
if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_JPEG)) {
return false;
}
| php | {
"resource": ""
} |
q7872 | SystemSetting.getPortableType | train | public function getPortableType()
{
$type = false;
switch ($this->getFieldXType()) {
case 'modx-combo-template':
$type = 'template';
break;
case 'modx-combo-source': | php | {
"resource": ""
} |
q7873 | SystemSetting.setCoreAccessPoliciesVersion | train | public function setCoreAccessPoliciesVersion($value)
{
$this->setFieldName('access_policies_version');
$this->loadObject(true); | php | {
"resource": ""
} |
q7874 | SystemSetting.setCoreAllowManagerLoginForgotPassword | train | public function setCoreAllowManagerLoginForgotPassword($value)
{
$this->setFieldName('allow_manager_login_forgot_password'); | php | {
"resource": ""
} |
q7875 | SystemSetting.setCoreAllowMultipleEmails | train | public function setCoreAllowMultipleEmails($value)
{
$this->setFieldName('allow_multiple_emails');
$this->loadObject(true); | php | {
"resource": ""
} |
q7876 | SystemSetting.setCoreAllowTagsInPost | train | public function setCoreAllowTagsInPost($value)
{
$this->setFieldName('allow_tags_in_post');
| php | {
"resource": ""
} |
q7877 | SystemSetting.setCoreAnonymousSessions | train | public function setCoreAnonymousSessions($value)
{
$this->setFieldName('anonymous_sessions');
$this->loadObject(true); | php | {
"resource": ""
} |
q7878 | SystemSetting.setCoreArchiveWith | train | public function setCoreArchiveWith($value)
{
$this->setFieldName('archive_with');
| php | {
"resource": ""
} |
q7879 | SystemSetting.setCoreAutoCheckPkgUpdates | train | public function setCoreAutoCheckPkgUpdates($value)
{
$this->setFieldName('auto_check_pkg_updates');
$this->loadObject(true); | php | {
"resource": ""
} |
q7880 | SystemSetting.setCoreAutoCheckPkgUpdatesCacheExpire | train | public function setCoreAutoCheckPkgUpdatesCacheExpire($value)
{
$this->setFieldName('auto_check_pkg_updates_cache_expire'); | php | {
"resource": ""
} |
q7881 | SystemSetting.setCoreAutoIsfolder | train | public function setCoreAutoIsfolder($value)
{
$this->setFieldName('auto_isfolder');
| php | {
"resource": ""
} |
q7882 | SystemSetting.setCoreAutoMenuindex | train | public function setCoreAutoMenuindex($value)
{
$this->setFieldName('auto_menuindex');
| php | {
"resource": ""
} |
q7883 | SystemSetting.setCoreAutomaticAlias | train | public function setCoreAutomaticAlias($value)
{
$this->setFieldName('automatic_alias');
| php | {
"resource": ""
} |
q7884 | SystemSetting.setCoreBaseHelpUrl | train | public function setCoreBaseHelpUrl($value)
{
$this->setFieldName('base_help_url');
| php | {
"resource": ""
} |
q7885 | SystemSetting.setCoreCacheAliasMap | train | public function setCoreCacheAliasMap($value)
{
$this->setFieldName('cache_alias_map');
| php | {
"resource": ""
} |
q7886 | SystemSetting.setCoreCacheContextSettings | train | public function setCoreCacheContextSettings($value)
{
$this->setFieldName('cache_context_settings');
$this->loadObject(true); | php | {
"resource": ""
} |
q7887 | SystemSetting.setCoreCacheDb | train | public function setCoreCacheDb($value)
{
$this->setFieldName('cache_db');
| php | {
"resource": ""
} |
q7888 | SystemSetting.setCoreCacheDbSession | train | public function setCoreCacheDbSession($value)
{
$this->setFieldName('cache_db_session');
| php | {
"resource": ""
} |
q7889 | SystemSetting.setCoreCacheDefault | train | public function setCoreCacheDefault($value)
{
$this->setFieldName('cache_default');
| php | {
"resource": ""
} |
q7890 | SystemSetting.setCoreCacheDisabled | train | public function setCoreCacheDisabled($value)
{
$this->setFieldName('cache_disabled');
| php | {
"resource": ""
} |
q7891 | SystemSetting.setCoreCacheFormat | train | public function setCoreCacheFormat($value)
{
$this->setFieldName('cache_format');
| php | {
"resource": ""
} |
q7892 | SystemSetting.setCoreCacheHandler | train | public function setCoreCacheHandler($value)
{
$this->setFieldName('cache_handler');
| php | {
"resource": ""
} |
q7893 | SystemSetting.setCoreCacheLangJs | train | public function setCoreCacheLangJs($value)
{
$this->setFieldName('cache_lang_js');
| php | {
"resource": ""
} |
q7894 | SystemSetting.setCoreCacheLexiconTopics | train | public function setCoreCacheLexiconTopics($value)
{
$this->setFieldName('cache_lexicon_topics');
$this->loadObject(true); | php | {
"resource": ""
} |
q7895 | SystemSetting.setCoreCacheNoncoreLexiconTopics | train | public function setCoreCacheNoncoreLexiconTopics($value)
{
$this->setFieldName('cache_noncore_lexicon_topics');
$this->loadObject(true); | php | {
"resource": ""
} |
q7896 | SystemSetting.setCoreCacheResource | train | public function setCoreCacheResource($value)
{
$this->setFieldName('cache_resource');
| php | {
"resource": ""
} |
q7897 | SystemSetting.setCoreCacheSystemSettings | train | public function setCoreCacheSystemSettings($value)
{
$this->setFieldName('cache_system_settings');
$this->loadObject(true); | php | {
"resource": ""
} |
q7898 | SystemSetting.setCoreClearCacheRefreshTrees | train | public function setCoreClearCacheRefreshTrees($value)
{
$this->setFieldName('clear_cache_refresh_trees');
$this->loadObject(true); | php | {
"resource": ""
} |
q7899 | SystemSetting.setCoreCompressCss | train | public function setCoreCompressCss($value)
{
$this->setFieldName('compress_css');
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.