repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Command.php | Command.setupEnvironment | protected function setupEnvironment($application, InputInterface $input, OutputInterface $output)
{
$basePath = $this->handleBasePath($input, $output);
$driverFactory = new DriverFactory;
$this->joomla = $driverFactory->create($basePath);
$this->joomla->setupEnvironment($basePath, $application);
} | php | protected function setupEnvironment($application, InputInterface $input, OutputInterface $output)
{
$basePath = $this->handleBasePath($input, $output);
$driverFactory = new DriverFactory;
$this->joomla = $driverFactory->create($basePath);
$this->joomla->setupEnvironment($basePath, $application);
} | [
"protected",
"function",
"setupEnvironment",
"(",
"$",
"application",
",",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"basePath",
"=",
"$",
"this",
"->",
"handleBasePath",
"(",
"$",
"input",
",",
"$",
"output",
")",... | Setup the environment
@param string $application The application, eg., 'site' or 'administration'
@param InputInterface $input An InputInterface instance
@param OutputInterface $output An OutputInterface instance
@return void | [
"Setup",
"the",
"environment"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Command.php#L89-L96 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Command.php | Command.handleBasePath | protected function handleBasePath(InputInterface $input, OutputInterface $output)
{
$path = realpath($input->getOption('basepath'));
$this->writeln($output, 'Joomla! installation expected in ' . $path, OutputInterface::VERBOSITY_DEBUG);
return $path;
} | php | protected function handleBasePath(InputInterface $input, OutputInterface $output)
{
$path = realpath($input->getOption('basepath'));
$this->writeln($output, 'Joomla! installation expected in ' . $path, OutputInterface::VERBOSITY_DEBUG);
return $path;
} | [
"protected",
"function",
"handleBasePath",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"path",
"=",
"realpath",
"(",
"$",
"input",
"->",
"getOption",
"(",
"'basepath'",
")",
")",
";",
"$",
"this",
"->",
"write... | Read the base path from the options
@param InputInterface $input An InputInterface instance
@param OutputInterface $output An OutputInterface instance
@return string The base path | [
"Read",
"the",
"base",
"path",
"from",
"the",
"options"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Command.php#L106-L112 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Command.php | Command.writeln | protected function writeln(OutputInterface $output, $message, $level = OutputInterface::VERBOSITY_NORMAL, $mode = OutputInterface::OUTPUT_NORMAL)
{
if ($output->getVerbosity() >= $level)
{
$output->writeln($message, $mode);
}
} | php | protected function writeln(OutputInterface $output, $message, $level = OutputInterface::VERBOSITY_NORMAL, $mode = OutputInterface::OUTPUT_NORMAL)
{
if ($output->getVerbosity() >= $level)
{
$output->writeln($message, $mode);
}
} | [
"protected",
"function",
"writeln",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"message",
",",
"$",
"level",
"=",
"OutputInterface",
"::",
"VERBOSITY_NORMAL",
",",
"$",
"mode",
"=",
"OutputInterface",
"::",
"OUTPUT_NORMAL",
")",
"{",
"if",
"(",
"$",
"o... | Proxy for OutputInterface::writeln()
@param OutputInterface $output An OutputInterface instance
@param string|array $message
@param int $level One of OutputInterface::VERBOSITY_*
@param int $mode One of OutputInterface::OUTPUT_*
@return void | [
"Proxy",
"for",
"OutputInterface",
"::",
"writeln",
"()"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Command.php#L124-L130 |
DevGroup-ru/yii2-users-module | src/models/LoginForm.php | LoginForm.login | public function login()
{
$module = UsersModule::module();
if ($this->validate()) {
return $this->user->login($this->rememberMe ? $module->loginDuration : 0);
} else {
return false;
}
} | php | public function login()
{
$module = UsersModule::module();
if ($this->validate()) {
return $this->user->login($this->rememberMe ? $module->loginDuration : 0);
} else {
return false;
}
} | [
"public",
"function",
"login",
"(",
")",
"{",
"$",
"module",
"=",
"UsersModule",
"::",
"module",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"user",
"->",
"login",
"(",
"$",
"this",
"-... | Validates form and logs the user in.
@return bool whether the user is logged in successfully | [
"Validates",
"form",
"and",
"logs",
"the",
"user",
"in",
"."
] | train | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/models/LoginForm.php#L76-L84 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobe | private function ffprobe($binary = null)
{
if (is_null($binary))
{
$binary = static::$ffprobe;
}
if (!isset($this->metadata))
{
$cmd = "{$binary} -v quiet -print_format json -show_format -show_streams {$this->file}";
exec($cmd, $output, $returnvalue);
$json = json_decode( implod... | php | private function ffprobe($binary = null)
{
if (is_null($binary))
{
$binary = static::$ffprobe;
}
if (!isset($this->metadata))
{
$cmd = "{$binary} -v quiet -print_format json -show_format -show_streams {$this->file}";
exec($cmd, $output, $returnvalue);
$json = json_decode( implod... | [
"private",
"function",
"ffprobe",
"(",
"$",
"binary",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"binary",
")",
")",
"{",
"$",
"binary",
"=",
"static",
"::",
"$",
"ffprobe",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
... | Runs an ffprobe on the file or returns cached information.
@return array|false | [
"Runs",
"an",
"ffprobe",
"on",
"the",
"file",
"or",
"returns",
"cached",
"information",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L36-L63 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobeFormat | private function ffprobeFormat($format)
{
$this->ffprobe();
if (count($this->formats) > 0)
{
$args = func_get_args();
foreach ($args as $arg)
{
if (in_array($arg, $this->formats))
{
return true;
}
}
return null;
}
return false;
} | php | private function ffprobeFormat($format)
{
$this->ffprobe();
if (count($this->formats) > 0)
{
$args = func_get_args();
foreach ($args as $arg)
{
if (in_array($arg, $this->formats))
{
return true;
}
}
return null;
}
return false;
} | [
"private",
"function",
"ffprobeFormat",
"(",
"$",
"format",
")",
"{",
"$",
"this",
"->",
"ffprobe",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"formats",
")",
">",
"0",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"... | Checks requested format against what formats ffprobe returned.
@param string $format The format extenson to check for.
@param string|null $format Option number of additional formats.
@return boolean|null | [
"Checks",
"requested",
"format",
"against",
"what",
"formats",
"ffprobe",
"returned",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L72-L92 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobeHasVideo | private function ffprobeHasVideo()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "video" && $stream['disposition']['attached_pic'] !== 1)
{
return $streamIndex;
... | php | private function ffprobeHasVideo()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "video" && $stream['disposition']['attached_pic'] !== 1)
{
return $streamIndex;
... | [
"private",
"function",
"ffprobeHasVideo",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
"as",
"$",
"streamIndex",
"=>",... | Check our metadata for a video stream.
@return boolean|int Int if video stream index found (CAN BE 0), false if none | [
"Check",
"our",
"metadata",
"for",
"a",
"video",
"stream",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L114-L128 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.ffprobeHasAudio | private function ffprobeHasAudio()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "audio")
{
return $streamIndex;
}
}
}
return false;
} | php | private function ffprobeHasAudio()
{
if (isset($this->metadata['streams']))
{
foreach ($this->metadata['streams'] as $streamIndex => $stream)
{
if (isset($stream['codec_type']) && $stream['codec_type'] === "audio")
{
return $streamIndex;
}
}
}
return false;
} | [
"private",
"function",
"ffprobeHasAudio",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"metadata",
"[",
"'streams'",
"]",
"as",
"$",
"streamIndex",
"=>",... | Check our metadata for an audio stream.
@return boolean|int Int if video stream index found (CAN BE 0), false if none | [
"Check",
"our",
"metadata",
"for",
"an",
"audio",
"stream",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L135-L149 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.lead3GP | protected function lead3GP()
{
$lead = $this->ffprobeFormat("3gp");
if ($lead === true)
{
return $this->closeCase("3gp", "video/3gp", $this->metadata);
}
return null;
} | php | protected function lead3GP()
{
$lead = $this->ffprobeFormat("3gp");
if ($lead === true)
{
return $this->closeCase("3gp", "video/3gp", $this->metadata);
}
return null;
} | [
"protected",
"function",
"lead3GP",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"3gp\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"3gp\"",
",",
"\"vide... | Checks if the file is a 3GP.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"3GP",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L156-L166 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadAAC | protected function leadAAC()
{
$lead = $this->ffprobeFormat("aac");
if ($lead === true)
{
return $this->closeCase("aac", "audio/aac", $this->metadata);
}
return null;
} | php | protected function leadAAC()
{
$lead = $this->ffprobeFormat("aac");
if ($lead === true)
{
return $this->closeCase("aac", "audio/aac", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadAAC",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"aac\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"aac\"",
",",
"\"audi... | Checks if the file is a AAC
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"AAC"
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L173-L183 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadFLV | protected function leadFLV()
{
$lead = $this->ffprobeFormat("flv");
if ($lead === true)
{
return $this->closeCase("flv", "video/x-flv", $this->metadata);
}
return null;
} | php | protected function leadFLV()
{
$lead = $this->ffprobeFormat("flv");
if ($lead === true)
{
return $this->closeCase("flv", "video/x-flv", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadFLV",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"flv\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"flv\"",
",",
"\"vide... | Checks if the file is a FLV.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"FLV",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L190-L200 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMP3 | protected function leadMP3()
{
$lead = $this->ffprobeFormat("mp1", "mp2", "mp3", "mpg", "mpeg");
if ($lead === true)
{
return $this->closeCase("mp3", "audio/mpeg", $this->metadata);
}
return null;
} | php | protected function leadMP3()
{
$lead = $this->ffprobeFormat("mp1", "mp2", "mp3", "mpg", "mpeg");
if ($lead === true)
{
return $this->closeCase("mp3", "audio/mpeg", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadMP3",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"mp1\"",
",",
"\"mp2\"",
",",
"\"mp3\"",
",",
"\"mpg\"",
",",
"\"mpeg\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"retu... | Checks if the file is a MP3
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MP3"
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L207-L217 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMP4 | protected function leadMP4()
{
$lead = $this->ffprobeFormat("mp4", "m4a");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mp4", "video/mp4", $this->metadata);
}
else if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mp... | php | protected function leadMP4()
{
$lead = $this->ffprobeFormat("mp4", "m4a");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mp4", "video/mp4", $this->metadata);
}
else if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mp... | [
"protected",
"function",
"leadMP4",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"mp4\"",
",",
"\"m4a\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ffprobeHasVideo",
"(",
... | Checks if the file is a MP4.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MP4",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L224-L245 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMKA | protected function leadMKA()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mka", "audio/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | php | protected function leadMKA()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasAudio() !== false)
{
return $this->closeCase("mka", "audio/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | [
"protected",
"function",
"leadMKA",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"matroska\"",
",",
"\"webm\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ffprobeHasAudio",
... | Checks if the file is a MKA.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MKA",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L252-L269 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadMKV | protected function leadMKV()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mkv", "video/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | php | protected function leadMKV()
{
$lead = $this->ffprobeFormat("matroska", "webm");
if ($lead === true)
{
if ($this->ffprobeHasVideo() !== false)
{
return $this->closeCase("mkv", "video/x-matroska", $this->metadata);
}
else
{
return false;
}
}
return null;
} | [
"protected",
"function",
"leadMKV",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"matroska\"",
",",
"\"webm\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ffprobeHasVideo",
... | Checks if the file is a MKV.
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"MKV",
"."
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L276-L293 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.leadWAV | protected function leadWAV()
{
$lead = $this->ffprobeFormat("wav");
if ($lead === true)
{
return $this->closeCase("wav", "audio/wave", $this->metadata);
}
return null;
} | php | protected function leadWAV()
{
$lead = $this->ffprobeFormat("wav");
if ($lead === true)
{
return $this->closeCase("wav", "audio/wave", $this->metadata);
}
return null;
} | [
"protected",
"function",
"leadWAV",
"(",
")",
"{",
"$",
"lead",
"=",
"$",
"this",
"->",
"ffprobeFormat",
"(",
"\"wav\"",
")",
";",
"if",
"(",
"$",
"lead",
"===",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"closeCase",
"(",
"\"wav\"",
",",
"\"audi... | Checks if the file is a WAV
@return boolean|null | [
"Checks",
"if",
"the",
"file",
"is",
"a",
"WAV"
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L328-L338 |
infinity-next/sleuth | src/Detectives/ffmpegDetective.php | ffmpegDetective.on | public static function on()
{
static::fetchBinaries();
return (empty(static::$ffmpeg) ? false : true) && (empty(static::$ffprobe) ? false : true);
} | php | public static function on()
{
static::fetchBinaries();
return (empty(static::$ffmpeg) ? false : true) && (empty(static::$ffprobe) ? false : true);
} | [
"public",
"static",
"function",
"on",
"(",
")",
"{",
"static",
"::",
"fetchBinaries",
"(",
")",
";",
"return",
"(",
"empty",
"(",
"static",
"::",
"$",
"ffmpeg",
")",
"?",
"false",
":",
"true",
")",
"&&",
"(",
"empty",
"(",
"static",
"::",
"$",
"ffp... | Can the system run this Detective?
@return boolean True if we can run, False if not. | [
"Can",
"the",
"system",
"run",
"this",
"Detective?"
] | train | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/ffmpegDetective.php#L406-L410 |
Danack/GithubArtaxService | lib/GithubService/Operation/listSelfStarredGistsPaginate.php | listSelfStarredGistsPaginate.createRequest | public function createRequest() {
$request = new \Amp\Artax\Request();
$url = null;
$request->setMethod('GET');
$queryParameters = [];
if (array_key_exists('Accept', $this->parameters) == true) {
$value = $this->getFilteredParameter('Accept');
$request->setH... | php | public function createRequest() {
$request = new \Amp\Artax\Request();
$url = null;
$request->setMethod('GET');
$queryParameters = [];
if (array_key_exists('Accept', $this->parameters) == true) {
$value = $this->getFilteredParameter('Accept');
$request->setH... | [
"public",
"function",
"createRequest",
"(",
")",
"{",
"$",
"request",
"=",
"new",
"\\",
"Amp",
"\\",
"Artax",
"\\",
"Request",
"(",
")",
";",
"$",
"url",
"=",
"null",
";",
"$",
"request",
"->",
"setMethod",
"(",
"'GET'",
")",
";",
"$",
"queryParamete... | Create an Amp\Artax\Request object from the operation.
@return \Amp\Artax\Request | [
"Create",
"an",
"Amp",
"\\",
"Artax",
"\\",
"Request",
"object",
"from",
"the",
"operation",
"."
] | train | https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/Operation/listSelfStarredGistsPaginate.php#L202-L240 |
tkotosz/behat-browser-initialiser | src/Bex/Behat/BrowserInitialiserExtension/ServiceContainer/BrowserInitialiserExtension.php | BrowserInitialiserExtension.configure | public function configure(ArrayNodeDefinition $builder)
{
$validator = new ConfigValidator();
$builder
->children()
->booleanNode('close_browser_after_scenario')
->defaultFalse()
->end()
->scalarNode('browser_window_size... | php | public function configure(ArrayNodeDefinition $builder)
{
$validator = new ConfigValidator();
$builder
->children()
->booleanNode('close_browser_after_scenario')
->defaultFalse()
->end()
->scalarNode('browser_window_size... | [
"public",
"function",
"configure",
"(",
"ArrayNodeDefinition",
"$",
"builder",
")",
"{",
"$",
"validator",
"=",
"new",
"ConfigValidator",
"(",
")",
";",
"$",
"builder",
"->",
"children",
"(",
")",
"->",
"booleanNode",
"(",
"'close_browser_after_scenario'",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/tkotosz/behat-browser-initialiser/blob/b20636f3ec2c83b027a21deb48c4388c940af6d3/src/Bex/Behat/BrowserInitialiserExtension/ServiceContainer/BrowserInitialiserExtension.php#L45-L60 |
tkotosz/behat-browser-initialiser | src/Bex/Behat/BrowserInitialiserExtension/ServiceContainer/BrowserInitialiserExtension.php | BrowserInitialiserExtension.load | public function load(ContainerBuilder $container, array $config)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config'));
$loader->load('services.xml');
$extensionConfig = new Config($config);
$container->set('bex.browser_initialiser_extension.config', $exten... | php | public function load(ContainerBuilder $container, array $config)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config'));
$loader->load('services.xml');
$extensionConfig = new Config($config);
$container->set('bex.browser_initialiser_extension.config', $exten... | [
"public",
"function",
"load",
"(",
"ContainerBuilder",
"$",
"container",
",",
"array",
"$",
"config",
")",
"{",
"$",
"loader",
"=",
"new",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/config'",
")",
")",
";",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/tkotosz/behat-browser-initialiser/blob/b20636f3ec2c83b027a21deb48c4388c940af6d3/src/Bex/Behat/BrowserInitialiserExtension/ServiceContainer/BrowserInitialiserExtension.php#L65-L72 |
eXistenZNL/PermCheck | src/Message/Bag.php | Bag.addMessage | public function addMessage($message, $type)
{
if (!is_string($message)) {
throw new \InvalidArgumentException('Message must be a string');
}
if (!$message) {
throw new \InvalidArgumentException('Message can\'t be empty');
}
if (!is_string($type)) {
... | php | public function addMessage($message, $type)
{
if (!is_string($message)) {
throw new \InvalidArgumentException('Message must be a string');
}
if (!$message) {
throw new \InvalidArgumentException('Message can\'t be empty');
}
if (!is_string($type)) {
... | [
"public",
"function",
"addMessage",
"(",
"$",
"message",
",",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"message",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Message must be a string'",
")",
";",
"}",
"if",
... | Add a message to this message bag.
@param string $message The message to add.
@param string $type The type of message to add.
@throws \InvalidArgumentException When the provided data is incorrect.
@return Bag | [
"Add",
"a",
"message",
"to",
"this",
"message",
"bag",
"."
] | train | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/Message/Bag.php#L21-L38 |
php-lug/lug | src/Bundle/ResourceBundle/Form/Extension/BooleanExtension.php | BooleanExtension.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($options['api']) {
$builder
->resetViewTransformers()
->addViewTransformer($this->booleanTransformer);
}
} | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
if ($options['api']) {
$builder
->resetViewTransformers()
->addViewTransformer($this->booleanTransformer);
}
} | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"options",
"[",
"'api'",
"]",
")",
"{",
"$",
"builder",
"->",
"resetViewTransformers",
"(",
")",
"->",
"addViewTransformer... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/Extension/BooleanExtension.php#L49-L56 |
php-lug/lug | src/Bundle/ResourceBundle/Form/EventSubscriber/CollectionSubscriber.php | CollectionSubscriber.resolveResource | private function resolveResource($class)
{
if (array_key_exists($class, $this->cache)) {
return $this->cache[$class];
}
$found = null;
foreach ($this->resourceRegistry as $resource) {
if ($resource->getModel() === $class) {
$found = $resource... | php | private function resolveResource($class)
{
if (array_key_exists($class, $this->cache)) {
return $this->cache[$class];
}
$found = null;
foreach ($this->resourceRegistry as $resource) {
if ($resource->getModel() === $class) {
$found = $resource... | [
"private",
"function",
"resolveResource",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"class",
",",
"$",
"this",
"->",
"cache",
")",
")",
"{",
"return",
"$",
"this",
"->",
"cache",
"[",
"$",
"class",
"]",
";",
"}",
"$",
"f... | @param string $class
@return ResourceInterface|null | [
"@param",
"string",
"$class"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/EventSubscriber/CollectionSubscriber.php#L113-L130 |
inhere/php-librarys | src/Helpers/Cli.php | Cli.write | public static function write($message, $nl = true, $quit = false)
{
if (\is_array($message)) {
$message = implode($nl ? PHP_EOL : '', $message);
}
self::stdout(self::renderColor($message), $nl, $quit);
} | php | public static function write($message, $nl = true, $quit = false)
{
if (\is_array($message)) {
$message = implode($nl ? PHP_EOL : '', $message);
}
self::stdout(self::renderColor($message), $nl, $quit);
} | [
"public",
"static",
"function",
"write",
"(",
"$",
"message",
",",
"$",
"nl",
"=",
"true",
",",
"$",
"quit",
"=",
"false",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"message",
")",
")",
"{",
"$",
"message",
"=",
"implode",
"(",
"$",
"nl",
... | write message to console
@param $message
@param bool $nl
@param bool $quit | [
"write",
"message",
"to",
"console"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/Cli.php#L206-L213 |
inhere/php-librarys | src/Helpers/Cli.php | Cli.stdout | public static function stdout($message, $nl = true, $quit = false)
{
fwrite(\STDOUT, $message . ($nl ? PHP_EOL : ''));
fflush(\STDOUT);
if (($isTrue = true === $quit) || \is_int($quit)) {
$code = $isTrue ? 0 : $quit;
exit($code);
}
} | php | public static function stdout($message, $nl = true, $quit = false)
{
fwrite(\STDOUT, $message . ($nl ? PHP_EOL : ''));
fflush(\STDOUT);
if (($isTrue = true === $quit) || \is_int($quit)) {
$code = $isTrue ? 0 : $quit;
exit($code);
}
} | [
"public",
"static",
"function",
"stdout",
"(",
"$",
"message",
",",
"$",
"nl",
"=",
"true",
",",
"$",
"quit",
"=",
"false",
")",
"{",
"fwrite",
"(",
"\\",
"STDOUT",
",",
"$",
"message",
".",
"(",
"$",
"nl",
"?",
"PHP_EOL",
":",
"''",
")",
")",
... | Logs data to stdout
@param string $message
@param bool $nl
@param bool|int $quit | [
"Logs",
"data",
"to",
"stdout"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/Cli.php#L221-L230 |
inhere/php-librarys | src/Helpers/Cli.php | Cli.stderr | public static function stderr($message, $nl = true, $quit = -200)
{
fwrite(\STDERR, self::color('[ERROR] ', 'red') . $message . ($nl ? PHP_EOL : ''));
fflush(\STDOUT);
if (($isTrue = true === $quit) || \is_int($quit)) {
$code = $isTrue ? 0 : $quit;
exit($code);
... | php | public static function stderr($message, $nl = true, $quit = -200)
{
fwrite(\STDERR, self::color('[ERROR] ', 'red') . $message . ($nl ? PHP_EOL : ''));
fflush(\STDOUT);
if (($isTrue = true === $quit) || \is_int($quit)) {
$code = $isTrue ? 0 : $quit;
exit($code);
... | [
"public",
"static",
"function",
"stderr",
"(",
"$",
"message",
",",
"$",
"nl",
"=",
"true",
",",
"$",
"quit",
"=",
"-",
"200",
")",
"{",
"fwrite",
"(",
"\\",
"STDERR",
",",
"self",
"::",
"color",
"(",
"'[ERROR] '",
",",
"'red'",
")",
".",
"$",
"m... | Logs data to stderr
@param string $message
@param bool $nl
@param bool|int $quit | [
"Logs",
"data",
"to",
"stderr"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/Cli.php#L238-L247 |
inhere/php-librarys | src/Helpers/Cli.php | Cli.argOptParse | public static function argOptParse(array $noValues = [], $mergeOpts = false)
{
$params = $GLOBALS['argv'];
reset($params);
$args = $sOpts = $lOpts = [];
$fullScript = implode(' ', $params);
$script = array_shift($params);
// each() will deprecated at 7.2 so,there us... | php | public static function argOptParse(array $noValues = [], $mergeOpts = false)
{
$params = $GLOBALS['argv'];
reset($params);
$args = $sOpts = $lOpts = [];
$fullScript = implode(' ', $params);
$script = array_shift($params);
// each() will deprecated at 7.2 so,there us... | [
"public",
"static",
"function",
"argOptParse",
"(",
"array",
"$",
"noValues",
"=",
"[",
"]",
",",
"$",
"mergeOpts",
"=",
"false",
")",
"{",
"$",
"params",
"=",
"$",
"GLOBALS",
"[",
"'argv'",
"]",
";",
"reset",
"(",
"$",
"params",
")",
";",
"$",
"ar... | Parses $GLOBALS['argv'] for parameters and assigns them to an array.
Supports:
-e
-e <value>
--long-param
--long-param=<value>
--long-param <value>
<value>
@link https://github.com/inhere/php-console/blob/master/src/io/Input.php
@param array $noValues List of parameters without values
@param bool $mergeOpts
@return arr... | [
"Parses",
"$GLOBALS",
"[",
"argv",
"]",
"for",
"parameters",
"and",
"assigns",
"them",
"to",
"an",
"array",
".",
"Supports",
":",
"-",
"e",
"-",
"e",
"<value",
">",
"--",
"long",
"-",
"param",
"--",
"long",
"-",
"param",
"=",
"<value",
">",
"--",
"... | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Helpers/Cli.php#L274-L351 |
arndtteunissen/column-layout | Classes/ViewHelpers/RowWrapViewHelper.php | RowWrapViewHelper.renderStatic | public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$enabled = self::isEnabled($arguments['colPos']);
if ($enabled) {
return self::wrapContent($renderChildrenClosure);
} else {
return $... | php | public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$enabled = self::isEnabled($arguments['colPos']);
if ($enabled) {
return self::wrapContent($renderChildrenClosure);
} else {
return $... | [
"public",
"static",
"function",
"renderStatic",
"(",
"array",
"$",
"arguments",
",",
"\\",
"Closure",
"$",
"renderChildrenClosure",
",",
"RenderingContextInterface",
"$",
"renderingContext",
")",
"{",
"$",
"enabled",
"=",
"self",
"::",
"isEnabled",
"(",
"$",
"ar... | {@inheritdoc} | [
"{"
] | train | https://github.com/arndtteunissen/column-layout/blob/ad737068eef3b084d4d0e3a48e6a3d8277af9560/Classes/ViewHelpers/RowWrapViewHelper.php#L48-L57 |
oroinc/OroLayoutComponent | Loader/Generator/Extension/ImportLayoutUpdateVisitor.php | ImportLayoutUpdateVisitor.startVisit | public function startVisit(VisitContext $visitContext)
{
$writer = $visitContext->createWriter();
$class = $visitContext->getClass();
$class->addUseStatement('Oro\Component\Layout\ImportLayoutManipulator');
$class->addInterfaceName('Oro\Component\Layout\LayoutUpdateImportInterface');... | php | public function startVisit(VisitContext $visitContext)
{
$writer = $visitContext->createWriter();
$class = $visitContext->getClass();
$class->addUseStatement('Oro\Component\Layout\ImportLayoutManipulator');
$class->addInterfaceName('Oro\Component\Layout\LayoutUpdateImportInterface');... | [
"public",
"function",
"startVisit",
"(",
"VisitContext",
"$",
"visitContext",
")",
"{",
"$",
"writer",
"=",
"$",
"visitContext",
"->",
"createWriter",
"(",
")",
";",
"$",
"class",
"=",
"$",
"visitContext",
"->",
"getClass",
"(",
")",
";",
"$",
"class",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Generator/Extension/ImportLayoutUpdateVisitor.php#L16-L80 |
Eresus/EresusCMS | src/core/Client/Controller/Content/Url.php | Eresus_Client_Controller_Content_Url.getHtml | public function getHtml(Eresus_CMS_Request $request, TClientUI $page)
{
$tmpl = new Eresus_Template();
$tmpl->setSource($page->content);
$html = $tmpl->compile();
$response = new Eresus_HTTP_Redirect($html);
return $response;
} | php | public function getHtml(Eresus_CMS_Request $request, TClientUI $page)
{
$tmpl = new Eresus_Template();
$tmpl->setSource($page->content);
$html = $tmpl->compile();
$response = new Eresus_HTTP_Redirect($html);
return $response;
} | [
"public",
"function",
"getHtml",
"(",
"Eresus_CMS_Request",
"$",
"request",
",",
"TClientUI",
"$",
"page",
")",
"{",
"$",
"tmpl",
"=",
"new",
"Eresus_Template",
"(",
")",
";",
"$",
"tmpl",
"->",
"setSource",
"(",
"$",
"page",
"->",
"content",
")",
";",
... | Возвращает разметку области контента
@param Eresus_CMS_Request $request
@param TClientUI $page
@return Eresus_HTTP_Response
@since 3.01 | [
"Возвращает",
"разметку",
"области",
"контента"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Client/Controller/Content/Url.php#L45-L52 |
OpenClassrooms/Cache | src/OpenClassrooms/Cache/Cache/CacheImpl.php | CacheImpl.fetchWithNamespace | public function fetchWithNamespace($id, $namespaceId = null)
{
if (null !== $namespaceId) {
$namespace = $this->fetch($namespaceId);
$id = $namespace . $id;
}
return $this->fetch($id);
} | php | public function fetchWithNamespace($id, $namespaceId = null)
{
if (null !== $namespaceId) {
$namespace = $this->fetch($namespaceId);
$id = $namespace . $id;
}
return $this->fetch($id);
} | [
"public",
"function",
"fetchWithNamespace",
"(",
"$",
"id",
",",
"$",
"namespaceId",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"namespaceId",
")",
"{",
"$",
"namespace",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"namespaceId",
")",
";",
... | Fetches an entry from the cache.
@param string $id The id of the cache entry to fetch.
@param string $namespaceId The id of the namespace entry to fetch.
@return mixed The cached data or FALSE, if no cache entry exists for the given namespace and id. | [
"Fetches",
"an",
"entry",
"from",
"the",
"cache",
"."
] | train | https://github.com/OpenClassrooms/Cache/blob/7e7bdfd1b1503384f59ff6d5d29ba741a0e18ad6/src/OpenClassrooms/Cache/Cache/CacheImpl.php#L40-L48 |
OpenClassrooms/Cache | src/OpenClassrooms/Cache/Cache/CacheImpl.php | CacheImpl.invalidate | public function invalidate($namespaceId)
{
$namespace = $this->fetch($namespaceId);
if (false === $namespace) {
return false;
}
$newNamespace = rand(0, 10000);
// @codeCoverageIgnoreStart
while ($namespace === $newNamespace) {
$newNamespace =... | php | public function invalidate($namespaceId)
{
$namespace = $this->fetch($namespaceId);
if (false === $namespace) {
return false;
}
$newNamespace = rand(0, 10000);
// @codeCoverageIgnoreStart
while ($namespace === $newNamespace) {
$newNamespace =... | [
"public",
"function",
"invalidate",
"(",
"$",
"namespaceId",
")",
"{",
"$",
"namespace",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"namespaceId",
")",
";",
"if",
"(",
"false",
"===",
"$",
"namespace",
")",
"{",
"return",
"false",
";",
"}",
"$",
"new... | Invalidate a namespace.
@param string $namespaceId The id of the namespace to invalidate.
@return boolean TRUE if the namespace entry was successfully regenerated, FALSE otherwise. | [
"Invalidate",
"a",
"namespace",
"."
] | train | https://github.com/OpenClassrooms/Cache/blob/7e7bdfd1b1503384f59ff6d5d29ba741a0e18ad6/src/OpenClassrooms/Cache/Cache/CacheImpl.php#L122-L138 |
OpenClassrooms/Cache | src/OpenClassrooms/Cache/Cache/CacheImpl.php | CacheImpl.save | public function save($id, $data, $lifeTime = null)
{
if (null === $lifeTime) {
$lifeTime = $this->defaultLifetime;
}
return $this->cache->save($id, $data, $lifeTime);
} | php | public function save($id, $data, $lifeTime = null)
{
if (null === $lifeTime) {
$lifeTime = $this->defaultLifetime;
}
return $this->cache->save($id, $data, $lifeTime);
} | [
"public",
"function",
"save",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"lifeTime",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"lifeTime",
")",
"{",
"$",
"lifeTime",
"=",
"$",
"this",
"->",
"defaultLifetime",
";",
"}",
"return",
"$",
... | Puts data into the cache.
@param string $id The cache id.
@param mixed $data The cache entry/data.
@param int $lifeTime The cache lifetime.
If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
@return boolean TRUE if the entry was successfully stored in the cache, FALSE other... | [
"Puts",
"data",
"into",
"the",
"cache",
"."
] | train | https://github.com/OpenClassrooms/Cache/blob/7e7bdfd1b1503384f59ff6d5d29ba741a0e18ad6/src/OpenClassrooms/Cache/Cache/CacheImpl.php#L150-L157 |
OpenClassrooms/Cache | src/OpenClassrooms/Cache/Cache/CacheImpl.php | CacheImpl.saveWithNamespace | public function saveWithNamespace($id, $data, $namespaceId = null, $lifeTime = null)
{
if (null !== $namespaceId) {
$namespace = $this->fetch($namespaceId);
if (!$namespace) {
$namespace = $namespaceId . '_' . rand(0, 10000);
$this->save($namespaceId, ... | php | public function saveWithNamespace($id, $data, $namespaceId = null, $lifeTime = null)
{
if (null !== $namespaceId) {
$namespace = $this->fetch($namespaceId);
if (!$namespace) {
$namespace = $namespaceId . '_' . rand(0, 10000);
$this->save($namespaceId, ... | [
"public",
"function",
"saveWithNamespace",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"namespaceId",
"=",
"null",
",",
"$",
"lifeTime",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"namespaceId",
")",
"{",
"$",
"namespace",
"=",
"$",
"this"... | Puts data into the cache.
@param string $id The cache id.
@param mixed $data The cache entry/data.
@param string $namespaceId The namespace id.
@param int $lifeTime The cache lifetime.
If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).
@return boolean TRUE if the e... | [
"Puts",
"data",
"into",
"the",
"cache",
"."
] | train | https://github.com/OpenClassrooms/Cache/blob/7e7bdfd1b1503384f59ff6d5d29ba741a0e18ad6/src/OpenClassrooms/Cache/Cache/CacheImpl.php#L170-L182 |
antarctica/laravel-base-repositories | src/Repository/BaseRepositoryEloquent.php | BaseRepositoryEloquent.find | public function find($id)
{
$result = $this->model->findOrFail($id)->toArray();
return $this->export($result);
} | php | public function find($id)
{
$result = $this->model->findOrFail($id)->toArray();
return $this->export($result);
} | [
"public",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"model",
"->",
"findOrFail",
"(",
"$",
"id",
")",
"->",
"toArray",
"(",
")",
";",
"return",
"$",
"this",
"->",
"export",
"(",
"$",
"result",
")",
";",
... | Return a single record/entity specified by an $id
TODO Handle export within export() method
@param string $id
@return array | [
"Return",
"a",
"single",
"record",
"/",
"entity",
"specified",
"by",
"an",
"$id"
] | train | https://github.com/antarctica/laravel-base-repositories/blob/ca3d36bc841807d5b9108e52f433433a2663e7dc/src/Repository/BaseRepositoryEloquent.php#L41-L46 |
antarctica/laravel-base-repositories | src/Repository/BaseRepositoryEloquent.php | BaseRepositoryEloquent.create | public function create(Array $input)
{
$result = $this->model->create($input);
return $this->export($result);
} | php | public function create(Array $input)
{
$result = $this->model->create($input);
return $this->export($result);
} | [
"public",
"function",
"create",
"(",
"Array",
"$",
"input",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"model",
"->",
"create",
"(",
"$",
"input",
")",
";",
"return",
"$",
"this",
"->",
"export",
"(",
"$",
"result",
")",
";",
"}"
] | Create new record/entity from $input
TODO Handle export within export() method
@param array $input
@return array | [
"Create",
"new",
"record",
"/",
"entity",
"from",
"$input"
] | train | https://github.com/antarctica/laravel-base-repositories/blob/ca3d36bc841807d5b9108e52f433433a2663e7dc/src/Repository/BaseRepositoryEloquent.php#L56-L61 |
technote-space/wordpress-plugin-base | src/traits/loader.php | Loader.namespace_to_dir | private function namespace_to_dir( $namespace ) {
$namespace = ltrim( $namespace, '\\' );
$dir = null;
if ( preg_match( "#\A{$this->app->define->plugin_namespace}#", $namespace ) ) {
$namespace = preg_replace( "#\A{$this->app->define->plugin_namespace}#", '', $namespace );
$dir = $this->app->def... | php | private function namespace_to_dir( $namespace ) {
$namespace = ltrim( $namespace, '\\' );
$dir = null;
if ( preg_match( "#\A{$this->app->define->plugin_namespace}#", $namespace ) ) {
$namespace = preg_replace( "#\A{$this->app->define->plugin_namespace}#", '', $namespace );
$dir = $this->app->def... | [
"private",
"function",
"namespace_to_dir",
"(",
"$",
"namespace",
")",
"{",
"$",
"namespace",
"=",
"ltrim",
"(",
"$",
"namespace",
",",
"'\\\\'",
")",
";",
"$",
"dir",
"=",
"null",
";",
"if",
"(",
"preg_match",
"(",
"\"#\\A{$this->app->define->plugin_namespace... | @param string $namespace
@return string|false | [
"@param",
"string",
"$namespace"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/loader.php#L61-L83 |
technote-space/wordpress-plugin-base | src/traits/loader.php | Loader.get_loaded_count | public function get_loaded_count( $exact = true ) {
if ( ! $exact && ! isset( $this->_list ) ) {
if ( ! isset( $this->_count ) ) {
$this->_count = 0;
foreach ( $this->get_namespaces() as $namespace ) {
$this->_count += count( $this->app->utility->scan_dir_namespace_class( $this->namespace_to_dir( $nam... | php | public function get_loaded_count( $exact = true ) {
if ( ! $exact && ! isset( $this->_list ) ) {
if ( ! isset( $this->_count ) ) {
$this->_count = 0;
foreach ( $this->get_namespaces() as $namespace ) {
$this->_count += count( $this->app->utility->scan_dir_namespace_class( $this->namespace_to_dir( $nam... | [
"public",
"function",
"get_loaded_count",
"(",
"$",
"exact",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"exact",
"&&",
"!",
"isset",
"(",
"$",
"this",
"->",
"_list",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_count",
")",
... | @since 2.6.1 Updated: count without load class feature
@param bool $exact
@return int | [
"@since",
"2",
".",
"6",
".",
"1",
"Updated",
":",
"count",
"without",
"load",
"class",
"feature"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/loader.php#L130-L143 |
technote-space/wordpress-plugin-base | src/traits/loader.php | Loader.get_class_settings | protected function get_class_settings( $dir ) {
foreach ( $this->app->utility->scan_dir_namespace_class( $dir, true ) as list( $namespace, $class ) ) {
yield $this->get_class_setting( $class, $namespace );
}
} | php | protected function get_class_settings( $dir ) {
foreach ( $this->app->utility->scan_dir_namespace_class( $dir, true ) as list( $namespace, $class ) ) {
yield $this->get_class_setting( $class, $namespace );
}
} | [
"protected",
"function",
"get_class_settings",
"(",
"$",
"dir",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"app",
"->",
"utility",
"->",
"scan_dir_namespace_class",
"(",
"$",
"dir",
",",
"true",
")",
"as",
"list",
"(",
"$",
"namespace",
",",
"$",
"clas... | @param string $dir
@return \Generator | [
"@param",
"string",
"$dir"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/loader.php#L150-L154 |
technote-space/wordpress-plugin-base | src/traits/loader.php | Loader.get_classes | protected function get_classes( $dir, $instanceof, $return_instance = true ) {
foreach ( $this->get_class_settings( $dir ) as $class_setting ) {
$instance = $this->get_class_instance( $class_setting, $instanceof );
if ( false !== $instance ) {
if ( $return_instance ) {
yield $instance;
} else {
... | php | protected function get_classes( $dir, $instanceof, $return_instance = true ) {
foreach ( $this->get_class_settings( $dir ) as $class_setting ) {
$instance = $this->get_class_instance( $class_setting, $instanceof );
if ( false !== $instance ) {
if ( $return_instance ) {
yield $instance;
} else {
... | [
"protected",
"function",
"get_classes",
"(",
"$",
"dir",
",",
"$",
"instanceof",
",",
"$",
"return_instance",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_class_settings",
"(",
"$",
"dir",
")",
"as",
"$",
"class_setting",
")",
"{",
"$",... | @param string $dir
@param string $instanceof
@param bool $return_instance
@return \Generator | [
"@param",
"string",
"$dir",
"@param",
"string",
"$instanceof",
"@param",
"bool",
"$return_instance"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/loader.php#L163-L174 |
technote-space/wordpress-plugin-base | src/traits/loader.php | Loader.get_class_setting | protected function get_class_setting( $class_name, $add_namespace = '' ) {
if ( isset( $this->_cache[ $add_namespace . $class_name ] ) ) {
return $this->_cache[ $add_namespace . $class_name ];
}
$namespaces = $this->get_namespaces();
if ( ! empty( $namespaces ) ) {
foreach ( $namespaces as $namespace ) {
... | php | protected function get_class_setting( $class_name, $add_namespace = '' ) {
if ( isset( $this->_cache[ $add_namespace . $class_name ] ) ) {
return $this->_cache[ $add_namespace . $class_name ];
}
$namespaces = $this->get_namespaces();
if ( ! empty( $namespaces ) ) {
foreach ( $namespaces as $namespace ) {
... | [
"protected",
"function",
"get_class_setting",
"(",
"$",
"class_name",
",",
"$",
"add_namespace",
"=",
"''",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_cache",
"[",
"$",
"add_namespace",
".",
"$",
"class_name",
"]",
")",
")",
"{",
"return",
... | @param string $class_name
@param string $add_namespace
@return false|array | [
"@param",
"string",
"$class_name",
"@param",
"string",
"$add_namespace"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/loader.php#L182-L199 |
technote-space/wordpress-plugin-base | src/traits/loader.php | Loader.get_class_instance | protected function get_class_instance( $class_setting, $instanceof ) {
if ( false !== $class_setting && class_exists( $class_setting[0] ) && is_subclass_of( $class_setting[0], '\Technote\Interfaces\Singleton' ) ) {
try {
/** @var Singleton[] $class_setting */
$instance = $class_setting[0]::get_instance( $t... | php | protected function get_class_instance( $class_setting, $instanceof ) {
if ( false !== $class_setting && class_exists( $class_setting[0] ) && is_subclass_of( $class_setting[0], '\Technote\Interfaces\Singleton' ) ) {
try {
/** @var Singleton[] $class_setting */
$instance = $class_setting[0]::get_instance( $t... | [
"protected",
"function",
"get_class_instance",
"(",
"$",
"class_setting",
",",
"$",
"instanceof",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"class_setting",
"&&",
"class_exists",
"(",
"$",
"class_setting",
"[",
"0",
"]",
")",
"&&",
"is_subclass_of",
"(",
"$"... | @param array $class_setting
@param string $instanceof
@return bool|Singleton | [
"@param",
"array",
"$class_setting",
"@param",
"string",
"$instanceof"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/traits/loader.php#L207-L224 |
titledk/silverstripe-uploaddirrules | code/AssetsFolderExtension.php | AssetsFolderExtension.onAfterWrite | public function onAfterWrite()
{
parent::onAfterWrite();
//creation will only be considered if the object has no folder relation
if ($this->owner->AssetsFolderID == 0) {
$url = $this->owner->assetsFolderUrlToBeWritten();
if ($url) {
//this creates th... | php | public function onAfterWrite()
{
parent::onAfterWrite();
//creation will only be considered if the object has no folder relation
if ($this->owner->AssetsFolderID == 0) {
$url = $this->owner->assetsFolderUrlToBeWritten();
if ($url) {
//this creates th... | [
"public",
"function",
"onAfterWrite",
"(",
")",
"{",
"parent",
"::",
"onAfterWrite",
"(",
")",
";",
"//creation will only be considered if the object has no folder relation",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"AssetsFolderID",
"==",
"0",
")",
"{",
"$",
... | Creation and association of assets folder,
once a data object has been created (and is ready for it). | [
"Creation",
"and",
"association",
"of",
"assets",
"folder",
"once",
"a",
"data",
"object",
"has",
"been",
"created",
"(",
"and",
"is",
"ready",
"for",
"it",
")",
"."
] | train | https://github.com/titledk/silverstripe-uploaddirrules/blob/ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c/code/AssetsFolderExtension.php#L37-L51 |
titledk/silverstripe-uploaddirrules | code/AssetsFolderExtension.php | AssetsFolderExtension.assetsFolderUrlToBeWritten | public function assetsFolderUrlToBeWritten() {
$url = null;
//the default rules only require the object to have an ID
//but more sophisticated rules might require more - e.g. a title to be set
//thus we check if the object is ready for folder creation - if custom rules
//(Upload... | php | public function assetsFolderUrlToBeWritten() {
$url = null;
//the default rules only require the object to have an ID
//but more sophisticated rules might require more - e.g. a title to be set
//thus we check if the object is ready for folder creation - if custom rules
//(Upload... | [
"public",
"function",
"assetsFolderUrlToBeWritten",
"(",
")",
"{",
"$",
"url",
"=",
"null",
";",
"//the default rules only require the object to have an ID",
"//but more sophisticated rules might require more - e.g. a title to be set",
"//thus we check if the object is ready for folder cre... | TODO this should NOT be public, but I'm not sure whether there's a way around it | [
"TODO",
"this",
"should",
"NOT",
"be",
"public",
"but",
"I",
"m",
"not",
"sure",
"whether",
"there",
"s",
"a",
"way",
"around",
"it"
] | train | https://github.com/titledk/silverstripe-uploaddirrules/blob/ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c/code/AssetsFolderExtension.php#L54-L78 |
titledk/silverstripe-uploaddirrules | code/AssetsFolderExtension.php | AssetsFolderExtension.findOrMakeAssetsFolder | public function findOrMakeAssetsFolder($url, $doWrite = true)
{
$owner = $this->owner;
$dir = Folder::find_or_make($url);
$owner->AssetsFolderID = $dir->ID;
if ($doWrite) {
$owner->write();
}
//Special case for when creating a new subsite
//the di... | php | public function findOrMakeAssetsFolder($url, $doWrite = true)
{
$owner = $this->owner;
$dir = Folder::find_or_make($url);
$owner->AssetsFolderID = $dir->ID;
if ($doWrite) {
$owner->write();
}
//Special case for when creating a new subsite
//the di... | [
"public",
"function",
"findOrMakeAssetsFolder",
"(",
"$",
"url",
",",
"$",
"doWrite",
"=",
"true",
")",
"{",
"$",
"owner",
"=",
"$",
"this",
"->",
"owner",
";",
"$",
"dir",
"=",
"Folder",
"::",
"find_or_make",
"(",
"$",
"url",
")",
";",
"$",
"owner",... | Find or make assets folder
called from onBeforeWrite.
@param string $url
@param bool $doWrite
@return Folder|null | [
"Find",
"or",
"make",
"assets",
"folder",
"called",
"from",
"onBeforeWrite",
"."
] | train | https://github.com/titledk/silverstripe-uploaddirrules/blob/ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c/code/AssetsFolderExtension.php#L89-L106 |
titledk/silverstripe-uploaddirrules | code/AssetsFolderExtension.php | AssetsFolderExtension.getAssetsFolderDirName | public function getAssetsFolderDirName()
{
if ($this->owner->getField('AssetsFolderID') != 0) {
$dirObj = $this->owner->AssetsFolder();
$dirName = str_replace('assets/', '', $dirObj->Filename);
return $dirName;
}
} | php | public function getAssetsFolderDirName()
{
if ($this->owner->getField('AssetsFolderID') != 0) {
$dirObj = $this->owner->AssetsFolder();
$dirName = str_replace('assets/', '', $dirObj->Filename);
return $dirName;
}
} | [
"public",
"function",
"getAssetsFolderDirName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"getField",
"(",
"'AssetsFolderID'",
")",
"!=",
"0",
")",
"{",
"$",
"dirObj",
"=",
"$",
"this",
"->",
"owner",
"->",
"AssetsFolder",
"(",
")",
"... | Name of the associated assets folder.
@return string|null | [
"Name",
"of",
"the",
"associated",
"assets",
"folder",
"."
] | train | https://github.com/titledk/silverstripe-uploaddirrules/blob/ed8ece7b6a4ca86dcb5dc16ee10ff339f629de3c/code/AssetsFolderExtension.php#L113-L121 |
simbiosis-group/yii2-helper | actions/CreateAction.php | CreateAction.run | public function run()
{
$model = $this->model;
if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post()) && isset($_POST['ajax'])) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
if ($mo... | php | public function run()
{
$model = $this->model;
if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post()) && isset($_POST['ajax'])) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
if ($mo... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"model",
";",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"isAjax",
"&&",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
... | Runs the action
@return string result content | [
"Runs",
"the",
"action"
] | train | https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/actions/CreateAction.php#L97-L152 |
simbiosis-group/yii2-helper | actions/CreateAction.php | CreateAction.assignDefaultValues | protected function assignDefaultValues()
{
foreach ($this->defaultValues as $key => $value) {
$this->model[$key] = $value;
}
return true;
} | php | protected function assignDefaultValues()
{
foreach ($this->defaultValues as $key => $value) {
$this->model[$key] = $value;
}
return true;
} | [
"protected",
"function",
"assignDefaultValues",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"defaultValues",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"model",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"}",
"return"... | Assign default values to model.
@return boolean | [
"Assign",
"default",
"values",
"to",
"model",
"."
] | train | https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/actions/CreateAction.php#L158-L165 |
WellCommerce/AppBundle | Form/Admin/PackageFormBuilder.php | PackageFormBuilder.getPackageVersions | protected function getPackageVersions($id)
{
$localPackage = $this->get('package.repository')->findOneById($id);
$remotePackage = $this->get('package.helper')->getPackage($localPackage->getFullName());
$versions = $remotePackage->getVersions();
$result = [];
... | php | protected function getPackageVersions($id)
{
$localPackage = $this->get('package.repository')->findOneById($id);
$remotePackage = $this->get('package.helper')->getPackage($localPackage->getFullName());
$versions = $remotePackage->getVersions();
$result = [];
... | [
"protected",
"function",
"getPackageVersions",
"(",
"$",
"id",
")",
"{",
"$",
"localPackage",
"=",
"$",
"this",
"->",
"get",
"(",
"'package.repository'",
")",
"->",
"findOneById",
"(",
"$",
"id",
")",
";",
"$",
"remotePackage",
"=",
"$",
"this",
"->",
"g... | Returns version information for package
@param $id
@return array | [
"Returns",
"version",
"information",
"for",
"package"
] | train | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/Admin/PackageFormBuilder.php#L83-L95 |
WellCommerce/AppBundle | Form/Admin/PackageFormBuilder.php | PackageFormBuilder.getPackageInfo | protected function getPackageInfo(Version $version, &$result)
{
$date = new \DateTime($version->getTime());
$packageVersion = $version->getVersion();
if ($packageVersion === PackageHelperInterface::DEFAULT_BRANCH_VERSION) {
$result[$packageVersion] = [
'... | php | protected function getPackageInfo(Version $version, &$result)
{
$date = new \DateTime($version->getTime());
$packageVersion = $version->getVersion();
if ($packageVersion === PackageHelperInterface::DEFAULT_BRANCH_VERSION) {
$result[$packageVersion] = [
'... | [
"protected",
"function",
"getPackageInfo",
"(",
"Version",
"$",
"version",
",",
"&",
"$",
"result",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"version",
"->",
"getTime",
"(",
")",
")",
";",
"$",
"packageVersion",
"=",
"$",
"version... | Adds information about single version to result array
@param Version $version
@param array $result | [
"Adds",
"information",
"about",
"single",
"version",
"to",
"result",
"array"
] | train | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/Admin/PackageFormBuilder.php#L103-L117 |
surebert/surebert-framework | src/sb/Password/Hash.php | Hash.create | public static function create($password) {
// format: algorithm:iterations:salt:hash
if(function_exists('random_bytes')){
$salt = random_bytes(self::$salt_byte_size);
} else if(function_exists('openssl_random_pseudo_bytes')){
$salt = openssl_random_pseudo_bytes(self::$sal... | php | public static function create($password) {
// format: algorithm:iterations:salt:hash
if(function_exists('random_bytes')){
$salt = random_bytes(self::$salt_byte_size);
} else if(function_exists('openssl_random_pseudo_bytes')){
$salt = openssl_random_pseudo_bytes(self::$sal... | [
"public",
"static",
"function",
"create",
"(",
"$",
"password",
")",
"{",
"// format: algorithm:iterations:salt:hash",
"if",
"(",
"function_exists",
"(",
"'random_bytes'",
")",
")",
"{",
"$",
"salt",
"=",
"random_bytes",
"(",
"self",
"::",
"$",
"salt_byte_size",
... | Creates the password hash that you would store for comparison.
Make sure to check the size of the output when creating database tables
to store this hash. The defaults produce a 94 char string. Changing the
public static properties may affect the size of the hash returned.
@param string $password
@return string The ... | [
"Creates",
"the",
"password",
"hash",
"that",
"you",
"would",
"store",
"for",
"comparison",
".",
"Make",
"sure",
"to",
"check",
"the",
"size",
"of",
"the",
"output",
"when",
"creating",
"database",
"tables",
"to",
"store",
"this",
"hash",
".",
"The",
"defa... | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Password/Hash.php#L112-L129 |
surebert/surebert-framework | src/sb/Password/Hash.php | Hash.validate | public static function validate($password, $hash) {
$params = explode(":", $hash);
if (count($params) < 4)
return false;
$pbkdf2 = base64_decode($params[self::$hash_pbkdf2_index]);
return self::slowEquals(
$pbkdf2, self::calculate(
$params[... | php | public static function validate($password, $hash) {
$params = explode(":", $hash);
if (count($params) < 4)
return false;
$pbkdf2 = base64_decode($params[self::$hash_pbkdf2_index]);
return self::slowEquals(
$pbkdf2, self::calculate(
$params[... | [
"public",
"static",
"function",
"validate",
"(",
"$",
"password",
",",
"$",
"hash",
")",
"{",
"$",
"params",
"=",
"explode",
"(",
"\":\"",
",",
"$",
"hash",
")",
";",
"if",
"(",
"count",
"(",
"$",
"params",
")",
"<",
"4",
")",
"return",
"false",
... | Validates a password against its precalculated hash
@param string $password
@param string $hash
@return boolean
<code>
$bool = \sb\Password\Hash::validate('password', $hash_from_create);
</code> | [
"Validates",
"a",
"password",
"against",
"its",
"precalculated",
"hash"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Password/Hash.php#L140-L150 |
kenphp/ken | src/Helpers/Input.php | Input.get | public static function get($name = null, $default = null)
{
$queryParams = app()->request->getQueryParams();
if (is_null($name)) {
return $queryParams;
} elseif (isset($queryParams[$name])) {
return $queryParams[$name];
}
return $default;
} | php | public static function get($name = null, $default = null)
{
$queryParams = app()->request->getQueryParams();
if (is_null($name)) {
return $queryParams;
} elseif (isset($queryParams[$name])) {
return $queryParams[$name];
}
return $default;
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"queryParams",
"=",
"app",
"(",
")",
"->",
"request",
"->",
"getQueryParams",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"nam... | Retrieves GET parameter.
@param string $name Name of GET parameter, if null then all parameter will be returned
@param mixed $default Default value returned if *$name* is not null but does not exist in GET query parameters
@return mixed | [
"Retrieves",
"GET",
"parameter",
"."
] | train | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/Input.php#L17-L28 |
kenphp/ken | src/Helpers/Input.php | Input.delete | public static function delete($name = null, $default = null)
{
$parsedBody = app()->request->getParsedBody();
if (is_null($name)) {
return $parsedBody;
}
if (isset($parsedBody[$name])) {
return $parsedBody[$name];
}
return $default;
} | php | public static function delete($name = null, $default = null)
{
$parsedBody = app()->request->getParsedBody();
if (is_null($name)) {
return $parsedBody;
}
if (isset($parsedBody[$name])) {
return $parsedBody[$name];
}
return $default;
} | [
"public",
"static",
"function",
"delete",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"parsedBody",
"=",
"app",
"(",
")",
"->",
"request",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"na... | Retrieves DELETE parameter.
@param string $name Name of DELETE parameter, if null then all parameter will be returned
@param mixed $default Default value returned if *$name* is not null but does not exist in DELETE request
@return mixed | [
"Retrieves",
"DELETE",
"parameter",
"."
] | train | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/Input.php#L61-L74 |
kenphp/ken | src/Helpers/Input.php | Input.files | public static function files($name = null)
{
$files = app()->request->getUploadedFiles();
if (is_null($name)) {
return $files;
}
if (isset($files[$name])) {
return $files[$name];
}
return null;
} | php | public static function files($name = null)
{
$files = app()->request->getUploadedFiles();
if (is_null($name)) {
return $files;
}
if (isset($files[$name])) {
return $files[$name];
}
return null;
} | [
"public",
"static",
"function",
"files",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"files",
"=",
"app",
"(",
")",
"->",
"request",
"->",
"getUploadedFiles",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
... | Retrieves Uploaded Files.
@param string $name Name of Uploaded Files parameter, if null then all value will be returned
@return \Psr\Http\Message\UploadedFileInterface|array|null | [
"Retrieves",
"Uploaded",
"Files",
"."
] | train | https://github.com/kenphp/ken/blob/c454a86f0ab55c52c88e9bff5bc6fb4e7bd9e0eb/src/Helpers/Input.php#L106-L119 |
petrica/php-statsd-system | Command/NotifyCommand.php | NotifyCommand.getStatsd | protected function getStatsd(InputInterface $input)
{
if (null === $this->statsd) {
$this->statsdConnection = new UdpSocket(
$input->getOption('statsd-host'),
$input->getOption('statsd-port')
);
$this->statsd = new Client(
$... | php | protected function getStatsd(InputInterface $input)
{
if (null === $this->statsd) {
$this->statsdConnection = new UdpSocket(
$input->getOption('statsd-host'),
$input->getOption('statsd-port')
);
$this->statsd = new Client(
$... | [
"protected",
"function",
"getStatsd",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"statsd",
")",
"{",
"$",
"this",
"->",
"statsdConnection",
"=",
"new",
"UdpSocket",
"(",
"$",
"input",
"->",
"getOption",
"(... | Statically cache statsd client and return a statsd client
@param InputInterface $input
@return Client | [
"Statically",
"cache",
"statsd",
"client",
"and",
"return",
"a",
"statsd",
"client"
] | train | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Command/NotifyCommand.php#L134-L148 |
petrica/php-statsd-system | Command/NotifyCommand.php | NotifyCommand.getGauges | protected function getGauges($config)
{
if (null === $this->gauges) {
$this->gauges = array();
foreach ($config as $path => $details) {
$className = $details['class'];
if (class_exists($className)) {
$reflection = new \ReflectionCl... | php | protected function getGauges($config)
{
if (null === $this->gauges) {
$this->gauges = array();
foreach ($config as $path => $details) {
$className = $details['class'];
if (class_exists($className)) {
$reflection = new \ReflectionCl... | [
"protected",
"function",
"getGauges",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"gauges",
")",
"{",
"$",
"this",
"->",
"gauges",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"path",
"=>",
... | Instantiate selected gauges
@param array $config
@return GaugeInterface[] array | [
"Instantiate",
"selected",
"gauges"
] | train | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Command/NotifyCommand.php#L166-L199 |
ClementIV/yii-rest-rbac2.0 | controllers/RuleController.php | RuleController.actionIndex | public function actionIndex()
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['index']);
}
try{
$searchModel = new BizRuleSearch();
$dataProvider = $searchModel->search(Yii::$app->reque... | php | public function actionIndex()
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['index']);
}
try{
$searchModel = new BizRuleSearch();
$dataProvider = $searchModel->search(Yii::$app->reque... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"request",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
";",
"if",
"(",
"$",
"request",
"->",
"getIsOptions",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ResponseOptions",
"(",
"$... | Lists all AuthItem models.
@return mixed | [
"Lists",
"all",
"AuthItem",
"models",
"."
] | train | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/RuleController.php#L52-L67 |
ClementIV/yii-rest-rbac2.0 | controllers/RuleController.php | RuleController.actionView | public function actionView($id)
{
try{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['view']);
}
$model = $this->findModel($id);
if($model!=null){
$resu... | php | public function actionView($id)
{
try{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['view']);
}
$model = $this->findModel($id);
if($model!=null){
$resu... | [
"public",
"function",
"actionView",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"request",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
";",
"if",
"(",
"$",
"request",
"->",
"getIsOptions",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Displays a single AuthItem model.
@param string $id
@return mixed | [
"Displays",
"a",
"single",
"AuthItem",
"model",
"."
] | train | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/RuleController.php#L74-L94 |
ClementIV/yii-rest-rbac2.0 | controllers/RuleController.php | RuleController.actionCheckname | public function actionCheckname(){
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['checkname']);
}
$model = new BizRule(null);
$mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
if($m... | php | public function actionCheckname(){
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['checkname']);
}
$model = new BizRule(null);
$mo =$model->find(Yii::$app->request->post()['BizRule']['name']);
if($m... | [
"public",
"function",
"actionCheckname",
"(",
")",
"{",
"$",
"request",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
";",
"if",
"(",
"$",
"request",
"->",
"getIsOptions",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ResponseOptions",
"(",
... | check is a new item
@return boolan | [
"check",
"is",
"a",
"new",
"item"
] | train | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/RuleController.php#L99-L112 |
ClementIV/yii-rest-rbac2.0 | controllers/RuleController.php | RuleController.actionCreate | public function actionCreate()
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['create']);
}
try
{
$model = new BizRule(null);
if(!array_key_exists('BizRule', Yii::$app->request... | php | public function actionCreate()
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['create']);
}
try
{
$model = new BizRule(null);
if(!array_key_exists('BizRule', Yii::$app->request... | [
"public",
"function",
"actionCreate",
"(",
")",
"{",
"$",
"request",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
";",
"if",
"(",
"$",
"request",
"->",
"getIsOptions",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ResponseOptions",
"(",
"... | Creates a new AuthItem model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"AuthItem",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | train | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/RuleController.php#L135-L171 |
ClementIV/yii-rest-rbac2.0 | controllers/RuleController.php | RuleController.actionUpdate | public function actionUpdate($id)
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['update']);
}
if($model = $this->findModel($id)){
//($model->save());die();
if ($model->load(Yii::$app-... | php | public function actionUpdate($id)
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['update']);
}
if($model = $this->findModel($id)){
//($model->save());die();
if ($model->load(Yii::$app-... | [
"public",
"function",
"actionUpdate",
"(",
"$",
"id",
")",
"{",
"$",
"request",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
";",
"if",
"(",
"$",
"request",
"->",
"getIsOptions",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ResponseOptio... | Updates an existing AuthItem model.
If update is successful, the browser will be redirected to the 'view' page.
@param string $id
@return mixed | [
"Updates",
"an",
"existing",
"AuthItem",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | train | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/RuleController.php#L179-L196 |
ClementIV/yii-rest-rbac2.0 | controllers/RuleController.php | RuleController.actionDelete | public function actionDelete($id)
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['delete']);
}
try{
$model = $this->findModel($id);
Configs::authManager()->remove($model->item);
... | php | public function actionDelete($id)
{
$request = \Yii::$app->request;
if ($request->getIsOptions()) {
return $this->ResponseOptions($this->verbs()['delete']);
}
try{
$model = $this->findModel($id);
Configs::authManager()->remove($model->item);
... | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
")",
"{",
"$",
"request",
"=",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
";",
"if",
"(",
"$",
"request",
"->",
"getIsOptions",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"ResponseOptio... | Deletes an existing AuthItem model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param string $id
@return mixed | [
"Deletes",
"an",
"existing",
"AuthItem",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | train | https://github.com/ClementIV/yii-rest-rbac2.0/blob/435ffceca8d51b4d369182db3a06c20f336e9ac4/controllers/RuleController.php#L204-L221 |
NuclearCMS/Hierarchy | src/Support/TokenManager.php | TokenManager.setToken | public function setToken($key, $value, $duration = 60)
{
$this->cache->put('reactor.tokens.' . $key, $value, $duration);
} | php | public function setToken($key, $value, $duration = 60)
{
$this->cache->put('reactor.tokens.' . $key, $value, $duration);
} | [
"public",
"function",
"setToken",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
"=",
"60",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"put",
"(",
"'reactor.tokens.'",
".",
"$",
"key",
",",
"$",
"value",
",",
"$",
"duration",
")",
";",
... | Setter for token
@param string $key
@param string $value
@param int $duration | [
"Setter",
"for",
"token"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/TokenManager.php#L47-L50 |
NuclearCMS/Hierarchy | src/Support/TokenManager.php | TokenManager.makeNewToken | public function makeNewToken($key, $duration = 60)
{
$token = str_random(32);
$this->setToken($key, $token, $duration);
return $token;
} | php | public function makeNewToken($key, $duration = 60)
{
$token = str_random(32);
$this->setToken($key, $token, $duration);
return $token;
} | [
"public",
"function",
"makeNewToken",
"(",
"$",
"key",
",",
"$",
"duration",
"=",
"60",
")",
"{",
"$",
"token",
"=",
"str_random",
"(",
"32",
")",
";",
"$",
"this",
"->",
"setToken",
"(",
"$",
"key",
",",
"$",
"token",
",",
"$",
"duration",
")",
... | Creates a new token and returns it
@param string $key
@param int $duration
@return string | [
"Creates",
"a",
"new",
"token",
"and",
"returns",
"it"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/TokenManager.php#L59-L66 |
NuclearCMS/Hierarchy | src/Support/TokenManager.php | TokenManager.requestHasToken | public function requestHasToken($key)
{
$token = $this->request->input($key, null);
if($token && $token === $this->getToken($key))
{
return true;
}
return false;
} | php | public function requestHasToken($key)
{
$token = $this->request->input($key, null);
if($token && $token === $this->getToken($key))
{
return true;
}
return false;
} | [
"public",
"function",
"requestHasToken",
"(",
"$",
"key",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"$",
"key",
",",
"null",
")",
";",
"if",
"(",
"$",
"token",
"&&",
"$",
"token",
"===",
"$",
"this",
"->",
"ge... | Checks if the request has the token
@param string $key
@return bool | [
"Checks",
"if",
"the",
"request",
"has",
"the",
"token"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/TokenManager.php#L74-L84 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/RouteMethods.php | RouteMethods.& | public function & SetDomainRoutes ($routes = [], $autoInitialize = TRUE) {
/** @var $this \MvcCore\Ext\Routers\Module */
if ($autoInitialize) {
$this->domainRoutes = [];
$this->AddDomainRoutes($routes);
} else {
$newRoutes = [];
foreach ($routes as $route)
$newRoutes[$route->GetModule()] = $route... | php | public function & SetDomainRoutes ($routes = [], $autoInitialize = TRUE) {
/** @var $this \MvcCore\Ext\Routers\Module */
if ($autoInitialize) {
$this->domainRoutes = [];
$this->AddDomainRoutes($routes);
} else {
$newRoutes = [];
foreach ($routes as $route)
$newRoutes[$route->GetModule()] = $route... | [
"public",
"function",
"&",
"SetDomainRoutes",
"(",
"$",
"routes",
"=",
"[",
"]",
",",
"$",
"autoInitialize",
"=",
"TRUE",
")",
"{",
"/** @var $this \\MvcCore\\Ext\\Routers\\Module */",
"if",
"(",
"$",
"autoInitialize",
")",
"{",
"$",
"this",
"->",
"domainRoutes"... | Clear all possible previously configured module domain routes and set new
given routes again collection again. If there is no module property
configured in given route item in array configuration, route module is set
by given `$routes` array key, if key is not numeric.
Routes could be defined in various forms:
Example... | [
"Clear",
"all",
"possible",
"previously",
"configured",
"module",
"domain",
"routes",
"and",
"set",
"new",
"given",
"routes",
"again",
"collection",
"again",
".",
"If",
"there",
"is",
"no",
"module",
"property",
"configured",
"in",
"given",
"route",
"item",
"i... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/RouteMethods.php#L66-L78 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/RouteMethods.php | RouteMethods.& | public function & AddDomainRoutes ($routes, $prepend = FALSE, $throwExceptionForDuplication = TRUE) {
/** @var $this \MvcCore\Ext\Routers\Module */
if ($prepend) $routes = array_reverse($routes);
$routeClass = static::$routeClass;
foreach ($routes as $key => $route) {
$numericKey = is_numeric($key);
if ($... | php | public function & AddDomainRoutes ($routes, $prepend = FALSE, $throwExceptionForDuplication = TRUE) {
/** @var $this \MvcCore\Ext\Routers\Module */
if ($prepend) $routes = array_reverse($routes);
$routeClass = static::$routeClass;
foreach ($routes as $key => $route) {
$numericKey = is_numeric($key);
if ($... | [
"public",
"function",
"&",
"AddDomainRoutes",
"(",
"$",
"routes",
",",
"$",
"prepend",
"=",
"FALSE",
",",
"$",
"throwExceptionForDuplication",
"=",
"TRUE",
")",
"{",
"/** @var $this \\MvcCore\\Ext\\Routers\\Module */",
"if",
"(",
"$",
"prepend",
")",
"$",
"routes"... | Append or prepend new module domain routes. If there is no module property
configured in given route item in array configuration, route module is set
by given `$routes` array key, if key is not numeric.
Routes could be defined in various forms:
Example:
`\MvcCore\Router::GetInstance()->AddDomainRoutes([
"blog" => [
"p... | [
"Append",
"or",
"prepend",
"new",
"module",
"domain",
"routes",
".",
"If",
"there",
"is",
"no",
"module",
"property",
"configured",
"in",
"given",
"route",
"item",
"in",
"array",
"configuration",
"route",
"module",
"is",
"set",
"by",
"given",
"$routes",
"arr... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/RouteMethods.php#L128-L181 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/RouteMethods.php | RouteMethods.& | public function & AddDomainRoute ($routeCfgOrRoute, $prepend = FALSE, $throwExceptionForDuplication = TRUE) {
/** @var $this \MvcCore\Ext\Routers\Module */
$instance = & $this->getRouteDomainInstance($routeCfgOrRoute);
$routeModule = $instance->GetModule();
if (isset($this->domainRoutes[$routeModule]) && $throw... | php | public function & AddDomainRoute ($routeCfgOrRoute, $prepend = FALSE, $throwExceptionForDuplication = TRUE) {
/** @var $this \MvcCore\Ext\Routers\Module */
$instance = & $this->getRouteDomainInstance($routeCfgOrRoute);
$routeModule = $instance->GetModule();
if (isset($this->domainRoutes[$routeModule]) && $throw... | [
"public",
"function",
"&",
"AddDomainRoute",
"(",
"$",
"routeCfgOrRoute",
",",
"$",
"prepend",
"=",
"FALSE",
",",
"$",
"throwExceptionForDuplication",
"=",
"TRUE",
")",
"{",
"/** @var $this \\MvcCore\\Ext\\Routers\\Module */",
"$",
"instance",
"=",
"&",
"$",
"this",... | Append or prepend new module domain route.
Example:
`\MvcCore\Router::GetInstance()->AddDomainRoute([
"blog" => [
"pattern" => "//blog.%sld%.%tld%",
"namespace" => "Blog",
"defaults" => ["page" => 1],
"constraints" => ["page" => "\d+"],
"allowedLocalizations" => ["en-US"],
"allowedMediaVersions" => ["full" =... | [
"Append",
"or",
"prepend",
"new",
"module",
"domain",
"route",
".",
"Example",
":",
"\\",
"MvcCore",
"\\",
"Router",
"::",
"GetInstance",
"()",
"-",
">",
"AddDomainRoute",
"(",
"[",
"blog",
"=",
">",
"[",
"pattern",
"=",
">",
"//",
"blog",
".",
"%sld%"... | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/RouteMethods.php#L227-L245 |
mvccore/ext-router-module | src/MvcCore/Ext/Routers/Module/RouteMethods.php | RouteMethods.& | protected function & getRouteDomainInstance (& $routeCfgOrRoute) {
if ($routeCfgOrRoute instanceof \MvcCore\Ext\Routers\Modules\IRoute)
return $routeCfgOrRoute->SetRouter($this);
$routeClass = self::$routeDomainClass;
return $routeClass::CreateInstance($routeCfgOrRoute)->SetRouter($this);
} | php | protected function & getRouteDomainInstance (& $routeCfgOrRoute) {
if ($routeCfgOrRoute instanceof \MvcCore\Ext\Routers\Modules\IRoute)
return $routeCfgOrRoute->SetRouter($this);
$routeClass = self::$routeDomainClass;
return $routeClass::CreateInstance($routeCfgOrRoute)->SetRouter($this);
} | [
"protected",
"function",
"&",
"getRouteDomainInstance",
"(",
"&",
"$",
"routeCfgOrRoute",
")",
"{",
"if",
"(",
"$",
"routeCfgOrRoute",
"instanceof",
"\\",
"MvcCore",
"\\",
"Ext",
"\\",
"Routers",
"\\",
"Modules",
"\\",
"IRoute",
")",
"return",
"$",
"routeCfgOr... | Get always route instance from given route configuration data or return
already created given instance.
@param \MvcCore\Ext\Routers\Modules\Route|\MvcCore\Ext\Routers\Modules\IRoute|array $routeCfgOrRoute
Route instance or route config array.
@return \MvcCore\Ext\Routers\Modules\Route|\MvcCore\Ext\Routers\Modules\IRout... | [
"Get",
"always",
"route",
"instance",
"from",
"given",
"route",
"configuration",
"data",
"or",
"return",
"already",
"created",
"given",
"instance",
"."
] | train | https://github.com/mvccore/ext-router-module/blob/7695784a451db86cca6a43c98d076803cd0a50a7/src/MvcCore/Ext/Routers/Module/RouteMethods.php#L254-L259 |
gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.setOrderStatusDetail | public function setOrderStatusDetail(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\OrderStatusDetail $orderStatusDetail = null)
{
$this->order_status_detail = $orderStatusDetail;
return $this;
} | php | public function setOrderStatusDetail(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\OrderStatusDetail $orderStatusDetail = null)
{
$this->order_status_detail = $orderStatusDetail;
return $this;
} | [
"public",
"function",
"setOrderStatusDetail",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"OrderStatusDetail",
"$",
"orderStatusDetail",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"order_status_deta... | Set orderStatusDetail.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\OrderStatusDetail $orderStatusDetail
@return Order | [
"Set",
"orderStatusDetail",
"."
] | train | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L714-L719 |
gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.setCustomer | public function setCustomer(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\Customer $customer = null)
{
$this->customer = $customer;
return $this;
} | php | public function setCustomer(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\Customer $customer = null)
{
$this->customer = $customer;
return $this;
} | [
"public",
"function",
"setCustomer",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Customer",
"\\",
"Customer",
"$",
"customer",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"customer",
"=",
"$... | Set customer.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\Customer $customer
@return Order | [
"Set",
"customer",
"."
] | train | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L738-L743 |
gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.setTrading | public function setTrading(\Gpupo\CommonSchema\ORM\Entity\Trading\Trading $trading = null)
{
$this->trading = $trading;
return $this;
} | php | public function setTrading(\Gpupo\CommonSchema\ORM\Entity\Trading\Trading $trading = null)
{
$this->trading = $trading;
return $this;
} | [
"public",
"function",
"setTrading",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Trading",
"$",
"trading",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"trading",
"=",
"$",
"trading",
";",
"return",
"$",
"... | Set trading.
@param null|\Gpupo\CommonSchema\ORM\Entity\Trading\Trading $trading
@return Order | [
"Set",
"trading",
"."
] | train | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L762-L767 |
gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.addShipping | public function addShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
$this->shippings[] = $shipping;
return $this;
} | php | public function addShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
$this->shippings[] = $shipping;
return $this;
} | [
"public",
"function",
"addShipping",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Shipping",
"$",
"shipping",
")",
"{",
"$",
"this",
"->",
"shippings",
"[",
"]",
"=",
"$",... | Add shipping.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping
@return Order | [
"Add",
"shipping",
"."
] | train | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L786-L791 |
gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.removeShipping | public function removeShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
return $this->shippings->removeElement($shipping);
} | php | public function removeShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping)
{
return $this->shippings->removeElement($shipping);
} | [
"public",
"function",
"removeShipping",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Shipping",
"\\",
"Shipping",
"$",
"shipping",
")",
"{",
"return",
"$",
"this",
"->",
"shippings",
"->",
"r... | Remove shipping.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"shipping",
"."
] | train | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L800-L803 |
gpupo/common-schema | src/ORM/Entity/Trading/Order/Order.php | Order.removeFeedback | public function removeFeedback(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Feedback\Feedback $feedback)
{
return $this->feedbacks->removeElement($feedback);
} | php | public function removeFeedback(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Feedback\Feedback $feedback)
{
return $this->feedbacks->removeElement($feedback);
} | [
"public",
"function",
"removeFeedback",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Trading",
"\\",
"Order",
"\\",
"Feedback",
"\\",
"Feedback",
"$",
"feedback",
")",
"{",
"return",
"$",
"this",
"->",
"feedbacks",
"->",
"r... | Remove feedback.
@param \Gpupo\CommonSchema\ORM\Entity\Trading\Order\Feedback\Feedback $feedback
@return bool TRUE if this collection contained the specified element, FALSE otherwise | [
"Remove",
"feedback",
"."
] | train | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Trading/Order/Order.php#L836-L839 |
WellCommerce/StandardEditionBundle | DataFixtures/ORM/LoadPageData.php | LoadPageData.load | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$this->manager = $manager;
$this->shop = $this->getReference('shop');
$this->defaultText = $this->getFakerGenerator()->text(600);
$aboutUs = $t... | php | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$this->manager = $manager;
$this->shop = $this->getReference('shop');
$this->defaultText = $this->getFakerGenerator()->text(600);
$aboutUs = $t... | [
"public",
"function",
"load",
"(",
"ObjectManager",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"manager",
"=",
"$",
"manager",
";",
"$",
"this",
"->",
"shop",... | {@inheritDoc} | [
"{"
] | train | https://github.com/WellCommerce/StandardEditionBundle/blob/6367bd20bbb6bde37c710a6ba87ae72b5f05f61e/DataFixtures/ORM/LoadPageData.php#L40-L87 |
WellCommerce/StandardEditionBundle | DataFixtures/ORM/LoadPageData.php | LoadPageData.createPage | protected function createPage($name, $hierarchy, Page $parent = null): Page
{
$page = new Page();
$page->setParent($parent);
$page->setHierarchy($hierarchy);
$page->setPublish(1);
$page->setRedirectType(0);
$page->setSection('');
$page->addShop($this->shop);
... | php | protected function createPage($name, $hierarchy, Page $parent = null): Page
{
$page = new Page();
$page->setParent($parent);
$page->setHierarchy($hierarchy);
$page->setPublish(1);
$page->setRedirectType(0);
$page->setSection('');
$page->addShop($this->shop);
... | [
"protected",
"function",
"createPage",
"(",
"$",
"name",
",",
"$",
"hierarchy",
",",
"Page",
"$",
"parent",
"=",
"null",
")",
":",
"Page",
"{",
"$",
"page",
"=",
"new",
"Page",
"(",
")",
";",
"$",
"page",
"->",
"setParent",
"(",
"$",
"parent",
")",... | Creates a cms page
@param string $name
@param int $hierarchy
@param Page $parent
@return Page | [
"Creates",
"a",
"cms",
"page"
] | train | https://github.com/WellCommerce/StandardEditionBundle/blob/6367bd20bbb6bde37c710a6ba87ae72b5f05f61e/DataFixtures/ORM/LoadPageData.php#L98-L120 |
verdet23/SphinxSearchBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sphinx_search');
$this->addIndexerSection($rootNode);
$this->addIndexesSection($rootNode);
$this->addSearchdSection($rootNode);
return $treeBuilder;
} | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('sphinx_search');
$this->addIndexerSection($rootNode);
$this->addIndexesSection($rootNode);
$this->addSearchdSection($rootNode);
return $treeBuilder;
} | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'sphinx_search'",
")",
";",
"$",
"this",
"->",
"addIndexerSection",
"(",
... | Generates the configuration tree.
@return TreeBuilder | [
"Generates",
"the",
"configuration",
"tree",
"."
] | train | https://github.com/verdet23/SphinxSearchBundle/blob/6452cc3a5fab83647b6c08574164249fb8f03b05/DependencyInjection/Configuration.php#L19-L29 |
verdet23/SphinxSearchBundle | DependencyInjection/Configuration.php | Configuration.addIndexerSection | private function addIndexerSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexer')
->addDefaultsIfNotSet()
->children()
->booleanNode('sudo')->defaultValue(false)->end()
... | php | private function addIndexerSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexer')
->addDefaultsIfNotSet()
->children()
->booleanNode('sudo')->defaultValue(false)->end()
... | [
"private",
"function",
"addIndexerSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'indexer'",
")",
"->",
"addDefaultsIfNotSet",
"(",
")",
"->",
"children",
"(",
")",
"->",
"boolea... | Set indexer parameters
@param ArrayNodeDefinition $node | [
"Set",
"indexer",
"parameters"
] | train | https://github.com/verdet23/SphinxSearchBundle/blob/6452cc3a5fab83647b6c08574164249fb8f03b05/DependencyInjection/Configuration.php#L36-L49 |
verdet23/SphinxSearchBundle | DependencyInjection/Configuration.php | Configuration.addIndexesSection | private function addIndexesSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexes')
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('key')
->prototype('scalar')->end()
... | php | private function addIndexesSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('indexes')
->isRequired()
->requiresAtLeastOneElement()
->useAttributeAsKey('key')
->prototype('scalar')->end()
... | [
"private",
"function",
"addIndexesSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'indexes'",
")",
"->",
"isRequired",
"(",
")",
"->",
"requiresAtLeastOneElement",
"(",
")",
"->",
... | Set indexes parameters
@param ArrayNodeDefinition $node | [
"Set",
"indexes",
"parameters"
] | train | https://github.com/verdet23/SphinxSearchBundle/blob/6452cc3a5fab83647b6c08574164249fb8f03b05/DependencyInjection/Configuration.php#L56-L67 |
verdet23/SphinxSearchBundle | DependencyInjection/Configuration.php | Configuration.addSearchdSection | private function addSearchdSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('searchd')
->addDefaultsIfNotSet()
->children()
->scalarNode('host')->defaultValue('localhost')->end()
... | php | private function addSearchdSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('searchd')
->addDefaultsIfNotSet()
->children()
->scalarNode('host')->defaultValue('localhost')->end()
... | [
"private",
"function",
"addSearchdSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'searchd'",
")",
"->",
"addDefaultsIfNotSet",
"(",
")",
"->",
"children",
"(",
")",
"->",
"scalar... | Set search daemon parameters
@param ArrayNodeDefinition $node | [
"Set",
"search",
"daemon",
"parameters"
] | train | https://github.com/verdet23/SphinxSearchBundle/blob/6452cc3a5fab83647b6c08574164249fb8f03b05/DependencyInjection/Configuration.php#L74-L87 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memcache.php | ezcCacheStorageMemcache.setOptions | public function setOptions( $options )
{
switch ( true )
{
case ( $options instanceof ezcCacheStorageMemcacheOptions ):
$this->properties['options'] = $options;
break;
case ( $options instanceof ezcCacheStorageOptions ):
$this->... | php | public function setOptions( $options )
{
switch ( true )
{
case ( $options instanceof ezcCacheStorageMemcacheOptions ):
$this->properties['options'] = $options;
break;
case ( $options instanceof ezcCacheStorageOptions ):
$this->... | [
"public",
"function",
"setOptions",
"(",
"$",
"options",
")",
"{",
"switch",
"(",
"true",
")",
"{",
"case",
"(",
"$",
"options",
"instanceof",
"ezcCacheStorageMemcacheOptions",
")",
":",
"$",
"this",
"->",
"properties",
"[",
"'options'",
"]",
"=",
"$",
"op... | Set new options.
Overwrites the options with the given ones.
@param ezcCacheStorageMemcacheOptions $options The options to set.
@throws ezcBasePropertyNotFoundException
If you tried to set a non-existent option value. The accepted
options depend on the ezcCacheStorage implementation and may
vary.
@throws ezcBaseValu... | [
"Set",
"new",
"options",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Cache/src/storage/memcache.php#L135-L155 |
alevilar/ristorantino-vendor | Fidelization/Model/Cliente.php | Cliente.getResponsabilidadIva | function getResponsabilidadIva($id = 0){
if($id == 0){
$id = $this->id;
}
$ret = $this->find('first',array('conditions'=>array('Cliente.id'=>$id),'contain'=>array('IvaResponsabilidad')));
return $ret;
} | php | function getResponsabilidadIva($id = 0){
if($id == 0){
$id = $this->id;
}
$ret = $this->find('first',array('conditions'=>array('Cliente.id'=>$id),'contain'=>array('IvaResponsabilidad')));
return $ret;
} | [
"function",
"getResponsabilidadIva",
"(",
"$",
"id",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"id",
"==",
"0",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"id",
";",
"}",
"$",
"ret",
"=",
"$",
"this",
"->",
"find",
"(",
"'first'",
",",
"array",
"... | Me devuelve la responsabilidad del cliente frente el IVA
@return array find(first) con Cliente e IvaResponsabilidad | [
"Me",
"devuelve",
"la",
"responsabilidad",
"del",
"cliente",
"frente",
"el",
"IVA"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Fidelization/Model/Cliente.php#L344-L350 |
alevilar/ristorantino-vendor | Fidelization/Model/Cliente.php | Cliente.filerBySearch | public function filerBySearch($data) {
$filter = $data['search'];
$condition = array(
'OR' => array(
$this->alias . '.nombre LIKE' => '%' . $filter . '%',
$this->alias . '.nrodocumento LIKE' => '%' . $filter . '%',
$this->alias . '.telefono LIK... | php | public function filerBySearch($data) {
$filter = $data['search'];
$condition = array(
'OR' => array(
$this->alias . '.nombre LIKE' => '%' . $filter . '%',
$this->alias . '.nrodocumento LIKE' => '%' . $filter . '%',
$this->alias . '.telefono LIK... | [
"public",
"function",
"filerBySearch",
"(",
"$",
"data",
")",
"{",
"$",
"filter",
"=",
"$",
"data",
"[",
"'search'",
"]",
";",
"$",
"condition",
"=",
"array",
"(",
"'OR'",
"=>",
"array",
"(",
"$",
"this",
"->",
"alias",
".",
"'.nombre LIKE'",
"=>",
"... | Or conditions with like | [
"Or",
"conditions",
"with",
"like"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Fidelization/Model/Cliente.php#L354-L366 |
surebert/surebert-framework | src/sb/Email/Attachment.php | Attachment.zip | public function zip()
{
if (empty($this->filepath)) {
throw(new \Exception("Must set \sb\Email\Attachment::file_path before zipping attachment"));
}
if (empty($this->name)) {
$this->name = basename($this->filepath);
}
$zip = new \ZipArchive();
... | php | public function zip()
{
if (empty($this->filepath)) {
throw(new \Exception("Must set \sb\Email\Attachment::file_path before zipping attachment"));
}
if (empty($this->name)) {
$this->name = basename($this->filepath);
}
$zip = new \ZipArchive();
... | [
"public",
"function",
"zip",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"filepath",
")",
")",
"{",
"throw",
"(",
"new",
"\\",
"Exception",
"(",
"\"Must set \\sb\\Email\\Attachment::file_path before zipping attachment\"",
")",
")",
";",
"}",
"if... | Zips the attachment before sending and sets the proper mime type | [
"Zips",
"the",
"attachment",
"before",
"sending",
"and",
"sets",
"the",
"proper",
"mime",
"type"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Attachment.php#L125-L161 |
surebert/surebert-framework | src/sb/Email/Attachment.php | Attachment.pgpEncrypt | public function pgpEncrypt($pgpEncrypt_key, $gnupg_path = '')
{
if (empty($gnupg_path)) {
$gnupg_path = \ROOT . '/private/resources/.gnupg';
}
if (!is_dir($gnupg_path)) {
throw(new \Exception('In order to use pgp engryption you must either '
.'pass a... | php | public function pgpEncrypt($pgpEncrypt_key, $gnupg_path = '')
{
if (empty($gnupg_path)) {
$gnupg_path = \ROOT . '/private/resources/.gnupg';
}
if (!is_dir($gnupg_path)) {
throw(new \Exception('In order to use pgp engryption you must either '
.'pass a... | [
"public",
"function",
"pgpEncrypt",
"(",
"$",
"pgpEncrypt_key",
",",
"$",
"gnupg_path",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"gnupg_path",
")",
")",
"{",
"$",
"gnupg_path",
"=",
"\\",
"ROOT",
".",
"'/private/resources/.gnupg'",
";",
"}",
"i... | Encrypts the extension with PGP using gpg extension for php http://pecl.php.net/package/gnupg
@author James Buczkowski, Paul Visco
@param string $pgpEncrypt_key The key to use to encrypt
@param string $gnupg_path Optional The path to your .gnupg directory, must be
readible by apache, by default served out of /priv... | [
"Encrypts",
"the",
"extension",
"with",
"PGP",
"using",
"gpg",
"extension",
"for",
"php",
"http",
":",
"//",
"pecl",
".",
"php",
".",
"net",
"/",
"package",
"/",
"gnupg"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Email/Attachment.php#L170-L194 |
grozzzny/catalog | controllers/TraitController.php | TraitController.saveFiles | public function saveFiles(&$current_model)
{
foreach ($current_model->getAttributes() as $attribute => $value){
if($current_model->hasValidator('image', $attribute)) {
$current_model->$attribute = UploadedFile::getInstance($current_model, $attribute);
if($current_... | php | public function saveFiles(&$current_model)
{
foreach ($current_model->getAttributes() as $attribute => $value){
if($current_model->hasValidator('image', $attribute)) {
$current_model->$attribute = UploadedFile::getInstance($current_model, $attribute);
if($current_... | [
"public",
"function",
"saveFiles",
"(",
"&",
"$",
"current_model",
")",
"{",
"foreach",
"(",
"$",
"current_model",
"->",
"getAttributes",
"(",
")",
"as",
"$",
"attribute",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"current_model",
"->",
"hasValidator",... | Сохранение изображений и файлов. Отличе в методе сохранения
@param $current_model | [
"Сохранение",
"изображений",
"и",
"файлов",
".",
"Отличе",
"в",
"методе",
"сохранения"
] | train | https://github.com/grozzzny/catalog/blob/ff1cac10a5f3a89f3ef2767f9ede6b2d74e1849a/controllers/TraitController.php#L18-L37 |
OKTOTV/OktolabMediaBundle | Model/MediaService.php | MediaService.addEpisodeJob | public function addEpisodeJob(Keychain $keychain, $uniqID, $overwrite = false, $worker_queue = false ,$first = false)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportEpisodeMetadataJob",
[
'keychain' => $keychain->getUniqID(),
'uniqID' =>... | php | public function addEpisodeJob(Keychain $keychain, $uniqID, $overwrite = false, $worker_queue = false ,$first = false)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportEpisodeMetadataJob",
[
'keychain' => $keychain->getUniqID(),
'uniqID' =>... | [
"public",
"function",
"addEpisodeJob",
"(",
"Keychain",
"$",
"keychain",
",",
"$",
"uniqID",
",",
"$",
"overwrite",
"=",
"false",
",",
"$",
"worker_queue",
"=",
"false",
",",
"$",
"first",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"jobService",
"->",
... | starts an import worker for an episode by uniqID from the given Keychain | [
"starts",
"an",
"import",
"worker",
"for",
"an",
"episode",
"by",
"uniqID",
"from",
"the",
"given",
"Keychain"
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/MediaService.php#L92-L104 |
OKTOTV/OktolabMediaBundle | Model/MediaService.php | MediaService.addImportSeriesPosterframeJob | public function addImportSeriesPosterframeJob($uniqID, $keychain, $filekey)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportSeriesPosterframeJob",
['uniqID' => $uniqID, 'keychain' => $keychain->getUniqID(), 'key' => $filekey]
);
} | php | public function addImportSeriesPosterframeJob($uniqID, $keychain, $filekey)
{
$this->jobService->addJob(
"Oktolab\MediaBundle\Model\ImportSeriesPosterframeJob",
['uniqID' => $uniqID, 'keychain' => $keychain->getUniqID(), 'key' => $filekey]
);
} | [
"public",
"function",
"addImportSeriesPosterframeJob",
"(",
"$",
"uniqID",
",",
"$",
"keychain",
",",
"$",
"filekey",
")",
"{",
"$",
"this",
"->",
"jobService",
"->",
"addJob",
"(",
"\"Oktolab\\MediaBundle\\Model\\ImportSeriesPosterframeJob\"",
",",
"[",
"'uniqID'",
... | please use addSeriesPosterframeJob in the future.
@deprecated | [
"please",
"use",
"addSeriesPosterframeJob",
"in",
"the",
"future",
"."
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/MediaService.php#L313-L319 |
wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.describeColumns | public function describeColumns($conn, $table, $schema = null)
{
$dialect = $this->getDialect($conn);
if (method_exists($dialect, 'showFullColumns')) {
$sql = $this->getDialect($conn)->showFullColumns($table, $schema);
$comments = [];
foreach ($conn->fetchAll($sql... | php | public function describeColumns($conn, $table, $schema = null)
{
$dialect = $this->getDialect($conn);
if (method_exists($dialect, 'showFullColumns')) {
$sql = $this->getDialect($conn)->showFullColumns($table, $schema);
$comments = [];
foreach ($conn->fetchAll($sql... | [
"public",
"function",
"describeColumns",
"(",
"$",
"conn",
",",
"$",
"table",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"$",
"dialect",
"=",
"$",
"this",
"->",
"getDialect",
"(",
"$",
"conn",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"dialect"... | Adds comment to column
@param DbAdapter $conn
@param string $table
@param string $schema
@return Column[] | [
"Adds",
"comment",
"to",
"column"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L32-L53 |
wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.describeIndexes | public function describeIndexes($conn, $table, $schema = null)
{
$dialect = $conn->getDialectType();
$method = 'describeIndexes' . $dialect;
if (!method_exists($this, $method)) {
throw new Exception("Describe index for $dialect is not implemented yet");
}
return $... | php | public function describeIndexes($conn, $table, $schema = null)
{
$dialect = $conn->getDialectType();
$method = 'describeIndexes' . $dialect;
if (!method_exists($this, $method)) {
throw new Exception("Describe index for $dialect is not implemented yet");
}
return $... | [
"public",
"function",
"describeIndexes",
"(",
"$",
"conn",
",",
"$",
"table",
",",
"$",
"schema",
"=",
"null",
")",
"{",
"$",
"dialect",
"=",
"$",
"conn",
"->",
"getDialectType",
"(",
")",
";",
"$",
"method",
"=",
"'describeIndexes'",
".",
"$",
"dialec... | Describes table indexes
@param DbAdapter $conn
@param string $table
@param string $schema
@return Index[] | [
"Describes",
"table",
"indexes"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L63-L71 |
wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.createTable | public function createTable($conn, $table, $schema, array $definition)
{
if (empty($definition['columns'])) {
throw new Exception("The table must contain at least one column");
}
$conn->execute($this->getDialect($conn)->createTable($table, $schema, $definition));
} | php | public function createTable($conn, $table, $schema, array $definition)
{
if (empty($definition['columns'])) {
throw new Exception("The table must contain at least one column");
}
$conn->execute($this->getDialect($conn)->createTable($table, $schema, $definition));
} | [
"public",
"function",
"createTable",
"(",
"$",
"conn",
",",
"$",
"table",
",",
"$",
"schema",
",",
"array",
"$",
"definition",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"definition",
"[",
"'columns'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"(... | creates database table | [
"creates",
"database",
"table"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L100-L106 |
wenbinye/PhalconX | src/Db/DbHelper.php | DbHelper.getConnection | public static function getConnection($dsn)
{
if (!is_array($dsn)) {
$dsn = self::parseDsn($dsn);
}
if (!isset($dsn['adapter'])) {
throw new Exception("database adapter is missing for " . json_encode($dsn));
}
$class = 'Phalcon\Db\Adapter\Pdo\\' . ucfir... | php | public static function getConnection($dsn)
{
if (!is_array($dsn)) {
$dsn = self::parseDsn($dsn);
}
if (!isset($dsn['adapter'])) {
throw new Exception("database adapter is missing for " . json_encode($dsn));
}
$class = 'Phalcon\Db\Adapter\Pdo\\' . ucfir... | [
"public",
"static",
"function",
"getConnection",
"(",
"$",
"dsn",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"dsn",
")",
")",
"{",
"$",
"dsn",
"=",
"self",
"::",
"parseDsn",
"(",
"$",
"dsn",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$"... | creates database connect by dsn
@param string $dsn
@return DbAdapter | [
"creates",
"database",
"connect",
"by",
"dsn"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Db/DbHelper.php#L159-L170 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setOptions | public function setOptions(array $opt = array())
{
// BC checks
// TODO remove in 1.1
if (isset($opt['compileDir']) || isset($opt['compile_dir'])) {
trigger_error('Dwoo ZF Adapter: the compile dir should be set in the $options[\'engine\'][\'compileDir\'] value the adapter settings', E_USER_WARNING);
}
if... | php | public function setOptions(array $opt = array())
{
// BC checks
// TODO remove in 1.1
if (isset($opt['compileDir']) || isset($opt['compile_dir'])) {
trigger_error('Dwoo ZF Adapter: the compile dir should be set in the $options[\'engine\'][\'compileDir\'] value the adapter settings', E_USER_WARNING);
}
if... | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"opt",
"=",
"array",
"(",
")",
")",
"{",
"// BC checks",
"// TODO remove in 1.1",
"if",
"(",
"isset",
"(",
"$",
"opt",
"[",
"'compileDir'",
"]",
")",
"||",
"isset",
"(",
"$",
"opt",
"[",
"'compile_di... | Set object state from options array
- engine = engine class name|engine object|array of options for engine
- dataProvider = data provider class name|data provider object|array of options for data provider
- compiler = compiler class name|compiler object|array of options for compiler
- templateFile =
Arra... | [
"Set",
"object",
"state",
"from",
"options",
"array",
"-",
"engine",
"=",
"engine",
"class",
"name|engine",
"object|array",
"of",
"options",
"for",
"engine",
"-",
"dataProvider",
"=",
"data",
"provider",
"class",
"name|data",
"provider",
"object|array",
"of",
"o... | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L93-L139 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setEngine | public function setEngine($engine)
{
// if param given as an object
if ($engine instanceof Dwoo) {
$this->_engine = $engine;
}
//
elseif (is_subclass_of($engine, 'Dwoo') || 'Dwoo' === $engine) {
$this->_engine = new $engine();
}
else {
throw new Dwoo_Exception("Custom engine must be a subclass o... | php | public function setEngine($engine)
{
// if param given as an object
if ($engine instanceof Dwoo) {
$this->_engine = $engine;
}
//
elseif (is_subclass_of($engine, 'Dwoo') || 'Dwoo' === $engine) {
$this->_engine = new $engine();
}
else {
throw new Dwoo_Exception("Custom engine must be a subclass o... | [
"public",
"function",
"setEngine",
"(",
"$",
"engine",
")",
"{",
"// if param given as an object",
"if",
"(",
"$",
"engine",
"instanceof",
"Dwoo",
")",
"{",
"$",
"this",
"->",
"_engine",
"=",
"$",
"engine",
";",
"}",
"//",
"elseif",
"(",
"is_subclass_of",
... | Sets template engine
@param string|Dwoo Object or name of the class | [
"Sets",
"template",
"engine"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L253-L266 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setDataProvider | public function setDataProvider($data)
{
if ($data instanceof Dwoo_IDataProvider) {
$this->_dataProvider = $data;
}
elseif (is_subclass_of($data, 'Dwoo_Data') || 'Dwoo_Data' == $data) {
$this->_dataProvider = new $data();
}
else {
throw new Dwoo_Exception("Custom data provider must be a subclass of ... | php | public function setDataProvider($data)
{
if ($data instanceof Dwoo_IDataProvider) {
$this->_dataProvider = $data;
}
elseif (is_subclass_of($data, 'Dwoo_Data') || 'Dwoo_Data' == $data) {
$this->_dataProvider = new $data();
}
else {
throw new Dwoo_Exception("Custom data provider must be a subclass of ... | [
"public",
"function",
"setDataProvider",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"instanceof",
"Dwoo_IDataProvider",
")",
"{",
"$",
"this",
"->",
"_dataProvider",
"=",
"$",
"data",
";",
"}",
"elseif",
"(",
"is_subclass_of",
"(",
"$",
"data",
... | Sets Dwoo data object
@param string|Dwoo_Data Object or name of the class | [
"Sets",
"Dwoo",
"data",
"object"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L287-L298 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.setCompiler | public function setCompiler($compiler)
{
// if param given as an object
if ($compiler instanceof Dwoo_ICompiler) {
$this->_compiler = $compiler;
}
// if param given as a string
elseif (is_subclass_of($compiler, 'Dwoo_Compiler') || 'Dwoo_Compiler' == $compiler) {
$this->_compiler = new $compiler;
}
... | php | public function setCompiler($compiler)
{
// if param given as an object
if ($compiler instanceof Dwoo_ICompiler) {
$this->_compiler = $compiler;
}
// if param given as a string
elseif (is_subclass_of($compiler, 'Dwoo_Compiler') || 'Dwoo_Compiler' == $compiler) {
$this->_compiler = new $compiler;
}
... | [
"public",
"function",
"setCompiler",
"(",
"$",
"compiler",
")",
"{",
"// if param given as an object",
"if",
"(",
"$",
"compiler",
"instanceof",
"Dwoo_ICompiler",
")",
"{",
"$",
"this",
"->",
"_compiler",
"=",
"$",
"compiler",
";",
"}",
"// if param given as a str... | Sets Dwoo compiler
@param string|Dwoo_Compiler Object or name of the class | [
"Sets",
"Dwoo",
"compiler"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L320-L334 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.getCompiler | public function getCompiler()
{
if (null === $this->_compiler) {
$this->_compiler = Dwoo_Compiler::compilerFactory();
}
return $this->_compiler;
} | php | public function getCompiler()
{
if (null === $this->_compiler) {
$this->_compiler = Dwoo_Compiler::compilerFactory();
}
return $this->_compiler;
} | [
"public",
"function",
"getCompiler",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_compiler",
")",
"{",
"$",
"this",
"->",
"_compiler",
"=",
"Dwoo_Compiler",
"::",
"compilerFactory",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"_co... | Return the Dwoo compiler object
@return Dwoo_Data | [
"Return",
"the",
"Dwoo",
"compiler",
"object"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L341-L348 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php | Dwoo_Adapters_ZendFramework_View.getTemplateFile | public function getTemplateFile($template) {
$templateFileClass = $this->_templateFileClass;
$dwooTemplateFile = new $templateFileClass($template);
if (!($dwooTemplateFile instanceof Dwoo_ITemplate)) {
throw new Dwoo_Exception("Custom templateFile class must be a subclass of Dwoo_ITemplate");
}
fore... | php | public function getTemplateFile($template) {
$templateFileClass = $this->_templateFileClass;
$dwooTemplateFile = new $templateFileClass($template);
if (!($dwooTemplateFile instanceof Dwoo_ITemplate)) {
throw new Dwoo_Exception("Custom templateFile class must be a subclass of Dwoo_ITemplate");
}
fore... | [
"public",
"function",
"getTemplateFile",
"(",
"$",
"template",
")",
"{",
"$",
"templateFileClass",
"=",
"$",
"this",
"->",
"_templateFileClass",
";",
"$",
"dwooTemplateFile",
"=",
"new",
"$",
"templateFileClass",
"(",
"$",
"template",
")",
";",
"if",
"(",
"!... | Initializes Dwoo_ITemplate type of class and sets properties from _templateFileSettings
@param string Template location
@return Dwoo_ITemplate | [
"Initializes",
"Dwoo_ITemplate",
"type",
"of",
"class",
"and",
"sets",
"properties",
"from",
"_templateFileSettings"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/ZendFramework/View.php#L356-L372 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.