_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q5900
Webservice.getNextResult
train
public static function getNextResult(&$response) { //====================================================================// // Extract Next Task From Buffer $task = self::getNextTask($response); //====================================================================// // Analyze SOAP Results if (!$task || !isset($task->data)) {
php
{ "resource": "" }
q5901
Webservice.getNextTask
train
public static function getNextTask(&$response) { //====================================================================// // Analyze SOAP Results if (!$response || !isset($response->result) || (true != $response->result)) { return false; } //====================================================================// // Check if Tasks Buffer is Empty if (!Splash::count($response->tasks)) { return false; } //====================================================================// // Detect ArrayObjects
php
{ "resource": "" }
q5902
Webservice.getServerInfos
train
public function getServerInfos() { //====================================================================// // Init Result Array $response = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); //====================================================================// // Server Infos $response->ServerType = 'PHP'; // INFO - Server Language Type $response->ServerVersion = PHP_VERSION; // INFO - Server Language Version $response->ProtocolVersion = SPL_PROTOCOL; // INFO - Server Protocal Version //====================================================================// // Server Infos $response->Self = Splash::input('PHP_SELF'); // INFO - Current Url $response->ServerAddress = Splash::input('SERVER_ADDR'); // INFO - Server IP Address // Read System Folder without symlinks
php
{ "resource": "" }
q5903
Webservice.getServerName
train
public function getServerName() { //====================================================================// // Check if Server Name is Overiden by Application Module if (isset(Splash::configuration()->ServerHost)) { return Splash::configuration()->ServerHost; } //====================================================================// // Check if Available with Secured Reading if (!empty(Splash::input('SERVER_NAME'))) {
php
{ "resource": "" }
q5904
Webservice.verify
train
private function verify() { //====================================================================// // Verify host address is present if (empty($this->host)) { return Splash::log()->err('ErrWsNoHost'); } //====================================================================// // Verify Server Id not empty if (empty($this->id)) { return Splash::log()->err('ErrWsNoId'); } //====================================================================// // Verify Server Id not empty if (empty($this->key)) { return Splash::log()->err('ErrWsNoKey'); }
php
{ "resource": "" }
q5905
Webservice.cleanIn
train
private function cleanIn() { //====================================================================// // Free current output buffer $this->inputs = null; //====================================================================//
php
{ "resource": "" }
q5906
Webservice.cleanOut
train
private function cleanOut() { //====================================================================// // Free current tasks list $this->tasks = null; //====================================================================// // Initiate a new tasks list $this->tasks = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); //====================================================================// // Free current output buffer
php
{ "resource": "" }
q5907
Webservice.init
train
private function init($service) { //====================================================================// // Debug Splash::log()->deb('MsgWsCall'); //====================================================================// // Safety Check if (!$this->verify()) { return Splash::log()->err('ErrWsInValid'); } //====================================================================// // Clean Data Input Buffer $this->cleanIn(); //====================================================================//
php
{ "resource": "" }
q5908
Webservice.addTasks
train
private function addTasks($tasks = null) { //====================================================================// // No tasks to Add if (is_null($tasks) && empty($this->tasks)) { return true; } //====================================================================// // Prepare Tasks To Perform //====================================================================// //====================================================================// // Add Internal Tasks to buffer if (!empty($this->tasks)) { $this->outputs->tasks = $this->tasks; $this->outputs->taskscount = count($this->outputs->tasks); Splash::log()->deb('[WS] Call Loaded '.$this->outputs->tasks->count().' Internal tasks');
php
{ "resource": "" }
q5909
Webservice.buildClient
train
private function buildClient() { //====================================================================// // Compute target client url if ((false === strpos($this->host, 'http://')) && (false === strpos($this->host, 'https://'))) { $this->url = 'https://'.$this->host; } else {
php
{ "resource": "" }
q5910
Webservice.decodeResponse
train
private function decodeResponse($isUncrypted) { //====================================================================// // Unpack NuSOAP Answer //====================================================================// if (!empty($this->rawIn)) { //====================================================================// // Unpack Data from Raw packet $this->inputs = $this->unPack($this->rawIn, $isUncrypted); //====================================================================// // Merge Logging Messages from remote with current class messages if (isset($this->inputs->log)) { Splash::log()->merge($this->inputs->log); }
php
{ "resource": "" }
q5911
Webservice.getClientUrl
train
private function getClientUrl() { //====================================================================// // Fetch Server Informations $serverInfos = $this->getServerInfos(); //====================================================================// // Build Server Url $host = $serverInfos['ServerHost']; if ((false !== strpos($host, 'http://'))
php
{ "resource": "" }
q5912
Webservice.getClientDebugLink
train
private function getClientDebugLink() { //====================================================================// // Compute target client debug url $url =
php
{ "resource": "" }
q5913
OpensearchFactory.getClient
train
protected function getClient(array $config) { $client = new CloudsearchClient( $config['client_id'], $config['client_secret'], $config['host'], 'aliyun' );
php
{ "resource": "" }
q5914
GenericFieldsTrait.setGenericObject
train
protected function setGenericObject($fieldName, $fieldData, $objectName = "object", $nullable = true) { //====================================================================// // Load New Object Id $newId = null; if ($fieldData && method_exists($fieldData, "getId") && $fieldData->getId()) { $newId = $fieldData->getId(); } //====================================================================// // Read Current Object Id $currentId = $this->getObjectId($fieldName, $objectName); //====================================================================// // No Changes if ($newId == $currentId) { return $this; } //====================================================================// // Check Pointed Object Exists & Has an Id
php
{ "resource": "" }
q5915
GenericFieldsTrait.getGeneric
train
protected function getGeneric($fieldName, $objectName = "object") { $this->out[$fieldName]
php
{ "resource": "" }
q5916
GenericFieldsTrait.getGenericBool
train
protected function getGenericBool($fieldName, $objectName = "object") {
php
{ "resource": "" }
q5917
GenericFieldsTrait.getGenericDate
train
protected function getGenericDate($fieldName, $objectName = "object") { $date = $this->{$objectName}->{ "get".$fieldName}();
php
{ "resource": "" }
q5918
GenericFieldsTrait.setGenericDate
train
protected function setGenericDate($fieldName, $fieldData, $objectName = "object") { //====================================================================// // Compare Field Data $current = $this->{$objectName}->{ "get".$fieldName}(); if (($current instanceof DateTime) && ($current->format(SPL_T_DATECAST) == $fieldData)) { return $this; }
php
{ "resource": "" }
q5919
GenericFieldsTrait.getGenericDateTime
train
protected function getGenericDateTime($fieldName, $objectName = "object") { $date = $this->{$objectName}->{ "get".$fieldName}();
php
{ "resource": "" }
q5920
GenericFieldsTrait.setGenericDateTime
train
protected function setGenericDateTime($fieldName, $fieldData, $objectName = "object") { //====================================================================// // Compare Field Data $current = $this->{$objectName}->{ "get".$fieldName}(); if (($current instanceof DateTime) && ($current->format(SPL_T_DATETIMECAST) == $fieldData)) { return $this; }
php
{ "resource": "" }
q5921
ClassBasedTypeHandler.resolveType
train
protected function resolveType(string $class): string { $name = str_replace(['\\', '_'], $this->delimiter, ucwords($class, '\\_')); if ($this->fullName) { return $name; }
php
{ "resource": "" }
q5922
Server.printServerFinger
train
private function printServerFinger() { $version = $this->version; $software = SERVER_MODE === 'swoole' ? 'Swoole Server' : 'PHP Development Server'; $document_root = APP_PATH . '/public'; echo <<<EOT -----------------------------------\033[32m ____ __ __ ____ /\ _`\ /\ \/\ \/\ _`\ __\ \ \ \ \ \ \_\ \ \ \ \ \ /'__`\ \ ,__/\ \ _ \ \ ,__/ /\ __/\ \ \ \ \ \ \ \ \ \ \ \____ \\ \_\ \ \_\ \_\ \_\ \/____/ \/_/ \/_/\/_/\/_/ \033[43;37mv{$version}\033[0m \033[0m >>> \033[35m{$software}\033[0m started ... Listening
php
{ "resource": "" }
q5923
Server.devServer
train
public function devServer(string $host, int $port) { // Mark server mode define('SERVER_MODE', 'buildin'); $this->config['host'] = $host;
php
{ "resource": "" }
q5924
Server.createServer
train
public function createServer(array $config) { // Mark server mode define('SERVER_MODE', 'swoole'); $this->config = $config + [ 'host' => '0.0.0.0', 'port' => '8000', 'task_worker_num' => 0, 'enable_websocket'=> false ]; // Start websocket or http server
php
{ "resource": "" }
q5925
Server.add_event_listener
train
public function add_event_listener(string $event) { // Automatically instantiate this class if ( class_exists("\App\Boot") ) { // Excute a boot instance $boot = new \App\Boot(); if ( method_exists($boot, $event) )
php
{ "resource": "" }
q5926
Server.start
train
public function start() { // Linsten http Event $this->server->on('request', [$this, 'onRequest']); $this->server->on('start', [$this, 'onStart']); $this->server->on('shutdown', [$this, 'onShutdown']); $this->server->on('workerStart', [$this, 'onWorkerStart']); $this->server->on('workerStop', [$this, 'onWorkerStop']);
php
{ "resource": "" }
q5927
Server.onRequest
train
public function onRequest(Request $request, Response $response) { // Compat fpm server $this->_compatFPM($request); // 注入全局变量 $GLOBALS['__$response'] = $response; $response->header('Server', 'ePHP/'. $this->version); $filename = APP_PATH . '/public'. $_SERVER['PATH_INFO']; // !in_array($extname, ['css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico']) // Try files, otherwise route to app if ( !is_file($filename) ) { ob_start(); (new \ePHP\Core\Application())->run(); $h = ob_get_clean(); // Fixed output o byte // if (strlen($h) === 0) { // $h = ' '; // } $response->end($h);
php
{ "resource": "" }
q5928
Server.onWorkerStart
train
public function onWorkerStart(\Swoole\Server $server, int $worker_id) { // STDOUT_LOG模式,不打印 worker stop 输出 if ( getenv('STDOUT_LOG') ) { echo date('Y-m-d H:i:s') . " |\033[31m ...... http worker process
php
{ "resource": "" }
q5929
Server.onWorkerError
train
public function onWorkerError(\Swoole\Server $server, int $worker_id, int $worker_pid, int $exit_code) { echo date('Y-m-d H:i:s') . " |\033[31m http worker process error[id={$worker_id} pid={$worker_pid}]
php
{ "resource": "" }
q5930
Server.onOpen
train
public function onOpen(\Swoole\WebSocket\Server $server, \Swoole\Http\Request $request) { // echo "[websocket][onopen]server: handshake success with fd{$request->fd} url={$request->server['request_uri']}?{$request->server['query_string']}\n"; // Compat fpm server $this->_compatFPM($request); // print_r(self::$websocketFrameContext); // filter websocket router class // route struct: [$controller_name, $controller_class] $controller_class = (\ePHP\Core\Route::init())->findWebSocketRoute(); if ( !empty($controller_class) ) { // Save websocket connection Context self::$websocketFrameContext[$request->fd] = [
php
{ "resource": "" }
q5931
Server.onMessage
train
public function onMessage(\Swoole\WebSocket\Server $server, \Swoole\WebSocket\Frame $frame) { // echo "[websocket][onmessage]receive from {$frame->fd}:{$frame->data},opcode:{$frame->opcode},fin:{$frame->finish}\n"; // $server->push($frame->fd, "this is server"); // print_r(self::$websocketFrameContext); if ( empty(self::$websocketFrameContext[$frame->fd]) ) { if ( getenv('STDOUT_LOG') ) { echo date('Y-m-d H:i:s') . " |\033[31m [ERROR][onMessage] WebSocket has been stoped before frame sending data\033[0m \n"; } return; }
php
{ "resource": "" }
q5932
Server.onClose
train
public function onClose(\Swoole\WebSocket\Server $server, int $fd) { // echo "[websocket][onclose]client fd{$fd} closed\n"; if ( empty(self::$websocketFrameContext[$fd]) ) { if ( getenv('STDOUT_LOG') ) { echo date('Y-m-d H:i:s') . " |\033[31m [ERROR][onClose] fd{$fd} WebSocket has been stoped...\033[0m \n"; } return; } // Save websocket connection Context $context = self::$websocketFrameContext[$fd]; // Restore global
php
{ "resource": "" }
q5933
BaseElement.prepareItems
train
public function prepareItems($items) { if (!is_array($items)) { return $items; } elseif (self::isAssoc($items)) { $items = $this->prepareItem($items); } else { foreach
php
{ "resource": "" }
q5934
BaseElement.prepareItem
train
protected function prepareItem($item) { if (!isset($item["type"])) { return $item; } if (isset($item["children"])) { $item["children"] = $this->prepareItems($item["children"]); } switch ($item['type']) { case 'select': if (isset($item['sql'])) { $connectionName = isset($item['connection']) ? $item['connection'] : 'default'; $sql = $item['sql']; $options = isset($item["options"]) ? $item["options"] : array(); unset($item['sql']); unset($item['connection']); /** @var Connection $connection */ $connection = $this->container->get("doctrine.dbal.{$connectionName}_connection"); $all = $connection->fetchAll($sql); foreach ($all as $option) { $options[] = array(reset($option), end($option)); } $item["options"] = $options; } if (isset($item['service'])) { $serviceInfo = $item['service']; $serviceName = isset($serviceInfo['serviceName']) ? $serviceInfo['serviceName'] : 'default'; $method = isset($serviceInfo['method']) ? $serviceInfo['method'] : 'get'; $args = isset($serviceInfo['args']) ? $item['args'] : ''; $service = $this->container->get($serviceName); $options = $service->$method($args); $item['options'] = $options;
php
{ "resource": "" }
q5935
BaseElement.decodeRequest
train
public function decodeRequest(array $request) { foreach ($request as $key => $value) { if (is_array($value)) { $request[ $key ] = $this->decodeRequest($value); } elseif (strpos($key, '[')) {
php
{ "resource": "" }
q5936
BaseElement.getType
train
public static function getType() { $clsInfo = explode('\\', get_called_class()); $namespaceParts = array_slice($clsInfo, 0, -1); // convention: AdminType classes are placed into the "<bundle>\Element\Type" namespace $namespaceParts[] = "Type"; $bareClassName = implode('', array_slice($clsInfo, -1)); // convention: AdminType
php
{ "resource": "" }
q5937
BaseElement.autoTemplate
train
private static function autoTemplate($section, $suffix = '.html.twig') { $cls = get_called_class(); $bundleName = str_replace('\\', '', preg_replace('/^([\w]+\\\\)*?(\w+\\\\\w+Bundle).*$/', '\2', $cls)); $elementName = implode('', array_slice(explode('\\', $cls), -1));
php
{ "resource": "" }
q5938
IdentifierCollectionContainer.identifiersToArray
train
protected function identifiersToArray(): array { $data = []; foreach ($this->getIdentifiers() as $identifier) {
php
{ "resource": "" }
q5939
QueryFactory.instantiateQuery
train
protected function instantiateQuery($queryClass, $apiQueryName) { if (!is_a($queryClass, static::$queryInterface, true)) { throw new RuntimeException("Query class '{$queryClass}' does not implements '" .
php
{ "resource": "" }
q5940
Request.withUri
train
public function withUri(UriInterface $uri, $preserveHost = false) { $clone = clone $this; $clone->uri = $uri; if ($preserveHost) { /** * Si l'en-tête Host est manquant ou vide, et que le nouvel URI contient * un composant hôte, cette méthode DOIT mettre à jour l'en-tête Host dans le retour.
php
{ "resource": "" }
q5941
Validate.ip
train
private function ip($ip) { return ((false
php
{ "resource": "" }
q5942
IncludedResourcesContainer.includedResourcesToArray
train
protected function includedResourcesToArray(): array { $data = []; foreach ($this->includedResources as $resource) {
php
{ "resource": "" }
q5943
Stream.getContents
train
public function getContents() { $this->valideAttach()->valideRead(); if (($stream = stream_get_contents($this->stream)) === false) { throw new \RuntimeException('An
php
{ "resource": "" }
q5944
Attachment.toArray
train
public function toArray() { return [ 'id' => $this->id, 'filename' => $this->filename, 'filetype' => $this->filetype,
php
{ "resource": "" }
q5945
Files.detectFilePath
train
private static function detectFilePath($params) { if (isset($params->path) && !empty($params->path)) {
php
{ "resource": "" }
q5946
ImagesTrait.images
train
public static function images() { // Helper Class Exists if (isset(self::$ImagesHelper)) { return self::$ImagesHelper; }
php
{ "resource": "" }
q5947
NativeTypesHandler.process
train
protected function process($value, string $type) { if ($type === 'integer') { return (int) $value; } if ($type === 'float') { return (float) $value;
php
{ "resource": "" }
q5948
Splash.commit
train
public static function commit($objectType, $local = null, $action = null, $user = '', $comment = '') { //====================================================================// // Stack Trace self::log()->trace(); //====================================================================// // Verify this Object Class is Valid ==> No Action on this Node if (false == Splash::object($objectType)) { return true; } //====================================================================// // Initiate Tasks parameters array $params = self::getCommitParameters($objectType, $local, $action, $user, $comment); //====================================================================// // Add This Commit to Session Logs static::$commited[] = $params; //====================================================================// // Verify this Object is Locked ==> No Action on this Node if (!self::isCommitAllowed($objectType, $local, $action)) {
php
{ "resource": "" }
q5949
Splash.getCommitParameters
train
private static function getCommitParameters($objectType, $local = null, $action = null, $user = '', $comment = '') { $params = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); $params->type = $objectType; // Type of
php
{ "resource": "" }
q5950
Splash.isCommitAllowed
train
private static function isCommitAllowed($objectType, $local = null, $action = null) { //====================================================================// // Verify this Object is Locked ==> No Action on this Node //====================================================================// if (is_array($local)) { foreach ($local as $value) { if (Splash::object($objectType)->isLocked($value)) {
php
{ "resource": "" }
q5951
Splash.isTravisMode
train
private static function isTravisMode($objectType, $local, $action = null) { //====================================================================// // Detect Travis from SERVER CONSTANTS if (empty(Splash::input('SPLASH_TRAVIS'))) { return false; }
php
{ "resource": "" }
q5952
Definition.merge
train
public function merge(self $definition) { if ($this->type === null && $definition->hasType()) { $this->type = $definition->getType(); }
php
{ "resource": "" }
q5953
ObjectsHelper.encode
train
public static function encode($objectType, $objectId) { //====================================================================// // Safety Checks if (empty($objectType)) {
php
{ "resource": "" }
q5954
ObjectsHelper.load
train
public static function load($fieldData, $objectClass = null) { //====================================================================// // Decode Object Type & Id $objectType = self::objectType($fieldData); $objectId = self::objectId($fieldData); if (!$objectType || !$objectId) { return null; } //====================================================================// // Load Splash Object $splashObject = Splash::object($objectType); if (empty($splashObject)) { return null; } //====================================================================// // Ensure Splash Object uses InteliParserTrait if (!in_array(IntelParserTrait::class, class_uses($splashObject), true)) { return null; } if (!method_exists($splashObject, 'load')) {
php
{ "resource": "" }
q5955
File.getMime
train
protected function getMime(UploadedFileInterface $upload) { $file = $upload->getStream()->getMetadata('uri');
php
{ "resource": "" }
q5956
File.getExtension
train
protected function getExtension(UploadedFileInterface $upload) { $filename = $filename = $upload->getClientFilename();
php
{ "resource": "" }
q5957
Encrypt.edcode
train
public static function edcode($string, $operation, $key = 'ePHP') { // ENCODE $key_length = strlen($key); $string = $operation == 'DECODE' ? \ePHP\Misc\Func::safe_b64decode($string) : substr(md5($string . $key), 0, 8) . $string; $string_length = strlen($string); $rndkey = $box = array(); $result = ''; for ($i = 0; $i <= 255; $i++) { $rndkey[$i] = ord($key[$i % $key_length]); $box[$i] = $i; } for ($j = $i = 0; $i < 256; $i++) { $j = ($j + $box[$i] + $rndkey[$i]) % 256; $tmp = $box[$i]; $box[$i] = $box[$j]; $box[$j] = $tmp; } for ($a = $j = $i = 0; $i < $string_length; $i++) { $a = ($a + 1) % 256; $j
php
{ "resource": "" }
q5958
Controller.setHeader
train
protected function setHeader($key, $value) { if (SERVER_MODE === 'swoole') { $GLOBALS['__$response']->header($key, $value); } else {
php
{ "resource": "" }
q5959
Controller.redirect
train
protected function redirect($url, $code = 302) { if (!headers_sent()) { if (SERVER_MODE === 'swoole' ) { $GLOBALS['__$response']->status($code); } else if ($code == 301) { header('HTTP/1.1 301 Moved Permanently'); } else { header('HTTP/1.1 302 Found'); } $this->setHeader("Location", $url);
php
{ "resource": "" }
q5960
DBPool.init
train
public static function init($name) { if (empty(self::$instance[$name]) || !self::$instance[$name] instanceof self) { self::$instance[$name] = new self();
php
{ "resource": "" }
q5961
ODataResource.orderBy
train
public function orderBy($orderBy = NULL) { if (isset($orderBy)) { $this->setOrderBy($orderBy);
php
{ "resource": "" }
q5962
Image.getDimensions
train
protected function getDimensions(UploadedFileInterface $upload) { $dimension = getimagesize($upload->getStream()->getMetadata('uri')); return [
php
{ "resource": "" }
q5963
Image.validMimeImage
train
private function validMimeImage($extension, $mimes) { if (is_array($mimes)) { foreach ($mimes as $mime) { if (!strstr($mime, 'image/')) { throw new \InvalidArgumentException(htmlspecialchars( "The extension $extension is not an image extension." )); }
php
{ "resource": "" }
q5964
FileExporterTrait.addLogToFile
train
protected static function addLogToFile($message, $logType = 'Unknown') { //====================================================================// // Safety Check if (0 == Splash::configuration()->Logging) { return true; } //====================================================================// // Detect Log File Directory $logfile = dirname(__DIR__).'/splash.log'; if (defined('SPLASH_DIR') && realpath(SPLASH_DIR)) { $logfile = realpath(SPLASH_DIR).'/splash.log'; } //====================================================================// // Open Log File $filefd = @fopen($logfile, 'a+');
php
{ "resource": "" }
q5965
FileExporterTrait.addLogBlockToFile
train
protected static function addLogBlockToFile($msgArray, $logType = 'Unknown') { //====================================================================// // Safety Check if (false == Splash::configuration()->Logging) { return true; } //====================================================================//
php
{ "resource": "" }
q5966
ProgressBar.render
train
public function render() { $percentage = (double) ($this->value / $this->total); $progress = floor($percentage * $this->size); $output = "\r[" . str_repeat('=', $progress); if ($progress < $this->size) { $output .= ">" . str_repeat(' ', $this->size - $progress); } else { $output .= '='; } $output .= sprintf('] %s%% %s/%s', round($percentage * 100, 0), $this->value, $this->total); if ($this->showRemainingTime) {
php
{ "resource": "" }
q5967
ProgressBar.write
train
public function write() { if ($this->textWriter === null) { throw new ConsoleException('No TextWriter object specified'); }
php
{ "resource": "" }
q5968
JsonConfigurator.getConfigPath
train
private function getConfigPath() { //====================================================================// // Load Module Configuration $cfg = Splash::configuration(); //====================================================================// // Check if Custom Configuration Path is Defined $cfgPath = Splash::getLocalPath()."/configuration.json"; if (isset($cfg->ConfiguratorPath) && is_string($cfg->ConfiguratorPath)) { $cfgPath = $cfg->ConfiguratorPath;
php
{ "resource": "" }
q5969
JsonConfigurator.getConfigArray
train
private function getConfigArray($cfgPath) { //====================================================================// // Check if Custom Configuration File Exists if (!is_file($cfgPath)) { return false; } //====================================================================// // Load File Contents $rawJson = file_get_contents($cfgPath); if (!is_string($rawJson)) { return false; } //====================================================================// // Decode Json Contents
php
{ "resource": "" }
q5970
Container.has
train
public function has($key) { if (!is_string($key)) { throw new \InvalidArgumentException(htmlspecialchars( "Get function only accepts strings. Input was: $key."
php
{ "resource": "" }
q5971
Container.loadHooks
train
protected function loadHooks(array $services) { foreach ($services as $service => $value) { if (!isset($value[ 'hooks' ])) { continue; }
php
{ "resource": "" }
q5972
HtmlExportsTrait.getHtmlListItem
train
public function getHtmlListItem($message, $type = null) { switch ($type) { case 'Error': $color = '#FF3300'; $text = '&nbsp;KO&nbsp;'; break; case 'Warning': $color = '#FF9933'; $text = '&nbsp;WAR&nbsp;'; break; default:
php
{ "resource": "" }
q5973
DataStoreService.get
train
public function get($name) { if (!isset($this->storeList[ $name ])) { $configs = $this->getDataStoreDeclarations();
php
{ "resource": "" }
q5974
QueryConfig.setEndPoint
train
public function setEndPoint($endPoint) { if (strlen($this->getEndPointGroup()) > 0) { throw new RuntimeException(
php
{ "resource": "" }
q5975
QueryConfig.setEndPointGroup
train
function setEndPointGroup($endPointGroup) { if (strlen($this->getEndPoint()) > 0) { throw new RuntimeException( "End point
php
{ "resource": "" }
q5976
QueryConfig.setGatewayUrl
train
public function setGatewayUrl($gatewayUrl, $gatewayMode) { $this->checkGatewayMode($gatewayMode); switch ($gatewayMode) { case self::GATEWAY_MODE_SANDBOX:
php
{ "resource": "" }
q5977
QueryConfig.getGatewayUrl
train
public function getGatewayUrl() { switch ($this->getGatewayMode()) { case self::GATEWAY_MODE_SANDBOX: { return $this->getGatewayUrlSandbox(); } case self::GATEWAY_MODE_PRODUCTION: { return $this->getGatewayUrlProduction(); }
php
{ "resource": "" }
q5978
PropertyAccessor.getValue
train
static public function getValue($object, $propertyPath, $failOnError = true) { if (!is_object($object)) { throw new RuntimeException('Object expected, ' . gettype($object) . ' given'); } // immediately return value if propertyPath contains only one level if (strpos($propertyPath, '.') === false) { return static::getByGetter($object, $propertyPath, $failOnError); } list($firstPropertyPath, $pathRest) = explode('.', $propertyPath, 2); $firstObject = static::getByGetter($object, $firstPropertyPath, $failOnError); // get value recursively while propertyPath has many levels if (is_object($firstObject))
php
{ "resource": "" }
q5979
PropertyAccessor.setValue
train
static public function setValue($object, $propertyPath, $propertyValue, $failOnError = true) { if (!is_object($object)) { throw new RuntimeException('Object expected, ' . gettype($object) . ' given'); } // immediately return value if propertyPath contains only one level if (strpos($propertyPath, '.') === false) { return static::setBySetter($object, $propertyPath, $propertyValue, $failOnError); } list($firstPropertyPath, $pathRest) = explode('.', $propertyPath, 2); $firstObject = static::getByGetter($object, $firstPropertyPath, $failOnError); // set value recursively while propertyPath has many levels if (is_object($firstObject))
php
{ "resource": "" }
q5980
PropertyAccessor.getByGetter
train
static protected function getByGetter($object, $propertyName, $failOnUnknownGetter) { $getter = array($object, 'get' . $propertyName); if (is_callable($getter)) { return call_user_func($getter); }
php
{ "resource": "" }
q5981
PropertyAccessor.setBySetter
train
static protected function setBySetter($object, $propertyName, $propertyValue, $failOnUnknownGetter) { $setter = array($object, 'set' . $propertyName); if (is_callable($setter)) { return call_user_func($setter, $propertyValue); }
php
{ "resource": "" }
q5982
ModelMongodb._clear_var
train
protected function _clear_var() { $this->field = array(); $this->limit = '';
php
{ "resource": "" }
q5983
RelationshipHandler.createIdentifierCollectionRelationship
train
protected function createIdentifierCollectionRelationship($object, RelationshipDefinition $definition, MappingContext $context): IdentifierCollectionRelationship { $relationship = new IdentifierCollectionRelationship(); $collection = $object->{$definition->getGetter()}(); $dataLimit = $definition->getDataLimit(); if ($dataLimit > 0) { $collection = new \LimitIterator($collection, 0, $dataLimit); } $mapper = $context->getMapper();
php
{ "resource": "" }
q5984
Typo3.createItem
train
public function createItem( array $values = [] ) { $values['customer.siteid']
php
{ "resource": "" }
q5985
Typo3.deleteItems
train
public function deleteItems( array $ids ) { $path = 'mshop/customer/manager/typo3/delete'; $this->deleteItemsBase( $ids, $path, false, 'uid' ); $manager = $this->getObject()->getSubManager( 'address' ); $search = $manager->createSearch()->setSlice( 0, 0x7fffffff ); $search->setConditions( $search->compare( '==', 'customer.address.parentid', $ids ) ); $manager->deleteItems( array_keys( $manager->searchItems( $search )
php
{ "resource": "" }
q5986
Typo3.getSubManager
train
public function getSubManager( $manager, $name = null ) { return $this->getSubManagerBase( 'customer',
php
{ "resource": "" }
q5987
Typo3.getPasswordHelper
train
protected function getPasswordHelper() { if( $this->helper ) { return $this->helper; } $classname = \Aimeos\MShop\Common\Helper\Password\Typo3::class; if( class_exists( $classname ) === false ) { throw new \Aimeos\MShop\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); } $context = $this->getContext();
php
{ "resource": "" }
q5988
JBDump.i
train
public static function i($options = array()) { static $instance; if (!isset($instance)) { $instance = new self($options); if (self::$_config['profiler']['showStart']) {
php
{ "resource": "" }
q5989
JBDump.showErrors
train
public static function showErrors($reportLevel = -1) { if (!self::isDebug()) { return false; } if ($reportLevel === null || $reportLevel === false) { return false; } if ($reportLevel != 0) {
php
{ "resource": "" }
q5990
JBDump.maxTime
train
public static function maxTime($time = 600) { if (!self::isDebug()) { return false; }
php
{ "resource": "" }
q5991
JBDump.setParams
train
public function setParams($data, $section = null) { if ($section) { $newData = array($section => $data); $data = $newData; unset($newData); } if (isset($data['errors']['reporting'])) { $this->showErrors($data['errors']['reporting']); } // set root directory if (!isset($data['root']) && !self::$_config['root']) { $data['root'] = $_SERVER['DOCUMENT_ROOT']; } // set log path if (isset($data['log']['path']) && $data['log']['path']) { $this->_logPath = $data['log']['path']; } elseif (!self::$_config['log']['path'] || !$this->_logPath) { $this->_logPath = dirname(__FILE__) . self::DS . 'logs'; } // set log filename $logFile = 'jbdump'; if (isset($data['log']['file']) && $data['log']['file']) { $logFile = $data['log']['file']; } elseif (!self::$_config['log']['file'] || !$this->_logfile) { $logFile = 'jbdump'; } $this->_logfile = $this->_logPath . self::DS . $logFile . '_' . date('Y.m.d') . '.log.php';
php
{ "resource": "" }
q5992
JBDump.ip
train
public static function ip() { if (!self::isDebug()) { return false; } $ip = self::getClientIP(); $data = array( 'ip' => $ip, 'host' => gethostbyaddr($ip), 'source'
php
{ "resource": "" }
q5993
JBDump.memory
train
public static function memory($formated = true) { if (!self::isDebug()) { return false; }
php
{ "resource": "" }
q5994
JBDump.functions
train
public static function functions($showInternal = false) { if (!self::isDebug()) { return false; } $functions = get_defined_functions(); if ($showInternal) { $functions = $functions['internal']; $type = 'internal';
php
{ "resource": "" }
q5995
JBDump.defines
train
public static function defines($showAll = false) { if (!self::isDebug()) { return false; } $defines = get_defined_constants(true); if (!$showAll) {
php
{ "resource": "" }
q5996
JBDump.extensions
train
public static function extensions($zend = false) { if (!self::isDebug()) { return false; }
php
{ "resource": "" }
q5997
JBDump.headers
train
public static function headers() { if (!self::isDebug()) { return false; } if (function_exists('apache_request_headers')) { $data = array( 'Request' => apache_request_headers(), 'Response' => apache_response_headers(), 'List' => headers_list() ); } else { $data = array(
php
{ "resource": "" }
q5998
JBDump.path
train
public static function path() { if (!self::isDebug()) { return false; } $result = array( 'get_include_path' => explode(PATH_SEPARATOR, trim(get_include_path(), PATH_SEPARATOR)), '$_SERVER[PATH]'
php
{ "resource": "" }
q5999
JBDump.json
train
public static function json($json, $name = '...') { if (!self::isDebug()) { return false;
php
{ "resource": "" }