id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
200,300 | ScaraMVC/Framework | src/Scara/Foundation/Application.php | Application.loadConfig | private function loadConfig()
{
$this->_config = new Configuration();
$this->_config->from('app');
// let's go ahead and set timezone
date_default_timezone_set($this->_config->get('timezone'));
} | php | private function loadConfig()
{
$this->_config = new Configuration();
$this->_config->from('app');
// let's go ahead and set timezone
date_default_timezone_set($this->_config->get('timezone'));
} | [
"private",
"function",
"loadConfig",
"(",
")",
"{",
"$",
"this",
"->",
"_config",
"=",
"new",
"Configuration",
"(",
")",
";",
"$",
"this",
"->",
"_config",
"->",
"from",
"(",
"'app'",
")",
";",
"// let's go ahead and set timezone",
"date_default_timezone_set",
... | Loads the application's main configuration.
@return void | [
"Loads",
"the",
"application",
"s",
"main",
"configuration",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Foundation/Application.php#L84-L91 |
200,301 | ScaraMVC/Framework | src/Scara/Foundation/Application.php | Application.registerControllers | private function registerControllers()
{
$this->_controller = new Controller();
$this->_controller->load($this->_router,
$this->_config->get('basepath'));
} | php | private function registerControllers()
{
$this->_controller = new Controller();
$this->_controller->load($this->_router,
$this->_config->get('basepath'));
} | [
"private",
"function",
"registerControllers",
"(",
")",
"{",
"$",
"this",
"->",
"_controller",
"=",
"new",
"Controller",
"(",
")",
";",
"$",
"this",
"->",
"_controller",
"->",
"load",
"(",
"$",
"this",
"->",
"_router",
",",
"$",
"this",
"->",
"_config",
... | Responsible for registering the app controllers.
@return void | [
"Responsible",
"for",
"registering",
"the",
"app",
"controllers",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Foundation/Application.php#L143-L148 |
200,302 | ScaraMVC/Framework | src/Scara/Foundation/Application.php | Application.registerScaraMasterSessionToken | private function registerScaraMasterSessionToken()
{
$s = SessionInitializer::init();
$h = new OpenSslHasher();
if (!$s->has('SCARA_SESSION_TOKEN')) {
$token = substr($h->tokenize($h->random_string(16), time()), 0, 16);
$session = $h->tokenize($token, hash('sha256', ... | php | private function registerScaraMasterSessionToken()
{
$s = SessionInitializer::init();
$h = new OpenSslHasher();
if (!$s->has('SCARA_SESSION_TOKEN')) {
$token = substr($h->tokenize($h->random_string(16), time()), 0, 16);
$session = $h->tokenize($token, hash('sha256', ... | [
"private",
"function",
"registerScaraMasterSessionToken",
"(",
")",
"{",
"$",
"s",
"=",
"SessionInitializer",
"::",
"init",
"(",
")",
";",
"$",
"h",
"=",
"new",
"OpenSslHasher",
"(",
")",
";",
"if",
"(",
"!",
"$",
"s",
"->",
"has",
"(",
"'SCARA_SESSION_T... | Registers Scara's master session.
@return void | [
"Registers",
"Scara",
"s",
"master",
"session",
"."
] | 199b08b45fadf5dae14ac4732af03b36e15bbef2 | https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Foundation/Application.php#L155-L166 |
200,303 | infusephp/cron | src/Libs/Runner.php | Runner.setUp | private function setUp($class, Run $run)
{
if (!$class) {
$run->writeOutput("Missing `class` parameter on {$this->jobModel->id} job")
->setResult(Run::RESULT_FAILED);
return false;
}
if (!class_exists($class)) {
$run->writeOutput("$class ... | php | private function setUp($class, Run $run)
{
if (!$class) {
$run->writeOutput("Missing `class` parameter on {$this->jobModel->id} job")
->setResult(Run::RESULT_FAILED);
return false;
}
if (!class_exists($class)) {
$run->writeOutput("$class ... | [
"private",
"function",
"setUp",
"(",
"$",
"class",
",",
"Run",
"$",
"run",
")",
"{",
"if",
"(",
"!",
"$",
"class",
")",
"{",
"$",
"run",
"->",
"writeOutput",
"(",
"\"Missing `class` parameter on {$this->jobModel->id} job\"",
")",
"->",
"setResult",
"(",
"Run... | Sets up an invokable class for a scheduled job run.
@param string $class
@param Run $run
@return callable|false | [
"Sets",
"up",
"an",
"invokable",
"class",
"for",
"a",
"scheduled",
"job",
"run",
"."
] | 783f6078b455a48415efeba0a6ee97ab17a3a903 | https://github.com/infusephp/cron/blob/783f6078b455a48415efeba0a6ee97ab17a3a903/src/Libs/Runner.php#L135-L159 |
200,304 | infusephp/cron | src/Libs/Runner.php | Runner.invoke | private function invoke(callable $job, Run $run)
{
try {
ob_start();
$ret = call_user_func($job, $run);
$result = Run::RESULT_SUCCEEDED;
if (false === $ret) {
$result = Run::RESULT_FAILED;
}
return $run->writeOutput(ob... | php | private function invoke(callable $job, Run $run)
{
try {
ob_start();
$ret = call_user_func($job, $run);
$result = Run::RESULT_SUCCEEDED;
if (false === $ret) {
$result = Run::RESULT_FAILED;
}
return $run->writeOutput(ob... | [
"private",
"function",
"invoke",
"(",
"callable",
"$",
"job",
",",
"Run",
"$",
"run",
")",
"{",
"try",
"{",
"ob_start",
"(",
")",
";",
"$",
"ret",
"=",
"call_user_func",
"(",
"$",
"job",
",",
"$",
"run",
")",
";",
"$",
"result",
"=",
"Run",
"::",... | Executes the actual job.
@param Run $run
@return Run | [
"Executes",
"the",
"actual",
"job",
"."
] | 783f6078b455a48415efeba0a6ee97ab17a3a903 | https://github.com/infusephp/cron/blob/783f6078b455a48415efeba0a6ee97ab17a3a903/src/Libs/Runner.php#L168-L190 |
200,305 | infusephp/cron | src/Libs/Runner.php | Runner.saveRun | private function saveRun(Run $run)
{
$this->jobModel->last_ran = time();
$this->jobModel->last_run_succeeded = $run->succeeded();
$this->jobModel->last_run_output = $run->getOutput();
$this->jobModel->save();
} | php | private function saveRun(Run $run)
{
$this->jobModel->last_ran = time();
$this->jobModel->last_run_succeeded = $run->succeeded();
$this->jobModel->last_run_output = $run->getOutput();
$this->jobModel->save();
} | [
"private",
"function",
"saveRun",
"(",
"Run",
"$",
"run",
")",
"{",
"$",
"this",
"->",
"jobModel",
"->",
"last_ran",
"=",
"time",
"(",
")",
";",
"$",
"this",
"->",
"jobModel",
"->",
"last_run_succeeded",
"=",
"$",
"run",
"->",
"succeeded",
"(",
")",
... | Saves the run attempt.
@param Run $run | [
"Saves",
"the",
"run",
"attempt",
"."
] | 783f6078b455a48415efeba0a6ee97ab17a3a903 | https://github.com/infusephp/cron/blob/783f6078b455a48415efeba0a6ee97ab17a3a903/src/Libs/Runner.php#L197-L203 |
200,306 | pdyn/base | ErrorHandler.php | ErrorHandler.format_backtrace | public static function format_backtrace($backtrace) {
global $CFG;
$html = '';
$i = count($backtrace);
foreach ($backtrace as $trace) {
$file = (isset($trace['file'])) ? str_replace($CFG->base_absroot, '', $trace['file']) : 'unknown';
$line = 'Line: '. ((isset($trace['line'])) ? $trace['line'] : '-');
... | php | public static function format_backtrace($backtrace) {
global $CFG;
$html = '';
$i = count($backtrace);
foreach ($backtrace as $trace) {
$file = (isset($trace['file'])) ? str_replace($CFG->base_absroot, '', $trace['file']) : 'unknown';
$line = 'Line: '. ((isset($trace['line'])) ? $trace['line'] : '-');
... | [
"public",
"static",
"function",
"format_backtrace",
"(",
"$",
"backtrace",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"html",
"=",
"''",
";",
"$",
"i",
"=",
"count",
"(",
"$",
"backtrace",
")",
";",
"foreach",
"(",
"$",
"backtrace",
"as",
"$",
"trace"... | Format a backtrace for better display.
@param array $backtrace A backtrace from debug_backtrace.
@return string Html that better displays the backtrace. | [
"Format",
"a",
"backtrace",
"for",
"better",
"display",
"."
] | 0b93961693954a6b4e1c6df7e345e5cdf07f26ff | https://github.com/pdyn/base/blob/0b93961693954a6b4e1c6df7e345e5cdf07f26ff/ErrorHandler.php#L93-L129 |
200,307 | pdyn/base | ErrorHandler.php | ErrorHandler.error_handler | public static function error_handler($errcode, $errstr, $errfile, $errline, $errcontext) {
throw new \Exception($errstr.' in '.$errfile.' on line '.$errline, $errcode);
} | php | public static function error_handler($errcode, $errstr, $errfile, $errline, $errcontext) {
throw new \Exception($errstr.' in '.$errfile.' on line '.$errline, $errcode);
} | [
"public",
"static",
"function",
"error_handler",
"(",
"$",
"errcode",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
",",
"$",
"errcontext",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"$",
"errstr",
".",
"' in '",
".",
"$",
"errfi... | Handle PHP errors.
@param int $errcode The error code.
@param string $errstr The error description
@param string $errfile The file the error occurred in.
@param int $errline The line the error occurred on. | [
"Handle",
"PHP",
"errors",
"."
] | 0b93961693954a6b4e1c6df7e345e5cdf07f26ff | https://github.com/pdyn/base/blob/0b93961693954a6b4e1c6df7e345e5cdf07f26ff/ErrorHandler.php#L139-L141 |
200,308 | pdyn/base | ErrorHandler.php | ErrorHandler.write_error_html | public static function write_error_html($errtitle, $errdetails, $errcode, $backtrace = null) {
global $USR;
?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><?php ec... | php | public static function write_error_html($errtitle, $errdetails, $errcode, $backtrace = null) {
global $USR;
?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><?php ec... | [
"public",
"static",
"function",
"write_error_html",
"(",
"$",
"errtitle",
",",
"$",
"errdetails",
",",
"$",
"errcode",
",",
"$",
"backtrace",
"=",
"null",
")",
"{",
"global",
"$",
"USR",
";",
"?>\n\t\t<!DOCTYPE HTML>\n\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\" l... | For handle-able errors, print out our custom error screen.
@param string $errtitle The title of the error.
@param string $errdetails Details of the error.
@param string $errcode (Optional) An error code.
@param string $backtrace (Optional) A backtrace. | [
"For",
"handle",
"-",
"able",
"errors",
"print",
"out",
"our",
"custom",
"error",
"screen",
"."
] | 0b93961693954a6b4e1c6df7e345e5cdf07f26ff | https://github.com/pdyn/base/blob/0b93961693954a6b4e1c6df7e345e5cdf07f26ff/ErrorHandler.php#L151-L210 |
200,309 | mrofi/video-info | src/DailyMotion.php | DailyMotion.getDailyMotionId | public function getDailyMotionId($url)
{
if (preg_match('!^.+dailymotion\.com/(video|hub)/([^_]+)[^#]*(#video=([^_&]+))?|(dai\.ly/([^_]+))!', $url, $m)) {
if (isset($m[6])) {
return $m[6];
}
if (isset($m[4])) {
return $m[4];
}
... | php | public function getDailyMotionId($url)
{
if (preg_match('!^.+dailymotion\.com/(video|hub)/([^_]+)[^#]*(#video=([^_&]+))?|(dai\.ly/([^_]+))!', $url, $m)) {
if (isset($m[6])) {
return $m[6];
}
if (isset($m[4])) {
return $m[4];
}
... | [
"public",
"function",
"getDailyMotionId",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'!^.+dailymotion\\.com/(video|hub)/([^_]+)[^#]*(#video=([^_&]+))?|(dai\\.ly/([^_]+))!'",
",",
"$",
"url",
",",
"$",
"m",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$"... | Extracts the daily motion id from a daily motion url.
Returns false if the url is not recognized as a daily motion url. | [
"Extracts",
"the",
"daily",
"motion",
"id",
"from",
"a",
"daily",
"motion",
"url",
".",
"Returns",
"false",
"if",
"the",
"url",
"is",
"not",
"recognized",
"as",
"a",
"daily",
"motion",
"url",
"."
] | fa5b84212d04c284bb289a18c33c660881c92863 | https://github.com/mrofi/video-info/blob/fa5b84212d04c284bb289a18c33c660881c92863/src/DailyMotion.php#L40-L52 |
200,310 | KDF5000/EasyThink | src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_debug.php | Smarty_Internal_Debug.display_debug | public static function display_debug($obj)
{
// prepare information of assigned variables
$ptr = self::get_debug_vars($obj);
if ($obj instanceof Smarty) {
$smarty = clone $obj;
} else {
$smarty = clone $obj->smarty;
}
$_assigned_vars = $ptr->tp... | php | public static function display_debug($obj)
{
// prepare information of assigned variables
$ptr = self::get_debug_vars($obj);
if ($obj instanceof Smarty) {
$smarty = clone $obj;
} else {
$smarty = clone $obj->smarty;
}
$_assigned_vars = $ptr->tp... | [
"public",
"static",
"function",
"display_debug",
"(",
"$",
"obj",
")",
"{",
"// prepare information of assigned variables",
"$",
"ptr",
"=",
"self",
"::",
"get_debug_vars",
"(",
"$",
"obj",
")",
";",
"if",
"(",
"$",
"obj",
"instanceof",
"Smarty",
")",
"{",
"... | Opens a window for the Smarty Debugging Consol and display the data
@param Smarty_Internal_Template|Smarty $obj object to debug | [
"Opens",
"a",
"window",
"for",
"the",
"Smarty",
"Debugging",
"Consol",
"and",
"display",
"the",
"data"
] | 86efc9c8a0d504e01e2fea55868227fdc8928841 | https://github.com/KDF5000/EasyThink/blob/86efc9c8a0d504e01e2fea55868227fdc8928841/src/ThinkPHP/Library/Vendor/Smarty/sysplugins/smarty_internal_debug.php#L98-L136 |
200,311 | juliangut/mapping | src/Driver/AbstractDriverFactory.php | AbstractDriverFactory.getDriver | public function getDriver(array $mappingSource): DriverInterface
{
if (\array_key_exists('driver', $mappingSource)) {
$driver = $mappingSource['driver'];
if (!$driver instanceof DriverInterface) {
throw new DriverException(\sprintf(
'Metadata mapp... | php | public function getDriver(array $mappingSource): DriverInterface
{
if (\array_key_exists('driver', $mappingSource)) {
$driver = $mappingSource['driver'];
if (!$driver instanceof DriverInterface) {
throw new DriverException(\sprintf(
'Metadata mapp... | [
"public",
"function",
"getDriver",
"(",
"array",
"$",
"mappingSource",
")",
":",
"DriverInterface",
"{",
"if",
"(",
"\\",
"array_key_exists",
"(",
"'driver'",
",",
"$",
"mappingSource",
")",
")",
"{",
"$",
"driver",
"=",
"$",
"mappingSource",
"[",
"'driver'"... | Get mapping driver.
@param array $mappingSource
@throws DriverException
@return DriverInterface | [
"Get",
"mapping",
"driver",
"."
] | 1830ff84c054d8e3759df170a5664a97f7070be9 | https://github.com/juliangut/mapping/blob/1830ff84c054d8e3759df170a5664a97f7070be9/src/Driver/AbstractDriverFactory.php#L32-L56 |
200,312 | juliangut/mapping | src/Driver/AbstractDriverFactory.php | AbstractDriverFactory.getDriverImplementation | protected function getDriverImplementation(string $type, array $paths): DriverInterface
{
switch ($type) {
case DriverFactoryInterface::DRIVER_ANNOTATION:
return $this->getAnnotationDriver($paths);
case DriverFactoryInterface::DRIVER_PHP:
return $this... | php | protected function getDriverImplementation(string $type, array $paths): DriverInterface
{
switch ($type) {
case DriverFactoryInterface::DRIVER_ANNOTATION:
return $this->getAnnotationDriver($paths);
case DriverFactoryInterface::DRIVER_PHP:
return $this... | [
"protected",
"function",
"getDriverImplementation",
"(",
"string",
"$",
"type",
",",
"array",
"$",
"paths",
")",
":",
"DriverInterface",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"DriverFactoryInterface",
"::",
"DRIVER_ANNOTATION",
":",
"return",
"$",
... | Get mapping driver implementation.
@param string $type
@param array $paths
@throws DriverException
@return DriverInterface | [
"Get",
"mapping",
"driver",
"implementation",
"."
] | 1830ff84c054d8e3759df170a5664a97f7070be9 | https://github.com/juliangut/mapping/blob/1830ff84c054d8e3759df170a5664a97f7070be9/src/Driver/AbstractDriverFactory.php#L68-L90 |
200,313 | jabernardo/lollipop-php | Library/Log.php | Log._write | private static function _write($type, $message) {
$log_path = Config::get('log.folder', LOLLIPOP_STORAGE_LOG);
$log_enable = Config::get('log.enable', true);
$log_hourly = Config::get('log.hourly', false);
if (!is_dir($log_path))
throw new \Lollipop\Exception\Runtime(... | php | private static function _write($type, $message) {
$log_path = Config::get('log.folder', LOLLIPOP_STORAGE_LOG);
$log_enable = Config::get('log.enable', true);
$log_hourly = Config::get('log.hourly', false);
if (!is_dir($log_path))
throw new \Lollipop\Exception\Runtime(... | [
"private",
"static",
"function",
"_write",
"(",
"$",
"type",
",",
"$",
"message",
")",
"{",
"$",
"log_path",
"=",
"Config",
"::",
"get",
"(",
"'log.folder'",
",",
"LOLLIPOP_STORAGE_LOG",
")",
";",
"$",
"log_enable",
"=",
"Config",
"::",
"get",
"(",
"'log... | Append to log file
@param string $message Message log
@throws \Lollipop\Exception\Runtime
@throws \Lollipop\Exception\Argument
@return bool | [
"Append",
"to",
"log",
"file"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Log.php#L53-L81 |
200,314 | battis/data-utilities | src/DataUtilities.php | DataUtilities.loadCsvToArray | public static function loadCsvToArray($field, $firstRowLabels = true)
{
$result = false;
if (!empty($_FILES[$field]['tmp_name'])) {
/* open the file for reading */
$csv = fopen($_FILES[$field]['tmp_name'], 'r');
$result = array();
/* treat the first r... | php | public static function loadCsvToArray($field, $firstRowLabels = true)
{
$result = false;
if (!empty($_FILES[$field]['tmp_name'])) {
/* open the file for reading */
$csv = fopen($_FILES[$field]['tmp_name'], 'r');
$result = array();
/* treat the first r... | [
"public",
"static",
"function",
"loadCsvToArray",
"(",
"$",
"field",
",",
"$",
"firstRowLabels",
"=",
"true",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"_FILES",
"[",
"$",
"field",
"]",
"[",
"'tmp_name'",
"]",
")"... | Load an uploaded CSV file into an associative array
@param string $field Field name holding the file name
@param boolean $firstRowLabels (Optional) Default `TRUE`
@return string[][]|boolean A two-dimensional array of string values, if the
`$field` contains a CSV file, `FALSE` if there is no file | [
"Load",
"an",
"uploaded",
"CSV",
"file",
"into",
"an",
"associative",
"array"
] | 81e9771db3f3cfa1a757179ad447ee40703c55a3 | https://github.com/battis/data-utilities/blob/81e9771db3f3cfa1a757179ad447ee40703c55a3/src/DataUtilities.php#L108-L142 |
200,315 | battis/data-utilities | src/DataUtilities.php | DataUtilities.URLfromPath | public static function URLfromPath($path, array $vars = null, $basePath = false)
{
if ($vars === null) {
if (php_sapi_name() != 'cli') {
$vars = $_SERVER;
} else {
return false;
}
}
if ($basePath !== false && substr($path, ... | php | public static function URLfromPath($path, array $vars = null, $basePath = false)
{
if ($vars === null) {
if (php_sapi_name() != 'cli') {
$vars = $_SERVER;
} else {
return false;
}
}
if ($basePath !== false && substr($path, ... | [
"public",
"static",
"function",
"URLfromPath",
"(",
"$",
"path",
",",
"array",
"$",
"vars",
"=",
"null",
",",
"$",
"basePath",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"vars",
"===",
"null",
")",
"{",
"if",
"(",
"php_sapi_name",
"(",
")",
"!=",
"'cl... | Generate a URL from a path
@param string $path A valid file path
@param string[] $vars Optional (default: `$_SERVER` unless run from CLI,
in which case the method fails without this
parameter). Array must have keys `HTTPS,
SERVER_NAME, CONTEXT_PREFIX,
CONTEXT_DOCUMENT_ROOT`.
@param string|false $basePath The base path... | [
"Generate",
"a",
"URL",
"from",
"a",
"path"
] | 81e9771db3f3cfa1a757179ad447ee40703c55a3 | https://github.com/battis/data-utilities/blob/81e9771db3f3cfa1a757179ad447ee40703c55a3/src/DataUtilities.php#L193-L223 |
200,316 | OpenConext-Attic/OpenConext-engineblock-metadata | src/MetadataRepository/CachedDoctrineMetadataRepository.php | CachedDoctrineMetadataRepository.invoke | public function invoke($name, array $args)
{
$signature = $name . ':' . serialize($args);
if (!isset($this->cache[$signature])) {
$this->cache[$signature] = call_user_func_array(array($this->repository, $name), $args);
}
return $this->cache[$signature];
} | php | public function invoke($name, array $args)
{
$signature = $name . ':' . serialize($args);
if (!isset($this->cache[$signature])) {
$this->cache[$signature] = call_user_func_array(array($this->repository, $name), $args);
}
return $this->cache[$signature];
} | [
"public",
"function",
"invoke",
"(",
"$",
"name",
",",
"array",
"$",
"args",
")",
"{",
"$",
"signature",
"=",
"$",
"name",
".",
"':'",
".",
"serialize",
"(",
"$",
"args",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
... | Read results from cache or proxy to wrapped doctrine repository.
@param string $name
@param array $args
@return mixed | [
"Read",
"results",
"from",
"cache",
"or",
"proxy",
"to",
"wrapped",
"doctrine",
"repository",
"."
] | 236e2f52ef9cf28e71404544a1c4388f63ee535d | https://github.com/OpenConext-Attic/OpenConext-engineblock-metadata/blob/236e2f52ef9cf28e71404544a1c4388f63ee535d/src/MetadataRepository/CachedDoctrineMetadataRepository.php#L66-L75 |
200,317 | anime-db/catalog-bundle | src/Form/ViewSorter.php | ViewSorter.choice | public function choice(FormView $choice)
{
$that = $this;
if ($choice->vars['compound']) {
usort($choice->children, function (FormView $a, FormView $b) use ($that) {
return $that->compare($a->vars['label'] ?: $a->vars['value'], $b->vars['label'] ?: $b->vars['value']);
... | php | public function choice(FormView $choice)
{
$that = $this;
if ($choice->vars['compound']) {
usort($choice->children, function (FormView $a, FormView $b) use ($that) {
return $that->compare($a->vars['label'] ?: $a->vars['value'], $b->vars['label'] ?: $b->vars['value']);
... | [
"public",
"function",
"choice",
"(",
"FormView",
"$",
"choice",
")",
"{",
"$",
"that",
"=",
"$",
"this",
";",
"if",
"(",
"$",
"choice",
"->",
"vars",
"[",
"'compound'",
"]",
")",
"{",
"usort",
"(",
"$",
"choice",
"->",
"children",
",",
"function",
... | Sort choice.
@param FormView $choice | [
"Sort",
"choice",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Form/ViewSorter.php#L42-L54 |
200,318 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.updateCheck | private function updateCheck($name)
{
$filePath = Yii::getPathOfAlias('base.themes').DS.$name;
$details = $this->actionDetails($name);
if (file_exists($filePath.DS.'VERSION'))
{
$version = file_get_contents($filePath.DS.'VERSION');
if ($version != $details['latest-version'])
return true;
}
else
... | php | private function updateCheck($name)
{
$filePath = Yii::getPathOfAlias('base.themes').DS.$name;
$details = $this->actionDetails($name);
if (file_exists($filePath.DS.'VERSION'))
{
$version = file_get_contents($filePath.DS.'VERSION');
if ($version != $details['latest-version'])
return true;
}
else
... | [
"private",
"function",
"updateCheck",
"(",
"$",
"name",
")",
"{",
"$",
"filePath",
"=",
"Yii",
"::",
"getPathOfAlias",
"(",
"'base.themes'",
")",
".",
"DS",
".",
"$",
"name",
";",
"$",
"details",
"=",
"$",
"this",
"->",
"actionDetails",
"(",
"$",
"name... | Checks if an update is necessary
@param string $name
@return boolean | [
"Checks",
"if",
"an",
"update",
"is",
"necessary"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L94-L110 |
200,319 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.actionUpdateCheck | public function actionUpdateCheck($name=false)
{
if ($name == false)
return false;
if (defined('CII_CONFIG'))
return $this->returnError(200, Yii::t('Api.main', 'Update is not required'), false);
if ($this->updateCheck($name))
return $this->returnError(200, Yii::t('Api.main', 'Update is available'), tr... | php | public function actionUpdateCheck($name=false)
{
if ($name == false)
return false;
if (defined('CII_CONFIG'))
return $this->returnError(200, Yii::t('Api.main', 'Update is not required'), false);
if ($this->updateCheck($name))
return $this->returnError(200, Yii::t('Api.main', 'Update is available'), tr... | [
"public",
"function",
"actionUpdateCheck",
"(",
"$",
"name",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"false",
")",
"return",
"false",
";",
"if",
"(",
"defined",
"(",
"'CII_CONFIG'",
")",
")",
"return",
"$",
"this",
"->",
"returnError",
"(... | Exposed action to check for an update
@param string $name
@return boolean | [
"Exposed",
"action",
"to",
"check",
"for",
"an",
"update"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L117-L129 |
200,320 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.actionUpdate | public function actionUpdate($name=false)
{
if ($name == false || defined('CII_CONFIG'))
return false;
// Performs an update check, and if an update is available performs the update
if ($this->updateCheck($name))
{
if (!$this->actionInstall($name))
return $this->returnError(500, Yii::t('Api.main', '... | php | public function actionUpdate($name=false)
{
if ($name == false || defined('CII_CONFIG'))
return false;
// Performs an update check, and if an update is available performs the update
if ($this->updateCheck($name))
{
if (!$this->actionInstall($name))
return $this->returnError(500, Yii::t('Api.main', '... | [
"public",
"function",
"actionUpdate",
"(",
"$",
"name",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"false",
"||",
"defined",
"(",
"'CII_CONFIG'",
")",
")",
"return",
"false",
";",
"// Performs an update check, and if an update is available performs the up... | Performs an update
@return boolean | [
"Performs",
"an",
"update"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L135-L149 |
200,321 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.actionInstall | public function actionInstall($name=false)
{
if ($name == false || defined('CII_CONFIG'))
return false;
$filePath = Yii::getPathOfAlias('base.themes').DS.$name;
$details = $this->actionDetails($name);
// If the theme is already installed, make sure it is the correct version, otherwise we'll be performin... | php | public function actionInstall($name=false)
{
if ($name == false || defined('CII_CONFIG'))
return false;
$filePath = Yii::getPathOfAlias('base.themes').DS.$name;
$details = $this->actionDetails($name);
// If the theme is already installed, make sure it is the correct version, otherwise we'll be performin... | [
"public",
"function",
"actionInstall",
"(",
"$",
"name",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"false",
"||",
"defined",
"(",
"'CII_CONFIG'",
")",
")",
"return",
"false",
";",
"$",
"filePath",
"=",
"Yii",
"::",
"getPathOfAlias",
"(",
"'... | Installs and or updates a theme using the provided name
@return boolean | [
"Installs",
"and",
"or",
"updates",
"a",
"theme",
"using",
"the",
"provided",
"name"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L155-L235 |
200,322 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.actionUninstall | public function actionUninstall($name=false)
{
if ($name == false)
return false;
if ($name == 'default')
throw new CHttpException(400, Yii::t('Api.theme', 'You cannot uninstall the default theme.'));
if (!$this->actionIsInstalled($name))
return false;
$installedThemes = $this->actionInstalled();
... | php | public function actionUninstall($name=false)
{
if ($name == false)
return false;
if ($name == 'default')
throw new CHttpException(400, Yii::t('Api.theme', 'You cannot uninstall the default theme.'));
if (!$this->actionIsInstalled($name))
return false;
$installedThemes = $this->actionInstalled();
... | [
"public",
"function",
"actionUninstall",
"(",
"$",
"name",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"false",
")",
"return",
"false",
";",
"if",
"(",
"$",
"name",
"==",
"'default'",
")",
"throw",
"new",
"CHttpException",
"(",
"400",
",",
... | Uninstalls a theme by name
@return boolean | [
"Uninstalls",
"a",
"theme",
"by",
"name"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L241-L262 |
200,323 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.actionList | public function actionList()
{
// Don't allow theme listing in CII_CONFIG
if (defined('CII_CONFIG'))
return false;
$response = Yii::app()->cache->get('CiiMS::API::Themes::Available');
if ($response === false)
{
$url = 'https://themes.ciims.io/index.json';
$curl = new \Curl\Curl;
$response = $cur... | php | public function actionList()
{
// Don't allow theme listing in CII_CONFIG
if (defined('CII_CONFIG'))
return false;
$response = Yii::app()->cache->get('CiiMS::API::Themes::Available');
if ($response === false)
{
$url = 'https://themes.ciims.io/index.json';
$curl = new \Curl\Curl;
$response = $cur... | [
"public",
"function",
"actionList",
"(",
")",
"{",
"// Don't allow theme listing in CII_CONFIG",
"if",
"(",
"defined",
"(",
"'CII_CONFIG'",
")",
")",
"return",
"false",
";",
"$",
"response",
"=",
"Yii",
"::",
"app",
"(",
")",
"->",
"cache",
"->",
"get",
"(",... | Lists ciims-themes that are available for download via
@return array | [
"Lists",
"ciims",
"-",
"themes",
"that",
"are",
"available",
"for",
"download",
"via"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L268-L290 |
200,324 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.actionDetails | public function actionDetails($name=false)
{
if ($name == false)
throw new CHttpException(400, Yii::t('Api.Theme', 'Missing theme name'));
// Fetch the data from Packagist
$data = Yii::app()->cache->get('CiiMS::API::Themes::' . $name);
if ($data === false)
{
$url = 'https://packagist.org/packages/cii... | php | public function actionDetails($name=false)
{
if ($name == false)
throw new CHttpException(400, Yii::t('Api.Theme', 'Missing theme name'));
// Fetch the data from Packagist
$data = Yii::app()->cache->get('CiiMS::API::Themes::' . $name);
if ($data === false)
{
$url = 'https://packagist.org/packages/cii... | [
"public",
"function",
"actionDetails",
"(",
"$",
"name",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"false",
")",
"throw",
"new",
"CHttpException",
"(",
"400",
",",
"Yii",
"::",
"t",
"(",
"'Api.Theme'",
",",
"'Missing theme name'",
")",
")",
... | Retrieves the details about a particular theme
@param string $name
@return array | [
"Retrieves",
"the",
"details",
"about",
"a",
"particular",
"theme"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L297-L368 |
200,325 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.actionCallbackPost | public function actionCallbackPost($theme=NULL, $method=NULL)
{
$this->callback($theme, $method, $_POST);
} | php | public function actionCallbackPost($theme=NULL, $method=NULL)
{
$this->callback($theme, $method, $_POST);
} | [
"public",
"function",
"actionCallbackPost",
"(",
"$",
"theme",
"=",
"NULL",
",",
"$",
"method",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"callback",
"(",
"$",
"theme",
",",
"$",
"method",
",",
"$",
"_POST",
")",
";",
"}"
] | Allows themes to have their own dedicated callback resources for POST
This enables theme developers to not have to hack CiiMS Core in order to accomplish stuff
@param string $method The method of the current theme they want to call
@param string $theme The theme name
@return The output or action of the callback | [
"Allows",
"themes",
"to",
"have",
"their",
"own",
"dedicated",
"callback",
"resources",
"for",
"POST"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L391-L394 |
200,326 | ciims/ciims-modules-api | controllers/ThemeController.php | ThemeController.callback | private function callback($theme, $method, $data)
{
if ($theme == NULL)
throw new CHttpException(400, Yii::t('Api.Theme', 'Missing Theme'));
if ($method == NULL)
throw new CHttpException(400, Yii::t('Api.Theme', 'Method name is missing'));
Yii::import('base.themes.' . $theme . '.Theme');
$theme = new T... | php | private function callback($theme, $method, $data)
{
if ($theme == NULL)
throw new CHttpException(400, Yii::t('Api.Theme', 'Missing Theme'));
if ($method == NULL)
throw new CHttpException(400, Yii::t('Api.Theme', 'Method name is missing'));
Yii::import('base.themes.' . $theme . '.Theme');
$theme = new T... | [
"private",
"function",
"callback",
"(",
"$",
"theme",
",",
"$",
"method",
",",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"theme",
"==",
"NULL",
")",
"throw",
"new",
"CHttpException",
"(",
"400",
",",
"Yii",
"::",
"t",
"(",
"'Api.Theme'",
",",
"'Missing ... | Callback method for actionCallback and actionCallbackPost
@param string $method The method of the current theme they want to call
@param string $theme The theme name
@param array $data $_GET or $_POST
@return mixed | [
"Callback",
"method",
"for",
"actionCallback",
"and",
"actionCallbackPost"
] | 4351855328da0b112ac27bde7e7e07e212be8689 | https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/ThemeController.php#L404-L419 |
200,327 | covex-nn/JooS | src/JooS/Config/Adapter/Serialized.php | Adapter_Serialized.save | public function save($name, Config $config)
{
$path = $this->_getPath($name);
$data = $config->valueOf();
file_put_contents(
$path, serialize($data)
);
return true;
} | php | public function save($name, Config $config)
{
$path = $this->_getPath($name);
$data = $config->valueOf();
file_put_contents(
$path, serialize($data)
);
return true;
} | [
"public",
"function",
"save",
"(",
"$",
"name",
",",
"Config",
"$",
"config",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"_getPath",
"(",
"$",
"name",
")",
";",
"$",
"data",
"=",
"$",
"config",
"->",
"valueOf",
"(",
")",
";",
"file_put_contents... | Save config data
@param string $name Config name
@param Config $config Config data
@return boolean | [
"Save",
"config",
"data"
] | 8dfb94edccecaf307787d4091ba7f20a674b7792 | https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Config/Adapter/Serialized.php#L71-L81 |
200,328 | covex-nn/JooS | src/JooS/Config/Adapter/Serialized.php | Adapter_Serialized.delete | public function delete($name)
{
$path = $this->_getPath($name);
if (file_exists($path)) {
$result = @unlink($path);
} else {
$result = false;
}
return $result;
} | php | public function delete($name)
{
$path = $this->_getPath($name);
if (file_exists($path)) {
$result = @unlink($path);
} else {
$result = false;
}
return $result;
} | [
"public",
"function",
"delete",
"(",
"$",
"name",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"_getPath",
"(",
"$",
"name",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"result",
"=",
"@",
"unlink",
"(",
"$",
"pa... | Delete config data
@param string $name Config name
@return boolean | [
"Delete",
"config",
"data"
] | 8dfb94edccecaf307787d4091ba7f20a674b7792 | https://github.com/covex-nn/JooS/blob/8dfb94edccecaf307787d4091ba7f20a674b7792/src/JooS/Config/Adapter/Serialized.php#L90-L101 |
200,329 | koolkode/json | src/Json.php | Json.encode | public static function encode($data, $forceObject = false)
{
return @json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | ($forceObject ? JSON_FORCE_OBJECT : 0));
} | php | public static function encode($data, $forceObject = false)
{
return @json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | ($forceObject ? JSON_FORCE_OBJECT : 0));
} | [
"public",
"static",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"forceObject",
"=",
"false",
")",
"{",
"return",
"@",
"json_encode",
"(",
"$",
"data",
",",
"JSON_UNESCAPED_SLASHES",
"|",
"JSON_UNESCAPED_UNICODE",
"|",
"(",
"$",
"forceObject",
"?",
"JSO... | Encode the given data into a JSON string.
@param mixed $data The data to be JSON-encoded.
@param boolean $forceObject Force empty arrays to be encoded as objects?
@return string | [
"Encode",
"the",
"given",
"data",
"into",
"a",
"JSON",
"string",
"."
] | 857a6217e7e2cf4ea8270bd99d0cc35cac13dc07 | https://github.com/koolkode/json/blob/857a6217e7e2cf4ea8270bd99d0cc35cac13dc07/src/Json.php#L29-L32 |
200,330 | koolkode/json | src/Json.php | Json.decode | public static function decode($json, $assoc = false, $maxDepth = 512)
{
$result = @json_decode($json, $assoc, $maxDepth);
if($result === NULL)
{
switch($error = json_last_error())
{
case JSON_ERROR_NONE:
return NULL;
case JSON_ERROR_CTRL_CHAR:
throw new JsonUnserializationException('An... | php | public static function decode($json, $assoc = false, $maxDepth = 512)
{
$result = @json_decode($json, $assoc, $maxDepth);
if($result === NULL)
{
switch($error = json_last_error())
{
case JSON_ERROR_NONE:
return NULL;
case JSON_ERROR_CTRL_CHAR:
throw new JsonUnserializationException('An... | [
"public",
"static",
"function",
"decode",
"(",
"$",
"json",
",",
"$",
"assoc",
"=",
"false",
",",
"$",
"maxDepth",
"=",
"512",
")",
"{",
"$",
"result",
"=",
"@",
"json_decode",
"(",
"$",
"json",
",",
"$",
"assoc",
",",
"$",
"maxDepth",
")",
";",
... | Decode the given JSON string into a PHP data structure.
@param string $json The JSON-encoded input data.
@param boolean $assoc Serialize JSON objects into PHP arrays?
@param integer $maxDepth Maximum nesting depth of JSON input.
@return mixed
@throws JsonUnserializationException When any error occurs during unseriali... | [
"Decode",
"the",
"given",
"JSON",
"string",
"into",
"a",
"PHP",
"data",
"structure",
"."
] | 857a6217e7e2cf4ea8270bd99d0cc35cac13dc07 | https://github.com/koolkode/json/blob/857a6217e7e2cf4ea8270bd99d0cc35cac13dc07/src/Json.php#L45-L67 |
200,331 | miBadger/miBadger.Pagination | src/Pagination.php | Pagination.get | public function get($index)
{
return array_slice($this->items, $index * $this->itemsPerPage, $this->itemsPerPage);
} | php | public function get($index)
{
return array_slice($this->items, $index * $this->itemsPerPage, $this->itemsPerPage);
} | [
"public",
"function",
"get",
"(",
"$",
"index",
")",
"{",
"return",
"array_slice",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"index",
"*",
"$",
"this",
"->",
"itemsPerPage",
",",
"$",
"this",
"->",
"itemsPerPage",
")",
";",
"}"
] | Returns the items on the given page number.
@param int $index
@return mixed[] the items on the given page number. | [
"Returns",
"the",
"items",
"on",
"the",
"given",
"page",
"number",
"."
] | 4c9a528a3e3ef9b16f6d1db375b17d5a9fa1c447 | https://github.com/miBadger/miBadger.Pagination/blob/4c9a528a3e3ef9b16f6d1db375b17d5a9fa1c447/src/Pagination.php#L62-L65 |
200,332 | eureka-framework/component-http | src/Http/File.php | File.useName | public function useName($name)
{
if (empty($name)) {
throw new \Exception('Given name is empty!');
}
if (!isset($_FILES[$name])) {
throw new \Exception('Given name not exists in $_FILES var!');
}
$this->data = $_FILES[$name];
return $this;
... | php | public function useName($name)
{
if (empty($name)) {
throw new \Exception('Given name is empty!');
}
if (!isset($_FILES[$name])) {
throw new \Exception('Given name not exists in $_FILES var!');
}
$this->data = $_FILES[$name];
return $this;
... | [
"public",
"function",
"useName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Given name is empty!'",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"_FILES",
"[",
"$"... | Use name as default in File's methods.
@param string $name
@return self
@throws \Exception | [
"Use",
"name",
"as",
"default",
"in",
"File",
"s",
"methods",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/File.php#L44-L57 |
200,333 | eureka-framework/component-http | src/Http/File.php | File.move | public function move($toDir, $fileName = null, $mode = 0775)
{
if ($this->hasError()) {
throw new \Exception('Cannot move file, the file has not been correctly uploaded!');
}
$fileName = (empty($fileName) ? $this->get('name') : $fileName);
if (!file_exists($toDir) && !m... | php | public function move($toDir, $fileName = null, $mode = 0775)
{
if ($this->hasError()) {
throw new \Exception('Cannot move file, the file has not been correctly uploaded!');
}
$fileName = (empty($fileName) ? $this->get('name') : $fileName);
if (!file_exists($toDir) && !m... | [
"public",
"function",
"move",
"(",
"$",
"toDir",
",",
"$",
"fileName",
"=",
"null",
",",
"$",
"mode",
"=",
"0775",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasError",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Cannot move file, the... | Move uploaded file.
@param string $toDir
@param string $fileName
@param int $mode Right mode on directory to create (if not exists)
@return bool
@throws \Exception | [
"Move",
"uploaded",
"file",
"."
] | 698c3b73581a9703a9c932890c57e50f8774607a | https://github.com/eureka-framework/component-http/blob/698c3b73581a9703a9c932890c57e50f8774607a/src/Http/File.php#L78-L91 |
200,334 | black-lamp/blcms-cart | backend/controllers/OrderController.php | OrderController.actionView | public function actionView($id)
{
if (!empty($id)) {
$model = Order::findOne($id);
if (empty($model)) {
$model = new Order();
}
if (Yii::$app->user->can('changeOrderStatus')) {
if ($model->load(Yii::$app->request->post())) {
... | php | public function actionView($id)
{
if (!empty($id)) {
$model = Order::findOne($id);
if (empty($model)) {
$model = new Order();
}
if (Yii::$app->user->can('changeOrderStatus')) {
if ($model->load(Yii::$app->request->post())) {
... | [
"public",
"function",
"actionView",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"$",
"model",
"=",
"Order",
"::",
"findOne",
"(",
"$",
"id",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"model",
")",
")",
"{",... | Displays a single Order model and changes status for this model.
@param integer $id
@return mixed
@throws NotFoundHttpException
@throws ForbiddenHttpException | [
"Displays",
"a",
"single",
"Order",
"model",
"and",
"changes",
"status",
"for",
"this",
"model",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/backend/controllers/OrderController.php#L84-L118 |
200,335 | black-lamp/blcms-cart | backend/controllers/OrderController.php | OrderController.actionDeleteProduct | public function actionDeleteProduct($id)
{
if (($model = OrderProduct::findOne($id)) !== null) {
$model->delete();
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
return $this->redirect(\Yii::$app->request->referrer);
} | php | public function actionDeleteProduct($id)
{
if (($model = OrderProduct::findOne($id)) !== null) {
$model->delete();
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
return $this->redirect(\Yii::$app->request->referrer);
} | [
"public",
"function",
"actionDeleteProduct",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"(",
"$",
"model",
"=",
"OrderProduct",
"::",
"findOne",
"(",
"$",
"id",
")",
")",
"!==",
"null",
")",
"{",
"$",
"model",
"->",
"delete",
"(",
")",
";",
"}",
"else",
... | Deletes product from existing Order model.
If deletion is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
@throws NotFoundHttpException | [
"Deletes",
"product",
"from",
"existing",
"Order",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 314796eecae3ca4ed5fecfdc0231a738af50eba7 | https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/backend/controllers/OrderController.php#L140-L149 |
200,336 | danielgp/common-lib | source/DomDynamicSelectByDanielGP.php | DomDynamicSelectByDanielGP.calculateSelectOptionsSize | private function calculateSelectOptionsSize($aElements, $aFeatures = [])
{
$selectSize = $this->calculateSelectOptionsSizeForced($aElements, $aFeatures);
if ((in_array('include_null', $aFeatures)) && ($selectSize != '1')) {
$selectSize++;
}
return $selectSize;
} | php | private function calculateSelectOptionsSize($aElements, $aFeatures = [])
{
$selectSize = $this->calculateSelectOptionsSizeForced($aElements, $aFeatures);
if ((in_array('include_null', $aFeatures)) && ($selectSize != '1')) {
$selectSize++;
}
return $selectSize;
} | [
"private",
"function",
"calculateSelectOptionsSize",
"(",
"$",
"aElements",
",",
"$",
"aFeatures",
"=",
"[",
"]",
")",
"{",
"$",
"selectSize",
"=",
"$",
"this",
"->",
"calculateSelectOptionsSizeForced",
"(",
"$",
"aElements",
",",
"$",
"aFeatures",
")",
";",
... | Calculate the optimal for all options within a select tag
@param array $aElements
@param array $aFeatures
@return string|int | [
"Calculate",
"the",
"optimal",
"for",
"all",
"options",
"within",
"a",
"select",
"tag"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomDynamicSelectByDanielGP.php#L61-L68 |
200,337 | danielgp/common-lib | source/DomDynamicSelectByDanielGP.php | DomDynamicSelectByDanielGP.setOptionsForSelect | private function setOptionsForSelect($aElements, $sDefaultValue, $featArray = null)
{
if (is_null($featArray)) {
$featArray = [];
}
$sReturn = [];
$crtGroup = null;
foreach ($aElements as $key => $value) {
$aFH = $this->setOptionGroupFooterHeade... | php | private function setOptionsForSelect($aElements, $sDefaultValue, $featArray = null)
{
if (is_null($featArray)) {
$featArray = [];
}
$sReturn = [];
$crtGroup = null;
foreach ($aElements as $key => $value) {
$aFH = $this->setOptionGroupFooterHeade... | [
"private",
"function",
"setOptionsForSelect",
"(",
"$",
"aElements",
",",
"$",
"sDefaultValue",
",",
"$",
"featArray",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"featArray",
")",
")",
"{",
"$",
"featArray",
"=",
"[",
"]",
";",
"}",
"$",
... | Creates all the child tags required to populate a SELECT tag
@param array $aElements
@param string|array $sDefaultValue
@param array $featArray
@return string | [
"Creates",
"all",
"the",
"child",
"tags",
"required",
"to",
"populate",
"a",
"SELECT",
"tag"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomDynamicSelectByDanielGP.php#L199-L216 |
200,338 | Programie/JsonConfig | src/main/php/com/selfcoders/jsonconfig/ValueByPath.php | ValueByPath.getValueByPath | public static function getValueByPath($dataTree, $path)
{
$pathParts = explode(".", $path);
foreach ($pathParts as $name)
{
if (!isset($dataTree->{$name}))
{
return null;
}
$dataTree = $dataTree->{$name};
}
return $dataTree;
} | php | public static function getValueByPath($dataTree, $path)
{
$pathParts = explode(".", $path);
foreach ($pathParts as $name)
{
if (!isset($dataTree->{$name}))
{
return null;
}
$dataTree = $dataTree->{$name};
}
return $dataTree;
} | [
"public",
"static",
"function",
"getValueByPath",
"(",
"$",
"dataTree",
",",
"$",
"path",
")",
"{",
"$",
"pathParts",
"=",
"explode",
"(",
"\".\"",
",",
"$",
"path",
")",
";",
"foreach",
"(",
"$",
"pathParts",
"as",
"$",
"name",
")",
"{",
"if",
"(",
... | Get the value of the property in the data tree specified by the dotted path.
@param \StdClass $dataTree A tree of StdClass objects
@param string $path The dotted path to the property which should be returned
@return null|mixed The value of the property or null if not found | [
"Get",
"the",
"value",
"of",
"the",
"property",
"in",
"the",
"data",
"tree",
"specified",
"by",
"the",
"dotted",
"path",
"."
] | 51314ec4f00fb14c6eb17b36f322b723681a7d36 | https://github.com/Programie/JsonConfig/blob/51314ec4f00fb14c6eb17b36f322b723681a7d36/src/main/php/com/selfcoders/jsonconfig/ValueByPath.php#L13-L28 |
200,339 | Programie/JsonConfig | src/main/php/com/selfcoders/jsonconfig/ValueByPath.php | ValueByPath.setValueByPath | public static function setValueByPath($dataTree, $path, $value, $add)
{
$pathParts = explode(".", $path);
$name = $pathParts[0];
if (!$add and !isset($dataTree->{$name}))
{
return false;
}
if (count($pathParts) == 1)
{
$dataTree->{$name} = $value;
return true;
}
if (isset($dataTree->{$n... | php | public static function setValueByPath($dataTree, $path, $value, $add)
{
$pathParts = explode(".", $path);
$name = $pathParts[0];
if (!$add and !isset($dataTree->{$name}))
{
return false;
}
if (count($pathParts) == 1)
{
$dataTree->{$name} = $value;
return true;
}
if (isset($dataTree->{$n... | [
"public",
"static",
"function",
"setValueByPath",
"(",
"$",
"dataTree",
",",
"$",
"path",
",",
"$",
"value",
",",
"$",
"add",
")",
"{",
"$",
"pathParts",
"=",
"explode",
"(",
"\".\"",
",",
"$",
"path",
")",
";",
"$",
"name",
"=",
"$",
"pathParts",
... | Set the value of the property specified by the given path in the data tree.
@param \StdClass $dataTree A tree of StdClass objects
@param string $path The path to the property which should be set
@param mixed $value The value for the property
@param bool $add Whether to add a new property if not existing or only set if... | [
"Set",
"the",
"value",
"of",
"the",
"property",
"specified",
"by",
"the",
"given",
"path",
"in",
"the",
"data",
"tree",
"."
] | 51314ec4f00fb14c6eb17b36f322b723681a7d36 | https://github.com/Programie/JsonConfig/blob/51314ec4f00fb14c6eb17b36f322b723681a7d36/src/main/php/com/selfcoders/jsonconfig/ValueByPath.php#L40-L70 |
200,340 | Programie/JsonConfig | src/main/php/com/selfcoders/jsonconfig/ValueByPath.php | ValueByPath.removeValueByPath | public static function removeValueByPath($dataTree, $path)
{
$pathParts = explode(".", $path);
$name = $pathParts[0];
if (!isset($dataTree->{$name}))
{
return false;
}
if (count($pathParts) == 1)
{
unset($dataTree->{$name});
return true;
}
return ValueByPath::removeValueByPath($dataTree-... | php | public static function removeValueByPath($dataTree, $path)
{
$pathParts = explode(".", $path);
$name = $pathParts[0];
if (!isset($dataTree->{$name}))
{
return false;
}
if (count($pathParts) == 1)
{
unset($dataTree->{$name});
return true;
}
return ValueByPath::removeValueByPath($dataTree-... | [
"public",
"static",
"function",
"removeValueByPath",
"(",
"$",
"dataTree",
",",
"$",
"path",
")",
"{",
"$",
"pathParts",
"=",
"explode",
"(",
"\".\"",
",",
"$",
"path",
")",
";",
"$",
"name",
"=",
"$",
"pathParts",
"[",
"0",
"]",
";",
"if",
"(",
"!... | Remove the value of the property specified by the given path in the data tree.
@param \StdClass $dataTree A tree of StdClass objects
@param string $path The path to the property which should be removed
@return bool true if the property has been removed successfully, false if not (e.g. property not existing in tree) | [
"Remove",
"the",
"value",
"of",
"the",
"property",
"specified",
"by",
"the",
"given",
"path",
"in",
"the",
"data",
"tree",
"."
] | 51314ec4f00fb14c6eb17b36f322b723681a7d36 | https://github.com/Programie/JsonConfig/blob/51314ec4f00fb14c6eb17b36f322b723681a7d36/src/main/php/com/selfcoders/jsonconfig/ValueByPath.php#L80-L98 |
200,341 | FuzeWorks/Core | src/FuzeWorks/Libraries.php | Libraries.getDriver | public function getDriver($libraryName, array $parameters = null, array $directory = null, $newInstance = false)
{
if (empty($libraryName))
{
throw new LibraryException("Could not load driver. No name provided", 1);
}
// Load the driver class if it is not yet loaded
if ( ! class_exists('FuzeWorks\FW_Driv... | php | public function getDriver($libraryName, array $parameters = null, array $directory = null, $newInstance = false)
{
if (empty($libraryName))
{
throw new LibraryException("Could not load driver. No name provided", 1);
}
// Load the driver class if it is not yet loaded
if ( ! class_exists('FuzeWorks\FW_Driv... | [
"public",
"function",
"getDriver",
"(",
"$",
"libraryName",
",",
"array",
"$",
"parameters",
"=",
"null",
",",
"array",
"$",
"directory",
"=",
"null",
",",
"$",
"newInstance",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"libraryName",
")",
")... | Driver Library Loader
Loads, instantiates and returns driver libraries.
@param string $library Driver Library name
@param array $params Optional parameters to pass to the library class constructor
@param array $directory Optional list of directories where the library can be found. Overrides default list
@param ... | [
"Driver",
"Library",
"Loader"
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Libraries.php#L132-L147 |
200,342 | FuzeWorks/Core | src/FuzeWorks/Libraries.php | Libraries.loadLibrary | protected function loadLibrary($libraryName, $parameters = null, array $directory = null, $newInstance = false)
{
// First get the directories where the library can be located
$directories = (is_null($directory) ? $this->libraryPaths : $directory);
// Now figure out the className and subdir
$class = trim($li... | php | protected function loadLibrary($libraryName, $parameters = null, array $directory = null, $newInstance = false)
{
// First get the directories where the library can be located
$directories = (is_null($directory) ? $this->libraryPaths : $directory);
// Now figure out the className and subdir
$class = trim($li... | [
"protected",
"function",
"loadLibrary",
"(",
"$",
"libraryName",
",",
"$",
"parameters",
"=",
"null",
",",
"array",
"$",
"directory",
"=",
"null",
",",
"$",
"newInstance",
"=",
"false",
")",
"{",
"// First get the directories where the library can be located",
"$",
... | Internal Library Loader
Determines what type of library needs to be loaded
@param string $library Library name
@param array $params Optional parameters to pass to the library class constructor
@param array $directory Optional list of directories where the library can be found. Overrides default list
@param boo... | [
"Internal",
"Library",
"Loader"
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Libraries.php#L161-L192 |
200,343 | FuzeWorks/Core | src/FuzeWorks/Libraries.php | Libraries.loadAppLibrary | protected function loadAppLibrary($class, $subdir, array $parameters = null, array $directories, $newInstance = false)
{
// First check if the input is correct
if (!is_array($directories))
{
throw new LibraryException("Could not load library. \$directory variable was not an array", 1);
}
// Search for ... | php | protected function loadAppLibrary($class, $subdir, array $parameters = null, array $directories, $newInstance = false)
{
// First check if the input is correct
if (!is_array($directories))
{
throw new LibraryException("Could not load library. \$directory variable was not an array", 1);
}
// Search for ... | [
"protected",
"function",
"loadAppLibrary",
"(",
"$",
"class",
",",
"$",
"subdir",
",",
"array",
"$",
"parameters",
"=",
"null",
",",
"array",
"$",
"directories",
",",
"$",
"newInstance",
"=",
"false",
")",
"{",
"// First check if the input is correct",
"if",
"... | Application Library Loader
Loads, instantiates and returns an application library.
Could possibly extend a core library if requested.
@param string $class Classname
@param string $subdir Sub directory in which the final class can be found
@param array $params Optional parameters to pass to the library class ... | [
"Application",
"Library",
"Loader"
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Libraries.php#L320-L376 |
200,344 | FuzeWorks/Core | src/FuzeWorks/Libraries.php | Libraries.removeLibraryPath | public function removeLibraryPath($directory)
{
if (($key = array_search($directory, $this->libraryPaths)) !== false)
{
unset($this->libraryPaths[$key]);
}
} | php | public function removeLibraryPath($directory)
{
if (($key = array_search($directory, $this->libraryPaths)) !== false)
{
unset($this->libraryPaths[$key]);
}
} | [
"public",
"function",
"removeLibraryPath",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"(",
"$",
"key",
"=",
"array_search",
"(",
"$",
"directory",
",",
"$",
"this",
"->",
"libraryPaths",
")",
")",
"!==",
"false",
")",
"{",
"unset",
"(",
"$",
"this",
... | Remove a path where libraries can be found
@param string $directory The directory
@return void | [
"Remove",
"a",
"path",
"where",
"libraries",
"can",
"be",
"found"
] | 051c64fdaa3a648174cbd54557d05ad553dd826b | https://github.com/FuzeWorks/Core/blob/051c64fdaa3a648174cbd54557d05ad553dd826b/src/FuzeWorks/Libraries.php#L445-L451 |
200,345 | freialib/fenrir.system | src/Trait/MysqlRepo.php | MysqlRepoTrait.find | function find(array $logic = null) {
$logic != null or $logic = [];
$opt = [];
foreach (['%fields', '%order_by', '%limit', '%offset'] as $key) {
if (isset($logic[$key])) {
$opt[$key] = $logic[$key];
unset($logic[$key]);
}
else { // %filter not set
$opt[$key] = [];
}
}
$entries = $th... | php | function find(array $logic = null) {
$logic != null or $logic = [];
$opt = [];
foreach (['%fields', '%order_by', '%limit', '%offset'] as $key) {
if (isset($logic[$key])) {
$opt[$key] = $logic[$key];
unset($logic[$key]);
}
else { // %filter not set
$opt[$key] = [];
}
}
$entries = $th... | [
"function",
"find",
"(",
"array",
"$",
"logic",
"=",
"null",
")",
"{",
"$",
"logic",
"!=",
"null",
"or",
"$",
"logic",
"=",
"[",
"]",
";",
"$",
"opt",
"=",
"[",
"]",
";",
"foreach",
"(",
"[",
"'%fields'",
",",
"'%order_by'",
",",
"'%limit'",
",",... | You can specify fields via %fields
You can specify limit via %limit and offset via %offset
You can specify order rules via %order_by
Everything else is interpreted as constraints on the entries.
@return array [ models ] | [
"You",
"can",
"specify",
"fields",
"via",
"%fields",
"You",
"can",
"specify",
"limit",
"via",
"%limit",
"and",
"offset",
"via",
"%offset",
"You",
"can",
"specify",
"order",
"rules",
"via",
"%order_by"
] | 388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8 | https://github.com/freialib/fenrir.system/blob/388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8/src/Trait/MysqlRepo.php#L81-L106 |
200,346 | freialib/fenrir.system | src/Trait/MysqlRepo.php | MysqlRepoTrait.sqlinsert | protected function sqlinsert(array $fields, array $nums = null, array $bools = null) {
$db = $this->db;
$nums != null or $nums = [];
$bools != null or $bools = [];
$keys = array_keys($fields);
$strs = array_diff($keys, $bools, $nums);
$key_fields = \hlin\Arr::join(', ', $keys, function ($_, $val) {
re... | php | protected function sqlinsert(array $fields, array $nums = null, array $bools = null) {
$db = $this->db;
$nums != null or $nums = [];
$bools != null or $bools = [];
$keys = array_keys($fields);
$strs = array_diff($keys, $bools, $nums);
$key_fields = \hlin\Arr::join(', ', $keys, function ($_, $val) {
re... | [
"protected",
"function",
"sqlinsert",
"(",
"array",
"$",
"fields",
",",
"array",
"$",
"nums",
"=",
"null",
",",
"array",
"$",
"bools",
"=",
"null",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"db",
";",
"$",
"nums",
"!=",
"null",
"or",
"$",
"num... | Inserts fields, if bools or nums are specified the fields mentioned are
treated as strings.
@return int new entry id | [
"Inserts",
"fields",
"if",
"bools",
"or",
"nums",
"are",
"specified",
"the",
"fields",
"mentioned",
"are",
"treated",
"as",
"strings",
"."
] | 388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8 | https://github.com/freialib/fenrir.system/blob/388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8/src/Trait/MysqlRepo.php#L200-L231 |
200,347 | freialib/fenrir.system | src/Trait/MysqlRepo.php | MysqlRepoTrait.sqlupdate | protected function sqlupdate(array $fields, array $nums = null, array $bools = null) {
$db = $this->db;
$idfield = $this->idfield();
$nums != null or $nums = [];
$bools != null or $bools = [];
$keys = array_diff(array_keys($fields), [ $idfield ]);
$strs = array_diff(array_keys($fields), $bools, $nums);
... | php | protected function sqlupdate(array $fields, array $nums = null, array $bools = null) {
$db = $this->db;
$idfield = $this->idfield();
$nums != null or $nums = [];
$bools != null or $bools = [];
$keys = array_diff(array_keys($fields), [ $idfield ]);
$strs = array_diff(array_keys($fields), $bools, $nums);
... | [
"protected",
"function",
"sqlupdate",
"(",
"array",
"$",
"fields",
",",
"array",
"$",
"nums",
"=",
"null",
",",
"array",
"$",
"bools",
"=",
"null",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"db",
";",
"$",
"idfield",
"=",
"$",
"this",
"->",
"i... | Update fields, if bools or nums are specified the fields mentioned are
treated as strings
@return int updated entry id | [
"Update",
"fields",
"if",
"bools",
"or",
"nums",
"are",
"specified",
"the",
"fields",
"mentioned",
"are",
"treated",
"as",
"strings"
] | 388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8 | https://github.com/freialib/fenrir.system/blob/388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8/src/Trait/MysqlRepo.php#L239-L268 |
200,348 | freialib/fenrir.system | src/Trait/MysqlRepo.php | MysqlRepoTrait.sqlentry | protected function sqlentry($entry_id) {
$res = $this->sqlfind([ $this->idfield() => $entry_id ], null, null, 1);
if (empty($res)) {
return null;
}
else { // found entry
return $res[0];
}
} | php | protected function sqlentry($entry_id) {
$res = $this->sqlfind([ $this->idfield() => $entry_id ], null, null, 1);
if (empty($res)) {
return null;
}
else { // found entry
return $res[0];
}
} | [
"protected",
"function",
"sqlentry",
"(",
"$",
"entry_id",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"sqlfind",
"(",
"[",
"$",
"this",
"->",
"idfield",
"(",
")",
"=>",
"$",
"entry_id",
"]",
",",
"null",
",",
"null",
",",
"1",
")",
";",
"if",
... | Mostly an alias to sqlsearch on id with limit of 1.
@return array|null | [
"Mostly",
"an",
"alias",
"to",
"sqlsearch",
"on",
"id",
"with",
"limit",
"of",
"1",
"."
] | 388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8 | https://github.com/freialib/fenrir.system/blob/388d360dbc3bc6dcf85b09bb06e08a2dce8f3ec8/src/Trait/MysqlRepo.php#L337-L345 |
200,349 | jyokum/healthgraph | src/HealthGraph/HealthGraphClient.php | HealthGraphClient.factory | public static function factory($config = array())
{
$default = array(
'base_url' => 'https://api.runkeeper.com',
'logger' => FALSE,
);
$required = array('base_url');
$config = Collection::fromConfig($config, $default, $required);
$client = new self($... | php | public static function factory($config = array())
{
$default = array(
'base_url' => 'https://api.runkeeper.com',
'logger' => FALSE,
);
$required = array('base_url');
$config = Collection::fromConfig($config, $default, $required);
$client = new self($... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'base_url'",
"=>",
"'https://api.runkeeper.com'",
",",
"'logger'",
"=>",
"FALSE",
",",
")",
";",
"$",
"required",
"=",
"a... | Factory method to create a new HealthGraphClient
@param array|Collection $config Configuration data. Array keys:
base_url - Base URL of web service
@return HealthGraphClient
@TODO update factory method and docblock for parameters | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"HealthGraphClient"
] | 6b3b4c4eb797f1fcf056024c8b15a16665bf8758 | https://github.com/jyokum/healthgraph/blob/6b3b4c4eb797f1fcf056024c8b15a16665bf8758/src/HealthGraph/HealthGraphClient.php#L23-L55 |
200,350 | faustbrian/HTTP | src/HttpRequest.php | HttpRequest.headers | public function headers(): array
{
return collect($this->request->getHeaders())->mapWithKeys(function ($values, $header) {
return [$header => $values[0]];
})->all();
} | php | public function headers(): array
{
return collect($this->request->getHeaders())->mapWithKeys(function ($values, $header) {
return [$header => $values[0]];
})->all();
} | [
"public",
"function",
"headers",
"(",
")",
":",
"array",
"{",
"return",
"collect",
"(",
"$",
"this",
"->",
"request",
"->",
"getHeaders",
"(",
")",
")",
"->",
"mapWithKeys",
"(",
"function",
"(",
"$",
"values",
",",
"$",
"header",
")",
"{",
"return",
... | Gets all header values.
@return array | [
"Gets",
"all",
"header",
"values",
"."
] | ab24b37ea211eb106237a813ec8d47ec1d4fe199 | https://github.com/faustbrian/HTTP/blob/ab24b37ea211eb106237a813ec8d47ec1d4fe199/src/HttpRequest.php#L65-L70 |
200,351 | stubbles/stubbles-peer | src/main/php/QueryString.php | QueryString.build | public function build(): string
{
if (count($this->parameters) === 0) {
return '';
}
$queryString = '';
foreach ($this->parameters as $name => $value) {
$queryString .= $this->buildQuery($name, $value);
}
return substr($queryString, 1);
} | php | public function build(): string
{
if (count($this->parameters) === 0) {
return '';
}
$queryString = '';
foreach ($this->parameters as $name => $value) {
$queryString .= $this->buildQuery($name, $value);
}
return substr($queryString, 1);
} | [
"public",
"function",
"build",
"(",
")",
":",
"string",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"parameters",
")",
"===",
"0",
")",
"{",
"return",
"''",
";",
"}",
"$",
"queryString",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"pa... | build the query from parameters
@return string | [
"build",
"the",
"query",
"from",
"parameters"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/QueryString.php#L85-L97 |
200,352 | stubbles/stubbles-peer | src/main/php/QueryString.php | QueryString.buildQuery | protected function buildQuery(string $name, $value, string $postfix= ''): string
{
$query = '';
if (is_array($value)) {
foreach ($value as $k => $v) {
if (is_int($k)) {
$query .= $this->buildQuery('', $v, $postfix . $name .'[]');
} else... | php | protected function buildQuery(string $name, $value, string $postfix= ''): string
{
$query = '';
if (is_array($value)) {
foreach ($value as $k => $v) {
if (is_int($k)) {
$query .= $this->buildQuery('', $v, $postfix . $name .'[]');
} else... | [
"protected",
"function",
"buildQuery",
"(",
"string",
"$",
"name",
",",
"$",
"value",
",",
"string",
"$",
"postfix",
"=",
"''",
")",
":",
"string",
"{",
"$",
"query",
"=",
"''",
";",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"foreach... | Calculates query string
@param string $name
@param mixed $value
@param string $postfix The postfix to use for each variable (defaults to '')
@return string | [
"Calculates",
"query",
"string"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/QueryString.php#L107-L129 |
200,353 | stubbles/stubbles-peer | src/main/php/QueryString.php | QueryString.addParam | public function addParam(string $name, $value): self
{
if (!is_array($value) && !is_scalar($value) && null !== $value) {
if (is_object($value) && method_exists($value, '__toString')) {
$value = (string) $value;
} else {
throw new \InvalidArgumentExcept... | php | public function addParam(string $name, $value): self
{
if (!is_array($value) && !is_scalar($value) && null !== $value) {
if (is_object($value) && method_exists($value, '__toString')) {
$value = (string) $value;
} else {
throw new \InvalidArgumentExcept... | [
"public",
"function",
"addParam",
"(",
"string",
"$",
"name",
",",
"$",
"value",
")",
":",
"self",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
"&&",
"!",
"is_scalar",
"(",
"$",
"value",
")",
"&&",
"null",
"!==",
"$",
"value",
")",
"{... | add a parameter
@param string $name name of parameter
@param mixed $value value of parameter
@return \stubbles\peer\QueryString
@throws \InvalidArgumentException | [
"add",
"a",
"parameter"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/QueryString.php#L149-L165 |
200,354 | stubbles/stubbles-peer | src/main/php/QueryString.php | QueryString.removeParam | public function removeParam(string $name): self
{
if (array_key_exists($name, $this->parameters)) {
unset($this->parameters[$name]);
}
return $this;
} | php | public function removeParam(string $name): self
{
if (array_key_exists($name, $this->parameters)) {
unset($this->parameters[$name]);
}
return $this;
} | [
"public",
"function",
"removeParam",
"(",
"string",
"$",
"name",
")",
":",
"self",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"parameters",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"na... | remove a param
@param string $name name of parameter
@return \stubbles\peer\QueryString | [
"remove",
"a",
"param"
] | dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc | https://github.com/stubbles/stubbles-peer/blob/dc8b0a517dc4c84b615cc3c88f0d64a2b742f9cc/src/main/php/QueryString.php#L173-L180 |
200,355 | shgysk8zer0/core_api | traits/magic/is_set.php | Is_Set.__isset | final public function __isset($prop)
{
$this->magicPropConvert($prop);
return is_array($this->{$this::MAGIC_PROPERTY})
? array_key_exists($prop, $this->{$this::MAGIC_PROPERTY})
: isset($this->{$this::MAGIC_PROPERTY}->$prop);
} | php | final public function __isset($prop)
{
$this->magicPropConvert($prop);
return is_array($this->{$this::MAGIC_PROPERTY})
? array_key_exists($prop, $this->{$this::MAGIC_PROPERTY})
: isset($this->{$this::MAGIC_PROPERTY}->$prop);
} | [
"final",
"public",
"function",
"__isset",
"(",
"$",
"prop",
")",
"{",
"$",
"this",
"->",
"magicPropConvert",
"(",
"$",
"prop",
")",
";",
"return",
"is_array",
"(",
"$",
"this",
"->",
"{",
"$",
"this",
"::",
"MAGIC_PROPERTY",
"}",
")",
"?",
"array_key_e... | Magic isset metod.
@param string $prop The property to work with
@return bool Whether or not it is set.
@example isset($magic_class->$prop) ? 'True' : 'False'; | [
"Magic",
"isset",
"metod",
"."
] | 9e9b8baf761af874b95256ad2462e55fbb2b2e58 | https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/magic/is_set.php#L32-L38 |
200,356 | stubbles/stubbles-streams | src/main/php/InputStreamIterator.php | InputStreamIterator.next | public function next()
{
$this->valid = !$this->inputStream->eof();
$this->currentLine = $this->inputStream->readLine();
$this->lineNumber++;
} | php | public function next()
{
$this->valid = !$this->inputStream->eof();
$this->currentLine = $this->inputStream->readLine();
$this->lineNumber++;
} | [
"public",
"function",
"next",
"(",
")",
"{",
"$",
"this",
"->",
"valid",
"=",
"!",
"$",
"this",
"->",
"inputStream",
"->",
"eof",
"(",
")",
";",
"$",
"this",
"->",
"currentLine",
"=",
"$",
"this",
"->",
"inputStream",
"->",
"readLine",
"(",
")",
";... | moves forward to next line | [
"moves",
"forward",
"to",
"next",
"line"
] | 99b0dace5fcf71584d1456b4b5408017b896bdf5 | https://github.com/stubbles/stubbles-streams/blob/99b0dace5fcf71584d1456b4b5408017b896bdf5/src/main/php/InputStreamIterator.php#L78-L83 |
200,357 | stubbles/stubbles-streams | src/main/php/InputStreamIterator.php | InputStreamIterator.rewind | public function rewind()
{
if (!($this->inputStream instanceof Seekable)) {
return;
}
$this->inputStream->seek(0, Seekable::SET);
$this->lineNumber = 0;
$this->currentLine = null;
$this->next();
} | php | public function rewind()
{
if (!($this->inputStream instanceof Seekable)) {
return;
}
$this->inputStream->seek(0, Seekable::SET);
$this->lineNumber = 0;
$this->currentLine = null;
$this->next();
} | [
"public",
"function",
"rewind",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"inputStream",
"instanceof",
"Seekable",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"inputStream",
"->",
"seek",
"(",
"0",
",",
"Seekable",
"::",
"SET",... | rewinds to first line | [
"rewinds",
"to",
"first",
"line"
] | 99b0dace5fcf71584d1456b4b5408017b896bdf5 | https://github.com/stubbles/stubbles-streams/blob/99b0dace5fcf71584d1456b4b5408017b896bdf5/src/main/php/InputStreamIterator.php#L88-L98 |
200,358 | shampeak/GraceServer | src/Log/Log.php | Log.addDebug | public function addDebug($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::DEBUG, $message, $context);
} | php | public function addDebug($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::DEBUG, $message, $context);
} | [
"public",
"function",
"addDebug",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"DEBUG",
",",
"$",
"message"... | Adds a log record at the DEBUG level.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"DEBUG",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L115-L118 |
200,359 | shampeak/GraceServer | src/Log/Log.php | Log.addInfo | public function addInfo($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::INFO, $message, $context);
} | php | public function addInfo($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::INFO, $message, $context);
} | [
"public",
"function",
"addInfo",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"INFO",
",",
"$",
"message",
... | Adds a log record at the INFO level.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"INFO",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L128-L131 |
200,360 | shampeak/GraceServer | src/Log/Log.php | Log.addNotice | public function addNotice($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::NOTICE, $message, $context);
} | php | public function addNotice($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::NOTICE, $message, $context);
} | [
"public",
"function",
"addNotice",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"NOTICE",
",",
"$",
"messag... | Adds a log record at the NOTICE level.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"NOTICE",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L141-L144 |
200,361 | shampeak/GraceServer | src/Log/Log.php | Log.addCritical | public function addCritical($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::CRITICAL, $message, $context);
} | php | public function addCritical($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::CRITICAL, $message, $context);
} | [
"public",
"function",
"addCritical",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"CRITICAL",
",",
"$",
"me... | Adds a log record at the CRITICAL level.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"CRITICAL",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L180-L183 |
200,362 | shampeak/GraceServer | src/Log/Log.php | Log.addAlert | public function addAlert($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::ALERT, $message, $context);
} | php | public function addAlert($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::ALERT, $message, $context);
} | [
"public",
"function",
"addAlert",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"ALERT",
",",
"$",
"message"... | Adds a log record at the ALERT level.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"ALERT",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L193-L196 |
200,363 | shampeak/GraceServer | src/Log/Log.php | Log.warn | public function warn($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::WARNING, $message, $context);
} | php | public function warn($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::WARNING, $message, $context);
} | [
"public",
"function",
"warn",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"WARNING",
",",
"$",
"message",
... | Adds a log record at the WARNING level.
This method allows for compatibility with common interfaces.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"WARNING",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L295-L298 |
200,364 | shampeak/GraceServer | src/Log/Log.php | Log.err | public function err($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::ERROR, $message, $context);
} | php | public function err($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::ERROR, $message, $context);
} | [
"public",
"function",
"err",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"ERROR",
",",
"$",
"message",
"... | Adds a log record at the ERROR level.
This method allows for compatibility with common interfaces.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"ERROR",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L325-L328 |
200,365 | shampeak/GraceServer | src/Log/Log.php | Log.emergency | public function emergency($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::EMERGENCY, $message, $context);
} | php | public function emergency($message, array $context = array())
{
return $this->_instance->addRecord(\Monolog\Logger::EMERGENCY, $message, $context);
} | [
"public",
"function",
"emergency",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_instance",
"->",
"addRecord",
"(",
"\\",
"Monolog",
"\\",
"Logger",
"::",
"EMERGENCY",
",",
"$",
"mes... | Adds a log record at the EMERGENCY level.
This method allows for compatibility with common interfaces.
@param string $message The log message
@param array $context The log context
@return Boolean Whether the record has been processed | [
"Adds",
"a",
"log",
"record",
"at",
"the",
"EMERGENCY",
"level",
"."
] | e69891de3daae7d228c803c06213eb248fc88594 | https://github.com/shampeak/GraceServer/blob/e69891de3daae7d228c803c06213eb248fc88594/src/Log/Log.php#L415-L418 |
200,366 | Panigale/laravel5-Points | src/Traits/AddPoint.php | AddPoint.addPointToUser | protected function addPointToUser($number, $beforePoint, $afterPoint)
{
if($this->pointNotIsset())
$point = $this->createPointToUser();
else
$point = Point::where('user_id' ,$this->id)
->where('rule_id' ,$this->ruleId)
->first(... | php | protected function addPointToUser($number, $beforePoint, $afterPoint)
{
if($this->pointNotIsset())
$point = $this->createPointToUser();
else
$point = Point::where('user_id' ,$this->id)
->where('rule_id' ,$this->ruleId)
->first(... | [
"protected",
"function",
"addPointToUser",
"(",
"$",
"number",
",",
"$",
"beforePoint",
",",
"$",
"afterPoint",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pointNotIsset",
"(",
")",
")",
"$",
"point",
"=",
"$",
"this",
"->",
"createPointToUser",
"(",
")",
... | update user point
@param int $ruleId
@param $number
@param $beforePoint
@param $afterPoint
@return mixed | [
"update",
"user",
"point"
] | 6fb559d91694a336f5a11d8408348a85395b4ff3 | https://github.com/Panigale/laravel5-Points/blob/6fb559d91694a336f5a11d8408348a85395b4ff3/src/Traits/AddPoint.php#L49-L62 |
200,367 | Panigale/laravel5-Points | src/Traits/AddPoint.php | AddPoint.createPointToUser | private function createPointToUser($number = null)
{
return Point::create([
'user_id' => $this->id,
'rule_id' => $this->ruleId,
'number' => $number
]);
} | php | private function createPointToUser($number = null)
{
return Point::create([
'user_id' => $this->id,
'rule_id' => $this->ruleId,
'number' => $number
]);
} | [
"private",
"function",
"createPointToUser",
"(",
"$",
"number",
"=",
"null",
")",
"{",
"return",
"Point",
"::",
"create",
"(",
"[",
"'user_id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'rule_id'",
"=>",
"$",
"this",
"->",
"ruleId",
",",
"'number'",
"=>",
... | create point to user
@param null $number | [
"create",
"point",
"to",
"user"
] | 6fb559d91694a336f5a11d8408348a85395b4ff3 | https://github.com/Panigale/laravel5-Points/blob/6fb559d91694a336f5a11d8408348a85395b4ff3/src/Traits/AddPoint.php#L69-L76 |
200,368 | N0rthernL1ghts/Command | src/Exec.php | Exec.command | public static function command(string $command, bool $passThrough = false): CommandResultInterface
{
return new CommandResult(
new static(
$command,
$passThrough
)
);
} | php | public static function command(string $command, bool $passThrough = false): CommandResultInterface
{
return new CommandResult(
new static(
$command,
$passThrough
)
);
} | [
"public",
"static",
"function",
"command",
"(",
"string",
"$",
"command",
",",
"bool",
"$",
"passThrough",
"=",
"false",
")",
":",
"CommandResultInterface",
"{",
"return",
"new",
"CommandResult",
"(",
"new",
"static",
"(",
"$",
"command",
",",
"$",
"passThro... | Creates new instance of self, and passes it to new instance of CommandResult
@param string $command
@param bool $passThrough
@return CommandResultInterface | [
"Creates",
"new",
"instance",
"of",
"self",
"and",
"passes",
"it",
"to",
"new",
"instance",
"of",
"CommandResult"
] | 52877330a1b150f2e410d1ef6eff8f404da01481 | https://github.com/N0rthernL1ghts/Command/blob/52877330a1b150f2e410d1ef6eff8f404da01481/src/Exec.php#L50-L58 |
200,369 | romm/configuration_object | Classes/TypeConverter/ArrayConverter.php | ArrayConverter.convertFrom | public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
{
$result = [];
$array = ('array' === $targetType)
? $source
: $convertedChildProperties;
foreach ($array as $name => ... | php | public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
{
$result = [];
$array = ('array' === $targetType)
? $source
: $convertedChildProperties;
foreach ($array as $name => ... | [
"public",
"function",
"convertFrom",
"(",
"$",
"source",
",",
"$",
"targetType",
",",
"array",
"$",
"convertedChildProperties",
"=",
"[",
"]",
",",
"PropertyMappingConfigurationInterface",
"$",
"configuration",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"... | Converts into an array, leaving child properties types.
@inheritdoc | [
"Converts",
"into",
"an",
"array",
"leaving",
"child",
"properties",
"types",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/TypeConverter/ArrayConverter.php#L49-L68 |
200,370 | devlabmtl/haven-cms | Controller/LayoutController.php | LayoutController.showAction | public function showAction($id, $extra) {
$entity = $this->container->get("layout.read_handler")->get($id);
$delete_form = $this->container->get("layout.form_handler")->createDeleteForm($id);
// $route_collection = $this->container->get('router')->getRouteCollection()->all();
// echo '<p... | php | public function showAction($id, $extra) {
$entity = $this->container->get("layout.read_handler")->get($id);
$delete_form = $this->container->get("layout.form_handler")->createDeleteForm($id);
// $route_collection = $this->container->get('router')->getRouteCollection()->all();
// echo '<p... | [
"public",
"function",
"showAction",
"(",
"$",
"id",
",",
"$",
"extra",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"\"layout.read_handler\"",
")",
"->",
"get",
"(",
"$",
"id",
")",
";",
"$",
"delete_form",
"=",
"$"... | Finds and displays a layout entity.
@Route("/admin/{show}/layout/{id}/{extra}", requirements={"id" = "\d+", "extra" = ".+"}, defaults={"extra" = ""})
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"layout",
"entity",
"."
] | c20761a07c201a966dbda1f3eae33617f80e1ece | https://github.com/devlabmtl/haven-cms/blob/c20761a07c201a966dbda1f3eae33617f80e1ece/Controller/LayoutController.php#L67-L88 |
200,371 | martinlindhe/php-debughelper | src/HexPrinter.php | HexPrinter.render | public static function render($m, $rowLength = 16, $fillChar = ' ', $showOffset = true)
{
$res = '';
$rowOffset = 0;
$bytes = '';
$hex = '';
$j = 0;
for ($i = 0; $i < strlen($m); $i++) {
$x = substr($m, $i, 1);
$bytes .= self::decodeReadable... | php | public static function render($m, $rowLength = 16, $fillChar = ' ', $showOffset = true)
{
$res = '';
$rowOffset = 0;
$bytes = '';
$hex = '';
$j = 0;
for ($i = 0; $i < strlen($m); $i++) {
$x = substr($m, $i, 1);
$bytes .= self::decodeReadable... | [
"public",
"static",
"function",
"render",
"(",
"$",
"m",
",",
"$",
"rowLength",
"=",
"16",
",",
"$",
"fillChar",
"=",
"' '",
",",
"$",
"showOffset",
"=",
"true",
")",
"{",
"$",
"res",
"=",
"''",
";",
"$",
"rowOffset",
"=",
"0",
";",
"$",
"bytes",... | Prints hex dump of a binary string, similar to xxd
@param string $m
@param int $rowLength
@param string $fillChar
@param bool $showOffset
@return string of hex + ascii values | [
"Prints",
"hex",
"dump",
"of",
"a",
"binary",
"string",
"similar",
"to",
"xxd"
] | 8fde5bbfd77d71f3f0990829f235242232094734 | https://github.com/martinlindhe/php-debughelper/blob/8fde5bbfd77d71f3f0990829f235242232094734/src/HexPrinter.php#L13-L49 |
200,372 | danielgp/common-lib | source/DomHeaderFooterByDanielGP.php | DomHeaderFooterByDanielGP.setFooterCommon | protected function setFooterCommon($footerInjected = null)
{
$sHK = $this->tCmnSuperGlobals->get('specialHook');
if (!is_null($sHK) && (in_array('noHeader', $sHK))) {
return '';
}
return $this->setFooterCommonInjected($footerInjected) . '</body></html>';
} | php | protected function setFooterCommon($footerInjected = null)
{
$sHK = $this->tCmnSuperGlobals->get('specialHook');
if (!is_null($sHK) && (in_array('noHeader', $sHK))) {
return '';
}
return $this->setFooterCommonInjected($footerInjected) . '</body></html>';
} | [
"protected",
"function",
"setFooterCommon",
"(",
"$",
"footerInjected",
"=",
"null",
")",
"{",
"$",
"sHK",
"=",
"$",
"this",
"->",
"tCmnSuperGlobals",
"->",
"get",
"(",
"'specialHook'",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"sHK",
")",
"&&",
"... | Outputs an HTML footer
@param array $footerInjected
@return string | [
"Outputs",
"an",
"HTML",
"footer"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomHeaderFooterByDanielGP.php#L76-L83 |
200,373 | danielgp/common-lib | source/DomHeaderFooterByDanielGP.php | DomHeaderFooterByDanielGP.setHeaderCommon | protected function setHeaderCommon($headerFeatures = [])
{
$sReturn = [];
$this->initializeSprGlbAndSession();
$sHK = $this->tCmnSuperGlobals->get('specialHook');
if (!is_null($sHK) && (in_array('noHeader', $sHK))) {
return ''; // no Header
}
$fixedHea... | php | protected function setHeaderCommon($headerFeatures = [])
{
$sReturn = [];
$this->initializeSprGlbAndSession();
$sHK = $this->tCmnSuperGlobals->get('specialHook');
if (!is_null($sHK) && (in_array('noHeader', $sHK))) {
return ''; // no Header
}
$fixedHea... | [
"protected",
"function",
"setHeaderCommon",
"(",
"$",
"headerFeatures",
"=",
"[",
"]",
")",
"{",
"$",
"sReturn",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"initializeSprGlbAndSession",
"(",
")",
";",
"$",
"sHK",
"=",
"$",
"this",
"->",
"tCmnSuperGlobals",
"... | Outputs an HTML header
@param array $headerFeatures
@return string | [
"Outputs",
"an",
"HTML",
"header"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomHeaderFooterByDanielGP.php#L103-L129 |
200,374 | AmericanCouncils/MediaInfoBundle | MediaInfo.php | MediaInfo.scan | public function scan($filepath)
{
$proc = new Process(sprintf('%s %s --Output=XML --Full', $this->path, $filepath));
$proc->run();
if (!$proc->isSuccessful()) {
throw new \RuntimeException($proc->getErrorOutput());
}
$result = $proc->getOutput();
//pars... | php | public function scan($filepath)
{
$proc = new Process(sprintf('%s %s --Output=XML --Full', $this->path, $filepath));
$proc->run();
if (!$proc->isSuccessful()) {
throw new \RuntimeException($proc->getErrorOutput());
}
$result = $proc->getOutput();
//pars... | [
"public",
"function",
"scan",
"(",
"$",
"filepath",
")",
"{",
"$",
"proc",
"=",
"new",
"Process",
"(",
"sprintf",
"(",
"'%s %s --Output=XML --Full'",
",",
"$",
"this",
"->",
"path",
",",
"$",
"filepath",
")",
")",
";",
"$",
"proc",
"->",
"run",
"(",
... | Scans a file to return any structured metadata.
@param string $filepath Path to file to analyze
@return array | [
"Scans",
"a",
"file",
"to",
"return",
"any",
"structured",
"metadata",
"."
] | c1a37134c3e1c56282c115abfd53caaea7c97201 | https://github.com/AmericanCouncils/MediaInfoBundle/blob/c1a37134c3e1c56282c115abfd53caaea7c97201/MediaInfo.php#L33-L77 |
200,375 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/URLUtils.php | URLUtils.fullUrl | public static function fullUrl()
{
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = StringUtils::strLeft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443") ? "" : (... | php | public static function fullUrl()
{
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = StringUtils::strLeft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443") ? "" : (... | [
"public",
"static",
"function",
"fullUrl",
"(",
")",
"{",
"$",
"s",
"=",
"empty",
"(",
"$",
"_SERVER",
"[",
"\"HTTPS\"",
"]",
")",
"?",
"''",
":",
"(",
"$",
"_SERVER",
"[",
"\"HTTPS\"",
"]",
"==",
"\"on\"",
")",
"?",
"\"s\"",
":",
"\"\"",
";",
"$... | Returns the current, full url
@return string the current url | [
"Returns",
"the",
"current",
"full",
"url"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/URLUtils.php#L328-L335 |
200,376 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/URLUtils.php | URLUtils.safeUrl | public static function safeUrl($url)
{
// Strip invalid characters (anything but [a-zA-Z0-9=?&:;#_\/.-])
// $url = preg_replace("/[^a-zA-Z0-9=?&:;#_\/.-]/", '', $url);
if (empty($url))
return '';
// Prepend http:// if no scheme is specified
if (!preg_match("/^(ht... | php | public static function safeUrl($url)
{
// Strip invalid characters (anything but [a-zA-Z0-9=?&:;#_\/.-])
// $url = preg_replace("/[^a-zA-Z0-9=?&:;#_\/.-]/", '', $url);
if (empty($url))
return '';
// Prepend http:// if no scheme is specified
if (!preg_match("/^(ht... | [
"public",
"static",
"function",
"safeUrl",
"(",
"$",
"url",
")",
"{",
"// Strip invalid characters (anything but [a-zA-Z0-9=?&:;#_\\/.-])",
"// $url = preg_replace(\"/[^a-zA-Z0-9=?&:;#_\\/.-]/\", '', $url);",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"return",
"''... | Outputs a "safe" url, stripped of xss, autolink on domain, and stripped of invalid chars
@param string $url The url to process
@return string Safe and happy URL | [
"Outputs",
"a",
"safe",
"url",
"stripped",
"of",
"xss",
"autolink",
"on",
"domain",
"and",
"stripped",
"of",
"invalid",
"chars"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/URLUtils.php#L393-L410 |
200,377 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/URLUtils.php | URLUtils.resolveContextVariables | public static function resolveContextVariables($value, $object)
{
$value = str_replace(
array('%PATH_BUILD%', '%CONTEXT%', '%REWRITE_BASE%', '%SERVER_NAME%', '%DEVICE_VIEW%', '%DESIGN%', '%DOMAIN%', '%DOMAIN_BASE_URI%', '%DEPLOYMENT_BASE_PATH%'),
array(PATH_BUILD, ($object i... | php | public static function resolveContextVariables($value, $object)
{
$value = str_replace(
array('%PATH_BUILD%', '%CONTEXT%', '%REWRITE_BASE%', '%SERVER_NAME%', '%DEVICE_VIEW%', '%DESIGN%', '%DOMAIN%', '%DOMAIN_BASE_URI%', '%DEPLOYMENT_BASE_PATH%'),
array(PATH_BUILD, ($object i... | [
"public",
"static",
"function",
"resolveContextVariables",
"(",
"$",
"value",
",",
"$",
"object",
")",
"{",
"$",
"value",
"=",
"str_replace",
"(",
"array",
"(",
"'%PATH_BUILD%'",
",",
"'%CONTEXT%'",
",",
"'%REWRITE_BASE%'",
",",
"'%SERVER_NAME%'",
",",
"'%DEVICE... | Replace variables inside a value using the object as an originating reference
@static
@param $value
@param $object
@return mixed | [
"Replace",
"variables",
"inside",
"a",
"value",
"using",
"the",
"object",
"as",
"an",
"originating",
"reference"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/URLUtils.php#L579-L591 |
200,378 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/URLUtils.php | URLUtils.resolveSiteFromArray | public static function resolveSiteFromArray($siteArray, $useDomainAlias = false)
{
$site = new Site();
return self::resolveSiteContextObject($site, $siteArray, $useDomainAlias);
} | php | public static function resolveSiteFromArray($siteArray, $useDomainAlias = false)
{
$site = new Site();
return self::resolveSiteContextObject($site, $siteArray, $useDomainAlias);
} | [
"public",
"static",
"function",
"resolveSiteFromArray",
"(",
"$",
"siteArray",
",",
"$",
"useDomainAlias",
"=",
"false",
")",
"{",
"$",
"site",
"=",
"new",
"Site",
"(",
")",
";",
"return",
"self",
"::",
"resolveSiteContextObject",
"(",
"$",
"site",
",",
"$... | Creates a Site object from an array originating from the environments.xml
@static
@param $siteArray
@param bool $useDomainAlias
@return | [
"Creates",
"a",
"Site",
"object",
"from",
"an",
"array",
"originating",
"from",
"the",
"environments",
".",
"xml"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/URLUtils.php#L601-L607 |
200,379 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/URLUtils.php | URLUtils.resolveContextFromArray | public static function resolveContextFromArray($contextArray, $useDomainAlias = false)
{
$context = new ContextObject();
return self::resolveSiteContextObject($context, $contextArray, $useDomainAlias);
} | php | public static function resolveContextFromArray($contextArray, $useDomainAlias = false)
{
$context = new ContextObject();
return self::resolveSiteContextObject($context, $contextArray, $useDomainAlias);
} | [
"public",
"static",
"function",
"resolveContextFromArray",
"(",
"$",
"contextArray",
",",
"$",
"useDomainAlias",
"=",
"false",
")",
"{",
"$",
"context",
"=",
"new",
"ContextObject",
"(",
")",
";",
"return",
"self",
"::",
"resolveSiteContextObject",
"(",
"$",
"... | Creates a ContextObject object from an array originating from the environments.xml
@static
@param $contextArray
@param bool $useDomainAlias
@return | [
"Creates",
"a",
"ContextObject",
"object",
"from",
"an",
"array",
"originating",
"from",
"the",
"environments",
".",
"xml"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/URLUtils.php#L617-L622 |
200,380 | pluf/collection | src/Collection/Views/Document.php | Collection_Views_Document.create | public function create ($request, $match, $p)
{
// check collection
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
$request->REQUEST['collection'] = $collectionId;
} else {
$collectionId = $request->REQUEST['collection'];
... | php | public function create ($request, $match, $p)
{
// check collection
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
$request->REQUEST['collection'] = $collectionId;
} else {
$collectionId = $request->REQUEST['collection'];
... | [
"public",
"function",
"create",
"(",
"$",
"request",
",",
"$",
"match",
",",
"$",
"p",
")",
"{",
"// check collection",
"if",
"(",
"isset",
"(",
"$",
"match",
"[",
"'collectionId'",
"]",
")",
")",
"{",
"$",
"collectionId",
"=",
"$",
"match",
"[",
"'c... | Creates new instance of a document
@param Pluf_HTTP_Request $request
@param array $match
@param array $p
@return Pluf_HTTP_Response | [
"Creates",
"new",
"instance",
"of",
"a",
"document"
] | ae229d12e5ec352c66b31d5f89752f91f1342920 | https://github.com/pluf/collection/blob/ae229d12e5ec352c66b31d5f89752f91f1342920/src/Collection/Views/Document.php#L23-L39 |
200,381 | pluf/collection | src/Collection/Views/Document.php | Collection_Views_Document.get | public function get ($request, $match)
{
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} else {
$collectionId = $request->REQUEST['collectionId'];
}
$collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection',
... | php | public function get ($request, $match)
{
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} else {
$collectionId = $request->REQUEST['collectionId'];
}
$collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection',
... | [
"public",
"function",
"get",
"(",
"$",
"request",
",",
"$",
"match",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"match",
"[",
"'collectionId'",
"]",
")",
")",
"{",
"$",
"collectionId",
"=",
"$",
"match",
"[",
"'collectionId'",
"]",
";",
"}",
"else",
"... | Gets a document
@param Pluf_HTTP_Request $request
@param array $match
@throws Pluf_Exception_DoesNotExist
@return Pluf_HTTP_Response_Json | [
"Gets",
"a",
"document"
] | ae229d12e5ec352c66b31d5f89752f91f1342920 | https://github.com/pluf/collection/blob/ae229d12e5ec352c66b31d5f89752f91f1342920/src/Collection/Views/Document.php#L49-L67 |
200,382 | pluf/collection | src/Collection/Views/Document.php | Collection_Views_Document.find | public function find ($request, $match)
{
// check for collection
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} elseif (isset($request->REQUEST['collectionId'])) {
$collectionId = $request->REQUEST['collectionId'];
}
... | php | public function find ($request, $match)
{
// check for collection
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} elseif (isset($request->REQUEST['collectionId'])) {
$collectionId = $request->REQUEST['collectionId'];
}
... | [
"public",
"function",
"find",
"(",
"$",
"request",
",",
"$",
"match",
")",
"{",
"// check for collection",
"if",
"(",
"isset",
"(",
"$",
"match",
"[",
"'collectionId'",
"]",
")",
")",
"{",
"$",
"collectionId",
"=",
"$",
"match",
"[",
"'collectionId'",
"]... | Search for an document
@param Pluf_HTTP_Request $request
@param array $match
@return Pluf_HTTP_Response_Json | [
"Search",
"for",
"an",
"document"
] | ae229d12e5ec352c66b31d5f89752f91f1342920 | https://github.com/pluf/collection/blob/ae229d12e5ec352c66b31d5f89752f91f1342920/src/Collection/Views/Document.php#L76-L114 |
200,383 | pluf/collection | src/Collection/Views/Document.php | Collection_Views_Document.remove | public function remove ($request, $match)
{
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} else {
$collectionId = $request->REQUEST['collectionId'];
}
$collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection',
... | php | public function remove ($request, $match)
{
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} else {
$collectionId = $request->REQUEST['collectionId'];
}
$collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection',
... | [
"public",
"function",
"remove",
"(",
"$",
"request",
",",
"$",
"match",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"match",
"[",
"'collectionId'",
"]",
")",
")",
"{",
"$",
"collectionId",
"=",
"$",
"match",
"[",
"'collectionId'",
"]",
";",
"}",
"else",
... | Removes a document
@param Pluf_HTTP_Request $request
@param array $match
@throws Pluf_Exception_DoesNotExist
@return Pluf_HTTP_Response_Json | [
"Removes",
"a",
"document"
] | ae229d12e5ec352c66b31d5f89752f91f1342920 | https://github.com/pluf/collection/blob/ae229d12e5ec352c66b31d5f89752f91f1342920/src/Collection/Views/Document.php#L124-L151 |
200,384 | pluf/collection | src/Collection/Views/Document.php | Collection_Views_Document.update | public function update ($request, $match, $p)
{
// check collection
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
$request->REQUEST['collection'] = $collectionId;
} else {
$collectionId = $request->REQUEST['collection'];
... | php | public function update ($request, $match, $p)
{
// check collection
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
$request->REQUEST['collection'] = $collectionId;
} else {
$collectionId = $request->REQUEST['collection'];
... | [
"public",
"function",
"update",
"(",
"$",
"request",
",",
"$",
"match",
",",
"$",
"p",
")",
"{",
"// check collection",
"if",
"(",
"isset",
"(",
"$",
"match",
"[",
"'collectionId'",
"]",
")",
")",
"{",
"$",
"collectionId",
"=",
"$",
"match",
"[",
"'c... | Updates a document
@param Pluf_HTTP_Request $request
@param array $match
@param array $p
@throws Pluf_Exception_DoesNotExist
@return Pluf_HTTP_Response | [
"Updates",
"a",
"document"
] | ae229d12e5ec352c66b31d5f89752f91f1342920 | https://github.com/pluf/collection/blob/ae229d12e5ec352c66b31d5f89752f91f1342920/src/Collection/Views/Document.php#L162-L184 |
200,385 | pluf/collection | src/Collection/Views/Document.php | Collection_Views_Document.putMap | public function putMap ($request, $match)
{
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} else {
$collectionId = $request->REQUEST['collectionId'];
}
// $collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection',
... | php | public function putMap ($request, $match)
{
if (isset($match['collectionId'])) {
$collectionId = $match['collectionId'];
} else {
$collectionId = $request->REQUEST['collectionId'];
}
// $collection = Pluf_Shortcuts_GetObjectOr404('Collection_Collection',
... | [
"public",
"function",
"putMap",
"(",
"$",
"request",
",",
"$",
"match",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"match",
"[",
"'collectionId'",
"]",
")",
")",
"{",
"$",
"collectionId",
"=",
"$",
"match",
"[",
"'collectionId'",
"]",
";",
"}",
"else",
... | Puts attributes of a document
@param Pluf_HTTP_Request $request
@param array $match | [
"Puts",
"attributes",
"of",
"a",
"document"
] | ae229d12e5ec352c66b31d5f89752f91f1342920 | https://github.com/pluf/collection/blob/ae229d12e5ec352c66b31d5f89752f91f1342920/src/Collection/Views/Document.php#L225-L251 |
200,386 | opensourcerefinery/vicus | src/Storage/Handler/DeglobalizedMySQLSessionHandler.php | DeglobalizedMySQLSessionHandler.connect | private function connect()
{
$this->sessionLink = mysqli_connect($this->host_master,$this->user,$this->password,$this->name) or die("Error " . mysqli_error($this->sessionLink));
// $this->pdo = new \PDO($dsn, $this->username, $this->password, $this->connectionOptions);
// $this->pdo->setAttribute(\... | php | private function connect()
{
$this->sessionLink = mysqli_connect($this->host_master,$this->user,$this->password,$this->name) or die("Error " . mysqli_error($this->sessionLink));
// $this->pdo = new \PDO($dsn, $this->username, $this->password, $this->connectionOptions);
// $this->pdo->setAttribute(\... | [
"private",
"function",
"connect",
"(",
")",
"{",
"$",
"this",
"->",
"sessionLink",
"=",
"mysqli_connect",
"(",
"$",
"this",
"->",
"host_master",
",",
"$",
"this",
"->",
"user",
",",
"$",
"this",
"->",
"password",
",",
"$",
"this",
"->",
"name",
")",
... | NOT WORKING!!!
Lazy-connects to the database.
@param string $dsn DSN string | [
"NOT",
"WORKING!!!",
"Lazy",
"-",
"connects",
"to",
"the",
"database",
"."
] | 5be93d75bf6ab8009a299e9946c8333f0017fa3e | https://github.com/opensourcerefinery/vicus/blob/5be93d75bf6ab8009a299e9946c8333f0017fa3e/src/Storage/Handler/DeglobalizedMySQLSessionHandler.php#L218-L225 |
200,387 | mwyatt/core | src/Iterator/Model.php | Model.getKeyedByPropertyMulti | public function getKeyedByPropertyMulti($property)
{
$keyed = [];
foreach ($this as $model) {
if (empty($keyed[$model->$property])) {
$keyed[$model->$property] = [];
}
$keyed[$model->$property][] = $model;
}
return $keyed;
} | php | public function getKeyedByPropertyMulti($property)
{
$keyed = [];
foreach ($this as $model) {
if (empty($keyed[$model->$property])) {
$keyed[$model->$property] = [];
}
$keyed[$model->$property][] = $model;
}
return $keyed;
} | [
"public",
"function",
"getKeyedByPropertyMulti",
"(",
"$",
"property",
")",
"{",
"$",
"keyed",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"model",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"keyed",
"[",
"$",
"model",
"->",
"$",
"prop... | key the iterator by the specified property
but go 2 levels
@param string $property
@return array | [
"key",
"the",
"iterator",
"by",
"the",
"specified",
"property",
"but",
"go",
"2",
"levels"
] | 8ea9d67cc84fe6aff17a469c703d5492dbcd93ed | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Iterator/Model.php#L78-L88 |
200,388 | raulfraile/ladybug-plugin-extra | Type/CollectionType.php | CollectionType.loadFromArray | public function loadFromArray(array $data, $useKeys = true)
{
$this->items = array();
foreach ($data as $key => $item) {
$this->items[] = $item;
}
} | php | public function loadFromArray(array $data, $useKeys = true)
{
$this->items = array();
foreach ($data as $key => $item) {
$this->items[] = $item;
}
} | [
"public",
"function",
"loadFromArray",
"(",
"array",
"$",
"data",
",",
"$",
"useKeys",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"$"... | Loads collection values from the given array
@param array $data
@param bool $useKeys | [
"Loads",
"collection",
"values",
"from",
"the",
"given",
"array"
] | 0d569c28eb4706506f0057d95a1da9dd2c76c329 | https://github.com/raulfraile/ladybug-plugin-extra/blob/0d569c28eb4706506f0057d95a1da9dd2c76c329/Type/CollectionType.php#L40-L47 |
200,389 | geniv/nette-general-form | src/GeneralForm.php | GeneralForm.getDefinitionFormContainer | public static function getDefinitionFormContainer(CompilerExtension $compilerExtension, $indexConfig = 'formContainer', $prefixName = 'formContainer'): ServiceDefinition
{
$builder = $compilerExtension->getContainerBuilder();
$config = $compilerExtension->getConfig();
return $builder->addDe... | php | public static function getDefinitionFormContainer(CompilerExtension $compilerExtension, $indexConfig = 'formContainer', $prefixName = 'formContainer'): ServiceDefinition
{
$builder = $compilerExtension->getContainerBuilder();
$config = $compilerExtension->getConfig();
return $builder->addDe... | [
"public",
"static",
"function",
"getDefinitionFormContainer",
"(",
"CompilerExtension",
"$",
"compilerExtension",
",",
"$",
"indexConfig",
"=",
"'formContainer'",
",",
"$",
"prefixName",
"=",
"'formContainer'",
")",
":",
"ServiceDefinition",
"{",
"$",
"builder",
"=",
... | Get definition form container.
@param CompilerExtension $compilerExtension
@param string $indexConfig
@param string $prefixName
@return ServiceDefinition | [
"Get",
"definition",
"form",
"container",
"."
] | 0d0548b63cf7db58c17ee12d6933f2dd995a64e6 | https://github.com/geniv/nette-general-form/blob/0d0548b63cf7db58c17ee12d6933f2dd995a64e6/src/GeneralForm.php#L30-L38 |
200,390 | geniv/nette-general-form | src/GeneralForm.php | GeneralForm.getDefinitionEventContainer | public static function getDefinitionEventContainer(CompilerExtension $compilerExtension, $indexConfig = 'events'): array
{
$builder = $compilerExtension->getContainerBuilder();
$config = $compilerExtension->getConfig();
$events = [];
foreach ($config[$indexConfig] as $index => $even... | php | public static function getDefinitionEventContainer(CompilerExtension $compilerExtension, $indexConfig = 'events'): array
{
$builder = $compilerExtension->getContainerBuilder();
$config = $compilerExtension->getConfig();
$events = [];
foreach ($config[$indexConfig] as $index => $even... | [
"public",
"static",
"function",
"getDefinitionEventContainer",
"(",
"CompilerExtension",
"$",
"compilerExtension",
",",
"$",
"indexConfig",
"=",
"'events'",
")",
":",
"array",
"{",
"$",
"builder",
"=",
"$",
"compilerExtension",
"->",
"getContainerBuilder",
"(",
")",... | Get definition event container.
@param CompilerExtension $compilerExtension
@param string $indexConfig
@return array | [
"Get",
"definition",
"event",
"container",
"."
] | 0d0548b63cf7db58c17ee12d6933f2dd995a64e6 | https://github.com/geniv/nette-general-form/blob/0d0548b63cf7db58c17ee12d6933f2dd995a64e6/src/GeneralForm.php#L48-L77 |
200,391 | squareproton/Bond | src/Bond/Entity/Types/PgLargeObject.php | PgLargeObject.chainSaving | public function chainSaving( array &$tasks, $key )
{
if( $this->isNew() or $this->isChanged() ) {
$tasks[$key] = $this;
}
} | php | public function chainSaving( array &$tasks, $key )
{
if( $this->isNew() or $this->isChanged() ) {
$tasks[$key] = $this;
}
} | [
"public",
"function",
"chainSaving",
"(",
"array",
"&",
"$",
"tasks",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNew",
"(",
")",
"or",
"$",
"this",
"->",
"isChanged",
"(",
")",
")",
"{",
"$",
"tasks",
"[",
"$",
"key",
"]",
"=",... | Add a object to the chain task array if it is changed or new
Required for ChainSavingInterface
@param array $task The existing array of tasks
@param string $key The string under which to add the object | [
"Add",
"a",
"object",
"to",
"the",
"chain",
"task",
"array",
"if",
"it",
"is",
"changed",
"or",
"new",
"Required",
"for",
"ChainSavingInterface"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Types/PgLargeObject.php#L96-L101 |
200,392 | squareproton/Bond | src/Bond/Entity/Types/PgLargeObject.php | PgLargeObject.md5 | public function md5()
{
if( isset( $this->filePath ) ) {
return md5_file( $this->filePath );
} elseif( $this->oid ) {
$query = new Query(
"SELECT common.md5( %oid:oid|cast% );",
array(
'oid' => $this->oid
... | php | public function md5()
{
if( isset( $this->filePath ) ) {
return md5_file( $this->filePath );
} elseif( $this->oid ) {
$query = new Query(
"SELECT common.md5( %oid:oid|cast% );",
array(
'oid' => $this->oid
... | [
"public",
"function",
"md5",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"filePath",
")",
")",
"{",
"return",
"md5_file",
"(",
"$",
"this",
"->",
"filePath",
")",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"oid",
")",
"{",
"$",
... | Return the MD5 hash of the data
@return mixed | [
"Return",
"the",
"MD5",
"hash",
"of",
"the",
"data"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Types/PgLargeObject.php#L184-L207 |
200,393 | squareproton/Bond | src/Bond/Entity/Types/PgLargeObject.php | PgLargeObject.data | public function data()
{
if( isset( $this->filePath ) ) {
return file_get_contents( $this->filePath );
} elseif( $this->oid ) {
$pg = $this->oid->pg;
$pg->query( new Query( 'BEGIN' ) );
$handle = pg_lo_open( $pg->resource->get(), $this->oid->oid, ... | php | public function data()
{
if( isset( $this->filePath ) ) {
return file_get_contents( $this->filePath );
} elseif( $this->oid ) {
$pg = $this->oid->pg;
$pg->query( new Query( 'BEGIN' ) );
$handle = pg_lo_open( $pg->resource->get(), $this->oid->oid, ... | [
"public",
"function",
"data",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"filePath",
")",
")",
"{",
"return",
"file_get_contents",
"(",
"$",
"this",
"->",
"filePath",
")",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"oid",
")",
"{",... | Get the data stored in the large object resource.
@param void
@return mixed | [
"Get",
"the",
"data",
"stored",
"in",
"the",
"large",
"object",
"resource",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Types/PgLargeObject.php#L214-L243 |
200,394 | squareproton/Bond | src/Bond/Entity/Types/PgLargeObject.php | PgLargeObject.export | public function export( $destination, $overwriteIfExists = false )
{
if( !is_string( $destination ) ){
throw new \RuntimeException(sprintf(
'Expected $destination to be a string, got type: %s',
gettype($destination)
));
}
if( file_exi... | php | public function export( $destination, $overwriteIfExists = false )
{
if( !is_string( $destination ) ){
throw new \RuntimeException(sprintf(
'Expected $destination to be a string, got type: %s',
gettype($destination)
));
}
if( file_exi... | [
"public",
"function",
"export",
"(",
"$",
"destination",
",",
"$",
"overwriteIfExists",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"destination",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"sprintf",
"(",
"'Expected $... | Export the data stored in the large object resource to the specified file.
@param mixed $destination
@return boolean. | [
"Export",
"the",
"data",
"stored",
"in",
"the",
"large",
"object",
"resource",
"to",
"the",
"specified",
"file",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Types/PgLargeObject.php#L250-L282 |
200,395 | squareproton/Bond | src/Bond/Entity/Types/PgLargeObject.php | PgLargeObject.stream | public function stream()
{
// filesystem
if( isset( $this->filePath ) ) {
return readfile( $this->filePath );
} elseif ( $this->oid ) {
$pg = $this->oid->pg;
$pg->query( new Query( 'BEGIN' ) );
$handle = pg_lo_open( $pg->resource->get(), ... | php | public function stream()
{
// filesystem
if( isset( $this->filePath ) ) {
return readfile( $this->filePath );
} elseif ( $this->oid ) {
$pg = $this->oid->pg;
$pg->query( new Query( 'BEGIN' ) );
$handle = pg_lo_open( $pg->resource->get(), ... | [
"public",
"function",
"stream",
"(",
")",
"{",
"// filesystem",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"filePath",
")",
")",
"{",
"return",
"readfile",
"(",
"$",
"this",
"->",
"filePath",
")",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"oid",
... | Output the data stored in the large object resource to stdout.
@param void
@return void | [
"Output",
"the",
"data",
"stored",
"in",
"the",
"large",
"object",
"resource",
"to",
"stdout",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Types/PgLargeObject.php#L289-L316 |
200,396 | phpffcms/ffcms-core | src/Managers/CronManager.php | CronManager.run | public function run()
{
// check if cron instances is defined
if (!isset($this->configs['instances']) || !Any::isArray($this->configs['instances'])) {
return null;
}
// get timestamp
$time = time();
$log = [];
// each every one instance
f... | php | public function run()
{
// check if cron instances is defined
if (!isset($this->configs['instances']) || !Any::isArray($this->configs['instances'])) {
return null;
}
// get timestamp
$time = time();
$log = [];
// each every one instance
f... | [
"public",
"function",
"run",
"(",
")",
"{",
"// check if cron instances is defined",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"configs",
"[",
"'instances'",
"]",
")",
"||",
"!",
"Any",
"::",
"isArray",
"(",
"$",
"this",
"->",
"configs",
"[",
"'in... | Run cron task. Attention - this method is too 'fat' to run from any app's
@return array|null | [
"Run",
"cron",
"task",
".",
"Attention",
"-",
"this",
"method",
"is",
"too",
"fat",
"to",
"run",
"from",
"any",
"app",
"s"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/CronManager.php#L34-L63 |
200,397 | phpffcms/ffcms-core | src/Managers/CronManager.php | CronManager.remove | public function remove($class, $method)
{
$callback = $class . '::' . $method;
if (isset($this->configs['instances'][$callback])) {
unset($this->configs['instances'][$callback], $this->configs['log'][$callback]);
App::$Properties->writeConfig('Cron', $this->configs);
... | php | public function remove($class, $method)
{
$callback = $class . '::' . $method;
if (isset($this->configs['instances'][$callback])) {
unset($this->configs['instances'][$callback], $this->configs['log'][$callback]);
App::$Properties->writeConfig('Cron', $this->configs);
... | [
"public",
"function",
"remove",
"(",
"$",
"class",
",",
"$",
"method",
")",
"{",
"$",
"callback",
"=",
"$",
"class",
".",
"'::'",
".",
"$",
"method",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"configs",
"[",
"'instances'",
"]",
"[",
"$",
"... | Remove registered cron task from configs
@param string $class
@param string $method | [
"Remove",
"registered",
"cron",
"task",
"from",
"configs"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/CronManager.php#L95-L102 |
200,398 | eltrino/PHPUnit_MockAnnotations | src/Eltrino/PHPUnit/MockAnnotations/PlainMockObjectFactory.php | PlainMockObjectFactory.create | public function create($classToMock)
{
$mockBuilder = new \PHPUnit_Framework_MockObject_MockBuilder(
$this->testCase, $classToMock
);
$mockBuilder->disableOriginalConstructor();
return $mockBuilder->getMock();
} | php | public function create($classToMock)
{
$mockBuilder = new \PHPUnit_Framework_MockObject_MockBuilder(
$this->testCase, $classToMock
);
$mockBuilder->disableOriginalConstructor();
return $mockBuilder->getMock();
} | [
"public",
"function",
"create",
"(",
"$",
"classToMock",
")",
"{",
"$",
"mockBuilder",
"=",
"new",
"\\",
"PHPUnit_Framework_MockObject_MockBuilder",
"(",
"$",
"this",
"->",
"testCase",
",",
"$",
"classToMock",
")",
";",
"$",
"mockBuilder",
"->",
"disableOriginal... | Creates simple PHPUnit Mock Object with disabled original constructor
@param string $classToMock
@return \PHPUnit_Framework_MockObject_MockObject | [
"Creates",
"simple",
"PHPUnit",
"Mock",
"Object",
"with",
"disabled",
"original",
"constructor"
] | 1a06ed59ea0702359848fc01e958f4f92abb503a | https://github.com/eltrino/PHPUnit_MockAnnotations/blob/1a06ed59ea0702359848fc01e958f4f92abb503a/src/Eltrino/PHPUnit/MockAnnotations/PlainMockObjectFactory.php#L21-L28 |
200,399 | olobu/olobu | core/router.php | O_Router._parse_routes | private function _parse_routes()
{
$uri=implode('/', $this->uri->segments());
if (isset($this->router[$uri])) {
return $this->_set_request(explode('/', $this->router[$uri]));
}
foreach ($this->router as $key => $val) {
$key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));
if (preg_... | php | private function _parse_routes()
{
$uri=implode('/', $this->uri->segments());
if (isset($this->router[$uri])) {
return $this->_set_request(explode('/', $this->router[$uri]));
}
foreach ($this->router as $key => $val) {
$key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));
if (preg_... | [
"private",
"function",
"_parse_routes",
"(",
")",
"{",
"$",
"uri",
"=",
"implode",
"(",
"'/'",
",",
"$",
"this",
"->",
"uri",
"->",
"segments",
"(",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"router",
"[",
"$",
"uri",
"]",
")",
... | disini mo ba atur akan apa mo kamana | [
"disini",
"mo",
"ba",
"atur",
"akan",
"apa",
"mo",
"kamana"
] | 05bea2bff63d3e38b458fb42e8f07f1d850ae211 | https://github.com/olobu/olobu/blob/05bea2bff63d3e38b458fb42e8f07f1d850ae211/core/router.php#L58-L79 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.