_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q264900 | BizDataObj_Lite._run_search | test | protected function _run_search($limit = null)
{
// get database connection
$db = $this->getDBConnection("READ");
$querySQL = $this->getSQLHelper()->buildQuerySQL($this);
$this->_fetch4countQuery = $querySQL;
if ($limit && count($limit) > 0 && $limit['count'] > 0) {
... | php | {
"resource": ""
} |
q264901 | BizDataObj_Lite._getNumberRecords | test | private function _getNumberRecords($db, $sql)
{
$has_subquery = false;
if (preg_match("/\(\s*?SELECT\s*?.+\)/si", $sql)) {
$has_subquery = true;
}
if (preg_match("/^\s*SELECT\s+DISTINCT/is", $sql) || preg_match('/\s+GROUP\s+BY\s+/is', $sql)) {
// ok, has SELEC... | php | {
"resource": ""
} |
q264902 | BizDataObj_Lite._fetch_record | test | protected function _fetch_record(&$resultSet)
{
if (!is_array($resultSet)) {
return null;
}
$sqlArr = current($resultSet);
if ($sqlArr) {
$this->currentRecord = $this->bizRecord->convertSqlArrToRecArr($sqlArr);
$this->currentRecord = $this->bizReco... | php | {
"resource": ""
} |
q264903 | InputElement.addSCKeyScript | test | protected function addSCKeyScript()
{
$keyMap = $this->getSCKeyFuncMap();
if (count($keyMap) == 0) {
return "";
}
Openbizx::$app->getClientProxy()->appendScripts("shortcut", "shortcut.js");
$str = "<script>\n";
$formObj = $this->getFormObj();
if (... | php | {
"resource": ""
} |
q264904 | Application.config | test | public function config(string $key, $default = null)
{
return $this->container->get(Config::class)->get($key, $default);
} | php | {
"resource": ""
} |
q264905 | Application.bootstrap | test | public function bootstrap(): void
{
foreach( $this->config('bootstrap', []) as $file ){
$bootstrap = require_once(path($file));
$bootstrap($this);
}
} | php | {
"resource": ""
} |
q264906 | authService.authDBUser | test | protected function authDBUser($userName, $password)
{
$boAuth = Openbizx::getObject($this->authticationDataObj);
if (!$boAuth)
return false;
$searchRule = "[login]='$userName'";
$recordList = array();
$boAuth->fetchRecords($searchRule, $recordList, 1);
$e... | php | {
"resource": ""
} |
q264907 | FileWrapper.setRequest | test | protected function setRequest($request): void
{
if (is_null($this->path)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
}
if (! is_null($request)) {
if (! is_string($request)) {
throw \AWonderPHP\FileWrapper\TypeErrorEx... | php | {
"resource": ""
} |
q264908 | FileWrapper.setMaxAge | test | protected function setMaxAge($maxage): void
{
$now = time();
if (is_int($maxage)) {
if ($maxage > $now) {
$this->maxage = $maxage - $now;
return;
}
if ($maxage >= 0) {
$this->maxage = $maxage;
return;... | php | {
"resource": ""
} |
q264909 | FileWrapper.mimeTypoFix | test | protected function mimeTypoFix($input): string
{
if (is_null($this->path)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
}
$input = trim($input);
$mime = $input;
switch ($input) {
case 'application/font-woff':
... | php | {
"resource": ""
} |
q264910 | FileWrapper.validMimeType | test | protected function validMimeType($input): void
{
if (is_null($this->path)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
}
if (! is_null($input)) {
if (! is_string($input)) {
throw \AWonderPHP\FileWrapper\TypeErrorExcep... | php | {
"resource": ""
} |
q264911 | FileWrapper.textCheck | test | protected function textCheck(): void
{
if (is_null($this->mime)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('mime');
}
$test = substr($this->mime, 0, 5);
if ($test === 'text/') {
$this->istext = true;
return;
}
... | php | {
"resource": ""
} |
q264912 | FileWrapper.checkFullFile | test | protected function checkFullFile(): void
{
if (is_null($this->filesize)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('filesize');
}
$this->end = $this->filesize - 1;
$this->total = $this->filesize;
if ($this->istext) {
return;... | php | {
"resource": ""
} |
q264913 | FileWrapper.setFileProperties | test | protected function setFileProperties(): void
{
if (is_null($this->path)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
}
date_default_timezone_set('UTC');
$this->filesize = filesize($this->path);
$this->timestamp = filemtime($this-... | php | {
"resource": ""
} |
q264914 | FileWrapper.cacheCheck | test | protected function cacheCheck()
{
if (is_null($this->etag)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('etag');
}
if (isset($this->REQHEADERS['if-none-match'])) {
$reqETAG=trim($this->REQHEADERS['if-none-match'], '\'"');
if (strc... | php | {
"resource": ""
} |
q264915 | FileWrapper.readFromFilesystem | test | protected function readFromFilesystem(): void
{
if (is_null($this->path)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
}
$chunk = $this->chunksize;
$sent = 0;
$fp = fopen($this->path, 'rb');
fseek($fp, $this->start);
... | php | {
"resource": ""
} |
q264916 | FileWrapper.sendContent | test | protected function sendContent(): bool
{
if (is_null($this->path)) {
$this->sendInternalError();
return false;
}
if (is_null($this->request)) {
$this->sendInternalError();
return false;
}
if (is_null($this->etag)) {
... | php | {
"resource": ""
} |
q264917 | FileWrapper.cleanSource | test | protected function cleanSource($content): string
{
if (is_null($this->path)) {
throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('path');
}
//nuke BOM when we definitely have UTF8
$bom = pack('H*', 'EFBBBF');
//DOS to UNIX
$content = str_... | php | {
"resource": ""
} |
q264918 | FileWrapper.jsminify | test | protected function jsminify($content): string
{
$JSqueeze = new \Patchwork\JSqueeze();
return($JSqueeze->squeeze($content, true, false));
} | php | {
"resource": ""
} |
q264919 | FileWrapper.cssminify | test | protected function cssminify($content): string
{
$content = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $content);
$content = str_replace(': ', ':', $content);
$content = str_replace(array("\r\n", "\r", "\n", "\t"), '', $content);
$content = preg_replace("/ {2,}/", ' ', $conten... | php | {
"resource": ""
} |
q264920 | FileWrapper.textwordwrap | test | protected function textwordwrap($content): string
{
$tmp = explode("\n", $content);
$currmax = 0;
foreach ($tmp as $line) {
if (function_exists('mb_strlen')) {
$lw = mb_strlen($line);
if ($lw === false) {
$lw = strlen($line);
... | php | {
"resource": ""
} |
q264921 | FileWrapper.getTextContent | test | protected function getTextContent(): bool
{
if (is_null($this->path)) {
$this->sendInternalError();
return false;
}
if (is_null($this->mime)) {
$this->sendInternalError();
return false;
}
$content = file_get_contents($this->path... | php | {
"resource": ""
} |
q264922 | FileWrapper.serveText | test | protected function serveText(): bool
{
// move this to a class property in future FIXME
$vary = array();
if (is_null($this->request)) {
$this->sendInternalError();
return false;
}
if (is_null($this->etag)) {
$this->sendInternalError();
... | php | {
"resource": ""
} |
q264923 | FileWrapper.setAllowOrigin | test | public function setAllowOrigin($origin): void
{
$origin = trim($origin);
// fixme - send catchable error if origin isn't valid
// possibly could check with filter_var
if (strlen($origin) > 0) {
$this->allowOrigin = $origin;
}
} | php | {
"resource": ""
} |
q264924 | FileWrapper.sendfile | test | public function sendfile(): bool
{
if ($this->internalError) {
$this->sendInternalError();
return false;
}
if ($this->cacheok) {
header("HTTP/1.1 304 Not Modified");
return true;
}
if (is_null($this->path)) {
header(... | php | {
"resource": ""
} |
q264925 | AbstractTextingManager.registerProvider | test | public function registerProvider(TextingProviderInterface $provider)
{
if (!$this->defaultProvider) {
$this->defaultProvider = &$provider;
}
$this->providers[$provider->getName()] = $provider;
} | php | {
"resource": ""
} |
q264926 | ExplicitNormalizer.denormalize | test | public function denormalize($data, $class, $format = null, array $context = [])
{
$reflection = new ReflectionClass($class);
$instance = $reflection->newInstanceWithoutConstructor();
foreach ($data as $key => $value) {
$property = $reflection->getProperty($key);
$pro... | php | {
"resource": ""
} |
q264927 | ExplicitNormalizer.supportsDenormalization | test | public function supportsDenormalization($data, $type, $format = null)
{
return in_array(AbstractExplicitMessage::class, class_parents($type, true), true);
} | php | {
"resource": ""
} |
q264928 | RulesValidator.validate | test | final public function validate(array $data, $rules, string $type = null)
{
try {
$this->setMessages($rules);
} catch (\TypeError $e) {
}
try {
$this->setCustomAttributes($rules);
} catch (\TypeError $e) {
}
try {
$validator... | php | {
"resource": ""
} |
q264929 | RulesValidator.validateModel | test | public function validateModel(Model $model, Validation\Rules $rules, string $type = null)
{
try {
$this->setModel($rules, $model);
} catch (\TypeError $e) {
}
$this->validate($model->getAttributes(), $rules, $type);
} | php | {
"resource": ""
} |
q264930 | MenuItemTrait.getActionAttribute | test | public function getActionAttribute($value)
{
switch ($this->type) {
case MenuItemContract::TYPE_ROUTE:
return trans('menu::menu.type.route');
case MenuItemContract::TYPE_URL:
return trans('menu::menu.type.url');
default:
r... | php | {
"resource": ""
} |
q264931 | MenuItemTrait.getUrlAttribute | test | public function getUrlAttribute($value)
{
if ($this->hasChildren()) {
return MenuItemContract::URL_EMPTY;
}
switch ($this->type) {
case MenuItemContract::TYPE_ROUTE:
return $this->routeGracefulOnError($this->target, $this->parameters);
ca... | php | {
"resource": ""
} |
q264932 | EasyFormWizard.goNext | test | public function goNext($commit=false)
{
// call ValidateForm()
$recArr = $this->readInputRecord();
$this->setActiveRecord($recArr);
try
{
if ($this->ValidateForm() == false)
return;
}catch (Openbizx\Validation\Exception $e)
{
... | php | {
"resource": ""
} |
q264933 | EasyFormWizard.skip | test | public function skip()
{
$viewObj = $this->getWebpageObject();
// get the step
if($viewObj->getCurrentStep()){
$step = $viewObj->getCurrentStep();
}else{
$step = $_GET['step'];
}
if (!$step || $step=="")
$step=1;
$viewObj->renderStep($ste... | php | {
"resource": ""
} |
q264934 | EasyFormWizard.goBack | test | public function goBack()
{
$recArr = $this->readInputRecord();
$this->setActiveRecord($recArr);
$this->activeRecord = $this->readInputRecord();
$viewObj = $this->getWebpageObject();
// get the step
if($viewObj->getCurrentStep()){
$step = $viewObj->getCu... | php | {
"resource": ""
} |
q264935 | EasyFormWizard.doFinish | test | public function doFinish() //- call FinishWizard() by default
{
// call ValidateForm()
$recArr = $this->readInputRecord();
$this->setActiveRecord($recArr);
$this->setFormInputs($this->formInputs);
try
{
if ($this->ValidateForm() == false... | php | {
"resource": ""
} |
q264936 | EasyFormWizard.cancel | test | public function cancel()
{
// clean the session record
$this->dropSession = true;
Openbizx::$app->getSessionContext()->cleanObj($this->objectName, true);
} | php | {
"resource": ""
} |
q264937 | EasyFormWizard.render | test | public function render()
{
$viewobj = $this->getWebpageObject();
$viewobj->setFormState($this->objectName, 'visited', 1);
return parent::render();
} | php | {
"resource": ""
} |
q264938 | TOTPKeyGenerator.generate | test | public static function generate($length = null)
{
if ($length === null) {
$length = self::DEFAULT_LENGTH;
}
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
$randomString = '';
for ($i = 0; $i < $length; ++$i) {
$randomString .= $characters[rand(0, st... | php | {
"resource": ""
} |
q264939 | ExpressionUtil.isEmpty | test | public static function isEmpty(callable $callback, Context $context): bool
{
$policy = $context->setAccessPolicy(Context::ACCESS_POLICY_RETURN_NULL);
try {
$val = $callback($context);
} finally {
$context->setAccessPolicy($policy);
}
... | php | {
"resource": ""
} |
q264940 | ExpressionUtil.ternaryShortcut | test | public static function ternaryShortcut(callable $a, callable $b, Context $context)
{
$policy = $context->setAccessPolicy(Context::ACCESS_POLICY_RETURN_NULL);
try {
$val = $a($context);
} finally {
$context->setAccessPolicy($policy);
}
... | php | {
"resource": ""
} |
q264941 | ExpressionUtil.contains | test | public static function contains($container, $val): bool
{
if (\is_array($container)) {
return \in_array($val, $container, true);
}
if ($container instanceof \Traversable) {
foreach ($container as $tmp) {
if ($tmp === $val) {
... | php | {
"resource": ""
} |
q264942 | MetaIterator.merge | test | public function merge(&$anotherMIObj)
{
$old_varValue = $this->varValue;
$this->varValue = array();
foreach ($anotherMIObj as $key => $value) {
if (!$old_varValue[$key]) {
$this->varValue[$key] = $value;
} else {
$this->varValue[$key] =... | php | {
"resource": ""
} |
q264943 | AppFactory.create | test | public static function create(
$containerConfig = null,
?RouterInterface $router = null,
?DispatcherInterface $dispatcher = null,
?ResponseInterface $defaultResponse = null
): App {
$container = self::buildContainer($containerConfig);
$dispatcher = $dispatcher ?: new ... | php | {
"resource": ""
} |
q264944 | GenericDocumentManager.dispatch | test | public function dispatch($key, $arguments)
{
$event = new GenericEvent(
$key,
$arguments
);
$this->eventDispatcher->dispatch($key, $event);
return $event;
} | php | {
"resource": ""
} |
q264945 | GenericDocumentManager.countByGroup | test | public function countByGroup($fieldGroup, $match = [], $query = null, $sort = null, $limit = null)
{
$group = [
'_id' => '$'.$fieldGroup,
'count' => [ '$sum' => 1]
];
return $this->aggregateGroup($group, $match, $query, $sort, $limit);
} | php | {
"resource": ""
} |
q264946 | GenericDocumentManager.aggregateGroup | test | public function aggregateGroup($group, $match = [], $query = null, $sort = null, $limit = null)
{
$query = $this->getDefault('query', $query);
$collection = $this->dm->getDocumentCollection($this->document);
$pipeline = [];
if ($query) {
$query = $this->addNativeQuery(... | php | {
"resource": ""
} |
q264947 | GenericDocumentManager.find | test | public function find($id, array $filters = [])
{
$qb = $this->dm->createQueryBuilder($this->document);
if (count($filters)) {
$qb = $this->addFilters($qb, $filters);
}
$qb->field('_id')->equals(new \MongoId($id));
return $qb->getQuery()->getSingleResult();
... | php | {
"resource": ""
} |
q264948 | GenericDocumentManager.getMongoIds | test | public function getMongoIds($objects)
{
$ids = [];
foreach ($objects as $object) {
$ids[] = new \MongoId($object->getId());
}
return $ids;
} | php | {
"resource": ""
} |
q264949 | GenericDocumentManager.normalizeDate | test | public function normalizeDate($date)
{
if ($date instanceof \DateTime) {
return $date;
}
$date = preg_replace('/\.[0-9]+/', '', $date);
return \DateTime::createFromFormat(\DateTime::ISO8601, $date);
} | php | {
"resource": ""
} |
q264950 | WebPage.isInFormRefLibs | test | public function isInFormRefLibs($formName)
{
if ($this->formRefLibs) {
$this->formRefLibs->rewind();
while ($this->formRefLibs->valid()) {
$reference = $this->formRefLibs->current();
if ($reference->objectName == $formName) {
return... | php | {
"resource": ""
} |
q264951 | WebPage.render | test | public function render()
{
if (!$this->allowAccess()) {
$accessDenyWebpage = Openbizx::getObject(OPENBIZ_ACCESS_DENIED_WEBPAGE);
return $accessDenyWebpage->render();
}
$this->initAllForms();
// check the "fld_..." arg in url and put it in the search rule
... | php | {
"resource": ""
} |
q264952 | WebPage.getCurrentPageUrl | test | public function getCurrentPageUrl()
{
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUE... | php | {
"resource": ""
} |
q264953 | WebPage.initAllForms | test | protected function initAllForms()
{
foreach ($this->formRefs as $formRef) {
$formRef->setViewName($this->objectName);
$formName = $formRef->objectName;
$formObj = Openbizx::getObject($formName);
if ($formRef->subForms && method_exists($formObj, "SetSubForms"))... | php | {
"resource": ""
} |
q264954 | PhpSettingCheck.compareIntegers | test | public static function compareIntegers($value, $setting_value)
{
$okay = false;
$actual = self::getIntegerValue($value);
$operator = self::getOperator($setting_value);
$expected = self::getIntegerValue($setting_value);
switch ($operator) {
case '>':
... | php | {
"resource": ""
} |
q264955 | PhpSettingCheck.getIntegerValue | test | public static function getIntegerValue($value)
{
if (!is_numeric($value)) {
// strip excessive whitespace
$value = trim($value);
// strip comparison operator
$value = ltrim($value, '<>!=');
// remove the K|M|G suffix if necessary
$len =... | php | {
"resource": ""
} |
q264956 | Autoloader.findSourceFiles | test | public static function findSourceFiles(string $path)
{
$result = array();
$reader = dir($path);
while ($file = $reader->read())
{
if ($file === '.' || $file === '..')
continue;
$file = $path . '/' . $file;
if (substr($file, -4) ==... | php | {
"resource": ""
} |
q264957 | Autoloader.registerNS | test | public function registerNS(string $ns, string $path, $standard = Autoloader::PSR4)
{
if (!file_exists($path) || !is_dir($path) || !is_readable($path))
throw new \InvalidArgumentException("Path $path is not readable");
if ($standard !== Autoloader::PSR0 && $standard !== Autoloader::PSR4 ... | php | {
"resource": ""
} |
q264958 | Autoloader.buildCache | test | public function buildCache()
{
if ($this->cache === null)
throw new \LogicException("Cannot build cache without a cache instance");
$this->cache->set('cache_built', false);
$this->cache->set('classpaths', array());
$stack = array($this->root_namespace);
... | php | {
"resource": ""
} |
q264959 | Autoloader.findComposerAutoloader | test | public static function findComposerAutoloader()
{
// Find the Composer Autoloader class using its (generated) name
$list = get_declared_classes();
foreach ($list as $cl)
if (substr($cl, 0, 18) === "ComposerAutoloader")
return $cl;
// @codeCoverageIgnoreSt... | php | {
"resource": ""
} |
q264960 | Autoloader.findComposerAutoloaderVendorDir | test | public static function findComposerAutoloaderVendorDir(string $composer_loader_class)
{
$ref = new \ReflectionClass($composer_loader_class);
// Composer is located at MyProject/vendor/composer
$path = dirname($ref->getFileName());
return dirname($path);
} | php | {
"resource": ""
} |
q264961 | Autoloader.getClassLoaders | test | public function getClassLoaders(string $class)
{
$parts = explode("\\", $class);
$result = array();
$ref = &$this->root_namespace;
$sub_ns = "";
foreach ($parts as $part)
{
foreach ($ref['loaders'] as $loader)
$result[] = $loader;
... | php | {
"resource": ""
} |
q264962 | HasAttrWithMiddleware.getMiddlewareOrFallback | test | public function getMiddlewareOrFallback(string $name, $middleMan, $result = null)
{
// asserts instead of type-hints because this is a trait and another trait uses it.
assert($middleMan instanceof MiddlewareDispatcher);
if (! $middleMan->groupIsEmpty('getters')) {
$result = $mid... | php | {
"resource": ""
} |
q264963 | HasAttrWithMiddleware.setMiddlewareOrFallback | test | public function setMiddlewareOrFallback(string $name, $value, $middleMan, $result = null)
{
// asserts instead of type-hints because this is a trait and another trait uses it.
assert($middleMan instanceof MiddlewareDispatcher);
if (! $middleMan->groupIsEmpty('setters')) {
$resul... | php | {
"resource": ""
} |
q264964 | Printable.withStringLimit | test | public function withStringLimit(int $strlim): Printable
{
return new Printable($this->value, $this->callable, $strlim, $this->arrlim);
} | php | {
"resource": ""
} |
q264965 | Printable.withArrayLimit | test | public function withArrayLimit(int $arrlim): Printable
{
return new Printable($this->value, $this->callable, $this->strlim, $arrlim);
} | php | {
"resource": ""
} |
q264966 | Printable.string | test | private function string(string $value): string
{
if ($this->callable && is_callable($value)) {
return sprintf('function %s()', $value);
}
return strlen($value) > $this->strlim
? $this->quoted(substr($value, 0, $this->strlim) . '...')
: $this->quoted($valu... | php | {
"resource": ""
} |
q264967 | Printable.array | test | private function array(array $value): string
{
if ($this->callable && is_callable($value)) {
$class = ! is_string($value[0])
? $this->classname($value[0])
: $value[0];
$method = $value[1];
return sprintf('function %s::%s()', $class, $meth... | php | {
"resource": ""
} |
q264968 | Printable.arrayPair | test | private function arrayPair($key, $val): string
{
$key_str = is_int($key) ? $key : $this->quoted($key);
$val_str = $this->arrayValue($val);
return sprintf('%s => %s', $key_str, $val_str);
} | php | {
"resource": ""
} |
q264969 | Printable.arrayValue | test | private function arrayValue($val): string
{
return ! is_array($val)
? (string) new Printable($val, $this->callable, $this->strlim)
: '[...]';
} | php | {
"resource": ""
} |
q264970 | Printable.object | test | private function object($value): string
{
$class = $this->classname($value);
if ($class == \Closure::class) {
return 'function {closure}()';
}
return ($this->callable && is_callable($value))
? sprintf('function %s::__invoke()', $class)
: sprintf(... | php | {
"resource": ""
} |
q264971 | NewrelicBackgroundTransaction.reject | test | public function reject(RejectEnvelopeEvent $event)
{
if (!function_exists('newrelic_end_transaction')) {
return;
}
newrelic_notice_error($event->getEnvelope()->getName(), $event->getException());
newrelic_end_transaction();
} | php | {
"resource": ""
} |
q264972 | LaravelcpServiceProvider.boot | test | public function boot(\Illuminate\Routing\Router $router)
{
Config::set('auth.model', 'Askedio\Laravelcp\Models\User');
Config::set('auth.password.email', 'lcp::emails.password');
$router->middleware('auth', 'Askedio\Laravelcp\Http\Middleware\Authenticate');
$router->middleware('auth.basic', 'Illum... | php | {
"resource": ""
} |
q264973 | ViewRenderer.render | test | static public function render($webpage)
{
$tplEngine = $webpage->templateEngine;
$tplAttributes = ViewRenderer::buildTemplateAttributes($webpage);
ob_start();
if ($tplEngine == "Smarty" || $tplEngine == null) {
ViewRenderer::renderSmarty($webpage, $tplAttributes);
... | php | {
"resource": ""
} |
q264974 | ViewRenderer.renderSmarty | test | static protected function renderSmarty($webpage, $tplAttributes = Array())
{
$smarty = TemplateHelper::getSmartyTemplate();
$viewOutput = $webpage->outputAttrs();
foreach ($viewOutput as $k => $v) {
$smarty->assign($k, $v);
}
// render the formobj attributes
... | php | {
"resource": ""
} |
q264975 | ViewRenderer.renderPHP | test | static protected function renderPHP($viewObj, $tplAttributes = Array())
{
$view = TemplateHelper::getZendTemplate();
$tplFile = TemplateHelper::getTplFileWithPath($viewObj->templateFile, $viewObj->package);
$view->addScriptPath(dirname($tplFile));
//Translate Array of template varia... | php | {
"resource": ""
} |
q264976 | ViewRenderer.setHeaders | test | static protected function setHeaders($viewObj)
{
// get the cache attribute
// if cache = browser, set the cache control in headers
header('Pragma:', true);
header('Cache-Control: max-age=3600', true);
$offset = 60 * 60 * 24 * - 1;
$ExpStr = "Expires: " . gmdate("D, d... | php | {
"resource": ""
} |
q264977 | CommentFactory.create | test | public function create(IssueInterface $issue, UserInterface $user)
{
$comment = new $this->className();
return $comment
->setIssue($issue)
->setWrittenBy($user);
} | php | {
"resource": ""
} |
q264978 | Router.listDir | test | public static function listDir(string $dir, bool $recursive = true)
{
$contents = array();
$subdirs = array();
$reader = dir($dir);
while ($entry = $reader->read())
{
if ($entry === "." || $entry === "..")
continue;
$entry = $dir . DIR... | php | {
"resource": ""
} |
q264979 | Router.sortModules | test | protected function sortModules()
{
parent::sortModules();
if ($this->root !== null && $this->root_search_path !== $this->search_path)
{
$this->root = null;
$this->root_search_path = null;
}
} | php | {
"resource": ""
} |
q264980 | Router.getRoutes | test | public function getRoutes()
{
if (!$this->sorted)
$this->sortModules();
$cache = $this->getCachedData();
if ($cache !== null && $this->root === null)
{
$root = $cache->get('data');
if ($root instanceof Route)
{
$this->... | php | {
"resource": ""
} |
q264981 | HTMLMenus.renderMenuItems | test | protected function renderMenuItems(&$menuItemArray)
{
$sHTML = "";
if (isset($menuItemArray["ATTRIBUTES"])) {
$sHTML .= $this->renderSingleMenuItem($menuItemArray);
} else {
foreach ($menuItemArray as $menuItem) {
$sHTML .= $this->renderSingleMenuItem(... | php | {
"resource": ""
} |
q264982 | HTMLMenus.renderSingleMenuItem | test | protected function renderSingleMenuItem(&$menuItem)
{
$profile = Openbizx::$app->getUserProfile();
$svcobj = Openbizx::getService(ACCESS_SERVICE);
$role = isset($profile["ROLE"]) ? $profile["ROLE"] : null;
if ( isset($menuItem["ATTRIBUTES"]['URL']) ) {
$url = $menuItem["... | php | {
"resource": ""
} |
q264983 | TempFile.writeCsv | test | public function writeCsv(array $data): self
{
fputcsv($this->handler, $data, $this->delimiter, $this->enclosure, $this->escapeChar);
return $this;
} | php | {
"resource": ""
} |
q264984 | CheckCommand.configure | test | protected function configure()
{
parent::configure();
$this->setName('check');
$this->addOption(
'config',
'c',
InputOption::VALUE_OPTIONAL,
'Path to config file that defines the checks to process.'
);
$this->addOption(
... | php | {
"resource": ""
} |
q264985 | CheckCommand.readConfig | test | protected function readConfig()
{
$this->config = $this->getConfigHandler()->getConfig();
if ($this->config->has('introduction')) {
$this->output->writeln($this->config->get('introduction'));
$this->output->writeln('');
}
} | php | {
"resource": ""
} |
q264986 | CheckCommand.runChecks | test | protected function runChecks()
{
$runner_impl = $this->config->getRunnerImplementor();
$runner = new $runner_impl();
if (!$runner instanceof IRunner) {
throw new \InvalidArgumentException('The given runner "' . $runner_impl . '" must implement IRunner.');
}
$ru... | php | {
"resource": ""
} |
q264987 | CheckCommand.runExport | test | protected function runExport()
{
$export_impl = $this->config->getExportImplementor();
$exporter = new $export_impl();
if (!$exporter instanceof IExport) {
throw new \InvalidArgumentException('The given exporter "' . $export_impl . '" must implement IExport.');
}
... | php | {
"resource": ""
} |
q264988 | CheckCommand.writeCache | test | protected function writeCache($run_was_successful)
{
$disable_caching = $this->input->getOption('no-cache');
if (!empty($disable_caching)) {
return;
}
$cache_implementor = $this->config->getCacheImplementor();
$cache = new $cache_implementor();
if (!$cac... | php | {
"resource": ""
} |
q264989 | CheckCommand.getLoadedCache | test | protected function getLoadedCache()
{
if ($this->input->getOption('no-cache')) {
$this->readonly_cache = new ReadOnlyCache();
return $this->readonly_cache;
}
$cache_implementor = $this->config->getReadOnlyCacheImplementor();
$cache = new $cache_implementor();... | php | {
"resource": ""
} |
q264990 | CheckCommand.initialize | test | protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output); // necessary to register autoloader
$config = $input->getOption('config');
if (!empty($config)) {
if (!is_readable($config)) {
throw new \InvalidA... | php | {
"resource": ""
} |
q264991 | Executor.read | test | public function read($command, $eol = PHP_EOL)
{
exec($command, $output);
return implode($eol, $output);
} | php | {
"resource": ""
} |
q264992 | Executor.flush | test | public function flush(
$command,
array $streams,
array &$pipes = [],
$cwd = null,
array $env = null,
array $options = []
) {
$process = proc_open($command, $streams, $pipes, $cwd, $env, $options);
if (!is_resource($process)) {
throw new \Ru... | php | {
"resource": ""
} |
q264993 | ChainsResults.valueIsChainable | test | protected function valueIsChainable($value): bool
{
$chainableObjects = $this->getChainableObjects();
if (! is_object($value)) {
return false;
} elseif (in_array('object', $chainableObjects)) {
return true;
} else {
$isInstanceOf = function (string... | php | {
"resource": ""
} |
q264994 | InputForm.validateForm | test | protected function validateForm($cleanError = true)
{
if($cleanError == true)
{
$this->validateErrors = array();
}
$this->dataPanel->rewind();
while($this->dataPanel->valid())
{
/* @var $element Element */
$element = $this->dataPane... | php | {
"resource": ""
} |
q264995 | GroupSpecificationEq.isSatisfiedBy | test | public function isSatisfiedBy(GroupItem $item)
{
$field_name = $this->field_name;
if(in_array($item->$field_name, $this->val)){
return ($item->$field_name == $this->val);
}else{
return ($item->$field_name == $this->val);
}
} | php | {
"resource": ""
} |
q264996 | ClientCredentialsGrant.completeFlow | test | public function completeFlow(ClientEntity $client)
{
// Validate any scopes that are in the request
$scopeParam = $this->server->getRequestHandler()->getParam('scope');
$scopes = $this->validateScopes($scopeParam, $client);
// Create a new session
$session = new SessionEntit... | php | {
"resource": ""
} |
q264997 | BizField.getSqlValue | test | public function getSqlValue($input = null)
{
$value = ($input !== null) ? $input : $this->value;
if ($value === null) {
return "";
}
/*
if ($this->type != 'Number')
{
if (get_magic_quotes_gpc() == 0) {
$val = addcslashes($value, "\0... | php | {
"resource": ""
} |
q264998 | BizField.getValue | test | public function getValue($formatted = true)
{
// need to ensure that value are retrieved from source/cache
//if ($this->getDataObj()->CheckDataRetrieved() == false)
//$this->getDataObj()->getActiveRecord();
if ($this->_prevValue == $this->value) {
return $this->_get... | php | {
"resource": ""
} |
q264999 | BizField.saveOldValue | test | public function saveOldValue($value = null)
{
if ($value) {
$this->oldValue = $value;
} else {
$this->oldValue = $this->value;
}
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.