Search is not available for this dataset
repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens list | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens list | split_name stringclasses 1
value | func_code_url stringlengths 85 339 | parameters list | question stringlengths 9 114 | answer list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Boolive/Core | file/File.php | File.upload | static function upload($from, $to)
{
$result = false;
if(is_uploaded_file($from)){
$to = self::makeVirtualDir($to);
// Если папки нет, то создаем её
$dir = dirname($to);
if(!is_dir($dir)){
mkdir($dir, 0775, true);
}
... | php | static function upload($from, $to)
{
$result = false;
if(is_uploaded_file($from)){
$to = self::makeVirtualDir($to);
// Если папки нет, то создаем её
$dir = dirname($to);
if(!is_dir($dir)){
mkdir($dir, 0775, true);
}
... | [
"static",
"function",
"upload",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"is_uploaded_file",
"(",
"$",
"from",
")",
")",
"{",
"$",
"to",
"=",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"to",
")",
";"... | Перемешщение загруженного файла по указанному пути
@param string $from Путь к загружаемому файлу
@param string $to Путь, куда файл копировать. Путь должен содерджать имя файла
@return bool Признак, загружен файл или нет | [
"Перемешщение",
"загруженного",
"файла",
"по",
"указанному",
"пути"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L54-L72 | [
"from",
"to"
] | What does this function return? | [
"bool",
"Признак,",
"загружен",
"файл",
"или",
"нет"
] |
Boolive/Core | file/File.php | File.copy | static function copy($from, $to)
{
$result = false;
if (file_exists($from)){
$to = self::makeVirtualDir($to);
// Если папки нет, то создаем её
$dir = dirname($to);
if(!is_dir($dir)){
mkdir($dir, 0775, true);
}
if... | php | static function copy($from, $to)
{
$result = false;
if (file_exists($from)){
$to = self::makeVirtualDir($to);
// Если папки нет, то создаем её
$dir = dirname($to);
if(!is_dir($dir)){
mkdir($dir, 0775, true);
}
if... | [
"static",
"function",
"copy",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"file_exists",
"(",
"$",
"from",
")",
")",
"{",
"$",
"to",
"=",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"to",
")",
";",
"//... | Копирование файла
@param string $from Путь к копируемому файлу
@param string $to Путь, куда файл копировать. Путь должен содерджать имя файла
@return bool Признак, скопирован файл или нет | [
"Копирование",
"файла"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L80-L97 | [
"from",
"to"
] | What does this function return? | [
"bool",
"Признак,",
"скопирован",
"файл",
"или",
"нет"
] |
Boolive/Core | file/File.php | File.rename | static function rename($from, $to)
{
$result = false;
if (file_exists($from)){
$to = self::makeVirtualDir($to);
$dir = dirname($to);
if (!is_dir($dir)) mkdir($dir, true);
if (mb_strtoupper($from) != mb_strtoupper($to)){
if (is_dir($to))... | php | static function rename($from, $to)
{
$result = false;
if (file_exists($from)){
$to = self::makeVirtualDir($to);
$dir = dirname($to);
if (!is_dir($dir)) mkdir($dir, true);
if (mb_strtoupper($from) != mb_strtoupper($to)){
if (is_dir($to))... | [
"static",
"function",
"rename",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"file_exists",
"(",
"$",
"from",
")",
")",
"{",
"$",
"to",
"=",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"to",
")",
";",
"... | Переименование или перемещение файла
@param string $from Путь к переименовываемому файлу
@param string $to Путь с новым именем
@return bool Признак, переименован файл или нет | [
"Переименование",
"или",
"перемещение",
"файла"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L105-L124 | [
"from",
"to"
] | What does this function return? | [
"bool",
"Признак,",
"переименован",
"файл",
"или",
"нет"
] |
Boolive/Core | file/File.php | File.delete | static function delete($from)
{
$from = self::makeVirtualDir($from, false);
$result = false;
if (is_file($from)){
@unlink($from);
$result = true;
}
self::deleteVirtualDir($from);
return $result;
} | php | static function delete($from)
{
$from = self::makeVirtualDir($from, false);
$result = false;
if (is_file($from)){
@unlink($from);
$result = true;
}
self::deleteVirtualDir($from);
return $result;
} | [
"static",
"function",
"delete",
"(",
"$",
"from",
")",
"{",
"$",
"from",
"=",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"from",
",",
"false",
")",
";",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"is_file",
"(",
"$",
"from",
")",
")",
"{",
"@",
... | Удаление файла
@param string $from Путь к удаляемому файлу
@return bool | [
"Удаление",
"файла"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L131-L141 | [
"from"
] | What does this function return? | [
"bool"
] |
Boolive/Core | file/File.php | File.delete_empty_dir | static function delete_empty_dir($dir)
{
$dir = self::makeVirtualDir($dir, false);
if (is_dir($dir) && sizeof(scandir($dir)) == 2){
return @rmdir($dir);
}
self::deleteVirtualDir($dir);
return false;
} | php | static function delete_empty_dir($dir)
{
$dir = self::makeVirtualDir($dir, false);
if (is_dir($dir) && sizeof(scandir($dir)) == 2){
return @rmdir($dir);
}
self::deleteVirtualDir($dir);
return false;
} | [
"static",
"function",
"delete_empty_dir",
"(",
"$",
"dir",
")",
"{",
"$",
"dir",
"=",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"dir",
",",
"false",
")",
";",
"if",
"(",
"is_dir",
"(",
"$",
"dir",
")",
"&&",
"sizeof",
"(",
"scandir",
"(",
"$",
"dir... | Удаление пустой директории
@param $dir
@return bool | [
"Удаление",
"пустой",
"директории"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L148-L156 | [
"dir"
] | What does this function return? | [
"bool"
] |
Boolive/Core | file/File.php | File.clear_dir | static function clear_dir($dir, $delete_me = false)
{
$dir = self::makeVirtualDir($dir, false);
$result = false;
if (is_file($dir)){
$result = @unlink($dir);
}else
if (is_dir($dir)){
$scan = glob(rtrim($dir, '/').'/*');
foreach ($scan as $p... | php | static function clear_dir($dir, $delete_me = false)
{
$dir = self::makeVirtualDir($dir, false);
$result = false;
if (is_file($dir)){
$result = @unlink($dir);
}else
if (is_dir($dir)){
$scan = glob(rtrim($dir, '/').'/*');
foreach ($scan as $p... | [
"static",
"function",
"clear_dir",
"(",
"$",
"dir",
",",
"$",
"delete_me",
"=",
"false",
")",
"{",
"$",
"dir",
"=",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"dir",
",",
"false",
")",
";",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"is_file",
"("... | Удаление всех файлов и поддиректорий в указанной директории
@param string $dir Путь на очищаемому директорию
@param bool $delete_me Удалить указанную директорию (true) или только её содержимое (false)?
@return bool Признак, выполнено ли удаление | [
"Удаление",
"всех",
"файлов",
"и",
"поддиректорий",
"в",
"указанной",
"директории"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L164-L180 | [
"dir",
"delete_me"
] | What does this function return? | [
"bool",
"Признак,",
"выполнено",
"ли",
"удаление"
] |
Boolive/Core | file/File.php | File.fileInfo | static function fileInfo($path, $key = null)
{
$path = str_replace('\\','/',$path);
$list = F::explode('/', $path, -2);
if (sizeof($list)<2){
array_unshift($list, '');
}
$info = array('dir'=>$list[0], 'name'=>$list[1], 'base'=> '', 'ext'=>'', 'back'=>false);
... | php | static function fileInfo($path, $key = null)
{
$path = str_replace('\\','/',$path);
$list = F::explode('/', $path, -2);
if (sizeof($list)<2){
array_unshift($list, '');
}
$info = array('dir'=>$list[0], 'name'=>$list[1], 'base'=> '', 'ext'=>'', 'back'=>false);
... | [
"static",
"function",
"fileInfo",
"(",
"$",
"path",
",",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"path",
")",
";",
"$",
"list",
"=",
"F",
"::",
"explode",
"(",
"'/'",
",",
"$",
"p... | Возвращает имя и расширение файла из его пути
Путь может быть относительным. Файл может отсутствовать
@param string $path Путь к файлу
@param null $key Какую информацию о файле возвратить? dir, name, base, ext. Если null, то возвращается всё в виде массива
@return array|string Имя без расширения, расширение, полное имя... | [
"Возвращает",
"имя",
"и",
"расширение",
"файла",
"из",
"его",
"пути",
"Путь",
"может",
"быть",
"относительным",
".",
"Файл",
"может",
"отсутствовать"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L189-L212 | [
"path",
"key"
] | What does this function return? | [
"array|string",
"Имя",
"без",
"расширения,",
"расширение,",
"полное",
"имя",
"файла",
"и",
"директория"
] |
Boolive/Core | file/File.php | File.changeExtention | static function changeExtention($path, $ext)
{
$dir = dirname($path).'/';
$f = self::fileInfo($path);
return $dir.$f['base'].'.'.$ext;
} | php | static function changeExtention($path, $ext)
{
$dir = dirname($path).'/';
$f = self::fileInfo($path);
return $dir.$f['base'].'.'.$ext;
} | [
"static",
"function",
"changeExtention",
"(",
"$",
"path",
",",
"$",
"ext",
")",
"{",
"$",
"dir",
"=",
"dirname",
"(",
"$",
"path",
")",
".",
"'/'",
";",
"$",
"f",
"=",
"self",
"::",
"fileInfo",
"(",
"$",
"path",
")",
";",
"return",
"$",
"dir",
... | Смена расширения в имени файла.
Смена имени не касается самого файла!
@param string $path Путь к файлу
@param string $ext Новое расширение файла
@return string Новое имя файла | [
"Смена",
"расширения",
"в",
"имени",
"файла",
".",
"Смена",
"имени",
"не",
"касается",
"самого",
"файла!"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L221-L226 | [
"path",
"ext"
] | What does this function return? | [
"string",
"Новое",
"имя",
"файла"
] |
Boolive/Core | file/File.php | File.changeName | static function changeName($path, $name)
{
$f = self::fileInfo($path);
return $f['dir'].$name.'.'.$f['ext'];
} | php | static function changeName($path, $name)
{
$f = self::fileInfo($path);
return $f['dir'].$name.'.'.$f['ext'];
} | [
"static",
"function",
"changeName",
"(",
"$",
"path",
",",
"$",
"name",
")",
"{",
"$",
"f",
"=",
"self",
"::",
"fileInfo",
"(",
"$",
"path",
")",
";",
"return",
"$",
"f",
"[",
"'dir'",
"]",
".",
"$",
"name",
".",
"'.'",
".",
"$",
"f",
"[",
"'... | Смена имени файла не меняя расширения.
Смена имени не касается самого файла!
@param string $path Путь к файлу
@param string $name Новое имя файла без расширения
@return string Новое имя файла | [
"Смена",
"имени",
"файла",
"не",
"меняя",
"расширения",
".",
"Смена",
"имени",
"не",
"касается",
"самого",
"файла!"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L235-L239 | [
"path",
"name"
] | What does this function return? | [
"string",
"Новое",
"имя",
"файла"
] |
Boolive/Core | file/File.php | File.fileExtention | static function fileExtention($path)
{
$list = F::explode('.', $path, -2);
if (sizeof($list)>1){
return strtolower($list[1]);
}else{
return '';
}
} | php | static function fileExtention($path)
{
$list = F::explode('.', $path, -2);
if (sizeof($list)>1){
return strtolower($list[1]);
}else{
return '';
}
} | [
"static",
"function",
"fileExtention",
"(",
"$",
"path",
")",
"{",
"$",
"list",
"=",
"F",
"::",
"explode",
"(",
"'.'",
",",
"$",
"path",
",",
"-",
"2",
")",
";",
"if",
"(",
"sizeof",
"(",
"$",
"list",
")",
">",
"1",
")",
"{",
"return",
"strtolo... | Расширение файла
@param $path
@return mixed | [
"Расширение",
"файла"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L257-L265 | [
"path"
] | What does this function return? | [
"mixed"
] |
Boolive/Core | file/File.php | File.makeUniqueName | static function makeUniqueName($dir, $name, $ext, $start = 1)
{
self::makeVirtualDir($dir);
$i = 0;
$to = $dir.$name.$ext;
while (file_exists($to) && $i<100){
$to = $dir.$name.(++$i+$start).$ext;
}
$result = ($i < 100+$start)? false : $to;
self::de... | php | static function makeUniqueName($dir, $name, $ext, $start = 1)
{
self::makeVirtualDir($dir);
$i = 0;
$to = $dir.$name.$ext;
while (file_exists($to) && $i<100){
$to = $dir.$name.(++$i+$start).$ext;
}
$result = ($i < 100+$start)? false : $to;
self::de... | [
"static",
"function",
"makeUniqueName",
"(",
"$",
"dir",
",",
"$",
"name",
",",
"$",
"ext",
",",
"$",
"start",
"=",
"1",
")",
"{",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"dir",
")",
";",
"$",
"i",
"=",
"0",
";",
"$",
"to",
"=",
"$",
"dir",
... | Создание уникального имени для файла или директории
@param string $dir Директория со слэшем на конце, в которой подобрать уникальное имя
@param string $name Базовое имя, к которому будут добавляться числовые префиксы для уникальности
@param string $ext Расширение с точкой, присваиваемое к имени после подбора
@param int... | [
"Создание",
"уникального",
"имени",
"для",
"файла",
"или",
"директории"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L275-L286 | [
"dir",
"name",
"ext",
"start"
] | What does this function return? | [
"string|bool",
"Уникальное",
"имя",
"вместе",
"с",
"путём",
"или",
"false,",
"если",
"не",
"удалось",
"подобрать"
] |
Boolive/Core | file/File.php | File.makeUniqueDir | static function makeUniqueDir($dir, $name, $start = 1, $find = true)
{
self::makeVirtualDir($dir);
$max = $start + 1000;
$i = $start;
$path = $dir.$name;
do {
try{
if ($result = mkdir($path, 0775, true)){
$result = $path;
... | php | static function makeUniqueDir($dir, $name, $start = 1, $find = true)
{
self::makeVirtualDir($dir);
$max = $start + 1000;
$i = $start;
$path = $dir.$name;
do {
try{
if ($result = mkdir($path, 0775, true)){
$result = $path;
... | [
"static",
"function",
"makeUniqueDir",
"(",
"$",
"dir",
",",
"$",
"name",
",",
"$",
"start",
"=",
"1",
",",
"$",
"find",
"=",
"true",
")",
"{",
"self",
"::",
"makeVirtualDir",
"(",
"$",
"dir",
")",
";",
"$",
"max",
"=",
"$",
"start",
"+",
"1000",... | Создание уникальной директории
@param string $dir Директория со слэшем на конце, в которой подобрать уникальное имя
@param string $name Базовое имя, к которому будут добавляться числовые префиксы для уникальности
@param int $start Начальное значение для префикса
@param bool $find Признак подбирать уникальное имя
@retur... | [
"Создание",
"уникальной",
"директории"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L296-L315 | [
"dir",
"name",
"start",
"find"
] | What does this function return? | [
"string|bool",
"Уникальное",
"имя",
"вместе",
"с",
"путём",
"или",
"false,",
"если",
"не",
"удалось",
"подобрать"
] |
Boolive/Core | file/File.php | File.uploadErrorMmessage | static function uploadErrorMmessage($error_code)
{
switch ($error_code) {
case UPLOAD_ERR_INI_SIZE:
return 'Превышен максимально допустимый размер файла';
case UPLOAD_ERR_FORM_SIZE:
return 'Превышен максимально допустимый размер, указанный в html форме... | php | static function uploadErrorMmessage($error_code)
{
switch ($error_code) {
case UPLOAD_ERR_INI_SIZE:
return 'Превышен максимально допустимый размер файла';
case UPLOAD_ERR_FORM_SIZE:
return 'Превышен максимально допустимый размер, указанный в html форме... | [
"static",
"function",
"uploadErrorMmessage",
"(",
"$",
"error_code",
")",
"{",
"switch",
"(",
"$",
"error_code",
")",
"{",
"case",
"UPLOAD_ERR_INI_SIZE",
":",
"return",
"'Превышен максимально допустимый размер файла';",
"",
"case",
"UPLOAD_ERR_FORM_SIZE",
":",
"return",... | Текст ошибки загрзки файла
@param int $error_code Код ошибки
@return string | [
"Текст",
"ошибки",
"загрзки",
"файла"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L322-L341 | [
"error_code"
] | What does this function return? | [
"string"
] |
Boolive/Core | file/File.php | File.getDirSize | static function getDirSize($dir)
{
$size = 0;
$dirs = array_diff(scandir($dir), array('.', '..'));
foreach ($dirs as $d){
$d = $dir.'/'.$d;
$size+= filesize($d);
if (is_dir($d)){
$size+= self::getDirSize($d);
}
}
... | php | static function getDirSize($dir)
{
$size = 0;
$dirs = array_diff(scandir($dir), array('.', '..'));
foreach ($dirs as $d){
$d = $dir.'/'.$d;
$size+= filesize($d);
if (is_dir($d)){
$size+= self::getDirSize($d);
}
}
... | [
"static",
"function",
"getDirSize",
"(",
"$",
"dir",
")",
"{",
"$",
"size",
"=",
"0",
";",
"$",
"dirs",
"=",
"array_diff",
"(",
"scandir",
"(",
"$",
"dir",
")",
",",
"array",
"(",
"'.'",
",",
"'..'",
")",
")",
";",
"foreach",
"(",
"$",
"dirs",
... | Размер директории в байтах
@param string $dir Путь на директорию
@return int | [
"Размер",
"директории",
"в",
"байтах"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L359-L371 | [
"dir"
] | What does this function return? | [
"int"
] |
Boolive/Core | file/File.php | File.makeDirName | static function makeDirName($id, $size=3, $depth=3)
{
$size = intval(max(1, $size));
$depth = intval(max(1,$depth));
$id = self::clearFileName($id);
$id = str_repeat('0',max(0, $size*$depth-strlen($id))).$id;
$dir = '';
for ($i=1; $i<$depth; $i++){
$dir = ... | php | static function makeDirName($id, $size=3, $depth=3)
{
$size = intval(max(1, $size));
$depth = intval(max(1,$depth));
$id = self::clearFileName($id);
$id = str_repeat('0',max(0, $size*$depth-strlen($id))).$id;
$dir = '';
for ($i=1; $i<$depth; $i++){
$dir = ... | [
"static",
"function",
"makeDirName",
"(",
"$",
"id",
",",
"$",
"size",
"=",
"3",
",",
"$",
"depth",
"=",
"3",
")",
"{",
"$",
"size",
"=",
"intval",
"(",
"max",
"(",
"1",
",",
"$",
"size",
")",
")",
";",
"$",
"depth",
"=",
"intval",
"(",
"max"... | Создание пути на директорию из идентификатора
@param string $id Идентификатор, который режится на имена директорий. При недостаточности длины добавляются нули.
@param int $size Длина для имен директорий
@param int $depth Вложенность директорий
@return string | [
"Создание",
"пути",
"на",
"директорию",
"из",
"идентификатора"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L380-L391 | [
"id",
"size",
"depth"
] | What does this function return? | [
"string"
] |
Boolive/Core | file/File.php | File.makeVirtualDir | static function makeVirtualDir($dir, $mkdir = true)
{
if (self::$IS_WIN && mb_strlen($dir) > 248){
$dir = preg_replace('/\\\\/u','/', $dir);
$vdir = mb_substr($dir, 0, 248);
$vdir = F::splitRight('/', $vdir);
if ($vdir[0]){
$vdir = $vdir[0];
... | php | static function makeVirtualDir($dir, $mkdir = true)
{
if (self::$IS_WIN && mb_strlen($dir) > 248){
$dir = preg_replace('/\\\\/u','/', $dir);
$vdir = mb_substr($dir, 0, 248);
$vdir = F::splitRight('/', $vdir);
if ($vdir[0]){
$vdir = $vdir[0];
... | [
"static",
"function",
"makeVirtualDir",
"(",
"$",
"dir",
",",
"$",
"mkdir",
"=",
"true",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"IS_WIN",
"&&",
"mb_strlen",
"(",
"$",
"dir",
")",
">",
"248",
")",
"{",
"$",
"dir",
"=",
"preg_replace",
"(",
"'/\\\\\... | Создание виртуального диска в Windows, для увеличения лимита на длину пути к файлам
@param $dir
@param bool $mkdir
@return mixed|string | [
"Создание",
"виртуального",
"диска",
"в",
"Windows",
"для",
"увеличения",
"лимита",
"на",
"длину",
"пути",
"к",
"файлам"
] | train | https://github.com/Boolive/Core/blob/ead9668f1a6adf41656131eb608a99db6855138d/file/File.php#L399-L419 | [
"dir",
"mkdir"
] | What does this function return? | [
"mixed|string"
] |
asbamboo/http | Client.php | Client.getCurloptHttpHeader | private function getCurloptHttpHeader(RequestInterface $Request) : array
{
$options = [];
$headers = $Request->getHeaders();
foreach ($headers as $name => $values) {
$header = strtolower($name);
if ('expect' === $header) {
// curl-client does not... | php | private function getCurloptHttpHeader(RequestInterface $Request) : array
{
$options = [];
$headers = $Request->getHeaders();
foreach ($headers as $name => $values) {
$header = strtolower($name);
if ('expect' === $header) {
// curl-client does not... | [
"private",
"function",
"getCurloptHttpHeader",
"(",
"RequestInterface",
"$",
"Request",
")",
":",
"array",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"$",
"headers",
"=",
"$",
"Request",
"->",
"getHeaders",
"(",
")",
";",
"foreach",
"(",
"$",
"headers",
"a... | 返回curl option CURLOPT_HTTPHEADER
@param RequestInterface $Request
@return array | [
"返回curl",
"option",
"CURLOPT_HTTPHEADER"
] | train | https://github.com/asbamboo/http/blob/721156e29227854b787a1232eaa995ab2ccd4f25/Client.php#L170-L191 | [
"RequestInterface"
] | What does this function return? | [
"array"
] |
asbamboo/http | Client.php | Client.getCurloptHttpVersion | private function getCurloptHttpVersion(RequestInterface $Request) : int
{
switch($Request->getProtocolVersion()){
case '1.0':
return CURL_HTTP_VERSION_1_0;
case '1.1':
return CURL_HTTP_VERSION_1_1;
case '2.0':
return CURL_HT... | php | private function getCurloptHttpVersion(RequestInterface $Request) : int
{
switch($Request->getProtocolVersion()){
case '1.0':
return CURL_HTTP_VERSION_1_0;
case '1.1':
return CURL_HTTP_VERSION_1_1;
case '2.0':
return CURL_HT... | [
"private",
"function",
"getCurloptHttpVersion",
"(",
"RequestInterface",
"$",
"Request",
")",
":",
"int",
"{",
"switch",
"(",
"$",
"Request",
"->",
"getProtocolVersion",
"(",
")",
")",
"{",
"case",
"'1.0'",
":",
"return",
"CURL_HTTP_VERSION_1_0",
";",
"case",
... | 返回curl option CURLOPT_HTTP_VERSION
@param RequestInterface $Request
@return int | [
"返回curl",
"option",
"CURLOPT_HTTP_VERSION"
] | train | https://github.com/asbamboo/http/blob/721156e29227854b787a1232eaa995ab2ccd4f25/Client.php#L199-L210 | [
"RequestInterface"
] | What does this function return? | [
"int"
] |
asbamboo/http | Client.php | Client.getCurloptHeaderFunction | private function getCurloptHeaderFunction() : callable
{
return function($ch, $data){
$str = trim($data);
if('' !== $str){
if(strpos(strtolower($str), 'http/') === 0){
$status_line = $str;
... | php | private function getCurloptHeaderFunction() : callable
{
return function($ch, $data){
$str = trim($data);
if('' !== $str){
if(strpos(strtolower($str), 'http/') === 0){
$status_line = $str;
... | [
"private",
"function",
"getCurloptHeaderFunction",
"(",
")",
":",
"callable",
"{",
"return",
"function",
"(",
"$",
"ch",
",",
"$",
"data",
")",
"{",
"$",
"str",
"=",
"trim",
"(",
"$",
"data",
")",
";",
"if",
"(",
"''",
"!==",
"$",
"str",
")",
"{",
... | 返回curl option CURLOPT_HEADERFUNCTION
@return callable | [
"返回curl",
"option",
"CURLOPT_HEADERFUNCTION"
] | train | https://github.com/asbamboo/http/blob/721156e29227854b787a1232eaa995ab2ccd4f25/Client.php#L217-L235 | [] | What does this function return? | [
"callable"
] |
Vyki/mva-dbm | src/Mva/Dbm/Bridges/NetteTracy/ConnectionPanel.php | ConnectionPanel.getTab | public function getTab()
{
if (headers_sent() && !session_id()) {
return;
}
ob_start();
$count = $this->count;
$queries = $this->queries;
require __DIR__ . '/templates/ConnectionPanel.tab.phtml';
return ob_get_clean();
} | php | public function getTab()
{
if (headers_sent() && !session_id()) {
return;
}
ob_start();
$count = $this->count;
$queries = $this->queries;
require __DIR__ . '/templates/ConnectionPanel.tab.phtml';
return ob_get_clean();
} | [
"public",
"function",
"getTab",
"(",
")",
"{",
"if",
"(",
"headers_sent",
"(",
")",
"&&",
"!",
"session_id",
"(",
")",
")",
"{",
"return",
";",
"}",
"ob_start",
"(",
")",
";",
"$",
"count",
"=",
"$",
"this",
"->",
"count",
";",
"$",
"queries",
"=... | Renders tab.
@return string | [
"Renders",
"tab",
"."
] | train | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Bridges/NetteTracy/ConnectionPanel.php#L63-L74 | [] | What does this function return? | [
"string"
] |
Vyki/mva-dbm | src/Mva/Dbm/Bridges/NetteTracy/ConnectionPanel.php | ConnectionPanel.getPanel | public function getPanel()
{
ob_start();
if (!$this->count) {
return;
}
$count = $this->count;
$queries = $this->queries;
require __DIR__ . '/templates/ConnectionPanel.panel.phtml';
return ob_get_clean();
} | php | public function getPanel()
{
ob_start();
if (!$this->count) {
return;
}
$count = $this->count;
$queries = $this->queries;
require __DIR__ . '/templates/ConnectionPanel.panel.phtml';
return ob_get_clean();
} | [
"public",
"function",
"getPanel",
"(",
")",
"{",
"ob_start",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"count",
")",
"{",
"return",
";",
"}",
"$",
"count",
"=",
"$",
"this",
"->",
"count",
";",
"$",
"queries",
"=",
"$",
"this",
"->",
"q... | Renders panel.
@return string | [
"Renders",
"panel",
"."
] | train | https://github.com/Vyki/mva-dbm/blob/587d840e0620331a9f63a6867f3400a293a9d3c6/src/Mva/Dbm/Bridges/NetteTracy/ConnectionPanel.php#L80-L92 | [] | What does this function return? | [
"string"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.& | public function & SetView (\MvcCore\IView & $view) {
parent::SetView($view);
if (self::$appRoot === NULL) self::$appRoot = $this->request->GetAppRoot();
if (self::$basePath === NULL) self::$basePath = $this->request->GetBasePath();
if (self::$scriptName === NULL) self::$scriptName = ltrim($this->request->GetSc... | php | public function & SetView (\MvcCore\IView & $view) {
parent::SetView($view);
if (self::$appRoot === NULL) self::$appRoot = $this->request->GetAppRoot();
if (self::$basePath === NULL) self::$basePath = $this->request->GetBasePath();
if (self::$scriptName === NULL) self::$scriptName = ltrim($this->request->GetSc... | [
"public",
"function",
"&",
"SetView",
"(",
"\\",
"MvcCore",
"\\",
"IView",
"&",
"$",
"view",
")",
"{",
"parent",
"::",
"SetView",
"(",
"$",
"view",
")",
";",
"if",
"(",
"self",
"::",
"$",
"appRoot",
"===",
"NULL",
")",
"self",
"::",
"$",
"appRoot",... | Insert a \MvcCore\View in each helper constructing
@param \MvcCore\View|\MvcCore\IView $view
@return \MvcCore\Ext\Views\Helpers\AbstractHelper | [
"Insert",
"a",
"\\",
"MvcCore",
"\\",
"View",
"in",
"each",
"helper",
"constructing"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L150-L184 | [
"MvcCoreIView"
] | What does this function return? | [
"\\MvcCore\\Ext\\Views\\Helpers\\AbstractHelper"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.SetGlobalOptions | public static function SetGlobalOptions ($options = []) {
self::$globalOptions = array_merge(self::$globalOptions, (array) $options);
if (isset($options['assetsUrl']) && !is_null($options['assetsUrl'])) {
self::$assetsUrlCompletion = (bool) $options['assetsUrl'];
}
} | php | public static function SetGlobalOptions ($options = []) {
self::$globalOptions = array_merge(self::$globalOptions, (array) $options);
if (isset($options['assetsUrl']) && !is_null($options['assetsUrl'])) {
self::$assetsUrlCompletion = (bool) $options['assetsUrl'];
}
} | [
"public",
"static",
"function",
"SetGlobalOptions",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"self",
"::",
"$",
"globalOptions",
"=",
"array_merge",
"(",
"self",
"::",
"$",
"globalOptions",
",",
"(",
"array",
")",
"$",
"options",
")",
";",
"if",
"... | Set global static options about minifying and joining together
which can bee overwritten by single settings throw calling for
example: append() method as another param.
@see \MvcCore\Ext\Views\Helpers\Assets::$globalOptions
@param array $options whether or not to auto escape output
@return void | [
"Set",
"global",
"static",
"options",
"about",
"minifying",
"and",
"joining",
"together",
"which",
"can",
"bee",
"overwritten",
"by",
"single",
"settings",
"throw",
"calling",
"for",
"example",
":",
"append",
"()",
"method",
"as",
"another",
"param",
"."
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L195-L200 | [
"options"
] | What does this function return? | [
"void"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.getFileImprint | protected static function getFileImprint ($fullPath) {
$fileChecking = self::$globalOptions['fileChecking'];
if ($fileChecking == 'filemtime') {
return filemtime($fullPath);
} else {
return (string) call_user_func($fileChecking, $fullPath);
}
} | php | protected static function getFileImprint ($fullPath) {
$fileChecking = self::$globalOptions['fileChecking'];
if ($fileChecking == 'filemtime') {
return filemtime($fullPath);
} else {
return (string) call_user_func($fileChecking, $fullPath);
}
} | [
"protected",
"static",
"function",
"getFileImprint",
"(",
"$",
"fullPath",
")",
"{",
"$",
"fileChecking",
"=",
"self",
"::",
"$",
"globalOptions",
"[",
"'fileChecking'",
"]",
";",
"if",
"(",
"$",
"fileChecking",
"==",
"'filemtime'",
")",
"{",
"return",
"file... | Returns file modification imprint by global settings -
by `md5_file()` or by `filemtime()` - always as a string
@param string $fullPath
@return string | [
"Returns",
"file",
"modification",
"imprint",
"by",
"global",
"settings",
"-",
"by",
"md5_file",
"()",
"or",
"by",
"filemtime",
"()",
"-",
"always",
"as",
"a",
"string"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L231-L238 | [
"fullPath"
] | What does this function return? | [
"string"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.AssetUrl | public function AssetUrl ($path = '') {
$result = '';
if (self::$assetsUrlCompletion) {
// for \MvcCore\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_PACKAGE', 'PHP_PRESERVE_PACKAGE', 'PHP_PRESERVE_HDD'
$result = self::$scriptName . '?controller=controller&action=asset&path=' ... | php | public function AssetUrl ($path = '') {
$result = '';
if (self::$assetsUrlCompletion) {
// for \MvcCore\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_PACKAGE', 'PHP_PRESERVE_PACKAGE', 'PHP_PRESERVE_HDD'
$result = self::$scriptName . '?controller=controller&action=asset&path=' ... | [
"public",
"function",
"AssetUrl",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"self",
"::",
"$",
"assetsUrlCompletion",
")",
"{",
"// for \\MvcCore\\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_PACKA... | Completes font or image file URL inside CSS/JS file content.
If application compile mode is in development state or packed in strict HDD mode,
there is generated standard URL with \MvcCore\Request::$BasePath (current app location)
plus called $path param. Because those application compile modes presume by default,
tha... | [
"Completes",
"font",
"or",
"image",
"file",
"URL",
"inside",
"CSS",
"/",
"JS",
"file",
"content",
"."
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L268-L279 | [
"path"
] | What does this function return? | [
"string"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.CssJsFileUrl | public function CssJsFileUrl ($path = '') {
$result = '';
if (self::$assetsUrlCompletion) {
// for \MvcCore\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_PACKAGE', 'PHP_PRESERVE_PACKAGE', 'PHP_PRESERVE_HDD'
$result = $this->view->AssetUrl($path);
} else {
// for \MvcCore\... | php | public function CssJsFileUrl ($path = '') {
$result = '';
if (self::$assetsUrlCompletion) {
// for \MvcCore\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_PACKAGE', 'PHP_PRESERVE_PACKAGE', 'PHP_PRESERVE_HDD'
$result = $this->view->AssetUrl($path);
} else {
// for \MvcCore\... | [
"public",
"function",
"CssJsFileUrl",
"(",
"$",
"path",
"=",
"''",
")",
"{",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"self",
"::",
"$",
"assetsUrlCompletion",
")",
"{",
"// for \\MvcCore\\Application::GetInstance()->GetCompiled() equal to: 'PHAR', 'SFU', 'PHP_STRICT_P... | Completes CSS or JS file url.
If application compile mode is in development state or packed in strict HDD mode,
there is generated standard URL with \MvcCore\Request->GetBasePath() (current app location)
plus called $path param. Because those application compile modes presume by default,
that those files are placed be... | [
"Completes",
"CSS",
"or",
"JS",
"file",
"url",
"."
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L301-L311 | [
"path"
] | What does this function return? | [
"string"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems | protected function filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems ($items) {
$itemsToRenderMinimized = [];
$itemsToRenderSeparately = []; // some configurations is not possible to render together and minimized
// go for every item to complete existing combinations in attributes
foreach ($items as & $... | php | protected function filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems ($items) {
$itemsToRenderMinimized = [];
$itemsToRenderSeparately = []; // some configurations is not possible to render together and minimized
// go for every item to complete existing combinations in attributes
foreach ($items as & $... | [
"protected",
"function",
"filterItemsForNotPossibleMinifiedAndPossibleMinifiedItems",
"(",
"$",
"items",
")",
"{",
"$",
"itemsToRenderMinimized",
"=",
"[",
"]",
";",
"$",
"itemsToRenderSeparately",
"=",
"[",
"]",
";",
"// some configurations is not possible to render together... | Look for every item to render if there is any 'doNotMinify' record to render item separately
@param array $items
@return array[] $itemsToRenderMinimized $itemsToRenderSeparately | [
"Look",
"for",
"every",
"item",
"to",
"render",
"if",
"there",
"is",
"any",
"doNotMinify",
"record",
"to",
"render",
"item",
"separately"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L326-L354 | [
"items"
] | What does this function return? | [
"array[]",
"$itemsToRenderMinimized",
"$itemsToRenderSeparately"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.addFileModificationImprintToHrefUrl | protected function addFileModificationImprintToHrefUrl ($url, $path) {
$questionMarkPos = strpos($url, '?');
$separator = ($questionMarkPos === FALSE) ? '?' : '&';
$strippedUrl = $questionMarkPos !== FALSE ? substr($url, $questionMarkPos) : $url ;
$srcPath = $this->getAppRoot() . substr($strippedUrl, strlen(sel... | php | protected function addFileModificationImprintToHrefUrl ($url, $path) {
$questionMarkPos = strpos($url, '?');
$separator = ($questionMarkPos === FALSE) ? '?' : '&';
$strippedUrl = $questionMarkPos !== FALSE ? substr($url, $questionMarkPos) : $url ;
$srcPath = $this->getAppRoot() . substr($strippedUrl, strlen(sel... | [
"protected",
"function",
"addFileModificationImprintToHrefUrl",
"(",
"$",
"url",
",",
"$",
"path",
")",
"{",
"$",
"questionMarkPos",
"=",
"strpos",
"(",
"$",
"url",
",",
"'?'",
")",
";",
"$",
"separator",
"=",
"(",
"$",
"questionMarkPos",
"===",
"FALSE",
"... | Add to href URL file modification param by original file
@param string $url
@param string $path
@return string | [
"Add",
"to",
"href",
"URL",
"file",
"modification",
"param",
"by",
"original",
"file"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L362-L377 | [
"url",
"path"
] | What does this function return? | [
"string"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.getIndentString | protected function getIndentString($indent = 0) {
$indentStr = '';
if (is_numeric($indent)) {
$indInt = intval($indent);
if ($indInt > 0) {
$i = 0;
while ($i < $indInt) {
$indentStr .= "\t";
$i += 1;
}
}
} else if (is_string($indent)) {
$indentStr = $indent;
}
return $indentS... | php | protected function getIndentString($indent = 0) {
$indentStr = '';
if (is_numeric($indent)) {
$indInt = intval($indent);
if ($indInt > 0) {
$i = 0;
while ($i < $indInt) {
$indentStr .= "\t";
$i += 1;
}
}
} else if (is_string($indent)) {
$indentStr = $indent;
}
return $indentS... | [
"protected",
"function",
"getIndentString",
"(",
"$",
"indent",
"=",
"0",
")",
"{",
"$",
"indentStr",
"=",
"''",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"indent",
")",
")",
"{",
"$",
"indInt",
"=",
"intval",
"(",
"$",
"indent",
")",
";",
"if",
"(",... | Get indent string
@param string|int $indent
@return string | [
"Get",
"indent",
"string"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L384-L399 | [
"indent"
] | What does this function return? | [
"string"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.getTmpDir | protected function getTmpDir() {
if (!self::$tmpDir) {
$tmpDir = $this->getAppRoot() . self::$globalOptions['tmpDir'];
if (!\MvcCore\Application::GetInstance()->GetCompiled()) {
if (!is_dir($tmpDir)) mkdir($tmpDir, 0777, TRUE);
if (!is_writable($tmpDir)) {
try {
@chmod($tmpDir, 0777);
} ... | php | protected function getTmpDir() {
if (!self::$tmpDir) {
$tmpDir = $this->getAppRoot() . self::$globalOptions['tmpDir'];
if (!\MvcCore\Application::GetInstance()->GetCompiled()) {
if (!is_dir($tmpDir)) mkdir($tmpDir, 0777, TRUE);
if (!is_writable($tmpDir)) {
try {
@chmod($tmpDir, 0777);
} ... | [
"protected",
"function",
"getTmpDir",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"tmpDir",
")",
"{",
"$",
"tmpDir",
"=",
"$",
"this",
"->",
"getAppRoot",
"(",
")",
".",
"self",
"::",
"$",
"globalOptions",
"[",
"'tmpDir'",
"]",
";",
"if",
"("... | Return and store application document root from controller view request object
@throws \Exception
@return string | [
"Return",
"and",
"store",
"application",
"document",
"root",
"from",
"controller",
"view",
"request",
"object"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L414-L431 | [] | What does this function return? | [
"string"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.saveFileContent | protected function saveFileContent ($fullPath = '', & $fileContent = '') {
$toolClass = \MvcCore\Application::GetInstance()->GetToolClass();
$toolClass::SingleProcessWrite($fullPath, $fileContent);
@chmod($fullPath, 0766);
} | php | protected function saveFileContent ($fullPath = '', & $fileContent = '') {
$toolClass = \MvcCore\Application::GetInstance()->GetToolClass();
$toolClass::SingleProcessWrite($fullPath, $fileContent);
@chmod($fullPath, 0766);
} | [
"protected",
"function",
"saveFileContent",
"(",
"$",
"fullPath",
"=",
"''",
",",
"&",
"$",
"fileContent",
"=",
"''",
")",
"{",
"$",
"toolClass",
"=",
"\\",
"MvcCore",
"\\",
"Application",
"::",
"GetInstance",
"(",
")",
"->",
"GetToolClass",
"(",
")",
";... | Save atomically file content in full path by 1 MB to not overflow any memory limits
@param string $fullPath
@param string $fileContent
@return void | [
"Save",
"atomically",
"file",
"content",
"in",
"full",
"path",
"by",
"1",
"MB",
"to",
"not",
"overflow",
"any",
"memory",
"limits"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L439-L443 | [
"fullPath",
""
] | What does this function return? | [
"void"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.log | protected function log ($msg = '', $logType = 'debug') {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::Log($msg, $logType);
}
} | php | protected function log ($msg = '', $logType = 'debug') {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::Log($msg, $logType);
}
} | [
"protected",
"function",
"log",
"(",
"$",
"msg",
"=",
"''",
",",
"$",
"logType",
"=",
"'debug'",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"loggingAndExceptions",
")",
"{",
"\\",
"MvcCore",
"\\",
"Debug",
"::",
"Log",
"(",
"$",
"msg",
",",
"$",
"logT... | Log any render messages with optional log file name
@param string $msg
@param string $logType
@return void | [
"Log",
"any",
"render",
"messages",
"with",
"optional",
"log",
"file",
"name"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L451-L455 | [
"msg",
"logType"
] | What does this function return? | [
"void"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.warning | protected function warning ($msg) {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::BarDump('[' . get_class($this) . '] ' . $msg, \MvcCore\IDebug::DEBUG);
}
} | php | protected function warning ($msg) {
if (self::$loggingAndExceptions) {
\MvcCore\Debug::BarDump('[' . get_class($this) . '] ' . $msg, \MvcCore\IDebug::DEBUG);
}
} | [
"protected",
"function",
"warning",
"(",
"$",
"msg",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"loggingAndExceptions",
")",
"{",
"\\",
"MvcCore",
"\\",
"Debug",
"::",
"BarDump",
"(",
"'['",
".",
"get_class",
"(",
"$",
"this",
")",
".",
"'] '",
".",
"$"... | Throw exception with given message with actual helper class name before
@param string $msg
@return void | [
"Throw",
"exception",
"with",
"given",
"message",
"with",
"actual",
"helper",
"class",
"name",
"before"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L474-L478 | [
"msg"
] | What does this function return? | [
"void"
] |
mvccore/ext-view-helper-assets | src/MvcCore/Ext/Views/Helpers/Assets.php | Assets.getTmpFileFullPathByPartFilesInfo | protected function getTmpFileFullPathByPartFilesInfo ($filesGroupInfo = [], $minify = FALSE, $extension = '') {
return implode('', [
$this->getTmpDir(),
'/' . ($minify ? 'minified' : 'rendered') . '_' . $extension . '_',
md5(implode(',', $filesGroupInfo) . '_' . $minify),
'.' . $extension
]);
} | php | protected function getTmpFileFullPathByPartFilesInfo ($filesGroupInfo = [], $minify = FALSE, $extension = '') {
return implode('', [
$this->getTmpDir(),
'/' . ($minify ? 'minified' : 'rendered') . '_' . $extension . '_',
md5(implode(',', $filesGroupInfo) . '_' . $minify),
'.' . $extension
]);
} | [
"protected",
"function",
"getTmpFileFullPathByPartFilesInfo",
"(",
"$",
"filesGroupInfo",
"=",
"[",
"]",
",",
"$",
"minify",
"=",
"FALSE",
",",
"$",
"extension",
"=",
"''",
")",
"{",
"return",
"implode",
"(",
"''",
",",
"[",
"$",
"this",
"->",
"getTmpDir",... | Complete items group tmp directory file name by group source files info
@param array $filesGroupInfo
@param boolean $minify
@return string | [
"Complete",
"items",
"group",
"tmp",
"directory",
"file",
"name",
"by",
"group",
"source",
"files",
"info"
] | train | https://github.com/mvccore/ext-view-helper-assets/blob/5672575aca6d63f2340c912f9b9754bbb896d97b/src/MvcCore/Ext/Views/Helpers/Assets.php#L497-L504 | [
"filesGroupInfo",
"minify",
"extension"
] | What does this function return? | [
"string"
] |
rzajac/php-test-helper | src/Database/Driver/MySQL.php | MySQL.getTableNames | protected function getTableNames(): array
{
$dbName = $this->config[DbItf::DB_CFG_DATABASE];
$resp = $this->dbRunQuery(sprintf('SHOW FULL TABLES FROM `%s`', $dbName));
$tableAndViewNames = [];
while ($row = $resp->fetch_assoc()) {
$tableAndViewNames[] = array_change_key_... | php | protected function getTableNames(): array
{
$dbName = $this->config[DbItf::DB_CFG_DATABASE];
$resp = $this->dbRunQuery(sprintf('SHOW FULL TABLES FROM `%s`', $dbName));
$tableAndViewNames = [];
while ($row = $resp->fetch_assoc()) {
$tableAndViewNames[] = array_change_key_... | [
"protected",
"function",
"getTableNames",
"(",
")",
":",
"array",
"{",
"$",
"dbName",
"=",
"$",
"this",
"->",
"config",
"[",
"DbItf",
"::",
"DB_CFG_DATABASE",
"]",
";",
"$",
"resp",
"=",
"$",
"this",
"->",
"dbRunQuery",
"(",
"sprintf",
"(",
"'SHOW FULL T... | Return table and view names form the database.
@throws DatabaseEx
@return array | [
"Return",
"table",
"and",
"view",
"names",
"form",
"the",
"database",
"."
] | train | https://github.com/rzajac/php-test-helper/blob/37280e9ff639b25cf9413909cc080c5d8deb311c/src/Database/Driver/MySQL.php#L164-L175 | [] | What does this function return? | [
"array"
] |
QoboLtd/cakephp-translations | src/Controller/LanguagesController.php | LanguagesController.index | public function index()
{
$languages = $this->Languages->find('all');
$this->set(compact('languages'));
$this->set('_serialize', ['languages']);
} | php | public function index()
{
$languages = $this->Languages->find('all');
$this->set(compact('languages'));
$this->set('_serialize', ['languages']);
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"languages",
"=",
"$",
"this",
"->",
"Languages",
"->",
"find",
"(",
"'all'",
")",
";",
"$",
"this",
"->",
"set",
"(",
"compact",
"(",
"'languages'",
")",
")",
";",
"$",
"this",
"->",
"set",
"(",
... | Index method
@return \Cake\Http\Response|void | [
"Index",
"method"
] | train | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Controller/LanguagesController.php#L28-L33 | [] | What does this function return? | [
"\\Cake\\Http\\Response|void"
] |
QoboLtd/cakephp-translations | src/Controller/LanguagesController.php | LanguagesController.add | public function add()
{
$language = $this->Languages->newEntity();
if ($this->request->is('post')) {
$data = is_array($this->request->getData()) ? $this->request->getData() : [];
$languageEntity = $this->Languages->addOrRestore($data);
if (!empty($languageEntity))... | php | public function add()
{
$language = $this->Languages->newEntity();
if ($this->request->is('post')) {
$data = is_array($this->request->getData()) ? $this->request->getData() : [];
$languageEntity = $this->Languages->addOrRestore($data);
if (!empty($languageEntity))... | [
"public",
"function",
"add",
"(",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"Languages",
"->",
"newEntity",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"is",
"(",
"'post'",
")",
")",
"{",
"$",
"data",
"=",
"is_array",
"... | Add method
@return \Cake\Http\Response|void|null Redirects on successful add, renders view otherwise. | [
"Add",
"method"
] | train | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Controller/LanguagesController.php#L40-L56 | [] | What does this function return? | [
"\\Cake\\Http\\Response|void|null",
"Redirects",
"on",
"successful",
"add,",
"renders",
"view",
"otherwise."
] |
QoboLtd/cakephp-translations | src/Controller/LanguagesController.php | LanguagesController.delete | public function delete(string $id = null)
{
$this->request->allowMethod(['post', 'delete']);
$language = $this->Languages->get($id);
if ($this->Languages->delete($language)) {
$this->Flash->success((string)__('The language has been deleted.'));
} else {
$this-... | php | public function delete(string $id = null)
{
$this->request->allowMethod(['post', 'delete']);
$language = $this->Languages->get($id);
if ($this->Languages->delete($language)) {
$this->Flash->success((string)__('The language has been deleted.'));
} else {
$this-... | [
"public",
"function",
"delete",
"(",
"string",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"request",
"->",
"allowMethod",
"(",
"[",
"'post'",
",",
"'delete'",
"]",
")",
";",
"$",
"language",
"=",
"$",
"this",
"->",
"Languages",
"->",
"get",... | Delete method
@param string|null $id Language id.
@return \Cake\Http\Response|void|null Redirects to index.
@throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. | [
"Delete",
"method"
] | train | https://github.com/QoboLtd/cakephp-translations/blob/b488eafce71a55d517b975342487812f0d2d375a/src/Controller/LanguagesController.php#L65-L76 | [
"string"
] | What does this function return? | [
"\\Cake\\Http\\Response|void|null",
"Redirects",
"to",
"index.",
"@throws",
"\\Cake\\Datasource\\Exception\\RecordNotFoundException",
"When",
"record",
"not",
"found."
] |
graze/csv-token | src/Tokeniser/StateBuilder.php | StateBuilder.buildStates | public function buildStates(TokenStoreInterface $tokenStore)
{
$initial = new State($tokenStore, State::S_INITIAL_TOKENS);
$any = new State($tokenStore, State::S_ANY_TOKENS);
$inQuote = new State($tokenStore, State::S_IN_QUOTE_TOKENS);
$inEscape = new State($tokenStore, State::S_IN_E... | php | public function buildStates(TokenStoreInterface $tokenStore)
{
$initial = new State($tokenStore, State::S_INITIAL_TOKENS);
$any = new State($tokenStore, State::S_ANY_TOKENS);
$inQuote = new State($tokenStore, State::S_IN_QUOTE_TOKENS);
$inEscape = new State($tokenStore, State::S_IN_E... | [
"public",
"function",
"buildStates",
"(",
"TokenStoreInterface",
"$",
"tokenStore",
")",
"{",
"$",
"initial",
"=",
"new",
"State",
"(",
"$",
"tokenStore",
",",
"State",
"::",
"S_INITIAL_TOKENS",
")",
";",
"$",
"any",
"=",
"new",
"State",
"(",
"$",
"tokenSt... | @param TokenStoreInterface $tokenStore
@return State The default starting state | [
"@param",
"TokenStoreInterface",
"$tokenStore"
] | train | https://github.com/graze/csv-token/blob/ad11cfc83e7f0cae56da6844f9216bbaf5c8dcb8/src/Tokeniser/StateBuilder.php#L26-L52 | [
"TokenStoreInterface"
] | What does this function return? | [
"State",
"The",
"default",
"starting",
"state"
] |
wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.slashDirname | public static function slashDirname($dirname = null)
{
if (is_null($dirname) || empty($dirname)) {
return '';
}
return rtrim($dirname, '/ '.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
} | php | public static function slashDirname($dirname = null)
{
if (is_null($dirname) || empty($dirname)) {
return '';
}
return rtrim($dirname, '/ '.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
} | [
"public",
"static",
"function",
"slashDirname",
"(",
"$",
"dirname",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"dirname",
")",
"||",
"empty",
"(",
"$",
"dirname",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
"rtrim",
"(",
"$",
"d... | Get a dirname with one and only trailing slash
@param string $dirname
@return string | [
"Get",
"a",
"dirname",
"with",
"one",
"and",
"only",
"trailing",
"slash"
] | train | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L43-L49 | [
"dirname"
] | What does this function return? | [
"",
"string"
] |
wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.isGitClone | public static function isGitClone($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
$dir_path = self::slashDirname($path).'.git';
return (bool) (file_exists($dir_path) && is_dir($dir_path));
} | php | public static function isGitClone($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
$dir_path = self::slashDirname($path).'.git';
return (bool) (file_exists($dir_path) && is_dir($dir_path));
} | [
"public",
"static",
"function",
"isGitClone",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"path",
")",
"||",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"dir_path",
"=",
"self",
"::",
"... | Test if a path seems to be a git clone
@param string $path
@return bool | [
"Test",
"if",
"a",
"path",
"seems",
"to",
"be",
"a",
"git",
"clone"
] | train | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L57-L64 | [
"path"
] | What does this function return? | [
"",
"bool"
] |
wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.isDotPath | public static function isDotPath($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
return (bool) ('.'===substr(basename($path), 0, 1));
} | php | public static function isDotPath($path = null)
{
if (is_null($path) || empty($path)) {
return false;
}
return (bool) ('.'===substr(basename($path), 0, 1));
} | [
"public",
"static",
"function",
"isDotPath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"path",
")",
"||",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"bool",
")",
"(",
"'.'"... | Test if a filename seems to have a dot as first character
@param string $path
@return bool | [
"Test",
"if",
"a",
"filename",
"seems",
"to",
"have",
"a",
"dot",
"as",
"first",
"character"
] | train | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L72-L78 | [
"path"
] | What does this function return? | [
"",
"bool"
] |
wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.remove | public static function remove($path, $parent = true)
{
$ok = true;
if (true===self::ensureExists($path)) {
if (false===@is_dir($path) || true===is_link($path)) {
return @unlink($path);
}
$iterator = new \RecursiveIteratorIterator(
n... | php | public static function remove($path, $parent = true)
{
$ok = true;
if (true===self::ensureExists($path)) {
if (false===@is_dir($path) || true===is_link($path)) {
return @unlink($path);
}
$iterator = new \RecursiveIteratorIterator(
n... | [
"public",
"static",
"function",
"remove",
"(",
"$",
"path",
",",
"$",
"parent",
"=",
"true",
")",
"{",
"$",
"ok",
"=",
"true",
";",
"if",
"(",
"true",
"===",
"self",
"::",
"ensureExists",
"(",
"$",
"path",
")",
")",
"{",
"if",
"(",
"false",
"==="... | Try to remove a path
@param string $path
@param bool $parent
@return bool | [
"Try",
"to",
"remove",
"a",
"path"
] | train | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L117-L144 | [
"path",
"parent"
] | What does this function return? | [
"",
"bool"
] |
wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.parseIni | public static function parseIni($path)
{
if (true===@file_exists($path)) {
$data = parse_ini_file($path, true);
if ($data && !empty($data)) {
return $data;
}
}
return false;
} | php | public static function parseIni($path)
{
if (true===@file_exists($path)) {
$data = parse_ini_file($path, true);
if ($data && !empty($data)) {
return $data;
}
}
return false;
} | [
"public",
"static",
"function",
"parseIni",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"true",
"===",
"@",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"data",
"=",
"parse_ini_file",
"(",
"$",
"path",
",",
"true",
")",
";",
"if",
"(",
"$",
"d... | Read and parse a INI content file
@param $path
@return array|bool | [
"Read",
"and",
"parse",
"a",
"INI",
"content",
"file"
] | train | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L152-L161 | [
"path"
] | What does this function return? | [
"array|bool"
] |
wdbo/webdocbook | src/WebDocBook/Filesystem/Helper.php | Helper.parseJson | public static function parseJson($path)
{
if (true===@file_exists($path)) {
$ctt = file_get_contents($path);
if ($ctt!==false) {
$data = json_decode($ctt, true);
if ($data && !empty($data)) {
return $data;
}
... | php | public static function parseJson($path)
{
if (true===@file_exists($path)) {
$ctt = file_get_contents($path);
if ($ctt!==false) {
$data = json_decode($ctt, true);
if ($data && !empty($data)) {
return $data;
}
... | [
"public",
"static",
"function",
"parseJson",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"true",
"===",
"@",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
"$",
"ctt",
"=",
"file_get_contents",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"ctt",
"!==",
... | Read and parse a JSON content file
@param $path
@return bool|mixed | [
"Read",
"and",
"parse",
"a",
"JSON",
"content",
"file"
] | train | https://github.com/wdbo/webdocbook/blob/7d4e806f674b6222c9a3e85bfed34e72bc9d584e/src/WebDocBook/Filesystem/Helper.php#L169-L181 | [
"path"
] | What does this function return? | [
"bool|mixed"
] |
PhoxPHP/Glider | src/Console/Command/Migration.php | Migration.create | protected function create(Array $arguments=[])
{
$migrationsDirectory = $this->cmd->getConfigOpt('migrations_storage');
$templateTags = [];
$migrationName = $this->cmd->question('Migration filename?');
$filename = trim($migrationName);
$path = $migrationsDirectory . '/' . $filename . '.php';
i... | php | protected function create(Array $arguments=[])
{
$migrationsDirectory = $this->cmd->getConfigOpt('migrations_storage');
$templateTags = [];
$migrationName = $this->cmd->question('Migration filename?');
$filename = trim($migrationName);
$path = $migrationsDirectory . '/' . $filename . '.php';
i... | [
"protected",
"function",
"create",
"(",
"Array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"migrationsDirectory",
"=",
"$",
"this",
"->",
"cmd",
"->",
"getConfigOpt",
"(",
"'migrations_storage'",
")",
";",
"$",
"templateTags",
"=",
"[",
"]",
";",
"... | Creates a migration.
@param $arguments <Array>
@access protected
@return <void> | [
"Creates",
"a",
"migration",
"."
] | train | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Console/Command/Migration.php#L145-L177 | [
"Array"
] | What does this function return? | [
"\t<void>"
] |
PhoxPHP/Glider | src/Console/Command/Migration.php | Migration.processMigration | protected function processMigration(Array $arguments)
{
$migrationClass = $arguments[0];
$migration = Model::findByclass_name($migrationClass);
if (!$migration) {
throw new MigrationClassNotFoundException(
sprintf(
'Migration class [%s] does not exist',
$migrationClass
)
);
... | php | protected function processMigration(Array $arguments)
{
$migrationClass = $arguments[0];
$migration = Model::findByclass_name($migrationClass);
if (!$migration) {
throw new MigrationClassNotFoundException(
sprintf(
'Migration class [%s] does not exist',
$migrationClass
)
);
... | [
"protected",
"function",
"processMigration",
"(",
"Array",
"$",
"arguments",
")",
"{",
"$",
"migrationClass",
"=",
"$",
"arguments",
"[",
"0",
"]",
";",
"$",
"migration",
"=",
"Model",
"::",
"findByclass_name",
"(",
"$",
"migrationClass",
")",
";",
"if",
"... | Processes a specific migration.
@param $arguments <Array>
@access protected
@return <void> | [
"Processes",
"a",
"specific",
"migration",
"."
] | train | https://github.com/PhoxPHP/Glider/blob/17aaf3b7bb6e70ea3ae1f04e30a7690e884bf042/src/Console/Command/Migration.php#L199-L218 | [
"Array"
] | What does this function return? | [
"\t<void>"
] |
iwyg/xmlconf | src/Thapp/XmlConf/Cache/Cache.php | Cache.getCacheModificationDate | protected function getCacheModificationDate($file)
{
$storageKey = $this->getStorageKey() . '.lasmodified';
$filemtime = filemtime($file);
$lastmodified = $this->storage->has($storageKey) ? $this->storage->get($storageKey) : $filemtime - 1;
return array($filemtime, $lastmodifie... | php | protected function getCacheModificationDate($file)
{
$storageKey = $this->getStorageKey() . '.lasmodified';
$filemtime = filemtime($file);
$lastmodified = $this->storage->has($storageKey) ? $this->storage->get($storageKey) : $filemtime - 1;
return array($filemtime, $lastmodifie... | [
"protected",
"function",
"getCacheModificationDate",
"(",
"$",
"file",
")",
"{",
"$",
"storageKey",
"=",
"$",
"this",
"->",
"getStorageKey",
"(",
")",
".",
"'.lasmodified'",
";",
"$",
"filemtime",
"=",
"filemtime",
"(",
"$",
"file",
")",
";",
"$",
"lastmod... | Returns the modification date of a given file and the the
date of the last cache write.
@access protected
@return array | [
"Returns",
"the",
"modification",
"date",
"of",
"a",
"given",
"file",
"and",
"the",
"the",
"date",
"of",
"the",
"last",
"cache",
"write",
"."
] | train | https://github.com/iwyg/xmlconf/blob/1d8a657073f3fd46dacfb6bf5d173f9d5283661b/src/Thapp/XmlConf/Cache/Cache.php#L97-L104 | [
"file"
] | What does this function return? | [
"array"
] |
crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.create | public function create(array $metadata = array())
{
if (is_file($this->file)) {
return false;
}
$this->createTemporaryFolder();
file_put_contents($this->file, $this->placeholderContent($metadata), LOCK_EX);
return true;
} | php | public function create(array $metadata = array())
{
if (is_file($this->file)) {
return false;
}
$this->createTemporaryFolder();
file_put_contents($this->file, $this->placeholderContent($metadata), LOCK_EX);
return true;
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"metadata",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"createTemporaryFolder",
"(",
")",
... | Creates the file. It creates a placeholder file with some metadata on it and will
create all the temporary files and folders.
Writing without creating first will throw an exception. Creating twice will not throw an
exception but will return false. That means it is OK to call `create()` before calling
`write()`. Ideall... | [
"Creates",
"the",
"file",
".",
"It",
"creates",
"a",
"placeholder",
"file",
"with",
"some",
"metadata",
"on",
"it",
"and",
"will",
"create",
"all",
"the",
"temporary",
"files",
"and",
"folders",
"."
] | train | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L72-L82 | [
"array"
] | What does this function return? | [
"bool"
] |
crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.write | public function write($offset, $input, $limit = -1)
{
if (!is_dir($this->blocks)) {
throw new RuntimeException("Cannot write into the file");
}
$block = new BlockWriter($this->blocks . $offset, $this->tmp);
$wrote = $block->write($input, $limit);
$block->commit();... | php | public function write($offset, $input, $limit = -1)
{
if (!is_dir($this->blocks)) {
throw new RuntimeException("Cannot write into the file");
}
$block = new BlockWriter($this->blocks . $offset, $this->tmp);
$wrote = $block->write($input, $limit);
$block->commit();... | [
"public",
"function",
"write",
"(",
"$",
"offset",
",",
"$",
"input",
",",
"$",
"limit",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"this",
"->",
"blocks",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Cannot write into... | Writes content to this file. This writer must provide the $offset where this data is going to
be written. The $content maybe a stream (the output of `fopen()`) or a string. Both type of `$content`
can have a `$limit` to limit the number of bytes that are written.
@param int $offset
@param string|stream $content
@param... | [
"Writes",
"content",
"to",
"this",
"file",
".",
"This",
"writer",
"must",
"provide",
"the",
"$offset",
"where",
"this",
"data",
"is",
"going",
"to",
"be",
"written",
".",
"The",
"$content",
"maybe",
"a",
"stream",
"(",
"the",
"output",
"of",
"fopen",
"()... | train | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L122-L132 | [
"offset",
"input",
"limit"
] | What does this function return? | [
"BlockWriter",
"Return",
"the",
"BlockWriter",
"object."
] |
crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.getWroteBlocks | public function getWroteBlocks()
{
if (!is_dir($this->blocks)) {
throw new RuntimeException("cannot obtain the blocks ({$this->blocks})");
}
$files = array_filter(array_map(function($file) {
$basename = basename($file);
if (!is_numeric($basename)) {
... | php | public function getWroteBlocks()
{
if (!is_dir($this->blocks)) {
throw new RuntimeException("cannot obtain the blocks ({$this->blocks})");
}
$files = array_filter(array_map(function($file) {
$basename = basename($file);
if (!is_numeric($basename)) {
... | [
"public",
"function",
"getWroteBlocks",
"(",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"this",
"->",
"blocks",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"cannot obtain the blocks ({$this->blocks})\"",
")",
";",
"}",
"$",
"files",
"=",
"ar... | Returns all the wrote blocks of files. All the blocks are sorted by their offset.
@return array | [
"Returns",
"all",
"the",
"wrote",
"blocks",
"of",
"files",
".",
"All",
"the",
"blocks",
"are",
"sorted",
"by",
"their",
"offset",
"."
] | train | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L139-L161 | [] | What does this function return? | [
"array"
] |
crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.getMissingBlocks | public function getMissingBlocks(Array $blocks = array())
{
$missing = array();
$blocks = $blocks ? $blocks : $this->getWroteBlocks();
$last = array_shift($blocks);
if ($last['offset'] !== 0) {
$missing[] = array('offset' => 0, 'size' => $last['offset']);
}
... | php | public function getMissingBlocks(Array $blocks = array())
{
$missing = array();
$blocks = $blocks ? $blocks : $this->getWroteBlocks();
$last = array_shift($blocks);
if ($last['offset'] !== 0) {
$missing[] = array('offset' => 0, 'size' => $last['offset']);
}
... | [
"public",
"function",
"getMissingBlocks",
"(",
"Array",
"$",
"blocks",
"=",
"array",
"(",
")",
")",
"{",
"$",
"missing",
"=",
"array",
"(",
")",
";",
"$",
"blocks",
"=",
"$",
"blocks",
"?",
"$",
"blocks",
":",
"$",
"this",
"->",
"getWroteBlocks",
"("... | Returns the empty blocks in a file, if any gap is missing `finalize()`
will fail and will throw an exception.
@param $blocks Provides the list of blocks, otherwise `getWroteBlocks()` will
be called.
@return array | [
"Returns",
"the",
"empty",
"blocks",
"in",
"a",
"file",
"if",
"any",
"gap",
"is",
"missing",
"finalize",
"()",
"will",
"fail",
"and",
"will",
"throw",
"an",
"exception",
"."
] | train | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L172-L191 | [
"Array"
] | What does this function return? | [
"array"
] |
crodas/ConcurrentFileWriter | src/ConcurrentFileWriter/ConcurrentFileWriter.php | ConcurrentFileWriter.finalize | public function finalize()
{
if (!is_file($this->tmp . '.lock')) {
throw new RuntimeException("File is already completed");
}
$lock = fopen($this->tmp . '.lock', 'r+');
if (!flock($lock, LOCK_EX | LOCK_NB)) {
return false;
}
$blocks = $this-... | php | public function finalize()
{
if (!is_file($this->tmp . '.lock')) {
throw new RuntimeException("File is already completed");
}
$lock = fopen($this->tmp . '.lock', 'r+');
if (!flock($lock, LOCK_EX | LOCK_NB)) {
return false;
}
$blocks = $this-... | [
"public",
"function",
"finalize",
"(",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"this",
"->",
"tmp",
".",
"'.lock'",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"File is already completed\"",
")",
";",
"}",
"$",
"lock",
"=",
"fopen",
... | Finalizes writing a file. The finalization of a file means check that there are no gap or missing
block in a file, lock the file (so no other write may happen or another `finalize()`).
In here, after locking, all the blocks are merged into a single file. When the merging is ready,
we rename the temporary file as the f... | [
"Finalizes",
"writing",
"a",
"file",
".",
"The",
"finalization",
"of",
"a",
"file",
"means",
"check",
"that",
"there",
"are",
"no",
"gap",
"or",
"missing",
"block",
"in",
"a",
"file",
"lock",
"the",
"file",
"(",
"so",
"no",
"other",
"write",
"may",
"ha... | train | https://github.com/crodas/ConcurrentFileWriter/blob/13f88d8c2daf5fe9c70f8be6aeb3d862cd2a5e5a/src/ConcurrentFileWriter/ConcurrentFileWriter.php#L203-L238 | [] | What does this function return? | [
"bool"
] |
DimNS/MFLPHP | src/Pages/User/ActionLogin.php | ActionLogin.run | public function run($user_email, $user_pass)
{
$result = [
'error' => true,
'message' => 'Неизвестная ошибка.',
];
$loginResult = $this->di->auth->login($user_email, $user_pass, false);
if ($loginResult['error'] === false) {
$user_id = $this->d... | php | public function run($user_email, $user_pass)
{
$result = [
'error' => true,
'message' => 'Неизвестная ошибка.',
];
$loginResult = $this->di->auth->login($user_email, $user_pass, false);
if ($loginResult['error'] === false) {
$user_id = $this->d... | [
"public",
"function",
"run",
"(",
"$",
"user_email",
",",
"$",
"user_pass",
")",
"{",
"$",
"result",
"=",
"[",
"'error'",
"=>",
"true",
",",
"'message'",
"=>",
"'Неизвестная ошибка.',",
"",
"]",
";",
"$",
"loginResult",
"=",
"$",
"this",
"->",
"di",
"-... | Выполним действие
@param string $user_email Адрес электронной почты
@param string $user_pass Пароль пользователя
@return array
@version 22.04.2017
@author Дмитрий Щербаков <atomcms@ya.ru> | [
"Выполним",
"действие"
] | train | https://github.com/DimNS/MFLPHP/blob/8da06f3f9aabf1da5796f9a3cea97425b30af201/src/Pages/User/ActionLogin.php#L26-L62 | [
"user_email",
"user_pass"
] | What does this function return? | [
"array",
"",
"@version",
"22.04.2017",
"@author",
"",
"Дмитрий",
"Щербаков",
"<atomcms@ya.ru>"
] |
nyeholt/silverstripe-performant | code/model/DataObjectNode.php | DataObjectNode.isSection | public function isSection() {
if ($this->isCurrent()) {
return true;
}
$ancestors = $this->getAncestors();
if (Director::get_current_page() instanceof Page) {
$node = Director::get_current_page()->asMenuItem();
if ($node) {
$ancestors = $node->getAncestors();
return $ancestors && in_array($this... | php | public function isSection() {
if ($this->isCurrent()) {
return true;
}
$ancestors = $this->getAncestors();
if (Director::get_current_page() instanceof Page) {
$node = Director::get_current_page()->asMenuItem();
if ($node) {
$ancestors = $node->getAncestors();
return $ancestors && in_array($this... | [
"public",
"function",
"isSection",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isCurrent",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"ancestors",
"=",
"$",
"this",
"->",
"getAncestors",
"(",
")",
";",
"if",
"(",
"Director",
"::",
"get_... | Check if this page is in the currently active section (e.g. it is either current or one of its children is
currently being viewed).
@return bool | [
"Check",
"if",
"this",
"page",
"is",
"in",
"the",
"currently",
"active",
"section",
"(",
"e",
".",
"g",
".",
"it",
"is",
"either",
"current",
"or",
"one",
"of",
"its",
"children",
"is",
"currently",
"being",
"viewed",
")",
"."
] | train | https://github.com/nyeholt/silverstripe-performant/blob/2c9d2570ddf4a43ced38487184da4de453a4863c/code/model/DataObjectNode.php#L70-L84 | [] | What does this function return? | [
"bool"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.