_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q267000
Kernel.shutdown
test
public function shutdown(&$arg = null, $callback = null) { if ($this->getDebug() && false===$this->is_shutdown) { return \DevDebug\Debugger::shutdown(true, $callback); } }
php
{ "resource": "" }
q267001
Kernel.handles
test
public function handles(Request $request) { if (!$this->is_booted) { $this->boot(); } $this->getContainer()->set('request', $request); $this->getContainer()->get('router')->setUrl($request->buildUrl()); $mode_data = $this->getMode(true); if (isset($mode_da...
php
{ "resource": "" }
q267002
Kernel.distribute
test
public function distribute() { if (!$this->is_booted) { $this->boot(); } $req = $this->getContainer()->get('request'); if (empty($req)) { $this->handles(new Request); } return $this->getContainer()->get('front_controller') ->dis...
php
{ "resource": "" }
q267003
Kernel.initBundle
test
public function initBundle($space, $dir) { $bundle = new \CarteBlanche\App\Bundle($space, $dir); return $this->getContainer()->setBundle($space, $bundle); }
php
{ "resource": "" }
q267004
Kernel.addBootError
test
public function addBootError($string) { $this->boot_errors[] = $string; if ($this->getMode()==='dev') { die( sprintf("[boot error] : %s", $string) ); } return $this; }
php
{ "resource": "" }
q267005
Kernel.initConstantPath
test
public function initConstantPath($cst, $path_ref, $must_exists = false, $must_be_writable = false) { if (defined($cst)) { $this->addPath($path_ref, constant($cst), $must_exists, $must_be_writable); } else { throw new ErrorException( sprintf('Missing constant p...
php
{ "resource": "" }
q267006
Kernel.addPath
test
public function addPath($name, $value, $must_exists = false, $must_be_writable = false) { $config = $this->getContainer()->get('config'); if ($must_exists) { $realpath = $this->getAbsolutePath($value); if (!empty($realpath)) { $value = $realpath; }...
php
{ "resource": "" }
q267007
Kernel.getPath
test
public function getPath($name, $full_path = false) { $config = $this->getContainer()->get('config'); $path = $config->getRegistry()->getStackEntry($name, null, 'paths'); if (file_exists($path) && is_dir($path)) { $path = DirectoryHelper::slashDirname($path); } if ...
php
{ "resource": "" }
q267008
Kernel.getAbsolutePath
test
public function getAbsolutePath($path) { $root = $this->getPath('root_path'); if (empty($root)) { return null; } if (empty($path)) { return $root; } if (0===substr_count($path, $root)) { $path = DirectoryHelper::slashDirname($root)....
php
{ "resource": "" }
q267009
Kernel.whoAmI
test
public function whoAmI() { $cmd = new \Library\Command; $whoami = $cmd->run('whoami'); return !empty($whoami[0]) ? $whoami[0] : null; }
php
{ "resource": "" }
q267010
Kernel.__setMode
test
private function __setMode($mode = 'dev') { $config = $this->getContainer()->get('config'); $mode_data = $config->get('carte_blanche.modes', array(), 'app'); if (array_key_exists($mode, $mode_data)) { $this->mode = strtolower($mode); } else { $this->mode = is...
php
{ "resource": "" }
q267011
Kernel.__loadDefaultConfig
test
private function __loadDefaultConfig() { $app_cfgfile = __DIR__.'/../../../config/'.self::CARTE_BLANCHE_CONFIG_FILE; if (!file_exists($app_cfgfile)) { throw new ErrorException( sprintf('Default application configuration file not found in "%s" [%s]!', $this->getPath('conf...
php
{ "resource": "" }
q267012
AssetManager.init
test
public function init() { parent::init(); $this->basePath = Reaction::$app->getAlias($this->basePath); if (!is_dir($this->basePath)) { throw new InvalidConfigException("The directory does not exist: {$this->basePath}"); } elseif (!is_writable($this->basePath)) { ...
php
{ "resource": "" }
q267013
AssetManager.loadBundle
test
protected function loadBundle($name, $config = [], $publish = true) { if (!isset($config['class'])) { $config['class'] = $name; } /* @var $bundle AssetBundle */ $bundle = Reaction::create($config); if ($publish) { $bundle->publish($this); } ...
php
{ "resource": "" }
q267014
AssetManager.getConverter
test
public function getConverter() { if ($this->_converter === null) { $this->_converter = Reaction::create(AssetConverter::class); } elseif (is_array($this->_converter) || is_string($this->_converter)) { if (is_array($this->_converter) && !isset($this->_converter['class'])) { ...
php
{ "resource": "" }
q267015
AssetManager.hash
test
protected function hash($path) { if (is_callable($this->hashCallback)) { return call_user_func($this->hashCallback, $path); } $path = (is_file($path) ? dirname($path) : $path) . filemtime($path); return sprintf('%x', crc32($path . Reaction::getVersion() . '|' . $this->lin...
php
{ "resource": "" }
q267016
AbstractMail.addReplytos
test
public function addReplytos(array $reply_tos) { foreach ($reply_tos as $key => $val) { if (is_numeric($key)) { $this->addReplyto($val); } else { $this->addReplyto($key, $val); } } }
php
{ "resource": "" }
q267017
liteAuth.newUser
test
public function newUser($user, $pass, $email = '', $fname = '', $sname = '' , $admin = False){ $hash = password_hash($pass, PASSWORD_BCRYPT); return $this->db->insert($this->prefix.'users', ['user' => $user, 'pass' => $hash, 'admin' => $admin, 'email' => $email, 'first_name' => $fname, 'surname' => $sna...
php
{ "resource": "" }
q267018
liteAuth.resumeSession
test
public function resumeSession($authtoken) { if( $id = $this->db->get($this->prefix.'authtokens', 'user_id', ['token'=>$authtoken]) ) $this->user = new User($this, $id); else return False; }
php
{ "resource": "" }
q267019
PokeCalculator.calculate
test
public function calculate($expression) { $translatedExpression = $this->translate($expression); $result = eval('return '.$translatedExpression.';'); $decimalResult = new Number($result); // this is bad and needs some work return $decimalResult->convert($this->numberSystem); }
php
{ "resource": "" }
q267020
Ifsta.urlUserDetails
test
public function urlUserDetails(\League\OAuth2\Client\Token\AccessToken $token) { return $this->domain . '/api/userinfo?access_token=' . $token; }
php
{ "resource": "" }
q267021
Mapper.raw
test
public function raw($sql, array $values = [], $class = null) { return $this->execute($sql, $values, function(\PDOStatement $statement) use($class) { if($statement->columnCount() > 0) { return $class ? $statement->fetchAll(\PDO::FETCH_CLASS | \PDO::FETC...
php
{ "resource": "" }
q267022
Html.csrfMetaTags
test
public static function csrfMetaTags(RequestApplicationInterface $app) { $encoding = $app->charset; if ($app->reqHelper->enableCsrfValidation) { return static::tag('meta', '', ['name' => 'csrf-param', 'content' => $app->reqHelper->csrfParam], $encoding) . "\n " . static...
php
{ "resource": "" }
q267023
Html.label
test
public static function label($content, $for = null, $options = [], $encoding = null) { $options['for'] = $for; return static::tag('label', $content, $options, $encoding); }
php
{ "resource": "" }
q267024
Html.button
test
public static function button($content = 'Button', $options = [], $encoding = null) { if (!isset($options['type'])) { $options['type'] = 'button'; } return static::tag('button', $content, $options, $encoding); }
php
{ "resource": "" }
q267025
Html.submitButton
test
public static function submitButton($content = 'Submit', $options = [], $encoding = null) { $options['type'] = 'submit'; return static::button($content, $options, $encoding); }
php
{ "resource": "" }
q267026
Html.submitInput
test
public static function submitInput($label = 'Submit', $options = [], $encoding = null) { $options['type'] = 'submit'; $options['value'] = $label; return static::tag('input', '', $options, $encoding); }
php
{ "resource": "" }
q267027
Html.resetInput
test
public static function resetInput($label = 'Reset', $options = [], $encoding = null) { $options['type'] = 'reset'; $options['value'] = $label; return static::tag('input', '', $options, $encoding); }
php
{ "resource": "" }
q267028
Html.hiddenInput
test
public static function hiddenInput($name, $value = null, $options = [], $encoding = null) { return static::input('hidden', $name, $value, $options, $encoding); }
php
{ "resource": "" }
q267029
Html.passwordInput
test
public static function passwordInput($name, $value = null, $options = [], $encoding = null) { return static::input('password', $name, $value, $options, $encoding); }
php
{ "resource": "" }
q267030
Html.processBooleanInputOptions
test
protected static function processBooleanInputOptions($name, &$options) { if(isset($options['label'])) { $options['labelOptions'] = isset($options['labelOptions']) ? $options['labelOptions'] : []; Html::addCssClass($options['labelOptions'], ['widget' => 'form-check-label']); } ...
php
{ "resource": "" }
q267031
Time.setHours
test
public function setHours(int $hours): void { $this->timeElementsAreValid($hours, $this->minutes, $this->seconds); $this->hours = $hours; }
php
{ "resource": "" }
q267032
Time.setMinutes
test
public function setMinutes(int $minutes): void { $this->timeElementsAreValid($this->hours, $minutes, $this->seconds); $this->minutes = $minutes; }
php
{ "resource": "" }
q267033
Time.setSeconds
test
public function setSeconds(int $seconds): void { $this->timeElementsAreValid($this->hours, $this->minutes, $seconds); $this->seconds = $seconds; }
php
{ "resource": "" }
q267034
Time.timeElementsAreValid
test
private function timeElementsAreValid($hours, $minutes, $seconds): bool { $exception = new \InvalidArgumentException( \sprintf('Invalid time "%02d:%02d:%02d".', $hours, $minutes, $seconds) ); if ((int)\sprintf('%d%02d%02d', $hours, $minutes, $seconds) > 240000) { thr...
php
{ "resource": "" }
q267035
FlyFilesystem.write
test
public function write(string $path, string $contents): bool { return $this->flySystem->write($path, $contents); }
php
{ "resource": "" }
q267036
FlyFilesystem.writeStream
test
public function writeStream(string $path, $resource): bool { return $this->flySystem->writeStream($path, $resource); }
php
{ "resource": "" }
q267037
FlyFilesystem.update
test
public function update(string $path, string $contents): bool { return $this->flySystem->update($path, $contents); }
php
{ "resource": "" }
q267038
FlyFilesystem.updateStream
test
public function updateStream(string $path, $resource): bool { return $this->flySystem->updateStream($path, $resource); }
php
{ "resource": "" }
q267039
FlyFilesystem.put
test
public function put(string $path, string $contents): bool { return $this->flySystem->put($path, $contents); }
php
{ "resource": "" }
q267040
FlyFilesystem.putStream
test
public function putStream(string $path, $resource): bool { return $this->flySystem->putStream($path, $resource); }
php
{ "resource": "" }
q267041
FlyFilesystem.rename
test
public function rename(string $path, string $newPath): bool { return $this->flySystem->rename($path, $newPath); }
php
{ "resource": "" }
q267042
FlyFilesystem.copy
test
public function copy(string $path, string $newPath): bool { return $this->flySystem->copy($path, $newPath); }
php
{ "resource": "" }
q267043
FlyFilesystem.metadata
test
public function metadata(string $path): ? array { $metadata = $this->flySystem->getMetadata($path); return false !== $metadata ? $metadata : null; }
php
{ "resource": "" }
q267044
FlyFilesystem.mimetype
test
public function mimetype(string $path): ? string { $mimetype = $this->flySystem->getMimetype($path); return false !== $mimetype ? $mimetype : null; }
php
{ "resource": "" }
q267045
FlyFilesystem.size
test
public function size(string $path): ? int { $size = $this->flySystem->getSize($path); return false !== $size ? $size : null; }
php
{ "resource": "" }
q267046
FlyFilesystem.timestamp
test
public function timestamp(string $path): ? int { $timestamp = $this->flySystem->getTimestamp($path); return false !== $timestamp ? $timestamp : null; }
php
{ "resource": "" }
q267047
FlyFilesystem.visibility
test
public function visibility(string $path): ? string { $visibility = $this->flySystem->getVisibility($path); return false !== $visibility ? $visibility : null; }
php
{ "resource": "" }
q267048
FlyFilesystem.setVisibility
test
public function setVisibility(string $path, Visibility $visibility): bool { return $this->flySystem->setVisibility($path, $visibility->getValue()); }
php
{ "resource": "" }
q267049
FlyFilesystem.setVisibilityPublic
test
public function setVisibilityPublic(string $path): bool { return $this->flySystem->setVisibility($path, Visibility::PUBLIC); }
php
{ "resource": "" }
q267050
FlyFilesystem.setVisibilityPrivate
test
public function setVisibilityPrivate(string $path): bool { return $this->flySystem->setVisibility($path, Visibility::PRIVATE); }
php
{ "resource": "" }
q267051
FlyFilesystem.listContents
test
public function listContents(string $directory = null, bool $recursive = false): array { return $this->flySystem->listContents($directory ?? '', $recursive); }
php
{ "resource": "" }
q267052
FlyFilesystem.localAdapter
test
protected function localAdapter(): Local { return self::$adapters['local'] ?? self::$adapters['local'] = new Local( $this->app->config()['filesystem']['adapters']['s3']['dir'] ); }
php
{ "resource": "" }
q267053
FlyFilesystem.s3Adapter
test
protected function s3Adapter(): AwsS3Adapter { if (isset(self::$adapters['s3'])) { return self::$adapters['s3']; } $config = $this->app->config()['filesystem']['adapters']['s3']; $clientConfig = [ 'credentials' => [ 'key' => $config['...
php
{ "resource": "" }
q267054
UrlManager.processRequest
test
protected function processRequest() { if (!Reaction::$app->getI18n()->detectLanguageByUrl) { return; } $langPrefixes = Reaction::$app->getI18n()->languagePrefixes; $rawUrl = trim($this->app->reqHelper->getPathInfo(), '/'); $requestPrefix = ''; $rawUrlParts...
php
{ "resource": "" }
q267055
JmsSerializerContentNegotiation.deserializeRequest
test
public function deserializeRequest($className) { $request = $this->app["request_stack"]->getCurrentRequest(); return $this->app["serializer"]->deserialize( $request->getContent(), $className, $request->getContentType(), $this->app["conneg.deserializat...
php
{ "resource": "" }
q267056
Model.checkAccess
test
private static function checkAccess($object,$errorMessage){ if(is_string($object)){ $className = $object; $object = null; }else{ $className = get_class($object); } if(TransactionManager::isSuperUser()){ return true; } $hasAccess = fals...
php
{ "resource": "" }
q267057
DocBlock.parseBlock
test
protected function parseBlock($block) { $lines = array_filter(array_map(function($line) { $line = trim($line); if (strpos($line, "/**") !== false or strpos($line, "*/") !== false) { return null; } return trim(substr($line, 1)); ...
php
{ "resource": "" }
q267058
Directory.path
test
public static function path(string $path = null): ? string { return $path && $path[0] !== static::DIRECTORY_SEPARATOR ? static::DIRECTORY_SEPARATOR . $path : $path; }
php
{ "resource": "" }
q267059
AbstractApi.getAuthenticationObject
test
protected function getAuthenticationObject() { if ($this->authObject == null) { if (strlen($this->login) <= 0 || strlen($this->password) <= 0) { throw new NullPointerException("Login or Password is not set."); } $auth = new Authentication(); if...
php
{ "resource": "" }
q267060
AbstractApi.getDataFromUrl
test
protected function getDataFromUrl($url) { $auth = $this->getAuthenticationObject(); $process = curl_init($url); curl_setopt($process, CURLOPT_HEADER, 0); // setting the authentication header curl_setopt($process, CURLOPT_HTTPHEADER, array( "Authorization:...
php
{ "resource": "" }
q267061
AbstractApi.parseJsonData
test
protected function parseJsonData($data) { if ($data != FALSE) { // check, if raw answer is requestedd if ($this->getRawAnswer()) { return $data; } $json_data = json_decode($data, TRUE); if (isset($json_data["errors"])) ...
php
{ "resource": "" }
q267062
AbstractApi.getAll
test
public function getAll() { // build url $url = $this->base_url . $this->url; // get data from server $data = $this->getDataFromUrl($url); // parse result set and get data as array $result = $this->parseJsonData($data); return $result; }
php
{ "resource": "" }
q267063
EntityRepositoryTrait.getEntityAlias
test
public function getEntityAlias() { if (!$this->entityAlias) { $className = $this->getClassName(); $reflectionCLass = new ReflectionClass($className); if (is_string($reflectionCLass->getConstant('ALIAS_NAME'))) { $entityAlias = $reflectionCLass->getC...
php
{ "resource": "" }
q267064
EntityRepositoryTrait.createQueryBuilder
test
public function createQueryBuilder($alias = null, $indexBy = null) { return $this->createNewQueryBuilderInstance()->selectFromRepositoryEntity($alias, $indexBy); }
php
{ "resource": "" }
q267065
EntityRepositoryTrait.createResultSetMappingBuilder
test
public function createResultSetMappingBuilder($alias = null) { if (!$alias) { $alias = $this->getEntityAlias(); } $resultSet = new ResultSetMappingBuilder( $this->getEntityManager(), ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT ); $resultSet->ad...
php
{ "resource": "" }
q267066
EntityRepositoryTrait.findAllIdentifiers
test
public function findAllIdentifiers() { $metadata = $this->getClassMetadata(); $identifiers = $metadata->getIdentifier(); $qb = $this->createQueryBuilder(); foreach ($identifiers as $field) { $qb->select($qb->alias($field)); } return $qb->fetc...
php
{ "resource": "" }
q267067
EntityRepositoryTrait.min
test
public function min($column) { $qb = $this->createQueryBuilder(); $qb->select(sprintf('MIN(%s) AS min_%s', $qb->alias($column), $column)); return $qb->fetchSingleScalar(); }
php
{ "resource": "" }
q267068
EntityRepositoryTrait.paginate
test
public function paginate($page = 1, $perPage = null) { $perPage = $perPage ?: $this->getMaxResults(); $qb = $this->createQueryBuilder(); $qb->paginate($page, $perPage); return $this->getPaginator($qb); }
php
{ "resource": "" }
q267069
EntityRepositoryTrait.isEntity
test
public function isEntity($entity) { return is_object($entity) && !$this->getEntityManager()->getMetadataFactory()->isTransient(ClassUtils::getClass($entity)); }
php
{ "resource": "" }
q267070
EntityRepositoryTrait.getIdentifier
test
protected function getIdentifier($entity, $single = false) { $this->validateEntity($entity, __METHOD__); $entityClass = ClassUtils::getClass($entity); $entityManager = $this->getEntityManager(); $metadata = $entityManager->getClassMetadata($entityClass); $metadata->v...
php
{ "resource": "" }
q267071
EntityRepositoryTrait.validateEntity
test
protected function validateEntity($entity, $method) { if (!$this->isEntity($entity)) { throw new Exception\InvalidArgumentException( sprintf( '%s expects parameter 1 to be a valid entity instance, %s provided instead', $method, is_object($e...
php
{ "resource": "" }
q267072
EntityRepositoryTrait.toArray
test
public function toArray($entity) { $entityManager = $this->getEntityManager(); $unitOfWork = $entityManager->getUnitOfWork(); $classMetadata = $this->getClassMetadata(); $result = []; foreach ($unitOfWork->getOriginalEntityData($entity) as $field => $value) { ...
php
{ "resource": "" }
q267073
FileValidator.filterFiles
test
private function filterFiles(array $files) { $result = []; //\React\Http\Io\UploadedFile::class; foreach ($files as $fileName => $file) { if ($file instanceof UploadedFile && $file->error !== UPLOAD_ERR_NO_FILE) { $result[$fileName] = $file; } ...
php
{ "resource": "" }
q267074
FileValidator.getSizeLimit
test
public function getSizeLimit() { // Get the lowest between post_max_size and upload_max_filesize, log a warning if the first is < than the latter $limit = $this->sizeToBytes(ini_get('upload_max_filesize')); $postLimit = $this->sizeToBytes(ini_get('post_max_size')); if ($postLimit > 0...
php
{ "resource": "" }
q267075
BagTrait.has
test
public function has($key) { return (isset($this->bag[$key]) || array_key_exists($key, $this->bag)); }
php
{ "resource": "" }
q267076
NativeKernel.handle
test
public function handle(Input $input, Output $output): int { $exitCode = 1; try { $exitCode = $this->console->dispatch($input, $output); } catch (Throwable $exception) { // Show the exception // TODO: Implement dd($exception); } ...
php
{ "resource": "" }
q267077
NativeKernel.terminate
test
public function terminate(Input $input, int $exitCode): void { $this->app->events()->trigger( ConsoleKernelTerminate::class, [new ConsoleKernelTerminate($input, $exitCode)] ); }
php
{ "resource": "" }
q267078
CategoryComponent.accountCategories
test
public function accountCategories(Account $account) { $this->dataCollection->add('account', $account); $categoryMapper = new CategoryMapper(Database::get('money')); $categories = $categoryMapper->findAllByAccountId($account->getId()); $this->dataCollection->add('categories', $c...
php
{ "resource": "" }
q267079
WebApp.run
test
public function run() { try { $this->init(); $this->executeController(); } catch (\Exception $e) { $this->logger->addCritical('Exception caught', array('exception' => $e)); $this->response->setHttpResponseCode(500); } }
php
{ "resource": "" }
q267080
WebApp.init
test
private function init() { $timeZone = $this->appConfig->getTimeZone(); if (!empty($timeZone)) { $this->timeZone->setDefaultTimeZone($timeZone); } }
php
{ "resource": "" }
q267081
ThrowPromise.execute
test
public function execute(array $args, FunctionProphecy $function) { if (is_string($this->exception)) { $classname = $this->exception; $reflection = new ReflectionClass($classname); $constructor = $reflection->getConstructor(); if ($constructor->isPublic() && 0...
php
{ "resource": "" }
q267082
Field.toArray
test
public function toArray() { return [ 'name' => $this->name, 'title' => $this->title, 'type' => $this->type, 'value' => $this->value, 'attributes' => $this->getAttributesData(), ]; }
php
{ "resource": "" }
q267083
DbManager.init
test
public function init() { parent::init(); $this->db = Instance::ensure($this->db, DatabaseInterface::class); if ($this->cache !== null) { $this->cache = Instance::ensure($this->cache, CacheInterface::class); } }
php
{ "resource": "" }
q267084
DbManager.getChildrenList
test
protected function getChildrenList() { return (new Query())->from($this->itemChildTable) ->all($this->db) ->then( function($rows) { $parents = []; foreach ($rows as $row) { $parents[$row['parent']][] = $r...
php
{ "resource": "" }
q267085
DbManager.detectLoop
test
protected function detectLoop($parent, $child) { if ($child->name === $parent->name) { return reject(true); } return $this->getChildren($child->name) ->then(function($children) use ($parent) { $promises = []; foreach ($children as $gra...
php
{ "resource": "" }
q267086
DbManager.invalidateCache
test
public function invalidateCache() { $this->_checkAccessAssignments = []; if ($this->cache !== null) { $this->items = null; $this->rules = null; $this->parents = null; return $this->cache->delete($this->cacheKey) ->then(function() { ...
php
{ "resource": "" }
q267087
DoctrineMigrationRepository.getLastBatchNumber
test
public function getLastBatchNumber() { $result = $this->getEntities()->createQueryBuilder() ->select('o, MAX(o.batch) as max_batch') ->from('Mitch\LaravelDoctrine\Migrations\Migration', 'o') ->getQuery()->getResult()[0]['max_batch']; return $result ?: 0; }
php
{ "resource": "" }
q267088
Response.html
test
public static function html($content = null, $code = 200, array $headers = []) { return new Response\Html($content, $code , $headers); }
php
{ "resource": "" }
q267089
Response.json
test
public static function json($content = null, $code = 200, array $headers = []) { return new Response\Json($content, $code , $headers); }
php
{ "resource": "" }
q267090
Response.template
test
public static function template($template, array $vars = [], $code = 200, array $headers = []) { return new Response\Template($template, $vars, $code , $headers); }
php
{ "resource": "" }
q267091
ControllerService.others
test
protected static function others(FileManager $fileManager, array &$parameters) { if (in_array( static::explain($parameters, 'Do you want to create Model layer?', '[y/n]'), static::POSITIVES) ) { $fileManager->execute('model'); } if (in_array( ...
php
{ "resource": "" }
q267092
Zend_Filter_Compress.getAdapter
test
public function getAdapter() { if ($this->_adapter instanceof Zend_Filter_Compress_CompressInterface) { return $this->_adapter; } $adapter = $this->_adapter; $options = $this->getAdapterOptions(); if (!class_exists($adapter)) { if (Zend_Loader::isRea...
php
{ "resource": "" }
q267093
Zend_Filter_Compress.setAdapter
test
public function setAdapter($adapter) { if ($adapter instanceof Zend_Filter_Compress_CompressInterface) { $this->_adapter = $adapter; return $this; } if (!is_string($adapter)) { throw new Zend_Filter_Exception('Invalid adapter provided; must be string or i...
php
{ "resource": "" }
q267094
AbstractRoutes.setPrefix
test
private static function setPrefix(array $config) { if(array_key_exists('prefix', $config)) { static::$prefix = $config['prefix']; } // Route group prefix must be set or defined. if(is_null(static::$prefix)) { throw new Exception(__CLASS__ . ': $prefix can not be null.'); } }
php
{ "resource": "" }
q267095
Request.getValue
test
private function getValue($name) { if (!$this->serverAccessor->contains($name)) { return null; } return $this->serverAccessor->getValue($name); }
php
{ "resource": "" }
q267096
DefaultController.indexAction
test
public function indexAction($offset = 0, $limit = 5, $table = null, $show = null) { return array(self::$views_dir.'hello', array( 'altdb'=>$this->getContainer()->get('request')->getUrlArg('altdb'), 'title' => $this->trans("Hello"), )); }
php
{ "resource": "" }
q267097
DefaultController.installAction
test
public function installAction() { $_altdb = $this->getContainer()->get('request')->getUrlArg('altdb'); $SQLITE = $this->getContainer()->get('database'); $tables = \CarteBlanche\Library\AutoObject\AutoObjectMapper::getObjectsStructure( $_altdb ); if (!empty($tables)) { $in...
php
{ "resource": "" }
q267098
DefaultController.bootErrorAction
test
public function bootErrorAction(array $errors = null) { $session = $this->getContainer()->get('session'); $original_errors = $session->has('boot_errors') ? $session->get('boot_errors') : $errors; $running_user = $this->getKernel()->whoAmI(); return array(self::$views_dir.'errors', a...
php
{ "resource": "" }
q267099
VarDumper.getSerializer
test
private static function getSerializer() { if (!isset(static::$_serializer)) { $superClosure = new \SuperClosure\Serializer(); static::$_serializer = new \Zumba\JsonSerializer\JsonSerializer($superClosure); } return static::$_serializer; }
php
{ "resource": "" }