_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q266600 | DatabaseOptions.setDataColumn | test | public function setDataColumn($dataColumn)
{
$dataColumn = (string) $dataColumn;
/** @noinspection IsEmptyFunctionUsageInspection */
if (empty($dataColumn)) {
throw new Exception\InvalidArgumentException('Data column must be a non-empty string.');
}
$this->dataC... | php | {
"resource": ""
} |
q266601 | DatabaseOptions.setLifetimeColumn | test | public function setLifetimeColumn($lifetimeColumn)
{
$lifetimeColumn = (string) $lifetimeColumn;
/** @noinspection IsEmptyFunctionUsageInspection */
if (empty($lifetimeColumn)) {
throw new Exception\InvalidArgumentException('Lifetime column must be a non-empty string.');
... | php | {
"resource": ""
} |
q266602 | DatabaseOptions.setModifiedColumn | test | public function setModifiedColumn($modifiedColumn)
{
$modifiedColumn = (string) $modifiedColumn;
/** @noinspection IsEmptyFunctionUsageInspection */
if (empty($modifiedColumn)) {
throw new Exception\InvalidArgumentException('Modified column must be a non-empty string.');
... | php | {
"resource": ""
} |
q266603 | DatabaseOptions.setCreatedColumn | test | public function setCreatedColumn($createdColumn)
{
$createdColumn = (string) $createdColumn;
/** @noinspection IsEmptyFunctionUsageInspection */
if (empty($createdColumn)) {
throw new Exception\InvalidArgumentException('Created column must be a non-empty string.');
}
... | php | {
"resource": ""
} |
q266604 | Social.providers | test | public static function providers()
{
return collect(Settings::first()->fillable)->filter(function ($value) {
return strpos($value, '_client_id') !== false;
})->map(function ($value) {
return str_replace('_client_id', '', $value);
})->toArray();
} | php | {
"resource": ""
} |
q266605 | Social.availableProviders | test | public static function availableProviders()
{
$settings = Settings::first();
return collect(static::providers())->filter(function ($value) use ($settings) {
$ci = $value.'_client_id';
$cs = $value.'_client_secret';
return $settings->$ci && $settings->$cs;
... | php | {
"resource": ""
} |
q266606 | ContentNegotiationServiceProvider.boot | test | public function boot(Application $app)
{
$app->before(array($this, "setRequestFormat"), Application::EARLY_EVENT);
$app->before(array($this, "validateRequestContentType"), Application::EARLY_EVENT);
} | php | {
"resource": ""
} |
q266607 | ContentNegotiationServiceProvider.register | test | public function register(Container $app)
{
$app["conneg.responseFormats"] = array("html");
$app["conneg.requestFormats"] = array("form");
$app["conneg.defaultFormat"] = "html";
$app["conneg"] = function (Container $app) {
if ($app->offsetExists("serializer")) {
... | php | {
"resource": ""
} |
q266608 | ContentNegotiationServiceProvider.setRequestFormat | test | public function setRequestFormat(Request $request, Application $app)
{
// If there is no Accept header, do nothing
if (!$request->headers->get("Accept")) {
return;
}
// Check the Accept header for acceptable formats
foreach ($request->getAcceptableContentTypes() ... | php | {
"resource": ""
} |
q266609 | ContentNegotiationServiceProvider.validateRequestContentType | test | public function validateRequestContentType(Request $request, Application $app)
{
// Define the "form" format so we can use it for validation
$request->setFormat("form", array("application/x-www-form-urlencoded", "multipart/form-data"));
$format = $request->getContentType();
if (strl... | php | {
"resource": ""
} |
q266610 | ReturnPromise.execute | test | public function execute(array $args, FunctionProphecy $function)
{
$value = array_shift($this->returnValues);
if (!count($this->returnValues)) {
$this->returnValues[] = $value;
}
return $value;
} | php | {
"resource": ""
} |
q266611 | PEAR_Downloader.discover | test | function discover($channel)
{
$this->log(1, 'Attempting to discover channel "' . $channel . '"...');
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$callback = $this->ui ? array(&$this, '_downloadCallback') : null;
if (!class_exists('System')) {
require_once 'System.php';
... | php | {
"resource": ""
} |
q266612 | PEAR_Downloader.& | test | function &getDependency2Object(&$c, $i, $p, $s)
{
if (!class_exists('PEAR_Dependency2')) {
require_once 'PEAR/Dependency2.php';
}
$z = &new PEAR_Dependency2($c, $i, $p, $s);
return $z;
} | php | {
"resource": ""
} |
q266613 | PEAR_Downloader.getDownloadDir | test | function getDownloadDir()
{
if (isset($this->_downloadDir)) {
return $this->_downloadDir;
}
$downloaddir = $this->config->get('download_dir');
if (empty($downloaddir) || (is_dir($downloaddir) && !is_writable($downloaddir))) {
if (is_dir($downloaddir) && !is_... | php | {
"resource": ""
} |
q266614 | PEAR_Downloader._detectDepCycle | test | function _detectDepCycle(&$deplinks)
{
do {
$keepgoing = false;
foreach ($deplinks as $dep => $parents) {
foreach ($parents as $parent => $unused) {
// reset the parent cycle detector
$this->_testCycle(null, null, null);
... | php | {
"resource": ""
} |
q266615 | PEAR_Downloader._setupGraph | test | function _setupGraph($t, $reg, &$deplinks, &$nodes, $package)
{
foreach ($t as $dep) {
$depchannel = !isset($dep['channel']) ? '__uri': $dep['channel'];
$dname = $reg->parsedPackageNameToString(
array(
'channel' => $depchannel,
... | php | {
"resource": ""
} |
q266616 | Request.getUrlArg | test | public function getUrlArg($param = null, $default = false)
{
$routes = CarteBlanche::getContainer()->get('router')->getRouteParsed();
if (!empty($routes)) {
if ($param=='args') {
if (isset($routes['args']))
return $routes['args'];
} else {
... | php | {
"resource": ""
} |
q266617 | Console.outputLine | test | public function outputLine($string = '', $translate = true)
{
if ($translate) {
\cli\line($this->getLang()->__($string));
} else {
\cli\line($string);
}
} | php | {
"resource": ""
} |
q266618 | Console.getArgs | test | public function getArgs($strict = false, $force = false)
{
if (is_null($this->args) || $force) {
$this->args = new \cli\Arguments($strict);
$this->args->addFlag(array(
'verbose',
'v'
), 'Turn on verbose output');
$this->args->ad... | php | {
"resource": ""
} |
q266619 | NoCaptchaServiceProvider.registerNoCaptcha | test | private function registerNoCaptcha()
{
$this->singleton(Contracts\NoCaptcha::class, function($app) {
/** @var \Illuminate\Config\Repository $config */
$config = $app['config'];
return new NoCaptcha(
$config->get('no-captcha.secret'),
$co... | php | {
"resource": ""
} |
q266620 | NoCaptchaServiceProvider.registerValidatorRules | test | private function registerValidatorRules($app)
{
$app['validator']->extend('captcha', function($attribute, $value) use ($app) {
unset($attribute);
$ip = $app['request']->getClientIp();
return $app[Contracts\NoCaptcha::class]->verify($value, $ip);
});
} | php | {
"resource": ""
} |
q266621 | NoCaptchaServiceProvider.registerFormMacros | test | private function registerFormMacros($app)
{
if ($app->bound('form')) {
$app['form']->macro('captcha', function($name = null, array $attributes = []) use ($app) {
return $app[Contracts\NoCaptcha::class]->display($name, $attributes);
});
}
} | php | {
"resource": ""
} |
q266622 | PEAR_ChannelFile.fromXmlFile | test | function fromXmlFile($descfile)
{
if (!file_exists($descfile) || !is_file($descfile) || !is_readable($descfile) ||
(!$fp = fopen($descfile, 'r'))) {
require_once 'PEAR.php';
return PEAR::raiseError("Unable to open $descfile");
}
// read the whole thing s... | php | {
"resource": ""
} |
q266623 | PEAR_ChannelFile.fromAny | test | function fromAny($info)
{
if (is_string($info) && file_exists($info) && strlen($info) < 255) {
$tmp = substr($info, -4);
if ($tmp == '.xml') {
$info = $this->fromXmlFile($info);
} else {
$fp = fopen($info, "r");
$test = frea... | php | {
"resource": ""
} |
q266624 | PEAR_ChannelFile.toXml | test | function toXml()
{
if (!$this->_isValid && !$this->validate()) {
$this->_validateError(PEAR_CHANNELFILE_ERROR_INVALID);
return false;
}
if (!isset($this->_channelInfo['attribs']['version'])) {
$this->_channelInfo['attribs']['version'] = '1.0';
}
... | php | {
"resource": ""
} |
q266625 | PEAR_ChannelFile._validateError | test | function _validateError($code, $params = array())
{
$this->_stack->push($code, 'error', $params);
$this->_isValid = false;
} | php | {
"resource": ""
} |
q266626 | PEAR_ChannelFile.getBaseURL | test | function getBaseURL($resourceType, $mirror = false)
{
if ($mirror == $this->_channelInfo['name']) {
$mirror = false;
}
if ($mirror) {
$mir = $this->getMirror($mirror);
if (!$mir) {
return false;
}
$rest = $mir['res... | php | {
"resource": ""
} |
q266627 | PEAR_ChannelFile.resetFunctions | test | function resetFunctions($type, $mirror = false)
{
if ($mirror) {
if (isset($this->_channelInfo['servers']['mirror'])) {
$mirrors = $this->_channelInfo['servers']['mirror'];
if (!isset($mirrors[0])) {
$mirrors = array($mirrors);
... | php | {
"resource": ""
} |
q266628 | PEAR_ChannelFile.setDefaultPEARProtocols | test | function setDefaultPEARProtocols($version = '1.0', $mirror = false)
{
switch ($version) {
case '1.0' :
$this->resetREST($mirror);
if (!isset($this->_channelInfo['servers'])) {
$this->_channelInfo['servers'] = array('primary' =>
... | php | {
"resource": ""
} |
q266629 | PEAR_ChannelFile.getMirror | test | function getMirror($server)
{
foreach ($this->getMirrors() as $mirror) {
if ($mirror['attribs']['host'] == $server) {
return $mirror;
}
}
return false;
} | php | {
"resource": ""
} |
q266630 | PEAR_ChannelFile.setValidationPackage | test | function setValidationPackage($validateclass, $version)
{
if (empty($validateclass)) {
unset($this->_channelInfo['validatepackage']);
}
$this->_channelInfo['validatepackage'] = array('_content' => $validateclass);
$this->_channelInfo['validatepackage']['attribs'] = array(... | php | {
"resource": ""
} |
q266631 | PEAR_ChannelFile.addFunction | test | function addFunction($type, $version, $name = '', $mirror = false)
{
if ($mirror) {
return $this->addMirrorFunction($mirror, $type, $version, $name);
}
$set = array('attribs' => array('version' => $version), '_content' => $name);
if (!isset($this->_channelInfo['servers']... | php | {
"resource": ""
} |
q266632 | PEAR_ChannelFile.addMirrorFunction | test | function addMirrorFunction($mirror, $type, $version, $name = '')
{
if (!isset($this->_channelInfo['servers']['mirror'])) {
$this->_validateError(PEAR_CHANNELFILE_ERROR_MIRROR_NOT_FOUND,
array('mirror' => $mirror));
return false;
}
$setmirror = false;
... | php | {
"resource": ""
} |
q266633 | PEAR_ChannelFile.getValidationPackage | test | function getValidationPackage()
{
if (!$this->_isValid && !$this->validate()) {
return false;
}
if (!isset($this->_channelInfo['validatepackage'])) {
return array('attribs' => array('version' => 'default'),
'_content' => 'PEAR_Validate');
}
... | php | {
"resource": ""
} |
q266634 | PEAR_ChannelFile.& | test | function &getValidationObject($package = false)
{
if (!class_exists('PEAR_Validate')) {
require_once 'PEAR/Validate.php';
}
if (!$this->_isValid) {
if (!$this->validate()) {
$a = false;
return $a;
}
}
if (i... | php | {
"resource": ""
} |
q266635 | BaseObject.canGetProperty | test | public function canGetProperty($name, $checkVars = true)
{
$getter = static::_GETTER_PREFIX . $name;
return method_exists($this, $getter) || $checkVars && property_exists($this, $name);
} | php | {
"resource": ""
} |
q266636 | BaseObject.canSetProperty | test | public function canSetProperty($name, $checkVars = true)
{
$setter = static::_GETTER_PREFIX . $name;
return method_exists($this, $setter) || $checkVars && property_exists($this, $name);
} | php | {
"resource": ""
} |
q266637 | Container.getCacheFile | test | public function getCacheFile(callable $encoder = null): string
{
if (\is_null($encoder)) {
$encoder = function ($value): string {
return var_export($value, true);
};
}
$this->loadCacheParameters();
ksort($this->entries);
$encoded = $en... | php | {
"resource": ""
} |
q266638 | Container.loadCacheParameters | test | private function loadCacheParameters(): void
{
foreach ($this->entryCache as $id => $entry) {
$parameters = $entry->getCacheParameters();
if (!$this->isConstantValue($parameters)) {
throw new ContainerException("Unable to cache entry '$id', the cache parameters are n... | php | {
"resource": ""
} |
q266639 | Container.addEntry | test | public function addEntry(string $id, EntryInterface $type): void
{
if (isset($this[$id])) {
throw new ContainerException("Entry for identifier '$id' already exists");
}
$this->entryCache[$id] = $type;
} | php | {
"resource": ""
} |
q266640 | Container.get | test | public function get($id)
{
if (array_key_exists($id, $this->valueCache)) {
return $this->valueCache[$id];
}
$entry = $this->getEntry($id);
$value = $entry->getValue($this->delegate);
if ($entry->isFactory()) {
$this->entryCache[$id] = $entry;
... | php | {
"resource": ""
} |
q266641 | Container.getEntry | test | private function getEntry(string $id): EntryInterface
{
if (isset($this->entryCache[$id])) {
return $this->entryCache[$id];
}
if (!isset($this->entries[$id])) {
throw new NotFoundException("No entry was found for the identifier '$id'");
}
/** @var En... | php | {
"resource": ""
} |
q266642 | Container.has | test | public function has($id): bool
{
return isset($this->entries[$id]) || isset($this->entryCache[$id]);
} | php | {
"resource": ""
} |
q266643 | Container.offsetUnset | test | public function offsetUnset($offset): void
{
unset(
$this->entries[$offset],
$this->entryCache[$offset],
$this->valueCache[$offset]
);
} | php | {
"resource": ""
} |
q266644 | SiteAttribute.applySiteConditions | test | protected function applySiteConditions()
{
if ($this->siteId !== null) {
$this->andWhere(Db::parseParam('siteId', $this->siteId));
} else {
$this->andWhere(Db::parseParam('siteId', Craft::$app->getSites()->currentSite->id));
}
} | php | {
"resource": ""
} |
q266645 | AssignByKey.assign | test | function assign(array $keys, $value)
{
foreach ($keys as $key) {
$arr = &$this->array[$key];
}
$arr = $value;
return $this->array;
} | php | {
"resource": ""
} |
q266646 | PEAR_PackageFile._extractErrors | test | function _extractErrors($err = null)
{
static $errors = array();
if ($err === null) {
$e = $errors;
$errors = array();
return $e;
}
$errors[] = $err->getMessage();
} | php | {
"resource": ""
} |
q266647 | ZeroConfDriver.getModelsConfigFile | test | public function getModelsConfigFile()
{
$o = $this->params;
$file = $o['path'] . DIRECTORY_SEPARATOR . 'normalist_zeroconf_cache_' . $o['alias'] . '_' . $o['version'] . '.php';
return $file;
} | php | {
"resource": ""
} |
q266648 | ZeroConfDriver.getModelsDefinition | test | public function getModelsDefinition()
{
$file = $this->getModelsConfigFile();
if (!file_exists($file) || !is_readable($file)) {
throw new Exception\ModelFileNotFoundException(__METHOD__ . " Model configuration file '$file' does not exists or not readable");
}
if (defined... | php | {
"resource": ""
} |
q266649 | ZeroConfDriver.saveModelsDefinition | test | protected function saveModelsDefinition(array $models_definition)
{
$file = $this->getModelsConfigFile();
if (file_exists($file) && !is_writable($file)) {
throw new Exception\ModelFileNotWritableException(__METHOD__ . "Model configuration file '$file' cannot be overwritten, not writable.... | php | {
"resource": ""
} |
q266650 | ZeroConfDriver.getMetadata | test | public function getMetadata()
{
$cache_key = md5(serialize($this->params));
if (!array_key_exists($cache_key, self::$metadataCache)) {
if ($this->metadata === null) {
self::$metadataCache[$cache_key] = $this->getDefaultMetadata();
} else {
self... | php | {
"resource": ""
} |
q266651 | BankAbstract.setName | test | public function setName($name)
{
$name = (string) $name;
if ($this->exists() && $this->name !== $name) {
$this->updated['name'] = true;
}
$this->name = $name;
return $this;
} | php | {
"resource": ""
} |
q266652 | BankAbstract.setColor | test | public function setColor($color)
{
$color = (string) $color;
if ($this->exists() && $this->color !== $color) {
$this->updated['color'] = true;
}
$this->color = $color;
return $this;
} | php | {
"resource": ""
} |
q266653 | BankAbstract.setParser | test | public function setParser($parser)
{
$parser = (string) $parser;
if ($this->exists() && $this->parser !== $parser) {
$this->updated['parser'] = true;
}
$this->parser = $parser;
return $this;
} | php | {
"resource": ""
} |
q266654 | Aggregator.aggregate | test | public function aggregate($collection)
{
// Ensure the collection is materialized.
$collection = $this->mirror->materializeCollection($collection);
// Create aggregate collection to accumulate style sheets.
$aggregate = new StyleAggregate();
foreach ($collection as $resource... | php | {
"resource": ""
} |
q266655 | NoAPI.curl | test | public static function curl($url)
{
$req = curl_init();
$opt = [
CURLOPT_AUTOREFERER => true,
CURLOPT_COOKIEJAR => tempnam(sys_get_temp_dir(), 'curl'),
CURLOPT_FAILONERROR => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HEADER ... | php | {
"resource": ""
} |
q266656 | NoAPI.imageProxy | test | public static function imageProxy($url, $filename, $directory, $overwrite = null)
{
$allowedmimetype = [ 'image/gif', 'image/jpeg', 'image/png', 'image/x-icon' ];
$localpath = $directory . '/noapi_' . $filename;
if (! $overwrite && file_exists($localpath)) return $localpath;
$imag... | php | {
"resource": ""
} |
q266657 | Validator.createValidator | test | public static function createValidator($type, $model, $attributes, $params = [])
{
$params['attributes'] = $attributes;
if ($type instanceof \Closure || ($model->hasMethod($type) && !isset(static::$builtInValidators[$type]))) {
// method-based validator
$params['class'] = __... | php | {
"resource": ""
} |
q266658 | Validator.validateAttribute | test | public function validateAttribute($model, $attribute)
{
$result = $this->validateValue($model->$attribute);
if ($result instanceof ExtendedPromiseInterface) {
return $result->then(function($_result) use ($model, $attribute) {
if (!empty($_result)) {
$t... | php | {
"resource": ""
} |
q266659 | Validator.validate | test | public function validate($value, &$error = null)
{
$result = $this->validateValue($value);
if (empty($result)) {
return true;
}
list($message, $params) = $result;
$params['attribute'] = Reaction::t('rct', 'the input value');
if (is_array($value)) {
... | php | {
"resource": ""
} |
q266660 | App.run | test | public function run($namespace)
{
$this->namespace = $namespace;
$this->_initRegister();
date_default_timezone_set($this->config['timezone']);
if (false === IS_CLI) {
$this->route = Route::instance()->init();
$this->controller = Controller::create($this->rou... | php | {
"resource": ""
} |
q266661 | App.shutdown | test | public static function shutdown()
{
$error = error_get_last();
if ($error !== null) {
if (App::app()->config['debug'] == false) {
Log::log()->fatal('Fatal Error: ' .$error['message'] . ' in '. $error['file']. ' on '.$error['line']);
}
}
} | php | {
"resource": ""
} |
q266662 | App.url | test | public function url($controller, $action, $param)
{
$path = url();
if (empty($param)) {
// return PATH_APP_REL.'/'.$controller.'/'.$action;
return $path . '/' . $controller.'/'.$action;
} else {
// return PATH_APP_REL.'/'.$controller.'/'.$action.'?'.http_b... | php | {
"resource": ""
} |
q266663 | UrlHelper.canonical | test | public function canonical()
{
$routePath = $this->getCurrentPath(true);
if ($routePath === null) {
return null;
}
$params = $this->app->getRoute()->getRouteParams();
$params[0] = $routePath;
return $this->getUrlManager()->createAbsoluteUrl($params);
} | php | {
"resource": ""
} |
q266664 | UrlHelper.normalizeRoutePath | test | protected function normalizeRoutePath($routePath)
{
$routePath = Reaction::$app->getAlias((string) $routePath);
if (strncmp($routePath, '/', 1) === 0) {
// absolute route
return $routePath;
}
$route = $this->app->getRoute();
// relative route
... | php | {
"resource": ""
} |
q266665 | Application.isWorking | test | public function isWorking()
{
if (null != $this->exception) {
return false;
}
foreach ($this->getTests() as $test) {
if ($test->hasFailed()) {
$this->exception = new \Exception('Tests failed');
return false;
}
}
... | php | {
"resource": ""
} |
q266666 | ViewFinderTrait.getViewNames | test | public function getViewNames($schema = '', $refresh = false)
{
if (!isset($this->_viewNames[$schema]) || $refresh) {
return $this->findViewNames($schema)->then(
function($names) use($schema) {
$this->_viewNames[$schema] = $names;
return $na... | php | {
"resource": ""
} |
q266667 | Psr16Manager.get | test | public function get(string $key, $default = null)
{
$value = static::$handler->get($this->normalized($key));
// If we could not find the cache value, we will get
// the default value for this cache value. This default could be a callback
// so we will execute the value function which... | php | {
"resource": ""
} |
q266668 | Psr16Manager.set | test | public function set(string $key, $value, int $ttl = null)
{
$keyNormalized = $this->normalized($key);
$result = static::$handler->set($keyNormalized, $value, $ttl ?? $this->ttl);
if ($result) {
if ($this->assistant) {
$this->assistant->add($keyNormalized);
... | php | {
"resource": ""
} |
q266669 | Psr16Manager.setMultiple | test | public function setMultiple(array $values, int $ttl = null)
{
$valuesNormalized = [];
foreach ($values as $key => $value) {
$valuesNormalized[$this->normalized($key)] = $value;
}
$result = static::$handler->setMultiple(
$valuesNormalized,
$ttl ??... | php | {
"resource": ""
} |
q266670 | Psr16Manager.pull | test | public function pull(string $key, $default = null)
{
$result = $this->get($key, $default);
$this->delete($key);
return $result;
} | php | {
"resource": ""
} |
q266671 | Psr16Manager.add | test | public function add(string $key, $value, int $ttl = null)
{
// If the store has an "add" method we will call the method on the store so it
// has a chance to override this logic. Some drivers better support the way
// this operation should work with a total "atomic" implementation of it.
... | php | {
"resource": ""
} |
q266672 | Psr16Manager.remember | test | public function remember(string $key, \Closure $callback, $ttl = null)
{
$value = $this->get($key);
// If the item exists in the cache we will just return this immediately and if
// not we will execute the given Closure and cache the result of that for a
// given number of seconds so... | php | {
"resource": ""
} |
q266673 | Psr16Manager.delete | test | public function delete(string $key)
{
$keyNormalized = $this->normalized($key);
$result = static::$handler->delete($keyNormalized);
if ($result) {
if ($this->assistant) {
$this->assistant->remove($keyNormalized);
$this->assistant->save();
... | php | {
"resource": ""
} |
q266674 | Phone.filter | test | public function filter($str)
{
$str = preg_replace("|[\D+]|", "", $str);
if (strlen($str) == 11 && in_array(substr($str, 0, 1), array("7", "8"))) {
$str = substr($str, 1);
}
$len2 = strlen($str);
return $len2 == 10 ? $str : "";
} | php | {
"resource": ""
} |
q266675 | ConfigTrait.configDefaultOptions | test | protected function configDefaultOptions(Command $command)
{
$defaultConfPath = getcwd() . '/' . $this->confDir;
$command->addArgument('working-directory', InputOption::VALUE_REQUIRED, 'Working directory', getcwd());
$command
->addOption('app-type', null, InputOption::VALUE_REQUIR... | php | {
"resource": ""
} |
q266676 | ConfigTrait.optionOrConfigValue | test | protected function optionOrConfigValue(InputInterface $input, $config, $optionName, $configName = null)
{
$optionNameRaw = $this->normalizeConfigArrayPath($optionName);
if ($input->hasParameterOption('--' . $optionNameRaw)) {
return $this->getOptionWithTypeCast($input, $optionName);
... | php | {
"resource": ""
} |
q266677 | ConfigTrait.getOptionWithTypeCast | test | protected function getOptionWithTypeCast(InputInterface $input, $optionName)
{
$optionNameExp = explode(':', $optionName);
if (count($optionNameExp) > 1) {
$optionName = $optionNameExp[0];
$optionType = $optionNameExp[1];
}
$optionValue = $input->getOption($op... | php | {
"resource": ""
} |
q266678 | ConfigTrait.loadConfigFromFile | test | protected function loadConfigFromFile($path, $appType = StaticApplicationInterface::APP_TYPE_WEB)
{
if (!isset($this->_reader)) {
$reader = new ConfigReader([
'path' => $path,
'appType' => $appType,
]);
$this->_reader = $reader;
}
... | php | {
"resource": ""
} |
q266679 | ConfigTrait.loadConfig | test | protected function loadConfig(InputInterface $input, OutputInterface $output, $saveConfig = true)
{
$configsPath = $this->getConfigPath($input);
$appType = $input->getOption('app-type');
$config = $this->loadConfigFromFile($configsPath, $appType);
/**
* Array format
... | php | {
"resource": ""
} |
q266680 | ConfigTrait.renderConfig | test | protected function renderConfig(OutputInterface $output, array $config)
{
$table = new Table($output);
$rows = $this->renderConfigRows($config);
$table->addRows($rows);
$table->render();
} | php | {
"resource": ""
} |
q266681 | ConfigTrait.renderValue | test | private function renderValue($value)
{
$type = gettype($value);
$valueStr = null;
switch ($type) {
case 'object':
$valueStr = 'object(' . get_class($value) . ')';
break;
case 'array':
$valueStr = 'array(' . count($value)... | php | {
"resource": ""
} |
q266682 | ConfigTrait.normalizeConfigArrayPath | test | private function normalizeConfigArrayPath($configPath)
{
if (!strpos($configPath, ':')) {
return $configPath;
}
$configPathExp = explode(':', $configPath);
return reset($configPathExp);
} | php | {
"resource": ""
} |
q266683 | PEAR_PackageFile_v2_rw._setPackageVersion2_1 | test | function _setPackageVersion2_1()
{
$info = array(
'version' => '2.1',
'xmlns' => 'http://pear.php.net/dtd/package-2.1',
'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0',
'x... | php | {
"resource": ""
} |
q266684 | PEAR_PackageFile_v2_rw.clearContents | test | function clearContents($baseinstall = false)
{
$this->_filesValid = false;
$this->_isValid = 0;
if (!isset($this->_packageInfo['contents'])) {
$this->_packageInfo = $this->_insertBefore($this->_packageInfo,
array('compatible',
'dependencies', '... | php | {
"resource": ""
} |
q266685 | PEAR_PackageFile_v2_rw.clearDeps | test | function clearDeps()
{
if (!isset($this->_packageInfo['dependencies'])) {
$this->_packageInfo = $this->_mergeTag($this->_packageInfo, array(),
array(
'dependencies' => array('providesextension', 'usesrole', 'usestask',
'srcpackage', 'sr... | php | {
"resource": ""
} |
q266686 | PEAR_PackageFile_v2_rw.setPackageType | test | function setPackageType($type)
{
$this->_isValid = 0;
if (!in_array($type, array('php', 'extbin', 'extsrc', 'zendextsrc',
'zendextbin', 'bundle'))) {
return false;
}
if (in_array($type, array('zendextsrc', 'zendextbin'))) {
... | php | {
"resource": ""
} |
q266687 | PEAR_PackageFile_v2_rw.& | test | function &_getCurrentRelease($strict = true)
{
if ($p = $this->getPackageType()) {
if ($strict) {
if ($p == 'extsrc' || $p == 'zendextsrc') {
$a = null;
return $a;
}
}
if ($p != 'bundle') {
... | php | {
"resource": ""
} |
q266688 | PEAR_PackageFile_v2_rw.addInstallAs | test | function addInstallAs($path, $as)
{
$r = &$this->_getCurrentRelease();
if ($r === null) {
return false;
}
$this->_isValid = 0;
$r = $this->_mergeTag($r, array('attribs' => array('name' => $path, 'as' => $as)),
array(
'filelist' => array... | php | {
"resource": ""
} |
q266689 | PEAR_PackageFile_v2_rw.addIgnore | test | function addIgnore($path)
{
$r = &$this->_getCurrentRelease();
if ($r === null) {
return false;
}
$this->_isValid = 0;
$r = $this->_mergeTag($r, array('attribs' => array('name' => $path)),
array(
'filelist' => array(),
'... | php | {
"resource": ""
} |
q266690 | PEAR_PackageFile_v2_rw.addBinarypackage | test | function addBinarypackage($package)
{
if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {
return false;
}
$r = &$this->_getCurrentRelease(false);
if ($r === null) {
return false;
}
$this->_isValid = 0;
... | php | {
"resource": ""
} |
q266691 | PEAR_PackageFile_v2_rw.addConfigureOption | test | function addConfigureOption($name, $prompt, $default = null)
{
if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {
return false;
}
$r = &$this->_getCurrentRelease(false);
if ($r === null) {
return false;
}
$o... | php | {
"resource": ""
} |
q266692 | PEAR_PackageFile_v2_rw.setPhpInstallCondition | test | function setPhpInstallCondition($min, $max, $exclude = false)
{
$r = &$this->_getCurrentRelease();
if ($r === null) {
return false;
}
$this->_isValid = 0;
if (isset($r['installconditions']['php'])) {
unset($r['installconditions']['php']);
}
... | php | {
"resource": ""
} |
q266693 | PEAR_PackageFile_v2_rw.setOsInstallCondition | test | function setOsInstallCondition($name, $conflicts = false)
{
$r = &$this->_getCurrentRelease();
if ($r === null) {
return false;
}
$this->_isValid = 0;
if (isset($r['installconditions']['os'])) {
unset($r['installconditions']['os']);
}
$... | php | {
"resource": ""
} |
q266694 | PEAR_PackageFile_v2_rw.setArchInstallCondition | test | function setArchInstallCondition($pattern, $conflicts = false)
{
$r = &$this->_getCurrentRelease();
if ($r === null) {
return false;
}
$this->_isValid = 0;
if (isset($r['installconditions']['arch'])) {
unset($r['installconditions']['arch']);
}
... | php | {
"resource": ""
} |
q266695 | PEAR_PackageFile_v2_rw.generateChangeLogEntry | test | function generateChangeLogEntry($notes = false)
{
return array(
'version' =>
array(
'release' => $this->getVersion('release'),
'api' => $this->getVersion('api'),
),
'stability' =>
$this->getSt... | php | {
"resource": ""
} |
q266696 | VideoModel.isVideo | test | public function isVideo()
{
return $this->pathExists() && $this->exists() &&
in_array(strtolower(end(explode('.', $this->filename))), self::$allowed_extensions);
} | php | {
"resource": ""
} |
q266697 | VideoModel.getVideoInfos | test | public function getVideoInfos()
{
if (!$this->exists()) return false;
$data = finfo_file($this->getPath().$this->filename);
return $data;
} | php | {
"resource": ""
} |
q266698 | TransactionAbstract.setDate | test | public function setDate($date)
{
$date = (string) $date;
if ($this->exists() && $this->date !== $date) {
$this->updated['date'] = true;
}
$this->date = $date;
return $this;
} | php | {
"resource": ""
} |
q266699 | TransactionAbstract.setAmount | test | public function setAmount($amount)
{
$amount = (float) $amount;
if ($this->exists() && $this->amount !== $amount) {
$this->updated['amount'] = true;
}
$this->amount = $amount;
return $this;
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.