_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q260600 | Obj.read | test | public static function read($object, $property, $default = null)
{
if (is_null($object)) {
return self::value($default);
}
| php | {
"resource": ""
} |
q260601 | Obj.fetch | test | public static function fetch($object, $property, $default = null)
{
if (is_null($object)) {
| php | {
"resource": ""
} |
q260602 | Obj.get | test | public static function get($target, $key, $default = null)
{
if (is_null($key) || !is_object($target)) {
return self::value($default);
}
if (!is_array($key)) {
if (isset($target->{$key}) || property_exists($target, $key)) {
return $target->{$key};
... | php | {
"resource": ""
} |
q260603 | Obj.set | test | public static function set(&$target, $key, $value, $overwrite = true)
{
if (is_null($key)) {
return $target;
}
if (!is_array($key)) {
if (isset($target->{$key}) || property_exists($target, $key)) {
if ($overwrite) {
$target->{$key}... | php | {
"resource": ""
} |
q260604 | Handler.register | test | public static function register()
{
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
self::handleError($errno, $errstr, $errfile, $errline);
});
set_exception_handler(function ($e) {
| php | {
"resource": ""
} |
q260605 | Handler.handleError | test | public static function handleError($errno, $errstr, $errfile, $errline)
{
if (!($errno & error_reporting())) | php | {
"resource": ""
} |
q260606 | Handler.handle | test | public static function handle(Error $error)
{
foreach (self::$writers as $class => $writer) {
if (is_null($writer)) {
| php | {
"resource": ""
} |
q260607 | Migrator.resolve | test | public function resolve($file)
{
$class = Str::studly(implode('_', array_slice(explode('_', $file), 4)));
if (!class_exists($class)) {
$className = str_replace('.', '\\', $this->getRepository()->getGroup()); | php | {
"resource": ""
} |
q260608 | LevelAwareLogger.shouldLog | test | protected function shouldLog($level)
{
if ($this->levels === ['*'] || $this->levels === ['all']) {
return true; | php | {
"resource": ""
} |
q260609 | LevelAwareLogger.useFiles | test | public function useFiles($path, $level = 'debug')
{
if ($this->logger | php | {
"resource": ""
} |
q260610 | LevelAwareLogger.useDailyFiles | test | public function useDailyFiles($path, $days = 0, $level = 'debug')
{
if ($this->logger instanceof Log) {
| php | {
"resource": ""
} |
q260611 | LoggerServiceProvider.registerLogger | test | protected function registerLogger()
{
$this->app->singleton('logger', function (Container $app) {
$loggers = [];
foreach ($app->config->get('logger.loggers', []) as $logger => $levels) {
| php | {
"resource": ""
} |
q260612 | SQL.setUp | test | public function setUp($options = [])
{
$this->setupProperty($options, 'dbType', 'DB_TYPE');
$this->setupProperty($options, 'server', 'DB_HOST');
$this->setupProperty($options, 'username', 'DB_USERNAME');
$this->setupProperty($options, 'password', 'DB_PASSWORD');
| php | {
"resource": ""
} |
q260613 | SQL.logSqlError | test | public function logSqlError($ignoreErrors = false)
{
if (!$this->result && !$ignoreErrors) {
$queryRaw = $this->lastQuery;
$callerBackTrace = debug_backtrace();
$callerBackTrace = $callerBackTrace[2];
$caller = $callerBackTrace['function'].'()'... | php | {
"resource": ""
} |
q260614 | UlTag.& | test | public function &addItemSmart($pageItem, $properties = [])
{
if (is_array($pageItem)) {
foreach ($pageItem as $item) {
$this->addItemSmart($item);
}
$itemAdded = &$this->lastItem;
} else {
if (isset($pageItem->tagType) && $pageItem->tag... | php | {
"resource": ""
} |
q260615 | Properties.getProperty | test | public function getProperty($property, $default = null)
{
if (!$property) return $default;
$value = isset($this->properties[$property]) ? $this->properties[$property] : $default;
// If the attribute exists within the cast array, we will convert it to
// an appropriate native PHP ty... | php | {
"resource": ""
} |
q260616 | Properties.setProperty | test | public function setProperty($property, $value)
{
$this->properties[$property] | php | {
"resource": ""
} |
q260617 | Properties.setProperties | test | public function setProperties(array $properties, $sync = false)
{
$this->properties = [];
foreach ($properties as $property => $value) {
$setMethod = 'set' . ucfirst($property);
| php | {
"resource": ""
} |
q260618 | Properties.getOriginal | test | public function getOriginal($property = null, $default = null)
{
if (is_null($property)) return $this->original;
| php | {
"resource": ""
} |
q260619 | Properties.hasCast | test | public function hasCast($property, $types = null)
{
if (array_key_exists($property, $this->casts)) { | php | {
"resource": ""
} |
q260620 | Properties.getDirty | test | public function getDirty()
{
$dirty = [];
foreach ($this->properties as $property => $value) {
if (!array_key_exists($property, $this->original)) {
$dirty[$property] = $value;
} elseif ($value !== $this->original[$property] &&
| php | {
"resource": ""
} |
q260621 | Navbar.navBarHeader | test | public static function navBarHeader($handle, $brand)
{
$navstyle = '.navbar-'.$handle.'-collapse';
$nbhc['button'] = new \Ease\Html\ButtonTag([new \Ease\Html\Span(
_('Switch navigation'), ['class' => 'sr-only']), new \Ease\Html\Span(
null, ['class' => 'icon-bar'... | php | {
"resource": ""
} |
q260622 | Navbar.& | test | public function &addDropDownSubmenu($name, $items)
{
$dropdown = $this->addItem(new \Ease\Html\UlTag(null,
['class' => 'dropdown-menu', | php | {
"resource": ""
} |
q260623 | ButtonGroup.addButton | test | public function addButton($content, $type = 'default', $properties = [])
{
if (isset($properties['class'])) {
$properties['class'] = 'btn btn-'.$type.' | php | {
"resource": ""
} |
q260624 | ToStd.flush | test | public function flush($caller = null)
{
$flushed = 0;
if (count($this->statusMessages)) {
foreach ($this->statusMessages as $type => $messages) {
foreach ($messages as $messageID => $message) {
if (!isset($this->flushed[$type][$messageID])) {
... | php | {
"resource": ""
} |
q260625 | WebPage.& | test | public function &addItem($item, $pageItemName = null)
{
$added = | php | {
"resource": ""
} |
q260626 | WebPage.addCSS | test | public function addCSS($css)
{
if (is_array($css)) {
$css = key($css).'{'.current($css).'}';
| php | {
"resource": ""
} |
q260627 | User.getGravatar | test | public static function getGravatar(
$email, $size = 80, $default = 'mm', $maxRating = 'g'
)
{
| php | {
"resource": ""
} |
q260628 | Page.offsetSet | test | public function offsetSet($key, $value)
{
if (is_null($key)) {
$this->content[] = $value;
| php | {
"resource": ""
} |
q260629 | Shared.& | test | public static function &db($pdo = null)
{
$shared = self::instanced();
if (is_object($pdo)) {
$shared->dbLink = &$pdo;
| php | {
"resource": ""
} |
q260630 | Shared.& | test | public static function &locale($locale = null)
{
$shared = self::instanced();
if (is_object($locale)) {
$shared->locale = &$locale;
}
if (!is_object($shared->locale)) {
| php | {
"resource": ""
} |
q260631 | Shared.addUrlParams | test | public static function addUrlParams($url, $addParams, $override = false)
{
$urlParts = parse_url($url);
$urlFinal = '';
if (array_key_exists('scheme', $urlParts)) {
$urlFinal .= $urlParts['scheme'].'://'.$urlParts['host'];
}
if (array_key_exists('port', $urlParts)... | php | {
"resource": ""
} |
q260632 | Shared.linkify | test | public static function linkify($value, $protocols = array('http', 'mail'),
array $attributes = array())
{
// Link attributes
$attr = '';
foreach ($attributes as $key => $val) {
$attr = ' '.$key.'="'.htmlentities($val).'"';
}
$li... | php | {
"resource": ""
} |
q260633 | TableTag.& | test | public function &addRowFooterColumns($columns = null, $properties = [])
{
$tableRow = $this->tFoot->addItem(new TrTag());
if (is_array($columns)) {
foreach ($columns as $column) {
if (is_object($column) && method_exists($column, 'getTagType') && $column->getTagType()
... | php | {
"resource": ""
} |
q260634 | Page.includeCss | test | public function includeCss($cssFile, $fwPrefix = false, $media = 'screen')
{
| php | {
"resource": ""
} |
q260635 | Page.phpSelf | test | public static function phpSelf($dropqs = true)
{
$url = null;
if (php_sapi_name() != 'cli') {
$schema = 'http';
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
$schema .= 's';
}
$url = sprintf('%s://%s%s', $schema, $_SER... | php | {
"resource": ""
} |
q260636 | NetLicensingCurl.buildPostData | test | public function buildPostData($data)
{
$this->data = $data;
$query = parent::buildPostData($data);
foreach ($data as $key => $value) {
if | php | {
"resource": ""
} |
q260637 | Locale.availble | test | public function availble()
{
$locales = [];
$d = dir(self::$i18n);
while (false !== ($entry = $d->read())) {
if (($entry[0] != '.') && file_exists(self::$i18n.'/'.$entry.'/LC_MESSAGES/'.self::$textDomain.'.mo')) {
| php | {
"resource": ""
} |
q260638 | Locale.langToLocale | test | public static function langToLocale($lang)
{
$defaultLocale = 'C';
$langs = [];
foreach (self::$alllngs as $langCode => $language) {
$langs[$langCode] = [strstr($langCode, '_') ? substr($langCode, 0,
strpos($langCode, '_')) : $langCode, $language];
... | php | {
"resource": ""
} |
q260639 | Locale.useLocale | test | public static function useLocale($localeCode)
{
\setlocale(LC_ALL, $localeCode);
\bind_textdomain_codeset(self::$textDomain, 'UTF-8');
\putenv("LC_ALL=$localeCode");
if (file_exists(self::$i18n)) {
\bindtextdomain(self::$textDomain, self::$i18n);
}
| php | {
"resource": ""
} |
q260640 | Molecule.setupProperty | test | public function setupProperty($options, $name, $constant = null)
{
if (isset($options[$name])) {
$this->$name = $options[$name];
} else {
| php | {
"resource": ""
} |
q260641 | Molecule.getStatusMessages | test | public function getStatusMessages($clean = false)
{
$messages = $this->easeShared->getStatusMessages();
if ($clean) {
| php | {
"resource": ""
} |
q260642 | UtilityService.listCountries | test | public static function listCountries(Context $context, $filter = null)
{
$queryParams = (!is_null($filter)) ? [Constants::FILTER => $filter] : [];
$response = NetLicensingService::getInstance()
->get($context, Constants::UTILITY_ENDPOINT_PATH . '/' . Constants::UTILITY_ENDPOINT_PATH_COU... | php | {
"resource": ""
} |
q260643 | ListGroup.& | test | public function &addItemSmart($pageItem, $properties = [])
{
$item = parent::addItemSmart($pageItem, $properties);
| php | {
"resource": ""
} |
q260644 | LabelTag.setObjectName | test | public function setObjectName($objectName = null)
{
if (is_null($objectName)) {
| php | {
"resource": ""
} |
q260645 | ToConsole.set | test | public static function set($str, $color)
{
$color_attrs = explode("+", $color);
$ansi_str = "";
foreach ($color_attrs as $attr) {
$ansi_str .= | php | {
"resource": ""
} |
q260646 | ToConsole.getTypeColor | test | public static function getTypeColor($type)
{
switch ($type) {
case 'mail': // Envelope
$color = 'blue';
break;
case 'warning': // Vykřičník v trojůhelníku
$color = 'yellow';
break... | php | {
"resource": ""
} |
q260647 | NetLicensingService.get | test | public function get(Context $context, $urlTemplate, array $queryParams = | php | {
"resource": ""
} |
q260648 | NetLicensingService.post | test | public function post(Context $context, $urlTemplate, array $queryParams = | php | {
"resource": ""
} |
q260649 | NetLicensingService.delete | test | public function delete(Context $context, $urlTemplate, array $queryParams = | php | {
"resource": ""
} |
q260650 | Sand.getMyKey | test | public function getMyKey($data = null)
{
$key = null;
if (is_null($data)) {
$data = $this->getData();
}
| php | {
"resource": ""
} |
q260651 | Sand.unsetDataValue | test | public function unsetDataValue($columnName)
{
if (array_key_exists($columnName, $this->data)) {
| php | {
"resource": ""
} |
q260652 | Sand.reindexArrayBy | test | public static function reindexArrayBy($data, $indexBy = null)
{
$reindexedData = [];
foreach ($data as $dataID => $data) {
if (array_key_exists($indexBy, $data)) {
$reindexedData[$data[$indexBy]] = $data;
} else { | php | {
"resource": ""
} |
q260653 | Container.draw | test | public function draw()
{
foreach ($this->pageParts as $part) {
if (is_object($part)) {
if (method_exists($part, 'drawIfNotDrawn')) {
| php | {
"resource": ""
} |
q260654 | NetLicensingDemo.setUpContext | test | public function setUpContext()
{
return $this->context = (new \NetLicensing\Context())
->setBaseUrl(self::BASE_URL)
->setSecurityMode(self::SECURITY_MODE)
| php | {
"resource": ""
} |
q260655 | Mailer.getItemsCount | test | public function getItemsCount($object = null)
{
if (is_null($object)) {
$object = $this->htmlBody;
| php | {
"resource": ""
} |
q260656 | Mailer.isEmpty | test | public function isEmpty($element = null)
{
if (is_null($element)) {
$element = $this->htmlBody;
| php | {
"resource": ""
} |
q260657 | PDO.addSlashes | test | public function addSlashes($text)
{
if (isset($this->sqlLink) && method_exists($this->sqlLink,
'real_escape_string')) {
$slashed = $this->sqlLink->real_escape_string($text);
| php | {
"resource": ""
} |
q260658 | PDO.connect | test | public function connect()
{
if (is_null($this->dbType)) {
$result = null;
} else {
switch ($this->dbType) {
case 'mysql':
$this->sqlLink = new \PDO($this->dbType.':dbname='.$this->database.';host='.$this->server.';port='.$this->port.';chars... | php | {
"resource": ""
} |
q260659 | PDO.arrayToInsert | test | public function arrayToInsert($data)
{
$cc = $this->getColumnComma();
$set = ' ';
if ($this->dbType == 'mysql') {
$set = ' SET ';
}
| php | {
"resource": ""
} |
q260660 | PDO.prepSelect | test | public function prepSelect($data, $ldiv = 'AND')
{
$operator = null;
$conditions = [];
$conditionsII = [];
foreach ($data as $column => $value) {
if (is_integer($column)) {
$conditionsII[] = $value;
continue;
}
... | php | {
"resource": ""
} |
q260661 | PDO.useObject | test | public function useObject($object)
{
$this->setKeyColumn($object->getKeyColumn()); | php | {
"resource": ""
} |
q260662 | Carousel.addSlide | test | public function addSlide($slide, $capHeading = '', $caption = '',
$default = false)
{
$item = new \Ease\Html\DivTag($slide, ['class' => 'item']);
if ($default) {
$item->addTagClass('active');
}
if ($capHeading || $caption) {
$cpt ... | php | {
"resource": ""
} |
q260663 | Carousel.finalize | test | public function finalize()
{
Part::twBootstrapize();
if (is_null($this->active) && $this->getItemsCount() ) { //We need one slide active
$this->indicators->getFirstPart()->setTagClass('active');
$this->inner->getFirstPart()->addTagClass('active');
}
$this->inn... | php | {
"resource": ""
} |
q260664 | Regent.addToLog | test | public function addToLog($caller, $message, $type = 'info')
{
foreach | php | {
"resource": ""
} |
q260665 | Regent.addStatusObject | test | public function addStatusObject(Message $message, $type = 'info')
{
$this->addToLog($message->caller, $message->body, $message->type);
\Ease\Shared::instanced()->addStatusMessage($message->body,
| php | {
"resource": ""
} |
q260666 | Tag.getTagName | test | public function getTagName()
{
$tagName = null;
if ($this->setName === true) {
if (isset($this->tagProperties['name'])) {
| php | {
"resource": ""
} |
q260667 | Tag.getTagProperty | test | public function getTagProperty($propertyName)
{
$property = null;
if (isset($this->tagProperties[$propertyName])) { | php | {
"resource": ""
} |
q260668 | Modal.finalize | test | public function finalize()
{
Part::twBootstrapize();
$modalDialog = $this->addItem(new \Ease\Html\DivTag(null,
['class' => 'modal-dialog', 'role' => 'document']));
$modalContent = $modalDialog->addItem(new \Ease\Html\DivTag(null,
['class' => 'modal-content'])... | php | {
"resource": ""
} |
q260669 | CommandRunner.cloneEarlyRunner | test | public function cloneEarlyRunner()
{
$ret = clone $this;
$ret->nextRun = time();
| php | {
"resource": ""
} |
q260670 | Tabs.& | test | public function &addAjaxTab($tabName, $tabUrl, $active = false)
{
$this->tabs[$tabName] = ['ajax' => $tabUrl];
if ($active) {
$this->activeTab = $tabName;
}
\Ease\Shared::webPage()->addJavaScript('
$(\'#'.$this->getTagID().' a\').click(function (e) {
e.preventDefault();
... | php | {
"resource": ""
} |
q260671 | Debug.trace | test | protected function trace($data)
{
if ($this->_debug) {
//Open the tags and output request specific items
if ($data->getType() == "request") {
print '<table style="border-style: solid; border-width: 1px; border-color: #b1b1b1; margin: 5px"><tr><td style="vertical-alig... | php | {
"resource": ""
} |
q260672 | AObservable.attach | test | public function attach($events, IObserver $observer)
{
if (is_array($events)) {
foreach ($events as $event) {
$this->doAttach($event, $observer);
}
} elseif (is_string($events)) {
| php | {
"resource": ""
} |
q260673 | AObservable.doAttach | test | protected function doAttach($event, IObserver $observer)
{
if (!array_key_exists($event, $this->_observers)) {
$this->_observers[$event] = array();
}
| php | {
"resource": ""
} |
q260674 | AObservable.detach | test | public function detach($event, IObserver $observer)
{
if (!isset($this->_observers[$event])) {
return;
}
foreach ($this->_observers[$event] as $key=> $attachedObserver) {
| php | {
"resource": ""
} |
q260675 | AObservable.detachAllEventsForObserver | test | public function detachAllEventsForObserver(IObserver $observerToRemove)
{
foreach ($this->_observers as $event => $observers) {
foreach ($observers as $position => $observer) {
| php | {
"resource": ""
} |
q260676 | Toolbox.validatePod | test | public function validatePod($pod)
{
if ($pod instanceof AModel) {
$pod = $pod->getPod();
}
if ($pod->compareToolbox($this)) {
return true;
} else {
| php | {
"resource": ""
} |
q260677 | Toolbox.getConnection | test | public function getConnection()
{
if (!$this->_connection) {
$options = array(
// server endpoint to connect to
ConnectionOptions::OPTION_ENDPOINT => $this->_endpoint,
// authorization type to use (currently supported: 'Basic')
... | php | {
"resource": ""
} |
q260678 | Toolbox.getDriver | test | public function getDriver()
{
if (!$this->_driver) {
if ($this->_graph) {
$this->_driver = $this->getGraphHandler(); | php | {
"resource": ""
} |
q260679 | Toolbox.generateBindingParameter | test | public function generateBindingParameter($parameter, $userParameters)
{
$userParameters = array_keys($userParameters);
while (in_array($parameter, $userParameters)) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyz';
for ($i = 0; $i < | php | {
"resource": ""
} |
q260680 | Toolbox.normaliseDriverExceptions | test | public function normaliseDriverExceptions(\Exception $exception)
{
if ($exception instanceof \triagens\ArangoDb\ServerException) {
return array('message' => $exception->getServerMessage(), 'code' => $exception->getServerCode());
} else | php | {
"resource": ""
} |
q260681 | DatabaseManager.createDatabase | test | public function createDatabase($name)
{
try {
Database::create($this->getConnection(), $name);
return true;
} catch (\Exception $e) {
| php | {
"resource": ""
} |
q260682 | DatabaseManager.deleteDatabase | test | public function deleteDatabase($name)
{
try {
Database::delete($this->getConnection(), $name);
return true;
} catch (\Exception $e) {
| php | {
"resource": ""
} |
q260683 | DatabaseManager.getDatabaseInfo | test | public function getDatabaseInfo($name)
{
try {
$connection = $this->getConnection($name);
$info = Database::getInfo($connection);
$result = array();
$result['id'] = $info['result']['id'];
$result['name'] = $info['result']['name'];
$r... | php | {
"resource": ""
} |
q260684 | DatabaseManager.listDatabases | test | public function listDatabases()
{
try {
$connection = $this->getConnection();
$result = Database::listDatabases($connection);
if (empty($result['result'])) {
return array();
} else {
return $result['result'];
}
... | php | {
"resource": ""
} |
q260685 | DatabaseManager.getConnection | test | private function getConnection($database = '_system')
{
$connection = clone $this->_toolbox->getConnection();
| php | {
"resource": ""
} |
q260686 | Client.useConnection | test | public function useConnection($name)
{
if (!array_key_exists($name, $this->_toolboxes)) {
throw new ClientException("The connection ($name) you are trying to | php | {
"resource": ""
} |
q260687 | Client.getToolbox | test | public function getToolbox($name = 'default')
{
if (!array_key_exists($name, $this->_toolboxes)) {
throw new ClientException("The toolbox for connection ($name) | php | {
"resource": ""
} |
q260688 | Client.setModelFormatter | test | public function setModelFormatter(IModelFormatter $formatter)
{
$this->_modelFormatter = | php | {
"resource": ""
} |
q260689 | Client.load | test | public function load($collection, $id)
{
return $this->getToolbox($this->_currentCon | php | {
"resource": ""
} |
q260690 | Client.createGraph | test | public function createGraph($name)
{
$toolbox = $this->getToolbox($this->_currentConnection);
$toolbox->getGraphManager()->createGraph($name);
$this->addConnection($name, | php | {
"resource": ""
} |
q260691 | Client.renameCollection | test | public function renameCollection($collection, $newName)
{
return $this->getToolbox($this->_currentCon | php | {
"resource": ""
} |
q260692 | Client.getIndexInfo | test | public function getIndexInfo($collection, $indexId)
{
return $this->getToolbox($this->_currentConn | php | {
"resource": ""
} |
q260693 | PodManager.load | test | public function load($type, $id)
{
$driver = $this->_toolbox->getDriver();
try {
if ($this->_toolbox->isGraph()) {
switch (strtolower($type)) {
case "vertex":
if ($this->hasTransaction()) {
$this-... | php | {
"resource": ""
} |
q260694 | PodManager.processStoreResult | test | public function processStoreResult($pod, $revision, $id = null)
{
$pod->setSaved();
$pod->setRevision($revision);
if ($id && $pod->getId() === null) {
$pod->setId($id);
| php | {
"resource": ""
} |
q260695 | PodManager.convertToPods | test | public function convertToPods($type, array $documents)
{
$result = array();
foreach ($documents as $document) {
if ($document instanceof \triagens\ArangoDb\Document) {
$model = $this->convertDriverDocumentToPod($document);
$result[$document->getInternal... | php | {
"resource": ""
} |
q260696 | PodManager.convertArrayToPod | test | public function convertArrayToPod($type, array $data)
{
$model = $this->dispense($type);
$pod = $model->getPod();
$pod->loadFromArray($data);
| php | {
"resource": ""
} |
q260697 | PodManager.convertDriverDocumentToPod | test | public function convertDriverDocumentToPod(\triagens\ArangoDb\Document $driverDocument)
{
switch ($driverDocument) {
case $driverDocument instanceof \triagens\ArangoDb\Vertex:
$model = $this->dispense("vertex");
break;
case $driverDocument instanceof ... | php | {
"resource": ""
} |
q260698 | PodManager.createVertex | test | private function createVertex(array $data = array(), $new = true)
{
$vertex = new Vertex($this->_toolbox, $data, $new);
| php | {
"resource": ""
} |
q260699 | PodManager.createEdge | test | private function createEdge(array $data = array(), $new = true)
{
$edge = new Edge($this->_toolbox, $data, $new);
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.