id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
191,000 | joomlatools/joomlatools-composer | src/Joomlatools/Joomla/Application.php | Application.authenticate | public function authenticate($credentials)
{
$user = JFactory::getUser();
$user->guest = 0;
foreach($credentials as $key => $value) {
$user->$key = $value;
}
JFactory::getSession()->set('user', $user);
} | php | public function authenticate($credentials)
{
$user = JFactory::getUser();
$user->guest = 0;
foreach($credentials as $key => $value) {
$user->$key = $value;
}
JFactory::getSession()->set('user', $user);
} | [
"public",
"function",
"authenticate",
"(",
"$",
"credentials",
")",
"{",
"$",
"user",
"=",
"JFactory",
"::",
"getUser",
"(",
")",
";",
"$",
"user",
"->",
"guest",
"=",
"0",
";",
"foreach",
"(",
"$",
"credentials",
"as",
"$",
"key",
"=>",
"$",
"value"... | Authenticates the Joomla user.
This method will load the default user object and change its guest status to logged in.
It will then simply copy all the properties defined by key in the $credentials argument
onto this JUser object, allowing you to completely overwrite the user information.
@param array $credentials ... | [
"Authenticates",
"the",
"Joomla",
"user",
"."
] | b4164897dc5da5d6ff560ed3189a36c0d251fa33 | https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Application.php#L120-L130 |
191,001 | joomlatools/joomlatools-composer | src/Joomlatools/Joomla/Application.php | Application.isInstalled | public function isInstalled($installPath)
{
$manifest = Util::getPackageManifest($installPath);
if ($manifest === false) {
return false;
}
$xml = simplexml_load_file($manifest);
if($xml instanceof \SimpleXMLElement)
{
$type = (string) $xm... | php | public function isInstalled($installPath)
{
$manifest = Util::getPackageManifest($installPath);
if ($manifest === false) {
return false;
}
$xml = simplexml_load_file($manifest);
if($xml instanceof \SimpleXMLElement)
{
$type = (string) $xm... | [
"public",
"function",
"isInstalled",
"(",
"$",
"installPath",
")",
"{",
"$",
"manifest",
"=",
"Util",
"::",
"getPackageManifest",
"(",
"$",
"installPath",
")",
";",
"if",
"(",
"$",
"manifest",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
... | Check if the Composer package located at the given path is installed or not.
This method will look for the package manifest at the given
directory. It will extract the extension name from the manifest
and see if that element is installed in the database.
@param string $installPath Path to Composer package
@return boo... | [
"Check",
"if",
"the",
"Composer",
"package",
"located",
"at",
"the",
"given",
"path",
"is",
"installed",
"or",
"not",
"."
] | b4164897dc5da5d6ff560ed3189a36c0d251fa33 | https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Application.php#L142-L171 |
191,002 | joomlatools/joomlatools-composer | src/Joomlatools/Joomla/Application.php | Application.uninstall | public function uninstall($id, $type)
{
$installer = $this->getInstaller();
return $installer->uninstall($type, $id);
} | php | public function uninstall($id, $type)
{
$installer = $this->getInstaller();
return $installer->uninstall($type, $id);
} | [
"public",
"function",
"uninstall",
"(",
"$",
"id",
",",
"$",
"type",
")",
"{",
"$",
"installer",
"=",
"$",
"this",
"->",
"getInstaller",
"(",
")",
";",
"return",
"$",
"installer",
"->",
"uninstall",
"(",
"$",
"type",
",",
"$",
"id",
")",
";",
"}"
] | Uninstalls the given extension
@param int $id ID of the extension row
@param string $type Type of extension (component, module, ..)
@return bool | [
"Uninstalls",
"the",
"given",
"extension"
] | b4164897dc5da5d6ff560ed3189a36c0d251fa33 | https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Application.php#L237-L242 |
191,003 | joomlatools/joomlatools-composer | src/Joomlatools/Joomla/Application.php | Application._setupLogging | protected function _setupLogging($loglevel)
{
// Backwards compatibility
if (file_exists(JPATH_LIBRARIES . '/src/Log/Log.php')) {
require_once JPATH_LIBRARIES . '/src/Log/Log.php';
} else {
require_once JPATH_LIBRARIES . '/joomla/log/log.php';
}
if ($logl... | php | protected function _setupLogging($loglevel)
{
// Backwards compatibility
if (file_exists(JPATH_LIBRARIES . '/src/Log/Log.php')) {
require_once JPATH_LIBRARIES . '/src/Log/Log.php';
} else {
require_once JPATH_LIBRARIES . '/joomla/log/log.php';
}
if ($logl... | [
"protected",
"function",
"_setupLogging",
"(",
"$",
"loglevel",
")",
"{",
"// Backwards compatibility",
"if",
"(",
"file_exists",
"(",
"JPATH_LIBRARIES",
".",
"'/src/Log/Log.php'",
")",
")",
"{",
"require_once",
"JPATH_LIBRARIES",
".",
"'/src/Log/Log.php'",
";",
"}",
... | Enable logging to stdout of Joomla system messages.
@param int $loglevel The log level
@return void | [
"Enable",
"logging",
"to",
"stdout",
"of",
"Joomla",
"system",
"messages",
"."
] | b4164897dc5da5d6ff560ed3189a36c0d251fa33 | https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Application.php#L498-L554 |
191,004 | phossa2/event | src/Event/StaticEventDispatcher.php | StaticEventDispatcher.getEventManager | public static function getEventManager()
{
if (!isset(self::$event_manager[get_called_class()])) {
self::$event_manager[get_called_class()] =
EventDispatcher::getShareable(static::$static_scope);
}
return self::$event_manager[get_called_class()];
} | php | public static function getEventManager()
{
if (!isset(self::$event_manager[get_called_class()])) {
self::$event_manager[get_called_class()] =
EventDispatcher::getShareable(static::$static_scope);
}
return self::$event_manager[get_called_class()];
} | [
"public",
"static",
"function",
"getEventManager",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"event_manager",
"[",
"get_called_class",
"(",
")",
"]",
")",
")",
"{",
"self",
"::",
"$",
"event_manager",
"[",
"get_called_class",
"(",
"... | Get the inner event manager
@return EventManagerInterface $eventManager
@access public
@api
@static | [
"Get",
"the",
"inner",
"event",
"manager"
] | dad12a5cb93a6fc62c6eb96278e6c3a52995fc24 | https://github.com/phossa2/event/blob/dad12a5cb93a6fc62c6eb96278e6c3a52995fc24/src/Event/StaticEventDispatcher.php#L110-L117 |
191,005 | joomlatools/joomlatools-composer | src/Joomlatools/Joomla/Bootstrapper.php | Bootstrapper.getApplication | public function getApplication()
{
if (!($this->_io instanceof IOInterface)) {
throw new \RuntimeException('Bootstrapper instance requires IOInterface instance. Please call setIO() first.');
}
if (!$this->_bootstrapped) {
$this->_bootstrap();
}
if (!... | php | public function getApplication()
{
if (!($this->_io instanceof IOInterface)) {
throw new \RuntimeException('Bootstrapper instance requires IOInterface instance. Please call setIO() first.');
}
if (!$this->_bootstrapped) {
$this->_bootstrap();
}
if (!... | [
"public",
"function",
"getApplication",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"_io",
"instanceof",
"IOInterface",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Bootstrapper instance requires IOInterface instance. Please call setIO() ... | Get the application instance.
If it 's not initialised yet, bootstrap the application.
@return \Joomlatools\Joomla\Application/bool $application Application instance on success or false on failure
@throws Exception $exception | [
"Get",
"the",
"application",
"instance",
".",
"If",
"it",
"s",
"not",
"initialised",
"yet",
"bootstrap",
"the",
"application",
"."
] | b4164897dc5da5d6ff560ed3189a36c0d251fa33 | https://github.com/joomlatools/joomlatools-composer/blob/b4164897dc5da5d6ff560ed3189a36c0d251fa33/src/Joomlatools/Joomla/Bootstrapper.php#L103-L143 |
191,006 | christiaan/zohocrmclient | Transport/XmlDataTransportDecorator.php | XmlDataTransportDecorator.parse | private function parse($content)
{
$xml = new SimpleXMLElement($content);
if (isset($xml->error)) {
throw new Exception\ZohoErrorException(
new ZohoError(
(string) $xml->error->code,
(string) $xml->error->message
)
... | php | private function parse($content)
{
$xml = new SimpleXMLElement($content);
if (isset($xml->error)) {
throw new Exception\ZohoErrorException(
new ZohoError(
(string) $xml->error->code,
(string) $xml->error->message
)
... | [
"private",
"function",
"parse",
"(",
"$",
"content",
")",
"{",
"$",
"xml",
"=",
"new",
"SimpleXMLElement",
"(",
"$",
"content",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"xml",
"->",
"error",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"ZohoError... | Parses the XML returned by Zoho to the appropriate objects
@param string $content Response body as returned by Zoho
@throws Exception\UnexpectedValueException When invalid XML is given to parse
@throws Exception\NoDataException when Zoho tells us there is no data
@throws Exception\ZohoErrorException when content is a ... | [
"Parses",
"the",
"XML",
"returned",
"by",
"Zoho",
"to",
"the",
"appropriate",
"objects"
] | 69067021ae24bce1c6d6bf516b08564d0a540bda | https://github.com/christiaan/zohocrmclient/blob/69067021ae24bce1c6d6bf516b08564d0a540bda/Transport/XmlDataTransportDecorator.php#L106-L139 |
191,007 | PurpleBooth/git-lint-validators | src/PurpleBooth/GitLintValidators/ValidatorFactoryImplementation.php | ValidatorFactoryImplementation.getMessageValidator | public function getMessageValidator(): ValidateMessage
{
$messageValidator = new ValidateMessageImplementation(
[
new CapitalizeTheSubjectLineValidator(),
new DoNotEndTheSubjectLineWithAPeriodValidator(),
new LimitTheBodyWrapLengthTo72CharactersVal... | php | public function getMessageValidator(): ValidateMessage
{
$messageValidator = new ValidateMessageImplementation(
[
new CapitalizeTheSubjectLineValidator(),
new DoNotEndTheSubjectLineWithAPeriodValidator(),
new LimitTheBodyWrapLengthTo72CharactersVal... | [
"public",
"function",
"getMessageValidator",
"(",
")",
":",
"ValidateMessage",
"{",
"$",
"messageValidator",
"=",
"new",
"ValidateMessageImplementation",
"(",
"[",
"new",
"CapitalizeTheSubjectLineValidator",
"(",
")",
",",
"new",
"DoNotEndTheSubjectLineWithAPeriodValidator"... | Get a message validator set-up with all the validators.
@return ValidateMessage | [
"Get",
"a",
"message",
"validator",
"set",
"-",
"up",
"with",
"all",
"the",
"validators",
"."
] | 8d435743e086865290a9f8bd43da275a56800e6b | https://github.com/PurpleBooth/git-lint-validators/blob/8d435743e086865290a9f8bd43da275a56800e6b/src/PurpleBooth/GitLintValidators/ValidatorFactoryImplementation.php#L31-L45 |
191,008 | Web-Feet/coasterframework | src/Helpers/Admin/Import/Block.php | Block.combine | public function combine(Block $block)
{
$this->setBlockData($block->blockData, false);
$this->setGlobalData($block->globalData, false);
$this->addTemplates($block->templates);
$this->addRepeaterBlocks($block->inRepeaterBlocks);
$this->addRepeaterChildBlocks($block->repeaterCh... | php | public function combine(Block $block)
{
$this->setBlockData($block->blockData, false);
$this->setGlobalData($block->globalData, false);
$this->addTemplates($block->templates);
$this->addRepeaterBlocks($block->inRepeaterBlocks);
$this->addRepeaterChildBlocks($block->repeaterCh... | [
"public",
"function",
"combine",
"(",
"Block",
"$",
"block",
")",
"{",
"$",
"this",
"->",
"setBlockData",
"(",
"$",
"block",
"->",
"blockData",
",",
"false",
")",
";",
"$",
"this",
"->",
"setGlobalData",
"(",
"$",
"block",
"->",
"globalData",
",",
"fal... | Add extra data from second block
@param Block $block | [
"Add",
"extra",
"data",
"from",
"second",
"block"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Admin/Import/Block.php#L135-L144 |
191,009 | Web-Feet/coasterframework | src/Helpers/Admin/Import/Block.php | Block.subtract | public function subtract(Block $block)
{
$this->blockData = array_diff_assoc($this->blockData, $block->blockData);
$this->globalData = array_diff_assoc($this->globalData, $block->globalData);
$this->templates = array_diff($this->templates, $block->templates);
$this->inRepeaterBlocks ... | php | public function subtract(Block $block)
{
$this->blockData = array_diff_assoc($this->blockData, $block->blockData);
$this->globalData = array_diff_assoc($this->globalData, $block->globalData);
$this->templates = array_diff($this->templates, $block->templates);
$this->inRepeaterBlocks ... | [
"public",
"function",
"subtract",
"(",
"Block",
"$",
"block",
")",
"{",
"$",
"this",
"->",
"blockData",
"=",
"array_diff_assoc",
"(",
"$",
"this",
"->",
"blockData",
",",
"$",
"block",
"->",
"blockData",
")",
";",
"$",
"this",
"->",
"globalData",
"=",
... | Find any differences in the data
@param Block $block
@return bool | [
"Find",
"any",
"differences",
"in",
"the",
"data"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Admin/Import/Block.php#L151-L166 |
191,010 | Web-Feet/coasterframework | src/Libraries/Blocks/Gallery.php | Gallery.exportFiles | public function exportFiles($content)
{
$images = [];
if ($galleryData = $this->_defaultData($content)) {
foreach ($galleryData as $image => $imageData) {
$images[] = '/uploads/system/gallery/' . $this->_block->name . $imageData->path . $image;
}
}
... | php | public function exportFiles($content)
{
$images = [];
if ($galleryData = $this->_defaultData($content)) {
foreach ($galleryData as $image => $imageData) {
$images[] = '/uploads/system/gallery/' . $this->_block->name . $imageData->path . $image;
}
}
... | [
"public",
"function",
"exportFiles",
"(",
"$",
"content",
")",
"{",
"$",
"images",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"galleryData",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$",
"content",
")",
")",
"{",
"foreach",
"(",
"$",
"galleryData",
"as"... | Export gallery images
@param string $content
@return array | [
"Export",
"gallery",
"images"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Gallery.php#L82-L91 |
191,011 | Web-Feet/coasterframework | src/Libraries/Blocks/Gallery.php | Gallery.editPage | public function editPage()
{
$page = Page::preload($this->_block->getPageId());
if ($page->exists) {
$paths = Path::getById($page->id);
return View::make('coaster::pages.gallery', ['paths' => $paths, '_block' => $this->_block, 'can_delete' => Auth::action('gallery.delete', ['... | php | public function editPage()
{
$page = Page::preload($this->_block->getPageId());
if ($page->exists) {
$paths = Path::getById($page->id);
return View::make('coaster::pages.gallery', ['paths' => $paths, '_block' => $this->_block, 'can_delete' => Auth::action('gallery.delete', ['... | [
"public",
"function",
"editPage",
"(",
")",
"{",
"$",
"page",
"=",
"Page",
"::",
"preload",
"(",
"$",
"this",
"->",
"_block",
"->",
"getPageId",
"(",
")",
")",
";",
"if",
"(",
"$",
"page",
"->",
"exists",
")",
"{",
"$",
"paths",
"=",
"Path",
"::"... | Display full edit page for gallery
@return \Illuminate\Contracts\View\View|string | [
"Display",
"full",
"edit",
"page",
"for",
"gallery"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Gallery.php#L99-L108 |
191,012 | Web-Feet/coasterframework | src/Libraries/Blocks/Gallery.php | Gallery.submitSort | public function submitSort()
{
$order = 1;
$galleryData = $this->_defaultData($this->_block->getContent());
foreach (Request::input('arr') as $image) {
if (!isset($galleryData[$image])) {
return 0;
}
$galleryData[$image]->order = $order++;
... | php | public function submitSort()
{
$order = 1;
$galleryData = $this->_defaultData($this->_block->getContent());
foreach (Request::input('arr') as $image) {
if (!isset($galleryData[$image])) {
return 0;
}
$galleryData[$image]->order = $order++;
... | [
"public",
"function",
"submitSort",
"(",
")",
"{",
"$",
"order",
"=",
"1",
";",
"$",
"galleryData",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$",
"this",
"->",
"_block",
"->",
"getContent",
"(",
")",
")",
";",
"foreach",
"(",
"Request",
"::",
"in... | Update sort values of images
@return int | [
"Update",
"sort",
"values",
"of",
"images"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Gallery.php#L114-L129 |
191,013 | Web-Feet/coasterframework | src/Libraries/Blocks/Gallery.php | Gallery.submitCaption | public function submitCaption()
{
$galleryData = $this->_defaultData($this->_block->getContent());
if (!empty($galleryData[Request::input('file_data')])) {
$galleryData[Request::input('file_data')]->caption = Request::input('caption');
$this->_block->updateContent(serialize($... | php | public function submitCaption()
{
$galleryData = $this->_defaultData($this->_block->getContent());
if (!empty($galleryData[Request::input('file_data')])) {
$galleryData[Request::input('file_data')]->caption = Request::input('caption');
$this->_block->updateContent(serialize($... | [
"public",
"function",
"submitCaption",
"(",
")",
"{",
"$",
"galleryData",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$",
"this",
"->",
"_block",
"->",
"getContent",
"(",
")",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"galleryData",
"[",
"Request"... | Update image caption in gallery
@return int | [
"Update",
"image",
"caption",
"in",
"gallery"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Gallery.php#L135-L147 |
191,014 | Web-Feet/coasterframework | src/Libraries/Blocks/Gallery.php | Gallery.submitDelete | public function submitDelete($file)
{
AdminLog::new_log('Removed ' . $file . ' from Gallery (ID ' . $this->_block->id . ')');
$galleryData = $this->_defaultData($this->_block->getContent());
$path = '/' . $this->_block->getPageId() . '/';
if (isset($galleryData[$file])) {
... | php | public function submitDelete($file)
{
AdminLog::new_log('Removed ' . $file . ' from Gallery (ID ' . $this->_block->id . ')');
$galleryData = $this->_defaultData($this->_block->getContent());
$path = '/' . $this->_block->getPageId() . '/';
if (isset($galleryData[$file])) {
... | [
"public",
"function",
"submitDelete",
"(",
"$",
"file",
")",
"{",
"AdminLog",
"::",
"new_log",
"(",
"'Removed '",
".",
"$",
"file",
".",
"' from Gallery (ID '",
".",
"$",
"this",
"->",
"_block",
"->",
"id",
".",
"')'",
")",
";",
"$",
"galleryData",
"=",
... | Delete image from gallery
@param string $file
@return int | [
"Delete",
"image",
"from",
"gallery"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Gallery.php#L154-L172 |
191,015 | Web-Feet/coasterframework | src/Libraries/Blocks/Gallery.php | Gallery.runHandler | public function runHandler()
{
$currentData = $this->_defaultData($this->_block->getContent());
$uploadHandler = new GalleryUploadHandler([
'print_response' => false,
'selected_data' => $currentData,
'script_url' => Request::url(),
'max_file_size' => 2... | php | public function runHandler()
{
$currentData = $this->_defaultData($this->_block->getContent());
$uploadHandler = new GalleryUploadHandler([
'print_response' => false,
'selected_data' => $currentData,
'script_url' => Request::url(),
'max_file_size' => 2... | [
"public",
"function",
"runHandler",
"(",
")",
"{",
"$",
"currentData",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$",
"this",
"->",
"_block",
"->",
"getContent",
"(",
")",
")",
";",
"$",
"uploadHandler",
"=",
"new",
"GalleryUploadHandler",
"(",
"[",
"... | Return upload images, handler also uploads image if in request
@return string | [
"Return",
"upload",
"images",
"handler",
"also",
"uploads",
"image",
"if",
"in",
"request"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Gallery.php#L178-L208 |
191,016 | yidas/codeigniter-widget | src/Widget.php | Widget.widget | public static function widget($config=[])
{
// Cache considering (Lost resetting pattern)
// if (!self::$_instance) {
// $widget = get_called_class();
// self::$_instance = new $widget;
// }
// Create an instance for each call
$widget... | php | public static function widget($config=[])
{
// Cache considering (Lost resetting pattern)
// if (!self::$_instance) {
// $widget = get_called_class();
// self::$_instance = new $widget;
// }
// Create an instance for each call
$widget... | [
"public",
"static",
"function",
"widget",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"// Cache considering (Lost resetting pattern)\r",
"// if (!self::$_instance) {\r",
"// $widget = get_called_class();\r",
"// self::$_instance = new $widget;\r",
"// }\r",
"// Create an i... | Creates a widget instance and runs it.
The widget rendering result is returned by this method.
@param array $config name-value pairs that will be used to initialize the object properties
@return string the rendering result of the widget.
@throws \Exception | [
"Creates",
"a",
"widget",
"instance",
"and",
"runs",
"it",
".",
"The",
"widget",
"rendering",
"result",
"is",
"returned",
"by",
"this",
"method",
"."
] | c13dcb9cf726c5b88564a3f46baf2ca7e46a5042 | https://github.com/yidas/codeigniter-widget/blob/c13dcb9cf726c5b88564a3f46baf2ca7e46a5042/src/Widget.php#L47-L66 |
191,017 | yidas/codeigniter-widget | src/Widget.php | Widget.getViewPath | public function getViewPath()
{
// Cache mechanism
if (self::$_viewPath) {
return self::$_viewPath;
}
// Called widget filepath
$reflectionClass = new ReflectionClass($this);
$widgetPath = dirname($reflectionClass->getFileName());
... | php | public function getViewPath()
{
// Cache mechanism
if (self::$_viewPath) {
return self::$_viewPath;
}
// Called widget filepath
$reflectionClass = new ReflectionClass($this);
$widgetPath = dirname($reflectionClass->getFileName());
... | [
"public",
"function",
"getViewPath",
"(",
")",
"{",
"// Cache mechanism\r",
"if",
"(",
"self",
"::",
"$",
"_viewPath",
")",
"{",
"return",
"self",
"::",
"$",
"_viewPath",
";",
"}",
"// Called widget filepath\r",
"$",
"reflectionClass",
"=",
"new",
"ReflectionCla... | Returns the directory containing the view files for this widget.
The default implementation returns the 'views' subdirectory under the directory containing the widget class file.
@return string the directory containing the view files for this widget. | [
"Returns",
"the",
"directory",
"containing",
"the",
"view",
"files",
"for",
"this",
"widget",
".",
"The",
"default",
"implementation",
"returns",
"the",
"views",
"subdirectory",
"under",
"the",
"directory",
"containing",
"the",
"widget",
"class",
"file",
"."
] | c13dcb9cf726c5b88564a3f46baf2ca7e46a5042 | https://github.com/yidas/codeigniter-widget/blob/c13dcb9cf726c5b88564a3f46baf2ca7e46a5042/src/Widget.php#L74-L89 |
191,018 | yidas/codeigniter-widget | src/Widget.php | Widget.render | protected function render($viewFile, $variables=[])
{
$viewFile = (strpos($viewFile, '/', 0)===false) ? $this->getViewPath() . $viewFile : $viewFile;
$this->CI->load->view($viewFile, $variables);
} | php | protected function render($viewFile, $variables=[])
{
$viewFile = (strpos($viewFile, '/', 0)===false) ? $this->getViewPath() . $viewFile : $viewFile;
$this->CI->load->view($viewFile, $variables);
} | [
"protected",
"function",
"render",
"(",
"$",
"viewFile",
",",
"$",
"variables",
"=",
"[",
"]",
")",
"{",
"$",
"viewFile",
"=",
"(",
"strpos",
"(",
"$",
"viewFile",
",",
"'/'",
",",
"0",
")",
"===",
"false",
")",
"?",
"$",
"this",
"->",
"getViewPath... | Render a view of Widget
@param string View file path, relative for widget's view, absolute for CI view
@param array View variables | [
"Render",
"a",
"view",
"of",
"Widget"
] | c13dcb9cf726c5b88564a3f46baf2ca7e46a5042 | https://github.com/yidas/codeigniter-widget/blob/c13dcb9cf726c5b88564a3f46baf2ca7e46a5042/src/Widget.php#L97-L102 |
191,019 | Web-Feet/coasterframework | src/Libraries/Blocks/Datetime.php | Datetime.filter | public function filter($content, $search, $type)
{
$search = is_array($search) ? $search : [$search];
$search = array_map(function($searchValue) {return is_a($searchValue, Carbon::class) ? $searchValue : new Carbon($searchValue);}, $search);
$current = (new Carbon($content));
sw... | php | public function filter($content, $search, $type)
{
$search = is_array($search) ? $search : [$search];
$search = array_map(function($searchValue) {return is_a($searchValue, Carbon::class) ? $searchValue : new Carbon($searchValue);}, $search);
$current = (new Carbon($content));
sw... | [
"public",
"function",
"filter",
"(",
"$",
"content",
",",
"$",
"search",
",",
"$",
"type",
")",
"{",
"$",
"search",
"=",
"is_array",
"(",
"$",
"search",
")",
"?",
"$",
"search",
":",
"[",
"$",
"search",
"]",
";",
"$",
"search",
"=",
"array_map",
... | Datetime exact match check as well as between check
@param string $content
@param string $search
@param string $type
@return bool | [
"Datetime",
"exact",
"match",
"check",
"as",
"well",
"as",
"between",
"check"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Datetime.php#L63-L75 |
191,020 | Web-Feet/coasterframework | src/Libraries/Blocks/Form.php | Form.display | public function display($content, $options = [])
{
$formData = $this->_defaultData($content);
$view = !empty($options['view']) ? $options['view'] : $formData->template;
return FormWrap::view($this->_block, $options, $this->displayView($view), ['form_data' => $formData]);
} | php | public function display($content, $options = [])
{
$formData = $this->_defaultData($content);
$view = !empty($options['view']) ? $options['view'] : $formData->template;
return FormWrap::view($this->_block, $options, $this->displayView($view), ['form_data' => $formData]);
} | [
"public",
"function",
"display",
"(",
"$",
"content",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"formData",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$",
"content",
")",
";",
"$",
"view",
"=",
"!",
"empty",
"(",
"$",
"options",
"[",
... | Display form view
@param string $content
@param array $options
@return string | [
"Display",
"form",
"view"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Form.php#L41-L46 |
191,021 | Web-Feet/coasterframework | src/Libraries/Blocks/Form.php | Form.submissionSaveData | public function submissionSaveData(array $formData)
{
// remove empty values
$formData = array_filter($formData);
// get array of files to upload
$files = [];
foreach ($formData as $field => $value) {
if (Request::hasFile($field)) {
$file... | php | public function submissionSaveData(array $formData)
{
// remove empty values
$formData = array_filter($formData);
// get array of files to upload
$files = [];
foreach ($formData as $field => $value) {
if (Request::hasFile($field)) {
$file... | [
"public",
"function",
"submissionSaveData",
"(",
"array",
"$",
"formData",
")",
"{",
"// remove empty values\r",
"$",
"formData",
"=",
"array_filter",
"(",
"$",
"formData",
")",
";",
"// get array of files to upload\r",
"$",
"files",
"=",
"[",
"]",
";",
"foreach",... | Save form data
@param array $formData
@return FormSubmission | [
"Save",
"form",
"data"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Form.php#L53-L76 |
191,022 | Web-Feet/coasterframework | src/Libraries/Blocks/Form.php | Form.submissionSendEmail | public function submissionSendEmail(array $formData, \stdClass $form_settings)
{
$subject = config('coaster::site.name') . ': New Form Submission - ' . $this->_block->label;
return Email::sendFromFormData([$form_settings->template, $this->_block->name], $formData, $subject, $form_settings->email_... | php | public function submissionSendEmail(array $formData, \stdClass $form_settings)
{
$subject = config('coaster::site.name') . ': New Form Submission - ' . $this->_block->label;
return Email::sendFromFormData([$form_settings->template, $this->_block->name], $formData, $subject, $form_settings->email_... | [
"public",
"function",
"submissionSendEmail",
"(",
"array",
"$",
"formData",
",",
"\\",
"stdClass",
"$",
"form_settings",
")",
"{",
"$",
"subject",
"=",
"config",
"(",
"'coaster::site.name'",
")",
".",
"': New Form Submission - '",
".",
"$",
"this",
"->",
"_block... | Send the form data by email
@param array $formData
@param \stdClass $form_settings
@return boolean | [
"Send",
"the",
"form",
"data",
"by",
"email"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Form.php#L84-L88 |
191,023 | Web-Feet/coasterframework | src/Libraries/Blocks/Form.php | Form.submission | public function submission($formData)
{
if ($form_settings = $this->_block->getContent(true)) {
$form_settings = $this->_defaultData($form_settings);
$form_rules = BlockFormRule::get_rules($form_settings->template ?: $this->_block->name);
$v = Validator::make($formDa... | php | public function submission($formData)
{
if ($form_settings = $this->_block->getContent(true)) {
$form_settings = $this->_defaultData($form_settings);
$form_rules = BlockFormRule::get_rules($form_settings->template ?: $this->_block->name);
$v = Validator::make($formDa... | [
"public",
"function",
"submission",
"(",
"$",
"formData",
")",
"{",
"if",
"(",
"$",
"form_settings",
"=",
"$",
"this",
"->",
"_block",
"->",
"getContent",
"(",
"true",
")",
")",
"{",
"$",
"form_settings",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$... | Save form data and send email
@param array $formData
@return bool|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector | [
"Save",
"form",
"data",
"and",
"send",
"email"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Form.php#L95-L134 |
191,024 | xsanisty/SlimStarter | src/SlimStarter/Facade/RouteFacade.php | RouteFacade.resource | public static function resource(){
$arguments = func_get_args();
$path = $arguments[0];
$controller = end($arguments);
$resourceRoutes = array(
'get' => array(
'pattern' => "$path",
'method' => 'get',
... | php | public static function resource(){
$arguments = func_get_args();
$path = $arguments[0];
$controller = end($arguments);
$resourceRoutes = array(
'get' => array(
'pattern' => "$path",
'method' => 'get',
... | [
"public",
"static",
"function",
"resource",
"(",
")",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"$",
"path",
"=",
"$",
"arguments",
"[",
"0",
"]",
";",
"$",
"controller",
"=",
"end",
"(",
"$",
"arguments",
")",
";",
"$",
"resourceRo... | Route resource to single controller | [
"Route",
"resource",
"to",
"single",
"controller"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Facade/RouteFacade.php#L10-L71 |
191,025 | xsanisty/SlimStarter | src/SlimStarter/Facade/RouteFacade.php | RouteFacade.controller | public static function controller(){
$arguments = func_get_args();
$path = $arguments[0];
$controller = end($arguments);
$class = new \ReflectionClass($controller);
$controllerMethods = $class->getMethods(\ReflectionMethod::IS_PUBLIC);
$uppercase = 'ABCDEF... | php | public static function controller(){
$arguments = func_get_args();
$path = $arguments[0];
$controller = end($arguments);
$class = new \ReflectionClass($controller);
$controllerMethods = $class->getMethods(\ReflectionMethod::IS_PUBLIC);
$uppercase = 'ABCDEF... | [
"public",
"static",
"function",
"controller",
"(",
")",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"$",
"path",
"=",
"$",
"arguments",
"[",
"0",
"]",
";",
"$",
"controller",
"=",
"end",
"(",
"$",
"arguments",
")",
";",
"$",
"class",
... | Map route to all public controller method
with
Route::get('/prefix', 'ClassController')
this will map
GET domain.com/prefix -> ClassController::getIndex
POST domain.com/prefix -> ClassCOntroller::postIndex
PUT domain.com/prefix -> ClassCOntroller::putIndex | [
"Map",
"route",
"to",
"all",
"public",
"controller",
"method"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Facade/RouteFacade.php#L84-L123 |
191,026 | xsanisty/SlimStarter | app/controllers/InstallController.php | InstallController.index | public function index()
{
$this->loadJs('app/install.js');
$this->publish('baseUrl', $this->data['baseUrl']);
App::render('install/configure_db.twig', $this->data);
} | php | public function index()
{
$this->loadJs('app/install.js');
$this->publish('baseUrl', $this->data['baseUrl']);
App::render('install/configure_db.twig', $this->data);
} | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"loadJs",
"(",
"'app/install.js'",
")",
";",
"$",
"this",
"->",
"publish",
"(",
"'baseUrl'",
",",
"$",
"this",
"->",
"data",
"[",
"'baseUrl'",
"]",
")",
";",
"App",
"::",
"render",
"(",... | display database configuration form | [
"display",
"database",
"configuration",
"form"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/app/controllers/InstallController.php#L10-L15 |
191,027 | xsanisty/SlimStarter | app/controllers/InstallController.php | InstallController.checkConnection | public function checkConnection()
{
$success = false;
$message = '';
$config = $this->getPostConfiguration();
try{
$this->makeConnection($config);
/**
* Just trying to show tables with current connection
*/
switch ($con... | php | public function checkConnection()
{
$success = false;
$message = '';
$config = $this->getPostConfiguration();
try{
$this->makeConnection($config);
/**
* Just trying to show tables with current connection
*/
switch ($con... | [
"public",
"function",
"checkConnection",
"(",
")",
"{",
"$",
"success",
"=",
"false",
";",
"$",
"message",
"=",
"''",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"getPostConfiguration",
"(",
")",
";",
"try",
"{",
"$",
"this",
"->",
"makeConnection",
"(... | check database connection based on provided setting | [
"check",
"database",
"connection",
"based",
"on",
"provided",
"setting"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/app/controllers/InstallController.php#L28-L75 |
191,028 | xsanisty/SlimStarter | app/controllers/InstallController.php | InstallController.writeConfiguration | public function writeConfiguration()
{
$configFile= APP_PATH.'config/database.php';
$config = $this->getPostConfiguration();
$configStr = <<<CONFIG
<?php
\$config['database'] = array(
'default' => '{$config['driver']}',
'connections' => array(
'{$config['driver'... | php | public function writeConfiguration()
{
$configFile= APP_PATH.'config/database.php';
$config = $this->getPostConfiguration();
$configStr = <<<CONFIG
<?php
\$config['database'] = array(
'default' => '{$config['driver']}',
'connections' => array(
'{$config['driver'... | [
"public",
"function",
"writeConfiguration",
"(",
")",
"{",
"$",
"configFile",
"=",
"APP_PATH",
".",
"'config/database.php'",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"getPostConfiguration",
"(",
")",
";",
"$",
"configStr",
"=",
" <<<CONFIG\n<?php\n\n\\$config['... | write configuration to database configuration | [
"write",
"configuration",
"to",
"database",
"configuration"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/app/controllers/InstallController.php#L80-L113 |
191,029 | xsanisty/SlimStarter | app/controllers/InstallController.php | InstallController.getPostConfiguration | private function getPostConfiguration()
{
$driver = Input::post('dbdriver');
$database = Input::post('dbname');
/**
* point to APP_PATH/storage/db if driver is sqlite
*/
if($driver == 'sqlite'){
$database = APP_PATH.'storage/db/'.$database.'.sqlit... | php | private function getPostConfiguration()
{
$driver = Input::post('dbdriver');
$database = Input::post('dbname');
/**
* point to APP_PATH/storage/db if driver is sqlite
*/
if($driver == 'sqlite'){
$database = APP_PATH.'storage/db/'.$database.'.sqlit... | [
"private",
"function",
"getPostConfiguration",
"(",
")",
"{",
"$",
"driver",
"=",
"Input",
"::",
"post",
"(",
"'dbdriver'",
")",
";",
"$",
"database",
"=",
"Input",
"::",
"post",
"(",
"'dbname'",
")",
";",
"/**\n * point to APP_PATH/storage/db if driver is... | Get configuration value posted by user | [
"Get",
"configuration",
"value",
"posted",
"by",
"user"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/app/controllers/InstallController.php#L118-L140 |
191,030 | TimeIncOSS/swagger-bundle | src/Swagger.php | Swagger.build | public function build($alternativeHost = null)
{
// Crawl directory and parse all files
$finder = Util::finder($this->directories, []);
foreach ($finder as $file) {
$this->analysis->addAnalysis($this->analyser->fromFile($file->getPathname()));
}
// Set alternativ... | php | public function build($alternativeHost = null)
{
// Crawl directory and parse all files
$finder = Util::finder($this->directories, []);
foreach ($finder as $file) {
$this->analysis->addAnalysis($this->analyser->fromFile($file->getPathname()));
}
// Set alternativ... | [
"public",
"function",
"build",
"(",
"$",
"alternativeHost",
"=",
"null",
")",
"{",
"// Crawl directory and parse all files",
"$",
"finder",
"=",
"Util",
"::",
"finder",
"(",
"$",
"this",
"->",
"directories",
",",
"[",
"]",
")",
";",
"foreach",
"(",
"$",
"f... | Search for annotations, process and validate definitions.
@param null|string $alternativeHost
@return $this | [
"Search",
"for",
"annotations",
"process",
"and",
"validate",
"definitions",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger.php#L60-L78 |
191,031 | TimeIncOSS/swagger-bundle | src/Swagger.php | Swagger.json | public function json($alternativeHost = null, $pretty = false)
{
$this->build($alternativeHost);
$jsonOptions = JSON_UNESCAPED_SLASHES;
if ($pretty) {
$jsonOptions |= JSON_PRETTY_PRINT;
}
return json_encode($this->analysis->swagger, $jsonOptions);
} | php | public function json($alternativeHost = null, $pretty = false)
{
$this->build($alternativeHost);
$jsonOptions = JSON_UNESCAPED_SLASHES;
if ($pretty) {
$jsonOptions |= JSON_PRETTY_PRINT;
}
return json_encode($this->analysis->swagger, $jsonOptions);
} | [
"public",
"function",
"json",
"(",
"$",
"alternativeHost",
"=",
"null",
",",
"$",
"pretty",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"build",
"(",
"$",
"alternativeHost",
")",
";",
"$",
"jsonOptions",
"=",
"JSON_UNESCAPED_SLASHES",
";",
"if",
"(",
"$",... | Build and return OpenAPI json.
@param null|string $alternativeHost
@param bool $pretty
@return \Swagger\Annotations\Swagger | [
"Build",
"and",
"return",
"OpenAPI",
"json",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger.php#L88-L99 |
191,032 | TimeIncOSS/swagger-bundle | src/Swagger.php | Swagger.save | public function save($filename, $alternativeHost = null)
{
$this->build($alternativeHost);
$this->analysis->swagger->saveAs($filename);
} | php | public function save($filename, $alternativeHost = null)
{
$this->build($alternativeHost);
$this->analysis->swagger->saveAs($filename);
} | [
"public",
"function",
"save",
"(",
"$",
"filename",
",",
"$",
"alternativeHost",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"build",
"(",
"$",
"alternativeHost",
")",
";",
"$",
"this",
"->",
"analysis",
"->",
"swagger",
"->",
"saveAs",
"(",
"$",
"filena... | Build and save OpenAPI json to file.
@param string $filename
@param null|string $alternativeHost | [
"Build",
"and",
"save",
"OpenAPI",
"json",
"to",
"file",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger.php#L107-L112 |
191,033 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver.php | Driver.move_to | public function move_to($id = NULL, $x = NULL, $y = NULL)
{
throw new Exception_Notimplemented(__FUNCTION__, $this);
} | php | public function move_to($id = NULL, $x = NULL, $y = NULL)
{
throw new Exception_Notimplemented(__FUNCTION__, $this);
} | [
"public",
"function",
"move_to",
"(",
"$",
"id",
"=",
"NULL",
",",
"$",
"x",
"=",
"NULL",
",",
"$",
"y",
"=",
"NULL",
")",
"{",
"throw",
"new",
"Exception_Notimplemented",
"(",
"__FUNCTION__",
",",
"$",
"this",
")",
";",
"}"
] | Move the mouse to a certain element | [
"Move",
"the",
"mouse",
"to",
"a",
"certain",
"element"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver.php#L256-L259 |
191,034 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver.php | Driver.extract_query_from_uri | public static function extract_query_from_uri($uri)
{
$uri_query_str = parse_url($uri, PHP_URL_QUERY);
if ( ! $uri_query_str)
{
return array();
}
parse_str($uri_query_str, $uri_query);
return $uri_query;
} | php | public static function extract_query_from_uri($uri)
{
$uri_query_str = parse_url($uri, PHP_URL_QUERY);
if ( ! $uri_query_str)
{
return array();
}
parse_str($uri_query_str, $uri_query);
return $uri_query;
} | [
"public",
"static",
"function",
"extract_query_from_uri",
"(",
"$",
"uri",
")",
"{",
"$",
"uri_query_str",
"=",
"parse_url",
"(",
"$",
"uri",
",",
"PHP_URL_QUERY",
")",
";",
"if",
"(",
"!",
"$",
"uri_query_str",
")",
"{",
"return",
"array",
"(",
")",
";"... | Extract implicit query from URI
@return array | [
"Extract",
"implicit",
"query",
"from",
"URI"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver.php#L334-L346 |
191,035 | Web-Feet/coasterframework | src/Libraries/Import/Blocks/FormRulesImport.php | FormRulesImport._afterRun | protected function _afterRun()
{
foreach ($this->_formTemplateRulesToDelete as $template => $fields) {
BlockFormRule::where('form_template', '=', $template)->whereIn('field', array_keys($fields))->delete();
}
} | php | protected function _afterRun()
{
foreach ($this->_formTemplateRulesToDelete as $template => $fields) {
BlockFormRule::where('form_template', '=', $template)->whereIn('field', array_keys($fields))->delete();
}
} | [
"protected",
"function",
"_afterRun",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_formTemplateRulesToDelete",
"as",
"$",
"template",
"=>",
"$",
"fields",
")",
"{",
"BlockFormRule",
"::",
"where",
"(",
"'form_template'",
",",
"'='",
",",
"$",
"templat... | When adding form rules clear all previous rules for any conflicting form_templates | [
"When",
"adding",
"form",
"rules",
"clear",
"all",
"previous",
"rules",
"for",
"any",
"conflicting",
"form_templates"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Import/Blocks/FormRulesImport.php#L108-L113 |
191,036 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver/Simple/RequestFactory/HTTP.php | Driver_Simple_RequestFactory_HTTP.execute | public function execute($method, $url, array $post = array())
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent());
if (... | php | public function execute($method, $url, array $post = array())
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent());
if (... | [
"public",
"function",
"execute",
"(",
"$",
"method",
",",
"$",
"url",
",",
"array",
"$",
"post",
"=",
"array",
"(",
")",
")",
"{",
"$",
"curl",
"=",
"curl_init",
"(",
"$",
"url",
")",
";",
"curl_setopt",
"(",
"$",
"curl",
",",
"CURLOPT_FOLLOWLOCATION... | Perform the request, follow redirects, return the response
@param string $method
@param string $url
@param array $post
@return string | [
"Perform",
"the",
"request",
"follow",
"redirects",
"return",
"the",
"response"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver/Simple/RequestFactory/HTTP.php#L69-L93 |
191,037 | xsanisty/SlimStarter | src/SlimStarter/Bootstrap.php | Bootstrap.setConfig | public function setConfig($config){
$this->config = $config;
foreach ($config as $key => $value) {
$this->app->config($key, $value);
}
} | php | public function setConfig($config){
$this->config = $config;
foreach ($config as $key => $value) {
$this->app->config($key, $value);
}
} | [
"public",
"function",
"setConfig",
"(",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"$",
"config",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"config",
"(",
"... | Setup SlimStarter configuration and inject it to Slim instance
@param array $config | [
"Setup",
"SlimStarter",
"configuration",
"and",
"inject",
"it",
"to",
"Slim",
"instance"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Bootstrap.php#L39-L44 |
191,038 | xsanisty/SlimStarter | src/SlimStarter/Bootstrap.php | Bootstrap.bootEloquent | public function bootEloquent($config){
try{
$this->app->container->singleton('db',function(){
return new DatabaseManager;
});
$this->app->db->addConnection($config['connections'][$config['default']]);
$this->app->db->setAsGlobal();
$th... | php | public function bootEloquent($config){
try{
$this->app->container->singleton('db',function(){
return new DatabaseManager;
});
$this->app->db->addConnection($config['connections'][$config['default']]);
$this->app->db->setAsGlobal();
$th... | [
"public",
"function",
"bootEloquent",
"(",
"$",
"config",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"app",
"->",
"container",
"->",
"singleton",
"(",
"'db'",
",",
"function",
"(",
")",
"{",
"return",
"new",
"DatabaseManager",
";",
"}",
")",
";",
"$",
... | Boot up Eloquent ORM and inject to Slim container
@param Array $config | [
"Boot",
"up",
"Eloquent",
"ORM",
"and",
"inject",
"to",
"Slim",
"container"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Bootstrap.php#L67-L79 |
191,039 | xsanisty/SlimStarter | src/SlimStarter/Bootstrap.php | Bootstrap.bootModuleManager | public function bootModuleManager(){
$app = $this->app;
$this->app->container->singleton('module', function() use ($app){
return new ModuleManager($app);
});
} | php | public function bootModuleManager(){
$app = $this->app;
$this->app->container->singleton('module', function() use ($app){
return new ModuleManager($app);
});
} | [
"public",
"function",
"bootModuleManager",
"(",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"$",
"this",
"->",
"app",
"->",
"container",
"->",
"singleton",
"(",
"'module'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"app",
")",
"{",
... | Boot up module manager and inject to Slim container
@return [type] [description] | [
"Boot",
"up",
"module",
"manager",
"and",
"inject",
"to",
"Slim",
"container"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Bootstrap.php#L85-L90 |
191,040 | xsanisty/SlimStarter | src/SlimStarter/Bootstrap.php | Bootstrap.bootSentry | public function bootSentry($config){
$app = $this->app;
$this->app->container->singleton('sentry', function() use ($app, $config){
$hasherProvider = $this->hasherProviderFactory($config);
$userProvider = $this->userProviderFactory($hasherProvider, $config);
... | php | public function bootSentry($config){
$app = $this->app;
$this->app->container->singleton('sentry', function() use ($app, $config){
$hasherProvider = $this->hasherProviderFactory($config);
$userProvider = $this->userProviderFactory($hasherProvider, $config);
... | [
"public",
"function",
"bootSentry",
"(",
"$",
"config",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"$",
"this",
"->",
"app",
"->",
"container",
"->",
"singleton",
"(",
"'sentry'",
",",
"function",
"(",
")",
"use",
"(",
"$",
"app",
",... | Boot up Sentry authorization provider
@param Array $config | [
"Boot",
"up",
"Sentry",
"authorization",
"provider"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Bootstrap.php#L96-L114 |
191,041 | xsanisty/SlimStarter | src/SlimStarter/Bootstrap.php | Bootstrap.hasherProviderFactory | protected function hasherProviderFactory($config){
$hasher = $config['hasher'];
switch ($hasher)
{
case 'native':
return new NativeHasher;
break;
case 'bcrypt':
return new BcryptHasher;
break;
... | php | protected function hasherProviderFactory($config){
$hasher = $config['hasher'];
switch ($hasher)
{
case 'native':
return new NativeHasher;
break;
case 'bcrypt':
return new BcryptHasher;
break;
... | [
"protected",
"function",
"hasherProviderFactory",
"(",
"$",
"config",
")",
"{",
"$",
"hasher",
"=",
"$",
"config",
"[",
"'hasher'",
"]",
";",
"switch",
"(",
"$",
"hasher",
")",
"{",
"case",
"'native'",
":",
"return",
"new",
"NativeHasher",
";",
"break",
... | Sentry specific factory, adopted from SentryServiceProvider | [
"Sentry",
"specific",
"factory",
"adopted",
"from",
"SentryServiceProvider"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Bootstrap.php#L117-L139 |
191,042 | xsanisty/SlimStarter | src/SlimStarter/Bootstrap.php | Bootstrap.bootTwig | public function bootTwig($config){
$app = $this->app;
$view = $app->view;
$view->parserOptions = $config;
$view->parserExtensions = array(
new \Slim\Views\TwigExtension(),
new \SlimStarter\TwigExtension\MenuRenderer()
);
} | php | public function bootTwig($config){
$app = $this->app;
$view = $app->view;
$view->parserOptions = $config;
$view->parserExtensions = array(
new \Slim\Views\TwigExtension(),
new \SlimStarter\TwigExtension\MenuRenderer()
);
} | [
"public",
"function",
"bootTwig",
"(",
"$",
"config",
")",
"{",
"$",
"app",
"=",
"$",
"this",
"->",
"app",
";",
"$",
"view",
"=",
"$",
"app",
"->",
"view",
";",
"$",
"view",
"->",
"parserOptions",
"=",
"$",
"config",
";",
"$",
"view",
"->",
"pars... | Boot up Twig template engine
@param Array $config | [
"Boot",
"up",
"Twig",
"template",
"engine"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Bootstrap.php#L254-L263 |
191,043 | xsanisty/SlimStarter | src/SlimStarter/Bootstrap.php | Bootstrap.boot | public function boot(){
$this->bootFacade($this->config['aliases']);
$this->bootMenuManager();
$this->bootEloquent($this->config['database']);
$this->bootModuleManager();
$this->bootTwig($this->config['twig']);
$this->bootSentry($this->config['sentry']);
} | php | public function boot(){
$this->bootFacade($this->config['aliases']);
$this->bootMenuManager();
$this->bootEloquent($this->config['database']);
$this->bootModuleManager();
$this->bootTwig($this->config['twig']);
$this->bootSentry($this->config['sentry']);
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"$",
"this",
"->",
"bootFacade",
"(",
"$",
"this",
"->",
"config",
"[",
"'aliases'",
"]",
")",
";",
"$",
"this",
"->",
"bootMenuManager",
"(",
")",
";",
"$",
"this",
"->",
"bootEloquent",
"(",
"$",
"this",... | Run the boot sequence
@return [type] [description] | [
"Run",
"the",
"boot",
"sequence"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Bootstrap.php#L278-L285 |
191,044 | Web-Feet/coasterframework | src/Libraries/Blocks/Stringwcolour.php | Stringwcolour._defaultData | protected function _defaultData($content)
{
$content = @unserialize($content);
if (empty($content) || !is_a($content, \stdClass::class)) {
$content = new \stdClass;
}
$content->text = isset($content->text) ? $content->text : '';
$content->colour = isset($co... | php | protected function _defaultData($content)
{
$content = @unserialize($content);
if (empty($content) || !is_a($content, \stdClass::class)) {
$content = new \stdClass;
}
$content->text = isset($content->text) ? $content->text : '';
$content->colour = isset($co... | [
"protected",
"function",
"_defaultData",
"(",
"$",
"content",
")",
"{",
"$",
"content",
"=",
"@",
"unserialize",
"(",
"$",
"content",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"content",
")",
"||",
"!",
"is_a",
"(",
"$",
"content",
",",
"\\",
"stdClass... | Return valid stringwcolour data
@param $content
@return \stdClass | [
"Return",
"valid",
"stringwcolour",
"data"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Stringwcolour.php#L60-L69 |
191,045 | Web-Feet/coasterframework | src/Libraries/Blocks/Stringwcolour.php | Stringwcolour.generateSearchText | public function generateSearchText($content)
{
$content = $this->_defaultData($content);
$searchText = $this->_generateSearchText($content->text, $content->colour);
return parent::generateSearchText($searchText);
} | php | public function generateSearchText($content)
{
$content = $this->_defaultData($content);
$searchText = $this->_generateSearchText($content->text, $content->colour);
return parent::generateSearchText($searchText);
} | [
"public",
"function",
"generateSearchText",
"(",
"$",
"content",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$",
"content",
")",
";",
"$",
"searchText",
"=",
"$",
"this",
"->",
"_generateSearchText",
"(",
"$",
"content",
"->",
... | Add text and colour data to search
@param null|string $content
@return null|string | [
"Add",
"text",
"and",
"colour",
"data",
"to",
"search"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Stringwcolour.php#L76-L81 |
191,046 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Nodelist.php | Nodelist.seek | public function seek($offset)
{
if ($this->offsetExists($offset))
{
$this->_current = $offset;
return TRUE;
}
return FALSE;
} | php | public function seek($offset)
{
if ($this->offsetExists($offset))
{
$this->_current = $offset;
return TRUE;
}
return FALSE;
} | [
"public",
"function",
"seek",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"offset",
")",
")",
"{",
"$",
"this",
"->",
"_current",
"=",
"$",
"offset",
";",
"return",
"TRUE",
";",
"}",
"return",
"FALSE",
";",... | Implementation of SeekableIterator
@param mixed $offset
@return boolean | [
"Implementation",
"of",
"SeekableIterator"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Nodelist.php#L134-L142 |
191,047 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Network.php | Network.is_port_open | public static function is_port_open($host, $port)
{
$connection = @fsockopen($host, $port);
if (is_resource($connection))
{
fclose($connection);
return FALSE;
}
return TRUE;
} | php | public static function is_port_open($host, $port)
{
$connection = @fsockopen($host, $port);
if (is_resource($connection))
{
fclose($connection);
return FALSE;
}
return TRUE;
} | [
"public",
"static",
"function",
"is_port_open",
"(",
"$",
"host",
",",
"$",
"port",
")",
"{",
"$",
"connection",
"=",
"@",
"fsockopen",
"(",
"$",
"host",
",",
"$",
"port",
")",
";",
"if",
"(",
"is_resource",
"(",
"$",
"connection",
")",
")",
"{",
"... | Check if a port is open
@param string $host
@param integer $port
@return boolean | [
"Check",
"if",
"a",
"port",
"is",
"open"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Network.php#L21-L30 |
191,048 | Web-Feet/coasterframework | src/Libraries/Blocks/Link.php | Link.edit | public function edit($content)
{
$content = $this->_defaultData($content);
$link = str_replace('internal://', '', $content['link'], $count);
$content['link'] = ($count > 0) ? '' : $content['link'];
$this->_editViewData['targetOptions'] = [0 => 'Target: Same Tab', '_blank' => 'Ta... | php | public function edit($content)
{
$content = $this->_defaultData($content);
$link = str_replace('internal://', '', $content['link'], $count);
$content['link'] = ($count > 0) ? '' : $content['link'];
$this->_editViewData['targetOptions'] = [0 => 'Target: Same Tab', '_blank' => 'Ta... | [
"public",
"function",
"edit",
"(",
"$",
"content",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"_defaultData",
"(",
"$",
"content",
")",
";",
"$",
"link",
"=",
"str_replace",
"(",
"'internal://'",
",",
"''",
",",
"$",
"content",
"[",
"'link'",
... | Edit link settings
@param string $content
@return string | [
"Edit",
"link",
"settings"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Link.php#L29-L38 |
191,049 | Web-Feet/coasterframework | src/Libraries/Blocks/Link.php | Link.submit | public function submit($postContent)
{
$linkData = [];
if (!empty($postContent['internal'])) {
$linkData['link'] = 'internal://' . $postContent['internal'];
} elseif (!empty($postContent['custom'])) {
$linkData['link'] = $postContent['custom'];
} else {... | php | public function submit($postContent)
{
$linkData = [];
if (!empty($postContent['internal'])) {
$linkData['link'] = 'internal://' . $postContent['internal'];
} elseif (!empty($postContent['custom'])) {
$linkData['link'] = $postContent['custom'];
} else {... | [
"public",
"function",
"submit",
"(",
"$",
"postContent",
")",
"{",
"$",
"linkData",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"postContent",
"[",
"'internal'",
"]",
")",
")",
"{",
"$",
"linkData",
"[",
"'link'",
"]",
"=",
"'internal://'"... | Update link settings
@param array $postContent
@return static | [
"Update",
"link",
"settings"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Link.php#L45-L57 |
191,050 | Web-Feet/coasterframework | src/Libraries/Beacons/EstimoteBeacon.php | EstimoteBeacon.normaliseDevices | public function normaliseDevices($pending = false)
{
try {
$this->originalDevices = json_decode($this->getClient()->request('GET', 'devices')->getBody());
} catch (\Exception $e) {
dd($e->getMessage());
}
$this->devices = [];
$this->pendingDevices= []... | php | public function normaliseDevices($pending = false)
{
try {
$this->originalDevices = json_decode($this->getClient()->request('GET', 'devices')->getBody());
} catch (\Exception $e) {
dd($e->getMessage());
}
$this->devices = [];
$this->pendingDevices= []... | [
"public",
"function",
"normaliseDevices",
"(",
"$",
"pending",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"originalDevices",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"request",
"(",
"'GET'",
",",
"'devices'",
"... | Normalise Estimote return array to match up to expected for BlockBeacon
@param boolean $pending
@return array | [
"Normalise",
"Estimote",
"return",
"array",
"to",
"match",
"up",
"to",
"expected",
"for",
"BlockBeacon"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Beacons/EstimoteBeacon.php#L84-L118 |
191,051 | dbojdo/gls-ade | src/Api/Exception/ExceptionFactory.php | ExceptionFactory.createException | public function createException(\Exception $e, $soapFunction, $input)
{
if (! ($e instanceof ExecutorException)) {
return $e;
}
$e = $e->getPrevious();
if ($e instanceof \SoapFault) {
switch ($e->faultcode) {
default:
throw... | php | public function createException(\Exception $e, $soapFunction, $input)
{
if (! ($e instanceof ExecutorException)) {
return $e;
}
$e = $e->getPrevious();
if ($e instanceof \SoapFault) {
switch ($e->faultcode) {
default:
throw... | [
"public",
"function",
"createException",
"(",
"\\",
"Exception",
"$",
"e",
",",
"$",
"soapFunction",
",",
"$",
"input",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"e",
"instanceof",
"ExecutorException",
")",
")",
"{",
"return",
"$",
"e",
";",
"}",
"$",
"e",... | Wraps exception to API's type
@param \Exception $e
@param string $soapFunction
@param $input
@return \Exception | [
"Wraps",
"exception",
"to",
"API",
"s",
"type"
] | 8ff750151a87b8a59c5a36e9d28e7d59733ea80f | https://github.com/dbojdo/gls-ade/blob/8ff750151a87b8a59c5a36e9d28e7d59733ea80f/src/Api/Exception/ExceptionFactory.php#L21-L36 |
191,052 | Web-Feet/coasterframework | src/Libraries/Builder/PageBuilder/DefaultInstance.php | DefaultInstance.parentPageId | public function parentPageId($noOverride = false)
{
if ($this->pageOverride && !$noOverride) {
return $this->pageOverride->parent;
} else {
return ($parentIndex = (count($this->pageLevels) - 2)) >= 0 ? $this->pageLevels[$parentIndex]->id : 0;
}
} | php | public function parentPageId($noOverride = false)
{
if ($this->pageOverride && !$noOverride) {
return $this->pageOverride->parent;
} else {
return ($parentIndex = (count($this->pageLevels) - 2)) >= 0 ? $this->pageLevels[$parentIndex]->id : 0;
}
} | [
"public",
"function",
"parentPageId",
"(",
"$",
"noOverride",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pageOverride",
"&&",
"!",
"$",
"noOverride",
")",
"{",
"return",
"$",
"this",
"->",
"pageOverride",
"->",
"parent",
";",
"}",
"else",
"... | Get parent page id based on the page levels loaded from url
@param bool $noOverride
@return int | [
"Get",
"parent",
"page",
"id",
"based",
"on",
"the",
"page",
"levels",
"loaded",
"from",
"url"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Builder/PageBuilder/DefaultInstance.php#L233-L240 |
191,053 | Web-Feet/coasterframework | src/Libraries/Blocks/Video.php | Video.display | public function display($content, $options = [])
{
if (!empty($content)) {
$videoInfo = $this->_cache($content);
if (!($videoInfo || empty($options['alwaysRender']))) {
return 'Video does not exist, it may have been removed from youtube';
}
... | php | public function display($content, $options = [])
{
if (!empty($content)) {
$videoInfo = $this->_cache($content);
if (!($videoInfo || empty($options['alwaysRender']))) {
return 'Video does not exist, it may have been removed from youtube';
}
... | [
"public",
"function",
"display",
"(",
"$",
"content",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"content",
")",
")",
"{",
"$",
"videoInfo",
"=",
"$",
"this",
"->",
"_cache",
"(",
"$",
"content",
")",
";",
... | Display video using info from youtube API
@param string $content
@param array $options
@return string | [
"Display",
"video",
"using",
"info",
"from",
"youtube",
"API"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Video.php#L36-L47 |
191,054 | Web-Feet/coasterframework | src/Libraries/Blocks/Video.php | Video.submit | public function submit($postContent)
{
if (is_array($postContent) && array_key_exists('select', $postContent)) {
$this->_cache($postContent['select'], true);
}
return parent::submit($postContent);
} | php | public function submit($postContent)
{
if (is_array($postContent) && array_key_exists('select', $postContent)) {
$this->_cache($postContent['select'], true);
}
return parent::submit($postContent);
} | [
"public",
"function",
"submit",
"(",
"$",
"postContent",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"postContent",
")",
"&&",
"array_key_exists",
"(",
"'select'",
",",
"$",
"postContent",
")",
")",
"{",
"$",
"this",
"->",
"_cache",
"(",
"$",
"postContent... | Save video with and youtube video API data to cache
@param array $postContent
@return static | [
"Save",
"video",
"with",
"and",
"youtube",
"video",
"API",
"data",
"to",
"cache"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Video.php#L67-L73 |
191,055 | Web-Feet/coasterframework | src/Libraries/Blocks/Video.php | Video._cache | protected function _cache($videoId, $dl = false)
{
if ((!array_key_exists($videoId, static::$_cachedVideoData) || $dl)) {
if ($videoId) {
$videoData = BlockVideoCache::where('videoId', '=', $videoId)->first() ?: new BlockVideoCache;
if (!$videoData->exists() ... | php | protected function _cache($videoId, $dl = false)
{
if ((!array_key_exists($videoId, static::$_cachedVideoData) || $dl)) {
if ($videoId) {
$videoData = BlockVideoCache::where('videoId', '=', $videoId)->first() ?: new BlockVideoCache;
if (!$videoData->exists() ... | [
"protected",
"function",
"_cache",
"(",
"$",
"videoId",
",",
"$",
"dl",
"=",
"false",
")",
"{",
"if",
"(",
"(",
"!",
"array_key_exists",
"(",
"$",
"videoId",
",",
"static",
"::",
"$",
"_cachedVideoData",
")",
"||",
"$",
"dl",
")",
")",
"{",
"if",
"... | Return cached youtube video API data or fetch if not cached
@param string $videoId
@param bool $dl
@return null|\stdClass https://developers.google.com/youtube/v3/docs/search#resource | [
"Return",
"cached",
"youtube",
"video",
"API",
"data",
"or",
"fetch",
"if",
"not",
"cached"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Video.php#L81-L101 |
191,056 | Web-Feet/coasterframework | src/Libraries/Blocks/Video.php | Video._dl | protected function _dl($request, $params = [])
{
try {
$youTube = new Client(['base_uri' => 'https://www.googleapis.com/youtube/v3/']);
$params = $params + ['key' => config('coaster::key.yt_server')];
$response = $youTube->request('GET', $request, ['query' => $param... | php | protected function _dl($request, $params = [])
{
try {
$youTube = new Client(['base_uri' => 'https://www.googleapis.com/youtube/v3/']);
$params = $params + ['key' => config('coaster::key.yt_server')];
$response = $youTube->request('GET', $request, ['query' => $param... | [
"protected",
"function",
"_dl",
"(",
"$",
"request",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"$",
"youTube",
"=",
"new",
"Client",
"(",
"[",
"'base_uri'",
"=>",
"'https://www.googleapis.com/youtube/v3/'",
"]",
")",
";",
"$",
"params",
"=... | Download youtube API data
@param $request
@param array $params
@return null | [
"Download",
"youtube",
"API",
"data"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Video.php#L109-L120 |
191,057 | Web-Feet/coasterframework | src/Libraries/Blocks/String_.php | String_.display | public function display($content, $options = [])
{
if (!empty($options['meta']) || !empty($options['pageBuilder'])) {
$content = preg_replace_callback(
'/{{\s*\$(?P<block>\w*)\s*}}/',
function ($matches) {
return str_replace('"', "'", str... | php | public function display($content, $options = [])
{
if (!empty($options['meta']) || !empty($options['pageBuilder'])) {
$content = preg_replace_callback(
'/{{\s*\$(?P<block>\w*)\s*}}/',
function ($matches) {
return str_replace('"', "'", str... | [
"public",
"function",
"display",
"(",
"$",
"content",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'meta'",
"]",
")",
"||",
"!",
"empty",
"(",
"$",
"options",
"[",
"'pageBuilder'",
"]",
")",
")... | Frontend display for the block
@param string $content
@param array $options
@return string | [
"Frontend",
"display",
"for",
"the",
"block"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/String_.php#L16-L36 |
191,058 | Web-Feet/coasterframework | src/Libraries/Blocks/String_.php | String_.edit | public function edit($content)
{
if (stripos($this->_block->name, 'meta') !== false) {
if (stripos($this->_block->name, 'title') !== false) {
$lengthGuide = ['data-min' => 40, 'data-max' => 60];
} elseif (stripos($this->_block->name, 'desc') !== false) {
... | php | public function edit($content)
{
if (stripos($this->_block->name, 'meta') !== false) {
if (stripos($this->_block->name, 'title') !== false) {
$lengthGuide = ['data-min' => 40, 'data-max' => 60];
} elseif (stripos($this->_block->name, 'desc') !== false) {
... | [
"public",
"function",
"edit",
"(",
"$",
"content",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"_block",
"->",
"name",
",",
"'meta'",
")",
"!==",
"false",
")",
"{",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->",
"_block",
"->",
"name",
... | Meta length guides
@param string $content
@return string | [
"Meta",
"length",
"guides"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/String_.php#L43-L57 |
191,059 | Web-Feet/coasterframework | src/Helpers/Cms/Page/PageLoader.php | PageLoader._loadPageLevels | protected function _loadPageLevels()
{
$urlSegments = count(Request::segments());
// check for homepage feed
if ($urlSegments == 1 && substr(Request::segment(1), 0, 5) == 'root.') {
if ($this->feedExtension = Feed::getFeedExtensionFromPath(Request::segment(1))) {
... | php | protected function _loadPageLevels()
{
$urlSegments = count(Request::segments());
// check for homepage feed
if ($urlSegments == 1 && substr(Request::segment(1), 0, 5) == 'root.') {
if ($this->feedExtension = Feed::getFeedExtensionFromPath(Request::segment(1))) {
... | [
"protected",
"function",
"_loadPageLevels",
"(",
")",
"{",
"$",
"urlSegments",
"=",
"count",
"(",
"Request",
"::",
"segments",
"(",
")",
")",
";",
"// check for homepage feed",
"if",
"(",
"$",
"urlSegments",
"==",
"1",
"&&",
"substr",
"(",
"Request",
"::",
... | Load all page levels for current request.
Also check if search page or feed page. | [
"Load",
"all",
"page",
"levels",
"for",
"current",
"request",
".",
"Also",
"check",
"if",
"search",
"page",
"or",
"feed",
"page",
"."
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Cms/Page/PageLoader.php#L94-L160 |
191,060 | Web-Feet/coasterframework | src/Helpers/Cms/Page/PageLoader.php | PageLoader._loadPageStatus | protected function _loadPageStatus()
{
$lowestLevelPage = count($this->pageLevels) > 0 ? end($this->pageLevels) : null;
if ($lowestLevelPage) {
/** @var Page $lowestLevelPage */
$this->isLive = $lowestLevelPage->is_live();
if (!$this->is404) {
i... | php | protected function _loadPageStatus()
{
$lowestLevelPage = count($this->pageLevels) > 0 ? end($this->pageLevels) : null;
if ($lowestLevelPage) {
/** @var Page $lowestLevelPage */
$this->isLive = $lowestLevelPage->is_live();
if (!$this->is404) {
i... | [
"protected",
"function",
"_loadPageStatus",
"(",
")",
"{",
"$",
"lowestLevelPage",
"=",
"count",
"(",
"$",
"this",
"->",
"pageLevels",
")",
">",
"0",
"?",
"end",
"(",
"$",
"this",
"->",
"pageLevels",
")",
":",
"null",
";",
"if",
"(",
"$",
"lowestLevelP... | Load current page status.
Is live, Is preview, Custom Template | [
"Load",
"current",
"page",
"status",
".",
"Is",
"live",
"Is",
"preview",
"Custom",
"Template"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Cms/Page/PageLoader.php#L166-L187 |
191,061 | Web-Feet/coasterframework | src/Helpers/Cms/Page/PageLoader.php | PageLoader._loadPageTemplate | public function _loadPageTemplate()
{
$theme = Theme::find(config('coaster::frontend.theme'));
$lowestLevelPage = count($this->pageLevels) > 0 ? end($this->pageLevels) : null;
$this->theme = !empty($theme) && is_dir(base_path('/resources/views/themes/' . $theme->theme)) ? $theme->theme : 'd... | php | public function _loadPageTemplate()
{
$theme = Theme::find(config('coaster::frontend.theme'));
$lowestLevelPage = count($this->pageLevels) > 0 ? end($this->pageLevels) : null;
$this->theme = !empty($theme) && is_dir(base_path('/resources/views/themes/' . $theme->theme)) ? $theme->theme : 'd... | [
"public",
"function",
"_loadPageTemplate",
"(",
")",
"{",
"$",
"theme",
"=",
"Theme",
"::",
"find",
"(",
"config",
"(",
"'coaster::frontend.theme'",
")",
")",
";",
"$",
"lowestLevelPage",
"=",
"count",
"(",
"$",
"this",
"->",
"pageLevels",
")",
">",
"0",
... | Load theme name, template name and content type to return | [
"Load",
"theme",
"name",
"template",
"name",
"and",
"content",
"type",
"to",
"return"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Cms/Page/PageLoader.php#L192-L200 |
191,062 | Web-Feet/coasterframework | src/Helpers/Cms/Page/PageLoader.php | PageLoader._isSearchPage | protected function _isSearchPage($path, Page $parentPage)
{
$ppIsNamedSearch = ($parentPage->pageLang() && $parentPage->pageLang()->url == 'search');
if ($path == 'search' || $ppIsNamedSearch) {
return $ppIsNamedSearch ? 0 : 1;
} else {
return false;
}
} | php | protected function _isSearchPage($path, Page $parentPage)
{
$ppIsNamedSearch = ($parentPage->pageLang() && $parentPage->pageLang()->url == 'search');
if ($path == 'search' || $ppIsNamedSearch) {
return $ppIsNamedSearch ? 0 : 1;
} else {
return false;
}
} | [
"protected",
"function",
"_isSearchPage",
"(",
"$",
"path",
",",
"Page",
"$",
"parentPage",
")",
"{",
"$",
"ppIsNamedSearch",
"=",
"(",
"$",
"parentPage",
"->",
"pageLang",
"(",
")",
"&&",
"$",
"parentPage",
"->",
"pageLang",
"(",
")",
"->",
"url",
"==",... | If a search page returns an additional offset from which segment to take the search query
@param string $path
@param Page $parentPage
@return false|int | [
"If",
"a",
"search",
"page",
"returns",
"an",
"additional",
"offset",
"from",
"which",
"segment",
"to",
"take",
"the",
"search",
"query"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Cms/Page/PageLoader.php#L266-L274 |
191,063 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver/Selenium/Connection.php | Driver_Selenium_Connection.start | public function start(array $desiredCapabilities = NULL)
{
if ( ! ($this->_session_id = $this->reuse_session()))
{
$this->_session_id = $this->new_session($desiredCapabilities);
}
$this->_server .= "session/{$this->_session_id}/";
} | php | public function start(array $desiredCapabilities = NULL)
{
if ( ! ($this->_session_id = $this->reuse_session()))
{
$this->_session_id = $this->new_session($desiredCapabilities);
}
$this->_server .= "session/{$this->_session_id}/";
} | [
"public",
"function",
"start",
"(",
"array",
"$",
"desiredCapabilities",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"_session_id",
"=",
"$",
"this",
"->",
"reuse_session",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"_session_id",
... | Start a new selenium session, based on passed desired capabilities.
Reuses the session if possible
@param array $desiredCapabilities | [
"Start",
"a",
"new",
"selenium",
"session",
"based",
"on",
"passed",
"desired",
"capabilities",
".",
"Reuses",
"the",
"session",
"if",
"possible"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver/Selenium/Connection.php#L52-L60 |
191,064 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver/Selenium/Connection.php | Driver_Selenium_Connection.reuse_session | public function reuse_session()
{
$sessions = $this->get('sessions');
foreach ($sessions as $session)
{
$id = $session['id'];
try
{
$this->get("session/$id/window_handle");
return $id;
}
// @codeCoverageIgnoreStart
// This cannot be tested because of selenium bug (can't close main windo... | php | public function reuse_session()
{
$sessions = $this->get('sessions');
foreach ($sessions as $session)
{
$id = $session['id'];
try
{
$this->get("session/$id/window_handle");
return $id;
}
// @codeCoverageIgnoreStart
// This cannot be tested because of selenium bug (can't close main windo... | [
"public",
"function",
"reuse_session",
"(",
")",
"{",
"$",
"sessions",
"=",
"$",
"this",
"->",
"get",
"(",
"'sessions'",
")",
";",
"foreach",
"(",
"$",
"sessions",
"as",
"$",
"session",
")",
"{",
"$",
"id",
"=",
"$",
"session",
"[",
"'id'",
"]",
";... | Try to reuse an existing selenium session, return the reused id
@return string | [
"Try",
"to",
"reuse",
"an",
"existing",
"selenium",
"session",
"return",
"the",
"reused",
"id"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver/Selenium/Connection.php#L75-L94 |
191,065 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver/Selenium/Connection.php | Driver_Selenium_Connection.new_session | public function new_session(array $desiredCapabilities = NULL)
{
if ( ! $desiredCapabilities)
{
$desiredCapabilities = array('browserName' => 'firefox');
}
$session = $this->post('session', array('desiredCapabilities' => $desiredCapabilities));
return $session['webdriver.remote.sessionid'];
} | php | public function new_session(array $desiredCapabilities = NULL)
{
if ( ! $desiredCapabilities)
{
$desiredCapabilities = array('browserName' => 'firefox');
}
$session = $this->post('session', array('desiredCapabilities' => $desiredCapabilities));
return $session['webdriver.remote.sessionid'];
} | [
"public",
"function",
"new_session",
"(",
"array",
"$",
"desiredCapabilities",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"desiredCapabilities",
")",
"{",
"$",
"desiredCapabilities",
"=",
"array",
"(",
"'browserName'",
"=>",
"'firefox'",
")",
";",
"}",
"$",... | Initiate a new session, based on the desired capabilities
@param array $desiredCapabilities
@return new session | [
"Initiate",
"a",
"new",
"session",
"based",
"on",
"the",
"desired",
"capabilities"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver/Selenium/Connection.php#L101-L110 |
191,066 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver/Selenium/Connection.php | Driver_Selenium_Connection.post | public function post($command, array $params)
{
$options = array();
$options[CURLOPT_POST] = TRUE;
if ($params) {
$options[CURLOPT_POSTFIELDS] = json_encode($params);
}
return $this->call($command, $options);
} | php | public function post($command, array $params)
{
$options = array();
$options[CURLOPT_POST] = TRUE;
if ($params) {
$options[CURLOPT_POSTFIELDS] = json_encode($params);
}
return $this->call($command, $options);
} | [
"public",
"function",
"post",
"(",
"$",
"command",
",",
"array",
"$",
"params",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"$",
"options",
"[",
"CURLOPT_POST",
"]",
"=",
"TRUE",
";",
"if",
"(",
"$",
"params",
")",
"{",
"$",
"options",
... | Perform a post request to the selenium server
@param string $command
@param array $params
@return mixed | [
"Perform",
"a",
"post",
"request",
"to",
"the",
"selenium",
"server"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver/Selenium/Connection.php#L128-L138 |
191,067 | OpenBuildings/spiderling | src/Openbuildings/Spiderling/Driver/Selenium/Connection.php | Driver_Selenium_Connection.call | public function call($command, array $options = array())
{
$curl = curl_init();
$options[CURLOPT_URL] = $this->server().$command;
$options[CURLOPT_RETURNTRANSFER] = TRUE;
$options[CURLOPT_FOLLOWLOCATION] = TRUE;
$options[CURLOPT_HTTPHEADER] = array(
'Content-Type: application/json;charset=UTF-8',
'Acce... | php | public function call($command, array $options = array())
{
$curl = curl_init();
$options[CURLOPT_URL] = $this->server().$command;
$options[CURLOPT_RETURNTRANSFER] = TRUE;
$options[CURLOPT_FOLLOWLOCATION] = TRUE;
$options[CURLOPT_HTTPHEADER] = array(
'Content-Type: application/json;charset=UTF-8',
'Acce... | [
"public",
"function",
"call",
"(",
"$",
"command",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"curl",
"=",
"curl_init",
"(",
")",
";",
"$",
"options",
"[",
"CURLOPT_URL",
"]",
"=",
"$",
"this",
"->",
"server",
"(",
")",
... | Perform a request to the selenium server, using curl
@param string $command
@param array $options curl options
@return mixed | [
"Perform",
"a",
"request",
"to",
"the",
"selenium",
"server",
"using",
"curl"
] | 00cec77eb7228204fda55596dee49ff1a5f14ac5 | https://github.com/OpenBuildings/spiderling/blob/00cec77eb7228204fda55596dee49ff1a5f14ac5/src/Openbuildings/Spiderling/Driver/Selenium/Connection.php#L159-L190 |
191,068 | Web-Feet/coasterframework | src/Helpers/Cms/Page/Path.php | Path.getFullPathsVariations | public static function getFullPathsVariations($pageIds, $separator = ' » ')
{
$paths = [];
foreach ($pageIds as $pageId) {
$paths[$pageId] = self::getFullPath($pageId, $separator);
if ($paths[$pageId]->groupContainers) {
foreach ($paths[$pageId]->groupCo... | php | public static function getFullPathsVariations($pageIds, $separator = ' » ')
{
$paths = [];
foreach ($pageIds as $pageId) {
$paths[$pageId] = self::getFullPath($pageId, $separator);
if ($paths[$pageId]->groupContainers) {
foreach ($paths[$pageId]->groupCo... | [
"public",
"static",
"function",
"getFullPathsVariations",
"(",
"$",
"pageIds",
",",
"$",
"separator",
"=",
"' » '",
")",
"{",
"$",
"paths",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"pageIds",
"as",
"$",
"pageId",
")",
"{",
"$",
"paths",
"[",
"$",... | Get paths with group variations
@param array $pageIds
@param string $separator
@return Path[] | [
"Get",
"paths",
"with",
"group",
"variations"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Cms/Page/Path.php#L247-L262 |
191,069 | Web-Feet/coasterframework | src/Helpers/Cms/Page/Path.php | Path.unParsePageId | public static function unParsePageId($unParsedPageId, $returnFirstEl = true)
{
$parts = explode(',', $unParsedPageId);
return $returnFirstEl ? $parts[0] : $parts;
} | php | public static function unParsePageId($unParsedPageId, $returnFirstEl = true)
{
$parts = explode(',', $unParsedPageId);
return $returnFirstEl ? $parts[0] : $parts;
} | [
"public",
"static",
"function",
"unParsePageId",
"(",
"$",
"unParsedPageId",
",",
"$",
"returnFirstEl",
"=",
"true",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"','",
",",
"$",
"unParsedPageId",
")",
";",
"return",
"$",
"returnFirstEl",
"?",
"$",
"parts"... | remove group data from saved block content or block options
@param int|string $unParsedPageId
@param bool $returnFirstEl
@return int|string|array | [
"remove",
"group",
"data",
"from",
"saved",
"block",
"content",
"or",
"block",
"options"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Cms/Page/Path.php#L284-L288 |
191,070 | Web-Feet/coasterframework | src/Libraries/Import/BlocksImport.php | BlocksImport._renderThemeFiles | protected function _renderThemeFiles($scope = 'file')
{
$this->_blocksCollection->setScope($scope);
$themeBuilder = PageBuilder::make(ThemeBuilderInstance::class, [new PageLoaderDummy($this->_additionalData['theme']->theme), $this->_blocksCollection]);
if ($this->_templateList) {
... | php | protected function _renderThemeFiles($scope = 'file')
{
$this->_blocksCollection->setScope($scope);
$themeBuilder = PageBuilder::make(ThemeBuilderInstance::class, [new PageLoaderDummy($this->_additionalData['theme']->theme), $this->_blocksCollection]);
if ($this->_templateList) {
... | [
"protected",
"function",
"_renderThemeFiles",
"(",
"$",
"scope",
"=",
"'file'",
")",
"{",
"$",
"this",
"->",
"_blocksCollection",
"->",
"setScope",
"(",
"$",
"scope",
")",
";",
"$",
"themeBuilder",
"=",
"PageBuilder",
"::",
"make",
"(",
"ThemeBuilderInstance",... | Get all extra block data from theme files
@param string $scope | [
"Get",
"all",
"extra",
"block",
"data",
"from",
"theme",
"files"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Import/BlocksImport.php#L314-L337 |
191,071 | Web-Feet/coasterframework | src/Libraries/Import/BlocksImport.php | BlocksImport._renderCsvBlocks | protected function _renderCsvBlocks($themeBuilder)
{
$themeBuilder->setData('template', '');
foreach ($this->_blocksCollection->getBlocks('csv') as $blockName => $importBlock) {
$themeBuilder->block($blockName);
}
} | php | protected function _renderCsvBlocks($themeBuilder)
{
$themeBuilder->setData('template', '');
foreach ($this->_blocksCollection->getBlocks('csv') as $blockName => $importBlock) {
$themeBuilder->block($blockName);
}
} | [
"protected",
"function",
"_renderCsvBlocks",
"(",
"$",
"themeBuilder",
")",
"{",
"$",
"themeBuilder",
"->",
"setData",
"(",
"'template'",
",",
"''",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_blocksCollection",
"->",
"getBlocks",
"(",
"'csv'",
")",
"as",... | Run all blocks from import csv as they may not have be found and rendered in the theme files
@param ThemeBuilderInstance $themeBuilder | [
"Run",
"all",
"blocks",
"from",
"import",
"csv",
"as",
"they",
"may",
"not",
"have",
"be",
"found",
"and",
"rendered",
"in",
"the",
"theme",
"files"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Import/BlocksImport.php#L343-L349 |
191,072 | TimeIncOSS/swagger-bundle | src/Swagger/Processor/RouteProcessor.php | RouteProcessor.configureGet | private function configureGet(Get $operation, array $options)
{
if (!$operation->summary) {
if ($options['returns'] == Route::RETURNS_ENTITY) {
$operation->summary = 'Fetch a '.$options['entity_name'].' entity';
} else {
$operation->summary = 'Fetch a ... | php | private function configureGet(Get $operation, array $options)
{
if (!$operation->summary) {
if ($options['returns'] == Route::RETURNS_ENTITY) {
$operation->summary = 'Fetch a '.$options['entity_name'].' entity';
} else {
$operation->summary = 'Fetch a ... | [
"private",
"function",
"configureGet",
"(",
"Get",
"$",
"operation",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"operation",
"->",
"summary",
")",
"{",
"if",
"(",
"$",
"options",
"[",
"'returns'",
"]",
"==",
"Route",
"::",
"RETURNS_EN... | Configure a Get annotation with FosRest data.
@param Get $operation
@param array $options | [
"Configure",
"a",
"Get",
"annotation",
"with",
"FosRest",
"data",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger/Processor/RouteProcessor.php#L228-L276 |
191,073 | TimeIncOSS/swagger-bundle | src/Swagger/Processor/RouteProcessor.php | RouteProcessor.configurePost | private function configurePost(Post $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Create a '.$options['entity_name'].' entity';
}
if (!isset($operation->parameters['body'])) {
$operation->parameters[] = new Parameter(
... | php | private function configurePost(Post $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Create a '.$options['entity_name'].' entity';
}
if (!isset($operation->parameters['body'])) {
$operation->parameters[] = new Parameter(
... | [
"private",
"function",
"configurePost",
"(",
"Post",
"$",
"operation",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"operation",
"->",
"summary",
")",
"{",
"$",
"operation",
"->",
"summary",
"=",
"'Create a '",
".",
"$",
"options",
"[",
... | Configure a Post annotation with FosRest data.
@param Post $operation
@param array $options | [
"Configure",
"a",
"Post",
"annotation",
"with",
"FosRest",
"data",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger/Processor/RouteProcessor.php#L284-L321 |
191,074 | TimeIncOSS/swagger-bundle | src/Swagger/Processor/RouteProcessor.php | RouteProcessor.configurePut | private function configurePut(Put $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Edit a '.$options['entity_name'].' entity';
}
if (!isset($operation->parameters['body'])) {
$operation->parameters[] = new Parameter(
[
... | php | private function configurePut(Put $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Edit a '.$options['entity_name'].' entity';
}
if (!isset($operation->parameters['body'])) {
$operation->parameters[] = new Parameter(
[
... | [
"private",
"function",
"configurePut",
"(",
"Put",
"$",
"operation",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"operation",
"->",
"summary",
")",
"{",
"$",
"operation",
"->",
"summary",
"=",
"'Edit a '",
".",
"$",
"options",
"[",
"'e... | Configure a Put annotation with FosRest data.
@param Put $operation
@param array $options | [
"Configure",
"a",
"Put",
"annotation",
"with",
"FosRest",
"data",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger/Processor/RouteProcessor.php#L329-L372 |
191,075 | TimeIncOSS/swagger-bundle | src/Swagger/Processor/RouteProcessor.php | RouteProcessor.configurePatch | private function configurePatch(Patch $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Edit fields of a '.$options['entity_name'].' entity';
}
if (!isset($operation->parameters['body'])) {
$operation->parameters[] = new Parameter(
... | php | private function configurePatch(Patch $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Edit fields of a '.$options['entity_name'].' entity';
}
if (!isset($operation->parameters['body'])) {
$operation->parameters[] = new Parameter(
... | [
"private",
"function",
"configurePatch",
"(",
"Patch",
"$",
"operation",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"operation",
"->",
"summary",
")",
"{",
"$",
"operation",
"->",
"summary",
"=",
"'Edit fields of a '",
".",
"$",
"options"... | Configure a Patch annotation with FosRest data.
@param Patch $operation
@param array $options | [
"Configure",
"a",
"Patch",
"annotation",
"with",
"FosRest",
"data",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger/Processor/RouteProcessor.php#L380-L423 |
191,076 | TimeIncOSS/swagger-bundle | src/Swagger/Processor/RouteProcessor.php | RouteProcessor.configureDelete | private function configureDelete(Delete $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Delete a '.$options['entity_name'].' entity';
}
$this->appendResponses(
$operation,
[
new Response(
... | php | private function configureDelete(Delete $operation, array $options)
{
if (!$operation->summary) {
$operation->summary = 'Delete a '.$options['entity_name'].' entity';
}
$this->appendResponses(
$operation,
[
new Response(
... | [
"private",
"function",
"configureDelete",
"(",
"Delete",
"$",
"operation",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"operation",
"->",
"summary",
")",
"{",
"$",
"operation",
"->",
"summary",
"=",
"'Delete a '",
".",
"$",
"options",
"[... | Configure a Delete annotation with FosRest data.
@param Delete $operation
@param array $options | [
"Configure",
"a",
"Delete",
"annotation",
"with",
"FosRest",
"data",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger/Processor/RouteProcessor.php#L431-L459 |
191,077 | TimeIncOSS/swagger-bundle | src/Swagger/Processor/RouteProcessor.php | RouteProcessor.appendResponses | private function appendResponses(Operation $operation, array $newResponses)
{
foreach ($newResponses as $newResponse) {
if (!$operation->responses) {
$operation->responses = [];
}
$hasResponse = false;
/** @var Response $response */
... | php | private function appendResponses(Operation $operation, array $newResponses)
{
foreach ($newResponses as $newResponse) {
if (!$operation->responses) {
$operation->responses = [];
}
$hasResponse = false;
/** @var Response $response */
... | [
"private",
"function",
"appendResponses",
"(",
"Operation",
"$",
"operation",
",",
"array",
"$",
"newResponses",
")",
"{",
"foreach",
"(",
"$",
"newResponses",
"as",
"$",
"newResponse",
")",
"{",
"if",
"(",
"!",
"$",
"operation",
"->",
"responses",
")",
"{... | Append responses onto an operation, checking first if they are already configured.
@param Operation $operation
@param array $newResponses | [
"Append",
"responses",
"onto",
"an",
"operation",
"checking",
"first",
"if",
"they",
"are",
"already",
"configured",
"."
] | d1179aef505ae330c15ff2871bffef5fb2e285e2 | https://github.com/TimeIncOSS/swagger-bundle/blob/d1179aef505ae330c15ff2871bffef5fb2e285e2/src/Swagger/Processor/RouteProcessor.php#L488-L509 |
191,078 | xsanisty/SlimStarter | src/SlimStarter/Menu/MenuCollection.php | MenuCollection.addItem | public function addItem($name, \SlimStarter\Menu\MenuItem $item){
$this->items[$name] = $item;
} | php | public function addItem($name, \SlimStarter\Menu\MenuItem $item){
$this->items[$name] = $item;
} | [
"public",
"function",
"addItem",
"(",
"$",
"name",
",",
"\\",
"SlimStarter",
"\\",
"Menu",
"\\",
"MenuItem",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"items",
"[",
"$",
"name",
"]",
"=",
"$",
"item",
";",
"}"
] | Add new item to menuCollection
@param SlimStarter\Menu\MenuItem $item
@param String $menu | [
"Add",
"new",
"item",
"to",
"menuCollection"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/src/SlimStarter/Menu/MenuCollection.php#L49-L51 |
191,079 | Web-Feet/coasterframework | src/Libraries/Blocks/Select.php | Select.data | public function data($content, $options = [])
{
if (isset($options['returnAll']) && $options['returnAll']) {
return BlockSelectOption::getOptionsArray($this->_block->id);
}
return parent::data($content);
} | php | public function data($content, $options = [])
{
if (isset($options['returnAll']) && $options['returnAll']) {
return BlockSelectOption::getOptionsArray($this->_block->id);
}
return parent::data($content);
} | [
"public",
"function",
"data",
"(",
"$",
"content",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'returnAll'",
"]",
")",
"&&",
"$",
"options",
"[",
"'returnAll'",
"]",
")",
"{",
"return",
"BlockSelectOpt... | Add return all option to the data function
@param string $content
@param array $options
@return array|string | [
"Add",
"return",
"all",
"option",
"to",
"the",
"data",
"function"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Select.php#L18-L24 |
191,080 | Web-Feet/coasterframework | src/Libraries/Blocks/Select.php | Select.edit | public function edit($content)
{
if (!array_key_exists('selectOptions', $this->_editViewData)) {
$this->_editViewData['selectOptions'] = [];
$selectOptions = BlockSelectOption::where('block_id', '=', $this->_block->id)->get();
foreach ($selectOptions as $selectOption... | php | public function edit($content)
{
if (!array_key_exists('selectOptions', $this->_editViewData)) {
$this->_editViewData['selectOptions'] = [];
$selectOptions = BlockSelectOption::where('block_id', '=', $this->_block->id)->get();
foreach ($selectOptions as $selectOption... | [
"public",
"function",
"edit",
"(",
"$",
"content",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'selectOptions'",
",",
"$",
"this",
"->",
"_editViewData",
")",
")",
"{",
"$",
"this",
"->",
"_editViewData",
"[",
"'selectOptions'",
"]",
"=",
"[",
"]... | Display select options, will fill in bg colour if hexadecimal
@param string $content
@return string | [
"Display",
"select",
"options",
"will",
"fill",
"in",
"bg",
"colour",
"if",
"hexadecimal"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Select.php#L31-L44 |
191,081 | Web-Feet/coasterframework | src/Helpers/Cms/File/SecureUpload.php | SecureUpload._processFolders | protected static function _processFolders($secureFolders)
{
$secureFolders = array_filter(is_array($secureFolders) ? $secureFolders : explode(',', $secureFolders), 'trim');
foreach ($secureFolders as $k => $folder) {
$secureFolders[$k] = '/' . trim($folder, '/');
}
if (in... | php | protected static function _processFolders($secureFolders)
{
$secureFolders = array_filter(is_array($secureFolders) ? $secureFolders : explode(',', $secureFolders), 'trim');
foreach ($secureFolders as $k => $folder) {
$secureFolders[$k] = '/' . trim($folder, '/');
}
if (in... | [
"protected",
"static",
"function",
"_processFolders",
"(",
"$",
"secureFolders",
")",
"{",
"$",
"secureFolders",
"=",
"array_filter",
"(",
"is_array",
"(",
"$",
"secureFolders",
")",
"?",
"$",
"secureFolders",
":",
"explode",
"(",
"','",
",",
"$",
"secureFolde... | Remove subfolders and blank entries then return array
@param string|array $secureFolders
@return array | [
"Remove",
"subfolders",
"and",
"blank",
"entries",
"then",
"return",
"array"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Cms/File/SecureUpload.php#L95-L112 |
191,082 | Web-Feet/coasterframework | src/Libraries/Blocks/Repeater.php | Repeater.display | public function display($content, $options = [])
{
if (!empty($options['form'])) {
$view = !empty($options['view']) ? $options['view'] : '';
return FormWrap::view($this->_block, $options, $this->displayView($view, '-form'));
}
$options = $options + ['random' =... | php | public function display($content, $options = [])
{
if (!empty($options['form'])) {
$view = !empty($options['view']) ? $options['view'] : '';
return FormWrap::view($this->_block, $options, $this->displayView($view, '-form'));
}
$options = $options + ['random' =... | [
"public",
"function",
"display",
"(",
"$",
"content",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'form'",
"]",
")",
")",
"{",
"$",
"view",
"=",
"!",
"empty",
"(",
"$",
"options",
"[",
"'vie... | Display repeater view
@param string $content
@param array $options
@return string | [
"Display",
"repeater",
"view"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Repeater.php#L52-L63 |
191,083 | Web-Feet/coasterframework | src/Libraries/Blocks/Repeater.php | Repeater._renderRepeatedDisplayView | protected function _renderRepeatedDisplayView($options, $repeaterRows = [])
{
$repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);
// $repeaterRows[0] check allows skipping of block check (used for dummy data)
if (($repeaterRows && $repeaterBlocks) || (isset($repeaterRo... | php | protected function _renderRepeatedDisplayView($options, $repeaterRows = [])
{
$repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);
// $repeaterRows[0] check allows skipping of block check (used for dummy data)
if (($repeaterRows && $repeaterBlocks) || (isset($repeaterRo... | [
"protected",
"function",
"_renderRepeatedDisplayView",
"(",
"$",
"options",
",",
"$",
"repeaterRows",
"=",
"[",
"]",
")",
"{",
"$",
"repeaterBlocks",
"=",
"BlockRepeater",
"::",
"getRepeaterBlocks",
"(",
"$",
"this",
"->",
"_block",
"->",
"id",
")",
";",
"//... | Check per page values and load block info to pass to repeated view
@param array $options
@param array $repeaterRows
@return string | [
"Check",
"per",
"page",
"values",
"and",
"load",
"block",
"info",
"to",
"pass",
"to",
"repeated",
"view"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Repeater.php#L109-L130 |
191,084 | Web-Feet/coasterframework | src/Libraries/Blocks/Repeater.php | Repeater.submission | public function submission($formData)
{
$formRules = BlockFormRule::get_rules($this->_block->name.'-form');
$v = Validator::make($formData, $formRules);
if ($v->passes()) {
foreach ($formData as $blockName => $content) {
$fieldBlock = Block::preload($block... | php | public function submission($formData)
{
$formRules = BlockFormRule::get_rules($this->_block->name.'-form');
$v = Validator::make($formData, $formRules);
if ($v->passes()) {
foreach ($formData as $blockName => $content) {
$fieldBlock = Block::preload($block... | [
"public",
"function",
"submission",
"(",
"$",
"formData",
")",
"{",
"$",
"formRules",
"=",
"BlockFormRule",
"::",
"get_rules",
"(",
"$",
"this",
"->",
"_block",
"->",
"name",
".",
"'-form'",
")",
";",
"$",
"v",
"=",
"Validator",
"::",
"make",
"(",
"$",... | Repeater form submission
@param array $formData
@return null|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector | [
"Repeater",
"form",
"submission"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Repeater.php#L159-L186 |
191,085 | Web-Feet/coasterframework | src/Libraries/Blocks/Repeater.php | Repeater.edit | public function edit($content, $newRow = false)
{
// if no current repeater id, reserve next new repeater id for use on save
$repeaterId = $content ?: PageBlockRepeaterRows::nextFreeRepeaterId();
$this->_editViewData['renderedRows'] = '';
$this->_editViewData['itemName'] = '';
... | php | public function edit($content, $newRow = false)
{
// if no current repeater id, reserve next new repeater id for use on save
$repeaterId = $content ?: PageBlockRepeaterRows::nextFreeRepeaterId();
$this->_editViewData['renderedRows'] = '';
$this->_editViewData['itemName'] = '';
... | [
"public",
"function",
"edit",
"(",
"$",
"content",
",",
"$",
"newRow",
"=",
"false",
")",
"{",
"// if no current repeater id, reserve next new repeater id for use on save\r",
"$",
"repeaterId",
"=",
"$",
"content",
"?",
":",
"PageBlockRepeaterRows",
"::",
"nextFreeRepea... | Admin view for editing repeater data
Can return an individual repeater row with default block data)
@param string $content
@param bool $newRow
@return string | [
"Admin",
"view",
"for",
"editing",
"repeater",
"data",
"Can",
"return",
"an",
"individual",
"repeater",
"row",
"with",
"default",
"block",
"data",
")"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Repeater.php#L195-L232 |
191,086 | Web-Feet/coasterframework | src/Libraries/Blocks/Repeater.php | Repeater.submit | public function submit($postContent)
{
// load current and submitted data
$existingRepeaterRows = PageBlockRepeaterData::loadRepeaterData($postContent['repeater_id'], $this->_block->getVersionId());
$submittedRepeaterRows = Request::input('repeater.' . $postContent['repeater_id']) ?: [];... | php | public function submit($postContent)
{
// load current and submitted data
$existingRepeaterRows = PageBlockRepeaterData::loadRepeaterData($postContent['repeater_id'], $this->_block->getVersionId());
$submittedRepeaterRows = Request::input('repeater.' . $postContent['repeater_id']) ?: [];... | [
"public",
"function",
"submit",
"(",
"$",
"postContent",
")",
"{",
"// load current and submitted data\r",
"$",
"existingRepeaterRows",
"=",
"PageBlockRepeaterData",
"::",
"loadRepeaterData",
"(",
"$",
"postContent",
"[",
"'repeater_id'",
"]",
",",
"$",
"this",
"->",
... | Save submitted repeater data
@param array $postContent
@return static | [
"Save",
"submitted",
"repeater",
"data"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Repeater.php#L239-L282 |
191,087 | Web-Feet/coasterframework | src/Libraries/Blocks/Repeater.php | Repeater.generateSearchText | public function generateSearchText($content)
{
$searchText = '';
$repeaterRows = PageBlockRepeaterData::loadRepeaterData($content, $this->_block->getVersionId());
$repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);
foreach ($repeaterRows as $rowId => $repeat... | php | public function generateSearchText($content)
{
$searchText = '';
$repeaterRows = PageBlockRepeaterData::loadRepeaterData($content, $this->_block->getVersionId());
$repeaterBlocks = BlockRepeater::getRepeaterBlocks($this->_block->id);
foreach ($repeaterRows as $rowId => $repeat... | [
"public",
"function",
"generateSearchText",
"(",
"$",
"content",
")",
"{",
"$",
"searchText",
"=",
"''",
";",
"$",
"repeaterRows",
"=",
"PageBlockRepeaterData",
"::",
"loadRepeaterData",
"(",
"$",
"content",
",",
"$",
"this",
"->",
"_block",
"->",
"getVersionI... | Get search text from repeater blocks
@param null|string $content
@return null|string | [
"Get",
"search",
"text",
"from",
"repeater",
"blocks"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Repeater.php#L289-L308 |
191,088 | Web-Feet/coasterframework | src/Libraries/Blocks/Selectuser.php | Selectuser.edit | public function edit($content)
{
$users = [];
foreach (User::all() as $user) {
$users[$user->id] = $user->getName() . ' (#'.$user->id.')';
}
$this->_editViewData['customName'] = array_key_exists($content, $users) ? '' : $content;
$this->_editViewData['selectOption... | php | public function edit($content)
{
$users = [];
foreach (User::all() as $user) {
$users[$user->id] = $user->getName() . ' (#'.$user->id.')';
}
$this->_editViewData['customName'] = array_key_exists($content, $users) ? '' : $content;
$this->_editViewData['selectOption... | [
"public",
"function",
"edit",
"(",
"$",
"content",
")",
"{",
"$",
"users",
"=",
"[",
"]",
";",
"foreach",
"(",
"User",
"::",
"all",
"(",
")",
"as",
"$",
"user",
")",
"{",
"$",
"users",
"[",
"$",
"user",
"->",
"id",
"]",
"=",
"$",
"user",
"->"... | Display user select plus custom input
@param string $content
@return string | [
"Display",
"user",
"select",
"plus",
"custom",
"input"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Selectuser.php#L28-L38 |
191,089 | Web-Feet/coasterframework | src/Libraries/Blocks/Selectuser.php | Selectuser.generateSearchText | public function generateSearchText($content)
{
$userAliases = $content ? User::userAliases() : [];
$userName = (is_numeric($content) && !empty($userAliases[$content])) ? $userAliases[$content] : $content;
return parent::generateSearchText($userName);
} | php | public function generateSearchText($content)
{
$userAliases = $content ? User::userAliases() : [];
$userName = (is_numeric($content) && !empty($userAliases[$content])) ? $userAliases[$content] : $content;
return parent::generateSearchText($userName);
} | [
"public",
"function",
"generateSearchText",
"(",
"$",
"content",
")",
"{",
"$",
"userAliases",
"=",
"$",
"content",
"?",
"User",
"::",
"userAliases",
"(",
")",
":",
"[",
"]",
";",
"$",
"userName",
"=",
"(",
"is_numeric",
"(",
"$",
"content",
")",
"&&",... | Convert user id to name if not custom
@param null|string $content
@return null|string | [
"Convert",
"user",
"id",
"to",
"name",
"if",
"not",
"custom"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Selectuser.php#L55-L60 |
191,090 | xsanisty/SlimStarter | app/controllers/BaseController.php | BaseController.loadCss | protected function loadCss($css, $options=array())
{
$location = (isset($options['location'])) ? $options['location']:'internal';
//after:file, before:file, first, last
$position = (isset($options['position'])) ? $options['position']:'last';
if(!in_array($css,$this->data['css'][$lo... | php | protected function loadCss($css, $options=array())
{
$location = (isset($options['location'])) ? $options['location']:'internal';
//after:file, before:file, first, last
$position = (isset($options['position'])) ? $options['position']:'last';
if(!in_array($css,$this->data['css'][$lo... | [
"protected",
"function",
"loadCss",
"(",
"$",
"css",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"location",
"=",
"(",
"isset",
"(",
"$",
"options",
"[",
"'location'",
"]",
")",
")",
"?",
"$",
"options",
"[",
"'location'",
"]",
":",... | enqueue css asset to be loaded
@param [string] $css [css file to be loaded relative to base_asset_dir]
@param [array] $options [location=internal|external, position=first|last|after:file|before:file] | [
"enqueue",
"css",
"asset",
"to",
"be",
"loaded"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/app/controllers/BaseController.php#L56-L92 |
191,091 | xsanisty/SlimStarter | app/controllers/BaseController.php | BaseController.removeCss | protected function removeCss($css)
{
$key=array_keys($this->data['css']['internal'],$css);
if($key){
array_splice($this->data['css']['internal'],$key[0],1);
}
$key=array_keys($this->data['css']['external'],$css);
if($key){
array_splice($this->data['cs... | php | protected function removeCss($css)
{
$key=array_keys($this->data['css']['internal'],$css);
if($key){
array_splice($this->data['css']['internal'],$key[0],1);
}
$key=array_keys($this->data['css']['external'],$css);
if($key){
array_splice($this->data['cs... | [
"protected",
"function",
"removeCss",
"(",
"$",
"css",
")",
"{",
"$",
"key",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"data",
"[",
"'css'",
"]",
"[",
"'internal'",
"]",
",",
"$",
"css",
")",
";",
"if",
"(",
"$",
"key",
")",
"{",
"array_splice",
... | remove individual css file from queue list
@param [string] $css [css file to be removed] | [
"remove",
"individual",
"css",
"file",
"from",
"queue",
"list"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/app/controllers/BaseController.php#L164-L175 |
191,092 | xsanisty/SlimStarter | app/controllers/BaseController.php | BaseController.removeJs | protected function removeJs($js)
{
$key=array_keys($this->data['js']['internal'],$js);
if($key){
array_splice($this->data['js']['internal'],$key[0],1);
}
$key=array_keys($this->data['js']['external'],$js);
if($key){
array_splice($this->data['js']['ext... | php | protected function removeJs($js)
{
$key=array_keys($this->data['js']['internal'],$js);
if($key){
array_splice($this->data['js']['internal'],$key[0],1);
}
$key=array_keys($this->data['js']['external'],$js);
if($key){
array_splice($this->data['js']['ext... | [
"protected",
"function",
"removeJs",
"(",
"$",
"js",
")",
"{",
"$",
"key",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"data",
"[",
"'js'",
"]",
"[",
"'internal'",
"]",
",",
"$",
"js",
")",
";",
"if",
"(",
"$",
"key",
")",
"{",
"array_splice",
"("... | remove individual js file from queue list
@param [string] $js [js file to be removed] | [
"remove",
"individual",
"js",
"file",
"from",
"queue",
"list"
] | 3a2d012e8bd3928698f3340de203b9c0155cd853 | https://github.com/xsanisty/SlimStarter/blob/3a2d012e8bd3928698f3340de203b9c0155cd853/app/controllers/BaseController.php#L181-L192 |
191,093 | Web-Feet/coasterframework | src/Libraries/Blocks/Selectpages.php | Selectpages.display | public function display($content, $options = [])
{
$pages = [];
$page_ids = [];
if (isset($options['reverse'])) {
// get page_ids on which current page is selected in this block
$currentPageId = PageBuilder::pageId(true);
if ($currentPageId) {
... | php | public function display($content, $options = [])
{
$pages = [];
$page_ids = [];
if (isset($options['reverse'])) {
// get page_ids on which current page is selected in this block
$currentPageId = PageBuilder::pageId(true);
if ($currentPageId) {
... | [
"public",
"function",
"display",
"(",
"$",
"content",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"pages",
"=",
"[",
"]",
";",
"$",
"page_ids",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'reverse'",
"]",
")",
")",... | Display pages selected with view
Also reverse lookup option, find pages with the current page selected
@param string $content
@param array $options
@return string | [
"Display",
"pages",
"selected",
"with",
"view",
"Also",
"reverse",
"lookup",
"option",
"find",
"pages",
"with",
"the",
"current",
"page",
"selected"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Selectpages.php#L30-L63 |
191,094 | Web-Feet/coasterframework | src/Libraries/Blocks/Selectpages.php | Selectpages._renderRepeatedDisplayViewItem | protected function _renderRepeatedDisplayViewItem($displayView, $data = [])
{
$pageOverride = PageBuilder::getData('pageOverride');
$item = reset($data);
PageBuilder::setData('pageOverride', $item->page);
$renderedView = parent::_renderRepeatedDisplayViewItem($displayView, $data... | php | protected function _renderRepeatedDisplayViewItem($displayView, $data = [])
{
$pageOverride = PageBuilder::getData('pageOverride');
$item = reset($data);
PageBuilder::setData('pageOverride', $item->page);
$renderedView = parent::_renderRepeatedDisplayViewItem($displayView, $data... | [
"protected",
"function",
"_renderRepeatedDisplayViewItem",
"(",
"$",
"displayView",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"pageOverride",
"=",
"PageBuilder",
"::",
"getData",
"(",
"'pageOverride'",
")",
";",
"$",
"item",
"=",
"reset",
"(",
"$",
"... | Set default page id to selected page in the repeated view
@param string $displayView
@param array $data
@return string | [
"Set",
"default",
"page",
"id",
"to",
"selected",
"page",
"in",
"the",
"repeated",
"view"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Libraries/Blocks/Selectpages.php#L80-L88 |
191,095 | dlnsk/h-rbac | src/ArrayAuthorization.php | ArrayAuthorization.checkPermission | public function checkPermission($user, $ability, $arguments)
{
if ($user->role === 'admin') {
return true;
}
// У пользователя роль, которой нет в списке
$roles = $this->getRoles();
if (!isset($roles[$user->role])) {
return null;
}
// Ищем разрешение для данной роли среди наследников текущего раз... | php | public function checkPermission($user, $ability, $arguments)
{
if ($user->role === 'admin') {
return true;
}
// У пользователя роль, которой нет в списке
$roles = $this->getRoles();
if (!isset($roles[$user->role])) {
return null;
}
// Ищем разрешение для данной роли среди наследников текущего раз... | [
"public",
"function",
"checkPermission",
"(",
"$",
"user",
",",
"$",
"ability",
",",
"$",
"arguments",
")",
"{",
"if",
"(",
"$",
"user",
"->",
"role",
"===",
"'admin'",
")",
"{",
"return",
"true",
";",
"}",
"// У пользователя роль, которой нет в списке",
"$"... | Checking permission for choosed user
@return boolean | [
"Checking",
"permission",
"for",
"choosed",
"user"
] | 3bed613522adf5d0e7dbdd1ab2ef9388af0b270a | https://github.com/dlnsk/h-rbac/blob/3bed613522adf5d0e7dbdd1ab2ef9388af0b270a/src/ArrayAuthorization.php#L37-L77 |
191,096 | dlnsk/h-rbac | src/ArrayAuthorization.php | ArrayAuthorization.getModel | public function getModel($class, $id)
{
if ($id instanceof $class) {
return $id;
} elseif (ctype_digit(strval($id))) { // целое число в виде числа или текстовой строки
return $class::findOrFail($id);
} else {
//TODO: Использовать свое исключение
throw new \Exception("Can't get model.", 1);
}
} | php | public function getModel($class, $id)
{
if ($id instanceof $class) {
return $id;
} elseif (ctype_digit(strval($id))) { // целое число в виде числа или текстовой строки
return $class::findOrFail($id);
} else {
//TODO: Использовать свое исключение
throw new \Exception("Can't get model.", 1);
}
} | [
"public",
"function",
"getModel",
"(",
"$",
"class",
",",
"$",
"id",
")",
"{",
"if",
"(",
"$",
"id",
"instanceof",
"$",
"class",
")",
"{",
"return",
"$",
"id",
";",
"}",
"elseif",
"(",
"ctype_digit",
"(",
"strval",
"(",
"$",
"id",
")",
")",
")",
... | Return model of given class or exception if can't
@param class $class This is a class which instance we need.
@param Model|integer $id Instance or its ID
@return Model|exception | [
"Return",
"model",
"of",
"given",
"class",
"or",
"exception",
"if",
"can",
"t"
] | 3bed613522adf5d0e7dbdd1ab2ef9388af0b270a | https://github.com/dlnsk/h-rbac/blob/3bed613522adf5d0e7dbdd1ab2ef9388af0b270a/src/ArrayAuthorization.php#L88-L98 |
191,097 | Web-Feet/coasterframework | src/Helpers/Admin/Import/BlocksCollection.php | BlocksCollection.getAggregatedBlock | public function getAggregatedBlock($blockName, $scopes = [])
{
$aggregatedData = new Block(['name' => $blockName]);
if (array_key_exists($blockName, $this->_blocks)) {
$scopes = $this->_getScopes($scopes);
arsort($scopes);
foreach ($scopes as $scope => $scopeOrder... | php | public function getAggregatedBlock($blockName, $scopes = [])
{
$aggregatedData = new Block(['name' => $blockName]);
if (array_key_exists($blockName, $this->_blocks)) {
$scopes = $this->_getScopes($scopes);
arsort($scopes);
foreach ($scopes as $scope => $scopeOrder... | [
"public",
"function",
"getAggregatedBlock",
"(",
"$",
"blockName",
",",
"$",
"scopes",
"=",
"[",
"]",
")",
"{",
"$",
"aggregatedData",
"=",
"new",
"Block",
"(",
"[",
"'name'",
"=>",
"$",
"blockName",
"]",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"... | Ignores template data from db scope
@param string $blockName
@param array $scopes
@return Block | [
"Ignores",
"template",
"data",
"from",
"db",
"scope"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Admin/Import/BlocksCollection.php#L92-L110 |
191,098 | Web-Feet/coasterframework | src/Helpers/Admin/Import/BlocksCollection.php | BlocksCollection._getScopes | protected function _getScopes($scopes = [])
{
if ($scopes) {
$returnScopes = [];
foreach ($scopes as $scope) {
$returnScopes[$scope] = $this->_scopes[$scope];
}
return $returnScopes;
} else {
return $this->_scopes;
}... | php | protected function _getScopes($scopes = [])
{
if ($scopes) {
$returnScopes = [];
foreach ($scopes as $scope) {
$returnScopes[$scope] = $this->_scopes[$scope];
}
return $returnScopes;
} else {
return $this->_scopes;
}... | [
"protected",
"function",
"_getScopes",
"(",
"$",
"scopes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"scopes",
")",
"{",
"$",
"returnScopes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"scopes",
"as",
"$",
"scope",
")",
"{",
"$",
"returnScopes",
"[",
... | Return scopes with order values
@param array $scopes
@return array | [
"Return",
"scopes",
"with",
"order",
"values"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Admin/Import/BlocksCollection.php#L188-L199 |
191,099 | Web-Feet/coasterframework | src/Helpers/Admin/Import/BlocksCollection.php | BlocksCollection.getBlockListInfo | public function getBlockListInfo()
{
$blockList = [];
foreach ($this->getBlockNames() as $blockName) {
$importBlock = $this->getAggregatedBlock($blockName);
$currentBlock = $this->getBlock($importBlock->blockData['name'], 'db');
$blockList[$blockName] = [
... | php | public function getBlockListInfo()
{
$blockList = [];
foreach ($this->getBlockNames() as $blockName) {
$importBlock = $this->getAggregatedBlock($blockName);
$currentBlock = $this->getBlock($importBlock->blockData['name'], 'db');
$blockList[$blockName] = [
... | [
"public",
"function",
"getBlockListInfo",
"(",
")",
"{",
"$",
"blockList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getBlockNames",
"(",
")",
"as",
"$",
"blockName",
")",
"{",
"$",
"importBlock",
"=",
"$",
"this",
"->",
"getAggregatedBlock... | Used in theme review view
Caches aggregated blocks as they are heavily used in other functions | [
"Used",
"in",
"theme",
"review",
"view",
"Caches",
"aggregated",
"blocks",
"as",
"they",
"are",
"heavily",
"used",
"in",
"other",
"functions"
] | 8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7 | https://github.com/Web-Feet/coasterframework/blob/8e1dbfd5f240786f8de59d789a8450bbc4cf1ba7/src/Helpers/Admin/Import/BlocksCollection.php#L227-L265 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.