repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
hametuha/wpametu | src/WPametu/API/QueryHighJack.php | QueryHighJack.rewrite_rules_array | public function rewrite_rules_array( array $rules ){
if( !empty($this->rewrites) ){
$rules = array_merge($this->rewrites, $rules);
}
return $rules;
} | php | public function rewrite_rules_array( array $rules ){
if( !empty($this->rewrites) ){
$rules = array_merge($this->rewrites, $rules);
}
return $rules;
} | [
"public",
"function",
"rewrite_rules_array",
"(",
"array",
"$",
"rules",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"rewrites",
")",
")",
"{",
"$",
"rules",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"rewrites",
",",
"$",
"rules",
")... | Register rewrite rules
@param array $rules
@return array | [
"Register",
"rewrite",
"rules"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/QueryHighJack.php#L71-L76 |
hametuha/wpametu | src/WPametu/API/QueryHighJack.php | QueryHighJack.detect_title | final public function detect_title( \WP_Query &$wp_query ){
if( $wp_query->is_main_query() && $this->is_valid_query($wp_query) ){
add_filter('wp_title', [$this, 'wp_title'], 10, 3);
}
} | php | final public function detect_title( \WP_Query &$wp_query ){
if( $wp_query->is_main_query() && $this->is_valid_query($wp_query) ){
add_filter('wp_title', [$this, 'wp_title'], 10, 3);
}
} | [
"final",
"public",
"function",
"detect_title",
"(",
"\\",
"WP_Query",
"&",
"$",
"wp_query",
")",
"{",
"if",
"(",
"$",
"wp_query",
"->",
"is_main_query",
"(",
")",
"&&",
"$",
"this",
"->",
"is_valid_query",
"(",
"$",
"wp_query",
")",
")",
"{",
"add_filter... | Add wp_title filter if required
@param \WP_Query $wp_query | [
"Add",
"wp_title",
"filter",
"if",
"required"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/QueryHighJack.php#L83-L87 |
hametuha/wpametu | src/WPametu/API/QueryHighJack.php | QueryHighJack.add_meta_query | protected function add_meta_query( \WP_Query &$wp_query, array $meta_query ){
$old_query = (array) $wp_query->get('meta_query');
array_push($old_query, $meta_query);
$wp_query->set('meta_query', $old_query);
} | php | protected function add_meta_query( \WP_Query &$wp_query, array $meta_query ){
$old_query = (array) $wp_query->get('meta_query');
array_push($old_query, $meta_query);
$wp_query->set('meta_query', $old_query);
} | [
"protected",
"function",
"add_meta_query",
"(",
"\\",
"WP_Query",
"&",
"$",
"wp_query",
",",
"array",
"$",
"meta_query",
")",
"{",
"$",
"old_query",
"=",
"(",
"array",
")",
"$",
"wp_query",
"->",
"get",
"(",
"'meta_query'",
")",
";",
"array_push",
"(",
"... | Add meta query
@param \WP_Query $wp_query
@param array $meta_query | [
"Add",
"meta",
"query"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/API/QueryHighJack.php#L226-L230 |
technote-space/wordpress-plugin-base | src/classes/models/lib/loader/controller/admin.php | Admin.plugin_action_links | private function plugin_action_links( $links ) {
$link = $this->get_view( 'admin/include/action_links', [
'url' => menu_page_url( $this->get_menu_slug(), false ),
] );
array_unshift( $links, $link );
return $links;
} | php | private function plugin_action_links( $links ) {
$link = $this->get_view( 'admin/include/action_links', [
'url' => menu_page_url( $this->get_menu_slug(), false ),
] );
array_unshift( $links, $link );
return $links;
} | [
"private",
"function",
"plugin_action_links",
"(",
"$",
"links",
")",
"{",
"$",
"link",
"=",
"$",
"this",
"->",
"get_view",
"(",
"'admin/include/action_links'",
",",
"[",
"'url'",
"=>",
"menu_page_url",
"(",
"$",
"this",
"->",
"get_menu_slug",
"(",
")",
",",... | @param $links
@return array | [
"@param",
"$links"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/loader/controller/admin.php#L250-L257 |
technote-space/wordpress-plugin-base | src/classes/models/lib/loader/controller/admin.php | Admin.load | private function load() {
if ( isset( $this->page ) ) {
if ( $this->app->user_can( $this->page->get_capability() ) ) {
$this->get_view( 'admin/include/layout', [
'page' => $this->page,
'slug' => $this->page->get_page_slug(),
], true );
} else {
$this->get_view( 'admin/include/error', [ 'me... | php | private function load() {
if ( isset( $this->page ) ) {
if ( $this->app->user_can( $this->page->get_capability() ) ) {
$this->get_view( 'admin/include/layout', [
'page' => $this->page,
'slug' => $this->page->get_page_slug(),
], true );
} else {
$this->get_view( 'admin/include/error', [ 'me... | [
"private",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"page",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"user_can",
"(",
"$",
"this",
"->",
"page",
"->",
"get_capability",
"(",
")",
")",
")",
... | load | [
"load"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/loader/controller/admin.php#L293-L306 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php | Dwoo_Data.clear | public function clear($name = null)
{
if ($name === null) {
$this->data = array();
} elseif (is_array($name)) {
foreach ($name as $index)
unset($this->data[$index]);
} else {
unset($this->data[$name]);
}
} | php | public function clear($name = null)
{
if ($name === null) {
$this->data = array();
} elseif (is_array($name)) {
foreach ($name as $index)
unset($this->data[$index]);
} else {
unset($this->data[$name]);
}
} | [
"public",
"function",
"clear",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"array",
"(",
")",
";",
"}",
"elseif",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
... | clears a the entire data or only the given key
@param array|string $name clears only one value if you give a name, multiple values if
you give an array of names, or the entire data if left null | [
"clears",
"a",
"the",
"entire",
"data",
"or",
"only",
"the",
"given",
"key"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php#L43-L53 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php | Dwoo_Data.mergeData | public function mergeData(array $data)
{
$args = func_get_args();
while (list(,$v) = each($args)) {
if (is_array($v)) {
$this->data = array_merge($this->data, $v);
}
}
} | php | public function mergeData(array $data)
{
$args = func_get_args();
while (list(,$v) = each($args)) {
if (is_array($v)) {
$this->data = array_merge($this->data, $v);
}
}
} | [
"public",
"function",
"mergeData",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"while",
"(",
"list",
"(",
",",
"$",
"v",
")",
"=",
"each",
"(",
"$",
"args",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"... | merges the given array(s) with the current data with array_merge
@param array $data the array to merge
@param array $data2 $data3 ... other arrays to merge, optional, etc. | [
"merges",
"the",
"given",
"array",
"(",
"s",
")",
"with",
"the",
"current",
"data",
"with",
"array_merge"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php#L71-L79 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php | Dwoo_Data.assign | public function assign($name, $val = null)
{
if (is_array($name)) {
reset($name);
while (list($k,$v) = each($name))
$this->data[$k] = $v;
} else {
$this->data[$name] = $val;
}
} | php | public function assign($name, $val = null)
{
if (is_array($name)) {
reset($name);
while (list($k,$v) = each($name))
$this->data[$k] = $v;
} else {
$this->data[$name] = $val;
}
} | [
"public",
"function",
"assign",
"(",
"$",
"name",
",",
"$",
"val",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"reset",
"(",
"$",
"name",
")",
";",
"while",
"(",
"list",
"(",
"$",
"k",
",",
"$",
"v",
")",
... | assigns a value or an array of values to the data object
@param array|string $name an associative array of multiple (index=>value) or a string
that is the index to use, i.e. a value assigned to "foo" will be
accessible in the template through {$foo}
@param mixed $val the value to assign, or null if $name was an array | [
"assigns",
"a",
"value",
"or",
"an",
"array",
"of",
"values",
"to",
"the",
"data",
"object"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Data.php#L89-L98 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_pgsql.php | ezcQueryExpressionPgsql.subString | public function subString( $value, $from, $len = null )
{
$value = $this->getIdentifier( $value );
if ( $len === null )
{
$len = $this->getIdentifier( $len );
return "substr( {$value}, {$from} )";
}
else
{
return "substr( {$value}, ... | php | public function subString( $value, $from, $len = null )
{
$value = $this->getIdentifier( $value );
if ( $len === null )
{
$len = $this->getIdentifier( $len );
return "substr( {$value}, {$from} )";
}
else
{
return "substr( {$value}, ... | [
"public",
"function",
"subString",
"(",
"$",
"value",
",",
"$",
"from",
",",
"$",
"len",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"value",
")",
";",
"if",
"(",
"$",
"len",
"===",
"null",
")",
"{",
... | Returns part of a string.
Note: Not SQL92, but common functionality.
@param string $value the target $value the string or the string column.
@param int $from extract from this characeter.
@param int $len extract this amount of characters.
@return string sql that extracts part of a string. | [
"Returns",
"part",
"of",
"a",
"string",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_pgsql.php#L83-L95 |
kusanagi/katana-sdk-php7 | src/Api/Factory/ServiceApiFactory.php | ServiceApiFactory.build | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
) {
$context = new ZMQContext();
$socket = new ZMQSocket($context, ZMQ::SOCKET_REQ);
$socket->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);
if ($input->getMapping() === 'compact') {
... | php | public function build(
$action,
array $data,
CliInput $input,
Mapping $mapping
) {
$context = new ZMQContext();
$socket = new ZMQSocket($context, ZMQ::SOCKET_REQ);
$socket->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);
if ($input->getMapping() === 'compact') {
... | [
"public",
"function",
"build",
"(",
"$",
"action",
",",
"array",
"$",
"data",
",",
"CliInput",
"$",
"input",
",",
"Mapping",
"$",
"mapping",
")",
"{",
"$",
"context",
"=",
"new",
"ZMQContext",
"(",
")",
";",
"$",
"socket",
"=",
"new",
"ZMQSocket",
"(... | Build an Action Api class instance
@param string $action
@param array $data
@param CliInput $input
@param Mapping $mapping
@return ActionApi | [
"Build",
"an",
"Action",
"Api",
"class",
"instance"
] | train | https://github.com/kusanagi/katana-sdk-php7/blob/91e7860a1852c3ce79a7034f8c36f41840e69e1f/src/Api/Factory/ServiceApiFactory.php#L47-L90 |
artscorestudio/document-bundle | Repository/PostRepository.php | PostRepository.getLastVersion | public function getLastVersion($post_id)
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original=:post_id')
->orderBy('p.createdAt', 'DESC')
->setParameter(':post_id', $post_id);
$result = $qb->getQuery()->setMaxResults(1)->getResult(Query::HYDRATE_OBJECT);
if ( is_null($result) ) {
$q... | php | public function getLastVersion($post_id)
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original=:post_id')
->orderBy('p.createdAt', 'DESC')
->setParameter(':post_id', $post_id);
$result = $qb->getQuery()->setMaxResults(1)->getResult(Query::HYDRATE_OBJECT);
if ( is_null($result) ) {
$q... | [
"public",
"function",
"getLastVersion",
"(",
"$",
"post_id",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'p'",
")",
";",
"$",
"qb",
"->",
"where",
"(",
"'p.original=:post_id'",
")",
"->",
"orderBy",
"(",
"'p.createdAt'",
",",
... | Get last version for a post
@param integer $id AsfDocumentBundle:Page ID | [
"Get",
"last",
"version",
"for",
"a",
"post"
] | train | https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Repository/PostRepository.php#L29-L47 |
artscorestudio/document-bundle | Repository/PostRepository.php | PostRepository.getAllLastVersion | public function getAllLastVersion()
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original IS NULL AND p.state=:state')
->setParameter(':state', DocumentModel::STATE_PUBLISHED);
$result = $qb->getQuery()->getResult();
$return = array();
foreach($result as $original) {
$return[] = $this->getL... | php | public function getAllLastVersion()
{
$qb = $this->createQueryBuilder('p');
$qb->where('p.original IS NULL AND p.state=:state')
->setParameter(':state', DocumentModel::STATE_PUBLISHED);
$result = $qb->getQuery()->getResult();
$return = array();
foreach($result as $original) {
$return[] = $this->getL... | [
"public",
"function",
"getAllLastVersion",
"(",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'p'",
")",
";",
"$",
"qb",
"->",
"where",
"(",
"'p.original IS NULL AND p.state=:state'",
")",
"->",
"setParameter",
"(",
"':state'",
",",
... | Get all posts in their last version | [
"Get",
"all",
"posts",
"in",
"their",
"last",
"version"
] | train | https://github.com/artscorestudio/document-bundle/blob/3aceab0f75de8f7dd0fad0d0db83d7940bf565c8/Repository/PostRepository.php#L52-L64 |
WasabiLib/Mail | src/Mail.php | Mail.send | public function send() {
if($this->message->getBody()==null){
throw new InvalidArgumentException(sprintf(
'Provided body is not valid. It should be one of "%s". %s provided',
implode('", "', ['string', 'Zend\Mime\Part', 'Zend\Mime\Message','Zend\View\Model\ViewModel']... | php | public function send() {
if($this->message->getBody()==null){
throw new InvalidArgumentException(sprintf(
'Provided body is not valid. It should be one of "%s". %s provided',
implode('", "', ['string', 'Zend\Mime\Part', 'Zend\Mime\Message','Zend\View\Model\ViewModel']... | [
"public",
"function",
"send",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"message",
"->",
"getBody",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Provided body is not valid. It should be one of \"%s\". %s p... | Sends the email. | [
"Sends",
"the",
"email",
"."
] | train | https://github.com/WasabiLib/Mail/blob/5e6a1de480d500e380e5ecfbf633d40f87e9c8e9/src/Mail.php#L208-L220 |
WasabiLib/Mail | src/Mail.php | Mail.attachFiles | private function attachFiles(){
if (count($this->attachments) === 0) {
return;
}
// Get old message parts
$mimeMessage = $this->message->getBody();
if (is_string($mimeMessage)) {
$originalBodyPart = new Mime\Part($mimeMessage);
$originalBodyPar... | php | private function attachFiles(){
if (count($this->attachments) === 0) {
return;
}
// Get old message parts
$mimeMessage = $this->message->getBody();
if (is_string($mimeMessage)) {
$originalBodyPart = new Mime\Part($mimeMessage);
$originalBodyPar... | [
"private",
"function",
"attachFiles",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"attachments",
")",
"===",
"0",
")",
"{",
"return",
";",
"}",
"// Get old message parts",
"$",
"mimeMessage",
"=",
"$",
"this",
"->",
"message",
"->",
"getBo... | Attaches files to the message if any | [
"Attaches",
"files",
"to",
"the",
"message",
"if",
"any"
] | train | https://github.com/WasabiLib/Mail/blob/5e6a1de480d500e380e5ecfbf633d40f87e9c8e9/src/Mail.php#L234-L270 |
barrelstrength/craftnet-php | src/CraftnetClient.php | CraftnetClient.post | public function post($endpoint, array $options = [])
{
$jsonValues = [];
if (isset($options['json'])) {
$jsonValues = $options['json'];
}
return $this->httpClient->request('POST', 'https://api.craftcms.com/v1/'.$endpoint, [
'auth' => $this->setAuth(),
... | php | public function post($endpoint, array $options = [])
{
$jsonValues = [];
if (isset($options['json'])) {
$jsonValues = $options['json'];
}
return $this->httpClient->request('POST', 'https://api.craftcms.com/v1/'.$endpoint, [
'auth' => $this->setAuth(),
... | [
"public",
"function",
"post",
"(",
"$",
"endpoint",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"jsonValues",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'json'",
"]",
")",
")",
"{",
"$",
"jsonValues",
"=",
... | Sends a POST request to the Craftnet API
@param $endpoint
@param array $options
@return mixed|\Psr\Http\Message\ResponseInterface
@throws \GuzzleHttp\Exception\GuzzleException | [
"Sends",
"a",
"POST",
"request",
"to",
"the",
"Craftnet",
"API"
] | train | https://github.com/barrelstrength/craftnet-php/blob/90c9767b6bef6078bc062b3bfcdde38b24c843fc/src/CraftnetClient.php#L98-L110 |
technote-space/wordpress-plugin-base | src/classes/models/lib/option.php | Option.reload_options | public function reload_options() {
if ( $this->_suspend_reload ) {
return;
}
$this->_options = wp_parse_args(
$this->get_option(), []
);
$this->unescape_options();
} | php | public function reload_options() {
if ( $this->_suspend_reload ) {
return;
}
$this->_options = wp_parse_args(
$this->get_option(), []
);
$this->unescape_options();
} | [
"public",
"function",
"reload_options",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_suspend_reload",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"_options",
"=",
"wp_parse_args",
"(",
"$",
"this",
"->",
"get_option",
"(",
")",
",",
"[",
"]",
... | reload options | [
"reload",
"options"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/option.php#L56-L64 |
technote-space/wordpress-plugin-base | src/classes/models/lib/option.php | Option.unescape_options | private function unescape_options() {
foreach ( $this->_options as $key => $value ) {
if ( is_string( $value ) ) {
$this->_options[ $key ] = stripslashes( htmlspecialchars_decode( $this->_options[ $key ] ) );
}
}
} | php | private function unescape_options() {
foreach ( $this->_options as $key => $value ) {
if ( is_string( $value ) ) {
$this->_options[ $key ] = stripslashes( htmlspecialchars_decode( $this->_options[ $key ] ) );
}
}
} | [
"private",
"function",
"unescape_options",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"_options",
"[",
"... | unescape options | [
"unescape",
"options"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/option.php#L90-L96 |
technote-space/wordpress-plugin-base | src/classes/models/lib/option.php | Option.get | public function get( $key, $default = '' ) {
if ( array_key_exists( $key, $this->_options ) ) {
return $this->apply_filters( 'get_option', $this->_options[ $key ], $key, $default );
}
return $this->apply_filters( 'get_option', $default, $key, $default );
} | php | public function get( $key, $default = '' ) {
if ( array_key_exists( $key, $this->_options ) ) {
return $this->apply_filters( 'get_option', $this->_options[ $key ], $key, $default );
}
return $this->apply_filters( 'get_option', $default, $key, $default );
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"''",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"_options",
")",
")",
"{",
"return",
"$",
"this",
"->",
"apply_filters",
"(",
"'get_option... | @param string $key
@param string $default
@return mixed | [
"@param",
"string",
"$key",
"@param",
"string",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/option.php#L104-L110 |
technote-space/wordpress-plugin-base | src/classes/models/lib/option.php | Option.set | public function set( $key, $value ) {
$this->reload_options();
$suspend_reload = $this->_suspend_reload;
$prev = isset( $this->_options[ $key ] ) ? $this->_options[ $key ] : null;
$this->_options[ $key ] = $value;
if ( $prev !== $value ) {
$this->_suspend_reload = true;
$this->... | php | public function set( $key, $value ) {
$this->reload_options();
$suspend_reload = $this->_suspend_reload;
$prev = isset( $this->_options[ $key ] ) ? $this->_options[ $key ] : null;
$this->_options[ $key ] = $value;
if ( $prev !== $value ) {
$this->_suspend_reload = true;
$this->... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"reload_options",
"(",
")",
";",
"$",
"suspend_reload",
"=",
"$",
"this",
"->",
"_suspend_reload",
";",
"$",
"prev",
"=",
"isset",
"(",
"$",
"this",
"->",
... | @param string $key
@param mixed $value
@return bool | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$value"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/option.php#L118-L130 |
technote-space/wordpress-plugin-base | src/classes/models/lib/option.php | Option.delete | public function delete( $key ) {
$this->reload_options();
$suspend_reload = $this->_suspend_reload;
if ( array_key_exists( $key, $this->_options ) ) {
$prev = $this->_options[ $key ];
unset( $this->_options[ $key ] );
$this->_suspend_reload = true;
$this->do_action( 'deleted_option', $key, $prev );
... | php | public function delete( $key ) {
$this->reload_options();
$suspend_reload = $this->_suspend_reload;
if ( array_key_exists( $key, $this->_options ) ) {
$prev = $this->_options[ $key ];
unset( $this->_options[ $key ] );
$this->_suspend_reload = true;
$this->do_action( 'deleted_option', $key, $prev );
... | [
"public",
"function",
"delete",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"reload_options",
"(",
")",
";",
"$",
"suspend_reload",
"=",
"$",
"this",
"->",
"_suspend_reload",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->"... | @param string $key
@return bool | [
"@param",
"string",
"$key"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/option.php#L137-L151 |
technote-space/wordpress-plugin-base | src/classes/models/lib/option.php | Option.set_post_value | public function set_post_value( $key, $default = null ) {
if ( ! isset( $_POST[ $key ] ) && ! isset( $default ) ) {
return false;
}
$result = $this->set( $key, isset( $_POST[ $key ] ) ? $_POST[ $key ] : $default );
$this->delete_hook_cache( preg_replace( '/^' . preg_quote( $this->get_filter_prefix(), '/' ) .... | php | public function set_post_value( $key, $default = null ) {
if ( ! isset( $_POST[ $key ] ) && ! isset( $default ) ) {
return false;
}
$result = $this->set( $key, isset( $_POST[ $key ] ) ? $_POST[ $key ] : $default );
$this->delete_hook_cache( preg_replace( '/^' . preg_quote( $this->get_filter_prefix(), '/' ) .... | [
"public",
"function",
"set_post_value",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"_POST",
"[",
"$",
"key",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"default",
")",
")",
"{",
"return",
"false",... | @param string $key
@param mixed $default
@return bool | [
"@param",
"string",
"$key",
"@param",
"mixed",
"$default"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/models/lib/option.php#L159-L167 |
petrica/php-statsd-system | Config/ConfigLoader.php | ConfigLoader.load | public function load()
{
if (file_exists($this->filepath) && ($contents = file_get_contents($this->filepath))) {
$yaml = new Parser();
$config = $yaml->parse($contents);
if (null === $config) {
$config = array();
}
$processor = ne... | php | public function load()
{
if (file_exists($this->filepath) && ($contents = file_get_contents($this->filepath))) {
$yaml = new Parser();
$config = $yaml->parse($contents);
if (null === $config) {
$config = array();
}
$processor = ne... | [
"public",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"filepath",
")",
"&&",
"(",
"$",
"contents",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"filepath",
")",
")",
")",
"{",
"$",
"yaml",
"=",
"new",
"... | Process configuration and make sure the configuration format is as expected
@return array | [
"Process",
"configuration",
"and",
"make",
"sure",
"the",
"configuration",
"format",
"is",
"as",
"expected"
] | train | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Config/ConfigLoader.php#L36-L66 |
oroinc/OroLayoutComponent | Util/BlockUtils.php | BlockUtils.registerPlugin | public static function registerPlugin(BlockView $view, $pluginName)
{
$optionsArray = $view->vars['block_prefixes'];
array_splice(
$optionsArray,
-1,
1,
[$pluginName, end($optionsArray)]
);
$view->vars['block_prefixes'] = $optionsArray;... | php | public static function registerPlugin(BlockView $view, $pluginName)
{
$optionsArray = $view->vars['block_prefixes'];
array_splice(
$optionsArray,
-1,
1,
[$pluginName, end($optionsArray)]
);
$view->vars['block_prefixes'] = $optionsArray;... | [
"public",
"static",
"function",
"registerPlugin",
"(",
"BlockView",
"$",
"view",
",",
"$",
"pluginName",
")",
"{",
"$",
"optionsArray",
"=",
"$",
"view",
"->",
"vars",
"[",
"'block_prefixes'",
"]",
";",
"array_splice",
"(",
"$",
"optionsArray",
",",
"-",
"... | Registers the plugin for the block type.
You can use this method to add the additional block prefix that allow you
to create an additional template for existing block type.
IMPORTANT: This method should be called in finishView of your block type extension
because the 'block_prefixes' array is not filled in buildView y... | [
"Registers",
"the",
"plugin",
"for",
"the",
"block",
"type",
".",
"You",
"can",
"use",
"this",
"method",
"to",
"add",
"the",
"additional",
"block",
"prefix",
"that",
"allow",
"you",
"to",
"create",
"an",
"additional",
"template",
"for",
"existing",
"block",
... | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Util/BlockUtils.php#L22-L32 |
oroinc/OroLayoutComponent | Util/BlockUtils.php | BlockUtils.normalizeTransValue | public static function normalizeTransValue($text, $parameters = null)
{
if (is_string($text) && !empty($text)) {
$text = ['label' => $text];
}
if (!empty($parameters) && is_array($text) && !isset($text['parameters'])) {
$text['parameters'] = $parameters;
}
... | php | public static function normalizeTransValue($text, $parameters = null)
{
if (is_string($text) && !empty($text)) {
$text = ['label' => $text];
}
if (!empty($parameters) && is_array($text) && !isset($text['parameters'])) {
$text['parameters'] = $parameters;
}
... | [
"public",
"static",
"function",
"normalizeTransValue",
"(",
"$",
"text",
",",
"$",
"parameters",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"text",
")",
"&&",
"!",
"empty",
"(",
"$",
"text",
")",
")",
"{",
"$",
"text",
"=",
"[",
"'lab... | Normalizes the given value to the format that can be translated by a renderer.
@param string|array $text The text to be translated
@param array|null $parameters The parameters
@return array | [
"Normalizes",
"the",
"given",
"value",
"to",
"the",
"format",
"that",
"can",
"be",
"translated",
"by",
"a",
"renderer",
"."
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Util/BlockUtils.php#L42-L52 |
oroinc/OroLayoutComponent | Util/BlockUtils.php | BlockUtils.processUrl | public static function processUrl(BlockView $view, Options $options, $required = false, $prefix = null)
{
$pathName = null !== $prefix ? $prefix . '_path' : 'path';
$routeName = null !== $prefix ? $prefix . '_route_name' : 'route_name';
if ($options->isExistsAndNotEmpty($pathName)) {
... | php | public static function processUrl(BlockView $view, Options $options, $required = false, $prefix = null)
{
$pathName = null !== $prefix ? $prefix . '_path' : 'path';
$routeName = null !== $prefix ? $prefix . '_route_name' : 'route_name';
if ($options->isExistsAndNotEmpty($pathName)) {
... | [
"public",
"static",
"function",
"processUrl",
"(",
"BlockView",
"$",
"view",
",",
"Options",
"$",
"options",
",",
"$",
"required",
"=",
"false",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"$",
"pathName",
"=",
"null",
"!==",
"$",
"prefix",
"?",
"$",
... | Gets the url related options and pass them to the block view.
@param BlockView $view The block view
@param Options $options The block options
@param boolean $required Specifies whether the url related options are mandatory
@param string|null $prefix The prefix for the url related options
@SuppressWar... | [
"Gets",
"the",
"url",
"related",
"options",
"and",
"pass",
"them",
"to",
"the",
"block",
"view",
"."
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Util/BlockUtils.php#L64-L82 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.build | public function build(array $config)
{
$config = $this->prepareConfig($config);
return new Grid(
$this->buildResource($config),
$this->buildColumns($config),
$this->buildFilters($config),
$this->buildSorts($config),
$this->buildGlobalActio... | php | public function build(array $config)
{
$config = $this->prepareConfig($config);
return new Grid(
$this->buildResource($config),
$this->buildColumns($config),
$this->buildFilters($config),
$this->buildSorts($config),
$this->buildGlobalActio... | [
"public",
"function",
"build",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"config",
")",
";",
"return",
"new",
"Grid",
"(",
"$",
"this",
"->",
"buildResource",
"(",
"$",
"config",
")",
","... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L77-L92 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildColumns | protected function buildColumns(array $config)
{
$columns = [];
foreach (isset($config['columns']) ? $config['columns'] : [] as $name => $column) {
$column = $this->buildColumn(array_merge(['name' => $name], $column), $config);
$columns[$column->getName()] = $column;
... | php | protected function buildColumns(array $config)
{
$columns = [];
foreach (isset($config['columns']) ? $config['columns'] : [] as $name => $column) {
$column = $this->buildColumn(array_merge(['name' => $name], $column), $config);
$columns[$column->getName()] = $column;
... | [
"protected",
"function",
"buildColumns",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"columns",
"=",
"[",
"]",
";",
"foreach",
"(",
"isset",
"(",
"$",
"config",
"[",
"'columns'",
"]",
")",
"?",
"$",
"config",
"[",
"'columns'",
"]",
":",
"[",
"]",
"... | @param mixed[] $config
@return ColumnInterface[] | [
"@param",
"mixed",
"[]",
"$config"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L113-L123 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildColumn | protected function buildColumn(array $config, array $parentConfig)
{
return $this->columnBuilder->build($this->prepareConfig($config, $parentConfig));
} | php | protected function buildColumn(array $config, array $parentConfig)
{
return $this->columnBuilder->build($this->prepareConfig($config, $parentConfig));
} | [
"protected",
"function",
"buildColumn",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"parentConfig",
")",
"{",
"return",
"$",
"this",
"->",
"columnBuilder",
"->",
"build",
"(",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"config",
",",
"$",
"parentCon... | @param mixed[] $config
@param mixed[] $parentConfig
@return ColumnInterface | [
"@param",
"mixed",
"[]",
"$config",
"@param",
"mixed",
"[]",
"$parentConfig"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L131-L134 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildFilters | protected function buildFilters(array $config)
{
$filters = [];
foreach ((isset($config['filters']) ? $config['filters'] : []) as $name => $filter) {
$filter = $this->buildFilter(array_merge(['name' => $name], $filter), $config);
$filters[$filter->getName()] = $filter;
... | php | protected function buildFilters(array $config)
{
$filters = [];
foreach ((isset($config['filters']) ? $config['filters'] : []) as $name => $filter) {
$filter = $this->buildFilter(array_merge(['name' => $name], $filter), $config);
$filters[$filter->getName()] = $filter;
... | [
"protected",
"function",
"buildFilters",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"isset",
"(",
"$",
"config",
"[",
"'filters'",
"]",
")",
"?",
"$",
"config",
"[",
"'filters'",
"]",
":",
"[",
"... | @param mixed[] $config
@return FilterInterface[] | [
"@param",
"mixed",
"[]",
"$config"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L141-L151 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildFilter | protected function buildFilter(array $config, array $parentConfig)
{
return $this->filterBuilder->build($this->prepareConfig($config, $parentConfig));
} | php | protected function buildFilter(array $config, array $parentConfig)
{
return $this->filterBuilder->build($this->prepareConfig($config, $parentConfig));
} | [
"protected",
"function",
"buildFilter",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"parentConfig",
")",
"{",
"return",
"$",
"this",
"->",
"filterBuilder",
"->",
"build",
"(",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"config",
",",
"$",
"parentCon... | @param mixed[] $config
@param mixed[] $parentConfig
@return FilterInterface | [
"@param",
"mixed",
"[]",
"$config",
"@param",
"mixed",
"[]",
"$parentConfig"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L159-L162 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildSorts | protected function buildSorts(array $config)
{
$sorts = [];
foreach ((isset($config['sorts']) ? $config['sorts'] : []) as $name => $sort) {
$sort = $this->buildSort(array_merge(['name' => $name], $sort), $config);
$sorts[$sort->getName()] = $sort;
}
return $... | php | protected function buildSorts(array $config)
{
$sorts = [];
foreach ((isset($config['sorts']) ? $config['sorts'] : []) as $name => $sort) {
$sort = $this->buildSort(array_merge(['name' => $name], $sort), $config);
$sorts[$sort->getName()] = $sort;
}
return $... | [
"protected",
"function",
"buildSorts",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"sorts",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"isset",
"(",
"$",
"config",
"[",
"'sorts'",
"]",
")",
"?",
"$",
"config",
"[",
"'sorts'",
"]",
":",
"[",
"]",
")... | @param mixed[] $config
@return SortInterface[] | [
"@param",
"mixed",
"[]",
"$config"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L169-L179 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildSort | protected function buildSort(array $config, array $parentConfig)
{
return $this->sortBuilder->build($this->prepareConfig($config, $parentConfig));
} | php | protected function buildSort(array $config, array $parentConfig)
{
return $this->sortBuilder->build($this->prepareConfig($config, $parentConfig));
} | [
"protected",
"function",
"buildSort",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"parentConfig",
")",
"{",
"return",
"$",
"this",
"->",
"sortBuilder",
"->",
"build",
"(",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"config",
",",
"$",
"parentConfig"... | @param mixed[] $config
@param mixed[] $parentConfig
@return SortInterface | [
"@param",
"mixed",
"[]",
"$config",
"@param",
"mixed",
"[]",
"$parentConfig"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L187-L190 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildGlobalActions | protected function buildGlobalActions(array $config)
{
$globalActions = [];
foreach ((isset($config['global_actions']) ? $config['global_actions'] : []) as $name => $action) {
$action = $this->buildGlobalAction(array_merge(['name' => $name], $action), $config);
$globalAction... | php | protected function buildGlobalActions(array $config)
{
$globalActions = [];
foreach ((isset($config['global_actions']) ? $config['global_actions'] : []) as $name => $action) {
$action = $this->buildGlobalAction(array_merge(['name' => $name], $action), $config);
$globalAction... | [
"protected",
"function",
"buildGlobalActions",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"globalActions",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"isset",
"(",
"$",
"config",
"[",
"'global_actions'",
"]",
")",
"?",
"$",
"config",
"[",
"'global_actions'"... | @param mixed[] $config
@return ActionInterface[] | [
"@param",
"mixed",
"[]",
"$config"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L197-L207 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildGlobalAction | protected function buildGlobalAction(array $config, array $parentConfig)
{
return $this->actionBuilder->build($this->prepareConfig($config, $parentConfig));
} | php | protected function buildGlobalAction(array $config, array $parentConfig)
{
return $this->actionBuilder->build($this->prepareConfig($config, $parentConfig));
} | [
"protected",
"function",
"buildGlobalAction",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"parentConfig",
")",
"{",
"return",
"$",
"this",
"->",
"actionBuilder",
"->",
"build",
"(",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"config",
",",
"$",
"par... | @param mixed[] $config
@param mixed[] $parentConfig
@return ActionInterface | [
"@param",
"mixed",
"[]",
"$config",
"@param",
"mixed",
"[]",
"$parentConfig"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L215-L218 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildColumnActions | protected function buildColumnActions(array $config)
{
$columnActions = [];
foreach ((isset($config['column_actions']) ? $config['column_actions'] : []) as $name => $action) {
$action = $this->buildColumnAction(array_merge(['name' => $name], $action), $config);
$columnAction... | php | protected function buildColumnActions(array $config)
{
$columnActions = [];
foreach ((isset($config['column_actions']) ? $config['column_actions'] : []) as $name => $action) {
$action = $this->buildColumnAction(array_merge(['name' => $name], $action), $config);
$columnAction... | [
"protected",
"function",
"buildColumnActions",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"columnActions",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"isset",
"(",
"$",
"config",
"[",
"'column_actions'",
"]",
")",
"?",
"$",
"config",
"[",
"'column_actions'"... | @param mixed[] $config
@return ActionInterface[] | [
"@param",
"mixed",
"[]",
"$config"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L225-L235 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildColumnAction | protected function buildColumnAction(array $config, array $parentConfig)
{
return $this->actionBuilder->build($this->prepareConfig($config, $parentConfig));
} | php | protected function buildColumnAction(array $config, array $parentConfig)
{
return $this->actionBuilder->build($this->prepareConfig($config, $parentConfig));
} | [
"protected",
"function",
"buildColumnAction",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"parentConfig",
")",
"{",
"return",
"$",
"this",
"->",
"actionBuilder",
"->",
"build",
"(",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"config",
",",
"$",
"par... | @param mixed[] $config
@param mixed[] $parentConfig
@return ActionInterface | [
"@param",
"mixed",
"[]",
"$config",
"@param",
"mixed",
"[]",
"$parentConfig"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L243-L246 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildBatches | protected function buildBatches(array $config)
{
$batches = [];
foreach ((isset($config['batches']) ? $config['batches'] : []) as $name => $batch) {
$batch = $this->buildBatch(array_merge(['name' => $name], $batch), $config);
$batches[$batch->getName()] = $batch;
}
... | php | protected function buildBatches(array $config)
{
$batches = [];
foreach ((isset($config['batches']) ? $config['batches'] : []) as $name => $batch) {
$batch = $this->buildBatch(array_merge(['name' => $name], $batch), $config);
$batches[$batch->getName()] = $batch;
}
... | [
"protected",
"function",
"buildBatches",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"batches",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"isset",
"(",
"$",
"config",
"[",
"'batches'",
"]",
")",
"?",
"$",
"config",
"[",
"'batches'",
"]",
":",
"[",
"... | @param mixed[] $config
@return BatchInterface[] | [
"@param",
"mixed",
"[]",
"$config"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L253-L263 |
php-lug/lug | src/Component/Grid/Model/Builder/GridBuilder.php | GridBuilder.buildBatch | protected function buildBatch(array $config, array $parentConfig)
{
return $this->batchBuilder->build($this->prepareConfig($config, $parentConfig));
} | php | protected function buildBatch(array $config, array $parentConfig)
{
return $this->batchBuilder->build($this->prepareConfig($config, $parentConfig));
} | [
"protected",
"function",
"buildBatch",
"(",
"array",
"$",
"config",
",",
"array",
"$",
"parentConfig",
")",
"{",
"return",
"$",
"this",
"->",
"batchBuilder",
"->",
"build",
"(",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"config",
",",
"$",
"parentConfi... | @param mixed[] $config
@param mixed[] $parentConfig
@return BatchInterface | [
"@param",
"mixed",
"[]",
"$config",
"@param",
"mixed",
"[]",
"$parentConfig"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Model/Builder/GridBuilder.php#L271-L274 |
songshenzong/log | src/Bridge/SwiftMailer/SwiftMailCollector.php | SwiftMailCollector.formatTo | protected function formatTo($to)
{
if (!$to) {
return '';
}
$f = [];
foreach ($to as $k => $v) {
$f[] = (empty($v) ? '' : "$v ") . "<$k>";
}
return implode(', ', $f);
} | php | protected function formatTo($to)
{
if (!$to) {
return '';
}
$f = [];
foreach ($to as $k => $v) {
$f[] = (empty($v) ? '' : "$v ") . "<$k>";
}
return implode(', ', $f);
} | [
"protected",
"function",
"formatTo",
"(",
"$",
"to",
")",
"{",
"if",
"(",
"!",
"$",
"to",
")",
"{",
"return",
"''",
";",
"}",
"$",
"f",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"to",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"f",
"["... | @param $to
@return string | [
"@param",
"$to"
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/Bridge/SwiftMailer/SwiftMailCollector.php#L64-L75 |
simialbi/yii2-simialbi-base | widgets/InputWidget.php | InputWidget.init | public function init() {
if (!isset($this->options['id'])) {
$this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
}
parent::init();
} | php | public function init() {
if (!isset($this->options['id'])) {
$this->options['id'] = $this->hasModel() ? Html::getInputId($this->model, $this->attribute) : $this->getId();
}
parent::init();
} | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"'id'",
"]",
"=",
"$",
"this",
"->",
"hasModel",
"(",
")",
"?",
"Html",... | {@inheritdoc}
@throws \yii\base\InvalidConfigException | [
"{"
] | train | https://github.com/simialbi/yii2-simialbi-base/blob/f68d3ee64f52c6dfb0aa31ffc14f5ced5aabdbb7/widgets/InputWidget.php#L42-L47 |
simialbi/yii2-simialbi-base | widgets/InputWidget.php | InputWidget.registerPlugin | protected function registerPlugin($pluginName = null) {
$view = $this->view;
$className = static::className();
$assetClassName = $className."Asset";
if (empty($pluginName)) {
$pluginName = strtolower(StringHelper::basename($className));
}
if (class_exists($assetClassName)) {
/**
* @var \simi... | php | protected function registerPlugin($pluginName = null) {
$view = $this->view;
$className = static::className();
$assetClassName = $className."Asset";
if (empty($pluginName)) {
$pluginName = strtolower(StringHelper::basename($className));
}
if (class_exists($assetClassName)) {
/**
* @var \simi... | [
"protected",
"function",
"registerPlugin",
"(",
"$",
"pluginName",
"=",
"null",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"view",
";",
"$",
"className",
"=",
"static",
"::",
"className",
"(",
")",
";",
"$",
"assetClassName",
"=",
"$",
"className",
... | Registers a specific plugin and the related events
@param string $pluginName optional plugin name | [
"Registers",
"a",
"specific",
"plugin",
"and",
"the",
"related",
"events"
] | train | https://github.com/simialbi/yii2-simialbi-base/blob/f68d3ee64f52c6dfb0aa31ffc14f5ced5aabdbb7/widgets/InputWidget.php#L54-L78 |
simialbi/yii2-simialbi-base | widgets/InputWidget.php | InputWidget.registerClientEvents | protected function registerClientEvents() {
if (!empty($this->clientEvents)) {
$id = $this->options['id'];
$js = [];
foreach ($this->clientEvents as $event => $handler) {
$js[] = "jQuery('#$id').on('$event', $handler);";
}
$this->view->registerJs(implode("\n", $js));
}
} | php | protected function registerClientEvents() {
if (!empty($this->clientEvents)) {
$id = $this->options['id'];
$js = [];
foreach ($this->clientEvents as $event => $handler) {
$js[] = "jQuery('#$id').on('$event', $handler);";
}
$this->view->registerJs(implode("\n", $js));
}
} | [
"protected",
"function",
"registerClientEvents",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"clientEvents",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"options",
"[",
"'id'",
"]",
";",
"$",
"js",
"=",
"[",
"]",
";",
"f... | Registers JS event handlers that are listed in [[clientEvents]]. | [
"Registers",
"JS",
"event",
"handlers",
"that",
"are",
"listed",
"in",
"[[",
"clientEvents",
"]]",
"."
] | train | https://github.com/simialbi/yii2-simialbi-base/blob/f68d3ee64f52c6dfb0aa31ffc14f5ced5aabdbb7/widgets/InputWidget.php#L83-L92 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.removePreProcessor | public function removePreProcessor($callback)
{
if (($index = array_search($callback, $this->processors['pre'], true)) !== false) {
unset($this->processors['pre'][$index]);
} elseif (($index = array_search('Dwoo_Processor_'.str_replace('Dwoo_Processor_', '', $callback), $this->processors['pre'], true)) !== fals... | php | public function removePreProcessor($callback)
{
if (($index = array_search($callback, $this->processors['pre'], true)) !== false) {
unset($this->processors['pre'][$index]);
} elseif (($index = array_search('Dwoo_Processor_'.str_replace('Dwoo_Processor_', '', $callback), $this->processors['pre'], true)) !== fals... | [
"public",
"function",
"removePreProcessor",
"(",
"$",
"callback",
")",
"{",
"if",
"(",
"(",
"$",
"index",
"=",
"array_search",
"(",
"$",
"callback",
",",
"$",
"this",
"->",
"processors",
"[",
"'pre'",
"]",
",",
"true",
")",
")",
"!==",
"false",
")",
... | removes a preprocessor from the compiler
@param mixed $callback either a valid callback to the preprocessor or a simple name if it was autoloaded | [
"removes",
"a",
"preprocessor",
"from",
"the",
"compiler"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L380-L395 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.addPostProcessor | public function addPostProcessor($callback, $autoload = false)
{
if ($autoload) {
$name = str_replace('Dwoo_Processor_', '', $callback);
$class = 'Dwoo_Processor_'.$name;
if (class_exists($class, false)) {
$callback = array(new $class($this), 'process');
} elseif (function_exists($class)) {
$cal... | php | public function addPostProcessor($callback, $autoload = false)
{
if ($autoload) {
$name = str_replace('Dwoo_Processor_', '', $callback);
$class = 'Dwoo_Processor_'.$name;
if (class_exists($class, false)) {
$callback = array(new $class($this), 'process');
} elseif (function_exists($class)) {
$cal... | [
"public",
"function",
"addPostProcessor",
"(",
"$",
"callback",
",",
"$",
"autoload",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"autoload",
")",
"{",
"$",
"name",
"=",
"str_replace",
"(",
"'Dwoo_Processor_'",
",",
"''",
",",
"$",
"callback",
")",
";",
"$... | adds a postprocessor to the compiler, it will be called
before the template is compiled
@param mixed $callback either a valid callback to the postprocessor or a simple name if the autoload is set to true
@param bool $autoload if set to true, the postprocessor is auto-loaded from one of the plugin directories, else you... | [
"adds",
"a",
"postprocessor",
"to",
"the",
"compiler",
"it",
"will",
"be",
"called",
"before",
"the",
"template",
"is",
"compiled"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L404-L422 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.loadProcessor | protected function loadProcessor($class, $name)
{
if (!class_exists($class, false) && !function_exists($class)) {
try {
$this->dwoo->getLoader()->loadPlugin($name);
} catch (Dwoo_Exception $e) {
throw new Dwoo_Exception('Processor '.$name.' could not be found in your plugin directories, please ensure i... | php | protected function loadProcessor($class, $name)
{
if (!class_exists($class, false) && !function_exists($class)) {
try {
$this->dwoo->getLoader()->loadPlugin($name);
} catch (Dwoo_Exception $e) {
throw new Dwoo_Exception('Processor '.$name.' could not be found in your plugin directories, please ensure i... | [
"protected",
"function",
"loadProcessor",
"(",
"$",
"class",
",",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
",",
"false",
")",
"&&",
"!",
"function_exists",
"(",
"$",
"class",
")",
")",
"{",
"try",
"{",
"$",
"this",
... | internal function to autoload processors at runtime if required
@param string $class the class/function name
@param string $name the plugin name (without Dwoo_Plugin_ prefix) | [
"internal",
"function",
"to",
"autoload",
"processors",
"at",
"runtime",
"if",
"required"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L452-L471 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.compile | public function compile(Dwoo $dwoo, Dwoo_ITemplate $template)
{
// init vars
$tpl = $template->getSource();
$ptr = 0;
$this->dwoo = $dwoo;
$this->template = $template;
$this->templateSource =& $tpl;
$this->pointer =& $ptr;
while (true) {
// if pointer is at the beginning, reset everything, that all... | php | public function compile(Dwoo $dwoo, Dwoo_ITemplate $template)
{
// init vars
$tpl = $template->getSource();
$ptr = 0;
$this->dwoo = $dwoo;
$this->template = $template;
$this->templateSource =& $tpl;
$this->pointer =& $ptr;
while (true) {
// if pointer is at the beginning, reset everything, that all... | [
"public",
"function",
"compile",
"(",
"Dwoo",
"$",
"dwoo",
",",
"Dwoo_ITemplate",
"$",
"template",
")",
"{",
"// init vars",
"$",
"tpl",
"=",
"$",
"template",
"->",
"getSource",
"(",
")",
";",
"$",
"ptr",
"=",
"0",
";",
"$",
"this",
"->",
"dwoo",
"="... | compiles the provided string down to php code
@param string $tpl the template to compile
@return string a compiled php string | [
"compiles",
"the",
"provided",
"string",
"down",
"to",
"php",
"code"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L682-L909 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.resolveSubTemplateDependencies | protected function resolveSubTemplateDependencies($function)
{
$body = $this->templatePlugins[$function]['body'];
foreach ($this->templatePlugins as $func => $attr) {
if ($func !== $function && !isset($attr['called']) && strpos($body, 'Dwoo_Plugin_'.$func) !== false) {
$this->templatePlugins[$func]['called'... | php | protected function resolveSubTemplateDependencies($function)
{
$body = $this->templatePlugins[$function]['body'];
foreach ($this->templatePlugins as $func => $attr) {
if ($func !== $function && !isset($attr['called']) && strpos($body, 'Dwoo_Plugin_'.$func) !== false) {
$this->templatePlugins[$func]['called'... | [
"protected",
"function",
"resolveSubTemplateDependencies",
"(",
"$",
"function",
")",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"templatePlugins",
"[",
"$",
"function",
"]",
"[",
"'body'",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"templatePlugins",
"as",... | checks what sub-templates are used in every sub-template so that we're sure they are all compiled
@param string $function the sub-template name | [
"checks",
"what",
"sub",
"-",
"templates",
"are",
"used",
"in",
"every",
"sub",
"-",
"template",
"so",
"that",
"we",
"re",
"sure",
"they",
"are",
"all",
"compiled"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L916-L926 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.setScope | public function setScope($scope, $absolute = false)
{
$old = $this->scopeTree;
if ($scope===null) {
unset($this->scope);
$this->scope = null;
}
if (is_array($scope)===false) {
$scope = explode('.', $scope);
}
if ($absolute===true) {
$this->scope =& $this->data;
$this->scopeTree = array();... | php | public function setScope($scope, $absolute = false)
{
$old = $this->scopeTree;
if ($scope===null) {
unset($this->scope);
$this->scope = null;
}
if (is_array($scope)===false) {
$scope = explode('.', $scope);
}
if ($absolute===true) {
$this->scope =& $this->data;
$this->scopeTree = array();... | [
"public",
"function",
"setScope",
"(",
"$",
"scope",
",",
"$",
"absolute",
"=",
"false",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"scopeTree",
";",
"if",
"(",
"$",
"scope",
"===",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"scope",
"... | sets the scope
set to null if the scope becomes "unstable" (i.e. too variable or unknown) so that
variables are compiled in a more evaluative way than just $this->scope['key']
@param mixed $scope a string i.e. "level1.level2" or an array i.e. array("level1", "level2")
@param bool $absolute if true, the scope is set f... | [
"sets",
"the",
"scope"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L964-L1004 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.addBlock | public function addBlock($type, array $params, $paramtype)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$params = $this->mapParams($params, array($class, 'init'), $paramtype);
$this->stack[] = array('type' => $type, 'params'... | php | public function addBlock($type, array $params, $paramtype)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$params = $this->mapParams($params, array($class, 'init'), $paramtype);
$this->stack[] = array('type' => $type, 'params'... | [
"public",
"function",
"addBlock",
"(",
"$",
"type",
",",
"array",
"$",
"params",
",",
"$",
"paramtype",
")",
"{",
"$",
"class",
"=",
"'Dwoo_Plugin_'",
".",
"$",
"type",
";",
"if",
"(",
"class_exists",
"(",
"$",
"class",
",",
"false",
")",
"===",
"fal... | adds a block to the top of the block stack
@param string $type block type (name)
@param array $params the parameters array
@param int $paramtype the parameters type (see mapParams), 0, 1 or 2
@return string the preProcessing() method's output | [
"adds",
"a",
"block",
"to",
"the",
"top",
"of",
"the",
"block",
"stack"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1014-L1026 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.injectBlock | public function injectBlock($type, array $params)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$this->stack[] = array('type' => $type, 'params' => $params, 'custom' => false, 'class' => $class, 'buffer' => null);
$this->curBlo... | php | public function injectBlock($type, array $params)
{
$class = 'Dwoo_Plugin_'.$type;
if (class_exists($class, false) === false) {
$this->dwoo->getLoader()->loadPlugin($type);
}
$this->stack[] = array('type' => $type, 'params' => $params, 'custom' => false, 'class' => $class, 'buffer' => null);
$this->curBlo... | [
"public",
"function",
"injectBlock",
"(",
"$",
"type",
",",
"array",
"$",
"params",
")",
"{",
"$",
"class",
"=",
"'Dwoo_Plugin_'",
".",
"$",
"type",
";",
"if",
"(",
"class_exists",
"(",
"$",
"class",
",",
"false",
")",
"===",
"false",
")",
"{",
"$",
... | injects a block at the top of the plugin stack without calling its preProcessing method
used by {else} blocks to re-add themselves after having closed everything up to their parent
@param string $type block type (name)
@param array $params parameters array | [
"injects",
"a",
"block",
"at",
"the",
"top",
"of",
"the",
"plugin",
"stack",
"without",
"calling",
"its",
"preProcessing",
"method"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1060-L1068 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.removeBlock | public function removeBlock($type)
{
$output = '';
$pluginType = $this->getPluginType($type);
if ($pluginType & Dwoo::SMARTY_BLOCK) {
$type = 'smartyinterface';
}
while (true) {
while ($top = array_pop($this->stack)) {
if ($top['custom']) {
$class = $top['class'];
} else {
$class = '... | php | public function removeBlock($type)
{
$output = '';
$pluginType = $this->getPluginType($type);
if ($pluginType & Dwoo::SMARTY_BLOCK) {
$type = 'smartyinterface';
}
while (true) {
while ($top = array_pop($this->stack)) {
if ($top['custom']) {
$class = $top['class'];
} else {
$class = '... | [
"public",
"function",
"removeBlock",
"(",
"$",
"type",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"pluginType",
"=",
"$",
"this",
"->",
"getPluginType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"$",
"pluginType",
"&",
"Dwoo",
"::",
"SMARTY_BLOCK",
"... | removes the closest-to-top block of the given type and all other
blocks encountered while going down the block stack
@param string $type block type (name)
@return string the output of all postProcessing() method's return values of the closed blocks | [
"removes",
"the",
"closest",
"-",
"to",
"-",
"top",
"block",
"of",
"the",
"given",
"type",
"and",
"all",
"other",
"blocks",
"encountered",
"while",
"going",
"down",
"the",
"block",
"stack"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1077-L1111 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.& | public function &findBlock($type, $closeAlong = false)
{
if ($closeAlong===true) {
while ($b = end($this->stack)) {
if ($b['type']===$type) {
return $this->stack[key($this->stack)];
}
$this->push($this->removeTopBlock(), 0);
}
} else {
end($this->stack);
while ($b = current($this->stac... | php | public function &findBlock($type, $closeAlong = false)
{
if ($closeAlong===true) {
while ($b = end($this->stack)) {
if ($b['type']===$type) {
return $this->stack[key($this->stack)];
}
$this->push($this->removeTopBlock(), 0);
}
} else {
end($this->stack);
while ($b = current($this->stac... | [
"public",
"function",
"&",
"findBlock",
"(",
"$",
"type",
",",
"$",
"closeAlong",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"closeAlong",
"===",
"true",
")",
"{",
"while",
"(",
"$",
"b",
"=",
"end",
"(",
"$",
"this",
"->",
"stack",
")",
")",
"{",
... | returns a reference to the first block of the given type encountered and
optionally closes all blocks until it finds it
this is mainly used by {else} plugins to close everything that was opened
between their parent and themselves
@param string $type the block type (name)
@param bool $closeAlong whether to close all b... | [
"returns",
"a",
"reference",
"to",
"the",
"first",
"block",
"of",
"the",
"given",
"type",
"encountered",
"and",
"optionally",
"closes",
"all",
"blocks",
"until",
"it",
"finds",
"it"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1125-L1145 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.removeTopBlock | public function removeTopBlock()
{
$o = array_pop($this->stack);
if ($o === null) {
throw new Dwoo_Compilation_Exception($this, 'Syntax malformation, a block of unknown type was closed but was not opened.');
}
if ($o['custom']) {
$class = $o['class'];
} else {
$class = 'Dwoo_Plugin_'.$o['type'];
}... | php | public function removeTopBlock()
{
$o = array_pop($this->stack);
if ($o === null) {
throw new Dwoo_Compilation_Exception($this, 'Syntax malformation, a block of unknown type was closed but was not opened.');
}
if ($o['custom']) {
$class = $o['class'];
} else {
$class = 'Dwoo_Plugin_'.$o['type'];
}... | [
"public",
"function",
"removeTopBlock",
"(",
")",
"{",
"$",
"o",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"stack",
")",
";",
"if",
"(",
"$",
"o",
"===",
"null",
")",
"{",
"throw",
"new",
"Dwoo_Compilation_Exception",
"(",
"$",
"this",
",",
"'Syntax ma... | removes the block at the top of the stack and calls its postProcessing() method
@return string the postProcessing() method's output | [
"removes",
"the",
"block",
"at",
"the",
"top",
"of",
"the",
"stack",
"and",
"calls",
"its",
"postProcessing",
"()",
"method"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1163-L1178 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.parseFunction | protected function parseFunction($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$cmdstr = substr($in, $from, $to-$from);
preg_match('/^([a-z][a-z0-9_]*(?:::[a-z][a-z0-9_]*)?)(\s*'.$this->rdr.'|\s*;)?/i', $cmdstr, $match);
if (empty($match[1])) {
throw new Dwoo_Compilation_Exceptio... | php | protected function parseFunction($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$cmdstr = substr($in, $from, $to-$from);
preg_match('/^([a-z][a-z0-9_]*(?:::[a-z][a-z0-9_]*)?)(\s*'.$this->rdr.'|\s*;)?/i', $cmdstr, $match);
if (empty($match[1])) {
throw new Dwoo_Compilation_Exceptio... | [
"protected",
"function",
"parseFunction",
"(",
"$",
"in",
",",
"$",
"from",
",",
"$",
"to",
",",
"$",
"parsingParams",
"=",
"false",
",",
"$",
"curBlock",
"=",
"''",
",",
"&",
"$",
"pointer",
"=",
"null",
")",
"{",
"$",
"cmdstr",
"=",
"substr",
"("... | parses a function call
@param string $in the string within which we must parse something
@param int $from the starting offset of the parsed area
@param int $to the ending offset of the parsed area
@param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default
@p... | [
"parses",
"a",
"function",
"call"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1534-L1870 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.parseString | protected function parseString($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$substr = substr($in, $from, $to-$from);
$first = $substr[0];
if ($this->debug) echo 'STRING FOUND (in '.htmlentities(substr($in, $from, min($to-$from, 50))).(($to-$from) > 50 ? '...':'').')<br />';
$stre... | php | protected function parseString($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$substr = substr($in, $from, $to-$from);
$first = $substr[0];
if ($this->debug) echo 'STRING FOUND (in '.htmlentities(substr($in, $from, min($to-$from, 50))).(($to-$from) > 50 ? '...':'').')<br />';
$stre... | [
"protected",
"function",
"parseString",
"(",
"$",
"in",
",",
"$",
"from",
",",
"$",
"to",
",",
"$",
"parsingParams",
"=",
"false",
",",
"$",
"curBlock",
"=",
"''",
",",
"&",
"$",
"pointer",
"=",
"null",
")",
"{",
"$",
"substr",
"=",
"substr",
"(",
... | parses a string
@param string $in the string within which we must parse something
@param int $from the starting offset of the parsed area
@param int $to the ending offset of the parsed area
@param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default
@param st... | [
"parses",
"a",
"string"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1883-L1937 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.parseConst | protected function parseConst($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$substr = substr($in, $from, $to-$from);
if ($this->debug) {
echo 'CONST FOUND : '.$substr.'<br />';
}
if (!preg_match('#^%([a-z0-9_:]+)#i', $substr, $m)) {
throw new Dwoo_Compilation_Exception($thi... | php | protected function parseConst($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$substr = substr($in, $from, $to-$from);
if ($this->debug) {
echo 'CONST FOUND : '.$substr.'<br />';
}
if (!preg_match('#^%([a-z0-9_:]+)#i', $substr, $m)) {
throw new Dwoo_Compilation_Exception($thi... | [
"protected",
"function",
"parseConst",
"(",
"$",
"in",
",",
"$",
"from",
",",
"$",
"to",
",",
"$",
"parsingParams",
"=",
"false",
",",
"$",
"curBlock",
"=",
"''",
",",
"&",
"$",
"pointer",
"=",
"null",
")",
"{",
"$",
"substr",
"=",
"substr",
"(",
... | parses a constant
@param string $in the string within which we must parse something
@param int $from the starting offset of the parsed area
@param int $to the ending offset of the parsed area
@param mixed $parsingParams must be an array if we are parsing a function or modifier's parameters, or false by default
@param ... | [
"parses",
"a",
"constant"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1950-L1976 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.parseConstKey | protected function parseConstKey($key, $curBlock)
{
if ($this->securityPolicy !== null && $this->securityPolicy->getConstantHandling() === Dwoo_Security_Policy::CONST_DISALLOW) {
return 'null';
}
if ($curBlock !== 'root') {
$output = '(defined("'.$key.'") ? '.$key.' : null)';
} else {
$output = $key;... | php | protected function parseConstKey($key, $curBlock)
{
if ($this->securityPolicy !== null && $this->securityPolicy->getConstantHandling() === Dwoo_Security_Policy::CONST_DISALLOW) {
return 'null';
}
if ($curBlock !== 'root') {
$output = '(defined("'.$key.'") ? '.$key.' : null)';
} else {
$output = $key;... | [
"protected",
"function",
"parseConstKey",
"(",
"$",
"key",
",",
"$",
"curBlock",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"securityPolicy",
"!==",
"null",
"&&",
"$",
"this",
"->",
"securityPolicy",
"->",
"getConstantHandling",
"(",
")",
"===",
"Dwoo_Security_... | parses a constant
@param string $key the constant to parse
@param string $curBlock the current parser-block being processed
@return string parsed constant | [
"parses",
"a",
"constant"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L1985-L1998 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.parseMethodCall | protected function parseMethodCall($output, $methodCall, $curBlock, &$pointer)
{
$ptr = 0;
$len = strlen($methodCall);
while ($ptr < $len) {
if (strpos($methodCall, '->', $ptr) === $ptr) {
$ptr += 2;
}
if (in_array($methodCall[$ptr], array(';', '/', ' ', "\t", "\r", "\n", ')', '+', '*', '%', '=', ... | php | protected function parseMethodCall($output, $methodCall, $curBlock, &$pointer)
{
$ptr = 0;
$len = strlen($methodCall);
while ($ptr < $len) {
if (strpos($methodCall, '->', $ptr) === $ptr) {
$ptr += 2;
}
if (in_array($methodCall[$ptr], array(';', '/', ' ', "\t", "\r", "\n", ')', '+', '*', '%', '=', ... | [
"protected",
"function",
"parseMethodCall",
"(",
"$",
"output",
",",
"$",
"methodCall",
",",
"$",
"curBlock",
",",
"&",
"$",
"pointer",
")",
"{",
"$",
"ptr",
"=",
"0",
";",
"$",
"len",
"=",
"strlen",
"(",
"$",
"methodCall",
")",
";",
"while",
"(",
... | parses any number of chained method calls/property reads
@param string $output the variable or whatever upon which the method are called
@param string $methodCall method call source, starting at "->"
@param string $curBlock the current parser-block being processed
@param int $pointer a reference to a pointer that will... | [
"parses",
"any",
"number",
"of",
"chained",
"method",
"calls",
"/",
"property",
"reads"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L2217-L2262 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.parseOthers | protected function parseOthers($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$first = $in[$from];
$substr = substr($in, $from, $to-$from);
$end = strlen($substr);
if ($curBlock === 'condition') {
$breakChars = array('(', ')', ' ', '||', '&&', '|', '&', '>=', '<=', '===', '==',... | php | protected function parseOthers($in, $from, $to, $parsingParams = false, $curBlock='', &$pointer = null)
{
$first = $in[$from];
$substr = substr($in, $from, $to-$from);
$end = strlen($substr);
if ($curBlock === 'condition') {
$breakChars = array('(', ')', ' ', '||', '&&', '|', '&', '>=', '<=', '===', '==',... | [
"protected",
"function",
"parseOthers",
"(",
"$",
"in",
",",
"$",
"from",
",",
"$",
"to",
",",
"$",
"parsingParams",
"=",
"false",
",",
"$",
"curBlock",
"=",
"''",
",",
"&",
"$",
"pointer",
"=",
"null",
")",
"{",
"$",
"first",
"=",
"$",
"in",
"["... | parses various constants, operators or non-quoted strings
@param string $in the string within which we must parse something
@param int $from the starting offset of the parsed area
@param int $to the ending offset of the parsed area
@param mixed $parsingParams must be an array if we are parsing a function or modifier's... | [
"parses",
"various",
"constants",
"operators",
"or",
"non",
"-",
"quoted",
"strings"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L2455-L2535 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.replaceStringVars | protected function replaceStringVars($string, $first, $curBlock='')
{
$pos = 0;
if ($this->debug) echo 'STRING VAR REPLACEMENT : '.$string.'<br>';
// replace vars
while (($pos = strpos($string, '$', $pos)) !== false) {
$prev = substr($string, $pos-1, 1);
if ($prev === '\\') {
$pos++;
continue;
... | php | protected function replaceStringVars($string, $first, $curBlock='')
{
$pos = 0;
if ($this->debug) echo 'STRING VAR REPLACEMENT : '.$string.'<br>';
// replace vars
while (($pos = strpos($string, '$', $pos)) !== false) {
$prev = substr($string, $pos-1, 1);
if ($prev === '\\') {
$pos++;
continue;
... | [
"protected",
"function",
"replaceStringVars",
"(",
"$",
"string",
",",
"$",
"first",
",",
"$",
"curBlock",
"=",
"''",
")",
"{",
"$",
"pos",
"=",
"0",
";",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"echo",
"'STRING VAR REPLACEMENT : '",
".",
"$",
"str... | replaces variables within a parsed string
@param string $string the parsed string
@param string $first the first character parsed in the string, which is the string delimiter (' or ")
@param string $curBlock the current parser-block being processed
@return string the original string with variables replaced | [
"replaces",
"variables",
"within",
"a",
"parsed",
"string"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L2545-L2580 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.replaceModifiers | protected function replaceModifiers(array $m, $curBlock = null, &$pointer = null)
{
if ($this->debug) echo 'PARSING MODIFIERS : '.$m[3].'<br />';
if ($pointer !== null) {
$pointer += strlen($m[3]);
}
// remove first pipe
$cmdstrsrc = substr($m[3], 1);
// remove last quote if present
if (substr($cmdst... | php | protected function replaceModifiers(array $m, $curBlock = null, &$pointer = null)
{
if ($this->debug) echo 'PARSING MODIFIERS : '.$m[3].'<br />';
if ($pointer !== null) {
$pointer += strlen($m[3]);
}
// remove first pipe
$cmdstrsrc = substr($m[3], 1);
// remove last quote if present
if (substr($cmdst... | [
"protected",
"function",
"replaceModifiers",
"(",
"array",
"$",
"m",
",",
"$",
"curBlock",
"=",
"null",
",",
"&",
"$",
"pointer",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"echo",
"'PARSING MODIFIERS : '",
".",
"$",
"m",
"[",
... | replaces the modifiers applied to a string or a variable
@param array $m the regex matches that must be array(1=>"double or single quotes enclosing a string, when applicable", 2=>"the string or var", 3=>"the modifiers matched")
@param string $curBlock the current parser-block being processed
@return string the input e... | [
"replaces",
"the",
"modifiers",
"applied",
"to",
"a",
"string",
"or",
"a",
"variable"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L2589-L2830 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.getPluginType | protected function getPluginType($name)
{
$pluginType = -1;
if (($this->securityPolicy === null && (function_exists($name) || strtolower($name) === 'isset' || strtolower($name) === 'empty')) ||
($this->securityPolicy !== null && in_array(strtolower($name), $this->securityPolicy->getAllowedPhpFunctions()) !== f... | php | protected function getPluginType($name)
{
$pluginType = -1;
if (($this->securityPolicy === null && (function_exists($name) || strtolower($name) === 'isset' || strtolower($name) === 'empty')) ||
($this->securityPolicy !== null && in_array(strtolower($name), $this->securityPolicy->getAllowedPhpFunctions()) !== f... | [
"protected",
"function",
"getPluginType",
"(",
"$",
"name",
")",
"{",
"$",
"pluginType",
"=",
"-",
"1",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"securityPolicy",
"===",
"null",
"&&",
"(",
"function_exists",
"(",
"$",
"name",
")",
"||",
"strtolower",
"(... | returns the plugin type of a plugin and adds it to the used plugins array if required
@param string $name plugin name, as found in the template
@return int type as a multi bit flag composed of the Dwoo plugin types constants | [
"returns",
"the",
"plugin",
"type",
"of",
"a",
"plugin",
"and",
"adds",
"it",
"to",
"the",
"used",
"plugins",
"array",
"if",
"required"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L2866-L2926 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php | Dwoo_Compiler.mapParams | protected function mapParams(array $params, $callback, $callType=2, $map = null)
{
if (!$map) {
$map = $this->getParamMap($callback);
}
$paramlist = array();
// transforms the parameter array from (x=>array('paramname'=>array(values))) to (paramname=>array(values))
$ps = array();
foreach ($params as $... | php | protected function mapParams(array $params, $callback, $callType=2, $map = null)
{
if (!$map) {
$map = $this->getParamMap($callback);
}
$paramlist = array();
// transforms the parameter array from (x=>array('paramname'=>array(values))) to (paramname=>array(values))
$ps = array();
foreach ($params as $... | [
"protected",
"function",
"mapParams",
"(",
"array",
"$",
"params",
",",
"$",
"callback",
",",
"$",
"callType",
"=",
"2",
",",
"$",
"map",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"map",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"getParamMa... | maps the parameters received from the template onto the parameters required by the given callback
@param array $params the array of parameters
@param callback $callback the function or method to reflect on to find out the required parameters
@param int $callType the type of call in the template, 0 = no params, 1 = php... | [
"maps",
"the",
"parameters",
"received",
"from",
"the",
"template",
"onto",
"the",
"parameters",
"required",
"by",
"the",
"given",
"callback"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Compiler.php#L2960-L3036 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php | ezcMail.__isset | public function __isset( $name )
{
switch ( $name )
{
case 'to':
case 'cc':
case 'bcc':
case 'from':
case 'subject':
case 'subjectCharset':
case 'body':
case 'messageId':
case 'returnPath':
... | php | public function __isset( $name )
{
switch ( $name )
{
case 'to':
case 'cc':
case 'bcc':
case 'from':
case 'subject':
case 'subjectCharset':
case 'body':
case 'messageId':
case 'returnPath':
... | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"switch",
"(",
"$",
"name",
")",
"{",
"case",
"'to'",
":",
"case",
"'cc'",
":",
"case",
"'bcc'",
":",
"case",
"'from'",
":",
"case",
"'subject'",
":",
"case",
"'subjectCharset'",
":",
"case",... | Returns true if the property $name is set, otherwise false.
@param string $name
@return bool
@ignore | [
"Returns",
"true",
"if",
"the",
"property",
"$name",
"is",
"set",
"otherwise",
"false",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php#L261-L285 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php | ezcMail.generateHeaders | public function generateHeaders()
{
// set our headers first.
if ( $this->from !== null )
{
$this->setHeader( "From", ezcMailTools::composeEmailAddress( $this->from ) );
}
if ( $this->to !== null )
{
$this->setHeader( "To", ezcMailTools::compo... | php | public function generateHeaders()
{
// set our headers first.
if ( $this->from !== null )
{
$this->setHeader( "From", ezcMailTools::composeEmailAddress( $this->from ) );
}
if ( $this->to !== null )
{
$this->setHeader( "To", ezcMailTools::compo... | [
"public",
"function",
"generateHeaders",
"(",
")",
"{",
"// set our headers first.",
"if",
"(",
"$",
"this",
"->",
"from",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"setHeader",
"(",
"\"From\"",
",",
"ezcMailTools",
"::",
"composeEmailAddress",
"(",
"$",
"... | Returns the generated headers for the mail.
This method is called automatically when the mail message is built.
You can re-implement this method in subclasses if you wish to set
different mail headers than ezcMail.
@return string | [
"Returns",
"the",
"generated",
"headers",
"for",
"the",
"mail",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php#L342-L384 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php | ezcMail.fetchParts | public function fetchParts( $filter = null, $includeDigests = false )
{
$context = new ezcMailPartWalkContext( array( __CLASS__, 'collectPart' ) );
$context->includeDigests = $includeDigests;
$context->filter = $filter;
$context->level = 0;
$this->walkParts( $context, $this )... | php | public function fetchParts( $filter = null, $includeDigests = false )
{
$context = new ezcMailPartWalkContext( array( __CLASS__, 'collectPart' ) );
$context->includeDigests = $includeDigests;
$context->filter = $filter;
$context->level = 0;
$this->walkParts( $context, $this )... | [
"public",
"function",
"fetchParts",
"(",
"$",
"filter",
"=",
"null",
",",
"$",
"includeDigests",
"=",
"false",
")",
"{",
"$",
"context",
"=",
"new",
"ezcMailPartWalkContext",
"(",
"array",
"(",
"__CLASS__",
",",
"'collectPart'",
")",
")",
";",
"$",
"contex... | Returns an array of mail parts from the current mail.
The array returned contains objects of classes:
- ezcMailText
- ezcMailFile
- ezcMailRfc822Digest
If the method is called with $includeDigests as true, then the returned
array will not contain ezcMailRfc822Digest objects, but instead the mail
parts inside the diges... | [
"Returns",
"an",
"array",
"of",
"mail",
"parts",
"from",
"the",
"current",
"mail",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php#L420-L428 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php | ezcMail.walkParts | public function walkParts( ezcMailPartWalkContext $context, ezcMailPart $mail )
{
$className = get_class( $mail );
$context->level++;
switch ( $className )
{
case 'ezcMail':
case 'ezcMailComposer':
if ( $mail->body !== null )
{
... | php | public function walkParts( ezcMailPartWalkContext $context, ezcMailPart $mail )
{
$className = get_class( $mail );
$context->level++;
switch ( $className )
{
case 'ezcMail':
case 'ezcMailComposer':
if ( $mail->body !== null )
{
... | [
"public",
"function",
"walkParts",
"(",
"ezcMailPartWalkContext",
"$",
"context",
",",
"ezcMailPart",
"$",
"mail",
")",
"{",
"$",
"className",
"=",
"get_class",
"(",
"$",
"mail",
")",
";",
"$",
"context",
"->",
"level",
"++",
";",
"switch",
"(",
"$",
"cl... | Walks recursively through the mail parts in the specified mail object.
$context is an object of class ezcMailPartWalkContext, which must contain
a valid callback function name to be applied to all mail parts. You can use
the collectPart() method, or create your own callback function which can
for example save the mail... | [
"Walks",
"recursively",
"through",
"the",
"mail",
"parts",
"in",
"the",
"specified",
"mail",
"object",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/mail.php#L460-L532 |
Eresus/EresusCMS | src/core/Plugin/Templates.php | Eresus_Plugin_Templates.client | public function client($filename)
{
$path = $this->clientPath($filename, false);
return Eresus_Template::loadFromFile($path);
} | php | public function client($filename)
{
$path = $this->clientPath($filename, false);
return Eresus_Template::loadFromFile($path);
} | [
"public",
"function",
"client",
"(",
"$",
"filename",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"clientPath",
"(",
"$",
"filename",
",",
"false",
")",
";",
"return",
"Eresus_Template",
"::",
"loadFromFile",
"(",
"$",
"path",
")",
";",
"}"
] | Возвращает шаблон для клиентского интерфейса
@param string $filename имя файла шаблона относительно папки клиентских шаблонов
@return Eresus_Template
@since 3.01 | [
"Возвращает",
"шаблон",
"для",
"клиентского",
"интерфейса"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin/Templates.php#L76-L80 |
Eresus/EresusCMS | src/core/Plugin/Templates.php | Eresus_Plugin_Templates.clientWrite | public function clientWrite($filename, $source)
{
$path = $this->clientPath($filename);
file_put_contents($path, $source);
} | php | public function clientWrite($filename, $source)
{
$path = $this->clientPath($filename);
file_put_contents($path, $source);
} | [
"public",
"function",
"clientWrite",
"(",
"$",
"filename",
",",
"$",
"source",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"clientPath",
"(",
"$",
"filename",
")",
";",
"file_put_contents",
"(",
"$",
"path",
",",
"$",
"source",
")",
";",
"}"
] | Записывает новый исходный код в шаблон для клиентского интерфейса
@param string $filename имя файла шаблона относительно папки клиентских шаблонов
@param string $source новый исходный код шаблона
@return void
@since 3.01 | [
"Записывает",
"новый",
"исходный",
"код",
"в",
"шаблон",
"для",
"клиентского",
"интерфейса"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin/Templates.php#L107-L111 |
Eresus/EresusCMS | src/core/Plugin/Templates.php | Eresus_Plugin_Templates.clientPath | public function clientPath($filename, $absolute = true)
{
$path = "templates/{$this->plugin->getName()}/$filename";
if ($absolute)
{
$path = $this->getFullPath($path);
}
return $path;
} | php | public function clientPath($filename, $absolute = true)
{
$path = "templates/{$this->plugin->getName()}/$filename";
if ($absolute)
{
$path = $this->getFullPath($path);
}
return $path;
} | [
"public",
"function",
"clientPath",
"(",
"$",
"filename",
",",
"$",
"absolute",
"=",
"true",
")",
"{",
"$",
"path",
"=",
"\"templates/{$this->plugin->getName()}/$filename\"",
";",
"if",
"(",
"$",
"absolute",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"... | Возвращает путь к шаблону КИ
@param string $filename имя файла относительно папки шаблонов
@param bool $absolute если false, то вернёт путь относительно корня сайта
@return string путь к файлу шаблона | [
"Возвращает",
"путь",
"к",
"шаблону",
"КИ"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin/Templates.php#L121-L129 |
Eresus/EresusCMS | src/core/Plugin/Templates.php | Eresus_Plugin_Templates.adminPath | public function adminPath($filename, $absolute = true)
{
$path = "ext/{$this->plugin->getName()}/admin/templates/$filename";
if ($absolute)
{
$path = $this->getFullPath($path);
}
return $path;
} | php | public function adminPath($filename, $absolute = true)
{
$path = "ext/{$this->plugin->getName()}/admin/templates/$filename";
if ($absolute)
{
$path = $this->getFullPath($path);
}
return $path;
} | [
"public",
"function",
"adminPath",
"(",
"$",
"filename",
",",
"$",
"absolute",
"=",
"true",
")",
"{",
"$",
"path",
"=",
"\"ext/{$this->plugin->getName()}/admin/templates/$filename\"",
";",
"if",
"(",
"$",
"absolute",
")",
"{",
"$",
"path",
"=",
"$",
"this",
... | Возвращает путь к шаблону АИ
@param string $filename имя файла относительно папки шаблонов
@param bool $absolute если false, то вернёт путь относительно корня сайта
@return string путь к файлу шаблона | [
"Возвращает",
"путь",
"к",
"шаблону",
"АИ"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/Plugin/Templates.php#L139-L147 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/ConstantAssembler.php | ConstantAssembler.create | public function create($data)
{
$constantDescriptor = new ConstantDescriptor();
$constantDescriptor->setName($data->getShortName());
$constantDescriptor->setValue($data->getValue());
// Reflection library formulates namespace as global but this is not wanted for phpDocumentor itself
... | php | public function create($data)
{
$constantDescriptor = new ConstantDescriptor();
$constantDescriptor->setName($data->getShortName());
$constantDescriptor->setValue($data->getValue());
// Reflection library formulates namespace as global but this is not wanted for phpDocumentor itself
... | [
"public",
"function",
"create",
"(",
"$",
"data",
")",
"{",
"$",
"constantDescriptor",
"=",
"new",
"ConstantDescriptor",
"(",
")",
";",
"$",
"constantDescriptor",
"->",
"setName",
"(",
"$",
"data",
"->",
"getShortName",
"(",
")",
")",
";",
"$",
"constantDe... | Creates a Descriptor from the provided data.
@param ConstantReflector $data
@return ConstantDescriptor | [
"Creates",
"a",
"Descriptor",
"from",
"the",
"provided",
"data",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/ConstantAssembler.php#L29-L48 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php | ezcMailMultipartParser.parseBody | public function parseBody( $origLine )
{
if ( $this->parserState == self::PARSE_STATE_POST_LAST )
{
return;
}
$line = rtrim( $origLine, "\r\n" );
// check if we hit any of the boundaries
$newPart = false;
$endOfMultipart = false;
if ( str... | php | public function parseBody( $origLine )
{
if ( $this->parserState == self::PARSE_STATE_POST_LAST )
{
return;
}
$line = rtrim( $origLine, "\r\n" );
// check if we hit any of the boundaries
$newPart = false;
$endOfMultipart = false;
if ( str... | [
"public",
"function",
"parseBody",
"(",
"$",
"origLine",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parserState",
"==",
"self",
"::",
"PARSE_STATE_POST_LAST",
")",
"{",
"return",
";",
"}",
"$",
"line",
"=",
"rtrim",
"(",
"$",
"origLine",
",",
"\"\\r\\n\"",... | Parses a multipart body.
@throws ezcBaseFileNotFoundException
if a neccessary temporary file could not be opened.
@param string $origLine | [
"Parses",
"a",
"multipart",
"body",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php#L106-L185 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php | ezcMailMultipartParser.finish | public function finish()
{
if ( $this->parserState != self::PARSE_STATE_POST_LAST )
{
// this should never happen
// let's give the last parser a chance to clean up after himself
if ( $this->currentPartParser !== null )
{
$part = $this-... | php | public function finish()
{
if ( $this->parserState != self::PARSE_STATE_POST_LAST )
{
// this should never happen
// let's give the last parser a chance to clean up after himself
if ( $this->currentPartParser !== null )
{
$part = $this-... | [
"public",
"function",
"finish",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parserState",
"!=",
"self",
"::",
"PARSE_STATE_POST_LAST",
")",
"{",
"// this should never happen",
"// let's give the last parser a chance to clean up after himself",
"if",
"(",
"$",
"this",
... | Completes the parsing of the multipart and returns the corresponding part.
This method should not be overriden. Use finishMultipart() instead.
@return ezcMailMultipart | [
"Completes",
"the",
"parsing",
"of",
"the",
"multipart",
"and",
"returns",
"the",
"corresponding",
"part",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/multipart_parser.php#L194-L211 |
j-d/draggy | src/Draggy/Autocode/PHPAttribute.php | PHPAttribute.getPhpType | public function getPhpType()
{
if ($this->type === 'object') {
if (is_null($this->getSubtype())) {
throw new \InvalidArgumentException('Attribute ' . $this->getName() . ' on the entity ' . $this->getEntity()->getName() . ' is marked as an object but doesn\'t have a subtype');
... | php | public function getPhpType()
{
if ($this->type === 'object') {
if (is_null($this->getSubtype())) {
throw new \InvalidArgumentException('Attribute ' . $this->getName() . ' on the entity ' . $this->getEntity()->getName() . ' is marked as an object but doesn\'t have a subtype');
... | [
"public",
"function",
"getPhpType",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"type",
"===",
"'object'",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getSubtype",
"(",
")",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",... | <user-additions part="settersAndGetters"> | [
"<user",
"-",
"additions",
"part",
"=",
"settersAndGetters",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/PHPAttribute.php#L53-L82 |
j-d/draggy | src/Draggy/Autocode/PHPAttribute.php | PHPAttribute.describe | public function describe()
{
$ret = '';
$ret .= 'PHPType = ' . $this->getPhpType() . "\n";
$ret .= 'PHPParameterType = ' . $this->getPhpParameterType() . "\n";
return parent::describe() . $ret;
} | php | public function describe()
{
$ret = '';
$ret .= 'PHPType = ' . $this->getPhpType() . "\n";
$ret .= 'PHPParameterType = ' . $this->getPhpParameterType() . "\n";
return parent::describe() . $ret;
} | [
"public",
"function",
"describe",
"(",
")",
"{",
"$",
"ret",
"=",
"''",
";",
"$",
"ret",
".=",
"'PHPType = '",
".",
"$",
"this",
"->",
"getPhpType",
"(",
")",
".",
"\"\\n\"",
";",
"$",
"ret",
".=",
"'PHPParameterType = '",
".",
"$",
"this",
"->",
"ge... | <user-additions part="otherMethods"> | [
"<user",
"-",
"additions",
"part",
"=",
"otherMethods",
">"
] | train | https://github.com/j-d/draggy/blob/97ffc66e1aacb5f685d7aac5251c4abb8888d4bb/src/Draggy/Autocode/PHPAttribute.php#L341-L349 |
inhere/php-librarys | src/Traits/ConfigTrait.php | ConfigTrait.getValue | public function getValue(string $name, $default = null)
{
$value = Arr::getByPath($this->config, $name, $default);
if ($value && $value instanceof \Closure) {
$value = $value();
}
return $value;
} | php | public function getValue(string $name, $default = null)
{
$value = Arr::getByPath($this->config, $name, $default);
if ($value && $value instanceof \Closure) {
$value = $value();
}
return $value;
} | [
"public",
"function",
"getValue",
"(",
"string",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"Arr",
"::",
"getByPath",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"name",
",",
"$",
"default",
")",
";",
"if",
"(",
"... | Method to get property Options
@param string $name
@param mixed $default
@return mixed | [
"Method",
"to",
"get",
"property",
"Options"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/ConfigTrait.php#L37-L46 |
inhere/php-librarys | src/Traits/ConfigTrait.php | ConfigTrait.delValue | public function delValue($name)
{
$value = null;
if ($this->hasConfig($name)) {
$value = $this->getValue($name);
unset($this->config[$name]);
}
return $value;
} | php | public function delValue($name)
{
$value = null;
if ($this->hasConfig($name)) {
$value = $this->getValue($name);
unset($this->config[$name]);
}
return $value;
} | [
"public",
"function",
"delValue",
"(",
"$",
"name",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"hasConfig",
"(",
"$",
"name",
")",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getValue",
"(",
"$",
"name",
")",
"... | delete a option
@param $name
@return mixed|null | [
"delete",
"a",
"option"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/ConfigTrait.php#L66-L77 |
inhere/php-librarys | src/Traits/ConfigTrait.php | ConfigTrait.getConfig | public function getConfig(string $key = null)
{
if ($key) {
return $this->getValue($key);
}
return $this->config;
} | php | public function getConfig(string $key = null)
{
if ($key) {
return $this->getValue($key);
}
return $this->config;
} | [
"public",
"function",
"getConfig",
"(",
"string",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
")",
"{",
"return",
"$",
"this",
"->",
"getValue",
"(",
"$",
"key",
")",
";",
"}",
"return",
"$",
"this",
"->",
"config",
";",
"}"
] | Method to get property Options
@param string|null $key
@return array | [
"Method",
"to",
"get",
"property",
"Options"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/ConfigTrait.php#L84-L91 |
inhere/php-librarys | src/Traits/ConfigTrait.php | ConfigTrait.setConfig | public function setConfig(array $config, $loopMerge = true)
{
$this->config = $loopMerge ? Arr::merge($this->config, $config) : $config;
return $this;
} | php | public function setConfig(array $config, $loopMerge = true)
{
$this->config = $loopMerge ? Arr::merge($this->config, $config) : $config;
return $this;
} | [
"public",
"function",
"setConfig",
"(",
"array",
"$",
"config",
",",
"$",
"loopMerge",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"config",
"=",
"$",
"loopMerge",
"?",
"Arr",
"::",
"merge",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"config",
")",
... | Method to set property config
@param array $config
@param bool $loopMerge
@return static Return self to support chaining. | [
"Method",
"to",
"set",
"property",
"config"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/ConfigTrait.php#L99-L104 |
antaresproject/notifications | src/Contents.php | Contents.find | public function find(string $operation, string $locale)
{
$model = $this->notifications->first(function ($value) use($operation, $locale) {
return $value->code === $locale && ($value->title === $operation || $value->name === $operation);
});
return $model ? $model->content : fal... | php | public function find(string $operation, string $locale)
{
$model = $this->notifications->first(function ($value) use($operation, $locale) {
return $value->code === $locale && ($value->title === $operation || $value->name === $operation);
});
return $model ? $model->content : fal... | [
"public",
"function",
"find",
"(",
"string",
"$",
"operation",
",",
"string",
"$",
"locale",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"notifications",
"->",
"first",
"(",
"function",
"(",
"$",
"value",
")",
"use",
"(",
"$",
"operation",
",",
"... | Finds notification content by title and locale.
@param string $operation
@param string $locale
@return bool | [
"Finds",
"notification",
"content",
"by",
"title",
"and",
"locale",
"."
] | train | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Contents.php#L64-L71 |
sciactive/nymph-server | src/Drivers/PostgreSQLDriver.php | PostgreSQLDriver.connect | public function connect() {
// Check that the PostgreSQL extension is installed.
if (!is_callable('pg_connect')) {
throw new Exceptions\UnableToConnectException(
'PostgreSQL PHP extension is not available. It probably has not '.
'been installed. Please install and configure it in order... | php | public function connect() {
// Check that the PostgreSQL extension is installed.
if (!is_callable('pg_connect')) {
throw new Exceptions\UnableToConnectException(
'PostgreSQL PHP extension is not available. It probably has not '.
'been installed. Please install and configure it in order... | [
"public",
"function",
"connect",
"(",
")",
"{",
"// Check that the PostgreSQL extension is installed.",
"if",
"(",
"!",
"is_callable",
"(",
"'pg_connect'",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"UnableToConnectException",
"(",
"'PostgreSQL PHP extension is no... | Connect to the PostgreSQL database.
@return bool Whether this instance is connected to a PostgreSQL database
after the method has run. | [
"Connect",
"to",
"the",
"PostgreSQL",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/PostgreSQLDriver.php#L54-L117 |
sciactive/nymph-server | src/Drivers/PostgreSQLDriver.php | PostgreSQLDriver.disconnect | public function disconnect() {
if ($this->connected) {
if (is_resource($this->link)) {
pg_close($this->link);
}
$this->connected = false;
}
return $this->connected;
} | php | public function disconnect() {
if ($this->connected) {
if (is_resource($this->link)) {
pg_close($this->link);
}
$this->connected = false;
}
return $this->connected;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connected",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"link",
")",
")",
"{",
"pg_close",
"(",
"$",
"this",
"->",
"link",
")",
";",
"}",
"$",
"this... | Disconnect from the PostgreSQL database.
@return bool Whether this instance is connected to a PostgreSQL database
after the method has run. | [
"Disconnect",
"from",
"the",
"PostgreSQL",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/PostgreSQLDriver.php#L125-L133 |
sciactive/nymph-server | src/Drivers/PostgreSQLDriver.php | PostgreSQLDriver.createTables | private function createTables($etype = null) {
$this->query('ROLLBACK; BEGIN;');
if (isset($etype)) {
$etype = '_'.pg_escape_string($this->link, $etype);
// Create the entity table.
$this->query("CREATE TABLE IF NOT EXISTS \"{$this->prefix}entities{$etype}\" ( \"guid\" BIGINT NOT NULL, \"tags\... | php | private function createTables($etype = null) {
$this->query('ROLLBACK; BEGIN;');
if (isset($etype)) {
$etype = '_'.pg_escape_string($this->link, $etype);
// Create the entity table.
$this->query("CREATE TABLE IF NOT EXISTS \"{$this->prefix}entities{$etype}\" ( \"guid\" BIGINT NOT NULL, \"tags\... | [
"private",
"function",
"createTables",
"(",
"$",
"etype",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"query",
"(",
"'ROLLBACK; BEGIN;'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"etype",
")",
")",
"{",
"$",
"etype",
"=",
"'_'",
".",
"pg_escape_string",
... | Create entity tables in the database.
@param string $etype The entity type to create a table for. If this is
blank, the default tables are created. | [
"Create",
"entity",
"tables",
"in",
"the",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/PostgreSQLDriver.php#L141-L216 |
mikebarlow/html-helper | src/Services/CometPHP/Assets.php | Assets.getAsset | protected function getAsset($assetData)
{
try {
$Comet = \CometPHP\Comet::getInstance();
} catch (\CometPHP\Exceptions\CometNotBooted $e) {
return null;
}
if (! is_array($assetData)) {
$assetData = [$assetData];
}
$asset = $Comet[... | php | protected function getAsset($assetData)
{
try {
$Comet = \CometPHP\Comet::getInstance();
} catch (\CometPHP\Exceptions\CometNotBooted $e) {
return null;
}
if (! is_array($assetData)) {
$assetData = [$assetData];
}
$asset = $Comet[... | [
"protected",
"function",
"getAsset",
"(",
"$",
"assetData",
")",
"{",
"try",
"{",
"$",
"Comet",
"=",
"\\",
"CometPHP",
"\\",
"Comet",
"::",
"getInstance",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"CometPHP",
"\\",
"Exceptions",
"\\",
"CometNotBooted",
"$"... | base function to return assets
@param mixed asset path data received from the image method
@return string url to pass to img or css | [
"base",
"function",
"to",
"return",
"assets"
] | train | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Services/CometPHP/Assets.php#L13-L31 |
GrupaZero/api | src/Gzero/Api/Controller/Admin/LangController.php | LangController.show | public function show($code)
{
$lang = $this->langRepo->getByCode($code);
if (empty($lang)) {
return $this->respondNotFound();
}
return $this->respondWithSuccess($lang, new LangTransformer);
} | php | public function show($code)
{
$lang = $this->langRepo->getByCode($code);
if (empty($lang)) {
return $this->respondNotFound();
}
return $this->respondWithSuccess($lang, new LangTransformer);
} | [
"public",
"function",
"show",
"(",
"$",
"code",
")",
"{",
"$",
"lang",
"=",
"$",
"this",
"->",
"langRepo",
"->",
"getByCode",
"(",
"$",
"code",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"lang",
")",
")",
"{",
"return",
"$",
"this",
"->",
"respondNo... | Display the specified resource.
@param int $code Lang code
@return Response | [
"Display",
"the",
"specified",
"resource",
"."
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/LangController.php#L53-L60 |
rem42/scraper | Cache/FileSystemCache.php | FileSystemCache.setCacheFolder | public function setCacheFolder(?string $cacheFolder)
{
if (substr($cacheFolder, -1) !== '/') {
$cacheFolder .= "/";
}
$this->cacheFolder = $cacheFolder;
$this->initCache();
return $this;
} | php | public function setCacheFolder(?string $cacheFolder)
{
if (substr($cacheFolder, -1) !== '/') {
$cacheFolder .= "/";
}
$this->cacheFolder = $cacheFolder;
$this->initCache();
return $this;
} | [
"public",
"function",
"setCacheFolder",
"(",
"?",
"string",
"$",
"cacheFolder",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"cacheFolder",
",",
"-",
"1",
")",
"!==",
"'/'",
")",
"{",
"$",
"cacheFolder",
".=",
"\"/\"",
";",
"}",
"$",
"this",
"->",
"cache... | @param string $cacheFolder
@return $this | [
"@param",
"string",
"$cacheFolder"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/Cache/FileSystemCache.php#L43-L51 |
rem42/scraper | Cache/FileSystemCache.php | FileSystemCache.write | public function write($data)
{
$this->createFolderIfNotExist($this->folderPath());
$this->createFile($this->getFilePath(), $data);
} | php | public function write($data)
{
$this->createFolderIfNotExist($this->folderPath());
$this->createFile($this->getFilePath(), $data);
} | [
"public",
"function",
"write",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"createFolderIfNotExist",
"(",
"$",
"this",
"->",
"folderPath",
"(",
")",
")",
";",
"$",
"this",
"->",
"createFile",
"(",
"$",
"this",
"->",
"getFilePath",
"(",
")",
",",
"... | @param $data
@return bool|void | [
"@param",
"$data"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/Cache/FileSystemCache.php#L58-L62 |
xiewulong/yii2-fileupload | oss/libs/guzzle/plugin/Guzzle/Plugin/Cookie/Cookie.php | Cookie.matchesDomain | public function matchesDomain($domain)
{
$cookieDomain = $this->getDomain();
// Domain not set or exact match.
if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
return true;
}
// . prefix match.
if (strpos($cookieDomain, '.') === 0) {
... | php | public function matchesDomain($domain)
{
$cookieDomain = $this->getDomain();
// Domain not set or exact match.
if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
return true;
}
// . prefix match.
if (strpos($cookieDomain, '.') === 0) {
... | [
"public",
"function",
"matchesDomain",
"(",
"$",
"domain",
")",
"{",
"$",
"cookieDomain",
"=",
"$",
"this",
"->",
"getDomain",
"(",
")",
";",
"// Domain not set or exact match.",
"if",
"(",
"!",
"$",
"cookieDomain",
"||",
"!",
"strcasecmp",
"(",
"$",
"domain... | Check if the cookie matches a domain value
@param string $domain Domain to check against
@return bool | [
"Check",
"if",
"the",
"cookie",
"matches",
"a",
"domain",
"value"
] | train | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/plugin/Guzzle/Plugin/Cookie/Cookie.php#L425-L455 |
inhere/php-librarys | src/Utils/DbRecordSort.php | DbRecordSort.setValue | public function setValue($name, $value = '')
{
if (\is_array($name)) {
foreach ($name as $key => $val) {
if (isset($this->$key)) {
$this->$key = $val;
}
}
} else {
if (isset($this->$name)) {
$this... | php | public function setValue($name, $value = '')
{
if (\is_array($name)) {
foreach ($name as $key => $val) {
if (isset($this->$key)) {
$this->$key = $val;
}
}
} else {
if (isset($this->$name)) {
$this... | [
"public",
"function",
"setValue",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"foreach",
"(",
"$",
"name",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"i... | /*
1.array(
'firstRank' => rankValue,
'lastRank' => rankValue
)
2. ('firstRank','rankValue') | [
"/",
"*",
"1",
".",
"array",
"(",
"firstRank",
"=",
">",
"rankValue",
"lastRank",
"=",
">",
"rankValue",
")",
"2",
".",
"(",
"firstRank",
"rankValue",
")"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/DbRecordSort.php#L78-L91 |
inhere/php-librarys | src/Utils/DbRecordSort.php | DbRecordSort.execute | public function execute($id, $oldSortVal, $sortType = self::MOVE_UP)
{
if (empty($this->tableName)) {
$this->error = '必须传入或设置要操作的表名称(无需前缀)!';
return false;
}
if ($this->firstRank === '' || $this->lastRank === '') {
$this->error = '必须传入首尾记录的排序值!';
... | php | public function execute($id, $oldSortVal, $sortType = self::MOVE_UP)
{
if (empty($this->tableName)) {
$this->error = '必须传入或设置要操作的表名称(无需前缀)!';
return false;
}
if ($this->firstRank === '' || $this->lastRank === '') {
$this->error = '必须传入首尾记录的排序值!';
... | [
"public",
"function",
"execute",
"(",
"$",
"id",
",",
"$",
"oldSortVal",
",",
"$",
"sortType",
"=",
"self",
"::",
"MOVE_UP",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"tableName",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"'必须传入或设... | execute 执行排序,
@param int $id 当前记录 Id
@param int $oldSortVal 当前记录的排序值
@param int $sortType 排序请求
@return bool
@throws \InvalidArgumentException | [
"execute",
"执行排序,"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Utils/DbRecordSort.php#L101-L184 |
ProjetPP/WikidataQueryApi | src/Services/SimpleQueryService.php | SimpleQueryService.doQuery | public function doQuery( AbstractQuery $query ) {
$result = $this->api->doQuery( [
'q' => $this->querySerializer->serialize( $query )
] );
return $this->parseItemList( $result['items'] );
} | php | public function doQuery( AbstractQuery $query ) {
$result = $this->api->doQuery( [
'q' => $this->querySerializer->serialize( $query )
] );
return $this->parseItemList( $result['items'] );
} | [
"public",
"function",
"doQuery",
"(",
"AbstractQuery",
"$",
"query",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"api",
"->",
"doQuery",
"(",
"[",
"'q'",
"=>",
"$",
"this",
"->",
"querySerializer",
"->",
"serialize",
"(",
"$",
"query",
")",
"]",
... | @param AbstractQuery $query
@return ItemId[]
@throws WikibaseQueryApiException | [
"@param",
"AbstractQuery",
"$query",
"@return",
"ItemId",
"[]"
] | train | https://github.com/ProjetPP/WikidataQueryApi/blob/d6c448a4ca8e9472b0a223f88cc7c28baffac861/src/Services/SimpleQueryService.php#L44-L50 |
alevilar/ristorantino-vendor | Product/Model/Categoria.php | Categoria.array_listado | function array_listado($categoria_id = 1){
$array_categoria = array();
$array_final = array();
$this->recursive = 1;
$this->id = $categoria_id;
// $this->contain(array(
// 'Producto',
// 'Sabor',
// ... | php | function array_listado($categoria_id = 1){
$array_categoria = array();
$array_final = array();
$this->recursive = 1;
$this->id = $categoria_id;
// $this->contain(array(
// 'Producto',
// 'Sabor',
// ... | [
"function",
"array_listado",
"(",
"$",
"categoria_id",
"=",
"1",
")",
"{",
"$",
"array_categoria",
"=",
"array",
"(",
")",
";",
"$",
"array_final",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"recursive",
"=",
"1",
";",
"$",
"this",
"->",
"id",
... | Me devuelve un array lindo con sub arrays para cada subarbol
@param $categoria_id de donde yovoy a leer los hijos
@return unknown_type | [
"Me",
"devuelve",
"un",
"array",
"lindo",
"con",
"sub",
"arrays",
"para",
"cada",
"subarbol"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Product/Model/Categoria.php#L59-L90 |
rhosocial/yii2-user | web/admin/controllers/UserController.php | UserController.initMessages | protected function initMessages()
{
if (!is_string($this->registerSuccessMessage)) {
$this->registerSuccessMessage = Yii::t('user' ,'User Registered.');
}
if (!is_string($this->registerFailedMessage)) {
$this->registerFailedMessage = Yii::t('user', 'Register Failed.')... | php | protected function initMessages()
{
if (!is_string($this->registerSuccessMessage)) {
$this->registerSuccessMessage = Yii::t('user' ,'User Registered.');
}
if (!is_string($this->registerFailedMessage)) {
$this->registerFailedMessage = Yii::t('user', 'Register Failed.')... | [
"protected",
"function",
"initMessages",
"(",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"this",
"->",
"registerSuccessMessage",
")",
")",
"{",
"$",
"this",
"->",
"registerSuccessMessage",
"=",
"Yii",
"::",
"t",
"(",
"'user'",
",",
"'User Registered.'"... | Initialize messages. | [
"Initialize",
"messages",
"."
] | train | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/web/admin/controllers/UserController.php#L58-L78 |
rhosocial/yii2-user | web/admin/controllers/UserController.php | UserController.actionRegisterNewUser | public function actionRegisterNewUser()
{
$model = new RegisterForm();
if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
Yii::$app->response = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
if ($model->load(Yii::$app-... | php | public function actionRegisterNewUser()
{
$model = new RegisterForm();
if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
Yii::$app->response = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
if ($model->load(Yii::$app-... | [
"public",
"function",
"actionRegisterNewUser",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"RegisterForm",
"(",
")",
";",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"isAjax",
"&&",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app"... | Register new user.
@return string|\yii\web\Response | [
"Register",
"new",
"user",
"."
] | train | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/web/admin/controllers/UserController.php#L164-L188 |
rhosocial/yii2-user | web/admin/controllers/UserController.php | UserController.getUser | protected function getUser($id)
{
$class = Yii::$app->user->identityClass;
if (!class_exists($class)) {
return null;
}
$user = $class::find()->id($id)->one();
if (empty($user) || !($user instanceof User)) {
throw new BadRequestHttpException(Yii::t('use... | php | protected function getUser($id)
{
$class = Yii::$app->user->identityClass;
if (!class_exists($class)) {
return null;
}
$user = $class::find()->id($id)->one();
if (empty($user) || !($user instanceof User)) {
throw new BadRequestHttpException(Yii::t('use... | [
"protected",
"function",
"getUser",
"(",
"$",
"id",
")",
"{",
"$",
"class",
"=",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"identityClass",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
... | Get user by ID.
@param string $id User ID.
@return User
@throws BadRequestHttpException throw if user not found. | [
"Get",
"user",
"by",
"ID",
"."
] | train | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/web/admin/controllers/UserController.php#L196-L207 |
rhosocial/yii2-user | web/admin/controllers/UserController.php | UserController.actionDeregister | public function actionDeregister($id)
{
$id = (int)$id;
if (Yii::$app->user->identity->getID() == $id) {
throw new ForbiddenHttpException(Yii::t('user', 'You cannot deregister yourself.'));
}
$user = $this->getUser($id);
try {
$result = $user->deregist... | php | public function actionDeregister($id)
{
$id = (int)$id;
if (Yii::$app->user->identity->getID() == $id) {
throw new ForbiddenHttpException(Yii::t('user', 'You cannot deregister yourself.'));
}
$user = $this->getUser($id);
try {
$result = $user->deregist... | [
"public",
"function",
"actionDeregister",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"(",
"int",
")",
"$",
"id",
";",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"identity",
"->",
"getID",
"(",
")",
"==",
"$",
"id",
")",
"{",
"throw"... | Deregister User.
@param string $id User ID.
@return string
@throws ServerErrorHttpException
@throws ForbiddenHttpException | [
"Deregister",
"User",
"."
] | train | https://github.com/rhosocial/yii2-user/blob/96737a9d8ca7e9c42cd2b7736d6c0a90ede6e5bc/web/admin/controllers/UserController.php#L216-L237 |
gregoryv/php-logger | src/ConsoleWriter.php | ConsoleWriter.swrite | public function swrite($severity, $message='')
{
if($severity <= LOG_ERR) {
fwrite(STDERR, $message . "\n");
} else {
fwrite(STDOUT, $message . "\n");
}
} | php | public function swrite($severity, $message='')
{
if($severity <= LOG_ERR) {
fwrite(STDERR, $message . "\n");
} else {
fwrite(STDOUT, $message . "\n");
}
} | [
"public",
"function",
"swrite",
"(",
"$",
"severity",
",",
"$",
"message",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"severity",
"<=",
"LOG_ERR",
")",
"{",
"fwrite",
"(",
"STDERR",
",",
"$",
"message",
".",
"\"\\n\"",
")",
";",
"}",
"else",
"{",
"fwrite... | If severity is equal or lower than LOG_ERR then the message is written
to STDERR, otherwise STDOUT is used. | [
"If",
"severity",
"is",
"equal",
"or",
"lower",
"than",
"LOG_ERR",
"then",
"the",
"message",
"is",
"written",
"to",
"STDERR",
"otherwise",
"STDOUT",
"is",
"used",
"."
] | train | https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/ConsoleWriter.php#L17-L24 |
ZayconFoods/whatcounts | src/ZayconWhatCounts/Folder.php | Folder.setFolderId | public function setFolderId( $folder_id )
{
$this->folder_id = (is_numeric($folder_id)) ? abs(round($folder_id)) : NULL;
return $this;
} | php | public function setFolderId( $folder_id )
{
$this->folder_id = (is_numeric($folder_id)) ? abs(round($folder_id)) : NULL;
return $this;
} | [
"public",
"function",
"setFolderId",
"(",
"$",
"folder_id",
")",
"{",
"$",
"this",
"->",
"folder_id",
"=",
"(",
"is_numeric",
"(",
"$",
"folder_id",
")",
")",
"?",
"abs",
"(",
"round",
"(",
"$",
"folder_id",
")",
")",
":",
"NULL",
";",
"return",
"$",... | @param mixed $folder_id
@return Folder | [
"@param",
"mixed",
"$folder_id"
] | train | https://github.com/ZayconFoods/whatcounts/blob/ff18491fc152571a72e4b558f8102f4fbb9bb7fd/src/ZayconWhatCounts/Folder.php#L36-L41 |
ZayconFoods/whatcounts | src/ZayconWhatCounts/Folder.php | Folder.setFolderType | public function setFolderType( $folder_type )
{
$this->folder_type = (in_array($folder_type, $this->folder_types)) ? $folder_type : NULL;
return $this;
} | php | public function setFolderType( $folder_type )
{
$this->folder_type = (in_array($folder_type, $this->folder_types)) ? $folder_type : NULL;
return $this;
} | [
"public",
"function",
"setFolderType",
"(",
"$",
"folder_type",
")",
"{",
"$",
"this",
"->",
"folder_type",
"=",
"(",
"in_array",
"(",
"$",
"folder_type",
",",
"$",
"this",
"->",
"folder_types",
")",
")",
"?",
"$",
"folder_type",
":",
"NULL",
";",
"retur... | @param mixed $folder_type
@return Folder | [
"@param",
"mixed",
"$folder_type"
] | train | https://github.com/ZayconFoods/whatcounts/blob/ff18491fc152571a72e4b558f8102f4fbb9bb7fd/src/ZayconWhatCounts/Folder.php#L76-L81 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.