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
OKTOTV/OktolabMediaBundle
Controller/EpisodeController.php
EpisodeController.newAction
public function newAction(Request $request) { $entity = new Episode(); $form = $this->createCreateForm($entity); return [ 'entity' => $entity, 'form' => $form->createView(), ]; }
php
public function newAction(Request $request) { $entity = new Episode(); $form = $this->createCreateForm($entity); return [ 'entity' => $entity, 'form' => $form->createView(), ]; }
[ "public", "function", "newAction", "(", "Request", "$", "request", ")", "{", "$", "entity", "=", "new", "Episode", "(", ")", ";", "$", "form", "=", "$", "this", "->", "createCreateForm", "(", "$", "entity", ")", ";", "return", "[", "'entity'", "=>", ...
Displays a form to create a new Episode entity. @Route("/new", name="oktolab_episode_new") @Method("GET") @Template()
[ "Displays", "a", "form", "to", "create", "a", "new", "Episode", "entity", "." ]
train
https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L125-L134
OKTOTV/OktolabMediaBundle
Controller/EpisodeController.php
EpisodeController.showAction
public function showAction($uniqID) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository( $this->container->getParameter('oktolab_media.episode_class') )->findOneBy(array('uniqID' => $uniqID)); if (!$entity) { throw $this->createNotFoundEx...
php
public function showAction($uniqID) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository( $this->container->getParameter('oktolab_media.episode_class') )->findOneBy(array('uniqID' => $uniqID)); if (!$entity) { throw $this->createNotFoundEx...
[ "public", "function", "showAction", "(", "$", "uniqID", ")", "{", "$", "em", "=", "$", "this", "->", "getDoctrine", "(", ")", "->", "getManager", "(", ")", ";", "$", "entity", "=", "$", "em", "->", "getRepository", "(", "$", "this", "->", "container"...
Finds and displays a Episode entity. @Route("/{uniqID}", name="oktolab_episode_show") @Method("GET") @Template()
[ "Finds", "and", "displays", "a", "Episode", "entity", "." ]
train
https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L186-L198
OKTOTV/OktolabMediaBundle
Controller/EpisodeController.php
EpisodeController.editAction
public function editAction(Request $request, $episode) { $entity = $episode; $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id); return [ 'entity' => $entity, 'form' => $editForm->createView(), 'delete_form' =>...
php
public function editAction(Request $request, $episode) { $entity = $episode; $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id); return [ 'entity' => $entity, 'form' => $editForm->createView(), 'delete_form' =>...
[ "public", "function", "editAction", "(", "Request", "$", "request", ",", "$", "episode", ")", "{", "$", "entity", "=", "$", "episode", ";", "$", "editForm", "=", "$", "this", "->", "createEditForm", "(", "$", "entity", ")", ";", "$", "deleteForm", "=",...
Displays a form to edit an existing Episode entity. @Route("/{episode}/edit", name="oktolab_episode_edit") @ParamConverter("episode", class="OktolabMediaBundle:Episode") @Method("GET") @Template()
[ "Displays", "a", "form", "to", "edit", "an", "existing", "Episode", "entity", "." ]
train
https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L208-L220
OKTOTV/OktolabMediaBundle
Controller/EpisodeController.php
EpisodeController.createEditForm
private function createEditForm(Episode $entity) { $form = $this->createForm( new EpisodeType(), $entity, [ 'action' => $this->generateUrl( 'oktolab_episode_update', ['id' => $entity->getId()] ), ...
php
private function createEditForm(Episode $entity) { $form = $this->createForm( new EpisodeType(), $entity, [ 'action' => $this->generateUrl( 'oktolab_episode_update', ['id' => $entity->getId()] ), ...
[ "private", "function", "createEditForm", "(", "Episode", "$", "entity", ")", "{", "$", "form", "=", "$", "this", "->", "createForm", "(", "new", "EpisodeType", "(", ")", ",", "$", "entity", ",", "[", "'action'", "=>", "$", "this", "->", "generateUrl", ...
Creates a form to edit a Episode entity. @param Episode $entity The entity @return \Symfony\Component\Form\Form The form
[ "Creates", "a", "form", "to", "edit", "a", "Episode", "entity", "." ]
train
https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L229-L250
OKTOTV/OktolabMediaBundle
Controller/EpisodeController.php
EpisodeController.deleteAction
public function deleteAction(Request $request, $id) { $form = $this->createDeleteForm($id); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('OktolabMediaBundle:Episode')->find($id); ...
php
public function deleteAction(Request $request, $id) { $form = $this->createDeleteForm($id); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('OktolabMediaBundle:Episode')->find($id); ...
[ "public", "function", "deleteAction", "(", "Request", "$", "request", ",", "$", "id", ")", "{", "$", "form", "=", "$", "this", "->", "createDeleteForm", "(", "$", "id", ")", ";", "$", "form", "->", "handleRequest", "(", "$", "request", ")", ";", "if"...
Deletes a Episode entity. @Route("/{id}", name="oktolab_episode_delete") @Method("DELETE")
[ "Deletes", "a", "Episode", "entity", "." ]
train
https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L306-L323
OKTOTV/OktolabMediaBundle
Controller/EpisodeController.php
EpisodeController.listRemoteEpisodes
public function listRemoteEpisodes(Keychain $keychain) { $episodes_url = $this->get('bprs_applink')->getApiUrlsForKey( $keychain, 'oktolab_media_api_list_episodes' ); if ($episodes_url) { $client = new Client(); $response = $client->request( ...
php
public function listRemoteEpisodes(Keychain $keychain) { $episodes_url = $this->get('bprs_applink')->getApiUrlsForKey( $keychain, 'oktolab_media_api_list_episodes' ); if ($episodes_url) { $client = new Client(); $response = $client->request( ...
[ "public", "function", "listRemoteEpisodes", "(", "Keychain", "$", "keychain", ")", "{", "$", "episodes_url", "=", "$", "this", "->", "get", "(", "'bprs_applink'", ")", "->", "getApiUrlsForKey", "(", "$", "keychain", ",", "'oktolab_media_api_list_episodes'", ")", ...
Browse Episodes of an remote application (with the keychain) @Route("/remote/{keychain}", name="oktolab_media_remote_episodes") @Method("GET") @Template()
[ "Browse", "Episodes", "of", "an", "remote", "application", "(", "with", "the", "keychain", ")" ]
train
https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/EpisodeController.php#L423-L448
simbiosis-group/yii2-helper
actions/DeleteAllAction.php
DeleteAllAction.run
public function run() { $model = $this->modelFullName; if ($model::deleteAll($this->conditions)) { Yii::$app->getSession()->setFlash('success', 'You have deleted all selected records!'); return $this->controller->goBack(); } Yii::$app->getSession(...
php
public function run() { $model = $this->modelFullName; if ($model::deleteAll($this->conditions)) { Yii::$app->getSession()->setFlash('success', 'You have deleted all selected records!'); return $this->controller->goBack(); } Yii::$app->getSession(...
[ "public", "function", "run", "(", ")", "{", "$", "model", "=", "$", "this", "->", "modelFullName", ";", "if", "(", "$", "model", "::", "deleteAll", "(", "$", "this", "->", "conditions", ")", ")", "{", "Yii", "::", "$", "app", "->", "getSession", "(...
Runs the action @return string result content
[ "Runs", "the", "action" ]
train
https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/actions/DeleteAllAction.php#L69-L81
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.Image_Toolbox
function Image_Toolbox() { $args = func_get_args(); $argc = func_num_args(); //get GD information. see what types we can handle $gd_info = function_exists('gd_info') ? gd_info() : $this->_gd_info(); preg_match("/\A[\D]*([\d+\.]*)[\D]*\Z/", $gd_info['GD Version'], $matches); ...
php
function Image_Toolbox() { $args = func_get_args(); $argc = func_num_args(); //get GD information. see what types we can handle $gd_info = function_exists('gd_info') ? gd_info() : $this->_gd_info(); preg_match("/\A[\D]*([\d+\.]*)[\D]*\Z/", $gd_info['GD Version'], $matches); ...
[ "function", "Image_Toolbox", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "argc", "=", "func_num_args", "(", ")", ";", "//get GD information. see what types we can handle", "$", "gd_info", "=", "function_exists", "(", "'gd_info'", ")", "...
The class constructor. Determines the image features of the server and sets the according values.<br> Additionally you can specify a image to be created/loaded. like {@link addImage() addImage}. If no parameter is given, no image resource will be generated<br> Or:<br> <i>string</i> <b>$file</b> imagefile to load<br> ...
[ "The", "class", "constructor", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L175-L239
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.getServerFeatures
function getServerFeatures() { $features = array(); $features['gd_version'] = $this->_gd_version_number; $features['gif'] = $this->_types[1]['supported']; $features['jpg'] = $this->_types[2]['supported']; $features['png'] = $this->_types[3]['supported']; $features['tt...
php
function getServerFeatures() { $features = array(); $features['gd_version'] = $this->_gd_version_number; $features['gif'] = $this->_types[1]['supported']; $features['jpg'] = $this->_types[2]['supported']; $features['png'] = $this->_types[3]['supported']; $features['tt...
[ "function", "getServerFeatures", "(", ")", "{", "$", "features", "=", "array", "(", ")", ";", "$", "features", "[", "'gd_version'", "]", "=", "$", "this", "->", "_gd_version_number", ";", "$", "features", "[", "'gif'", "]", "=", "$", "this", "->", "_ty...
Returns an assocative array with information about the image features of this server Array values: <ul> <li>'gd_version' -> what GD version is installed on this server (e.g. 2.0)</li> <li>'gif' -> 0 = not supported, 1 = reading is supported, 2 = creating is supported</li> <li>'jpg' -> 0 = not supported, 1 = reading is...
[ "Returns", "an", "assocative", "array", "with", "information", "about", "the", "image", "features", "of", "this", "server" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L255-L264
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.newImage
function newImage() { $args = func_get_args(); $argc = func_num_args(); if ($this->_addImage($argc, $args)) { foreach ($this->_img['operator'] as $key => $value) { $this->_img['main'][$key] = $value; } $this->_img['main...
php
function newImage() { $args = func_get_args(); $argc = func_num_args(); if ($this->_addImage($argc, $args)) { foreach ($this->_img['operator'] as $key => $value) { $this->_img['main'][$key] = $value; } $this->_img['main...
[ "function", "newImage", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "argc", "=", "func_num_args", "(", ")", ";", "if", "(", "$", "this", "->", "_addImage", "(", "$", "argc", ",", "$", "args", ")", ")", "{", "foreach", "(...
Flush all image resources and init a new one Parameter:<br> <i>string</i> <b>$file</b> imagefile to load<br> Or:<br> <i>integer</i> <b>$width</b> imagewidth of new image to be created<br> <i>integer</i> <b>$height</b> imageheight of new image to be created<br> <i>string</i> <b>$fillcolor</b> optional fill the new imag...
[ "Flush", "all", "image", "resources", "and", "init", "a", "new", "one" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L276-L296
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._gd_info
function _gd_info() { $array = array( "GD Version" => "", "FreeType Support" => false, "FreeType Linkage" => "", "T1Lib Support" => false, "GIF Read Support" => false, "GIF Create Support" => false, "JPG Support" => false, ...
php
function _gd_info() { $array = array( "GD Version" => "", "FreeType Support" => false, "FreeType Linkage" => "", "T1Lib Support" => false, "GIF Read Support" => false, "GIF Create Support" => false, "JPG Support" => false, ...
[ "function", "_gd_info", "(", ")", "{", "$", "array", "=", "array", "(", "\"GD Version\"", "=>", "\"\"", ",", "\"FreeType Support\"", "=>", "false", ",", "\"FreeType Linkage\"", "=>", "\"\"", ",", "\"T1Lib Support\"", "=>", "false", ",", "\"GIF Read Support\"", "...
Reimplements the original PHP {@link gd_info()} function for older PHP versions @access private @return array associative array with info about the GD library of the server
[ "Reimplements", "the", "original", "PHP", "{", "@link", "gd_info", "()", "}", "function", "for", "older", "PHP", "versions" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L304-L420
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._hexToPHPColor
function _hexToPHPColor($hex) { $length = strlen($hex); $dr = hexdec(substr($hex, $length - 6, 2)); $dg = hexdec(substr($hex, $length - 4, 2)); $db = hexdec(substr($hex, $length - 2, 2)); $color = ($dr << 16) + ($dg << 8) + $db; return $color; }
php
function _hexToPHPColor($hex) { $length = strlen($hex); $dr = hexdec(substr($hex, $length - 6, 2)); $dg = hexdec(substr($hex, $length - 4, 2)); $db = hexdec(substr($hex, $length - 2, 2)); $color = ($dr << 16) + ($dg << 8) + $db; return $color; }
[ "function", "_hexToPHPColor", "(", "$", "hex", ")", "{", "$", "length", "=", "strlen", "(", "$", "hex", ")", ";", "$", "dr", "=", "hexdec", "(", "substr", "(", "$", "hex", ",", "$", "length", "-", "6", ",", "2", ")", ")", ";", "$", "dg", "=",...
Convert a color defined in hexvalues to the PHP color format @access private @param string $hex color value in hexformat (e.g. '#FF0000') @return integer color value in PHP format
[ "Convert", "a", "color", "defined", "in", "hexvalues", "to", "the", "PHP", "color", "format" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L429-L437
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._hexToDecColor
function _hexToDecColor($hex) { $length = strlen($hex); $color['red'] = hexdec(substr($hex, $length - 6, 2)); $color['green'] = hexdec(substr($hex, $length - 4, 2)); $color['blue'] = hexdec(substr($hex, $length - 2, 2)); return $color; }
php
function _hexToDecColor($hex) { $length = strlen($hex); $color['red'] = hexdec(substr($hex, $length - 6, 2)); $color['green'] = hexdec(substr($hex, $length - 4, 2)); $color['blue'] = hexdec(substr($hex, $length - 2, 2)); return $color; }
[ "function", "_hexToDecColor", "(", "$", "hex", ")", "{", "$", "length", "=", "strlen", "(", "$", "hex", ")", ";", "$", "color", "[", "'red'", "]", "=", "hexdec", "(", "substr", "(", "$", "hex", ",", "$", "length", "-", "6", ",", "2", ")", ")", ...
Convert a color defined in hexvalues to corresponding dezimal values @access private @param string $hex color value in hexformat (e.g. '#FF0000') @return array associative array with color values in dezimal format (fields: 'red', 'green', 'blue')
[ "Convert", "a", "color", "defined", "in", "hexvalues", "to", "corresponding", "dezimal", "values" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L446-L453
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._addImage
function _addImage($argc, $args) { if (($argc == 2 || $argc == 3) && is_int($args[0]) && is_int($args[1]) && (is_string($args[2]) || !isset($args[2]))) { //neues leeres bild mit width und height (fillcolor optional) $this->_img['operator']['width'] = $args[0]; $th...
php
function _addImage($argc, $args) { if (($argc == 2 || $argc == 3) && is_int($args[0]) && is_int($args[1]) && (is_string($args[2]) || !isset($args[2]))) { //neues leeres bild mit width und height (fillcolor optional) $this->_img['operator']['width'] = $args[0]; $th...
[ "function", "_addImage", "(", "$", "argc", ",", "$", "args", ")", "{", "if", "(", "(", "$", "argc", "==", "2", "||", "$", "argc", "==", "3", ")", "&&", "is_int", "(", "$", "args", "[", "0", "]", ")", "&&", "is_int", "(", "$", "args", "[", "...
Generate a new image resource based on the given parameters Parameter: <i>string</i> <b>$file</b> imagefile to load<br> Or:<br> <i>integer</i> <b>$width</b> imagewidth of new image to be created<br> <i>integer</i> <b>$height</b> imageheight of new image to be created<br> <i>string</i> <b>$fillcolor</b> optional fill t...
[ "Generate", "a", "new", "image", "resource", "based", "on", "the", "given", "parameters" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L467-L505
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._loadFile
function _loadFile($filename) { if (file_exists($filename)) { $info = getimagesize($filename); $filedata['width'] = $info[0]; $filedata['height'] = $info[1]; ($filedata['width'] >= $filedata['height']) ? ($filedata['bias'] = IMAGE_TOOLBOX_BIAS_HORIZONT...
php
function _loadFile($filename) { if (file_exists($filename)) { $info = getimagesize($filename); $filedata['width'] = $info[0]; $filedata['height'] = $info[1]; ($filedata['width'] >= $filedata['height']) ? ($filedata['bias'] = IMAGE_TOOLBOX_BIAS_HORIZONT...
[ "function", "_loadFile", "(", "$", "filename", ")", "{", "if", "(", "file_exists", "(", "$", "filename", ")", ")", "{", "$", "info", "=", "getimagesize", "(", "$", "filename", ")", ";", "$", "filedata", "[", "'width'", "]", "=", "$", "info", "[", "...
Loads a image file @access private @param string $filename imagefile to load @return array associative array with the loaded filedata
[ "Loads", "a", "image", "file" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L514-L570
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.output
function output($output_type = false, $output_quality = false, $dither = false) { if ($output_type === false) { $output_type = $this->_img['main']['output_type']; } switch ($output_type) { case 1: case 'gif': case 'GIF': ...
php
function output($output_type = false, $output_quality = false, $dither = false) { if ($output_type === false) { $output_type = $this->_img['main']['output_type']; } switch ($output_type) { case 1: case 'gif': case 'GIF': ...
[ "function", "output", "(", "$", "output_type", "=", "false", ",", "$", "output_quality", "=", "false", ",", "$", "dither", "=", "false", ")", "{", "if", "(", "$", "output_type", "===", "false", ")", "{", "$", "output_type", "=", "$", "this", "->", "_...
Output a image to the browser $output_type can be one of the following:<br> <ul> <li>'gif' -> gif image (if supported) (8-bit indexed colors)</li> <li>'png' -> png image (if supported) (truecolor)</li> <li>'png8' -> png image (if supported) (8-bit indexed colors)</li> <li>'jpg' -> jpeg image (if supported) (truecolor)...
[ "Output", "a", "image", "to", "the", "browser" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L593-L690
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.setResizeMethod
function setResizeMethod($method) { switch ($method) { case 1: case 'resize': $this->_resize_function = 'imagecopyresized'; break; case 2: case 'resample': if (!function_exists('imagecopyresampled')) ...
php
function setResizeMethod($method) { switch ($method) { case 1: case 'resize': $this->_resize_function = 'imagecopyresized'; break; case 2: case 'resample': if (!function_exists('imagecopyresampled')) ...
[ "function", "setResizeMethod", "(", "$", "method", ")", "{", "switch", "(", "$", "method", ")", "{", "case", "1", ":", "case", "'resize'", ":", "$", "this", "->", "_resize_function", "=", "'imagecopyresized'", ";", "break", ";", "case", "2", ":", "case",...
Sets the resize method of choice $method can be one of the following:<br> <ul> <li>'resize' -> supported by every version of GD (fast but ugly resize of image)</li> <li>'resample' -> only supported by GD version >= 2.0 (slower but antialiased resize of image)</li> <li>'workaround' -> supported by every version of GD (...
[ "Sets", "the", "resize", "method", "of", "choice" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L827-L860
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.newOutputSize
function newOutputSize($width, $height, $mode = 0, $autorotate = false, $bgcolor = '#000000') { if ($width > 0 && $height > 0 && is_int($width) && is_int($height)) { //ignore aspectratio if (!$mode) { //do not crop to get correct aspectratio ...
php
function newOutputSize($width, $height, $mode = 0, $autorotate = false, $bgcolor = '#000000') { if ($width > 0 && $height > 0 && is_int($width) && is_int($height)) { //ignore aspectratio if (!$mode) { //do not crop to get correct aspectratio ...
[ "function", "newOutputSize", "(", "$", "width", ",", "$", "height", ",", "$", "mode", "=", "0", ",", "$", "autorotate", "=", "false", ",", "$", "bgcolor", "=", "'#000000'", ")", "{", "if", "(", "$", "width", ">", "0", "&&", "$", "height", ">", "0...
Resize the current image if $width = 0 the new width will be calculated from the $height value preserving the correct aspectratio.<br> if $height = 0 the new height will be calculated from the $width value preserving the correct aspectratio.<br> $mode can be one of the following:<br> <ul> <li>0 -> image will be resi...
[ "Resize", "the", "current", "image" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L887-L1041
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.addImage
function addImage() { $args = func_get_args(); $argc = func_num_args(); if ($this->_addImage($argc, $args)) { return true; } else { //trigger_error($this->_error_prefix . 'failed to add image.', E_USER_ERROR); return false;...
php
function addImage() { $args = func_get_args(); $argc = func_num_args(); if ($this->_addImage($argc, $args)) { return true; } else { //trigger_error($this->_error_prefix . 'failed to add image.', E_USER_ERROR); return false;...
[ "function", "addImage", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "argc", "=", "func_num_args", "(", ")", ";", "if", "(", "$", "this", "->", "_addImage", "(", "$", "argc", ",", "$", "args", ")", ")", "{", "return", "tr...
Adds a new image resource based on the given parameters. It does not overwrite the existing image resource.<br> Instead it is used to load a second image to merge with the existing image. Parameter:<br> <i>string</i> <b>$file</b> imagefile to load<br> Or:<br> <i>integer</i> <b>$width</b> imagewidth of new image to be...
[ "Adds", "a", "new", "image", "resource", "based", "on", "the", "given", "parameters", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1056-L1070
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.blend
function blend($x = 0, $y = 0, $mode = IMAGE_TOOLBOX_BLEND_COPY, $percent = 100) { if (is_string($x) || is_string($y)) { list($xalign, $xalign_offset) = explode(" ", $x); list($yalign, $yalign_offset) = explode(" ", $y); } if (is_string($x)) { ...
php
function blend($x = 0, $y = 0, $mode = IMAGE_TOOLBOX_BLEND_COPY, $percent = 100) { if (is_string($x) || is_string($y)) { list($xalign, $xalign_offset) = explode(" ", $x); list($yalign, $yalign_offset) = explode(" ", $y); } if (is_string($x)) { ...
[ "function", "blend", "(", "$", "x", "=", "0", ",", "$", "y", "=", "0", ",", "$", "mode", "=", "IMAGE_TOOLBOX_BLEND_COPY", ",", "$", "percent", "=", "100", ")", "{", "if", "(", "is_string", "(", "$", "x", ")", "||", "is_string", "(", "$", "y", "...
Blend two images. Original image and the image loaded with {@link addImage() addImage}<br> NOTE: This operation can take very long and is not intended for realtime use. (but of course depends on the power of your server :) ) IMPORTANT: {@link imagecopymerge() imagecopymerged} doesn't work with PHP 4.3.2. Bug ID: {@li...
[ "Blend", "two", "images", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1112-L1199
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._imageBlend
function _imageBlend($mode, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $percent) { if ($mode == IMAGE_TOOLBOX_BLEND_COPY) { if ($percent == 100) { imagecopy($this->_img['main']['resource'], $this->_img['operator']['resource'], $dst_x, $dst_y, $src_x, $src...
php
function _imageBlend($mode, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $percent) { if ($mode == IMAGE_TOOLBOX_BLEND_COPY) { if ($percent == 100) { imagecopy($this->_img['main']['resource'], $this->_img['operator']['resource'], $dst_x, $dst_y, $src_x, $src...
[ "function", "_imageBlend", "(", "$", "mode", ",", "$", "dst_x", ",", "$", "dst_y", ",", "$", "src_x", ",", "$", "src_y", ",", "$", "src_w", ",", "$", "src_h", ",", "$", "percent", ")", "{", "if", "(", "$", "mode", "==", "IMAGE_TOOLBOX_BLEND_COPY", ...
Blend two images. @access private
[ "Blend", "two", "images", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1206-L1244
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._calculateBlendvalue
function _calculateBlendvalue($mode, $colorrgb1, $colorrgb2) { switch ($mode) { case IMAGE_TOOLBOX_BLEND_MULTIPLY: $c['red'] = ($colorrgb1['red'] * $colorrgb2['red']) >> 8; $c['green'] = ($colorrgb1['green'] * $colorrgb2['green']) >> 8; $c[...
php
function _calculateBlendvalue($mode, $colorrgb1, $colorrgb2) { switch ($mode) { case IMAGE_TOOLBOX_BLEND_MULTIPLY: $c['red'] = ($colorrgb1['red'] * $colorrgb2['red']) >> 8; $c['green'] = ($colorrgb1['green'] * $colorrgb2['green']) >> 8; $c[...
[ "function", "_calculateBlendvalue", "(", "$", "mode", ",", "$", "colorrgb1", ",", "$", "colorrgb2", ")", "{", "switch", "(", "$", "mode", ")", "{", "case", "IMAGE_TOOLBOX_BLEND_MULTIPLY", ":", "$", "c", "[", "'red'", "]", "=", "(", "$", "colorrgb1", "[",...
Calculate blend values for given blend mode @access private
[ "Calculate", "blend", "values", "for", "given", "blend", "mode" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1251-L1316
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._iso2uni
function _iso2uni($isoline) { $iso2uni = array( 173 => "&#161;", 155 => "&#162;", 156 => "&#163;", 15 => "&#164;", 157 => "&#165;", 124 => "&#166;", 21 => "&#167;", 249 => "&#168;", 184 => "&#169;", ...
php
function _iso2uni($isoline) { $iso2uni = array( 173 => "&#161;", 155 => "&#162;", 156 => "&#163;", 15 => "&#164;", 157 => "&#165;", 124 => "&#166;", 21 => "&#167;", 249 => "&#168;", 184 => "&#169;", ...
[ "function", "_iso2uni", "(", "$", "isoline", ")", "{", "$", "iso2uni", "=", "array", "(", "173", "=>", "\"&#161;\"", ",", "155", "=>", "\"&#162;\"", ",", "156", "=>", "\"&#163;\"", ",", "15", "=>", "\"&#164;\"", ",", "157", "=>", "\"&#165;\"", ",", "12...
convert iso character coding to unicode (PHP conform) needed for TTF text generation of special characters (Latin-2) @access private
[ "convert", "iso", "character", "coding", "to", "unicode", "(", "PHP", "conform", ")", "needed", "for", "TTF", "text", "generation", "of", "special", "characters", "(", "Latin", "-", "2", ")" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1324-L1429
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox.addText
function addText($text, $font, $size, $color, $x, $y, $angle = 0) { global $HTTP_SERVER_VARS; if (substr($font, 0, 1) == DIRECTORY_SEPARATOR || (substr($font, 1, 1) == ":" && (substr($font, 2, 1) == "\\" || substr($font, 2, 1) == "/"))) { $prepath = ''; } else ...
php
function addText($text, $font, $size, $color, $x, $y, $angle = 0) { global $HTTP_SERVER_VARS; if (substr($font, 0, 1) == DIRECTORY_SEPARATOR || (substr($font, 1, 1) == ":" && (substr($font, 2, 1) == "\\" || substr($font, 2, 1) == "/"))) { $prepath = ''; } else ...
[ "function", "addText", "(", "$", "text", ",", "$", "font", ",", "$", "size", ",", "$", "color", ",", "$", "x", ",", "$", "y", ",", "$", "angle", "=", "0", ")", "{", "global", "$", "HTTP_SERVER_VARS", ";", "if", "(", "substr", "(", "$", "font", ...
Writes text over the image only TTF fonts are supported at the moment $x:<br> You can also use the following keywords ('left', 'center' or 'middle', 'right').<br> Additionally you can specify an offset in pixel with the keywords like this 'left +10'.<br> (default = 0) $y:<br> You can also use the following keywords ...
[ "Writes", "text", "over", "the", "image" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1454-L1513
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._imageCopyResampledWorkaround
function _imageCopyResampledWorkaround(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) { /* for ($i = 0; $i < imagecolorstotal($src_img); $i++) { $colors = ImageColorsForIndex ($src_img, $i); ImageColorAllocate ($dst_img, $colors[...
php
function _imageCopyResampledWorkaround(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) { /* for ($i = 0; $i < imagecolorstotal($src_img); $i++) { $colors = ImageColorsForIndex ($src_img, $i); ImageColorAllocate ($dst_img, $colors[...
[ "function", "_imageCopyResampledWorkaround", "(", "&", "$", "dst_img", ",", "&", "$", "src_img", ",", "$", "dst_x", ",", "$", "dst_y", ",", "$", "src_x", ",", "$", "src_y", ",", "$", "dst_w", ",", "$", "dst_h", ",", "$", "src_w", ",", "$", "src_h", ...
workaround function for bicubic resizing. works well for downsizing only. VERY slow. taken from php.net comments @access private
[ "workaround", "function", "for", "bicubic", "resizing", ".", "works", "well", "for", "downsizing", "only", ".", "VERY", "slow", ".", "taken", "from", "php", ".", "net", "comments" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1520-L1555
Eresus/EresusCMS
src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php
Image_Toolbox._imageCopyResampledWorkaround2
function _imageCopyResampledWorkaround2(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) { ImagePaletteCopy($dst_img, $src_img); $rX = $src_w / $dst_w; $rY = $src_h / $dst_h; $w = 0; for ($y = $dst_y; $y < $dst_h; $y++) { ...
php
function _imageCopyResampledWorkaround2(&$dst_img, &$src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) { ImagePaletteCopy($dst_img, $src_img); $rX = $src_w / $dst_w; $rY = $src_h / $dst_h; $w = 0; for ($y = $dst_y; $y < $dst_h; $y++) { ...
[ "function", "_imageCopyResampledWorkaround2", "(", "&", "$", "dst_img", ",", "&", "$", "src_img", ",", "$", "dst_x", ",", "$", "dst_y", ",", "$", "src_x", ",", "$", "src_y", ",", "$", "dst_w", ",", "$", "dst_h", ",", "$", "src_w", ",", "$", "src_h", ...
alternative workaround function for bicubic resizing. works well for downsizing and upsizing. VERY VERY slow. taken from php.net comments @access private
[ "alternative", "workaround", "function", "for", "bicubic", "resizing", ".", "works", "well", "for", "downsizing", "and", "upsizing", ".", "VERY", "VERY", "slow", ".", "taken", "from", "php", ".", "net", "comments" ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/ext-3rd/tinymce/plugins/images/connector/php/Image_Toolbox.class.php#L1562-L1593
99designs/ergo-http
src/HeaderField.php
HeaderField.fromString
public static function fromString($headerString) { $headerString = trim($headerString); list($name, $value) = explode(': ', trim($headerString), 2); return new self($name, $value); }
php
public static function fromString($headerString) { $headerString = trim($headerString); list($name, $value) = explode(': ', trim($headerString), 2); return new self($name, $value); }
[ "public", "static", "function", "fromString", "(", "$", "headerString", ")", "{", "$", "headerString", "=", "trim", "(", "$", "headerString", ")", ";", "list", "(", "$", "name", ",", "$", "value", ")", "=", "explode", "(", "': '", ",", "trim", "(", "...
Creates a header from a string representing a single header. @param string $headerString @return
[ "Creates", "a", "header", "from", "a", "string", "representing", "a", "single", "header", "." ]
train
https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/HeaderField.php#L76-L81
tequila/mongodb-odm
src/Proxy/Factory/GeneratorFactory.php
GeneratorFactory.generateProxyClass
public function generateProxyClass(string $documentClass): string { if (array_key_exists($documentClass, $this->proxyClassNames)) { return $this->proxyClassNames[$documentClass]; } $proxyClassName = $this->getProxyClassName($documentClass); $proxyGenerator = $this->getGe...
php
public function generateProxyClass(string $documentClass): string { if (array_key_exists($documentClass, $this->proxyClassNames)) { return $this->proxyClassNames[$documentClass]; } $proxyClassName = $this->getProxyClassName($documentClass); $proxyGenerator = $this->getGe...
[ "public", "function", "generateProxyClass", "(", "string", "$", "documentClass", ")", ":", "string", "{", "if", "(", "array_key_exists", "(", "$", "documentClass", ",", "$", "this", "->", "proxyClassNames", ")", ")", "{", "return", "$", "this", "->", "proxyC...
@param string $documentClass @return string @throws \ReflectionException
[ "@param", "string", "$documentClass" ]
train
https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Factory/GeneratorFactory.php#L54-L74
tequila/mongodb-odm
src/Proxy/Factory/GeneratorFactory.php
GeneratorFactory.getGenerator
private function getGenerator(string $documentClass): AbstractGenerator { if (!array_key_exists($documentClass, $this->generatorsCache)) { $metadata = $this->metadataFactory->getClassMetadata($documentClass); $this->generatorsCache[$documentClass] = $metadata->isNested() ...
php
private function getGenerator(string $documentClass): AbstractGenerator { if (!array_key_exists($documentClass, $this->generatorsCache)) { $metadata = $this->metadataFactory->getClassMetadata($documentClass); $this->generatorsCache[$documentClass] = $metadata->isNested() ...
[ "private", "function", "getGenerator", "(", "string", "$", "documentClass", ")", ":", "AbstractGenerator", "{", "if", "(", "!", "array_key_exists", "(", "$", "documentClass", ",", "$", "this", "->", "generatorsCache", ")", ")", "{", "$", "metadata", "=", "$"...
@param string $documentClass @return AbstractGenerator
[ "@param", "string", "$documentClass" ]
train
https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/Proxy/Factory/GeneratorFactory.php#L81-L91
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.isInstalled
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { if ($repo->hasPackage($package)) { return is_readable($this->getInstallPath($package) . '/' . $package->getExtra()['main']); } return false; }
php
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) { if ($repo->hasPackage($package)) { return is_readable($this->getInstallPath($package) . '/' . $package->getExtra()['main']); } return false; }
[ "public", "function", "isInstalled", "(", "InstalledRepositoryInterface", "$", "repo", ",", "PackageInterface", "$", "package", ")", "{", "if", "(", "$", "repo", "->", "hasPackage", "(", "$", "package", ")", ")", "{", "return", "is_readable", "(", "$", "this...
{@inheritdoc}
[ "{" ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L60-L67
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.install
public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $this->installCode($package); if (! $repo->hasPackage($package)) { $repo->addPackage(clone $package); } }
php
public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $this->installCode($package); if (! $repo->hasPackage($package)) { $repo->addPackage(clone $package); } }
[ "public", "function", "install", "(", "InstalledRepositoryInterface", "$", "repo", ",", "PackageInterface", "$", "package", ")", "{", "$", "this", "->", "installCode", "(", "$", "package", ")", ";", "if", "(", "!", "$", "repo", "->", "hasPackage", "(", "$"...
{@inheritdoc}
[ "{" ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L72-L79
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.installGitignore
protected function installGitignore(PackageInterface $package) { $installPath = $this->getInstallPath($package) . '/.gitignore'; $templatePath = $this->getTempPath($package) . '/.gitignore.template'; $data = ['APP_PUBLIC' => $this->plugin->getPublicDirectory()]; if ...
php
protected function installGitignore(PackageInterface $package) { $installPath = $this->getInstallPath($package) . '/.gitignore'; $templatePath = $this->getTempPath($package) . '/.gitignore.template'; $data = ['APP_PUBLIC' => $this->plugin->getPublicDirectory()]; if ...
[ "protected", "function", "installGitignore", "(", "PackageInterface", "$", "package", ")", "{", "$", "installPath", "=", "$", "this", "->", "getInstallPath", "(", "$", "package", ")", ".", "'/.gitignore'", ";", "$", "templatePath", "=", "$", "this", "->", "g...
Set up the .gitignore file. @param \Composer\Package\PackageInterface $package @return void
[ "Set", "up", "the", ".", "gitignore", "file", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L151-L205
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.installDotEnv
protected function installDotEnv(PackageInterface $package) { $templatePath = $this->getTempPath($package) . '/.env.template'; $dotEnvPath = $this->getInstallPath($package) . '/.env'; $dotEnvExamplePath = $this->getInstallPath($package) . '/.env.example'; if (! file_exists($...
php
protected function installDotEnv(PackageInterface $package) { $templatePath = $this->getTempPath($package) . '/.env.template'; $dotEnvPath = $this->getInstallPath($package) . '/.env'; $dotEnvExamplePath = $this->getInstallPath($package) . '/.env.example'; if (! file_exists($...
[ "protected", "function", "installDotEnv", "(", "PackageInterface", "$", "package", ")", "{", "$", "templatePath", "=", "$", "this", "->", "getTempPath", "(", "$", "package", ")", ".", "'/.env.template'", ";", "$", "dotEnvPath", "=", "$", "this", "->", "getIn...
Set up the .env file. @param \Composer\Package\PackageInterface $package @return void
[ "Set", "up", "the", ".", "env", "file", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L213-L253
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.checkWordPressInstallation
protected function checkWordPressInstallation() { $defaultWpInstallDir = $this->plugin->getRootDirectory() . '/wordpress'; $wpInstallDir = $this->getComposerConfigurator()->getWordPressInstallDirectory(); if (file_exists($defaultWpInstallDir) && is_dir($defaultWpInstallDir)) { ...
php
protected function checkWordPressInstallation() { $defaultWpInstallDir = $this->plugin->getRootDirectory() . '/wordpress'; $wpInstallDir = $this->getComposerConfigurator()->getWordPressInstallDirectory(); if (file_exists($defaultWpInstallDir) && is_dir($defaultWpInstallDir)) { ...
[ "protected", "function", "checkWordPressInstallation", "(", ")", "{", "$", "defaultWpInstallDir", "=", "$", "this", "->", "plugin", "->", "getRootDirectory", "(", ")", ".", "'/wordpress'", ";", "$", "wpInstallDir", "=", "$", "this", "->", "getComposerConfigurator"...
Check if WordPress is installed in the correct directory, and move it there if it is not. @return void
[ "Check", "if", "WordPress", "is", "installed", "in", "the", "correct", "directory", "and", "move", "it", "there", "if", "it", "is", "not", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L281-L297
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.selectPreferredLanguageOnWordPressInstall
protected function selectPreferredLanguageOnWordPressInstall() { $wpInstallScriptPath = $this->getComposerConfigurator()->getWordPressInstallDirectory() . '/wp-admin/install.php'; if (file_exists($wpInstallScriptPath)) { $wpInstallScript = file_get_contents($wpInstallScriptPath)...
php
protected function selectPreferredLanguageOnWordPressInstall() { $wpInstallScriptPath = $this->getComposerConfigurator()->getWordPressInstallDirectory() . '/wp-admin/install.php'; if (file_exists($wpInstallScriptPath)) { $wpInstallScript = file_get_contents($wpInstallScriptPath)...
[ "protected", "function", "selectPreferredLanguageOnWordPressInstall", "(", ")", "{", "$", "wpInstallScriptPath", "=", "$", "this", "->", "getComposerConfigurator", "(", ")", "->", "getWordPressInstallDirectory", "(", ")", ".", "'/wp-admin/install.php'", ";", "if", "(", ...
Select the preferred en_GB option in the WordPress installation language form. @return void
[ "Select", "the", "preferred", "en_GB", "option", "in", "the", "WordPress", "installation", "language", "form", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L304-L320
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.installCode
protected function installCode(PackageInterface $package) { $files = $this->getInstallFiles($package); $installPath = $this->getInstallPath($package); $downloadPath = $this->getTempPath($package); $publicPath = $this->plugin->getPublicDirectory(); $this->downloadMana...
php
protected function installCode(PackageInterface $package) { $files = $this->getInstallFiles($package); $installPath = $this->getInstallPath($package); $downloadPath = $this->getTempPath($package); $publicPath = $this->plugin->getPublicDirectory(); $this->downloadMana...
[ "protected", "function", "installCode", "(", "PackageInterface", "$", "package", ")", "{", "$", "files", "=", "$", "this", "->", "getInstallFiles", "(", "$", "package", ")", ";", "$", "installPath", "=", "$", "this", "->", "getInstallPath", "(", "$", "pack...
{@inheritdoc}
[ "{" ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L325-L343
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.updateCode
protected function updateCode(PackageInterface $current, PackageInterface $target) { $currentInstallPath = $this->getInstallPath($current); $targetInstallPath = $this->getInstallPath($target); if ($targetInstallPath !== $currentInstallPath) { // if the target and initial...
php
protected function updateCode(PackageInterface $current, PackageInterface $target) { $currentInstallPath = $this->getInstallPath($current); $targetInstallPath = $this->getInstallPath($target); if ($targetInstallPath !== $currentInstallPath) { // if the target and initial...
[ "protected", "function", "updateCode", "(", "PackageInterface", "$", "current", ",", "PackageInterface", "$", "target", ")", "{", "$", "currentInstallPath", "=", "$", "this", "->", "getInstallPath", "(", "$", "current", ")", ";", "$", "targetInstallPath", "=", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L348-L377
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.removeCode
protected function removeCode(PackageInterface $package) { $files = $this->getInstallFiles($package); $installPath = $this->getInstallPath($package); foreach ($files as $file) { $this->filesystem->remove($installPath . '/' . $file); } }
php
protected function removeCode(PackageInterface $package) { $files = $this->getInstallFiles($package); $installPath = $this->getInstallPath($package); foreach ($files as $file) { $this->filesystem->remove($installPath . '/' . $file); } }
[ "protected", "function", "removeCode", "(", "PackageInterface", "$", "package", ")", "{", "$", "files", "=", "$", "this", "->", "getInstallFiles", "(", "$", "package", ")", ";", "$", "installPath", "=", "$", "this", "->", "getInstallPath", "(", "$", "packa...
{@inheritdoc}
[ "{" ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L382-L390
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.installFiles
protected function installFiles($installPath, $downloadPath, $publicPath, $files = []) { foreach ($files as $file => $overwrite) { if ($overwrite || (! $overwrite && ! file_exists($installPath . '/' . $file))) { if (! file_exists($downloadPath . '/' . $file)) { ...
php
protected function installFiles($installPath, $downloadPath, $publicPath, $files = []) { foreach ($files as $file => $overwrite) { if ($overwrite || (! $overwrite && ! file_exists($installPath . '/' . $file))) { if (! file_exists($downloadPath . '/' . $file)) { ...
[ "protected", "function", "installFiles", "(", "$", "installPath", ",", "$", "downloadPath", ",", "$", "publicPath", ",", "$", "files", "=", "[", "]", ")", "{", "foreach", "(", "$", "files", "as", "$", "file", "=>", "$", "overwrite", ")", "{", "if", "...
Install files. @param string $installPath @param string $downloadPath @param string $publicPath @param array $files @return void
[ "Install", "files", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L401-L424
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.compileTemplate
private function compileTemplate($templatePath, $destinationPath, $data = null) { if ($data == null) { $data = $destinationPath; $destinationPath = null; } if (! isset($this->templates[$templatePath])) { $this->templates[$templatePath] = file_get_...
php
private function compileTemplate($templatePath, $destinationPath, $data = null) { if ($data == null) { $data = $destinationPath; $destinationPath = null; } if (! isset($this->templates[$templatePath])) { $this->templates[$templatePath] = file_get_...
[ "private", "function", "compileTemplate", "(", "$", "templatePath", ",", "$", "destinationPath", ",", "$", "data", "=", "null", ")", "{", "if", "(", "$", "data", "==", "null", ")", "{", "$", "data", "=", "$", "destinationPath", ";", "$", "destinationPath...
Compile a template file. @param string $templatePath @param string $destinationPath @param array|null $data @return string
[ "Compile", "a", "template", "file", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L434-L458
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.sortRules
private function sortRules(&$rules) { sort($rules); usort($rules, function ($a, $b) { return strlen($a) - strlen($b); }); }
php
private function sortRules(&$rules) { sort($rules); usort($rules, function ($a, $b) { return strlen($a) - strlen($b); }); }
[ "private", "function", "sortRules", "(", "&", "$", "rules", ")", "{", "sort", "(", "$", "rules", ")", ";", "usort", "(", "$", "rules", ",", "function", "(", "$", "a", ",", "$", "b", ")", "{", "return", "strlen", "(", "$", "a", ")", "-", "strlen...
Sort gitignore rules. @param array &$rules @return void
[ "Sort", "gitignore", "rules", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L466-L472
CupOfTea696/WordPress-Composer
src/Installer.php
Installer.generateSalt
private function generateSalt() { $str = ''; $length = 64; $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}[]/|`,.?+-_=:;<> '; $count = strlen($chars); while ($length--) { $str .= $chars[mt_rand(0, $count - 1)]; ...
php
private function generateSalt() { $str = ''; $length = 64; $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}[]/|`,.?+-_=:;<> '; $count = strlen($chars); while ($length--) { $str .= $chars[mt_rand(0, $count - 1)]; ...
[ "private", "function", "generateSalt", "(", ")", "{", "$", "str", "=", "''", ";", "$", "length", "=", "64", ";", "$", "chars", "=", "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(){}[]/|`,.?+-_=:;<> '", ";", "$", "count", "=", "strlen", "("...
Generate a Salt Key. @return string
[ "Generate", "a", "Salt", "Key", "." ]
train
https://github.com/CupOfTea696/WordPress-Composer/blob/8c0abc10f82b8ce1db5354f6a041c7587ad3fb90/src/Installer.php#L479-L491
ShaoZeMing/laravel-merchant
src/Form/Field.php
Field.removeElementClass
public function removeElementClass($class) { $delClass = []; if (is_string($class) || is_array($class)) { $delClass = (array) $class; } foreach ($delClass as $del) { if (($key = array_search($del, $this->elementClass))) { unset($this->element...
php
public function removeElementClass($class) { $delClass = []; if (is_string($class) || is_array($class)) { $delClass = (array) $class; } foreach ($delClass as $del) { if (($key = array_search($del, $this->elementClass))) { unset($this->element...
[ "public", "function", "removeElementClass", "(", "$", "class", ")", "{", "$", "delClass", "=", "[", "]", ";", "if", "(", "is_string", "(", "$", "class", ")", "||", "is_array", "(", "$", "class", ")", ")", "{", "$", "delClass", "=", "(", "array", ")...
Remove element class. @param $class @return $this
[ "Remove", "element", "class", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Field.php#L835-L850
ShaoZeMing/laravel-merchant
src/Form/Field.php
Field.getView
public function getView() { if (!empty($this->view)) { return $this->view; } $class = explode('\\', get_called_class()); return 'merchant::form.'.strtolower(end($class)); }
php
public function getView() { if (!empty($this->view)) { return $this->view; } $class = explode('\\', get_called_class()); return 'merchant::form.'.strtolower(end($class)); }
[ "public", "function", "getView", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "view", ")", ")", "{", "return", "$", "this", "->", "view", ";", "}", "$", "class", "=", "explode", "(", "'\\\\'", ",", "get_called_class", "(", ")", ...
Get view of this field. @return string
[ "Get", "view", "of", "this", "field", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Field.php#L879-L888
ShaoZeMing/laravel-merchant
src/Form/Field.php
Field.render
public function render() { Merchant::script($this->script); return view($this->getView(), $this->variables()); }
php
public function render() { Merchant::script($this->script); return view($this->getView(), $this->variables()); }
[ "public", "function", "render", "(", ")", "{", "Merchant", "::", "script", "(", "$", "this", "->", "script", ")", ";", "return", "view", "(", "$", "this", "->", "getView", "(", ")", ",", "$", "this", "->", "variables", "(", ")", ")", ";", "}" ]
Render this filed. @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
[ "Render", "this", "filed", "." ]
train
https://github.com/ShaoZeMing/laravel-merchant/blob/20801b1735e7832a6e58b37c2c391328f8d626fa/src/Form/Field.php#L905-L910
php-lug/lug
src/Bundle/GridBundle/Sort/SorterRenderer.php
SorterRenderer.render
public function render(GridViewInterface $grid, ColumnInterface $column, $sorting) { $definition = $grid->getDefinition(); $name = $column->getName(); if (!$definition->hasSort($name)) { return; } $sort = $sorting === SorterInterface::ASC ? $name : '-'.$name; ...
php
public function render(GridViewInterface $grid, ColumnInterface $column, $sorting) { $definition = $grid->getDefinition(); $name = $column->getName(); if (!$definition->hasSort($name)) { return; } $sort = $sorting === SorterInterface::ASC ? $name : '-'.$name; ...
[ "public", "function", "render", "(", "GridViewInterface", "$", "grid", ",", "ColumnInterface", "$", "column", ",", "$", "sorting", ")", "{", "$", "definition", "=", "$", "grid", "->", "getDefinition", "(", ")", ";", "$", "name", "=", "$", "column", "->",...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Sort/SorterRenderer.php#L60-L94
ezsystems/ezcomments-ls-extension
classes/ezcomcommentmanager.php
ezcomCommentManager.addComment
public function addComment( $comment, $user, $time = null, $notification = null ) { if ( $time === null ) { $time = time(); } $beforeAddingResult = $this->beforeAddingComment( $comment, $user, $notification ); if ( $beforeAddingResult !== true ) { ...
php
public function addComment( $comment, $user, $time = null, $notification = null ) { if ( $time === null ) { $time = time(); } $beforeAddingResult = $this->beforeAddingComment( $comment, $user, $notification ); if ( $beforeAddingResult !== true ) { ...
[ "public", "function", "addComment", "(", "$", "comment", ",", "$", "user", ",", "$", "time", "=", "null", ",", "$", "notification", "=", "null", ")", "{", "if", "(", "$", "time", "===", "null", ")", "{", "$", "time", "=", "time", "(", ")", ";", ...
Add comment into ezcomment table and do action The adding doesn't validate the data in http @param $comment: ezcomComment object which has not been stored title, name, url, email, created, modified, text, notification @param $user: user object @param $time: comment time @return true : if adding succeeds false otherwis...
[ "Add", "comment", "into", "ezcomment", "table", "and", "do", "action", "The", "adding", "doesn", "t", "validate", "the", "data", "in", "http", "@param", "$comment", ":", "ezcomComment", "object", "which", "has", "not", "been", "stored", "title", "name", "url...
train
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcommentmanager.php#L92-L110
ezsystems/ezcomments-ls-extension
classes/ezcomcommentmanager.php
ezcomCommentManager.updateComment
public function updateComment( $comment, $user=null, $time = null , $notified = null ) { if ( $time === null ) { $time = time(); } $beforeUpdating = $this->beforeUpdatingComment( $comment, $notified, $time ); if ( $beforeUpdating !== true ) { ...
php
public function updateComment( $comment, $user=null, $time = null , $notified = null ) { if ( $time === null ) { $time = time(); } $beforeUpdating = $this->beforeUpdatingComment( $comment, $notified, $time ); if ( $beforeUpdating !== true ) { ...
[ "public", "function", "updateComment", "(", "$", "comment", ",", "$", "user", "=", "null", ",", "$", "time", "=", "null", ",", "$", "notified", "=", "null", ")", "{", "if", "(", "$", "time", "===", "null", ")", "{", "$", "time", "=", "time", "(",...
Update the comment @param $comment comment to be updated @param $notified change the notification @param $time @param $user user to change @return
[ "Update", "the", "comment" ]
train
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcommentmanager.php#L120-L140
ezsystems/ezcomments-ls-extension
classes/ezcomcommentmanager.php
ezcomCommentManager.instance
public static function instance() { if ( !isset( self::$instance ) ) { $ini = eZINI::instance( 'ezcomments.ini' ); $className = $ini->variable( 'ManagerClasses', 'CommentManagerClass' ); self::$instance = new $className(); } return self::$instance;...
php
public static function instance() { if ( !isset( self::$instance ) ) { $ini = eZINI::instance( 'ezcomments.ini' ); $className = $ini->variable( 'ManagerClasses', 'CommentManagerClass' ); self::$instance = new $className(); } return self::$instance;...
[ "public", "static", "function", "instance", "(", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "instance", ")", ")", "{", "$", "ini", "=", "eZINI", "::", "instance", "(", "'ezcomments.ini'", ")", ";", "$", "className", "=", "$", "ini", ...
create an instance of ezcomCommentManager @return ezcomCommentManager
[ "create", "an", "instance", "of", "ezcomCommentManager" ]
train
https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcommentmanager.php#L159-L168
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Database/src/instance.php
ezcDbInstance.get
public static function get( $identifier = false ) { if ( $identifier === false && self::$DefaultInstanceIdentifier ) { $identifier = self::$DefaultInstanceIdentifier; } if ( !isset( self::$Instances[$identifier] ) ) { // The DatabaseInstanceFetchConfi...
php
public static function get( $identifier = false ) { if ( $identifier === false && self::$DefaultInstanceIdentifier ) { $identifier = self::$DefaultInstanceIdentifier; } if ( !isset( self::$Instances[$identifier] ) ) { // The DatabaseInstanceFetchConfi...
[ "public", "static", "function", "get", "(", "$", "identifier", "=", "false", ")", "{", "if", "(", "$", "identifier", "===", "false", "&&", "self", "::", "$", "DefaultInstanceIdentifier", ")", "{", "$", "identifier", "=", "self", "::", "$", "DefaultInstance...
Returns the database instance $identifier. If $identifier is ommited the default database instance specified by chooseDefault() is returned. @throws ezcDbHandlerNotFoundException if the specified instance is not found. @param string $identifier @return ezcDbHandler
[ "Returns", "the", "database", "instance", "$identifier", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/instance.php#L85-L108
LeaseCloud/leasecloud-php-sdk
src/ApiResource.php
ApiResource.staticRequest
protected static function staticRequest($method, $url, $params) { $requestor = new ApiRequestor(); list($response, $code) = $requestor->request($method, $url, $params); return array($response, $code); }
php
protected static function staticRequest($method, $url, $params) { $requestor = new ApiRequestor(); list($response, $code) = $requestor->request($method, $url, $params); return array($response, $code); }
[ "protected", "static", "function", "staticRequest", "(", "$", "method", ",", "$", "url", ",", "$", "params", ")", "{", "$", "requestor", "=", "new", "ApiRequestor", "(", ")", ";", "list", "(", "$", "response", ",", "$", "code", ")", "=", "$", "reques...
Make the http GET or POST request @param string $method @param string $url @param array|null $params @return array
[ "Make", "the", "http", "GET", "or", "POST", "request" ]
train
https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/ApiResource.php#L68-L73
LeaseCloud/leasecloud-php-sdk
src/ApiResource.php
ApiResource.create
protected static function create($params = null) { $url = static::classUrl(); list($response) = static::staticRequest('post', $url, $params); return $response; }
php
protected static function create($params = null) { $url = static::classUrl(); list($response) = static::staticRequest('post', $url, $params); return $response; }
[ "protected", "static", "function", "create", "(", "$", "params", "=", "null", ")", "{", "$", "url", "=", "static", "::", "classUrl", "(", ")", ";", "list", "(", "$", "response", ")", "=", "static", "::", "staticRequest", "(", "'post'", ",", "$", "url...
Create (post) a resource via the remote API @param array|null $params @return mixed
[ "Create", "(", "post", ")", "a", "resource", "via", "the", "remote", "API" ]
train
https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/ApiResource.php#L82-L87
LeaseCloud/leasecloud-php-sdk
src/ApiResource.php
ApiResource.retrieve
protected static function retrieve($id = null, $params = []) { $url = static::classUrl(); if ($id) { $url = $url . '/' . $id; } list($response) = static::staticRequest('get', $url, $params); return $response; }
php
protected static function retrieve($id = null, $params = []) { $url = static::classUrl(); if ($id) { $url = $url . '/' . $id; } list($response) = static::staticRequest('get', $url, $params); return $response; }
[ "protected", "static", "function", "retrieve", "(", "$", "id", "=", "null", ",", "$", "params", "=", "[", "]", ")", "{", "$", "url", "=", "static", "::", "classUrl", "(", ")", ";", "if", "(", "$", "id", ")", "{", "$", "url", "=", "$", "url", ...
Retrieve (get) data from the remote API @param null $id @param array $params @return mixed
[ "Retrieve", "(", "get", ")", "data", "from", "the", "remote", "API" ]
train
https://github.com/LeaseCloud/leasecloud-php-sdk/blob/091b073dd4f79ba915a68c0ed151bd9bfa61e7ca/src/ApiResource.php#L96-L104
xiewulong/yii2-fileupload
oss/libs/guzzle/http/Guzzle/Http/Message/Response.php
Response.xml
public function xml() { try { // Allow XML to be retrieved even if there is no response body $xml = new \SimpleXMLElement((string) $this->body ?: '<root />'); } catch (\Exception $e) { throw new RuntimeException('Unable to parse response body into XML: ' . $e->get...
php
public function xml() { try { // Allow XML to be retrieved even if there is no response body $xml = new \SimpleXMLElement((string) $this->body ?: '<root />'); } catch (\Exception $e) { throw new RuntimeException('Unable to parse response body into XML: ' . $e->get...
[ "public", "function", "xml", "(", ")", "{", "try", "{", "// Allow XML to be retrieved even if there is no response body", "$", "xml", "=", "new", "\\", "SimpleXMLElement", "(", "(", "string", ")", "$", "this", "->", "body", "?", ":", "'<root />'", ")", ";", "}...
Parse the XML response body and return a SimpleXMLElement @return \SimpleXMLElement @throws RuntimeException if the response body is not in XML format
[ "Parse", "the", "XML", "response", "body", "and", "return", "a", "SimpleXMLElement" ]
train
https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/http/Guzzle/Http/Message/Response.php#L873-L883
simbiosis-group/yii2-helper
actions/ExportAction.php
ExportAction.run
public function run() { $objPHPExcel = new \PHPExcel(); $objPHPExcel->getActiveSheet()->fromArray($this->excelData, null, 'A1'); // Redirect output to a client’s web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: at...
php
public function run() { $objPHPExcel = new \PHPExcel(); $objPHPExcel->getActiveSheet()->fromArray($this->excelData, null, 'A1'); // Redirect output to a client’s web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: at...
[ "public", "function", "run", "(", ")", "{", "$", "objPHPExcel", "=", "new", "\\", "PHPExcel", "(", ")", ";", "$", "objPHPExcel", "->", "getActiveSheet", "(", ")", "->", "fromArray", "(", "$", "this", "->", "excelData", ",", "null", ",", "'A1'", ")", ...
Runs the action @return string result content
[ "Runs", "the", "action" ]
train
https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/actions/ExportAction.php#L70-L94
j-d/draggy
src/Draggy/Utils/Yaml/YamlLoader.php
YamlLoader.mergeArrays
protected static function mergeArrays($target, $source) { foreach ($source as $node => $values) { if (!array_key_exists($node, $target)) { $target[$node] = $values; } elseif (is_array($values)) { $target[$node] = self::mergeArrays($target[$node], $valu...
php
protected static function mergeArrays($target, $source) { foreach ($source as $node => $values) { if (!array_key_exists($node, $target)) { $target[$node] = $values; } elseif (is_array($values)) { $target[$node] = self::mergeArrays($target[$node], $valu...
[ "protected", "static", "function", "mergeArrays", "(", "$", "target", ",", "$", "source", ")", "{", "foreach", "(", "$", "source", "as", "$", "node", "=>", "$", "values", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "node", ",", "$", "targ...
Overwrite / complete the target array with the values found on the source array @param array $target @param array $source @return array
[ "Overwrite", "/", "complete", "the", "target", "array", "with", "the", "values", "found", "on", "the", "source", "array" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Utils/Yaml/YamlLoader.php#L25-L38
j-d/draggy
src/Draggy/Utils/Yaml/YamlLoader.php
YamlLoader.mergeConfigurations
public static function mergeConfigurations($target, $source) { foreach (['attributes', 'entities', 'relationships', 'autocode', 'languages', 'frameworks', 'orms'] as $configurationPart) { if (isset($source[$configurationPart])) { $target[$configurationPart] = self::mergeArrays($t...
php
public static function mergeConfigurations($target, $source) { foreach (['attributes', 'entities', 'relationships', 'autocode', 'languages', 'frameworks', 'orms'] as $configurationPart) { if (isset($source[$configurationPart])) { $target[$configurationPart] = self::mergeArrays($t...
[ "public", "static", "function", "mergeConfigurations", "(", "$", "target", ",", "$", "source", ")", "{", "foreach", "(", "[", "'attributes'", ",", "'entities'", ",", "'relationships'", ",", "'autocode'", ",", "'languages'", ",", "'frameworks'", ",", "'orms'", ...
Complete the different configuration sections on the target array with those ones found on the source array @param array $target @param array $source @return array
[ "Complete", "the", "different", "configuration", "sections", "on", "the", "target", "array", "with", "those", "ones", "found", "on", "the", "source", "array" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Utils/Yaml/YamlLoader.php#L48-L57
j-d/draggy
src/Draggy/Utils/Yaml/YamlLoader.php
YamlLoader.loadConfiguration
public static function loadConfiguration() { $defaultsFile = __DIR__ . '/../../../../app/config/defaults.yml'; $draggyFile = __DIR__ . '/../../../../app/config/draggy.yml'; $userFile = __DIR__ . '/../../../../app/config/user.yml'; $defaultsArray = Yaml::parse($defaultsFile); ...
php
public static function loadConfiguration() { $defaultsFile = __DIR__ . '/../../../../app/config/defaults.yml'; $draggyFile = __DIR__ . '/../../../../app/config/draggy.yml'; $userFile = __DIR__ . '/../../../../app/config/user.yml'; $defaultsArray = Yaml::parse($defaultsFile); ...
[ "public", "static", "function", "loadConfiguration", "(", ")", "{", "$", "defaultsFile", "=", "__DIR__", ".", "'/../../../../app/config/defaults.yml'", ";", "$", "draggyFile", "=", "__DIR__", ".", "'/../../../../app/config/draggy.yml'", ";", "$", "userFile", "=", "__D...
Load the model configuration, merge it onto the default one and return the result array @return array
[ "Load", "the", "model", "configuration", "merge", "it", "onto", "the", "default", "one", "and", "return", "the", "result", "array" ]
train
https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Utils/Yaml/YamlLoader.php#L64-L79
m4grio/bangkok-insurance-php
src/ClientBuilder.php
ClientBuilder.setProcess
public function setProcess(ProcessInterface $process) { $this->process = $process; $this->setClient($process->getClient()); return $this; }
php
public function setProcess(ProcessInterface $process) { $this->process = $process; $this->setClient($process->getClient()); return $this; }
[ "public", "function", "setProcess", "(", "ProcessInterface", "$", "process", ")", "{", "$", "this", "->", "process", "=", "$", "process", ";", "$", "this", "->", "setClient", "(", "$", "process", "->", "getClient", "(", ")", ")", ";", "return", "$", "t...
@param ProcessInterface $process @return ClientBuilder
[ "@param", "ProcessInterface", "$process" ]
train
https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/ClientBuilder.php#L110-L116
m4grio/bangkok-insurance-php
src/ClientBuilder.php
ClientBuilder.build
public function build() { $soapClient = (new Factory)->getClient($this->getEndpoint(), $this->getSoapOptions()); $params['user_id'] = $this->userId; $params['agent_code'] = $this->agentCode; $params['agent_seq'] = $this->agentSeq; $client = new $this->client($soapClient, $pa...
php
public function build() { $soapClient = (new Factory)->getClient($this->getEndpoint(), $this->getSoapOptions()); $params['user_id'] = $this->userId; $params['agent_code'] = $this->agentCode; $params['agent_seq'] = $this->agentSeq; $client = new $this->client($soapClient, $pa...
[ "public", "function", "build", "(", ")", "{", "$", "soapClient", "=", "(", "new", "Factory", ")", "->", "getClient", "(", "$", "this", "->", "getEndpoint", "(", ")", ",", "$", "this", "->", "getSoapOptions", "(", ")", ")", ";", "$", "params", "[", ...
Build a new client's instance @return Client
[ "Build", "a", "new", "client", "s", "instance" ]
train
https://github.com/m4grio/bangkok-insurance-php/blob/400266d043abe6b7cacb9da36064cbb169149c2a/src/ClientBuilder.php#L147-L161
tigron/skeleton-file
migration/20171215_124319_filename_on_disk.php
Migration_20171215_124319_Filename_on_disk.up
public function up() { $db = Database::get(); $db->query(" ALTER TABLE `file` ADD `path` varchar(128) COLLATE 'utf8_unicode_ci' NOT NULL AFTER `name`; ", []); $data = $db->get_all('SELECT * FROM file WHERE path = "" AND md5sum != ""', []); foreach ($data as $row) { $path = $this->get_path($row); ...
php
public function up() { $db = Database::get(); $db->query(" ALTER TABLE `file` ADD `path` varchar(128) COLLATE 'utf8_unicode_ci' NOT NULL AFTER `name`; ", []); $data = $db->get_all('SELECT * FROM file WHERE path = "" AND md5sum != ""', []); foreach ($data as $row) { $path = $this->get_path($row); ...
[ "public", "function", "up", "(", ")", "{", "$", "db", "=", "Database", "::", "get", "(", ")", ";", "$", "db", "->", "query", "(", "\"\n\t\t\tALTER TABLE `file`\n\t\t\tADD `path` varchar(128) COLLATE 'utf8_unicode_ci' NOT NULL AFTER `name`;\n\t\t\"", ",", "[", "]", ")"...
Migrate up @access public
[ "Migrate", "up" ]
train
https://github.com/tigron/skeleton-file/blob/97978d49f179f07c76380ddc8919b8a7d56dee61/migration/20171215_124319_filename_on_disk.php#L21-L33
tigron/skeleton-file
migration/20171215_124319_filename_on_disk.php
Migration_20171215_124319_Filename_on_disk.get_path
public function get_path($file) { $parts = str_split($file['md5sum'], 2); $subpath = $parts[0] . '/' . $parts[1] . '/' . $parts[2] . '/'; $path = $subpath . $file['id'] . '-' . $this->sanitize_filename($file['name']); return $path; }
php
public function get_path($file) { $parts = str_split($file['md5sum'], 2); $subpath = $parts[0] . '/' . $parts[1] . '/' . $parts[2] . '/'; $path = $subpath . $file['id'] . '-' . $this->sanitize_filename($file['name']); return $path; }
[ "public", "function", "get_path", "(", "$", "file", ")", "{", "$", "parts", "=", "str_split", "(", "$", "file", "[", "'md5sum'", "]", ",", "2", ")", ";", "$", "subpath", "=", "$", "parts", "[", "0", "]", ".", "'/'", ".", "$", "parts", "[", "1",...
Get path @access public @return string $path
[ "Get", "path" ]
train
https://github.com/tigron/skeleton-file/blob/97978d49f179f07c76380ddc8919b8a7d56dee61/migration/20171215_124319_filename_on_disk.php#L41-L48
tigron/skeleton-file
migration/20171215_124319_filename_on_disk.php
Migration_20171215_124319_Filename_on_disk.sanitize_filename
public function sanitize_filename($name, $max_length = 50) { $special_chars = ['#','$','%','^','&','*','!','~','‘','"','’','\'','=','?','/','[',']','(',')','|','<','>',';','\\',',','+']; $name = preg_replace('/^[.]*/','',$name); // remove leading dots $name = preg_replace('/[.]*$/','',$name); // remove trailing d...
php
public function sanitize_filename($name, $max_length = 50) { $special_chars = ['#','$','%','^','&','*','!','~','‘','"','’','\'','=','?','/','[',']','(',')','|','<','>',';','\\',',','+']; $name = preg_replace('/^[.]*/','',$name); // remove leading dots $name = preg_replace('/[.]*$/','',$name); // remove trailing d...
[ "public", "function", "sanitize_filename", "(", "$", "name", ",", "$", "max_length", "=", "50", ")", "{", "$", "special_chars", "=", "[", "'#'", ",", "'$'", ",", "'%'", ",", "'^'", ",", "'&'", ",", "'*'", ",", "'!'", ",", "'~'", ",", "'‘','", "\"",...
Sanitize the filename (old way) @access public @param string $name
[ "Sanitize", "the", "filename", "(", "old", "way", ")" ]
train
https://github.com/tigron/skeleton-file/blob/97978d49f179f07c76380ddc8919b8a7d56dee61/migration/20171215_124319_filename_on_disk.php#L56-L81
husccexo/php-handlersocket-core
src/HSCore/Socket.php
Socket.openIndex
public function openIndex($dbName, $tableName, $indexName = null, array $columns = [], array $fColumns = null) { if (empty($indexName)) { $indexName = 'PRIMARY'; } $params = [$dbName, $tableName, $indexName, join(',', $columns)]; if (!is_null($fColumns)) { $...
php
public function openIndex($dbName, $tableName, $indexName = null, array $columns = [], array $fColumns = null) { if (empty($indexName)) { $indexName = 'PRIMARY'; } $params = [$dbName, $tableName, $indexName, join(',', $columns)]; if (!is_null($fColumns)) { $...
[ "public", "function", "openIndex", "(", "$", "dbName", ",", "$", "tableName", ",", "$", "indexName", "=", "null", ",", "array", "$", "columns", "=", "[", "]", ",", "array", "$", "fColumns", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "inde...
Perform opening index $indexId over $indexName of table $dbName.$tableName, preparing read $columns and filters $fColumns @param string $dbName @param string $tableName @param string $indexName @param array $columns @param array|null $fColumns @return int
[ "Perform", "opening", "index", "$indexId", "over", "$indexName", "of", "table", "$dbName", ".", "$tableName", "preparing", "read", "$columns", "and", "filters", "$fColumns" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Socket.php#L32-L52
husccexo/php-handlersocket-core
src/HSCore/Socket.php
Socket.send
protected function send(array $params) { $this->connect(); return $this->socket->send(join(Driver::SEP, array_map([$this->socket, 'encode'], $params)).Driver::EOL); }
php
protected function send(array $params) { $this->connect(); return $this->socket->send(join(Driver::SEP, array_map([$this->socket, 'encode'], $params)).Driver::EOL); }
[ "protected", "function", "send", "(", "array", "$", "params", ")", "{", "$", "this", "->", "connect", "(", ")", ";", "return", "$", "this", "->", "socket", "->", "send", "(", "join", "(", "Driver", "::", "SEP", ",", "array_map", "(", "[", "$", "thi...
Send command to server @param array $params @return string @throws HSException
[ "Send", "command", "to", "server" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Socket.php#L86-L90
husccexo/php-handlersocket-core
src/HSCore/Socket.php
Socket.parseResponse
protected function parseResponse($string) { $exp = explode(Driver::SEP, $string); if ($exp[0] != 0) { throw new HSException(isset($exp[2]) ? $exp[2] : '', $exp[0]); } array_shift($exp); // skip error code $numCols = intval(array_shift($exp)); $exp = arr...
php
protected function parseResponse($string) { $exp = explode(Driver::SEP, $string); if ($exp[0] != 0) { throw new HSException(isset($exp[2]) ? $exp[2] : '', $exp[0]); } array_shift($exp); // skip error code $numCols = intval(array_shift($exp)); $exp = arr...
[ "protected", "function", "parseResponse", "(", "$", "string", ")", "{", "$", "exp", "=", "explode", "(", "Driver", "::", "SEP", ",", "$", "string", ")", ";", "if", "(", "$", "exp", "[", "0", "]", "!=", "0", ")", "{", "throw", "new", "HSException", ...
Parse response from server @param $string @return array @throws HSException
[ "Parse", "response", "from", "server" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Socket.php#L100-L114
husccexo/php-handlersocket-core
src/HSCore/Socket.php
Socket.connect
private function connect() { if (!$this->socket->isOpened()) { $this->socket->open(); if ($this->secret) { $this->socket->send(join(Driver::SEP, ['A', 1, Driver::encode($this->secret)]).Driver::EOL); } } }
php
private function connect() { if (!$this->socket->isOpened()) { $this->socket->open(); if ($this->secret) { $this->socket->send(join(Driver::SEP, ['A', 1, Driver::encode($this->secret)]).Driver::EOL); } } }
[ "private", "function", "connect", "(", ")", "{", "if", "(", "!", "$", "this", "->", "socket", "->", "isOpened", "(", ")", ")", "{", "$", "this", "->", "socket", "->", "open", "(", ")", ";", "if", "(", "$", "this", "->", "secret", ")", "{", "$",...
Connect to Handler Socket @throws HSException
[ "Connect", "to", "Handler", "Socket" ]
train
https://github.com/husccexo/php-handlersocket-core/blob/aaeeece9c90a89bbc861a6fe390bc0c892496bf0/src/HSCore/Socket.php#L122-L131
blast-project/BaseEntitiesBundle
src/Controller/SortableController.php
SortableController.moveSortableItemAction
public function moveSortableItemAction(Request $request) { $admin = $this->container->get('sonata.admin.pool')->getInstance($request->get('admin_code')); $class = $admin->getClass(); $id = $request->get('id'); $prev_rank = (int) $request->get('prev_rank'); $next_rank = (int)...
php
public function moveSortableItemAction(Request $request) { $admin = $this->container->get('sonata.admin.pool')->getInstance($request->get('admin_code')); $class = $admin->getClass(); $id = $request->get('id'); $prev_rank = (int) $request->get('prev_rank'); $next_rank = (int)...
[ "public", "function", "moveSortableItemAction", "(", "Request", "$", "request", ")", "{", "$", "admin", "=", "$", "this", "->", "container", "->", "get", "(", "'sonata.admin.pool'", ")", "->", "getInstance", "(", "$", "request", "->", "get", "(", "'admin_cod...
Move a sortable item. @param Request $request @return JsonResponse @throws \RuntimeException @throws AccessDeniedException
[ "Move", "a", "sortable", "item", "." ]
train
https://github.com/blast-project/BaseEntitiesBundle/blob/abd06891fc38922225ab7e4fcb437a286ba2c0c4/src/Controller/SortableController.php#L34-L57
gn36/phpbb-oo-posting-api
src/Gn36/OoPostingApi/topic.php
topic.submit
function submit($submit_posts = true) { global $config, $db, $auth, $user, $phpbb_container; if (! $this->topic_id && count($this->posts) == 0) { trigger_error('cannot create a topic without posts', E_USER_ERROR); } if (! $this->topic_id) { // new post, set some default values if not set yet if ...
php
function submit($submit_posts = true) { global $config, $db, $auth, $user, $phpbb_container; if (! $this->topic_id && count($this->posts) == 0) { trigger_error('cannot create a topic without posts', E_USER_ERROR); } if (! $this->topic_id) { // new post, set some default values if not set yet if ...
[ "function", "submit", "(", "$", "submit_posts", "=", "true", ")", "{", "global", "$", "config", ",", "$", "db", ",", "$", "auth", ",", "$", "user", ",", "$", "phpbb_container", ";", "if", "(", "!", "$", "this", "->", "topic_id", "&&", "count", "(",...
TODO
[ "TODO" ]
train
https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/src/Gn36/OoPostingApi/topic.php#L232-L592
gn36/phpbb-oo-posting-api
src/Gn36/OoPostingApi/topic.php
topic.bump
function bump($user_id = 0) { global $db, $user; $current_time = time(); if ($user_id == 0) $user_id = $user->data['user_id']; $db->sql_transaction('begin'); $sql = 'UPDATE ' . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = {$this->topic_last_post_id} AND topic_id = {$this->topic_i...
php
function bump($user_id = 0) { global $db, $user; $current_time = time(); if ($user_id == 0) $user_id = $user->data['user_id']; $db->sql_transaction('begin'); $sql = 'UPDATE ' . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = {$this->topic_last_post_id} AND topic_id = {$this->topic_i...
[ "function", "bump", "(", "$", "user_id", "=", "0", ")", "{", "global", "$", "db", ",", "$", "user", ";", "$", "current_time", "=", "time", "(", ")", ";", "if", "(", "$", "user_id", "==", "0", ")", "$", "user_id", "=", "$", "user", "->", "data",...
bumps the topic @param
[ "bumps", "the", "topic" ]
train
https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/src/Gn36/OoPostingApi/topic.php#L717-L755
FriendsOfApi/phraseapp
src/HttpClientConfigurator.php
HttpClientConfigurator.appendPlugin
public function appendPlugin(Plugin ...$plugin): HttpClientConfigurator { foreach ($plugin as $p) { $this->appendPlugins[] = $p; } return $this; }
php
public function appendPlugin(Plugin ...$plugin): HttpClientConfigurator { foreach ($plugin as $p) { $this->appendPlugins[] = $p; } return $this; }
[ "public", "function", "appendPlugin", "(", "Plugin", "...", "$", "plugin", ")", ":", "HttpClientConfigurator", "{", "foreach", "(", "$", "plugin", "as", "$", "p", ")", "{", "$", "this", "->", "appendPlugins", "[", "]", "=", "$", "p", ";", "}", "return"...
@param Plugin $plugin @return HttpClientConfigurator
[ "@param", "Plugin", "$plugin" ]
train
https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/HttpClientConfigurator.php#L104-L111
FriendsOfApi/phraseapp
src/HttpClientConfigurator.php
HttpClientConfigurator.prependPlugin
public function prependPlugin(Plugin ...$plugin): HttpClientConfigurator { $plugin = array_reverse($plugin); foreach ($plugin as $p) { array_unshift($this->prependPlugins, $p); } return $this; }
php
public function prependPlugin(Plugin ...$plugin): HttpClientConfigurator { $plugin = array_reverse($plugin); foreach ($plugin as $p) { array_unshift($this->prependPlugins, $p); } return $this; }
[ "public", "function", "prependPlugin", "(", "Plugin", "...", "$", "plugin", ")", ":", "HttpClientConfigurator", "{", "$", "plugin", "=", "array_reverse", "(", "$", "plugin", ")", ";", "foreach", "(", "$", "plugin", "as", "$", "p", ")", "{", "array_unshift"...
@param Plugin $plugin @return HttpClientConfigurator
[ "@param", "Plugin", "$plugin" ]
train
https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/HttpClientConfigurator.php#L118-L126
Baachi/CouchDB
src/CouchDB/Connection.php
Connection.version
public function version() { $json = (string) $this->client->request('GET', '/')->getBody(); $value = JSONEncoder::decode($json); return $value['version']; }
php
public function version() { $json = (string) $this->client->request('GET', '/')->getBody(); $value = JSONEncoder::decode($json); return $value['version']; }
[ "public", "function", "version", "(", ")", "{", "$", "json", "=", "(", "string", ")", "$", "this", "->", "client", "->", "request", "(", "'GET'", ",", "'/'", ")", "->", "getBody", "(", ")", ";", "$", "value", "=", "JSONEncoder", "::", "decode", "("...
Get the couchdb version. @return string
[ "Get", "the", "couchdb", "version", "." ]
train
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L52-L58
Baachi/CouchDB
src/CouchDB/Connection.php
Connection.listDatabases
public function listDatabases() { $json = (string) $this->client->request('GET', '/_all_dbs')->getBody(); $databases = JSONEncoder::decode($json); return $databases; }
php
public function listDatabases() { $json = (string) $this->client->request('GET', '/_all_dbs')->getBody(); $databases = JSONEncoder::decode($json); return $databases; }
[ "public", "function", "listDatabases", "(", ")", "{", "$", "json", "=", "(", "string", ")", "$", "this", "->", "client", "->", "request", "(", "'GET'", ",", "'/_all_dbs'", ")", "->", "getBody", "(", ")", ";", "$", "databases", "=", "JSONEncoder", "::",...
Show all databases. @return array
[ "Show", "all", "databases", "." ]
train
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L65-L71
Baachi/CouchDB
src/CouchDB/Connection.php
Connection.dropDatabase
public function dropDatabase($name) { if ($this->eventManager->hasListeners(Events::PRE_DROP_DATABASE)) { // @codeCoverageIgnoreStart $this->eventManager->dispatchEvent(Events::PRE_DROP_DATABASE, new EventArgs($this, $name)); // @codeCoverageIgnoreEnd } $...
php
public function dropDatabase($name) { if ($this->eventManager->hasListeners(Events::PRE_DROP_DATABASE)) { // @codeCoverageIgnoreStart $this->eventManager->dispatchEvent(Events::PRE_DROP_DATABASE, new EventArgs($this, $name)); // @codeCoverageIgnoreEnd } $...
[ "public", "function", "dropDatabase", "(", "$", "name", ")", "{", "if", "(", "$", "this", "->", "eventManager", "->", "hasListeners", "(", "Events", "::", "PRE_DROP_DATABASE", ")", ")", "{", "// @codeCoverageIgnoreStart", "$", "this", "->", "eventManager", "->...
Drop a database. @param string $name @return bool
[ "Drop", "a", "database", "." ]
train
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L80-L104
Baachi/CouchDB
src/CouchDB/Connection.php
Connection.selectDatabase
public function selectDatabase($name) { $response = $this->client->request('GET', sprintf('/%s/', $name)); if (404 === $response->getStatusCode()) { throw new Exception(sprintf('The database "%s" does not exist', $name)); } return $this->wrapDatabase($name); }
php
public function selectDatabase($name) { $response = $this->client->request('GET', sprintf('/%s/', $name)); if (404 === $response->getStatusCode()) { throw new Exception(sprintf('The database "%s" does not exist', $name)); } return $this->wrapDatabase($name); }
[ "public", "function", "selectDatabase", "(", "$", "name", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "request", "(", "'GET'", ",", "sprintf", "(", "'/%s/'", ",", "$", "name", ")", ")", ";", "if", "(", "404", "===", "$", "res...
Select a database. @param string $name @throws Exception If the database doesn't exists. @return Database
[ "Select", "a", "database", "." ]
train
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L115-L124
Baachi/CouchDB
src/CouchDB/Connection.php
Connection.hasDatabase
public function hasDatabase($name) { $response = $this->client->request( 'GET', sprintf('/%s/', urlencode($name)) ); return 404 !== $response->getStatusCode(); }
php
public function hasDatabase($name) { $response = $this->client->request( 'GET', sprintf('/%s/', urlencode($name)) ); return 404 !== $response->getStatusCode(); }
[ "public", "function", "hasDatabase", "(", "$", "name", ")", "{", "$", "response", "=", "$", "this", "->", "client", "->", "request", "(", "'GET'", ",", "sprintf", "(", "'/%s/'", ",", "urlencode", "(", "$", "name", ")", ")", ")", ";", "return", "404",...
Check if a database exists. @param string $name The database name @return bool
[ "Check", "if", "a", "database", "exists", "." ]
train
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L133-L141
Baachi/CouchDB
src/CouchDB/Connection.php
Connection.createDatabase
public function createDatabase($name) { if (preg_match('@[^a-z0-9\_\$\(\)+\-]@', $name)) { throw new InvalidDatabasenameException(sprintf( 'The database name %s is invalid. The database name must match the following pattern (a-z0-9_$()+-)', $name )); ...
php
public function createDatabase($name) { if (preg_match('@[^a-z0-9\_\$\(\)+\-]@', $name)) { throw new InvalidDatabasenameException(sprintf( 'The database name %s is invalid. The database name must match the following pattern (a-z0-9_$()+-)', $name )); ...
[ "public", "function", "createDatabase", "(", "$", "name", ")", "{", "if", "(", "preg_match", "(", "'@[^a-z0-9\\_\\$\\(\\)+\\-]@'", ",", "$", "name", ")", ")", "{", "throw", "new", "InvalidDatabasenameException", "(", "sprintf", "(", "'The database name %s is invalid...
Creates a new database. @param string $name The database name @throws Exception If the database could not be created. @return Database
[ "Creates", "a", "new", "database", "." ]
train
https://github.com/Baachi/CouchDB/blob/6be364c2f3d9c7b1288b1c11115469c91819ff5c/src/CouchDB/Connection.php#L152-L189
thienhungho/yii2-product-management
src/modules/ProductManage/search/ProductTypeSearch.php
ProductTypeSearch.search
public function search($params) { $query = ProductType::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return a...
php
public function search($params) { $query = ProductType::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return a...
[ "public", "function", "search", "(", "$", "params", ")", "{", "$", "query", "=", "ProductType", "::", "find", "(", ")", ";", "$", "dataProvider", "=", "new", "ActiveDataProvider", "(", "[", "'query'", "=>", "$", "query", ",", "]", ")", ";", "$", "thi...
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/ProductTypeSearch.php#L42-L70
antismok/domain-events-publisher
src/DomainEventPublisher.php
DomainEventPublisher.addListener
public function addListener(string $eventName, $listener, int $priority = 0): void { $this->dispatcher->addListener($eventName, $listener, $priority); }
php
public function addListener(string $eventName, $listener, int $priority = 0): void { $this->dispatcher->addListener($eventName, $listener, $priority); }
[ "public", "function", "addListener", "(", "string", "$", "eventName", ",", "$", "listener", ",", "int", "$", "priority", "=", "0", ")", ":", "void", "{", "$", "this", "->", "dispatcher", "->", "addListener", "(", "$", "eventName", ",", "$", "listener", ...
Adds an event listener that listens on the specified events. @param string $eventName The event to listen on @param callable $listener The listener @param int $priority The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0) @return void
[ "Adds", "an", "event", "listener", "that", "listens", "on", "the", "specified", "events", "." ]
train
https://github.com/antismok/domain-events-publisher/blob/3ce431a0b81b1de10cd189281b05b8084c42bc63/src/DomainEventPublisher.php#L62-L65
antismok/domain-events-publisher
src/DomainEventPublisher.php
DomainEventPublisher.removeListener
public function removeListener(string $eventName, $listener): void { $this->dispatcher->removeListener($eventName, $listener); }
php
public function removeListener(string $eventName, $listener): void { $this->dispatcher->removeListener($eventName, $listener); }
[ "public", "function", "removeListener", "(", "string", "$", "eventName", ",", "$", "listener", ")", ":", "void", "{", "$", "this", "->", "dispatcher", "->", "removeListener", "(", "$", "eventName", ",", "$", "listener", ")", ";", "}" ]
Remove event listener @param string $eventName @param type $listener @return void
[ "Remove", "event", "listener" ]
train
https://github.com/antismok/domain-events-publisher/blob/3ce431a0b81b1de10cd189281b05b8084c42bc63/src/DomainEventPublisher.php#L75-L78
antismok/domain-events-publisher
src/DomainEventPublisher.php
DomainEventPublisher.removeListeners
public function removeListeners(string $eventName): void { foreach ($this->dispatcher->getListeners($eventName) as $listener) { $this->removeListener($eventName, $listener); } }
php
public function removeListeners(string $eventName): void { foreach ($this->dispatcher->getListeners($eventName) as $listener) { $this->removeListener($eventName, $listener); } }
[ "public", "function", "removeListeners", "(", "string", "$", "eventName", ")", ":", "void", "{", "foreach", "(", "$", "this", "->", "dispatcher", "->", "getListeners", "(", "$", "eventName", ")", "as", "$", "listener", ")", "{", "$", "this", "->", "remov...
Remove all event listeners @param string $eventName @return void
[ "Remove", "all", "event", "listeners" ]
train
https://github.com/antismok/domain-events-publisher/blob/3ce431a0b81b1de10cd189281b05b8084c42bc63/src/DomainEventPublisher.php#L87-L92
antismok/domain-events-publisher
src/DomainEventPublisher.php
DomainEventPublisher.dispatch
protected function dispatch(string $eventName, DomainEvent $event): void { $listeners = $this->dispatcher->getListeners($eventName); if (!empty($listeners)) { $this->doDispatch($listeners, $eventName, $event); } }
php
protected function dispatch(string $eventName, DomainEvent $event): void { $listeners = $this->dispatcher->getListeners($eventName); if (!empty($listeners)) { $this->doDispatch($listeners, $eventName, $event); } }
[ "protected", "function", "dispatch", "(", "string", "$", "eventName", ",", "DomainEvent", "$", "event", ")", ":", "void", "{", "$", "listeners", "=", "$", "this", "->", "dispatcher", "->", "getListeners", "(", "$", "eventName", ")", ";", "if", "(", "!", ...
Dispatches an event to all registered listeners. @param string $eventName The name of the event to dispatch. @param DomainEvent $event The event to pass to the event handlers/listeners @return void
[ "Dispatches", "an", "event", "to", "all", "registered", "listeners", "." ]
train
https://github.com/antismok/domain-events-publisher/blob/3ce431a0b81b1de10cd189281b05b8084c42bc63/src/DomainEventPublisher.php#L102-L109
antismok/domain-events-publisher
src/DomainEventPublisher.php
DomainEventPublisher.doDispatch
protected function doDispatch(array $listeners, string $eventName, DomainEvent $event): void { foreach ($listeners as $listener) { call_user_func($listener, $event, $eventName, $this); } }
php
protected function doDispatch(array $listeners, string $eventName, DomainEvent $event): void { foreach ($listeners as $listener) { call_user_func($listener, $event, $eventName, $this); } }
[ "protected", "function", "doDispatch", "(", "array", "$", "listeners", ",", "string", "$", "eventName", ",", "DomainEvent", "$", "event", ")", ":", "void", "{", "foreach", "(", "$", "listeners", "as", "$", "listener", ")", "{", "call_user_func", "(", "$", ...
Triggers the listeners of an event. This method can be overridden to add functionality that is executed for each listener. @param callable[] $listeners The event listeners @param string $eventName The name of the event to dispatch @param DomainEvent $event The event object to pass to the event handlers/list...
[ "Triggers", "the", "listeners", "of", "an", "event", "." ]
train
https://github.com/antismok/domain-events-publisher/blob/3ce431a0b81b1de10cd189281b05b8084c42bc63/src/DomainEventPublisher.php#L123-L128
surebert/surebert-framework
src/sb/XMPP/Packet.php
Packet.setTo
public function setTo($to) { $attr = $this->createAttribute('to'); $this->doc->appendChild($attr); $attr->appendChild($this->createTextNode($to)); }
php
public function setTo($to) { $attr = $this->createAttribute('to'); $this->doc->appendChild($attr); $attr->appendChild($this->createTextNode($to)); }
[ "public", "function", "setTo", "(", "$", "to", ")", "{", "$", "attr", "=", "$", "this", "->", "createAttribute", "(", "'to'", ")", ";", "$", "this", "->", "doc", "->", "appendChild", "(", "$", "attr", ")", ";", "$", "attr", "->", "appendChild", "("...
Sets the to jid of the message @param string $to e.g. paul.visco@chat.roswellpark.org
[ "Sets", "the", "to", "jid", "of", "the", "message" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Packet.php#L62-L67
surebert/surebert-framework
src/sb/XMPP/Packet.php
Packet.setFrom
public function setFrom($from) { $attr = $this->createAttribute('from'); $this->doc->appendChild($attr); $attr->appendChild($this->createTextNode($from)); }
php
public function setFrom($from) { $attr = $this->createAttribute('from'); $this->doc->appendChild($attr); $attr->appendChild($this->createTextNode($from)); }
[ "public", "function", "setFrom", "(", "$", "from", ")", "{", "$", "attr", "=", "$", "this", "->", "createAttribute", "(", "'from'", ")", ";", "$", "this", "->", "doc", "->", "appendChild", "(", "$", "attr", ")", ";", "$", "attr", "->", "appendChild",...
Sets the from jid of the message @param string $from e.g. paul.visco@chat.roswellpark.org
[ "Sets", "the", "from", "jid", "of", "the", "message" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Packet.php#L73-L78
surebert/surebert-framework
src/sb/XMPP/Packet.php
Packet.addXML
public function addXML($xml) { $next_elem = $this->createDocumentFragment(); $next_elem->appendXML($xml); $this->doc->appendChild($next_elem); }
php
public function addXML($xml) { $next_elem = $this->createDocumentFragment(); $next_elem->appendXML($xml); $this->doc->appendChild($next_elem); }
[ "public", "function", "addXML", "(", "$", "xml", ")", "{", "$", "next_elem", "=", "$", "this", "->", "createDocumentFragment", "(", ")", ";", "$", "next_elem", "->", "appendXML", "(", "$", "xml", ")", ";", "$", "this", "->", "doc", "->", "appendChild",...
Adds an arbitrary XML string to the packet's root node @param string $xml
[ "Adds", "an", "arbitrary", "XML", "string", "to", "the", "packet", "s", "root", "node" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/XMPP/Packet.php#L104-L110
glynnforrest/active-doctrine
src/ActiveDoctrine/Repository/AbstractRepository.php
AbstractRepository.findBy
public function findBy(array $conditions) { $s = $this->selector(); foreach ($conditions as $column => $value) { $s->where($column, '=', $value); } return $s->execute(); }
php
public function findBy(array $conditions) { $s = $this->selector(); foreach ($conditions as $column => $value) { $s->where($column, '=', $value); } return $s->execute(); }
[ "public", "function", "findBy", "(", "array", "$", "conditions", ")", "{", "$", "s", "=", "$", "this", "->", "selector", "(", ")", ";", "foreach", "(", "$", "conditions", "as", "$", "column", "=>", "$", "value", ")", "{", "$", "s", "->", "where", ...
Select entities matching an array of conditions. @param array $conditions An array of the form 'column => value' @return EntityCollection The selected entities
[ "Select", "entities", "matching", "an", "array", "of", "conditions", "." ]
train
https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Repository/AbstractRepository.php#L57-L65
glynnforrest/active-doctrine
src/ActiveDoctrine/Repository/AbstractRepository.php
AbstractRepository.findOneBy
public function findOneBy(array $conditions) { $s = $this->selector()->one(); foreach ($conditions as $column => $value) { $s->where($column, '=', $value); } return $s->execute(); }
php
public function findOneBy(array $conditions) { $s = $this->selector()->one(); foreach ($conditions as $column => $value) { $s->where($column, '=', $value); } return $s->execute(); }
[ "public", "function", "findOneBy", "(", "array", "$", "conditions", ")", "{", "$", "s", "=", "$", "this", "->", "selector", "(", ")", "->", "one", "(", ")", ";", "foreach", "(", "$", "conditions", "as", "$", "column", "=>", "$", "value", ")", "{", ...
Select a single entity matching an array of conditions. @param array $conditions An array of the form 'column => value' @return Entity|null The selected entity or null
[ "Select", "a", "single", "entity", "matching", "an", "array", "of", "conditions", "." ]
train
https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Repository/AbstractRepository.php#L73-L81
php-lug/lug
src/Component/Translation/Repository/Doctrine/MongoDB/TranslatableRepositoryFactory.php
TranslatableRepositoryFactory.createResourceRepository
protected function createResourceRepository( $class, DocumentManager $documentManager, ClassMetadata $metadata, ResourceInterface $resource = null ) { if ($resource !== null && is_a($class, TranslatableRepository::class, true)) { return new $class( ...
php
protected function createResourceRepository( $class, DocumentManager $documentManager, ClassMetadata $metadata, ResourceInterface $resource = null ) { if ($resource !== null && is_a($class, TranslatableRepository::class, true)) { return new $class( ...
[ "protected", "function", "createResourceRepository", "(", "$", "class", ",", "DocumentManager", "$", "documentManager", ",", "ClassMetadata", "$", "metadata", ",", "ResourceInterface", "$", "resource", "=", "null", ")", "{", "if", "(", "$", "resource", "!==", "n...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Repository/Doctrine/MongoDB/TranslatableRepositoryFactory.php#L44-L61
scherersoftware/cake-monitor
src/Error/SentryHandler.php
SentryHandler.handle
public function handle(Throwable $throwable) { if (!Configure::read('CakeMonitor.Sentry.enabled') || error_reporting() === 0) { return false; } $errorHandler = new \Raven_ErrorHandler($this->_ravenClient); $errorHandler->registerShutdownFunction(); $errorHandler-...
php
public function handle(Throwable $throwable) { if (!Configure::read('CakeMonitor.Sentry.enabled') || error_reporting() === 0) { return false; } $errorHandler = new \Raven_ErrorHandler($this->_ravenClient); $errorHandler->registerShutdownFunction(); $errorHandler-...
[ "public", "function", "handle", "(", "Throwable", "$", "throwable", ")", "{", "if", "(", "!", "Configure", "::", "read", "(", "'CakeMonitor.Sentry.enabled'", ")", "||", "error_reporting", "(", ")", "===", "0", ")", "{", "return", "false", ";", "}", "$", ...
Throwable Handler @param Throwable $throwable Throwable to handle @return void
[ "Throwable", "Handler" ]
train
https://github.com/scherersoftware/cake-monitor/blob/dbe07a1aac41b3db15e631d9e59cf26214bf6938/src/Error/SentryHandler.php#L44-L53
scherersoftware/cake-monitor
src/Error/SentryHandler.php
SentryHandler.captureMessage
public function captureMessage($message, $params = [], $data = [], $stack = false, $vars = null) { if (!Configure::read('CakeMonitor.Sentry.enabled') || error_reporting() === 0) { return false; } if (is_callable(Configure::read('CakeMonitor.Sentry.extraDataCallback'))) { ...
php
public function captureMessage($message, $params = [], $data = [], $stack = false, $vars = null) { if (!Configure::read('CakeMonitor.Sentry.enabled') || error_reporting() === 0) { return false; } if (is_callable(Configure::read('CakeMonitor.Sentry.extraDataCallback'))) { ...
[ "public", "function", "captureMessage", "(", "$", "message", ",", "$", "params", "=", "[", "]", ",", "$", "data", "=", "[", "]", ",", "$", "stack", "=", "false", ",", "$", "vars", "=", "null", ")", "{", "if", "(", "!", "Configure", "::", "read", ...
Capture a message via sentry @param string $message The message (primary description) for the event. @param array $params params to use when formatting the message. @param array $data Additional attributes to pass with this event (see Sentry docs). @param bool $stack Print stack trace @param null $vars Variables @retu...
[ "Capture", "a", "message", "via", "sentry" ]
train
https://github.com/scherersoftware/cake-monitor/blob/dbe07a1aac41b3db15e631d9e59cf26214bf6938/src/Error/SentryHandler.php#L65-L76
nabab/bbn
src/bbn/util/logger.php
logger.report
public function report($st) { if ( php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']) ){ if ( \is_string($st) ){ echo $st."\n"; } else{ print_r($st,1)."\n"; } } else{ if ( \is_string($st) ){ array_push($this->reports,$st); } else{ array_push($this->reports,print_r($st...
php
public function report($st) { if ( php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']) ){ if ( \is_string($st) ){ echo $st."\n"; } else{ print_r($st,1)."\n"; } } else{ if ( \is_string($st) ){ array_push($this->reports,$st); } else{ array_push($this->reports,print_r($st...
[ "public", "function", "report", "(", "$", "st", ")", "{", "if", "(", "php_sapi_name", "(", ")", "==", "'cli'", "&&", "empty", "(", "$", "_SERVER", "[", "'REMOTE_ADDR'", "]", ")", ")", "{", "if", "(", "\\", "is_string", "(", "$", "st", ")", ")", "...
Add information to the $info array @param string $st @return null
[ "Add", "information", "to", "the", "$info", "array" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/util/logger.php#L28-L47
nabab/bbn
src/bbn/util/logger.php
logger.log
public function log($st='',$file='misc') { if ( \defined('BBN_DATA_PATH') && is_dir(BBN_DATA_PATH.'logs') ){ $log_file = BBN_DATA_PATH.'logs/'.$file.'.log'; $r = "[".date('d/m/Y H:i:s')."]\t"; if ( empty($st) && \count($this->reports) > 0 ){ $st = implode("\n\n", $this->reports); $this->reports = []...
php
public function log($st='',$file='misc') { if ( \defined('BBN_DATA_PATH') && is_dir(BBN_DATA_PATH.'logs') ){ $log_file = BBN_DATA_PATH.'logs/'.$file.'.log'; $r = "[".date('d/m/Y H:i:s')."]\t"; if ( empty($st) && \count($this->reports) > 0 ){ $st = implode("\n\n", $this->reports); $this->reports = []...
[ "public", "function", "log", "(", "$", "st", "=", "''", ",", "$", "file", "=", "'misc'", ")", "{", "if", "(", "\\", "defined", "(", "'BBN_DATA_PATH'", ")", "&&", "is_dir", "(", "BBN_DATA_PATH", ".", "'logs'", ")", ")", "{", "$", "log_file", "=", "B...
Add information to the $info array @param string $st @param string $file @return null
[ "Add", "information", "to", "the", "$info", "array" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/util/logger.php#L61-L85
oroinc/OroLayoutComponent
Loader/Generator/ConfigLayoutUpdateGenerator.php
ConfigLayoutUpdateGenerator.doGenerateBody
protected function doGenerateBody(GeneratorData $data) { $body = []; $source = $data->getSource(); foreach ($source[self::NODE_ACTIONS] as $actionDefinition) { $actionName = key($actionDefinition); $arguments = isset($actionDefinition[$actionName]) && is_array($ac...
php
protected function doGenerateBody(GeneratorData $data) { $body = []; $source = $data->getSource(); foreach ($source[self::NODE_ACTIONS] as $actionDefinition) { $actionName = key($actionDefinition); $arguments = isset($actionDefinition[$actionName]) && is_array($ac...
[ "protected", "function", "doGenerateBody", "(", "GeneratorData", "$", "data", ")", "{", "$", "body", "=", "[", "]", ";", "$", "source", "=", "$", "data", "->", "getSource", "(", ")", ";", "foreach", "(", "$", "source", "[", "self", "::", "NODE_ACTIONS"...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Generator/ConfigLayoutUpdateGenerator.php#L32-L60
oroinc/OroLayoutComponent
Loader/Generator/ConfigLayoutUpdateGenerator.php
ConfigLayoutUpdateGenerator.validate
protected function validate(GeneratorData $data) { $source = $data->getSource(); if (!(is_array($source) && isset($source[self::NODE_ACTIONS]) && is_array($source[self::NODE_ACTIONS]))) { throw new SyntaxException(sprintf('expected array with "%s" node', self::NODE_ACTIONS), $source); ...
php
protected function validate(GeneratorData $data) { $source = $data->getSource(); if (!(is_array($source) && isset($source[self::NODE_ACTIONS]) && is_array($source[self::NODE_ACTIONS]))) { throw new SyntaxException(sprintf('expected array with "%s" node', self::NODE_ACTIONS), $source); ...
[ "protected", "function", "validate", "(", "GeneratorData", "$", "data", ")", "{", "$", "source", "=", "$", "data", "->", "getSource", "(", ")", ";", "if", "(", "!", "(", "is_array", "(", "$", "source", ")", "&&", "isset", "(", "$", "source", "[", "...
Validates given resource data, checks that "actions" node exists and consist valid actions. {@inheritdoc} @SuppressWarnings(PHPMD.NPathComplexity)
[ "Validates", "given", "resource", "data", "checks", "that", "actions", "node", "exists", "and", "consist", "valid", "actions", "." ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Generator/ConfigLayoutUpdateGenerator.php#L68-L115
oroinc/OroLayoutComponent
Loader/Generator/ConfigLayoutUpdateGenerator.php
ConfigLayoutUpdateGenerator.prepare
protected function prepare(GeneratorData $data, VisitorCollection $visitorCollection) { foreach ($this->extensions as $extension) { $extension->prepare($data, $visitorCollection); } }
php
protected function prepare(GeneratorData $data, VisitorCollection $visitorCollection) { foreach ($this->extensions as $extension) { $extension->prepare($data, $visitorCollection); } }
[ "protected", "function", "prepare", "(", "GeneratorData", "$", "data", ",", "VisitorCollection", "$", "visitorCollection", ")", "{", "foreach", "(", "$", "this", "->", "extensions", "as", "$", "extension", ")", "{", "$", "extension", "->", "prepare", "(", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Generator/ConfigLayoutUpdateGenerator.php#L120-L125
zhouyl/mellivora
Mellivora/Database/Query/Grammars/SQLiteGrammar.php
SQLiteGrammar.dateBasedWhere
protected function dateBasedWhere($type, Builder $query, $where) { $value = str_pad($where['value'], 2, '0', STR_PAD_LEFT); $value = $this->parameter($value); return "strftime('{$type}', {$this->wrap($where['column'])}) {$where['operator']} {$value}"; }
php
protected function dateBasedWhere($type, Builder $query, $where) { $value = str_pad($where['value'], 2, '0', STR_PAD_LEFT); $value = $this->parameter($value); return "strftime('{$type}', {$this->wrap($where['column'])}) {$where['operator']} {$value}"; }
[ "protected", "function", "dateBasedWhere", "(", "$", "type", ",", "Builder", "$", "query", ",", "$", "where", ")", "{", "$", "value", "=", "str_pad", "(", "$", "where", "[", "'value'", "]", ",", "2", ",", "'0'", ",", "STR_PAD_LEFT", ")", ";", "$", ...
Compile a date based where clause. @param string $type @param \Mellivora\Database\Query\Builder $query @param array $where @return string
[ "Compile", "a", "date", "based", "where", "clause", "." ]
train
https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Query/Grammars/SQLiteGrammar.php#L81-L88
nabab/bbn
src/bbn/appui/mapper.php
mapper.table_id
public function table_id($table, $db=false){ if ( substr_count($table, ".") === 1 ){ return $table; } else { return ( $db ?: $this->client_db ).'.'.$table; } }
php
public function table_id($table, $db=false){ if ( substr_count($table, ".") === 1 ){ return $table; } else { return ( $db ?: $this->client_db ).'.'.$table; } }
[ "public", "function", "table_id", "(", "$", "table", ",", "$", "db", "=", "false", ")", "{", "if", "(", "substr_count", "(", "$", "table", ",", "\".\"", ")", "===", "1", ")", "{", "return", "$", "table", ";", "}", "else", "{", "return", "(", "$",...
Returns the ID of a table (db.table) @param string $table The database table @param bool|string $db The database @return string
[ "Returns", "the", "ID", "of", "a", "table", "(", "db", ".", "table", ")" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/mapper.php#L116-L123
nabab/bbn
src/bbn/appui/mapper.php
mapper.col_id
public function col_id($col, $table=false){ if ( substr_count($col, ".") === 2 ){ return $col; } else if ( substr_count($col, ".") === 1 ){ if ( $table ){ return $this->table_id($table).'.'.$this->simple_name($col); } else{ return $this->simple_name($this->client...
php
public function col_id($col, $table=false){ if ( substr_count($col, ".") === 2 ){ return $col; } else if ( substr_count($col, ".") === 1 ){ if ( $table ){ return $this->table_id($table).'.'.$this->simple_name($col); } else{ return $this->simple_name($this->client...
[ "public", "function", "col_id", "(", "$", "col", ",", "$", "table", "=", "false", ")", "{", "if", "(", "substr_count", "(", "$", "col", ",", "\".\"", ")", "===", "2", ")", "{", "return", "$", "col", ";", "}", "else", "if", "(", "substr_count", "(...
Returns the ID of a column (db.table.column) @param string $col The table's column (can include the table) @param type $table The table @return string
[ "Returns", "the", "ID", "of", "a", "column", "(", "db", ".", "table", ".", "column", ")" ]
train
https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/mapper.php#L132-L148