repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
dappur/dappurware | app/src/Dappurware/Cookies.php | Cookies.modifyRequestCookie | public function modifyRequestCookie($request, $name, $value = null)
{
$modify = function (Cookie $cookie) {
$value = $cookie->getValue();
return $cookie->withValue($value);
};
$request = FigRequestCookies::modify($request, $name, $modify);
return $request;
... | php | public function modifyRequestCookie($request, $name, $value = null)
{
$modify = function (Cookie $cookie) {
$value = $cookie->getValue();
return $cookie->withValue($value);
};
$request = FigRequestCookies::modify($request, $name, $modify);
return $request;
... | [
"public",
"function",
"modifyRequestCookie",
"(",
"$",
"request",
",",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"modify",
"=",
"function",
"(",
"Cookie",
"$",
"cookie",
")",
"{",
"$",
"value",
"=",
"$",
"cookie",
"->",
"getValue",
... | Modify Request Cookie | [
"Modify",
"Request",
"Cookie"
] | train | https://github.com/dappur/dappurware/blob/453ca999047693a1f009618820f8497a287f6a05/app/src/Dappurware/Cookies.php#L98-L109 |
kecik-framework/kecik | Kecik/Request.php | Request.get | public static function get( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$_GET[ $name ] = $value;
}
if ( empty( $name ) ) {
return $_GET;
} else {
return ( isset( $_GET[ $name ] ) ) ? $_GET[ $name ] : NULL;
}
} | php | public static function get( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$_GET[ $name ] = $value;
}
if ( empty( $name ) ) {
return $_GET;
} else {
return ( isset( $_GET[ $name ] ) ) ? $_GET[ $name ] : NULL;
}
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"_GET",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"}",
"if",
"(... | Get/Set variable from Get Method
@param string $name
@param string $value
@return mixed|null | [
"Get",
"/",
"Set",
"variable",
"from",
"Get",
"Method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L38-L50 |
kecik-framework/kecik | Kecik/Request.php | Request.post | public static function post( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$_POST[ $name ] = $value;
}
if ( empty( $name ) ) {
return $_POST;
} else {
return ( isset( $_POST[ $name ] ) ) ? $_POST[ $name ] : NULL;
}
} | php | public static function post( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$_POST[ $name ] = $value;
}
if ( empty( $name ) ) {
return $_POST;
} else {
return ( isset( $_POST[ $name ] ) ) ? $_POST[ $name ] : NULL;
}
} | [
"public",
"static",
"function",
"post",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"_POST",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"}",
"if",
... | Get/Set variable from Post Method
@param string $name
@param string $value
@return mixed|null | [
"Get",
"/",
"Set",
"variable",
"from",
"Post",
"Method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L60-L72 |
kecik-framework/kecik | Kecik/Request.php | Request.put | public static function put( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_PUT'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_PUT'] ) ) ? $GLOBALS['_PUT'] : NULL;
} else {
return ( isset( $GLOBALS['_PUT'][ $name ] ) ) ? $GLOBALS['_PUT'][ $name ] : NULL;
... | php | public static function put( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_PUT'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_PUT'] ) ) ? $GLOBALS['_PUT'] : NULL;
} else {
return ( isset( $GLOBALS['_PUT'][ $name ] ) ) ? $GLOBALS['_PUT'][ $name ] : NULL;
... | [
"public",
"static",
"function",
"put",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"GLOBALS",
"[",
"'_PUT'",
"]",
"[",
"$",
"name",
"]",
"=",
"$",
"value... | Get/Set variable from Put Method
@param string $name
@param string $value
@return mixed|null | [
"Get",
"/",
"Set",
"variable",
"from",
"Put",
"Method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L82-L94 |
kecik-framework/kecik | Kecik/Request.php | Request.delete | public static function delete( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_DELETE'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_DELETE'] ) ) ? $GLOBALS['_DELETE'] : NULL;
} else {
return ( isset( $GLOBALS['_DELETE'][ $name ] ) ) ? $GLOBALS['_DELETE'][... | php | public static function delete( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_DELETE'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_DELETE'] ) ) ? $GLOBALS['_DELETE'] : NULL;
} else {
return ( isset( $GLOBALS['_DELETE'][ $name ] ) ) ? $GLOBALS['_DELETE'][... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"GLOBALS",
"[",
"'_DELETE'",
"]",
"[",
"$",
"name",
"]",
"=",
"$",
... | Get/Set variable from Delete Method
@param string $name
@param string $value
@return mixed|null | [
"Get",
"/",
"Set",
"variable",
"from",
"Delete",
"Method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L104-L116 |
kecik-framework/kecik | Kecik/Request.php | Request.patch | public static function patch( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_PATCH'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_PATCH'] ) ) ? $GLOBALS['_PATCH'] : NULL;
} else {
return ( isset( $GLOBALS['_PATCH'][ $name ] ) ) ? $GLOBALS['_PATCH'][ $name... | php | public static function patch( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_PATCH'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_PATCH'] ) ) ? $GLOBALS['_PATCH'] : NULL;
} else {
return ( isset( $GLOBALS['_PATCH'][ $name ] ) ) ? $GLOBALS['_PATCH'][ $name... | [
"public",
"static",
"function",
"patch",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"GLOBALS",
"[",
"'_PATCH'",
"]",
"[",
"$",
"name",
"]",
"=",
"$",
"v... | Get/Set variable from Patch Method
@param string $name
@param string $value
@return mixed|null | [
"Get",
"/",
"Set",
"variable",
"from",
"Patch",
"Method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L126-L138 |
kecik-framework/kecik | Kecik/Request.php | Request.options | public static function options( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_OPTIONS'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_OPTIONS'] ) ) ? $GLOBALS['_OPTIONS'] : NULL;
} else {
return ( isset( $GLOBALS['_OPTIONS'][ $name ] ) ) ? $GLOBALS['_OPTI... | php | public static function options( $name = '', $value = '' ) {
if ( ! empty( $value ) ) {
$GLOBALS['_OPTIONS'][ $name ] = $value;
}
if ( empty( $name ) ) {
return ( isset( $GLOBALS['_OPTIONS'] ) ) ? $GLOBALS['_OPTIONS'] : NULL;
} else {
return ( isset( $GLOBALS['_OPTIONS'][ $name ] ) ) ? $GLOBALS['_OPTI... | [
"public",
"static",
"function",
"options",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"GLOBALS",
"[",
"'_OPTIONS'",
"]",
"[",
"$",
"name",
"]",
"=",
"$",
... | Get/Set variable from Options Method
@param string $name
@param string $value
@return mixed|null | [
"Get",
"/",
"Set",
"variable",
"from",
"Options",
"Method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L148-L160 |
kecik-framework/kecik | Kecik/Request.php | UploadFile.move | public function move( $destination, $newName = '' ) {
$source = $this->file['tmp_name'];
if ( $destination != '' && substr( $destination, - 1 ) != '/' ) {
$destination .= '/';
}
if ( ! empty( $newName ) ) {
$target = $destination . $newName;
} else {
$target = $destination . $this->file['name'];
... | php | public function move( $destination, $newName = '' ) {
$source = $this->file['tmp_name'];
if ( $destination != '' && substr( $destination, - 1 ) != '/' ) {
$destination .= '/';
}
if ( ! empty( $newName ) ) {
$target = $destination . $newName;
} else {
$target = $destination . $this->file['name'];
... | [
"public",
"function",
"move",
"(",
"$",
"destination",
",",
"$",
"newName",
"=",
"''",
")",
"{",
"$",
"source",
"=",
"$",
"this",
"->",
"file",
"[",
"'tmp_name'",
"]",
";",
"if",
"(",
"$",
"destination",
"!=",
"''",
"&&",
"substr",
"(",
"$",
"desti... | Move file from temporary to actual location
@param $destination
@param string $newName
@return string
@throws FileException | [
"Move",
"file",
"from",
"temporary",
"to",
"actual",
"location"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Request.php#L225-L255 |
heidelpay/PhpDoc | src/phpDocumentor/Transformer/Router/Rule.php | Rule.translateToUrlEncodedPath | protected function translateToUrlEncodedPath($generatedPathAsUtf8)
{
$iso88591Path = explode('/', $generatedPathAsUtf8);
foreach ($iso88591Path as &$part) {
// identify and skip schemes
if (substr($part, -1) == ':') {
continue;
}
// o... | php | protected function translateToUrlEncodedPath($generatedPathAsUtf8)
{
$iso88591Path = explode('/', $generatedPathAsUtf8);
foreach ($iso88591Path as &$part) {
// identify and skip schemes
if (substr($part, -1) == ':') {
continue;
}
// o... | [
"protected",
"function",
"translateToUrlEncodedPath",
"(",
"$",
"generatedPathAsUtf8",
")",
"{",
"$",
"iso88591Path",
"=",
"explode",
"(",
"'/'",
",",
"$",
"generatedPathAsUtf8",
")",
";",
"foreach",
"(",
"$",
"iso88591Path",
"as",
"&",
"$",
"part",
")",
"{",
... | Translates the provided path, with UTF-8 characters, into a web- and windows-safe variant.
Windows does not support the use of UTF-8 characters on their file-system. In order to be sure that both
the web and windows can support the given filename we decode the UTF-8 characters and then url encode them
so that they wil... | [
"Translates",
"the",
"provided",
"path",
"with",
"UTF",
"-",
"8",
"characters",
"into",
"a",
"web",
"-",
"and",
"windows",
"-",
"safe",
"variant",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Transformer/Router/Rule.php#L88-L110 |
inhere/php-librarys | src/Traits/LogProfileTrait.php | LogProfileTrait.profile | public function profile($name, array $context = [], $category = 'application')
{
$data = [
'_profile_stats' => [
'startTime' => microtime(true),
'startMem' => memory_get_usage(),
],
'_profile_start' => $context,
'_profile_end' =... | php | public function profile($name, array $context = [], $category = 'application')
{
$data = [
'_profile_stats' => [
'startTime' => microtime(true),
'startMem' => memory_get_usage(),
],
'_profile_start' => $context,
'_profile_end' =... | [
"public",
"function",
"profile",
"(",
"$",
"name",
",",
"array",
"$",
"context",
"=",
"[",
"]",
",",
"$",
"category",
"=",
"'application'",
")",
"{",
"$",
"data",
"=",
"[",
"'_profile_stats'",
"=>",
"[",
"'startTime'",
"=>",
"microtime",
"(",
"true",
"... | mark data analysis start
@param $name
@param array $context
@param string $category | [
"mark",
"data",
"analysis",
"start"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LogProfileTrait.php#L36-L49 |
inhere/php-librarys | src/Traits/LogProfileTrait.php | LogProfileTrait.profileEnd | public function profileEnd($title = null, array $context = [])
{
if (!$this->activeKey) {
return;
}
list($category, $name) = explode('|', $this->activeKey);
if (isset($this->profiles[$category][$name])) {
$data = $this->profiles[$category][$name];
... | php | public function profileEnd($title = null, array $context = [])
{
if (!$this->activeKey) {
return;
}
list($category, $name) = explode('|', $this->activeKey);
if (isset($this->profiles[$category][$name])) {
$data = $this->profiles[$category][$name];
... | [
"public",
"function",
"profileEnd",
"(",
"$",
"title",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"activeKey",
")",
"{",
"return",
";",
"}",
"list",
"(",
"$",
"category",
",",
"$",
"name... | mark data analysis end
@param string|null $title
@param array $context | [
"mark",
"data",
"analysis",
"end"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/LogProfileTrait.php#L56-L76 |
DevGroup-ru/yii2-measure | src/actions/UpdateAction.php | UpdateAction.run | public function run($id = null)
{
if ($id === null) {
$model = new Measure;
$model->loadDefaultValues();
} else {
$model = $this->controller->findModel($id);
}
$isLoaded = $model->load(\Yii::$app->request->post());
$hasAccess = ($model->isN... | php | public function run($id = null)
{
if ($id === null) {
$model = new Measure;
$model->loadDefaultValues();
} else {
$model = $this->controller->findModel($id);
}
$isLoaded = $model->load(\Yii::$app->request->post());
$hasAccess = ($model->isN... | [
"public",
"function",
"run",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"model",
"=",
"new",
"Measure",
";",
"$",
"model",
"->",
"loadDefaultValues",
"(",
")",
";",
"}",
"else",
"{",
"$",
"model",
... | Updates an existing Measure model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Measure",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | train | https://github.com/DevGroup-ru/yii2-measure/blob/1d41a4af6ad3f2e34cabc32fa1c97bfd3643269c/src/actions/UpdateAction.php#L22-L47 |
mothership-ec/composer | src/Composer/IO/ConsoleIO.php | ConsoleIO.overwrite | public function overwrite($messages, $newline = true, $size = null)
{
$this->doOverwrite($messages, $newline, $size, false);
} | php | public function overwrite($messages, $newline = true, $size = null)
{
$this->doOverwrite($messages, $newline, $size, false);
} | [
"public",
"function",
"overwrite",
"(",
"$",
"messages",
",",
"$",
"newline",
"=",
"true",
",",
"$",
"size",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"doOverwrite",
"(",
"$",
"messages",
",",
"$",
"newline",
",",
"$",
"size",
",",
"false",
")",
";... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/IO/ConsoleIO.php#L142-L145 |
mothership-ec/composer | src/Composer/IO/ConsoleIO.php | ConsoleIO.overwriteError | public function overwriteError($messages, $newline = true, $size = null)
{
$this->doOverwrite($messages, $newline, $size, true);
} | php | public function overwriteError($messages, $newline = true, $size = null)
{
$this->doOverwrite($messages, $newline, $size, true);
} | [
"public",
"function",
"overwriteError",
"(",
"$",
"messages",
",",
"$",
"newline",
"=",
"true",
",",
"$",
"size",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"doOverwrite",
"(",
"$",
"messages",
",",
"$",
"newline",
",",
"$",
"size",
",",
"true",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/IO/ConsoleIO.php#L150-L153 |
mothership-ec/composer | src/Composer/IO/ConsoleIO.php | ConsoleIO.askConfirmation | public function askConfirmation($question, $default = true)
{
$output = $this->output;
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
/** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */
$helper = $this->h... | php | public function askConfirmation($question, $default = true)
{
$output = $this->output;
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
/** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */
$helper = $this->h... | [
"public",
"function",
"askConfirmation",
"(",
"$",
"question",
",",
"$",
"default",
"=",
"true",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"output",
";",
"if",
"(",
"$",
"output",
"instanceof",
"ConsoleOutputInterface",
")",
"{",
"$",
"output",
"=... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/IO/ConsoleIO.php#L217-L230 |
mothership-ec/composer | src/Composer/IO/ConsoleIO.php | ConsoleIO.askAndHideAnswer | public function askAndHideAnswer($question)
{
$this->writeError($question, false);
return \Seld\CliPrompt\CliPrompt::hiddenPrompt(true);
} | php | public function askAndHideAnswer($question)
{
$this->writeError($question, false);
return \Seld\CliPrompt\CliPrompt::hiddenPrompt(true);
} | [
"public",
"function",
"askAndHideAnswer",
"(",
"$",
"question",
")",
"{",
"$",
"this",
"->",
"writeError",
"(",
"$",
"question",
",",
"false",
")",
";",
"return",
"\\",
"Seld",
"\\",
"CliPrompt",
"\\",
"CliPrompt",
"::",
"hiddenPrompt",
"(",
"true",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/IO/ConsoleIO.php#L255-L260 |
technote-space/wordpress-plugin-base | src/classes/models/lib/loader.php | Loader.initialize | protected function initialize() {
$scan_dir = $this->app->define->lib_src_dir . DS . 'classes' . DS . 'models' . DS . 'lib' . DS . 'loader';
$namespace = $this->app->define->lib_namespace . '\\Classes\\Models\\Lib\\Loader\\';
foreach ( $this->app->utility->scan_dir_namespace_class( $scan_dir, false, $namespace )... | php | protected function initialize() {
$scan_dir = $this->app->define->lib_src_dir . DS . 'classes' . DS . 'models' . DS . 'lib' . DS . 'loader';
$namespace = $this->app->define->lib_namespace . '\\Classes\\Models\\Lib\\Loader\\';
foreach ( $this->app->utility->scan_dir_namespace_class( $scan_dir, false, $namespace )... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"scan_dir",
"=",
"$",
"this",
"->",
"app",
"->",
"define",
"->",
"lib_src_dir",
".",
"DS",
".",
"'classes'",
".",
"DS",
".",
"'models'",
".",
"DS",
".",
"'lib'",
".",
"DS",
".",
"'loader'",
"... | initialize | [
"initialize"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/loader.php#L47-L64 |
InactiveProjects/limoncello-illuminate | app/Database/Migrations/MigratePosts.php | MigratePosts.apply | public function apply()
{
Schema::create(Model::TABLE_NAME, function (Blueprint $table) {
$table->increments(Model::FIELD_ID);
$table->unsignedInteger(Model::FIELD_ID_BOARD);
$table->unsignedInteger(Model::FIELD_ID_USER);
$table->string(Model::FIELD_TITLE, Mod... | php | public function apply()
{
Schema::create(Model::TABLE_NAME, function (Blueprint $table) {
$table->increments(Model::FIELD_ID);
$table->unsignedInteger(Model::FIELD_ID_BOARD);
$table->unsignedInteger(Model::FIELD_ID_USER);
$table->string(Model::FIELD_TITLE, Mod... | [
"public",
"function",
"apply",
"(",
")",
"{",
"Schema",
"::",
"create",
"(",
"Model",
"::",
"TABLE_NAME",
",",
"function",
"(",
"Blueprint",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"increments",
"(",
"Model",
"::",
"FIELD_ID",
")",
";",
"$",
"table... | @inheritdoc
@SuppressWarnings(PHPMD.StaticAccess) | [
"@inheritdoc"
] | train | https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Database/Migrations/MigratePosts.php#L18-L37 |
Laralum/Users | src/Models/User.php | User.avatar | public function avatar($size = 100)
{
/*
if(File::exists(public_path('/avatars'.'/'.md5($this->email)))){
return asset('/avatars'.'/'.md5($this->email));
}
return "https://tracker.moodle.org/secure/attachment/30912/f3.png";
*/
// Get gavatar avatar
... | php | public function avatar($size = 100)
{
/*
if(File::exists(public_path('/avatars'.'/'.md5($this->email)))){
return asset('/avatars'.'/'.md5($this->email));
}
return "https://tracker.moodle.org/secure/attachment/30912/f3.png";
*/
// Get gavatar avatar
... | [
"public",
"function",
"avatar",
"(",
"$",
"size",
"=",
"100",
")",
"{",
"/*\n if(File::exists(public_path('/avatars'.'/'.md5($this->email)))){\n return asset('/avatars'.'/'.md5($this->email));\n }\n return \"https://tracker.moodle.org/secure/attachment/30912/f3.pn... | Returns the user avatar. | [
"Returns",
"the",
"user",
"avatar",
"."
] | train | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Models/User.php#L47-L63 |
vuer/token | src/Traits/Tokenable.php | Tokenable.getLastToken | public function getLastToken($type, $key = 'type')
{
return $this->token()->orderBy('tokens.created_at', 'desc')->where($key, $type)->first();
} | php | public function getLastToken($type, $key = 'type')
{
return $this->token()->orderBy('tokens.created_at', 'desc')->where($key, $type)->first();
} | [
"public",
"function",
"getLastToken",
"(",
"$",
"type",
",",
"$",
"key",
"=",
"'type'",
")",
"{",
"return",
"$",
"this",
"->",
"token",
"(",
")",
"->",
"orderBy",
"(",
"'tokens.created_at'",
",",
"'desc'",
")",
"->",
"where",
"(",
"$",
"key",
",",
"$... | Get the last Token by the type.
@param string $type
@param string $key
@return Token | [
"Get",
"the",
"last",
"Token",
"by",
"the",
"type",
"."
] | train | https://github.com/vuer/token/blob/096ba1820c850d5e29062a304bdc399789388714/src/Traits/Tokenable.php#L55-L58 |
vuer/token | src/Traits/Tokenable.php | Tokenable.checkToken | public function checkToken($token)
{
return (bool) $this->token()->where('token', $token)->where('expiration_date', '>', Carbon::now())->count();
} | php | public function checkToken($token)
{
return (bool) $this->token()->where('token', $token)->where('expiration_date', '>', Carbon::now())->count();
} | [
"public",
"function",
"checkToken",
"(",
"$",
"token",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"token",
"(",
")",
"->",
"where",
"(",
"'token'",
",",
"$",
"token",
")",
"->",
"where",
"(",
"'expiration_date'",
",",
"'>'",
",",
"Carbo... | Check the token.
@param string $token
@return boolean | [
"Check",
"the",
"token",
"."
] | train | https://github.com/vuer/token/blob/096ba1820c850d5e29062a304bdc399789388714/src/Traits/Tokenable.php#L76-L79 |
vuer/token | src/Traits/Tokenable.php | Tokenable.createToken | public function createToken($type, $expire = 60, $length = 48, $customProperties = null)
{
return $this->token()->create([
'token' => $this->generateTokenString($length),
'expiration_date' => Carbon::now()->addMinutes($expire),
'type' => $type,
... | php | public function createToken($type, $expire = 60, $length = 48, $customProperties = null)
{
return $this->token()->create([
'token' => $this->generateTokenString($length),
'expiration_date' => Carbon::now()->addMinutes($expire),
'type' => $type,
... | [
"public",
"function",
"createToken",
"(",
"$",
"type",
",",
"$",
"expire",
"=",
"60",
",",
"$",
"length",
"=",
"48",
",",
"$",
"customProperties",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"token",
"(",
")",
"->",
"create",
"(",
"[",
"'to... | Create new token and return the instance.
@param string $type token type
@param integer $expire expire in minutes
@param integer $length key length
@return Token | [
"Create",
"new",
"token",
"and",
"return",
"the",
"instance",
"."
] | train | https://github.com/vuer/token/blob/096ba1820c850d5e29062a304bdc399789388714/src/Traits/Tokenable.php#L99-L107 |
ouropencode/dachi | src/Router.php | Router.route | public static function route() {
if(defined('DACHI_CLI'))
return false;
$uri = Request::getFullUri();
$route = self::findRoute($uri);
self::performRoute($route);
return Template::render();
} | php | public static function route() {
if(defined('DACHI_CLI'))
return false;
$uri = Request::getFullUri();
$route = self::findRoute($uri);
self::performRoute($route);
return Template::render();
} | [
"public",
"static",
"function",
"route",
"(",
")",
"{",
"if",
"(",
"defined",
"(",
"'DACHI_CLI'",
")",
")",
"return",
"false",
";",
"$",
"uri",
"=",
"Request",
"::",
"getFullUri",
"(",
")",
";",
"$",
"route",
"=",
"self",
"::",
"findRoute",
"(",
"$",... | Performs routing based upon the loaded routing information and the incoming request
@return null | [
"Performs",
"routing",
"based",
"upon",
"the",
"loaded",
"routing",
"information",
"and",
"the",
"incoming",
"request"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Router.php#L28-L37 |
ouropencode/dachi | src/Router.php | Router.findRoute | public static function findRoute($uri) {
if(self::$routes === array())
self::load();
$count = count($uri);
$position = &self::$routes;
for($i = 0; $i < $count; $i++) {
if($i == $count - 1) {
if(isset($position[$uri[$i]]) && isset($position[$uri[$i]]["route"])) {
return $position[$uri[$i]]["rout... | php | public static function findRoute($uri) {
if(self::$routes === array())
self::load();
$count = count($uri);
$position = &self::$routes;
for($i = 0; $i < $count; $i++) {
if($i == $count - 1) {
if(isset($position[$uri[$i]]) && isset($position[$uri[$i]]["route"])) {
return $position[$uri[$i]]["rout... | [
"public",
"static",
"function",
"findRoute",
"(",
"$",
"uri",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"routes",
"===",
"array",
"(",
")",
")",
"self",
"::",
"load",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"uri",
")",
";",
"$",
"pos... | Find and process a valid route from the uri
@internal
@param array $uri Array of uri parts (split by /)
@throws ValidRouteNotFoundException
@return array | [
"Find",
"and",
"process",
"a",
"valid",
"route",
"from",
"the",
"uri"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Router.php#L46-L74 |
ouropencode/dachi | src/Router.php | Router.performRoute | public static function performRoute($route) {
$api_mode = isset($route["api-mode"]);
Request::setRequestVariables($route["variables"], $api_mode);
$controller = new $route["class"];
$response = $controller->$route["method"]();
if(!Request::isAjax() && !Request::isAPI() && isset($route["render-path"])) {
... | php | public static function performRoute($route) {
$api_mode = isset($route["api-mode"]);
Request::setRequestVariables($route["variables"], $api_mode);
$controller = new $route["class"];
$response = $controller->$route["method"]();
if(!Request::isAjax() && !Request::isAPI() && isset($route["render-path"])) {
... | [
"public",
"static",
"function",
"performRoute",
"(",
"$",
"route",
")",
"{",
"$",
"api_mode",
"=",
"isset",
"(",
"$",
"route",
"[",
"\"api-mode\"",
"]",
")",
";",
"Request",
"::",
"setRequestVariables",
"(",
"$",
"route",
"[",
"\"variables\"",
"]",
",",
... | Perform routing based upon the discovered route
@internal
@param array $route Format: array(class, method, uri_variables)
@see Request::setRequestVariables()
@return mixed Return value of last route to be executed | [
"Perform",
"routing",
"based",
"upon",
"the",
"discovered",
"route"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Router.php#L83-L101 |
digipolisgent/robo-digipolis-general | src/Common/DigipolisPropertiesAware.php | DigipolisPropertiesAware.readProperties | public function readProperties($root = null, $web = null, $vendor = null)
{
if (!$this->propertiesRead) {
if (is_null($root)) {
if (is_callable([$this, 'taskDetermineProjectRoot'])) {
$this->taskDetermineProjectRoot()->run();
}
... | php | public function readProperties($root = null, $web = null, $vendor = null)
{
if (!$this->propertiesRead) {
if (is_null($root)) {
if (is_callable([$this, 'taskDetermineProjectRoot'])) {
$this->taskDetermineProjectRoot()->run();
}
... | [
"public",
"function",
"readProperties",
"(",
"$",
"root",
"=",
"null",
",",
"$",
"web",
"=",
"null",
",",
"$",
"vendor",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"propertiesRead",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"root",
... | Read the properties from the YAML files. Determine project and web root
if needed.
@param string|null $root
The path to the project root, if null the project root will be
determined by taskDetermineProjectRoot().
@param string|null $web
The path to the project web root, if null the web root will be
determined by taskD... | [
"Read",
"the",
"properties",
"from",
"the",
"YAML",
"files",
".",
"Determine",
"project",
"and",
"web",
"root",
"if",
"needed",
"."
] | train | https://github.com/digipolisgent/robo-digipolis-general/blob/66f0806c9ed7bd4e5aaf3f57ae1363f6aaae7cd9/src/Common/DigipolisPropertiesAware.php#L27-L48 |
nabab/bbn | src/bbn/mvc/output.php | output.run | public function run()
{
if ( \count((array)$this->obj) === 0 ){
header('HTTP/1.0 404 Not Found');
exit();
}
if ( $this->mode === 'cli' ){
if ( !headers_sent() && !$this->obj->content ){
exit('No output...');
}
if ( $this->obj->content ){
echo $this->obj->cont... | php | public function run()
{
if ( \count((array)$this->obj) === 0 ){
header('HTTP/1.0 404 Not Found');
exit();
}
if ( $this->mode === 'cli' ){
if ( !headers_sent() && !$this->obj->content ){
exit('No output...');
}
if ( $this->obj->content ){
echo $this->obj->cont... | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"\\",
"count",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"obj",
")",
"===",
"0",
")",
"{",
"header",
"(",
"'HTTP/1.0 404 Not Found'",
")",
";",
"exit",
"(",
")",
";",
"}",
"if",
"(",
"$",
... | Outputs the result.
@return void | [
"Outputs",
"the",
"result",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/mvc/output.php#L26-L199 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionTemplatesInsert | public function sectionTemplatesInsert()
{
$filename = arg('name');
$filter = new Eresus_FS_NameFilter();
$filename = $filter->filter($filename);
if ('' === $filename)
{
$filename = uniqid();
}
if ($filename != arg('name'))
{
Eresus_Kernel::app()->getPage()->addErrorMessage(
... | php | public function sectionTemplatesInsert()
{
$filename = arg('name');
$filter = new Eresus_FS_NameFilter();
$filename = $filter->filter($filename);
if ('' === $filename)
{
$filename = uniqid();
}
if ($filename != arg('name'))
{
Eresus_Kernel::app()->getPage()->addErrorMessage(
... | [
"public",
"function",
"sectionTemplatesInsert",
"(",
")",
"{",
"$",
"filename",
"=",
"arg",
"(",
"'name'",
")",
";",
"$",
"filter",
"=",
"new",
"Eresus_FS_NameFilter",
"(",
")",
";",
"$",
"filename",
"=",
"$",
"filter",
"->",
"filter",
"(",
"$",
"filenam... | ???
@return void | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L94-L114 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionTemplatesUpdate | public function sectionTemplatesUpdate()
{
$templates = Templates::getInstance();
$templates->update(arg('name'), '', arg('code'), arg('desc'));
HTTP::redirect(arg('submitURL'));
} | php | public function sectionTemplatesUpdate()
{
$templates = Templates::getInstance();
$templates->update(arg('name'), '', arg('code'), arg('desc'));
HTTP::redirect(arg('submitURL'));
} | [
"public",
"function",
"sectionTemplatesUpdate",
"(",
")",
"{",
"$",
"templates",
"=",
"Templates",
"::",
"getInstance",
"(",
")",
";",
"$",
"templates",
"->",
"update",
"(",
"arg",
"(",
"'name'",
")",
",",
"''",
",",
"arg",
"(",
"'code'",
")",
",",
"ar... | ???
@return void | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L120-L125 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionTemplatesDelete | public function sectionTemplatesDelete()
{
$templates = Templates::getInstance();
$templates->delete(arg('delete'));
HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
} | php | public function sectionTemplatesDelete()
{
$templates = Templates::getInstance();
$templates->delete(arg('delete'));
HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
} | [
"public",
"function",
"sectionTemplatesDelete",
"(",
")",
"{",
"$",
"templates",
"=",
"Templates",
"::",
"getInstance",
"(",
")",
";",
"$",
"templates",
"->",
"delete",
"(",
"arg",
"(",
"'delete'",
")",
")",
";",
"HTTP",
"::",
"redirect",
"(",
"Eresus_Kern... | ???
@return void | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L131-L136 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionTemplatesAdd | public function sectionTemplatesAdd()
{
$form = array(
'name' => 'addForm',
'caption' => Eresus_Kernel::app()->getPage()->title.ADM_T_DIV.ADM_ADD,
'width' => '100%',
'fields' => array (
array('type'=>'hidden','name'=>'action', 'value'=>'insert'),
array('type'=>'hidden','name'=>'section', 'value'=... | php | public function sectionTemplatesAdd()
{
$form = array(
'name' => 'addForm',
'caption' => Eresus_Kernel::app()->getPage()->title.ADM_T_DIV.ADM_ADD,
'width' => '100%',
'fields' => array (
array('type'=>'hidden','name'=>'action', 'value'=>'insert'),
array('type'=>'hidden','name'=>'section', 'value'=... | [
"public",
"function",
"sectionTemplatesAdd",
"(",
")",
"{",
"$",
"form",
"=",
"array",
"(",
"'name'",
"=>",
"'addForm'",
",",
"'caption'",
"=>",
"Eresus_Kernel",
"::",
"app",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"title",
".",
"ADM_T_DIV",
".",
"ADM... | ???
@return string HTML | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L142-L162 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionTemplatesEdit | public function sectionTemplatesEdit()
{
$templates = Templates::getInstance();
$item = $templates->get(arg('id'), '', true);
$form = array(
'name' => 'editForm',
'caption' => Eresus_Kernel::app()->getPage()->title.ADM_T_DIV.ADM_EDIT,
'width' => '100%',
'fields' => array (
array('type'=>'hidden',... | php | public function sectionTemplatesEdit()
{
$templates = Templates::getInstance();
$item = $templates->get(arg('id'), '', true);
$form = array(
'name' => 'editForm',
'caption' => Eresus_Kernel::app()->getPage()->title.ADM_T_DIV.ADM_EDIT,
'width' => '100%',
'fields' => array (
array('type'=>'hidden',... | [
"public",
"function",
"sectionTemplatesEdit",
"(",
")",
"{",
"$",
"templates",
"=",
"Templates",
"::",
"getInstance",
"(",
")",
";",
"$",
"item",
"=",
"$",
"templates",
"->",
"get",
"(",
"arg",
"(",
"'id'",
")",
",",
"''",
",",
"true",
")",
";",
"$",... | ???
@return string HTML | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L169-L192 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionTemplates | public function sectionTemplates()
{
Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_TEMPLATES;
$result = '';
switch (arg('action'))
{
case 'update':
$this->sectionTemplatesUpdate();
break;
case 'insert':
$this->sectionTemplatesInsert();
break;
case 'add':
$result =... | php | public function sectionTemplates()
{
Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_TEMPLATES;
$result = '';
switch (arg('action'))
{
case 'update':
$this->sectionTemplatesUpdate();
break;
case 'insert':
$this->sectionTemplatesInsert();
break;
case 'add':
$result =... | [
"public",
"function",
"sectionTemplates",
"(",
")",
"{",
"Eresus_Kernel",
"::",
"app",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"title",
".=",
"ADM_T_DIV",
".",
"ADM_THEMES_TEMPLATES",
";",
"$",
"result",
"=",
"''",
";",
"switch",
"(",
"arg",
"(",
"'ac... | ???
@return string | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L238-L269 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStdInsert | public function sectionStdInsert()
{
$templates = Templates::getInstance();
$templates->add(arg('name'), 'std', arg('code'), $this->stdTemplates[arg('name')]['caption']);
HTTP::redirect(arg('submitURL'));
} | php | public function sectionStdInsert()
{
$templates = Templates::getInstance();
$templates->add(arg('name'), 'std', arg('code'), $this->stdTemplates[arg('name')]['caption']);
HTTP::redirect(arg('submitURL'));
} | [
"public",
"function",
"sectionStdInsert",
"(",
")",
"{",
"$",
"templates",
"=",
"Templates",
"::",
"getInstance",
"(",
")",
";",
"$",
"templates",
"->",
"add",
"(",
"arg",
"(",
"'name'",
")",
",",
"'std'",
",",
"arg",
"(",
"'code'",
")",
",",
"$",
"t... | ???
@return void | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L276-L281 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStdAdd | private function sectionStdAdd()
{
/*
* Создаём список имеющихся шаблонов чтобы отфильтровать их из списка доступных.
*/
$templates = Templates::getInstance();
$list = array_keys($templates->enum('std'));
$existed = array();
foreach ($list as $key)
{
$existed []= $key;
}
$values = array();
... | php | private function sectionStdAdd()
{
/*
* Создаём список имеющихся шаблонов чтобы отфильтровать их из списка доступных.
*/
$templates = Templates::getInstance();
$list = array_keys($templates->enum('std'));
$existed = array();
foreach ($list as $key)
{
$existed []= $key;
}
$values = array();
... | [
"private",
"function",
"sectionStdAdd",
"(",
")",
"{",
"/*\n\t\t * Создаём список имеющихся шаблонов чтобы отфильтровать их из списка доступных.\n\t\t */",
"$",
"templates",
"=",
"Templates",
"::",
"getInstance",
"(",
")",
";",
"$",
"list",
"=",
"array_keys",
"(",
"$",
"t... | Диалог добавления стандартного шаблона
@return string | [
"Диалог",
"добавления",
"стандартного",
"шаблона"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L309-L370 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStdEdit | public function sectionStdEdit()
{
$templates = Templates::getInstance();
$item = $templates->get(arg('id'), 'std', true);
$form = array(
'name' => 'editForm',
'caption' => Eresus_Kernel::app()->getPage()->title . ADM_T_DIV . ADM_EDIT,
'width' => '100%',
'fields' => array (
array('type'=>'hidden'... | php | public function sectionStdEdit()
{
$templates = Templates::getInstance();
$item = $templates->get(arg('id'), 'std', true);
$form = array(
'name' => 'editForm',
'caption' => Eresus_Kernel::app()->getPage()->title . ADM_T_DIV . ADM_EDIT,
'width' => '100%',
'fields' => array (
array('type'=>'hidden'... | [
"public",
"function",
"sectionStdEdit",
"(",
")",
"{",
"$",
"templates",
"=",
"Templates",
"::",
"getInstance",
"(",
")",
";",
"$",
"item",
"=",
"$",
"templates",
"->",
"get",
"(",
"arg",
"(",
"'id'",
")",
",",
"'std'",
",",
"true",
")",
";",
"$",
... | ???
@return string | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L377-L404 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStdList | public function sectionStdList()
{
$table = array(
'name' => 'templates',
'key'=> 'filename',
'sortMode' => 'filename',
'sortDesc' => false,
'columns' => array(
array('name' => 'description', 'caption' => 'Описание'),
#array('name' => 'filename', 'caption' => 'Имя файла'),
),
'controls' ... | php | public function sectionStdList()
{
$table = array(
'name' => 'templates',
'key'=> 'filename',
'sortMode' => 'filename',
'sortDesc' => false,
'columns' => array(
array('name' => 'description', 'caption' => 'Описание'),
#array('name' => 'filename', 'caption' => 'Имя файла'),
),
'controls' ... | [
"public",
"function",
"sectionStdList",
"(",
")",
"{",
"$",
"table",
"=",
"array",
"(",
"'name'",
"=>",
"'templates'",
",",
"'key'",
"=>",
"'filename'",
",",
"'sortMode'",
"=>",
"'filename'",
",",
"'sortDesc'",
"=>",
"false",
",",
"'columns'",
"=>",
"array",... | ???
@return string HTML | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L411-L444 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStd | public function sectionStd()
{
Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_STANDARD;
$result = '';
switch (arg('action'))
{
case 'update':
$this->sectionStdUpdate();
break;
case 'insert':
$this->sectionStdInsert();
break;
case 'add':
$result = $this->sectionStdA... | php | public function sectionStd()
{
Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_STANDARD;
$result = '';
switch (arg('action'))
{
case 'update':
$this->sectionStdUpdate();
break;
case 'insert':
$this->sectionStdInsert();
break;
case 'add':
$result = $this->sectionStdA... | [
"public",
"function",
"sectionStd",
"(",
")",
"{",
"Eresus_Kernel",
"::",
"app",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"title",
".=",
"ADM_T_DIV",
".",
"ADM_THEMES_STANDARD",
";",
"$",
"result",
"=",
"''",
";",
"switch",
"(",
"arg",
"(",
"'action'",... | ???
@return string HTML | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L450-L481 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStylesInsert | public function sectionStylesInsert()
{
$filename = arg('filename');
$filter = new Eresus_FS_NameFilter();
$filename = $filter->filter($filename);
if ('' === $filename)
{
$filename = uniqid();
}
if ($filename != arg('filename'))
{
Eresus_Kernel::app()->getPage()->addErrorMessage(
... | php | public function sectionStylesInsert()
{
$filename = arg('filename');
$filter = new Eresus_FS_NameFilter();
$filename = $filter->filter($filename);
if ('' === $filename)
{
$filename = uniqid();
}
if ($filename != arg('filename'))
{
Eresus_Kernel::app()->getPage()->addErrorMessage(
... | [
"public",
"function",
"sectionStylesInsert",
"(",
")",
"{",
"$",
"filename",
"=",
"arg",
"(",
"'filename'",
")",
";",
"$",
"filter",
"=",
"new",
"Eresus_FS_NameFilter",
"(",
")",
";",
"$",
"filename",
"=",
"$",
"filter",
"->",
"filter",
"(",
"$",
"filena... | Создаёт новый файл стилей
@return void | [
"Создаёт",
"новый",
"файл",
"стилей"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L489-L510 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStylesDelete | public function sectionStylesDelete()
{
$filename = Eresus_CMS::getLegacyKernel()->froot . 'style/'.arg('delete');
if (file_exists($filename))
{
unlink($filename);
}
HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
} | php | public function sectionStylesDelete()
{
$filename = Eresus_CMS::getLegacyKernel()->froot . 'style/'.arg('delete');
if (file_exists($filename))
{
unlink($filename);
}
HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
} | [
"public",
"function",
"sectionStylesDelete",
"(",
")",
"{",
"$",
"filename",
"=",
"Eresus_CMS",
"::",
"getLegacyKernel",
"(",
")",
"->",
"froot",
".",
"'style/'",
".",
"arg",
"(",
"'delete'",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"filename",
")",
... | ???
@return void | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L524-L532 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStylesEdit | public function sectionStylesEdit()
{
$item['filename'] = arg('id');
$item['html'] = trim(file_get_contents(Eresus_CMS::getLegacyKernel()->froot . 'style/' .
$item['filename']));
preg_match('|/\*(.*?)\*/|', $item['html'], $item['description']);
$item['description'] = trim($item['description'][1]);
$item['... | php | public function sectionStylesEdit()
{
$item['filename'] = arg('id');
$item['html'] = trim(file_get_contents(Eresus_CMS::getLegacyKernel()->froot . 'style/' .
$item['filename']));
preg_match('|/\*(.*?)\*/|', $item['html'], $item['description']);
$item['description'] = trim($item['description'][1]);
$item['... | [
"public",
"function",
"sectionStylesEdit",
"(",
")",
"{",
"$",
"item",
"[",
"'filename'",
"]",
"=",
"arg",
"(",
"'id'",
")",
";",
"$",
"item",
"[",
"'html'",
"]",
"=",
"trim",
"(",
"file_get_contents",
"(",
"Eresus_CMS",
"::",
"getLegacyKernel",
"(",
")"... | ???
@return string HTML | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L567-L596 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStylesList | public function sectionStylesList()
{
$table = array(
'name' => 'Styles',
'key'=> 'filename',
'sortMode' => 'filename',
'sortDesc' => false,
'columns' => array(
array('name' => 'description', 'caption' => 'Описание'),
array('name' => 'filename', 'caption' => 'Имя файла'),
),
'controls' =... | php | public function sectionStylesList()
{
$table = array(
'name' => 'Styles',
'key'=> 'filename',
'sortMode' => 'filename',
'sortDesc' => false,
'columns' => array(
array('name' => 'description', 'caption' => 'Описание'),
array('name' => 'filename', 'caption' => 'Имя файла'),
),
'controls' =... | [
"public",
"function",
"sectionStylesList",
"(",
")",
"{",
"$",
"table",
"=",
"array",
"(",
"'name'",
"=>",
"'Styles'",
",",
"'key'",
"=>",
"'filename'",
",",
"'sortMode'",
"=>",
"'filename'",
",",
"'sortDesc'",
"=>",
"false",
",",
"'columns'",
"=>",
"array",... | ???
@return string | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L603-L647 |
Eresus/EresusCMS | src/core/themes.php | TThemes.sectionStyles | public function sectionStyles()
{
$result = '';
Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_STYLES;
switch (arg('action'))
{
case 'update':
$this->sectionStylesUpdate();
break;
case 'insert':
$this->sectionStylesInsert();
break;
case 'add':
$result = $this->se... | php | public function sectionStyles()
{
$result = '';
Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_STYLES;
switch (arg('action'))
{
case 'update':
$this->sectionStylesUpdate();
break;
case 'insert':
$this->sectionStylesInsert();
break;
case 'add':
$result = $this->se... | [
"public",
"function",
"sectionStyles",
"(",
")",
"{",
"$",
"result",
"=",
"''",
";",
"Eresus_Kernel",
"::",
"app",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"title",
".=",
"ADM_T_DIV",
".",
"ADM_THEMES_STYLES",
";",
"switch",
"(",
"arg",
"(",
"'action'"... | ???
@return string | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L654-L687 |
Eresus/EresusCMS | src/core/themes.php | TThemes.adminRender | public function adminRender()
{
$result = '';
if (UserRights($this->access))
{
#FIXME: Временное решение #0000163
$this->tabs['items'][0]['url'] =
Eresus_Kernel::app()->getPage()->url(array('id' => '', 'section' => 'templates'));
$this->tabs['items'][1]['url'] =
Eresus_Kernel::app()->getPage()->... | php | public function adminRender()
{
$result = '';
if (UserRights($this->access))
{
#FIXME: Временное решение #0000163
$this->tabs['items'][0]['url'] =
Eresus_Kernel::app()->getPage()->url(array('id' => '', 'section' => 'templates'));
$this->tabs['items'][1]['url'] =
Eresus_Kernel::app()->getPage()->... | [
"public",
"function",
"adminRender",
"(",
")",
"{",
"$",
"result",
"=",
"''",
";",
"if",
"(",
"UserRights",
"(",
"$",
"this",
"->",
"access",
")",
")",
"{",
"#FIXME: Временное решение #0000163",
"$",
"this",
"->",
"tabs",
"[",
"'items'",
"]",
"[",
"0",
... | ???
@return string | [
"???"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/themes.php#L694-L724 |
netzmacht/contao-leaflet-geocode-widget | src/EventListener/RadiusWizardCallbackListener.php | RadiusWizardCallbackListener.generateWizard | public function generateWizard($dataContainer)
{
if (!isset($GLOBALS['TL_DCA'][$dataContainer->table]['fields'][$dataContainer->field]['eval']['coordinates'])) {
return '';
}
return sprintf(
'<a href="#" onclick="$(\'ctrl_%s_toggle\').click();return false;"><img src=... | php | public function generateWizard($dataContainer)
{
if (!isset($GLOBALS['TL_DCA'][$dataContainer->table]['fields'][$dataContainer->field]['eval']['coordinates'])) {
return '';
}
return sprintf(
'<a href="#" onclick="$(\'ctrl_%s_toggle\').click();return false;"><img src=... | [
"public",
"function",
"generateWizard",
"(",
"$",
"dataContainer",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'TL_DCA'",
"]",
"[",
"$",
"dataContainer",
"->",
"table",
"]",
"[",
"'fields'",
"]",
"[",
"$",
"dataContainer",
"->",
"field"... | Generate the wizard for the radius widget.
@param DataContainer $dataContainer Data container driver.
@return string
@SuppressWarnings(PHPMD.Superglobals) | [
"Generate",
"the",
"wizard",
"for",
"the",
"radius",
"widget",
"."
] | train | https://github.com/netzmacht/contao-leaflet-geocode-widget/blob/08acfbc473696f385d7c6aed6148e51c91443e12/src/EventListener/RadiusWizardCallbackListener.php#L33-L44 |
wenbinye/PhalconX | src/Helper/ArrayHelper.php | ArrayHelper.pull | public static function pull($arr, $name, $type = null)
{
$ret = [];
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[] = $elem->$method();
}
} elseif ($type == self::OBJ) {
foreach ($arr as $e... | php | public static function pull($arr, $name, $type = null)
{
$ret = [];
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[] = $elem->$method();
}
} elseif ($type == self::OBJ) {
foreach ($arr as $e... | [
"public",
"static",
"function",
"pull",
"(",
"$",
"arr",
",",
"$",
"name",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"type",
"==",
"self",
"::",
"GETTER",
")",
"{",
"$",
"method",
"=",
"'get'",
"... | Collects value from array
@param array $array
@param string $name
@param string $type
@return array | [
"Collects",
"value",
"from",
"array"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ArrayHelper.php#L37-L55 |
wenbinye/PhalconX | src/Helper/ArrayHelper.php | ArrayHelper.assoc | public static function assoc($arr, $name, $type = null)
{
$ret = [];
if (empty($arr)) {
return $ret;
}
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[$elem->$method()] = $elem;
}
... | php | public static function assoc($arr, $name, $type = null)
{
$ret = [];
if (empty($arr)) {
return $ret;
}
if ($type == self::GETTER) {
$method = 'get' . $name;
foreach ($arr as $elem) {
$ret[$elem->$method()] = $elem;
}
... | [
"public",
"static",
"function",
"assoc",
"(",
"$",
"arr",
",",
"$",
"name",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"arr",
")",
")",
"{",
"return",
"$",
"ret",
";",
"}",
"if",
"... | Creates associated array
@param array $array
@param string $name
@param string $type
@return array | [
"Creates",
"associated",
"array"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ArrayHelper.php#L65-L86 |
wenbinye/PhalconX | src/Helper/ArrayHelper.php | ArrayHelper.select | public static function select($arr, $includedKeys)
{
$ret = [];
foreach ($includedKeys as $key) {
if (array_key_exists($key, $arr)) {
$ret[$key] = $arr[$key];
}
}
return $ret;
} | php | public static function select($arr, $includedKeys)
{
$ret = [];
foreach ($includedKeys as $key) {
if (array_key_exists($key, $arr)) {
$ret[$key] = $arr[$key];
}
}
return $ret;
} | [
"public",
"static",
"function",
"select",
"(",
"$",
"arr",
",",
"$",
"includedKeys",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"includedKeys",
"as",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$"... | Create array with given keys
@param array $array
@param array $includedKeys
@return array | [
"Create",
"array",
"with",
"given",
"keys"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ArrayHelper.php#L107-L116 |
wenbinye/PhalconX | src/Helper/ArrayHelper.php | ArrayHelper.sorter | public static function sorter($name, $func = null, $type = null)
{
if (!isset($func)) {
$func = function ($a, $b) {
if ($a == $b) {
return 0;
}
return $a < $b ? -1 : 1;
};
}
if ($type == self... | php | public static function sorter($name, $func = null, $type = null)
{
if (!isset($func)) {
$func = function ($a, $b) {
if ($a == $b) {
return 0;
}
return $a < $b ? -1 : 1;
};
}
if ($type == self... | [
"public",
"static",
"function",
"sorter",
"(",
"$",
"name",
",",
"$",
"func",
"=",
"null",
",",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"func",
")",
")",
"{",
"$",
"func",
"=",
"function",
"(",
"$",
"a",
",",
"$... | create sorter
@param string $name
@param closure $func
@param string $type
@return closure | [
"create",
"sorter"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Helper/ArrayHelper.php#L139-L164 |
ajgarlag/AjglCsv | src/Reader/NativePhpReader.php | NativePhpReader.doRead | protected function doRead()
{
$row = fgetcsv($this->getHandler(), 0, $this->getDelimiter());
return ($row !== false) ? $row : null;
} | php | protected function doRead()
{
$row = fgetcsv($this->getHandler(), 0, $this->getDelimiter());
return ($row !== false) ? $row : null;
} | [
"protected",
"function",
"doRead",
"(",
")",
"{",
"$",
"row",
"=",
"fgetcsv",
"(",
"$",
"this",
"->",
"getHandler",
"(",
")",
",",
"0",
",",
"$",
"this",
"->",
"getDelimiter",
"(",
")",
")",
";",
"return",
"(",
"$",
"row",
"!==",
"false",
")",
"?... | {@inheritdoc} | [
"{"
] | train | https://github.com/ajgarlag/AjglCsv/blob/28872f58b9ef864893cac6faddfcb1229c2c2047/src/Reader/NativePhpReader.php#L22-L27 |
i-lateral/silverstripe-deferedimages | src/DeferedImageExtension.php | DeferedImage.MicroImage | public function MicroImage()
{
$pixel = $this->config()->pixelate;
$blur = $this->config()->blur;
$quality = $this->config()->quality;
$scale = $this->config()->scale;
$variant = $this->owner->variantName(__FUNCTION__, $pixel, $blur, $quality, $scale);
return... | php | public function MicroImage()
{
$pixel = $this->config()->pixelate;
$blur = $this->config()->blur;
$quality = $this->config()->quality;
$scale = $this->config()->scale;
$variant = $this->owner->variantName(__FUNCTION__, $pixel, $blur, $quality, $scale);
return... | [
"public",
"function",
"MicroImage",
"(",
")",
"{",
"$",
"pixel",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"pixelate",
";",
"$",
"blur",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"blur",
";",
"$",
"quality",
"=",
"$",
"this",
"->"... | Generates a reduced quality version of the current image
@config
@return void | [
"Generates",
"a",
"reduced",
"quality",
"version",
"of",
"the",
"current",
"image"
] | train | https://github.com/i-lateral/silverstripe-deferedimages/blob/6095e2404bbc5e33a8d996909f34111d4f751026/src/DeferedImageExtension.php#L50-L73 |
thelia-modules/CustomerGroup | Model/Map/CustomerGroupTableMap.php | CustomerGroupTableMap.getPrimaryKeyFromRow | public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
return (int) $row[
$indexType == TableMap::TYPE_NUM
? 2 + $offset
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME... | php | public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
return (int) $row[
$indexType == TableMap::TYPE_NUM
? 2 + $offset
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME... | [
"public",
"static",
"function",
"getPrimaryKeyFromRow",
"(",
"$",
"row",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"indexType",
"=",
"TableMap",
"::",
"TYPE_NUM",
")",
"{",
"return",
"(",
"int",
")",
"$",
"row",
"[",
"$",
"indexType",
"==",
"TableMap",
"... | Retrieves the primary key from the DB resultset row
For tables with a single-column primary key, that simple pkey value will be returned. For tables with
a multi-column primary key, an array of the primary key columns will be returned.
@param array $row resultset row.
@param int $offset The 0-based offse... | [
"Retrieves",
"the",
"primary",
"key",
"from",
"the",
"DB",
"resultset",
"row",
"For",
"tables",
"with",
"a",
"single",
"-",
"column",
"primary",
"key",
"that",
"simple",
"pkey",
"value",
"will",
"be",
"returned",
".",
"For",
"tables",
"with",
"a",
"multi",... | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerGroupTableMap.php#L247-L255 |
thelia-modules/CustomerGroup | Model/Map/CustomerGroupTableMap.php | CustomerGroupTableMap.addSelectColumns | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CustomerGroupTableMap::CODE);
$criteria->addSelectColumn(CustomerGroupTableMap::IS_DEFAULT);
$criteria->addSelectColumn(CustomerGroupTableMap::ID... | php | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CustomerGroupTableMap::CODE);
$criteria->addSelectColumn(CustomerGroupTableMap::IS_DEFAULT);
$criteria->addSelectColumn(CustomerGroupTableMap::ID... | [
"public",
"static",
"function",
"addSelectColumns",
"(",
"Criteria",
"$",
"criteria",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"alias",
")",
"{",
"$",
"criteria",
"->",
"addSelectColumn",
"(",
"CustomerGroupTableMap",
"::",
... | Add all the columns needed to create a new object.
Note: any columns that were marked with lazyLoad="true" in the
XML schema will not be added to the select list and only loaded
on demand.
@param Criteria $criteria object containing the columns to add.
@param string $alias optional table alias
@throws PropelExce... | [
"Add",
"all",
"the",
"columns",
"needed",
"to",
"create",
"a",
"new",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerGroupTableMap.php#L349-L366 |
thelia-modules/CustomerGroup | Model/Map/CustomerGroupTableMap.php | CustomerGroupTableMap.buildTableMap | public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CustomerGroupTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(CustomerGroupTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new CustomerGroupTableMap());
}
} | php | public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CustomerGroupTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(CustomerGroupTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new CustomerGroupTableMap());
}
} | [
"public",
"static",
"function",
"buildTableMap",
"(",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getDatabaseMap",
"(",
"CustomerGroupTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"!",
"$",
"dbMap",
"->",
"ha... | Add a TableMap instance to the database for this tableMap class. | [
"Add",
"a",
"TableMap",
"instance",
"to",
"the",
"database",
"for",
"this",
"tableMap",
"class",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Map/CustomerGroupTableMap.php#L383-L389 |
songshenzong/log | src/DataCollector/PDO/TracedStatement.php | TracedStatement.getSqlWithParams | public function getSqlWithParams($quotationChar = '<>')
{
if (($l = strlen($quotationChar)) > 1) {
$quoteLeft = substr($quotationChar, 0, $l / 2);
$quoteRight = substr($quotationChar, $l / 2);
} else {
$quoteLeft = $quoteRight = $quotationChar;
}
... | php | public function getSqlWithParams($quotationChar = '<>')
{
if (($l = strlen($quotationChar)) > 1) {
$quoteLeft = substr($quotationChar, 0, $l / 2);
$quoteRight = substr($quotationChar, $l / 2);
} else {
$quoteLeft = $quoteRight = $quotationChar;
}
... | [
"public",
"function",
"getSqlWithParams",
"(",
"$",
"quotationChar",
"=",
"'<>'",
")",
"{",
"if",
"(",
"(",
"$",
"l",
"=",
"strlen",
"(",
"$",
"quotationChar",
")",
")",
">",
"1",
")",
"{",
"$",
"quoteLeft",
"=",
"substr",
"(",
"$",
"quotationChar",
... | Returns the SQL string with any parameters used embedded
@param string $quotationChar
@return string | [
"Returns",
"the",
"SQL",
"string",
"with",
"any",
"parameters",
"used",
"embedded"
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/PDO/TracedStatement.php#L132-L152 |
traderinteractive/image-util-php | src/Image.php | Image.resize | public static function resize(\Imagick $source, int $boxWidth, int $boxHeight, array $options = []) : \Imagick
{
$results = self::resizeMulti($source, [['width' => $boxWidth, 'height' => $boxHeight]], $options);
return $results[0];
} | php | public static function resize(\Imagick $source, int $boxWidth, int $boxHeight, array $options = []) : \Imagick
{
$results = self::resizeMulti($source, [['width' => $boxWidth, 'height' => $boxHeight]], $options);
return $results[0];
} | [
"public",
"static",
"function",
"resize",
"(",
"\\",
"Imagick",
"$",
"source",
",",
"int",
"$",
"boxWidth",
",",
"int",
"$",
"boxHeight",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"\\",
"Imagick",
"{",
"$",
"results",
"=",
"self",
"::",
... | Calls @see resizeMulti() with $boxWidth and $boxHeight as a single element in $boxSizes | [
"Calls"
] | train | https://github.com/traderinteractive/image-util-php/blob/60595257ff8cb704e9a39384a0fc1232159d16dc/src/Image.php#L10-L14 |
traderinteractive/image-util-php | src/Image.php | Image.resizeMulti | public static function resizeMulti(\Imagick $source, array $boxSizes, array $options = []) : array
{
//algorithm inspired from http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html
//use of 2x2 binning is arguably the best quality one will get downsizing and is what lot... | php | public static function resizeMulti(\Imagick $source, array $boxSizes, array $options = []) : array
{
//algorithm inspired from http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html
//use of 2x2 binning is arguably the best quality one will get downsizing and is what lot... | [
"public",
"static",
"function",
"resizeMulti",
"(",
"\\",
"Imagick",
"$",
"source",
",",
"array",
"$",
"boxSizes",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"//algorithm inspired from http://today.java.net/pub/a/today/2007/04/03/perils-of-im... | resizes images into a bounding box. Maintains aspect ratio, extra space filled with given color.
@param \Imagick $source source image to resize. Will not modify
@param array $boxSizes resulting bounding boxes. Each value should be an array with width and height, both
integers
@param array $options options
string color... | [
"resizes",
"images",
"into",
"a",
"bounding",
"box",
".",
"Maintains",
"aspect",
"ratio",
"extra",
"space",
"filled",
"with",
"given",
"color",
"."
] | train | https://github.com/traderinteractive/image-util-php/blob/60595257ff8cb704e9a39384a0fc1232159d16dc/src/Image.php#L41-L226 |
traderinteractive/image-util-php | src/Image.php | Image.write | public static function write(\Imagick $source, string $destPath, array $options = [])
{
$format = 'jpeg';
if (array_key_exists('format', $options)) {
$format = $options['format'];
if (!is_string($format)) {
throw new \InvalidArgumentException('$options["format... | php | public static function write(\Imagick $source, string $destPath, array $options = [])
{
$format = 'jpeg';
if (array_key_exists('format', $options)) {
$format = $options['format'];
if (!is_string($format)) {
throw new \InvalidArgumentException('$options["format... | [
"public",
"static",
"function",
"write",
"(",
"\\",
"Imagick",
"$",
"source",
",",
"string",
"$",
"destPath",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"format",
"=",
"'jpeg'",
";",
"if",
"(",
"array_key_exists",
"(",
"'format'",
",",... | write $source to $destPath with $options applied
@param \Imagick $source source image. Will not modify
@param string $destPath destination image path
@param array $options options
string format (default jpeg) Any from http://www.imagemagick.org/script/formats.php#supported
int directoryMode (default 0777) ch... | [
"write",
"$source",
"to",
"$destPath",
"with",
"$options",
"applied"
] | train | https://github.com/traderinteractive/image-util-php/blob/60595257ff8cb704e9a39384a0fc1232159d16dc/src/Image.php#L249-L315 |
traderinteractive/image-util-php | src/Image.php | Image.stripHeaders | public static function stripHeaders(string $path)
{
$imagick = new \Imagick($path);
if ($imagick->stripImage() !== true) {
//cumbersome to test
throw new \Exception('Imagick::stripImage() did not return true');//@codeCoverageIgnore
}
if ($imagick->writeImage(... | php | public static function stripHeaders(string $path)
{
$imagick = new \Imagick($path);
if ($imagick->stripImage() !== true) {
//cumbersome to test
throw new \Exception('Imagick::stripImage() did not return true');//@codeCoverageIgnore
}
if ($imagick->writeImage(... | [
"public",
"static",
"function",
"stripHeaders",
"(",
"string",
"$",
"path",
")",
"{",
"$",
"imagick",
"=",
"new",
"\\",
"Imagick",
"(",
"$",
"path",
")",
";",
"if",
"(",
"$",
"imagick",
"->",
"stripImage",
"(",
")",
"!==",
"true",
")",
"{",
"//cumber... | Strips the headers (exif, etc) from an image at the given path.
@param string $path The image path.
@return void
@throws \InvalidArgumentException if $path is not a string
@throws \Exception if there is a failure stripping the headers
@throws \Exception if there is a failure writing the image back to path | [
"Strips",
"the",
"headers",
"(",
"exif",
"etc",
")",
"from",
"an",
"image",
"at",
"the",
"given",
"path",
"."
] | train | https://github.com/traderinteractive/image-util-php/blob/60595257ff8cb704e9a39384a0fc1232159d16dc/src/Image.php#L326-L338 |
contao-community-alliance/url-builder | src/Contao/BackendUrlBuilder.php | BackendUrlBuilder.getQueryString | public function getQueryString()
{
$query = parent::getQueryString();
if ($query) {
$query .= '&';
}
if (!defined('REQUEST_TOKEN')) {
throw new \RuntimeException('Request token not defined - can not append to query string.');
}
$query .= 'rt=... | php | public function getQueryString()
{
$query = parent::getQueryString();
if ($query) {
$query .= '&';
}
if (!defined('REQUEST_TOKEN')) {
throw new \RuntimeException('Request token not defined - can not append to query string.');
}
$query .= 'rt=... | [
"public",
"function",
"getQueryString",
"(",
")",
"{",
"$",
"query",
"=",
"parent",
"::",
"getQueryString",
"(",
")",
";",
"if",
"(",
"$",
"query",
")",
"{",
"$",
"query",
".=",
"'&'",
";",
"}",
"if",
"(",
"!",
"defined",
"(",
"'REQUEST_TOKEN'",
")",... | Retrieve the serialized query string.
@return string
@throws \RuntimeException If no REQUEST_TOKEN constant exists. | [
"Retrieve",
"the",
"serialized",
"query",
"string",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/Contao/BackendUrlBuilder.php#L42-L56 |
Eresus/EresusCMS | src/core/FS/Tool.php | Eresus_FS_Tool.normalize | public static function normalize($path)
{
$path = self::expandParentLinks($path);
$path = self::tidy($path);
return $path;
} | php | public static function normalize($path)
{
$path = self::expandParentLinks($path);
$path = self::tidy($path);
return $path;
} | [
"public",
"static",
"function",
"normalize",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"expandParentLinks",
"(",
"$",
"path",
")",
";",
"$",
"path",
"=",
"self",
"::",
"tidy",
"(",
"$",
"path",
")",
";",
"return",
"$",
"path",
";"... | Нормализует имя файла
Вызывает последовательно {@link expandParentLinks()} и {@link tidy()}.
@param string $path путь
@return string
@since 3.01 | [
"Нормализует",
"имя",
"файла"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/FS/Tool.php#L48-L53 |
Eresus/EresusCMS | src/core/FS/Tool.php | Eresus_FS_Tool.expandParentLinks | public static function expandParentLinks($path)
{
if (strpos($path, '..') === false)
{
return $path;
}
if ($path)
{
$parts = explode('/', $path);
for ($i = 0; $i < count($parts); $i++)
{
if ($parts[$i] == '..')
... | php | public static function expandParentLinks($path)
{
if (strpos($path, '..') === false)
{
return $path;
}
if ($path)
{
$parts = explode('/', $path);
for ($i = 0; $i < count($parts); $i++)
{
if ($parts[$i] == '..')
... | [
"public",
"static",
"function",
"expandParentLinks",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"path",
",",
"'..'",
")",
"===",
"false",
")",
"{",
"return",
"$",
"path",
";",
"}",
"if",
"(",
"$",
"path",
")",
"{",
"$",
"parts",
"... | Раскрывает ссылки на родительские папки ('..')
@param string $path
@return string
@since 3.01 | [
"Раскрывает",
"ссылки",
"на",
"родительские",
"папки",
"(",
"..",
")"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/FS/Tool.php#L62-L91 |
Eresus/EresusCMS | src/core/FS/Tool.php | Eresus_FS_Tool.tidy | public static function tidy($path)
{
$path = preg_replace('~/{2,}~', '/', $path);
$path = str_replace('/./', '/', $path);
$path = preg_replace('~^./~', '', $path);
$path = rtrim($path, '/');
return $path;
} | php | public static function tidy($path)
{
$path = preg_replace('~/{2,}~', '/', $path);
$path = str_replace('/./', '/', $path);
$path = preg_replace('~^./~', '', $path);
$path = rtrim($path, '/');
return $path;
} | [
"public",
"static",
"function",
"tidy",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"preg_replace",
"(",
"'~/{2,}~'",
",",
"'/'",
",",
"$",
"path",
")",
";",
"$",
"path",
"=",
"str_replace",
"(",
"'/./'",
",",
"'/'",
",",
"$",
"path",
")",
";",
... | Исправляет некоторые ошибки в пути
1. Заменяет несколько идущих подряд слэшей одним
2. Заменяет "/./" на "/"
3. Удаляет финальный слэш "/"
@param string $path
@return string
@since 3.01 | [
"Исправляет",
"некоторые",
"ошибки",
"в",
"пути"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/FS/Tool.php#L104-L111 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_delete.php | ezcQueryDelete.deleteFrom | public function deleteFrom( $table )
{
$table = $this->getPrefixedTableNames($table);
$this->table = $table;
return $this;
} | php | public function deleteFrom( $table )
{
$table = $this->getPrefixedTableNames($table);
$this->table = $table;
return $this;
} | [
"public",
"function",
"deleteFrom",
"(",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"getPrefixedTableNames",
"(",
"$",
"table",
")",
";",
"$",
"this",
"->",
"table",
"=",
"$",
"table",
";",
"return",
"$",
"this",
";",
"}"
] | Opens the query and sets the target table to $table.
deleteFrom() returns a pointer to $this.
@param string $table
@return ezcQueryDelete | [
"Opens",
"the",
"query",
"and",
"sets",
"the",
"target",
"table",
"to",
"$table",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_delete.php#L76-L81 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_delete.php | ezcQueryDelete.where | public function where()
{
if ( $this->whereString == null )
{
$this->whereString = 'WHERE ';
}
$args = func_get_args();
$expressions = self::arrayFlatten( $args );
if ( count( $expressions ) < 1 )
{
throw new ezcQueryVariableParameterE... | php | public function where()
{
if ( $this->whereString == null )
{
$this->whereString = 'WHERE ';
}
$args = func_get_args();
$expressions = self::arrayFlatten( $args );
if ( count( $expressions ) < 1 )
{
throw new ezcQueryVariableParameterE... | [
"public",
"function",
"where",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"whereString",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"whereString",
"=",
"'WHERE '",
";",
"}",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"expressions",
"=",... | Adds a where clause with logical expressions to the query.
where() accepts an arbitrary number of parameters. Each parameter
must contain a logical expression or an array with logical expressions.
where() could be invoked several times. All provided arguments
added to the end of $whereString and form final WHERE claus... | [
"Adds",
"a",
"where",
"clause",
"with",
"logical",
"expressions",
"to",
"the",
"query",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_delete.php#L103-L125 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_delete.php | ezcQueryDelete.getQuery | public function getQuery()
{
if ( $this->table == null )
{
throw new ezcQueryInvalidException( "DELETE", "deleteFrom() was not called before getQuery()." );
}
$query = "DELETE FROM {$this->table}";
// append where part.
if ( $this->whereString !== null )
... | php | public function getQuery()
{
if ( $this->table == null )
{
throw new ezcQueryInvalidException( "DELETE", "deleteFrom() was not called before getQuery()." );
}
$query = "DELETE FROM {$this->table}";
// append where part.
if ( $this->whereString !== null )
... | [
"public",
"function",
"getQuery",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"table",
"==",
"null",
")",
"{",
"throw",
"new",
"ezcQueryInvalidException",
"(",
"\"DELETE\"",
",",
"\"deleteFrom() was not called before getQuery().\"",
")",
";",
"}",
"$",
"query",... | Returns the query string for this query object.
@todo wrong exception
@throws ezcQueryInvalidException if no table or no values have been set.
@return string | [
"Returns",
"the",
"query",
"string",
"for",
"this",
"query",
"object",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_delete.php#L135-L150 |
jnaxo/country-codes | database/seeds/WorldZonesSeeder.php | WorldZonesSeeder.run | public function run()
{
DB::table('ctrystore_zones')->delete();
$today = date('Y-m-d H:i:s');
$zones = [
1 => 'europe',
2 => 'near east',
3 => 'caribbean',
4 => 'sub-saharan africa',
5 => 'antartica',
6 => 'latam',
... | php | public function run()
{
DB::table('ctrystore_zones')->delete();
$today = date('Y-m-d H:i:s');
$zones = [
1 => 'europe',
2 => 'near east',
3 => 'caribbean',
4 => 'sub-saharan africa',
5 => 'antartica',
6 => 'latam',
... | [
"public",
"function",
"run",
"(",
")",
"{",
"DB",
"::",
"table",
"(",
"'ctrystore_zones'",
")",
"->",
"delete",
"(",
")",
";",
"$",
"today",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
")",
";",
"$",
"zones",
"=",
"[",
"1",
"=>",
"'europe'",
",",
"2",
"=>",... | Run the database seeds.
@return void | [
"Run",
"the",
"database",
"seeds",
"."
] | train | https://github.com/jnaxo/country-codes/blob/ab1f24886e1b49eef5fd4b4eb4fb37aa7faeacd9/database/seeds/WorldZonesSeeder.php#L12-L45 |
zicht/z | src/Zicht/Tool/Container/Traverser.php | Traverser.addVisitor | public function addVisitor($callable, $condition, $when = self::BEFORE)
{
$this->visitors[] = array($when, $condition, $callable);
return $this;
} | php | public function addVisitor($callable, $condition, $when = self::BEFORE)
{
$this->visitors[] = array($when, $condition, $callable);
return $this;
} | [
"public",
"function",
"addVisitor",
"(",
"$",
"callable",
",",
"$",
"condition",
",",
"$",
"when",
"=",
"self",
"::",
"BEFORE",
")",
"{",
"$",
"this",
"->",
"visitors",
"[",
"]",
"=",
"array",
"(",
"$",
"when",
",",
"$",
"condition",
",",
"$",
"cal... | Add a visitor to the traverser. The node being visited is passed to the second callback to determine whether
the first callback should be called with the node. The arguments passed to both callbacks are the current node
and the path to the node. The result of the first callback is used to replace the node in the tree.
... | [
"Add",
"a",
"visitor",
"to",
"the",
"traverser",
".",
"The",
"node",
"being",
"visited",
"is",
"passed",
"to",
"the",
"second",
"callback",
"to",
"determine",
"whether",
"the",
"first",
"callback",
"should",
"be",
"called",
"with",
"the",
"node",
".",
"The... | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Traverser.php#L86-L91 |
zicht/z | src/Zicht/Tool/Container/Traverser.php | Traverser.doTraverse | private function doTraverse($node, $path = array())
{
foreach ($node as $name => $value) {
$path[] = $name;
$value = $this->doVisit($path, $value, self::BEFORE);
if (is_array($value)) {
$value = $this->doTraverse($value, $path);
}
... | php | private function doTraverse($node, $path = array())
{
foreach ($node as $name => $value) {
$path[] = $name;
$value = $this->doVisit($path, $value, self::BEFORE);
if (is_array($value)) {
$value = $this->doTraverse($value, $path);
}
... | [
"private",
"function",
"doTraverse",
"(",
"$",
"node",
",",
"$",
"path",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"node",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"path",
"[",
"]",
"=",
"$",
"name",
";",
"$",
"value",... | Recursive traversal implementation
@param mixed $node
@param array $path
@return mixed | [
"Recursive",
"traversal",
"implementation"
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Traverser.php#L112-L128 |
zicht/z | src/Zicht/Tool/Container/Traverser.php | Traverser.doVisit | private function doVisit($path, $value, $when)
{
foreach ($this->visitors as $visitor) {
if ($visitor[0] === $when && call_user_func($visitor[1], $path, $value)) {
try {
$value = call_user_func($visitor[2], $path, $value);
} catch (\Exception $... | php | private function doVisit($path, $value, $when)
{
foreach ($this->visitors as $visitor) {
if ($visitor[0] === $when && call_user_func($visitor[1], $path, $value)) {
try {
$value = call_user_func($visitor[2], $path, $value);
} catch (\Exception $... | [
"private",
"function",
"doVisit",
"(",
"$",
"path",
",",
"$",
"value",
",",
"$",
"when",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"visitors",
"as",
"$",
"visitor",
")",
"{",
"if",
"(",
"$",
"visitor",
"[",
"0",
"]",
"===",
"$",
"when",
"&&",
... | Visits the node with all visitors at the specified time.
@param array $path
@param mixed $value
@param int $when
@return mixed
@throws \RuntimeException | [
"Visits",
"the",
"node",
"with",
"all",
"visitors",
"at",
"the",
"specified",
"time",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Container/Traverser.php#L141-L158 |
thienhungho/yii2-product-management | src/modules/ProductManage/search/ProductSearch.php | ProductSearch.search | public function search($params)
{
$query = Product::find();
$this->load($params);
$query->andFilterWhere([
'id' => $this->id,
'author' => $this->author,
'quantity' => $this->quantity,
'promotional_price' => $this->promotional_price,... | php | public function search($params)
{
$query = Product::find();
$this->load($params);
$query->andFilterWhere([
'id' => $this->id,
'author' => $this->author,
'quantity' => $this->quantity,
'promotional_price' => $this->promotional_price,... | [
"public",
"function",
"search",
"(",
"$",
"params",
")",
"{",
"$",
"query",
"=",
"Product",
"::",
"find",
"(",
")",
";",
"$",
"this",
"->",
"load",
"(",
"$",
"params",
")",
";",
"$",
"query",
"->",
"andFilterWhere",
"(",
"[",
"'id'",
"=>",
"$",
"... | Creates data provider instance with search query applied
@param array $params
@return ActiveDataProvider | [
"Creates",
"data",
"provider",
"instance",
"with",
"search",
"query",
"applied"
] | train | https://github.com/thienhungho/yii2-product-management/blob/72e1237bba123faf671e44491bd93077b50adde9/src/modules/ProductManage/search/ProductSearch.php#L38-L81 |
hametuha/wpametu | src/WPametu/API/Ajax/AjaxPostSearch.php | AjaxPostSearch.get_data | protected function get_data()
{
$post_type = $this->input->get('post_type');
if( !post_type_exists($post_type) ){
$this->error(sprintf($this->__('Post type %s does not exist.'), $post_type), 404);
}
if( !current_user_can('edit_posts') ){
$this->error($this->__... | php | protected function get_data()
{
$post_type = $this->input->get('post_type');
if( !post_type_exists($post_type) ){
$this->error(sprintf($this->__('Post type %s does not exist.'), $post_type), 404);
}
if( !current_user_can('edit_posts') ){
$this->error($this->__... | [
"protected",
"function",
"get_data",
"(",
")",
"{",
"$",
"post_type",
"=",
"$",
"this",
"->",
"input",
"->",
"get",
"(",
"'post_type'",
")",
";",
"if",
"(",
"!",
"post_type_exists",
"(",
"$",
"post_type",
")",
")",
"{",
"$",
"this",
"->",
"error",
"(... | Returns data as array.
@return array | [
"Returns",
"data",
"as",
"array",
"."
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/Ajax/AjaxPostSearch.php#L29-L69 |
php-lug/lug | src/Bundle/GridBundle/Renderer/Renderer.php | Renderer.renderColumn | public function renderColumn(GridViewInterface $grid, ColumnInterface $column, $data)
{
return $this->doRender($grid, 'column', [
'column' => $column,
'data' => $data,
'value' => $this->columnRenderer->render($grid, $column, $data),
]);
} | php | public function renderColumn(GridViewInterface $grid, ColumnInterface $column, $data)
{
return $this->doRender($grid, 'column', [
'column' => $column,
'data' => $data,
'value' => $this->columnRenderer->render($grid, $column, $data),
]);
} | [
"public",
"function",
"renderColumn",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ColumnInterface",
"$",
"column",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"doRender",
"(",
"$",
"grid",
",",
"'column'",
",",
"[",
"'column'",
"=>",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Renderer/Renderer.php#L101-L108 |
php-lug/lug | src/Bundle/GridBundle/Renderer/Renderer.php | Renderer.renderColumnSorting | public function renderColumnSorting(GridViewInterface $grid, ColumnInterface $column, $sorting)
{
return $this->doRender($grid, 'column_sorting', [
'column' => $column,
'sorting' => $sorting,
'label' => 'lug.sorting.'.strtolower($sorting),
'value' => $thi... | php | public function renderColumnSorting(GridViewInterface $grid, ColumnInterface $column, $sorting)
{
return $this->doRender($grid, 'column_sorting', [
'column' => $column,
'sorting' => $sorting,
'label' => 'lug.sorting.'.strtolower($sorting),
'value' => $thi... | [
"public",
"function",
"renderColumnSorting",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ColumnInterface",
"$",
"column",
",",
"$",
"sorting",
")",
"{",
"return",
"$",
"this",
"->",
"doRender",
"(",
"$",
"grid",
",",
"'column_sorting'",
",",
"[",
"'column'",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Renderer/Renderer.php#L121-L129 |
php-lug/lug | src/Bundle/GridBundle/Renderer/Renderer.php | Renderer.renderColumnAction | public function renderColumnAction(GridViewInterface $grid, ActionInterface $action, $data)
{
return $this->doRender($grid, 'column_action', [
'action' => $action,
'data' => $data,
'value' => $this->actionRenderer->render($grid, $action, $data),
]);
} | php | public function renderColumnAction(GridViewInterface $grid, ActionInterface $action, $data)
{
return $this->doRender($grid, 'column_action', [
'action' => $action,
'data' => $data,
'value' => $this->actionRenderer->render($grid, $action, $data),
]);
} | [
"public",
"function",
"renderColumnAction",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ActionInterface",
"$",
"action",
",",
"$",
"data",
")",
"{",
"return",
"$",
"this",
"->",
"doRender",
"(",
"$",
"grid",
",",
"'column_action'",
",",
"[",
"'action'",
"=>... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Renderer/Renderer.php#L142-L149 |
php-lug/lug | src/Bundle/GridBundle/Renderer/Renderer.php | Renderer.renderGlobalAction | public function renderGlobalAction(GridViewInterface $grid, ActionInterface $action)
{
return $this->doRender($grid, 'global_action', [
'action' => $action,
'value' => $this->actionRenderer->render($grid, $action, null),
]);
} | php | public function renderGlobalAction(GridViewInterface $grid, ActionInterface $action)
{
return $this->doRender($grid, 'global_action', [
'action' => $action,
'value' => $this->actionRenderer->render($grid, $action, null),
]);
} | [
"public",
"function",
"renderGlobalAction",
"(",
"GridViewInterface",
"$",
"grid",
",",
"ActionInterface",
"$",
"action",
")",
"{",
"return",
"$",
"this",
"->",
"doRender",
"(",
"$",
"grid",
",",
"'global_action'",
",",
"[",
"'action'",
"=>",
"$",
"action",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Renderer/Renderer.php#L162-L168 |
php-lug/lug | src/Bundle/GridBundle/Renderer/Renderer.php | Renderer.doRender | private function doRender(GridViewInterface $grid, $template, array $context = [])
{
$context['grid'] = $grid;
return $this->twig->render($this->resolveTemplate($grid->getDefinition(), $template), $context);
} | php | private function doRender(GridViewInterface $grid, $template, array $context = [])
{
$context['grid'] = $grid;
return $this->twig->render($this->resolveTemplate($grid->getDefinition(), $template), $context);
} | [
"private",
"function",
"doRender",
"(",
"GridViewInterface",
"$",
"grid",
",",
"$",
"template",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"$",
"context",
"[",
"'grid'",
"]",
"=",
"$",
"grid",
";",
"return",
"$",
"this",
"->",
"twig",
"->... | @param GridViewInterface $grid
@param string $template
@param mixed[] $context
@return string | [
"@param",
"GridViewInterface",
"$grid",
"@param",
"string",
"$template",
"@param",
"mixed",
"[]",
"$context"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Renderer/Renderer.php#L177-L182 |
php-lug/lug | src/Bundle/GridBundle/Renderer/Renderer.php | Renderer.resolveTemplate | private function resolveTemplate(GridInterface $grid, $template)
{
if ($grid->hasOption($option = $template.'_template')) {
return $grid->getOption($option);
}
if (isset($this->templates[$template])) {
return $this->templates[$template];
}
return '@L... | php | private function resolveTemplate(GridInterface $grid, $template)
{
if ($grid->hasOption($option = $template.'_template')) {
return $grid->getOption($option);
}
if (isset($this->templates[$template])) {
return $this->templates[$template];
}
return '@L... | [
"private",
"function",
"resolveTemplate",
"(",
"GridInterface",
"$",
"grid",
",",
"$",
"template",
")",
"{",
"if",
"(",
"$",
"grid",
"->",
"hasOption",
"(",
"$",
"option",
"=",
"$",
"template",
".",
"'_template'",
")",
")",
"{",
"return",
"$",
"grid",
... | @param GridInterface $grid
@param string $template
@return string | [
"@param",
"GridInterface",
"$grid",
"@param",
"string",
"$template"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Renderer/Renderer.php#L190-L201 |
WellCommerce/AppBundle | Form/DataTransformer/MediaEntityToIdentifierTransformer.php | MediaEntityToIdentifierTransformer.reverseTransform | public function reverseTransform($modelData, PropertyPathInterface $propertyPath, $value)
{
$unmodified = intval($value['unmodified']);
if ($unmodified === 1) {
return;
}
$item = null;
if (isset($value[0])) {
$id = $value[0];
$it... | php | public function reverseTransform($modelData, PropertyPathInterface $propertyPath, $value)
{
$unmodified = intval($value['unmodified']);
if ($unmodified === 1) {
return;
}
$item = null;
if (isset($value[0])) {
$id = $value[0];
$it... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"modelData",
",",
"PropertyPathInterface",
"$",
"propertyPath",
",",
"$",
"value",
")",
"{",
"$",
"unmodified",
"=",
"intval",
"(",
"$",
"value",
"[",
"'unmodified'",
"]",
")",
";",
"if",
"(",
"$",
"unmod... | Transforms identifier to entity
@param object $modelData
@param PropertyPathInterface $propertyPath
@param mixed $value | [
"Transforms",
"identifier",
"to",
"entity"
] | train | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Form/DataTransformer/MediaEntityToIdentifierTransformer.php#L32-L46 |
traderinteractive/filter-dates-php | src/Filter/DateTime.php | DateTime.filter | public static function filter($value, bool $allowNull = false, DateTimeZoneStandard $timezone = null)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof DateTimeStandard) {
return $value;
}
if (is_int($value) ... | php | public static function filter($value, bool $allowNull = false, DateTimeZoneStandard $timezone = null)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof DateTimeStandard) {
return $value;
}
if (is_int($value) ... | [
"public",
"static",
"function",
"filter",
"(",
"$",
"value",
",",
"bool",
"$",
"allowNull",
"=",
"false",
",",
"DateTimeZoneStandard",
"$",
"timezone",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"valueIsNullAndValid",
"(",
"$",
"allowNull",
",",
"$",
... | Filters the given value into a \DateTime object.
@param mixed $value The value to be filtered.
@param boolean $allowNull True to allow nulls through, and false (default) if nulls should
not be allowed.
@param DateTimeZoneStandard $timezone A \DateTimeZone object representing the timezo... | [
"Filters",
"the",
"given",
"value",
"into",
"a",
"\\",
"DateTime",
"object",
"."
] | train | https://github.com/traderinteractive/filter-dates-php/blob/f9e60f139da3ebb565317c5d62a6fb0c347be4ee/src/Filter/DateTime.php#L28-L47 |
traderinteractive/filter-dates-php | src/Filter/DateTime.php | DateTime.format | public static function format(DateTimeInterface $dateTime, string $format = 'c') : string
{
if (empty(trim($format))) {
throw new \InvalidArgumentException('$format is not a non-empty string');
}
return $dateTime->format($format);
} | php | public static function format(DateTimeInterface $dateTime, string $format = 'c') : string
{
if (empty(trim($format))) {
throw new \InvalidArgumentException('$format is not a non-empty string');
}
return $dateTime->format($format);
} | [
"public",
"static",
"function",
"format",
"(",
"DateTimeInterface",
"$",
"dateTime",
",",
"string",
"$",
"format",
"=",
"'c'",
")",
":",
"string",
"{",
"if",
"(",
"empty",
"(",
"trim",
"(",
"$",
"format",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"In... | Filters the give \DateTime object to a formatted string.
@param DateTimeInterface $dateTime The date to be formatted.
@param string $format The format of the outputted date string.
@return string
@throws \InvalidArgumentException Thrown if $format is not a string | [
"Filters",
"the",
"give",
"\\",
"DateTime",
"object",
"to",
"a",
"formatted",
"string",
"."
] | train | https://github.com/traderinteractive/filter-dates-php/blob/f9e60f139da3ebb565317c5d62a6fb0c347be4ee/src/Filter/DateTime.php#L59-L66 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Transport/TCP.php | TCP.connect | public function connect()
{
if($this->stream !== null) return;
$host = strval($this->config["host"]);
$port = strval($this->config["port"]);
$address = "tcp://" . (strstr($host, ":") !== FALSE ? "[" . $host . "]" : $host) . ":" . $port;
$options = empty($this->config["tls"]) ? array() : array("s... | php | public function connect()
{
if($this->stream !== null) return;
$host = strval($this->config["host"]);
$port = strval($this->config["port"]);
$address = "tcp://" . (strstr($host, ":") !== FALSE ? "[" . $host . "]" : $host) . ":" . $port;
$options = empty($this->config["tls"]) ? array() : array("s... | [
"public",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"!==",
"null",
")",
"return",
";",
"$",
"host",
"=",
"strval",
"(",
"$",
"this",
"->",
"config",
"[",
"\"host\"",
"]",
")",
";",
"$",
"port",
"=",
"strval",
"... | Connects to a remote server.
@throws Exception
@return void | [
"Connects",
"to",
"a",
"remote",
"server",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Transport/TCP.php#L44-L69 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Transport/TCP.php | TCP.read | public function read($length = 4096)
{
$this->connect();
$this->waitForReadyRead();
$data = @stream_get_contents($this->stream, $length);
Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);
if($data === FALSE)
{
throw new Exception("connection to serv... | php | public function read($length = 4096)
{
$this->connect();
$this->waitForReadyRead();
$data = @stream_get_contents($this->stream, $length);
Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);
if($data === FALSE)
{
throw new Exception("connection to serv... | [
"public",
"function",
"read",
"(",
"$",
"length",
"=",
"4096",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"this",
"->",
"waitForReadyRead",
"(",
")",
";",
"$",
"data",
"=",
"@",
"stream_get_contents",
"(",
"$",
"this",
"->",
"stream"... | Reads data from the stream.
@param integer $length
@throws Exception
@return Str | [
"Reads",
"data",
"from",
"the",
"stream",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Transport/TCP.php#L92-L107 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Transport/TCP.php | TCP.readLine | public function readLine($token = "\n")
{
$this->connect();
$line = Str::factory("");
while(!$line->endsWith($token))
{
$this->waitForReadyRead();
$data = @fgets($this->stream, 4096);
Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);
if(... | php | public function readLine($token = "\n")
{
$this->connect();
$line = Str::factory("");
while(!$line->endsWith($token))
{
$this->waitForReadyRead();
$data = @fgets($this->stream, 4096);
Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);
if(... | [
"public",
"function",
"readLine",
"(",
"$",
"token",
"=",
"\"\\n\"",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"$",
"line",
"=",
"Str",
"::",
"factory",
"(",
"\"\"",
")",
";",
"while",
"(",
"!",
"$",
"line",
"->",
"endsWith",
"(",
"$... | Reads a single line of data from the stream.
@param string $token
@throws Exception
@return Str | [
"Reads",
"a",
"single",
"line",
"of",
"data",
"from",
"the",
"stream",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Transport/TCP.php#L116-L148 |
mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/Type/PageSelectorType.php | PageSelectorType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$ph = \Core::make('helper/form/page_selector');
$view->vars = array_replace($view->vars, array(
'selector' => $ph->selectPage($view->vars["full_name"], $view->vars["value"]),
));
} | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$ph = \Core::make('helper/form/page_selector');
$view->vars = array_replace($view->vars, array(
'selector' => $ph->selectPage($view->vars["full_name"], $view->vars["value"]),
));
} | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"ph",
"=",
"\\",
"Core",
"::",
"make",
"(",
"'helper/form/page_selector'",
")",
";",
"$",
"view",
"->",
"vars... | {@inheritdoc} | [
"{"
] | train | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/Type/PageSelectorType.php#L34-L40 |
dstuecken/notify | src/Handler/MacOSHandler.php | MacOSHandler.handle | public function handle(NotificationInterface $notification, $level)
{
if ($notification instanceof TitleAwareInterface)
{
$command = $this->shellCommand . ' -e \'display notification "' . addslashes($notification->message()) . '" with title "' . addslashes($notification->title()) . '"\''... | php | public function handle(NotificationInterface $notification, $level)
{
if ($notification instanceof TitleAwareInterface)
{
$command = $this->shellCommand . ' -e \'display notification "' . addslashes($notification->message()) . '" with title "' . addslashes($notification->title()) . '"\''... | [
"public",
"function",
"handle",
"(",
"NotificationInterface",
"$",
"notification",
",",
"$",
"level",
")",
"{",
"if",
"(",
"$",
"notification",
"instanceof",
"TitleAwareInterface",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"shellCommand",
".",
"' -e \\... | Handle a notification
@return bool | [
"Handle",
"a",
"notification"
] | train | https://github.com/dstuecken/notify/blob/abccf0a6a272caf66baea74323f18e2212c6e11e/src/Handler/MacOSHandler.php#L30-L44 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.disconnect | public function disconnect()
{
if ( $this->state !== self::STATE_NOT_CONNECTED
&& $this->connection->isConnected() === true )
{
$tag = $this->getNextTag();
$this->connection->sendData( "{$tag} LOGOUT" );
// discard the "bye bye" message ("{$tag} OK Lo... | php | public function disconnect()
{
if ( $this->state !== self::STATE_NOT_CONNECTED
&& $this->connection->isConnected() === true )
{
$tag = $this->getNextTag();
$this->connection->sendData( "{$tag} LOGOUT" );
// discard the "bye bye" message ("{$tag} OK Lo... | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!==",
"self",
"::",
"STATE_NOT_CONNECTED",
"&&",
"$",
"this",
"->",
"connection",
"->",
"isConnected",
"(",
")",
"===",
"true",
")",
"{",
"$",
"tag",
"=",
"$",
... | Disconnects the transport from the IMAP server. | [
"Disconnects",
"the",
"transport",
"from",
"the",
"IMAP",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L478-L494 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.authenticate | public function authenticate( $user, $password )
{
if ( $this->state != self::STATE_NOT_AUTHENTICATED )
{
throw new ezcMailTransportException( "Tried to authenticate when there was no connection or when already authenticated." );
}
$tag = $this->getNextTag();
$th... | php | public function authenticate( $user, $password )
{
if ( $this->state != self::STATE_NOT_AUTHENTICATED )
{
throw new ezcMailTransportException( "Tried to authenticate when there was no connection or when already authenticated." );
}
$tag = $this->getNextTag();
$th... | [
"public",
"function",
"authenticate",
"(",
"$",
"user",
",",
"$",
"password",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_NOT_AUTHENTICATED",
")",
"{",
"throw",
"new",
"ezcMailTransportException",
"(",
"\"Tried to authenticate whe... | Authenticates the user to the IMAP server with $user and $password.
This method should be called directly after the construction of this
object.
If the server is waiting for the authentication process to respond, the
connection with the IMAP server will be closed, and false is returned,
and it is the application's ta... | [
"Authenticates",
"the",
"user",
"to",
"the",
"IMAP",
"server",
"with",
"$user",
"and",
"$password",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L522-L558 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.listMailboxes | public function listMailboxes( $reference = '', $mailbox = '*' )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMa... | php | public function listMailboxes( $reference = '', $mailbox = '*' )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMa... | [
"public",
"function",
"listMailboxes",
"(",
"$",
"reference",
"=",
"''",
",",
"$",
"mailbox",
"=",
"'*'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
... | Returns an array with the names of the available mailboxes for the user
currently authenticated on the IMAP server.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully.
For more information about $reference and $mailbox, consult
the IMAP RFCs d... | [
"Returns",
"an",
"array",
"with",
"the",
"names",
"of",
"the",
"available",
"mailboxes",
"for",
"the",
"user",
"currently",
"authenticated",
"on",
"the",
"IMAP",
"server",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L593-L626 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.getHierarchyDelimiter | public function getHierarchyDelimiter()
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call getDelimiter() when not success... | php | public function getHierarchyDelimiter()
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call getDelimiter() when not success... | [
"public",
"function",
"getHierarchyDelimiter",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
"&&",
"$",
"this",
"->",
"state",
"!=",
... | Returns the hierarchy delimiter of the IMAP server, useful for handling
nested IMAP folders.
For more information about the hierarchy delimiter, consult the IMAP RFCs
{@link http://www.faqs.org/rfcs/rfc1730.html} or
{@link http://www.faqs.org/rfcs/rfc2060.html}, section 6.3.8.
Before calling this method, a connection... | [
"Returns",
"the",
"hierarchy",
"delimiter",
"of",
"the",
"IMAP",
"server",
"useful",
"for",
"handling",
"nested",
"IMAP",
"folders",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L654-L685 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.selectMailbox | public function selectMailbox( $mailbox, $readOnly = false )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call selectMail... | php | public function selectMailbox( $mailbox, $readOnly = false )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call selectMail... | [
"public",
"function",
"selectMailbox",
"(",
"$",
"mailbox",
",",
"$",
"readOnly",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELEC... | Selects the mailbox $mailbox, which will be the active mailbox for the
subsequent commands until it is changed.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully.
Inbox is a special mailbox and can be specified with any case.
This method sho... | [
"Selects",
"the",
"mailbox",
"$mailbox",
"which",
"will",
"be",
"the",
"active",
"mailbox",
"for",
"the",
"subsequent",
"commands",
"until",
"it",
"is",
"changed",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L713-L751 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.createMailbox | public function createMailbox( $mailbox )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call createMailbox() when not succ... | php | public function createMailbox( $mailbox )
{
if ( $this->state != self::STATE_AUTHENTICATED &&
$this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call createMailbox() when not succ... | [
"public",
"function",
"createMailbox",
"(",
"$",
"mailbox",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_AUTHENTICATED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
"&&",
"$",
"this",
"->",
"stat... | Creates the mailbox $mailbox.
Inbox cannot be created.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully.
@throws ezcMailTransportException
if the current server state is not accepted
or if the server sent a negative response
@param string $... | [
"Creates",
"the",
"mailbox",
"$mailbox",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L767-L784 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.copyMessages | public function copyMessages( $messages, $destination )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't... | php | public function copyMessages( $messages, $destination )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't... | [
"public",
"function",
"copyMessages",
"(",
"$",
"messages",
",",
"$",
"destination",
")",
"{",
"$",
"uid",
"=",
"(",
"$",
"this",
"->",
"options",
"->",
"uidReferencing",
")",
"?",
"self",
"::",
"UID",
":",
"self",
"::",
"NO_UID",
";",
"if",
"(",
"$"... | Copies message(s) from the currently selected mailbox to mailbox
$destination.
This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
Warning! When using unique IDs referencing and trying to copy a message
with an ID that does not ... | [
"Copies",
"message",
"(",
"s",
")",
"from",
"the",
"currently",
"selected",
"mailbox",
"to",
"mailbox",
"$destination",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L906-L925 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.listMessages | public function listMessages( $contentType = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMessages() on the IMAP transport when a mailbox is not selected." );
... | php | public function listMessages( $contentType = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listMessages() on the IMAP transport when a mailbox is not selected." );
... | [
"public",
"function",
"listMessages",
"(",
"$",
"contentType",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED_READONLY",
")",
"{",
... | Returns a list of the not deleted messages in the current mailbox.
It returns only the messages with the flag DELETED not set.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully, and a mailbox
must be selected.
The format of the returned arra... | [
"Returns",
"a",
"list",
"of",
"the",
"not",
"deleted",
"messages",
"in",
"the",
"current",
"mailbox",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L958-L1019 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.fetchSizes | public function fetchSizes( $messages )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call fetchSizes... | php | public function fetchSizes( $messages )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call fetchSizes... | [
"public",
"function",
"fetchSizes",
"(",
"$",
"messages",
")",
"{",
"$",
"uid",
"=",
"(",
"$",
"this",
"->",
"options",
"->",
"uidReferencing",
")",
"?",
"self",
"::",
"UID",
":",
"self",
"::",
"NO_UID",
";",
"if",
"(",
"$",
"this",
"->",
"state",
... | Fetches the sizes in bytes for messages $messages.
This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
$messages is an array of message numbers, for example:
<code>
array( 1, 2, 4 );
</code>
The format of the returned array is:... | [
"Fetches",
"the",
"sizes",
"in",
"bytes",
"for",
"messages",
"$messages",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1065-L1106 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.status | public function status( &$numMessages, &$sizeMessages, &$recent = 0, &$unseen = 0 )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call status() on the IMAP transport when a mailbox... | php | public function status( &$numMessages, &$sizeMessages, &$recent = 0, &$unseen = 0 )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call status() on the IMAP transport when a mailbox... | [
"public",
"function",
"status",
"(",
"&",
"$",
"numMessages",
",",
"&",
"$",
"sizeMessages",
",",
"&",
"$",
"recent",
"=",
"0",
",",
"&",
"$",
"unseen",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED"... | Returns information about the messages in the current mailbox.
The information returned through the parameters is:
- $numMessages = number of not deleted messages in the selected mailbox
- $sizeMessages = sum of the not deleted messages sizes
- $recent = number of recent and not deleted messages
- $unseen = number of ... | [
"Returns",
"information",
"about",
"the",
"messages",
"in",
"the",
"current",
"mailbox",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1142-L1158 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.delete | public function delete( $msgNum )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED )
{
throw new ezcMailTransportException( "Can't call delete() when a mailbox is not selected." );
}
$tag = $this->g... | php | public function delete( $msgNum )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED )
{
throw new ezcMailTransportException( "Can't call delete() when a mailbox is not selected." );
}
$tag = $this->g... | [
"public",
"function",
"delete",
"(",
"$",
"msgNum",
")",
"{",
"$",
"uid",
"=",
"(",
"$",
"this",
"->",
"options",
"->",
"uidReferencing",
")",
"?",
"self",
"::",
"UID",
":",
"self",
"::",
"NO_UID",
";",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
... | Deletes the message with the message number $msgNum from the current mailbox.
This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
The message number $msgNum must be a valid identifier fetched with e.g.
{@link listMessages()}.
T... | [
"Deletes",
"the",
"message",
"with",
"the",
"message",
"number",
"$msgNum",
"from",
"the",
"current",
"mailbox",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1184-L1202 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.top | public function top( $msgNum, $chars = 0 )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call top() o... | php | public function top( $msgNum, $chars = 0 )
{
$uid = ( $this->options->uidReferencing ) ? self::UID : self::NO_UID;
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call top() o... | [
"public",
"function",
"top",
"(",
"$",
"msgNum",
",",
"$",
"chars",
"=",
"0",
")",
"{",
"$",
"uid",
"=",
"(",
"$",
"this",
"->",
"options",
"->",
"uidReferencing",
")",
"?",
"self",
"::",
"UID",
":",
"self",
"::",
"NO_UID",
";",
"if",
"(",
"$",
... | Returns the headers and the first characters from message $msgNum,
without setting the SEEN flag.
This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
If the command failed or if it was not supported by the server an empty
string... | [
"Returns",
"the",
"headers",
"and",
"the",
"first",
"characters",
"from",
"message",
"$msgNum",
"without",
"setting",
"the",
"SEEN",
"flag",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1252-L1355 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.listUniqueIdentifiers | public function listUniqueIdentifiers( $msgNum = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listUniqueIdentifiers() on the IMAP transport when a mailbox is not selec... | php | public function listUniqueIdentifiers( $msgNum = null )
{
if ( $this->state != self::STATE_SELECTED &&
$this->state != self::STATE_SELECTED_READONLY )
{
throw new ezcMailTransportException( "Can't call listUniqueIdentifiers() on the IMAP transport when a mailbox is not selec... | [
"public",
"function",
"listUniqueIdentifiers",
"(",
"$",
"msgNum",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED",
"&&",
"$",
"this",
"->",
"state",
"!=",
"self",
"::",
"STATE_SELECTED_READONLY",
")",
"{"... | Returns the unique identifiers for the messages from the current mailbox.
You can fetch the unique identifier for a specific message by
providing the $msgNum parameter.
The unique identifier can be used to recognize mail from servers
between requests. In contrast to the message numbers the unique
numbers assigned to ... | [
"Returns",
"the",
"unique",
"identifiers",
"for",
"the",
"messages",
"from",
"the",
"current",
"mailbox",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1389-L1435 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php | ezcMailImapTransport.fetchAll | public function fetchAll( $deleteFromServer = false )
{
if ( $this->options->uidReferencing )
{
$messages = array_values( $this->listUniqueIdentifiers() );
}
else
{
$messages = array_keys( $this->listMessages() );
}
return new ezcMailI... | php | public function fetchAll( $deleteFromServer = false )
{
if ( $this->options->uidReferencing )
{
$messages = array_values( $this->listUniqueIdentifiers() );
}
else
{
$messages = array_keys( $this->listMessages() );
}
return new ezcMailI... | [
"public",
"function",
"fetchAll",
"(",
"$",
"deleteFromServer",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"->",
"uidReferencing",
")",
"{",
"$",
"messages",
"=",
"array_values",
"(",
"$",
"this",
"->",
"listUniqueIdentifiers",
"(",
"... | Returns an {@link ezcMailImapSet} with all the messages from the current mailbox.
This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
If $deleteFromServer is set to true the mail will be marked for deletion
after retrieval. If n... | [
"Returns",
"an",
"{",
"@link",
"ezcMailImapSet",
"}",
"with",
"all",
"the",
"messages",
"from",
"the",
"current",
"mailbox",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/imap/imap_transport.php#L1476-L1488 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.