_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q6100 | SMTP.Close | train | public function Close()
{
$this->error = null; // so there is no confusion
$this->helo_rply = null;
if (!empty($this->smtp_conn)) {
// close the connection and cleanup
fclose($this->smtp_conn);
$this->smtp_conn = 0;
}
} | php | {
"resource": ""
} |
q6101 | AbstractProcessor.registerAnnotations | train | static protected function registerAnnotations()
{
if (self::$annotationsRegistered === false) {
AnnotationRegistry::registerFile(__DIR__ . '/../Annotation/ResourceIdentifier.php');
AnnotationRegistry::registerFile(__DIR__ . '/../Annotation/Relationship.php');
AnnotationRe... | php | {
"resource": ""
} |
q6102 | AbstractProcessor.createLink | train | protected function createLink(LinkAnnotation $annotation): Link
{
if (! preg_match(self::RESOURCE_PATTERN, $annotation->resource, $matches)) {
throw new \LogicException(sprintf('Invalid resource definition: "%s"', $annotation->resource));
}
$link = new Link(
$annotat... | php | {
"resource": ""
} |
q6103 | Validator.isValidLocalClass | train | public function isValidLocalClass()
{
$className = SPLASH_CLASS_PREFIX.'\\Local';
//====================================================================//
// Verify Results in Cache
if (isset($this->ValidLocalClass[$className])) {
return $this->ValidLocalClass[$className]... | php | {
"resource": ""
} |
q6104 | Validator.isValidLocalParameterArray | train | public function isValidLocalParameterArray($input)
{
//====================================================================//
// Verify Array Given
if (!is_array($input)) {
return Splash::log()->err(Splash::trans('ErrorCfgNotAnArray', get_class($input)));
}
//===... | php | {
"resource": ""
} |
q6105 | Validator.isValidServerInfos | train | public function isValidServerInfos()
{
$infos = Splash::ws()->getServerInfos();
//====================================================================//
// Verify Array Given
if (!is_a($infos, 'ArrayObject')) {
return Splash::log()->err(Splash::trans('ErrInfosNotArrayObj... | php | {
"resource": ""
} |
q6106 | Validator.isLocalInstallation | train | public function isLocalInstallation($infos)
{
if (false !== strpos($infos['ServerHost'], 'localhost')) {
Splash::log()->war(Splash::trans('WarIsLocalhostServer'));
} elseif (false !== strpos($infos['ServerIP'], '127.0.0.1')) {
Splash::log()->war(Splash::trans('WarIsLocalhostS... | php | {
"resource": ""
} |
q6107 | Validator.isValidObject | train | public function isValidObject($objectType)
{
//====================================================================//
// Verify Result in Cache
if (isset($this->ValidLocalObject[$objectType])) {
return $this->ValidLocalObject[$objectType];
}
$this->ValidLocalObje... | php | {
"resource": ""
} |
q6108 | Validator.isValidObjectId | train | public function isValidObjectId($objectId)
{
//====================================================================//
// Checks Id is not Null
if (is_null($objectId)) {
return Splash::log()->err('ErrEmptyObjectId');
}
//============================================... | php | {
"resource": ""
} |
q6109 | Validator.isValidObjectFieldsList | train | public function isValidObjectFieldsList($fieldsList)
{
//====================================================================//
// Checks List Type
if (!is_array($fieldsList) && !($fieldsList instanceof ArrayObject)) {
return Splash::log()->err('ErrWrongFieldList');
}
... | php | {
"resource": ""
} |
q6110 | Validator.isValidWidget | train | public function isValidWidget($widgetType)
{
//====================================================================//
// Verify Result in Cache
if (isset($this->ValidLocalWidget[$widgetType])) {
return $this->ValidLocalWidget[$widgetType];
}
$this->ValidLocalWidge... | php | {
"resource": ""
} |
q6111 | Validator.isValidLocalPath | train | public function isValidLocalPath()
{
//====================================================================//
// Verify no result in Cache
if (!isset($this->ValidLocalPath)) {
$path = Splash::getLocalPath();
//==========================================================... | php | {
"resource": ""
} |
q6112 | Validator.isValidPHPVersion | train | public function isValidPHPVersion()
{
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
return Splash::log()->err(
'PHP : Your PHP version is too low to use Splash ('.PHP_VERSION.'). PHP >5.6 is Requiered.'
);
}
return Splash::log()->msg(
'... | php | {
"resource": ""
} |
q6113 | Validator.isValidPHPExtensions | train | public function isValidPHPExtensions()
{
$extensions = array('xml', 'soap', 'curl');
foreach ($extensions as $extension) {
if (!extension_loaded($extension)) {
return Splash::log()->err(
'PHP :'.$extension.' PHP Extension is required to use Splash PHP ... | php | {
"resource": ""
} |
q6114 | Validator.isValidSOAPMethod | train | public function isValidSOAPMethod()
{
if (!in_array(Splash::configuration()->WsMethod, array('SOAP', 'NuSOAP'), true)) {
return Splash::log()->err(
'Config : Your selected an unknown SOAP Method ('.Splash::configuration()->WsMethod.').'
);
}
return Sp... | php | {
"resource": ""
} |
q6115 | Validator.isValidConfigurator | train | public function isValidConfigurator($className)
{
//====================================================================//
// Verify Class Exists
if (false == class_exists($className)) {
return Splash::log()->err('Configurator Class Not Found: '.$className);
}
//... | php | {
"resource": ""
} |
q6116 | Validator.isValidObjectFile | train | private function isValidObjectFile($objectType)
{
//====================================================================//
// Verify Local Path Exist
if (false == $this->isValidLocalPath()) {
return false;
}
//=====================================================... | php | {
"resource": ""
} |
q6117 | Validator.isValidObjectClass | train | private function isValidObjectClass($objectType)
{
//====================================================================//
// Check if Object Manager is Overriden
if (Splash::local() instanceof ObjectsProviderInterface) {
//=======================================================... | php | {
"resource": ""
} |
q6118 | Validator.isValidWidgetFile | train | private function isValidWidgetFile($widgetType)
{
//====================================================================//
// Verify Local Path Exist
if (false == $this->isValidLocalPath()) {
return false;
}
//======================================================... | php | {
"resource": ""
} |
q6119 | Validator.isValidWidgetClass | train | private function isValidWidgetClass($widgetType)
{
//====================================================================//
// Check if Widget Manager is Overriden
if (Splash::local() instanceof WidgetsProviderInterface) {
//=======================================================... | php | {
"resource": ""
} |
q6120 | CallbackFactory.instantiateCallback | train | protected function instantiateCallback($callbackClass, $callbackType)
{
if (!is_a($callbackClass, static::$callbackInterface, true))
{
throw new RuntimeException("Callback class '{$callbackClass}' does not implements '" .
static::$callbackInterface ... | php | {
"resource": ""
} |
q6121 | PostgreSQL.getTableGeomType | train | public function getTableGeomType($tableName, $schema = null)
{
$connection = $this->connection;
if (strpos($tableName, '.')) {
list($schema, $tableName) = explode('.', $tableName);
}
$_schema = $schema ? $connection->quote($schema) : 'current_schema()';
$type = $c... | php | {
"resource": ""
} |
q6122 | PostgreSQL.getLastInsertId | train | public function getLastInsertId()
{
$connection = $this->getConnection();
$id = $connection->lastInsertId();
if ($id < 1) {
$fullTableName = $this->tableName;
$fullUniqueIdName = $connection->quoteIdentifier($this->getUniqueId());
$sql = /** @lang PostgreS... | php | {
"resource": ""
} |
q6123 | PostgreSQL.getNodeFromGeom | train | public function getNodeFromGeom($waysVerticesTableName, $waysGeomFieldName, $ewkt, $transformTo = null, $idKey = "id")
{
$db = $this->getConnection();
$geom = "ST_GeometryFromText('" . $db->quote($ewkt) . "')";
if ($transformTo) {
$geom = "ST_TRANSFORM($geom, $transformTo)";
... | php | {
"resource": ""
} |
q6124 | PostgreSQL.routeBetweenNodes | train | public function routeBetweenNodes(
$waysTableName,
$waysGeomFieldName,
$startNodeId,
$endNodeId,
$srid,
$directedGraph = false,
$hasReverseCost = false)
{
/** @var Connection $db */
$db = $this->getConnection();
$waysTableName = $db->qu... | php | {
"resource": ""
} |
q6125 | Insurer.all | train | public function all(string $country = 'MY', ?Query $query = null): Response
{
return $this->send(
'GET', "insurer/{$country}", $this->getApiHeaders(), $this->buildHttpQuery($query)
);
} | php | {
"resource": ""
} |
q6126 | FeatureType.getById | train | public function getById($id, $srid = null)
{
$rows = $this->getSelectQueryBuilder($srid)
->where($this->getUniqueId() . " = :id")
->setParameter('id', $id)
->execute()
->fetchAll();
$this->prepareResults($rows, $srid);
return reset($rows);
... | php | {
"resource": ""
} |
q6127 | FeatureType.search | train | public function search(array $criteria = array())
{
/** @var Statement $statement */
/** @var Feature $feature */
$maxResults = isset($criteria['maxResults']) ? intval($criteria['maxResults']) : self::MAX_RESULTS;
$intersect = isset($criteria['intersectGeometry']) ? $crite... | php | {
"resource": ""
} |
q6128 | FeatureType.getTableSequenceName | train | public function getTableSequenceName()
{
$connection = $this->getConnection();
$result = $connection->fetchColumn("SELECT column_default from information_schema.columns where table_name='" . $this->getTableName() . "' and column_name='" . $this->getUniqueId() . "'");
$result = explod... | php | {
"resource": ""
} |
q6129 | FeatureType.getFileUri | train | public function getFileUri($fieldName = null)
{
$path = self::UPLOAD_DIR_NAME . "/" . $this->getTableName();
if ($fieldName) {
$path .= "/" . $fieldName;
}
foreach ($this->getFileInfo() as $fileInfo) {
if (isset($fileInfo["field"]) && isset($fileInfo["uri"])... | php | {
"resource": ""
} |
q6130 | FeatureType.getFilePath | train | public function getFilePath($fieldName = null, $createPath = true)
{
$path = realpath(AppComponent::getUploadsDir($this->container)) . "/" . $this->getFileUri($fieldName);
foreach ($this->getFileInfo() as $fileInfo) {
if (isset($fileInfo["field"]) && isset($fileInfo["path"]) && $fieldNa... | php | {
"resource": ""
} |
q6131 | FeatureType.genFilePath | train | public function genFilePath($fieldName = null)
{
$id = $this->countFiles($fieldName) + 1;
$src = null;
$path = null;
while (1) {
$path = $id; //. "-" . System::generatePassword(12) ;
$src = $this->getFilePath($fieldName) . "/" . $path;
if (!fi... | php | {
"resource": ""
} |
q6132 | FeatureType.countFiles | train | private function countFiles($fieldName = null)
{
$finder = new Finder();
$finder->files()->in($this->getFilePath($fieldName));
return count($finder);
} | php | {
"resource": ""
} |
q6133 | FeatureType.routeBetweenGeom | train | public function routeBetweenGeom($sourceGeom, $targetGeom)
{
$driver = $this->getDriver();
$srid = $this->getSrid();
$sourceNode = $driver->getNodeFromGeom($this->waysVerticesTableName, $this->waysGeomFieldName, $sourceGeom, $srid, 'id');
$targetNode = $driver->getNodeFromG... | php | {
"resource": ""
} |
q6134 | FeatureType.getByIds | train | public function getByIds($ids, $prepareResults = true)
{
$queryBuilder = $this->getSelectQueryBuilder();
$connection = $queryBuilder->getConnection();
$rows = $queryBuilder->where(
$queryBuilder->expr()->in($this->getUniqueId(), array_map(function ($id) use ($connection... | php | {
"resource": ""
} |
q6135 | FeatureType.getConfiguration | train | public function getConfiguration($key = null)
{
return isset($this->_args[ $key ]) ? $this->_args[ $key ] : null;
} | php | {
"resource": ""
} |
q6136 | FeatureType.export | train | public function export(array &$rows)
{
$config = $this->getConfiguration('export');
$fieldNames = isset($config['fields']) ? $config['fields'] : null;
$result = array();
if ($fieldNames) {
foreach ($rows as &$row) {
$exportRow = array();
... | php | {
"resource": ""
} |
q6137 | ConsoleExporterTrait.getConsoleLog | train | public function getConsoleLog($clean = false)
{
$result = null;
//====================================================================//
// Read All Messages as Html
$result .= $this->getConsole($this->err, ' - Error => ', self::CMD_COLOR_ERR);
$result .= $this->getConsole... | php | {
"resource": ""
} |
q6138 | ConsoleExporterTrait.getConsole | train | private function getConsole($msgArray, $title = '', $color = 0)
{
$result = '';
if ((is_array($msgArray) || $msgArray instanceof Countable) && count($msgArray)) {
//====================================================================//
// Add Messages
foreach ($ms... | php | {
"resource": ""
} |
q6139 | AttributeHandler.processAttributeToResource | train | protected function processAttributeToResource($object, ResourceObject $resource, Attribute $definition)
{
$name = $definition->getName();
$getter = $definition->getGetter();
$value = $object->$getter();
if ($value === null && ! $definition->getProcessNull()) {
return;... | php | {
"resource": ""
} |
q6140 | AttributeHandler.processResourceToAttribute | train | protected function processResourceToAttribute($object, ResourceObject $resource, Attribute $definition)
{
$name = $definition->getName();
if (! $resource->hasAttribute($name)) {
return;
}
$value = $resource->getAttribute($name);
if ($value === null && ! $defini... | php | {
"resource": ""
} |
q6141 | Html._parse_form_attributes | train | private static function _parse_form_attributes($attributes, $default)
{
if (is_array($attributes)) {
foreach ($default as $key => $val) {
if (isset($attributes[$key])) {
$default[$key] = $attributes[$key];
unset($attributes[$key]);
... | php | {
"resource": ""
} |
q6142 | DateIntervalHandler.resolveFormat | train | protected function resolveFormat(\DateInterval $interval): string
{
$baseFormat = $this->resolveBaseFormat($interval);
$timeFormat = $this->resolveTimeFormat($interval);
if ($baseFormat === '') {
if ($timeFormat === '') {
return '';
}
ret... | php | {
"resource": ""
} |
q6143 | DateIntervalHandler.resolveBaseFormat | train | protected function resolveBaseFormat(\DateInterval $interval): string
{
$format = '';
if ($interval->y > 0) {
$format .= '%yY';
}
if ($interval->m > 0) {
$format .= '%mM';
}
if ($interval->d > 0) {
$format .= '%dD';
}
... | php | {
"resource": ""
} |
q6144 | DateIntervalHandler.resolveTimeFormat | train | protected function resolveTimeFormat(\DateInterval $interval): string
{
$format = '';
if ($interval->h > 0) {
$format .= '%hH';
}
if ($interval->i > 0) {
$format .= '%iM';
}
if ($interval->s > 0) {
$format .= '%sS';
}
... | php | {
"resource": ""
} |
q6145 | App.getInstance | train | public static function getInstance(ServerRequestInterface $request)
{
if (is_null(self::$instance)) {
$class = get_called_class();
self::$instance = new $class($request);
}
return self::$instance;
} | php | {
"resource": ""
} |
q6146 | App.run | train | public function run()
{
$request = clone $this->request;
$response = new Response(404, new Stream(null));
$this->container->callHook('app.response.before', [ &$request, &$response ]);
if (($route = $this->router->parse($request)) && $response->getStatusCode() == 404) {
... | php | {
"resource": ""
} |
q6147 | App.loadRoutesAndServices | train | protected function loadRoutesAndServices()
{
foreach ($this->modules as $module) {
if ($module->getPathRoutes()) {
$routesConfig = Util::getJson($module->getPathRoutes());
$this->routes += $routesConfig;
}
if ($module->getPathServices()) {... | php | {
"resource": ""
} |
q6148 | YamlDefinitionProvider.readConfig | train | protected function readConfig(string $path): array
{
if (! is_readable($path)) {
throw new DefinitionProviderException(sprintf('File "%s" with definition is not readable.', $path));
}
$content = file_get_contents($path);
$config = $this->parser->parse($content);
... | php | {
"resource": ""
} |
q6149 | YamlDefinitionProvider.getSchema | train | protected function getSchema(): NodeInterface
{
if ($this->schema === null) {
$this->schema = $this->config->getConfigTreeBuilder()->buildTree();
}
return $this->schema;
} | php | {
"resource": ""
} |
q6150 | Drivers.create | train | public function create(int $fleetId, string $fullname, string $identification, array $optional = []): Response
{
$this->requiresAccessToken();
return $this->sendJson(
'POST',
"fleets/{$fleetId}/drivers",
$this->getApiHeaders(),
\array_merge($optional,... | php | {
"resource": ""
} |
q6151 | AnnotationDefinitionProvider.createDefinition | train | protected function createDefinition(\ReflectionClass $reflection): Definition
{
$definition = new Definition($reflection->getName());
foreach ($this->processors as $processor)
{
$processor->process($reflection, $definition);
}
$parent = $reflection->getParentCla... | php | {
"resource": ""
} |
q6152 | LinkHandler.createLink | train | protected function createLink(LinkDefinition $definition, LinkData $data): LinkObject
{
$reference = $data->getReference();
$metadata = array_replace(
$data->getMetadata(),
$definition->getMetadata()
);
return new LinkObject($reference, $metadata);
} | php | {
"resource": ""
} |
q6153 | Application.run | train | function run()
{
// Set default error level, In dev env show all errors
// ini_set('display_errors', Config::get('show_errors') ? 'Off' : 'Off');
ini_set('display_errors', 'Off');
error_reporting(E_ALL | E_STRICT);
if (!defined('SERVER_MODE')) {
// Mark server mo... | php | {
"resource": ""
} |
q6154 | Profile.update | train | public function update(array $payload): Response
{
$this->requiresAccessToken();
return $this->sendJson(
'PATCH', 'profile', $this->getApiHeaders(), $this->mergeApiBody($payload)
);
} | php | {
"resource": ""
} |
q6155 | Profile.verifyPassword | train | public function verifyPassword(string $password): bool
{
$this->requiresAccessToken();
try {
$response = $this->send(
'POST',
'auth/verify',
$this->getApiHeaders(),
$this->mergeApiBody(compact('password'))
);
... | php | {
"resource": ""
} |
q6156 | Profile.uploadAvatar | train | public function uploadAvatar(string $file): Response
{
$this->requiresAccessToken();
return $this->stream(
'POST', 'profile/avatar', $this->getApiHeaders(), $this->getApiBody(), compact('file')
);
} | php | {
"resource": ""
} |
q6157 | ContactServiceProvider.registerContactMailer | train | protected function registerContactMailer()
{
$this->app->bind('contact.mailer', function ($app) {
$mail = $app['mailer'];
$home = $app['url']->to('/');
$path = $app['config']['contact.path'];
$email = $app['config']['contact.email'];
$name = $app['... | php | {
"resource": ""
} |
q6158 | ContactServiceProvider.registerContactController | train | protected function registerContactController()
{
$this->app->bind(ContactController::class, function ($app) {
$throttler = $app['throttle']->get($app['request'], 2, 30);
$path = $app['config']['contact.path'];
return new ContactController($throttler, $path);
});
... | php | {
"resource": ""
} |
q6159 | IntelParserTrait.verifyRequiredFields | train | public function verifyRequiredFields()
{
foreach ($this->Fields() as $field) {
//====================================================================//
// Field is NOT required
if (!$field["required"]) {
continue;
}
//==============... | php | {
"resource": ""
} |
q6160 | IntelParserTrait.setObjectData | train | private function setObjectData()
{
//====================================================================//
// Walk on All Requested Fields
//====================================================================//
$fields = is_a($this->in, "ArrayObject") ? $this->in->getArrayCopy() : ... | php | {
"resource": ""
} |
q6161 | IntelParserTrait.identifyMethods | train | private static function identifyMethods($prefix)
{
//====================================================================//
// Prepare List of Available Methods
$result = array();
foreach (get_class_methods(__CLASS__) as $method) {
if (0 !== strpos($method, $prefix)) {
... | php | {
"resource": ""
} |
q6162 | IntelParserTrait.verifyRequiredFieldIsAvailable | train | private function verifyRequiredFieldIsAvailable($fieldId)
{
//====================================================================//
// Detect List Field Names
if (!method_exists($this, "Lists") || !self::lists()->listName($fieldId)) {
//==========================================... | php | {
"resource": ""
} |
q6163 | AbstractConfigurator.getConfigurationValue | train | private function getConfigurationValue($key1, $key2 = null)
{
//====================================================================//
// Load Configuration from Configurator
$config = $this->getConfiguration();
//====================================================================//... | php | {
"resource": ""
} |
q6164 | AbstractConfigurator.sercureParameters | train | private static function sercureParameters(&$parameters)
{
//====================================================================//
// Detect Travis from SERVER CONSTANTS => Allow Unsecure for Testing
if (!empty(Splash::input('SPLASH_TRAVIS'))) {
return;
}
//======... | php | {
"resource": ""
} |
q6165 | AbstractConfigurator.updateField | train | private static function updateField($field, $values)
{
Splash::log()->trace();
//====================================================================//
// Check New Configuration is an Array
if (!is_array($values)) {
return $field;
}
//===================... | php | {
"resource": ""
} |
q6166 | AbstractConfigurator.updateFieldStrVal | train | private static function updateFieldStrVal(&$field, $values, $key)
{
if (isset($values[$key]) && is_string($values[$key])) {
$field->{$key} = $values[$key];
}
} | php | {
"resource": ""
} |
q6167 | AbstractConfigurator.updateFieldBoolVal | train | private static function updateFieldBoolVal(&$field, $values, $key)
{
if (isset($values[$key]) && is_scalar($values[$key])) {
$field->{$key} = (bool) $values[$key];
}
} | php | {
"resource": ""
} |
q6168 | AbstractConfigurator.updateFieldMeta | train | private static function updateFieldMeta(&$field, $values)
{
// Update Field Meta ItemType
self::updateFieldStrVal($field, $values, "itemtype");
// Update Field Meta ItemProp
self::updateFieldStrVal($field, $values, "itemprop");
// Update Field Meta Tag
if (isset($valu... | php | {
"resource": ""
} |
q6169 | FeatureTypeService.get | train | public function get($id)
{
if (empty($this->instances[$id])) {
$declarations = $this->getFeatureTypeDeclarations();
if (empty($declarations[$id])) {
throw new \RuntimeException("No FeatureType with id " . var_export($id, true));
}
$this->instan... | php | {
"resource": ""
} |
q6170 | FeatureTypeService.search | train | public function search()
{
foreach ($this->getFeatureTypeDeclarations() as $id => $declaration) {
if (empty($this->instances[$id])) {
$this->instances[$id] = new FeatureType($this->container, $declaration);
}
}
return $this->instances;
} | php | {
"resource": ""
} |
q6171 | Typo3.createMessage | train | public function createMessage( $charset = 'UTF-8' )
{
$closure = $this->closure;
return new \Aimeos\MW\Mail\Message\Typo3( $closure(), $charset );
} | php | {
"resource": ""
} |
q6172 | Typo3.send | train | public function send( \Aimeos\MW\Mail\Message\Iface $message )
{
$message->getObject()->send();
} | php | {
"resource": ""
} |
q6173 | Attribute.merge | train | public function merge(self $attribute)
{
if ($this->propertyName === null && $attribute->hasPropertyName()) {
$this->propertyName = $attribute->getPropertyName();
}
if ($this->type === null && $attribute->hasType()) {
$this->type = $attribute->getType();
}
... | php | {
"resource": ""
} |
q6174 | Command.execute | train | public function execute(array $args, array $options = array())
{
if (!count($args)) {
throw new ConsoleException("Missing subcommand name");
}
$command = ucfirst(Utils::camelize(array_shift($args)));
$methodName = "execute$command";
if (!method_exists($th... | php | {
"resource": ""
} |
q6175 | Command.writeerr | train | public function writeerr($text)
{
return $this->write($text, Colors::RED | Colors::BOLD, TextWriter::STDERR);
} | php | {
"resource": ""
} |
q6176 | Query.includes | train | protected function includes($includes)
{
$includes = \is_array($includes) ? $includes : \func_get_args();
$this->includes = $includes;
return $this;
} | php | {
"resource": ""
} |
q6177 | Query.onTimeZone | train | protected function onTimeZone(?string $timeZoneCode)
{
if (\is_null($timeZoneCode)) {
$this->timezone = null;
} elseif (\in_array($timeZoneCode, \timezone_identifiers_list())) {
$this->timezone = $timeZoneCode;
}
return $this;
} | php | {
"resource": ""
} |
q6178 | Query.excludes | train | protected function excludes($excludes)
{
$excludes = \is_array($excludes) ? $excludes : \func_get_args();
$this->excludes = $excludes;
return $this;
} | php | {
"resource": ""
} |
q6179 | Query.build | train | public function build(callable $callback): array
{
$data = [];
foreach (['includes', 'excludes'] as $key) {
if (! empty($this->{$key})) {
$data[$key] = \implode(',', $this->{$key});
}
}
if (! \is_null($this->timezone)) {
$data['ti... | php | {
"resource": ""
} |
q6180 | Request.getApiHeaders | train | protected function getApiHeaders(): array
{
$headers = [
'Accept' => "application/vnd.KATSANA.{$this->getVersion()}+json",
'Time-Zone' => $this->requestHeaderTimezoneCode ?? 'UTC',
];
if (! \is_null($accessToken = $this->client->getAccessToken())) {
$head... | php | {
"resource": ""
} |
q6181 | Request.onTimeZone | train | final public function onTimeZone(string $timeZoneCode): self
{
if (\in_array($timeZoneCode, \timezone_identifiers_list())) {
$this->requestHeaderTimezoneCode = $timeZoneCode;
}
return $this;
} | php | {
"resource": ""
} |
q6182 | Logger.setDebug | train | public function setDebug($debug)
{
//====================================================================//
// Change Parameter State
$this->debug = $debug;
//====================================================================//
// Delete Existing Debug Messages
if (... | php | {
"resource": ""
} |
q6183 | Logger.err | train | public function err($text = null, $param1 = '', $param2 = '', $param3 = '', $param4 = '')
{
//====================================================================//
// Safety Check
if (is_null($text)) {
return false;
}
//===========================================... | php | {
"resource": ""
} |
q6184 | Logger.war | train | public function war($text = null, $param1 = '', $param2 = '', $param3 = '', $param4 = '')
{
//====================================================================//
// Safety Check
if (is_null($text)) {
return true;
}
//============================================... | php | {
"resource": ""
} |
q6185 | Logger.trace | train | public function trace()
{
//====================================================================//
// Safety Check
if (!isset($this->debug) || !$this->debug) {
return;
}
//====================================================================//
// Build Erro... | php | {
"resource": ""
} |
q6186 | Logger.cleanLog | train | public function cleanLog()
{
if (isset($this->err)) {
$this->err = array();
}
if (isset($this->war)) {
$this->war = array();
}
if (isset($this->msg)) {
$this->msg = array();
}
if (isset($this->deb)) {
$this->deb ... | php | {
"resource": ""
} |
q6187 | Logger.getRawLog | train | public function getRawLog($clean = false)
{
$raw = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
if ($this->err) {
$raw->err = $this->err;
}
if ($this->war) {
$raw->war = $this->war;
}
if ($this->msg) {
$raw->msg = $this->m... | php | {
"resource": ""
} |
q6188 | Logger.merge | train | public function merge($logs)
{
if (!empty($logs->msg)) {
$this->mergeCore('msg', $logs->msg);
$this->addLogBlockToFile($logs->msg, 'MESSAGE');
}
if (!empty($logs->err)) {
$this->mergeCore('err', $logs->err);
$this->addLogBlockToFile($logs->err... | php | {
"resource": ""
} |
q6189 | Logger.flushOuputBuffer | train | public function flushOuputBuffer()
{
//====================================================================//
// Read the contents of the output buffer
$contents = ob_get_contents();
//====================================================================//
// Clean (erase) the... | php | {
"resource": ""
} |
q6190 | Logger.coreAddLog | train | private function coreAddLog($type, $message)
{
//====================================================================//
// Safety Check
if (is_null($message)) {
return;
}
//====================================================================//
// Initialis... | php | {
"resource": ""
} |
q6191 | Logger.mergeCore | train | private function mergeCore($logType, $logArray)
{
//====================================================================//
// Fast Line
if (empty($logArray)) {
return;
}
//====================================================================//
// Detect Arr... | php | {
"resource": ""
} |
q6192 | NifValidator.isValid | train | public static function isValid(string $nif): bool
{
return self::isValidDni($nif) || self::isValidNie($nif) || self::isValidCif($nif) || self::isValidOtherPersonalNif($nif);
} | php | {
"resource": ""
} |
q6193 | NifValidator.isValidPersonal | train | public static function isValidPersonal(string $nif): bool
{
return self::isValidDni($nif) || self::isValidNie($nif) || self::isValidOtherPersonalNif($nif);
} | php | {
"resource": ""
} |
q6194 | NifValidator.isValidDni | train | public static function isValidDni(string $dni): bool
{
if (!preg_match(self::DNI_REGEX, $dni, $matches)) {
return false;
}
if ('00000000' === $matches['number']) {
return false;
}
return self::DNINIE_CHECK_TABLE[$matches['number'] % 23] === $matches['... | php | {
"resource": ""
} |
q6195 | NifValidator.isValidNie | train | public static function isValidNie(string $nie): bool
{
if (!preg_match(self::NIE_REGEX, $nie, $matches)) {
return false;
}
$nieType = strpos(self::NIE_TYPES, $matches['type']);
$nie = $nieType . $matches['number'];
return self::DNINIE_CHECK_TABLE[$nie % 23] === ... | php | {
"resource": ""
} |
q6196 | NifValidator.isValidOtherPersonalNif | train | public static function isValidOtherPersonalNif(string $nif): bool
{
if (!preg_match(self::OTHER_PERSONAL_NIF_REGEX, $nif, $matches)) {
return false;
}
return self::isValidNifCheck($nif, $matches);
} | php | {
"resource": ""
} |
q6197 | NifValidator.isValidCif | train | public static function isValidCif(string $cif): bool
{
if (!preg_match(self::CIF_REGEX, $cif, $matches)) {
return false;
}
return self::isValidNifCheck($cif, $matches);
} | php | {
"resource": ""
} |
q6198 | DB_mysqlco.prepareDB | train | private function prepareDB()
{
$dbpool = DBPool::init($this->db_config);
// var_dump($dbpool->cap + $dbpool->activeCount, $dbpool->queue->isEmpty(), $dbpool->queue->count());
if ($dbpool->queue->isEmpty() && ($dbpool->cap + $dbpool->activeCount >= $this->config['max_pool_size'])) {
... | php | {
"resource": ""
} |
q6199 | Httpclient.get | train | public function get($url, $params = array(), $options = array())
{
return $this->request($url, self::GET, $params, $options);
} | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.