id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
27,000
antonmedv/purephp
src/Server.php
Server.onConnection
public function onConnection(ConnectionInterface $connection) { $this->log('New connection from ' . $connection->getRemoteAddress()); $buffer = ''; $connection->on('data', function ($data) use (&$buffer, &$connection) { $buffer .= $data; if (strpos($buffer, Client::...
php
public function onConnection(ConnectionInterface $connection) { $this->log('New connection from ' . $connection->getRemoteAddress()); $buffer = ''; $connection->on('data', function ($data) use (&$buffer, &$connection) { $buffer .= $data; if (strpos($buffer, Client::...
[ "public", "function", "onConnection", "(", "ConnectionInterface", "$", "connection", ")", "{", "$", "this", "->", "log", "(", "'New connection from '", ".", "$", "connection", "->", "getRemoteAddress", "(", ")", ")", ";", "$", "buffer", "=", "''", ";", "$", ...
On every new connection add event handler to receive commands from clients. @param ConnectionInterface $connection
[ "On", "every", "new", "connection", "add", "event", "handler", "to", "receive", "commands", "from", "clients", "." ]
05aa6b44cea9b0457ec1e5e67e8278cd89d47f21
https://github.com/antonmedv/purephp/blob/05aa6b44cea9b0457ec1e5e67e8278cd89d47f21/src/Server.php#L87-L106
27,001
antonmedv/purephp
src/Server.php
Server.runCommand
private function runCommand($arguments, ConnectionInterface $connection) { try { $commandClass = array_shift($arguments); if (null !== $this->getLogger()) { $this->log( 'Command from ' . $connection->getRemoteAddress() . ": [$...
php
private function runCommand($arguments, ConnectionInterface $connection) { try { $commandClass = array_shift($arguments); if (null !== $this->getLogger()) { $this->log( 'Command from ' . $connection->getRemoteAddress() . ": [$...
[ "private", "function", "runCommand", "(", "$", "arguments", ",", "ConnectionInterface", "$", "connection", ")", "{", "try", "{", "$", "commandClass", "=", "array_shift", "(", "$", "arguments", ")", ";", "if", "(", "null", "!==", "$", "this", "->", "getLogg...
Detect and run command received from client. @param array $arguments @param ConnectionInterface $connection
[ "Detect", "and", "run", "command", "received", "from", "client", "." ]
05aa6b44cea9b0457ec1e5e67e8278cd89d47f21
https://github.com/antonmedv/purephp/blob/05aa6b44cea9b0457ec1e5e67e8278cd89d47f21/src/Server.php#L113-L156
27,002
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Attribute/Import/Xml/Standard.php
Standard.getItems
protected function getItems( array $nodes, array $ref ) { $keys = []; foreach( $nodes as $node ) { if( ( $attr = $node->attributes->getNamedItem( 'ref' ) ) !== null ) { $keys[] = $attr->nodeValue; } } $manager = \Aimeos\MShop::create( $this->getContext(), 'attribute' ); $search = $manager->crea...
php
protected function getItems( array $nodes, array $ref ) { $keys = []; foreach( $nodes as $node ) { if( ( $attr = $node->attributes->getNamedItem( 'ref' ) ) !== null ) { $keys[] = $attr->nodeValue; } } $manager = \Aimeos\MShop::create( $this->getContext(), 'attribute' ); $search = $manager->crea...
[ "protected", "function", "getItems", "(", "array", "$", "nodes", ",", "array", "$", "ref", ")", "{", "$", "keys", "=", "[", "]", ";", "foreach", "(", "$", "nodes", "as", "$", "node", ")", "{", "if", "(", "(", "$", "attr", "=", "$", "node", "->"...
Returns the attribute items for the given nodes @param \DomElement[] $nodes List of XML attribute item nodes @param string[] $ref Domain names of referenced items that should be fetched too @return \Aimeos\MShop\Attribute\Item\Iface[] Associative list of attribute items with IDs as keys
[ "Returns", "the", "attribute", "items", "for", "the", "given", "nodes" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Attribute/Import/Xml/Standard.php#L134-L150
27,003
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Export/Sitemap/Standard.php
Standard.addItems
protected function addItems( \Aimeos\MW\Container\Content\Iface $content, array $items ) { $config = $this->getContext()->getConfig(); /** controller/jobs/product/export/sitemap/changefreq * Change frequency of the products * * Depending on how often the product content changes (e.g. price updates) * ...
php
protected function addItems( \Aimeos\MW\Container\Content\Iface $content, array $items ) { $config = $this->getContext()->getConfig(); /** controller/jobs/product/export/sitemap/changefreq * Change frequency of the products * * Depending on how often the product content changes (e.g. price updates) * ...
[ "protected", "function", "addItems", "(", "\\", "Aimeos", "\\", "MW", "\\", "Container", "\\", "Content", "\\", "Iface", "$", "content", ",", "array", "$", "items", ")", "{", "$", "config", "=", "$", "this", "->", "getContext", "(", ")", "->", "getConf...
Adds the given products to the content object for the site map file @param \Aimeos\MW\Container\Content\Iface $content File content object @param \Aimeos\MShop\Product\Item\Iface[] $items List of product items
[ "Adds", "the", "given", "products", "to", "the", "content", "object", "for", "the", "site", "map", "file" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Export/Sitemap/Standard.php#L68-L133
27,004
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Export/Sitemap/Standard.php
Standard.getConfig
protected function getConfig( $name, $default = null ) { $config = $this->getContext()->getConfig(); switch( $name ) { case 'domains': /** controller/jobs/product/export/sitemap/domains * List of associated items from other domains that should be fetched for the sitemap * * Products consis...
php
protected function getConfig( $name, $default = null ) { $config = $this->getContext()->getConfig(); switch( $name ) { case 'domains': /** controller/jobs/product/export/sitemap/domains * List of associated items from other domains that should be fetched for the sitemap * * Products consis...
[ "protected", "function", "getConfig", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "$", "config", "=", "$", "this", "->", "getContext", "(", ")", "->", "getConfig", "(", ")", ";", "switch", "(", "$", "name", ")", "{", "case", "'dom...
Returns the configuration value for the given name @param string $name One of "domain", "max-items" or "max-query" @param mixed $default Default value if name is unknown @return mixed Configuration value
[ "Returns", "the", "configuration", "value", "for", "the", "given", "name" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Export/Sitemap/Standard.php#L402-L480
27,005
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Customer/Import/Xml/Standard.php
Standard.process
protected function process( \Aimeos\MShop\Customer\Item\Iface $item, \DomElement $node ) { $list = []; foreach( $node->attributes as $attr ) { $list[$attr->nodeName] = $attr->nodeValue; } foreach( $node->childNodes as $tag ) { if( in_array( $tag->nodeName, ['address', 'lists', 'property', 'group'] ) ...
php
protected function process( \Aimeos\MShop\Customer\Item\Iface $item, \DomElement $node ) { $list = []; foreach( $node->attributes as $attr ) { $list[$attr->nodeName] = $attr->nodeValue; } foreach( $node->childNodes as $tag ) { if( in_array( $tag->nodeName, ['address', 'lists', 'property', 'group'] ) ...
[ "protected", "function", "process", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Customer", "\\", "Item", "\\", "Iface", "$", "item", ",", "\\", "DomElement", "$", "node", ")", "{", "$", "list", "=", "[", "]", ";", "foreach", "(", "$", "node", "->", ...
Updates the customer item and its referenced items using the given DOM node @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object to update @param \DomElement $node DOM node used for updateding the customer item @return \Aimeos\MShop\Customer\Item\Iface $item Updated customer item object
[ "Updates", "the", "customer", "item", "and", "its", "referenced", "items", "using", "the", "given", "DOM", "node" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Customer/Import/Xml/Standard.php#L294-L312
27,006
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Coupon/Import/Csv/Code/Standard.php
Standard.import
protected function import( array $items, array $data, $couponId, \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $processor ) { $errors = 0; $context = $this->getContext(); $manager = \Aimeos\MShop::create( $context, 'coupon/code' ); foreach( $data as $code => $list ) { $manager->begin(); ...
php
protected function import( array $items, array $data, $couponId, \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface $processor ) { $errors = 0; $context = $this->getContext(); $manager = \Aimeos\MShop::create( $context, 'coupon/code' ); foreach( $data as $code => $list ) { $manager->begin(); ...
[ "protected", "function", "import", "(", "array", "$", "items", ",", "array", "$", "data", ",", "$", "couponId", ",", "\\", "Aimeos", "\\", "Controller", "\\", "Common", "\\", "Coupon", "\\", "Import", "\\", "Csv", "\\", "Processor", "\\", "Iface", "$", ...
Imports the CSV data and creates new coupons or updates existing ones @param \Aimeos\MShop\Coupon\Item\Code\Iface[] $items List of coupons code items @param array $data Associative list of import data as index/value pairs @param string $couponId ID of the coupon item the coupon code should be added to @param \Aimeos\C...
[ "Imports", "the", "CSV", "data", "and", "creates", "new", "coupons", "or", "updates", "existing", "ones" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Coupon/Import/Csv/Code/Standard.php#L278-L314
27,007
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Coupon/Import/Csv/Base.php
Base.getData
protected function getData( \Aimeos\MW\Container\Content\Iface $content, $maxcnt, $codePos ) { $count = 0; $data = []; while( $content->valid() && $count++ < $maxcnt ) { $row = $content->current(); $data[$row[$codePos]] = $row; $content->next(); } return $data; }
php
protected function getData( \Aimeos\MW\Container\Content\Iface $content, $maxcnt, $codePos ) { $count = 0; $data = []; while( $content->valid() && $count++ < $maxcnt ) { $row = $content->current(); $data[$row[$codePos]] = $row; $content->next(); } return $data; }
[ "protected", "function", "getData", "(", "\\", "Aimeos", "\\", "MW", "\\", "Container", "\\", "Content", "\\", "Iface", "$", "content", ",", "$", "maxcnt", ",", "$", "codePos", ")", "{", "$", "count", "=", "0", ";", "$", "data", "=", "[", "]", ";",...
Returns the rows from the CSV file up to the maximum count @param \Aimeos\MW\Container\Content\Iface $content CSV content object @param integer $maxcnt Maximum number of rows that should be retrieved at once @param integer $codePos Column position which contains the unique coupon code (starting from 0) @return array L...
[ "Returns", "the", "rows", "from", "the", "CSV", "file", "up", "to", "the", "maximum", "count" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Coupon/Import/Csv/Base.php#L54-L67
27,008
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Coupon/Import/Csv/Base.php
Base.getMappedChunk
protected function getMappedChunk( array &$data, array $mapping ) { $idx = 0; $map = []; foreach( $mapping as $pos => $key ) { if( isset( $map[$idx][$key] ) ) { $idx++; } if( isset( $data[$pos] ) ) { $map[$idx][$key] = $data[$pos]; unset( $data[$pos] ); } } return $map; }
php
protected function getMappedChunk( array &$data, array $mapping ) { $idx = 0; $map = []; foreach( $mapping as $pos => $key ) { if( isset( $map[$idx][$key] ) ) { $idx++; } if( isset( $data[$pos] ) ) { $map[$idx][$key] = $data[$pos]; unset( $data[$pos] ); } } return $map; }
[ "protected", "function", "getMappedChunk", "(", "array", "&", "$", "data", ",", "array", "$", "mapping", ")", "{", "$", "idx", "=", "0", ";", "$", "map", "=", "[", "]", ";", "foreach", "(", "$", "mapping", "as", "$", "pos", "=>", "$", "key", ")",...
Returns the mapped data from the CSV line @param array $data List of CSV fields with position as key and domain item key as value (mapped data is removed) @param array $mapping List of domain item keys with the CSV field position as key @return array List of associative arrays containing the chunked properties
[ "Returns", "the", "mapped", "data", "from", "the", "CSV", "line" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Coupon/Import/Csv/Base.php#L101-L120
27,009
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Coupon/Import/Csv/Base.php
Base.getProcessors
protected function getProcessors( array $mappings ) { $context = $this->getContext(); $config = $context->getConfig(); $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done( $context, [] ); foreach( $mappings as $type => $mapping ) { if( ctype_alnum( $type ) === false ) { $class...
php
protected function getProcessors( array $mappings ) { $context = $this->getContext(); $config = $context->getConfig(); $object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done( $context, [] ); foreach( $mappings as $type => $mapping ) { if( ctype_alnum( $type ) === false ) { $class...
[ "protected", "function", "getProcessors", "(", "array", "$", "mappings", ")", "{", "$", "context", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "config", "=", "$", "context", "->", "getConfig", "(", ")", ";", "$", "object", "=", "new", "...
Returns the processor object for saving the coupon related information @param array $mappings Associative list of processor types as keys and index/data mappings as values @return \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface Processor object
[ "Returns", "the", "processor", "object", "for", "saving", "the", "coupon", "related", "information" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Coupon/Import/Csv/Base.php#L129-L163
27,010
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Catalog/Export/Sitemap/Standard.php
Standard.createContent
protected function createContent( \Aimeos\MW\Container\Iface $container, $filenum ) { /** controller/jobs/catalog/export/sitemap/standard/template-header * Relative path to the XML site map header template of the catalog site map job controller. * * The template file contains the XML code and processing ins...
php
protected function createContent( \Aimeos\MW\Container\Iface $container, $filenum ) { /** controller/jobs/catalog/export/sitemap/standard/template-header * Relative path to the XML site map header template of the catalog site map job controller. * * The template file contains the XML code and processing ins...
[ "protected", "function", "createContent", "(", "\\", "Aimeos", "\\", "MW", "\\", "Container", "\\", "Iface", "$", "container", ",", "$", "filenum", ")", "{", "/** controller/jobs/catalog/export/sitemap/standard/template-header\n\t\t * Relative path to the XML site map header te...
Creates a new site map content object @param \Aimeos\MW\Container\Iface $container Container object @param integer $filenum New file number @return \Aimeos\MW\Container\Content\Iface New content object
[ "Creates", "a", "new", "site", "map", "content", "object" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Catalog/Export/Sitemap/Standard.php#L218-L253
27,011
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Catalog/Export/Sitemap/Standard.php
Standard.closeContent
protected function closeContent( \Aimeos\MW\Container\Content\Iface $content ) { /** controller/jobs/catalog/export/sitemap/standard/template-footer * Relative path to the XML site map footer template of the catalog site map job controller. * * The template file contains the XML code and processing instruct...
php
protected function closeContent( \Aimeos\MW\Container\Content\Iface $content ) { /** controller/jobs/catalog/export/sitemap/standard/template-footer * Relative path to the XML site map footer template of the catalog site map job controller. * * The template file contains the XML code and processing instruct...
[ "protected", "function", "closeContent", "(", "\\", "Aimeos", "\\", "MW", "\\", "Container", "\\", "Content", "\\", "Iface", "$", "content", ")", "{", "/** controller/jobs/catalog/export/sitemap/standard/template-footer\n\t\t * Relative path to the XML site map footer template of...
Closes the site map content object @param \Aimeos\MW\Container\Content\Iface $content
[ "Closes", "the", "site", "map", "content", "object" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Catalog/Export/Sitemap/Standard.php#L261-L292
27,012
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Catalog/Export/Sitemap/Standard.php
Standard.createSitemapIndex
protected function createSitemapIndex( \Aimeos\MW\Container\Iface $container, array $files ) { /** controller/jobs/catalog/export/sitemap/standard/template-index * Relative path to the XML site map index template of the catalog site map job controller. * * The template file contains the XML code and process...
php
protected function createSitemapIndex( \Aimeos\MW\Container\Iface $container, array $files ) { /** controller/jobs/catalog/export/sitemap/standard/template-index * Relative path to the XML site map index template of the catalog site map job controller. * * The template file contains the XML code and process...
[ "protected", "function", "createSitemapIndex", "(", "\\", "Aimeos", "\\", "MW", "\\", "Container", "\\", "Iface", "$", "container", ",", "array", "$", "files", ")", "{", "/** controller/jobs/catalog/export/sitemap/standard/template-index\n\t\t * Relative path to the XML site ...
Adds the content for the site map index file @param \Aimeos\MW\Container\Iface $container File container object @param array $files List of generated site map file names
[ "Adds", "the", "content", "for", "the", "site", "map", "index", "file" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Catalog/Export/Sitemap/Standard.php#L301-L336
27,013
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Product/Import/Csv/Base.php
Base.convertData
protected function convertData( array $convlist, array $data ) { foreach( $convlist as $idx => $converter ) { foreach( $data as $code => $list ) { if( isset( $list[$idx] ) ) { $data[$code][$idx] = $converter->translate( $list[$idx] ); } } } return $data; }
php
protected function convertData( array $convlist, array $data ) { foreach( $convlist as $idx => $converter ) { foreach( $data as $code => $list ) { if( isset( $list[$idx] ) ) { $data[$code][$idx] = $converter->translate( $list[$idx] ); } } } return $data; }
[ "protected", "function", "convertData", "(", "array", "$", "convlist", ",", "array", "$", "data", ")", "{", "foreach", "(", "$", "convlist", "as", "$", "idx", "=>", "$", "converter", ")", "{", "foreach", "(", "$", "data", "as", "$", "code", "=>", "$"...
Converts the CSV field data using the available converter objects @param array $convlist Associative list of CSV field indexes and converter objects @param array $data Associative list of product codes and lists of CSV field indexes and their data @return array Associative list of CSV field indexes and their converted...
[ "Converts", "the", "CSV", "field", "data", "using", "the", "available", "converter", "objects" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Product/Import/Csv/Base.php#L30-L43
27,014
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Product/Import/Csv/Base.php
Base.getCache
protected function getCache( $type, $name = null ) { $context = $this->getContext(); $config = $context->getConfig(); if( ctype_alnum( $type ) === false ) { $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\' . $type : '<not a string>'; throw new \Aimeos\Contr...
php
protected function getCache( $type, $name = null ) { $context = $this->getContext(); $config = $context->getConfig(); if( ctype_alnum( $type ) === false ) { $classname = is_string( $name ) ? '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\' . $type : '<not a string>'; throw new \Aimeos\Contr...
[ "protected", "function", "getCache", "(", "$", "type", ",", "$", "name", "=", "null", ")", "{", "$", "context", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "config", "=", "$", "context", "->", "getConfig", "(", ")", ";", "if", "(", ...
Returns the cache object for the given type @param string $type Type of the cached data @param string|null Name of the cache implementation @return \Aimeos\Controller\Common\Product\Import\Csv\Cache\Iface Cache object
[ "Returns", "the", "cache", "object", "for", "the", "given", "type" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Product/Import/Csv/Base.php#L53-L85
27,015
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Product/Import/Csv/Base.php
Base.getConverterList
protected function getConverterList( array $convmap ) { $convlist = []; foreach( $convmap as $idx => $name ) { $convlist[$idx] = \Aimeos\MW\Convert\Factory::createConverter( $name ); } return $convlist; }
php
protected function getConverterList( array $convmap ) { $convlist = []; foreach( $convmap as $idx => $name ) { $convlist[$idx] = \Aimeos\MW\Convert\Factory::createConverter( $name ); } return $convlist; }
[ "protected", "function", "getConverterList", "(", "array", "$", "convmap", ")", "{", "$", "convlist", "=", "[", "]", ";", "foreach", "(", "$", "convmap", "as", "$", "idx", "=>", "$", "name", ")", "{", "$", "convlist", "[", "$", "idx", "]", "=", "\\...
Returns the list of converter objects based on the given converter map @param array $convmap List of converter names for the values at the position in the CSV file @return array Associative list of positions and converter objects
[ "Returns", "the", "list", "of", "converter", "objects", "based", "on", "the", "given", "converter", "map" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Product/Import/Csv/Base.php#L94-L103
27,016
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Product/Import/Csv/Base.php
Base.getProducts
protected function getProducts( array $codes, array $domains ) { $result = []; $manager = \Aimeos\MShop::create( $this->getContext(), 'product' ); $search = $manager->createSearch(); $search->setConditions( $search->compare( '==', 'product.code', $codes ) ); $search->setSlice( 0, count( $codes ) ); forea...
php
protected function getProducts( array $codes, array $domains ) { $result = []; $manager = \Aimeos\MShop::create( $this->getContext(), 'product' ); $search = $manager->createSearch(); $search->setConditions( $search->compare( '==', 'product.code', $codes ) ); $search->setSlice( 0, count( $codes ) ); forea...
[ "protected", "function", "getProducts", "(", "array", "$", "codes", ",", "array", "$", "domains", ")", "{", "$", "result", "=", "[", "]", ";", "$", "manager", "=", "\\", "Aimeos", "\\", "MShop", "::", "create", "(", "$", "this", "->", "getContext", "...
Returns the product items for the given codes @param array $codes List of product codes @param array $domains List of domains whose items should be fetched too @return array Associative list of product codes as key and product items as value
[ "Returns", "the", "product", "items", "for", "the", "given", "codes" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Product/Import/Csv/Base.php#L293-L307
27,017
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php
Standard.addJob
protected function addJob( $context, $path ) { $manager = \Aimeos\MAdmin::create( $context, 'job' ); $item = $manager->createItem(); $item->setResult( ['file' => $path] ); $item->setLabel( $path ); $manager->saveItem( $item, false ); }
php
protected function addJob( $context, $path ) { $manager = \Aimeos\MAdmin::create( $context, 'job' ); $item = $manager->createItem(); $item->setResult( ['file' => $path] ); $item->setLabel( $path ); $manager->saveItem( $item, false ); }
[ "protected", "function", "addJob", "(", "$", "context", ",", "$", "path", ")", "{", "$", "manager", "=", "\\", "Aimeos", "\\", "MAdmin", "::", "create", "(", "$", "context", ",", "'job'", ")", ";", "$", "item", "=", "$", "manager", "->", "createItem"...
Creates a new job entry for the exported file @param \Aimeos\MShop\Context\Item\Iface $context Context item @param string $path Absolute path to the exported file
[ "Creates", "a", "new", "job", "entry", "for", "the", "exported", "file" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php#L142-L151
27,018
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php
Standard.getContainer
protected function getContainer() { $config = $this->getContext()->getConfig(); /** controller/jobs/subscription/export/csv/location * Temporary file or directory where the content is stored which should be exported * * The path can point to any supported container format as long as the * content is i...
php
protected function getContainer() { $config = $this->getContext()->getConfig(); /** controller/jobs/subscription/export/csv/location * Temporary file or directory where the content is stored which should be exported * * The path can point to any supported container format as long as the * content is i...
[ "protected", "function", "getContainer", "(", ")", "{", "$", "config", "=", "$", "this", "->", "getContext", "(", ")", "->", "getConfig", "(", ")", ";", "/** controller/jobs/subscription/export/csv/location\n\t\t * Temporary file or directory where the content is stored which...
Opens and returns the container which includes the subscription data @return \Aimeos\MW\Container\Iface Container object
[ "Opens", "and", "returns", "the", "container", "which", "includes", "the", "subscription", "data" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php#L159-L245
27,019
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php
Standard.export
protected function export( array $processors, $msg, $maxcnt ) { $lcontext = $this->getLocaleContext( $msg ); $baseRef = ['order/base/address', 'order/base/product']; $manager = \Aimeos\MShop::create( $lcontext, 'subscription' ); $baseManager = \Aimeos\MShop::create( $lcontext, 'order/base' ); $container = ...
php
protected function export( array $processors, $msg, $maxcnt ) { $lcontext = $this->getLocaleContext( $msg ); $baseRef = ['order/base/address', 'order/base/product']; $manager = \Aimeos\MShop::create( $lcontext, 'subscription' ); $baseManager = \Aimeos\MShop::create( $lcontext, 'order/base' ); $container = ...
[ "protected", "function", "export", "(", "array", "$", "processors", ",", "$", "msg", ",", "$", "maxcnt", ")", "{", "$", "lcontext", "=", "$", "this", "->", "getLocaleContext", "(", "$", "msg", ")", ";", "$", "baseRef", "=", "[", "'order/base/address'", ...
Exports the subscriptions and returns the exported file name @param Aimeos\Controller\Common\Subscription\Export\Csv\Processor\Iface[] List of processor objects @param array $msg Message data passed from the frontend @param integer $maxcnt Maximum number of retrieved subscriptions at once @return string Path of the fi...
[ "Exports", "the", "subscriptions", "and", "returns", "the", "exported", "file", "name" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php#L256-L306
27,020
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php
Standard.getLocaleContext
protected function getLocaleContext( array $msg ) { $lcontext = clone $this->getContext(); $manager = \Aimeos\MShop::create( $lcontext, 'locale' ); $sitecode = ( isset( $msg['sitecode'] ) ? $msg['sitecode'] : 'default' ); $localeItem = $manager->bootstrap( $sitecode, '', '', false, \Aimeos\MShop\Locale\Manage...
php
protected function getLocaleContext( array $msg ) { $lcontext = clone $this->getContext(); $manager = \Aimeos\MShop::create( $lcontext, 'locale' ); $sitecode = ( isset( $msg['sitecode'] ) ? $msg['sitecode'] : 'default' ); $localeItem = $manager->bootstrap( $sitecode, '', '', false, \Aimeos\MShop\Locale\Manage...
[ "protected", "function", "getLocaleContext", "(", "array", "$", "msg", ")", "{", "$", "lcontext", "=", "clone", "$", "this", "->", "getContext", "(", ")", ";", "$", "manager", "=", "\\", "Aimeos", "\\", "MShop", "::", "create", "(", "$", "lcontext", ",...
Returns a new context including the locale from the message data @param array $msg Message data including a "sitecode" value @return \Aimeos\MShop\Context\Item\Iface New context item with updated locale
[ "Returns", "a", "new", "context", "including", "the", "locale", "from", "the", "message", "data" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php#L315-L324
27,021
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php
Standard.initCriteria
protected function initCriteria( \Aimeos\MW\Criteria\Iface $criteria, array $msg ) { if( isset( $msg['filter'] ) ) { $criteria->setConditions( $criteria->toConditions( $msg['filter'] ) ); } if( isset( $msg['sort'] ) ) { $criteria->setSortations( $criteria->toSortations( $msg['sort'] ) ); } return $cr...
php
protected function initCriteria( \Aimeos\MW\Criteria\Iface $criteria, array $msg ) { if( isset( $msg['filter'] ) ) { $criteria->setConditions( $criteria->toConditions( $msg['filter'] ) ); } if( isset( $msg['sort'] ) ) { $criteria->setSortations( $criteria->toSortations( $msg['sort'] ) ); } return $cr...
[ "protected", "function", "initCriteria", "(", "\\", "Aimeos", "\\", "MW", "\\", "Criteria", "\\", "Iface", "$", "criteria", ",", "array", "$", "msg", ")", "{", "if", "(", "isset", "(", "$", "msg", "[", "'filter'", "]", ")", ")", "{", "$", "criteria",...
Initializes the search criteria @param \Aimeos\MW\Criteria\Iface $criteria New criteria object @param array $msg Message data @return \Aimeos\MW\Criteria\Iface Initialized criteria object
[ "Initializes", "the", "search", "criteria" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php#L334-L345
27,022
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php
Standard.moveFile
protected function moveFile( $context, $path ) { $filename = basename( $path ); $context->getFileSystemManager()->get( 'fs-admin' )->writef( $filename, $path ); unlink( $path ); return $filename; }
php
protected function moveFile( $context, $path ) { $filename = basename( $path ); $context->getFileSystemManager()->get( 'fs-admin' )->writef( $filename, $path ); unlink( $path ); return $filename; }
[ "protected", "function", "moveFile", "(", "$", "context", ",", "$", "path", ")", "{", "$", "filename", "=", "basename", "(", "$", "path", ")", ";", "$", "context", "->", "getFileSystemManager", "(", ")", "->", "get", "(", "'fs-admin'", ")", "->", "writ...
Moves the exported file to the final storage @param \Aimeos\MShop\Context\Item\Iface $context Context item @param string $path Absolute path to the exported file @return string Relative path of the file in the storage
[ "Moves", "the", "exported", "file", "to", "the", "final", "storage" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Subscription/Export/Csv/Standard.php#L355-L362
27,023
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Subscription/Process/Processor/Cgroup/Standard.php
Standard.begin
public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription ) { if( empty( $this->groupIds ) ) { return; } $context = $this->getContext(); $manager = \Aimeos\MShop::create( $context, 'customer' ); $baseManager = \Aimeos\MShop::create( $context, 'order/base' ); $baseItem = $baseManager-...
php
public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription ) { if( empty( $this->groupIds ) ) { return; } $context = $this->getContext(); $manager = \Aimeos\MShop::create( $context, 'customer' ); $baseManager = \Aimeos\MShop::create( $context, 'order/base' ); $baseItem = $baseManager-...
[ "public", "function", "begin", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Subscription", "\\", "Item", "\\", "Iface", "$", "subscription", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "groupIds", ")", ")", "{", "return", ";", "}", "$", "cont...
Processes the initial subscription @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
[ "Processes", "the", "initial", "subscription" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Subscription/Process/Processor/Cgroup/Standard.php#L69-L85
27,024
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Bought/Standard.php
Standard.getSuggestions
protected function getSuggestions( $id, $prodIds, $count, $total, $maxItems, $minSupport, $minConfidence, $date ) { $refIds = []; $context = $this->getContext(); $catalogListManager = \Aimeos\MShop::create( $context, 'catalog/lists' ); $baseProductManager = \Aimeos\MShop::create( $context, 'order/base/product...
php
protected function getSuggestions( $id, $prodIds, $count, $total, $maxItems, $minSupport, $minConfidence, $date ) { $refIds = []; $context = $this->getContext(); $catalogListManager = \Aimeos\MShop::create( $context, 'catalog/lists' ); $baseProductManager = \Aimeos\MShop::create( $context, 'order/base/product...
[ "protected", "function", "getSuggestions", "(", "$", "id", ",", "$", "prodIds", ",", "$", "count", ",", "$", "total", ",", "$", "maxItems", ",", "$", "minSupport", ",", "$", "minConfidence", ",", "$", "date", ")", "{", "$", "refIds", "=", "[", "]", ...
Returns the IDs of the suggested products. @param string $id Product ID to calculate the suggestions for @param string[] $prodIds List of product IDs to create suggestions for @param integer $count Number of ordered products @param integer $total Total number of orders @param integer $maxItems Maximum number of sugges...
[ "Returns", "the", "IDs", "of", "the", "suggested", "products", "." ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Bought/Standard.php#L206-L259
27,025
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Bought/Standard.php
Standard.addListItems
protected function addListItems( $productId, array $productIds ) { if( empty( $productIds ) ) { return; } $manager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); $item = $manager->createItem(); foreach( $productIds as $pos => $refid ) { $item->setId( null ); $item->setParentId(...
php
protected function addListItems( $productId, array $productIds ) { if( empty( $productIds ) ) { return; } $manager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); $item = $manager->createItem(); foreach( $productIds as $pos => $refid ) { $item->setId( null ); $item->setParentId(...
[ "protected", "function", "addListItems", "(", "$", "productId", ",", "array", "$", "productIds", ")", "{", "if", "(", "empty", "(", "$", "productIds", ")", ")", "{", "return", ";", "}", "$", "manager", "=", "\\", "Aimeos", "\\", "MShop", "::", "create"...
Adds products as referenced products to the product list. @param string $productId Unique ID of the product the given products should be referenced to @param array $productIds List of position as key and product ID as value
[ "Adds", "products", "as", "referenced", "products", "to", "the", "product", "list", "." ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Bought/Standard.php#L268-L289
27,026
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Bought/Standard.php
Standard.removeListItems
protected function removeListItems( $productId ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); $search = $manager->createSearch(); $expr = array( $search->compare( '==', 'product.lists.parentid', $productId ), $search->compare( '==', 'product.lists.domain', 'product' ), $s...
php
protected function removeListItems( $productId ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); $search = $manager->createSearch(); $expr = array( $search->compare( '==', 'product.lists.parentid', $productId ), $search->compare( '==', 'product.lists.domain', 'product' ), $s...
[ "protected", "function", "removeListItems", "(", "$", "productId", ")", "{", "$", "manager", "=", "\\", "Aimeos", "\\", "MShop", "::", "create", "(", "$", "this", "->", "getContext", "(", ")", ",", "'product/lists'", ")", ";", "$", "search", "=", "$", ...
Remove all suggested products from product list. @param string $productId Unique ID of the product the references should be removed from
[ "Remove", "all", "suggested", "products", "from", "product", "list", "." ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Bought/Standard.php#L297-L312
27,027
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Subscription/Process/Base.php
Base.getProcessors
protected function getProcessors( array $pnames ) { $list = []; $context = $this->getContext(); $config = $context->getConfig(); foreach( $pnames as $pname ) { if( ctype_alnum( $pname ) === false ) { $classname = is_string( $pname ) ? '\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor...
php
protected function getProcessors( array $pnames ) { $list = []; $context = $this->getContext(); $config = $context->getConfig(); foreach( $pnames as $pname ) { if( ctype_alnum( $pname ) === false ) { $classname = is_string( $pname ) ? '\\Aimeos\\Controller\\Common\\Subscription\\Process\\Processor...
[ "protected", "function", "getProcessors", "(", "array", "$", "pnames", ")", "{", "$", "list", "=", "[", "]", ";", "$", "context", "=", "$", "this", "->", "getContext", "(", ")", ";", "$", "config", "=", "$", "context", "->", "getConfig", "(", ")", ...
Returns the processor object for managing the subscription resources @param array $pnames List of processor names @return \Aimeos\Controller\Common\Subscription\Export\Csv\Processor\Iface Processor object
[ "Returns", "the", "processor", "object", "for", "managing", "the", "subscription", "resources" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Subscription/Process/Base.php#L30-L66
27,028
pr-of-it/t4
framework/Mvc/Router.php
Router.splitRequestPath
protected function splitRequestPath($path) { // Domain part extract $parts = explode('!', $path); if (count($parts) > 1) { $domain = $parts[0]; $path = $parts[1]; } else { $domain = null; } $parts = parse_url($path); $baseP...
php
protected function splitRequestPath($path) { // Domain part extract $parts = explode('!', $path); if (count($parts) > 1) { $domain = $parts[0]; $path = $parts[1]; } else { $domain = null; } $parts = parse_url($path); $baseP...
[ "protected", "function", "splitRequestPath", "(", "$", "path", ")", "{", "// Domain part extract", "$", "parts", "=", "explode", "(", "'!'", ",", "$", "path", ")", ";", "if", "(", "count", "(", "$", "parts", ")", ">", "1", ")", "{", "$", "domain", "=...
Splits canonical request path into domain, path and extension @param string $path @return \T4\Mvc\Route
[ "Splits", "canonical", "request", "path", "into", "domain", "path", "and", "extension" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Router.php#L103-L133
27,029
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php
CKFinder_Connector_Core_ResourceTypeConfig.checkExtension
public function checkExtension(&$fileName, $renameIfRequired = true) { if (strpos($fileName, '.') === false) { return true; } if (is_null($this->_config)) { $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); } if ($this->_...
php
public function checkExtension(&$fileName, $renameIfRequired = true) { if (strpos($fileName, '.') === false) { return true; } if (is_null($this->_config)) { $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); } if ($this->_...
[ "public", "function", "checkExtension", "(", "&", "$", "fileName", ",", "$", "renameIfRequired", "=", "true", ")", "{", "if", "(", "strpos", "(", "$", "fileName", ",", "'.'", ")", "===", "false", ")", "{", "return", "true", ";", "}", "if", "(", "is_n...
Check extension, return true if file name is valid. Return false if extension is on denied list. If allowed extensions are defined, return false if extension isn't on allowed list. @access public @param string $extension extension @param boolean $renameIfRequired whether try to rename file or not @return boolean
[ "Check", "extension", "return", "true", "if", "file", "name", "is", "valid", ".", "Return", "false", "if", "extension", "is", "on", "denied", "list", ".", "If", "allowed", "extensions", "are", "defined", "return", "false", "if", "extension", "isn", "t", "o...
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php#L228-L265
27,030
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php
CKFinder_Connector_Core_ResourceTypeConfig.checkIsHiddenFolder
public function checkIsHiddenFolder($folderName) { if (is_null($this->_config)) { $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); } $regex = $this->_config->getHideFoldersRegex(); if ($regex) { return preg_match($regex, $folderN...
php
public function checkIsHiddenFolder($folderName) { if (is_null($this->_config)) { $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); } $regex = $this->_config->getHideFoldersRegex(); if ($regex) { return preg_match($regex, $folderN...
[ "public", "function", "checkIsHiddenFolder", "(", "$", "folderName", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "_config", ")", ")", "{", "$", "this", "->", "_config", "=", "&", "CKFinder_Connector_Core_Factory", "::", "getInstance", "(", "\"Cor...
Check given folder name Return true if folder name matches hidden folder names list @param string $folderName @access public @return boolean
[ "Check", "given", "folder", "name", "Return", "true", "if", "folder", "name", "matches", "hidden", "folder", "names", "list" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php#L275-L287
27,031
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php
CKFinder_Connector_Core_ResourceTypeConfig.checkIsHiddenFile
public function checkIsHiddenFile($fileName) { if (is_null($this->_config)) { $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); } $regex = $this->_config->getHideFilesRegex(); if ($regex) { return preg_match($regex, $fileName); ...
php
public function checkIsHiddenFile($fileName) { if (is_null($this->_config)) { $this->_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); } $regex = $this->_config->getHideFilesRegex(); if ($regex) { return preg_match($regex, $fileName); ...
[ "public", "function", "checkIsHiddenFile", "(", "$", "fileName", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "_config", ")", ")", "{", "$", "this", "->", "_config", "=", "&", "CKFinder_Connector_Core_Factory", "::", "getInstance", "(", "\"Core_Co...
Check given file name Return true if file name matches hidden file names list @param string $fileName @access public @return boolean
[ "Check", "given", "file", "name", "Return", "true", "if", "file", "name", "matches", "hidden", "file", "names", "list" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php#L297-L309
27,032
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php
CKFinder_Connector_Core_ResourceTypeConfig.checkIsHiddenPath
public function checkIsHiddenPath($path) { $_clientPathParts = explode("/", trim($path, "/")); if ($_clientPathParts) { foreach ($_clientPathParts as $_part) { if ($this->checkIsHiddenFolder($_part)) { return true; } } ...
php
public function checkIsHiddenPath($path) { $_clientPathParts = explode("/", trim($path, "/")); if ($_clientPathParts) { foreach ($_clientPathParts as $_part) { if ($this->checkIsHiddenFolder($_part)) { return true; } } ...
[ "public", "function", "checkIsHiddenPath", "(", "$", "path", ")", "{", "$", "_clientPathParts", "=", "explode", "(", "\"/\"", ",", "trim", "(", "$", "path", ",", "\"/\"", ")", ")", ";", "if", "(", "$", "_clientPathParts", ")", "{", "foreach", "(", "$",...
Check given path Return true if path contains folder name that matches hidden folder names list @param string $folderName @access public @return boolean
[ "Check", "given", "path", "Return", "true", "if", "path", "contains", "folder", "name", "that", "matches", "hidden", "folder", "names", "list" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php#L319-L331
27,033
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php
CKFinder_Connector_Core_ResourceTypeConfig.checkSingleExtension
public function checkSingleExtension($extension) { $extension = strtolower(ltrim($extension,'.')); if (sizeof($this->_deniedExtensions)) { if (in_array($extension, $this->_deniedExtensions)) { return false; } } if (sizeof($this->_allowedExten...
php
public function checkSingleExtension($extension) { $extension = strtolower(ltrim($extension,'.')); if (sizeof($this->_deniedExtensions)) { if (in_array($extension, $this->_deniedExtensions)) { return false; } } if (sizeof($this->_allowedExten...
[ "public", "function", "checkSingleExtension", "(", "$", "extension", ")", "{", "$", "extension", "=", "strtolower", "(", "ltrim", "(", "$", "extension", ",", "'.'", ")", ")", ";", "if", "(", "sizeof", "(", "$", "this", "->", "_deniedExtensions", ")", ")"...
Check if extension is allowed Return true if the extension is allowed. @param string $extension @access public @return boolean
[ "Check", "if", "extension", "is", "allowed", "Return", "true", "if", "the", "extension", "is", "allowed", "." ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Core/ResourceTypeConfig.php#L341-L356
27,034
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Export/Standard.php
Standard.createContainer
protected function createContainer() { $config = $this->getContext()->getConfig(); /** controller/jobs/product/export/location * Directory where the generated site maps should be placed into * * You have to configure a directory for the generated files on your * server that is writeable by the process...
php
protected function createContainer() { $config = $this->getContext()->getConfig(); /** controller/jobs/product/export/location * Directory where the generated site maps should be placed into * * You have to configure a directory for the generated files on your * server that is writeable by the process...
[ "protected", "function", "createContainer", "(", ")", "{", "$", "config", "=", "$", "this", "->", "getContext", "(", ")", "->", "getConfig", "(", ")", ";", "/** controller/jobs/product/export/location\n\t\t * Directory where the generated site maps should be placed into\n\t\t...
Creates a new container for the site map file @return \Aimeos\MW\Container\Iface Container object
[ "Creates", "a", "new", "container", "for", "the", "site", "map", "file" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Export/Standard.php#L106-L186
27,035
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Export/Standard.php
Standard.export
protected function export( \Aimeos\MW\Container\Iface $container, $default = true ) { $domains = array( 'attribute', 'media', 'price', 'product', 'text' ); $domains = $this->getConfig( 'domains', $domains ); $maxItems = $this->getConfig( 'max-items', 10000 ); $maxQuery = $this->getConfig( 'max-query', 1000 );...
php
protected function export( \Aimeos\MW\Container\Iface $container, $default = true ) { $domains = array( 'attribute', 'media', 'price', 'product', 'text' ); $domains = $this->getConfig( 'domains', $domains ); $maxItems = $this->getConfig( 'max-items', 10000 ); $maxQuery = $this->getConfig( 'max-query', 1000 );...
[ "protected", "function", "export", "(", "\\", "Aimeos", "\\", "MW", "\\", "Container", "\\", "Iface", "$", "container", ",", "$", "default", "=", "true", ")", "{", "$", "domains", "=", "array", "(", "'attribute'", ",", "'media'", ",", "'price'", ",", "...
Exports the products into the given container @param \Aimeos\MW\Container\Iface $container Container object @param boolean $default True to filter exported products by default criteria @return array List of content (file) names
[ "Exports", "the", "products", "into", "the", "given", "container" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Export/Standard.php#L280-L326
27,036
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.getFileNameWithoutExtension
public static function getFileNameWithoutExtension($fileName, $shortExtensionMode = TRUE) { $dotPos = $shortExtensionMode ? strrpos( $fileName, '.' ) : strpos( $fileName, '.' ); if (false === $dotPos) { return $fileName; } return substr($fileName, 0, $dotPos); }
php
public static function getFileNameWithoutExtension($fileName, $shortExtensionMode = TRUE) { $dotPos = $shortExtensionMode ? strrpos( $fileName, '.' ) : strpos( $fileName, '.' ); if (false === $dotPos) { return $fileName; } return substr($fileName, 0, $dotPos); }
[ "public", "static", "function", "getFileNameWithoutExtension", "(", "$", "fileName", ",", "$", "shortExtensionMode", "=", "TRUE", ")", "{", "$", "dotPos", "=", "$", "shortExtensionMode", "?", "strrpos", "(", "$", "fileName", ",", "'.'", ")", ":", "strpos", "...
Return file name without extension @static @access public @param string $fileName @param boolean $shortExtensionMode If set to false, extension is everything after a first dot @return string
[ "Return", "file", "name", "without", "extension" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L199-L207
27,037
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.readfileChunked
public static function readfileChunked($filename) { $chunksize = 1024 * 10; // how many bytes per chunk $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { echo fread($handle, $chunksize); @o...
php
public static function readfileChunked($filename) { $chunksize = 1024 * 10; // how many bytes per chunk $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { echo fread($handle, $chunksize); @o...
[ "public", "static", "function", "readfileChunked", "(", "$", "filename", ")", "{", "$", "chunksize", "=", "1024", "*", "10", ";", "// how many bytes per chunk", "$", "handle", "=", "fopen", "(", "$", "filename", ",", "'rb'", ")", ";", "if", "(", "$", "ha...
Read file, split it into small chunks and send it to the browser @static @access public @param string $filename @return boolean
[ "Read", "file", "split", "it", "into", "small", "chunks", "and", "send", "it", "to", "the", "browser" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L236-L252
27,038
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.secureFileName
public static function secureFileName($fileName) { $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $fileName = str_replace(array(":", "*", "?", "|", "/"), "_", $fileName); if ( $_config->getDisallowUnsafeCharacters() ) { $fileName = str_replace(";", "_", $fil...
php
public static function secureFileName($fileName) { $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $fileName = str_replace(array(":", "*", "?", "|", "/"), "_", $fileName); if ( $_config->getDisallowUnsafeCharacters() ) { $fileName = str_replace(";", "_", $fil...
[ "public", "static", "function", "secureFileName", "(", "$", "fileName", ")", "{", "$", "_config", "=", "&", "CKFinder_Connector_Core_Factory", "::", "getInstance", "(", "\"Core_Config\"", ")", ";", "$", "fileName", "=", "str_replace", "(", "array", "(", "\":\"",...
Secure file name from unsafe characters @param string $fileName @access public @static @return string $fileName
[ "Secure", "file", "name", "from", "unsafe", "characters" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L338-L351
27,039
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.convertToFilesystemEncoding
public static function convertToFilesystemEncoding($fileName) { $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $encoding = $_config->getFilesystemEncoding(); if (is_null($encoding) || strcasecmp($encoding, "UTF-8") == 0 || strcasecmp($encoding, "UTF8") == 0) { ...
php
public static function convertToFilesystemEncoding($fileName) { $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $encoding = $_config->getFilesystemEncoding(); if (is_null($encoding) || strcasecmp($encoding, "UTF-8") == 0 || strcasecmp($encoding, "UTF8") == 0) { ...
[ "public", "static", "function", "convertToFilesystemEncoding", "(", "$", "fileName", ")", "{", "$", "_config", "=", "&", "CKFinder_Connector_Core_Factory", "::", "getInstance", "(", "\"Core_Config\"", ")", ";", "$", "encoding", "=", "$", "_config", "->", "getFiles...
Convert file name from UTF-8 to system encoding @static @access public @param string $fileName @return string
[ "Convert", "file", "name", "from", "UTF", "-", "8", "to", "system", "encoding" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L361-L394
27,040
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.convertToConnectorEncoding
public static function convertToConnectorEncoding($fileName) { $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $encoding = $_config->getFilesystemEncoding(); if (is_null($encoding) || strcasecmp($encoding, "UTF-8") == 0 || strcasecmp($encoding, "UTF8") == 0) { ...
php
public static function convertToConnectorEncoding($fileName) { $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $encoding = $_config->getFilesystemEncoding(); if (is_null($encoding) || strcasecmp($encoding, "UTF-8") == 0 || strcasecmp($encoding, "UTF8") == 0) { ...
[ "public", "static", "function", "convertToConnectorEncoding", "(", "$", "fileName", ")", "{", "$", "_config", "=", "&", "CKFinder_Connector_Core_Factory", "::", "getInstance", "(", "\"Core_Config\"", ")", ";", "$", "encoding", "=", "$", "_config", "->", "getFilesy...
Convert file name from system encoding into UTF-8 @static @access public @param string $fileName @return string
[ "Convert", "file", "name", "from", "system", "encoding", "into", "UTF", "-", "8" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L404-L427
27,041
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.getDocumentRootPath
public function getDocumentRootPath() { /** * The absolute pathname of the currently executing script. * Notatka: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php, * $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by th...
php
public function getDocumentRootPath() { /** * The absolute pathname of the currently executing script. * Notatka: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php, * $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by th...
[ "public", "function", "getDocumentRootPath", "(", ")", "{", "/**\n * The absolute pathname of the currently executing script.\n * Notatka: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php,\n * $_SERVER['SCRIPT_FILENAME'] will contain the r...
Find document root @return string @access public
[ "Find", "document", "root" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L435-L463
27,042
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.createDirectoryRecursively
public static function createDirectoryRecursively($dir) { if (DIRECTORY_SEPARATOR === "\\") { $dir = str_replace("/", "\\", $dir); } else if (DIRECTORY_SEPARATOR === "/") { $dir = str_replace("\\", "/", $dir); } $_config =& CKFinder_Connector_Core_Fac...
php
public static function createDirectoryRecursively($dir) { if (DIRECTORY_SEPARATOR === "\\") { $dir = str_replace("/", "\\", $dir); } else if (DIRECTORY_SEPARATOR === "/") { $dir = str_replace("\\", "/", $dir); } $_config =& CKFinder_Connector_Core_Fac...
[ "public", "static", "function", "createDirectoryRecursively", "(", "$", "dir", ")", "{", "if", "(", "DIRECTORY_SEPARATOR", "===", "\"\\\\\"", ")", "{", "$", "dir", "=", "str_replace", "(", "\"/\"", ",", "\"\\\\\"", ",", "$", "dir", ")", ";", "}", "else", ...
Create directory recursively @access public @static @param string $dir @return boolean
[ "Create", "directory", "recursively" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L473-L493
27,043
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.isImageValid
public static function isImageValid($filePath, $extension) { if (!@is_readable($filePath)) { return -1; } $imageCheckExtensions = array('gif', 'jpeg', 'jpg', 'png', 'psd', 'bmp', 'tiff'); // version_compare is available since PHP4 >= 4.0.7 if ( function_exists( ...
php
public static function isImageValid($filePath, $extension) { if (!@is_readable($filePath)) { return -1; } $imageCheckExtensions = array('gif', 'jpeg', 'jpg', 'png', 'psd', 'bmp', 'tiff'); // version_compare is available since PHP4 >= 4.0.7 if ( function_exists( ...
[ "public", "static", "function", "isImageValid", "(", "$", "filePath", ",", "$", "extension", ")", "{", "if", "(", "!", "@", "is_readable", "(", "$", "filePath", ")", ")", "{", "return", "-", "1", ";", "}", "$", "imageCheckExtensions", "=", "array", "("...
Check file content. Currently this function validates only image files. Returns false if file is invalid. @static @access public @param string $filePath absolute path to file @param string $extension file extension @param integer $detectionLevel 0 = none, 1 = use getimagesize for images, 2 = use DetectHtml for images ...
[ "Check", "file", "content", ".", "Currently", "this", "function", "validates", "only", "image", "files", ".", "Returns", "false", "if", "file", "is", "invalid", "." ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L567-L604
27,044
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.hasChildren
public static function hasChildren($clientPath, $_resourceType) { $serverPath = CKFinder_Connector_Utils_FileSystem::combinePaths($_resourceType->getDirectory(), $clientPath); if (!is_dir($serverPath) || (false === $fh = @opendir($serverPath))) { return false; } $hasChi...
php
public static function hasChildren($clientPath, $_resourceType) { $serverPath = CKFinder_Connector_Utils_FileSystem::combinePaths($_resourceType->getDirectory(), $clientPath); if (!is_dir($serverPath) || (false === $fh = @opendir($serverPath))) { return false; } $hasChi...
[ "public", "static", "function", "hasChildren", "(", "$", "clientPath", ",", "$", "_resourceType", ")", "{", "$", "serverPath", "=", "CKFinder_Connector_Utils_FileSystem", "::", "combinePaths", "(", "$", "_resourceType", "->", "getDirectory", "(", ")", ",", "$", ...
Returns true if directory is not empty @access public @static @param string $clientPath client path (with trailing slash) @param object $_resourceType resource type configuration @return boolean
[ "Returns", "true", "if", "directory", "is", "not", "empty" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L615-L647
27,045
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.getTmpDir
public static function getTmpDir() { $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $tmpDir = $_config->getTempDirectory(); if ( $tmpDir ) { return $tmpDir; } if ( !function_exists('sys_get_temp_dir')) { function sys_get_temp_dir() { ...
php
public static function getTmpDir() { $_config = & CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $tmpDir = $_config->getTempDirectory(); if ( $tmpDir ) { return $tmpDir; } if ( !function_exists('sys_get_temp_dir')) { function sys_get_temp_dir() { ...
[ "public", "static", "function", "getTmpDir", "(", ")", "{", "$", "_config", "=", "&", "CKFinder_Connector_Core_Factory", "::", "getInstance", "(", "\"Core_Config\"", ")", ";", "$", "tmpDir", "=", "$", "_config", "->", "getTempDirectory", "(", ")", ";", "if", ...
Retruns temp directory @access public @static @return string
[ "Retruns", "temp", "directory" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L656-L684
27,046
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.isEmptyDir
public static function isEmptyDir($dirname) { $files = scandir($dirname); if ( $files && count($files) > 2) { return false; } return true; }
php
public static function isEmptyDir($dirname) { $files = scandir($dirname); if ( $files && count($files) > 2) { return false; } return true; }
[ "public", "static", "function", "isEmptyDir", "(", "$", "dirname", ")", "{", "$", "files", "=", "scandir", "(", "$", "dirname", ")", ";", "if", "(", "$", "files", "&&", "count", "(", "$", "files", ")", ">", "2", ")", "{", "return", "false", ";", ...
Check if given directory is empty @param string $dirname @access public @static @return bool
[ "Check", "if", "given", "directory", "is", "empty" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L694-L702
27,047
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.autoRename
public static function autoRename( $filePath, $fileName ) { $sFileNameOrginal = $fileName; $iCounter = 0; while (true) { $sFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($filePath, $fileName); if ( file_exists($sFilePath) ){ $iCounter++; $fil...
php
public static function autoRename( $filePath, $fileName ) { $sFileNameOrginal = $fileName; $iCounter = 0; while (true) { $sFilePath = CKFinder_Connector_Utils_FileSystem::combinePaths($filePath, $fileName); if ( file_exists($sFilePath) ){ $iCounter++; $fil...
[ "public", "static", "function", "autoRename", "(", "$", "filePath", ",", "$", "fileName", ")", "{", "$", "sFileNameOrginal", "=", "$", "fileName", ";", "$", "iCounter", "=", "0", ";", "while", "(", "true", ")", "{", "$", "sFilePath", "=", "CKFinder_Conne...
Autorename file if previous name is already taken @param string $filePath @param string $fileName @param string $sFileNameOrginal
[ "Autorename", "file", "if", "previous", "name", "is", "already", "taken" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L711-L728
27,048
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.sendFile
public static function sendFile( $filePath ){ $config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); if ( $config->getXSendfile() ){ CKFinder_Connector_Utils_FileSystem::sendWithXSendfile($filePath); } else { CKFinder_Connector_Utils_FileSystem::readfileChunked($filePa...
php
public static function sendFile( $filePath ){ $config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); if ( $config->getXSendfile() ){ CKFinder_Connector_Utils_FileSystem::sendWithXSendfile($filePath); } else { CKFinder_Connector_Utils_FileSystem::readfileChunked($filePa...
[ "public", "static", "function", "sendFile", "(", "$", "filePath", ")", "{", "$", "config", "=", "&", "CKFinder_Connector_Core_Factory", "::", "getInstance", "(", "\"Core_Config\"", ")", ";", "if", "(", "$", "config", "->", "getXSendfile", "(", ")", ")", "{",...
Send file to browser Selects the method depending on the XSendfile setting @param string $filePath
[ "Send", "file", "to", "browser", "Selects", "the", "method", "depending", "on", "the", "XSendfile", "setting" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L735-L742
27,049
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php
CKFinder_Connector_Utils_FileSystem.sendWithXSendfile
public static function sendWithXSendfile ( $filePath ){ if ( stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== FALSE ){ $fallback = true; $config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $XSendfileNginx = $config->getXSendfileNginx(); foreach ( $XSendfileNgin...
php
public static function sendWithXSendfile ( $filePath ){ if ( stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== FALSE ){ $fallback = true; $config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config"); $XSendfileNginx = $config->getXSendfileNginx(); foreach ( $XSendfileNgin...
[ "public", "static", "function", "sendWithXSendfile", "(", "$", "filePath", ")", "{", "if", "(", "stripos", "(", "$", "_SERVER", "[", "'SERVER_SOFTWARE'", "]", ",", "'nginx'", ")", "!==", "FALSE", ")", "{", "$", "fallback", "=", "true", ";", "$", "config"...
Send files using X-Sendfile server module @param string $filePath
[ "Send", "files", "using", "X", "-", "Sendfile", "server", "module" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/connector/php/php5/Utils/FileSystem.php#L749-L771
27,050
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Subscription/Export/Csv/Processor/Address/Standard.php
Standard.process
public function process( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order ) { $result = []; $addresses = $order->getAddresses(); krsort( $addresses ); foreach( $addresses as $items ) { foreach( $items as $item ) { $data = []; $list = $item->toArr...
php
public function process( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Base\Iface $order ) { $result = []; $addresses = $order->getAddresses(); krsort( $addresses ); foreach( $addresses as $items ) { foreach( $items as $item ) { $data = []; $list = $item->toArr...
[ "public", "function", "process", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Subscription", "\\", "Item", "\\", "Iface", "$", "subscription", ",", "\\", "Aimeos", "\\", "MShop", "\\", "Order", "\\", "Item", "\\", "Base", "\\", "Iface", "$", "order", ")", ...
Returns the subscription related data @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item @param \Aimeos\MShop\Order\Item\Base\Iface $order Full subscription with associated items @return array Two dimensional associative list of subscription data representing the lines in CSV
[ "Returns", "the", "subscription", "related", "data" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Subscription/Export/Csv/Processor/Address/Standard.php#L43-L72
27,051
pr-of-it/t4
framework/Orm/Extensions/Tree.php
Tree.insertModelAsLastRoot
protected function insertModelAsLastRoot(Model $model) { /** @var \T4\Orm\Model $class */ $class = get_class($model); $tableName = $class::getTableName(); /** @var \T4\Dbal\Connection $connection */ $connection = $class::getDbConnection(); $query = (new Query()) ...
php
protected function insertModelAsLastRoot(Model $model) { /** @var \T4\Orm\Model $class */ $class = get_class($model); $tableName = $class::getTableName(); /** @var \T4\Dbal\Connection $connection */ $connection = $class::getDbConnection(); $query = (new Query()) ...
[ "protected", "function", "insertModelAsLastRoot", "(", "Model", "$", "model", ")", "{", "/** @var \\T4\\Orm\\Model $class */", "$", "class", "=", "get_class", "(", "$", "model", ")", ";", "$", "tableName", "=", "$", "class", "::", "getTableName", "(", ")", ";"...
Prepares model for insert into tree as last root @param \T4\Orm\Model $model
[ "Prepares", "model", "for", "insert", "into", "tree", "as", "last", "root" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Orm/Extensions/Tree.php#L310-L351
27,052
wikimedia/html-formatter
src/HtmlFormatter.php
HtmlFormatter.filterContent
public function filterContent() { $removals = $this->parseItemsToRemove(); // Bail out early if nothing to do if ( \array_reduce( $removals, function ( $carry, $item ) { return $carry && !$item; }, true ) ) { return []; } $doc = $this->getDoc(); // Remove tags // You can't remove DOM...
php
public function filterContent() { $removals = $this->parseItemsToRemove(); // Bail out early if nothing to do if ( \array_reduce( $removals, function ( $carry, $item ) { return $carry && !$item; }, true ) ) { return []; } $doc = $this->getDoc(); // Remove tags // You can't remove DOM...
[ "public", "function", "filterContent", "(", ")", "{", "$", "removals", "=", "$", "this", "->", "parseItemsToRemove", "(", ")", ";", "// Bail out early if nothing to do", "if", "(", "\\", "array_reduce", "(", "$", "removals", ",", "function", "(", "$", "carry",...
Removes content we've chosen to remove. The text of the removed elements can be extracted with the getText method. @return array Array of removed DOMElements
[ "Removes", "content", "we", "ve", "chosen", "to", "remove", ".", "The", "text", "of", "the", "removed", "elements", "can", "be", "extracted", "with", "the", "getText", "method", "." ]
5e33e3bbb327b3e0d685cc595837ccb024b72f57
https://github.com/wikimedia/html-formatter/blob/5e33e3bbb327b3e0d685cc595837ccb024b72f57/src/HtmlFormatter.php#L137-L206
27,053
wikimedia/html-formatter
src/HtmlFormatter.php
HtmlFormatter.removeElements
private function removeElements( $elements ) { $list = $elements; if ( $elements instanceof \DOMNodeList ) { $list = []; foreach ( $elements as $element ) { $list[] = $element; } } /** @var $element \DOMElement */ foreach ( $list as $element ) { if ( $element->parentNode ) { $element->pare...
php
private function removeElements( $elements ) { $list = $elements; if ( $elements instanceof \DOMNodeList ) { $list = []; foreach ( $elements as $element ) { $list[] = $element; } } /** @var $element \DOMElement */ foreach ( $list as $element ) { if ( $element->parentNode ) { $element->pare...
[ "private", "function", "removeElements", "(", "$", "elements", ")", "{", "$", "list", "=", "$", "elements", ";", "if", "(", "$", "elements", "instanceof", "\\", "DOMNodeList", ")", "{", "$", "list", "=", "[", "]", ";", "foreach", "(", "$", "elements", ...
Removes a list of elelments from DOMDocument @param array|\DOMNodeList $elements @return array Array of removed elements
[ "Removes", "a", "list", "of", "elelments", "from", "DOMDocument" ]
5e33e3bbb327b3e0d685cc595837ccb024b72f57
https://github.com/wikimedia/html-formatter/blob/5e33e3bbb327b3e0d685cc595837ccb024b72f57/src/HtmlFormatter.php#L213-L228
27,054
wikimedia/html-formatter
src/HtmlFormatter.php
HtmlFormatter.fixLibXML
private function fixLibXML( $html ) { // We don't include rules like '&#34;' => '&amp;quot;' because entities had already been // normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE! $replacements = [ '&quot;' => '&amp;quot;', '&amp;' => '&amp;amp;', '&lt;' => '&amp;lt;...
php
private function fixLibXML( $html ) { // We don't include rules like '&#34;' => '&amp;quot;' because entities had already been // normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE! $replacements = [ '&quot;' => '&amp;quot;', '&amp;' => '&amp;amp;', '&lt;' => '&amp;lt;...
[ "private", "function", "fixLibXML", "(", "$", "html", ")", "{", "// We don't include rules like '&#34;' => '&amp;quot;' because entities had already been", "// normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE!", "$", "replacements", "=", "[", "'&quot...
libxml in its usual pointlessness converts many chars to entities - this function perfoms a reverse conversion @param string $html @return string
[ "libxml", "in", "its", "usual", "pointlessness", "converts", "many", "chars", "to", "entities", "-", "this", "function", "perfoms", "a", "reverse", "conversion" ]
5e33e3bbb327b3e0d685cc595837ccb024b72f57
https://github.com/wikimedia/html-formatter/blob/5e33e3bbb327b3e0d685cc595837ccb024b72f57/src/HtmlFormatter.php#L236-L251
27,055
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Product/Import/Csv/Processor/Stock/Standard.php
Standard.process
public function process( \Aimeos\MShop\Product\Item\Iface $product, array $data ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'stock' ); $manager->begin(); try { $map = $this->getMappedChunk( $data, $this->getMapping() ); $items = $this->getStockItems( $product->getCode() ); foreach( $m...
php
public function process( \Aimeos\MShop\Product\Item\Iface $product, array $data ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'stock' ); $manager->begin(); try { $map = $this->getMappedChunk( $data, $this->getMapping() ); $items = $this->getStockItems( $product->getCode() ); foreach( $m...
[ "public", "function", "process", "(", "\\", "Aimeos", "\\", "MShop", "\\", "Product", "\\", "Item", "\\", "Iface", "$", "product", ",", "array", "$", "data", ")", "{", "$", "manager", "=", "\\", "Aimeos", "\\", "MShop", "::", "create", "(", "$", "thi...
Saves the product stock related data to the storage @param \Aimeos\MShop\Product\Item\Iface $product Product item with associated items @param array $data List of CSV fields with position as key and data as value @return array List of data which hasn't been imported
[ "Saves", "the", "product", "stock", "related", "data", "to", "the", "storage" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Product/Import/Csv/Processor/Stock/Standard.php#L66-L113
27,056
aimeos/ai-controller-jobs
controller/common/src/Controller/Common/Product/Import/Csv/Processor/Stock/Standard.php
Standard.getStockItems
protected function getStockItems( $code ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'stock' ); $search = $manager->createSearch(); $search->setConditions( $search->compare( '==', 'stock.productcode', $code ) ); return $manager->searchItems( $search ); }
php
protected function getStockItems( $code ) { $manager = \Aimeos\MShop::create( $this->getContext(), 'stock' ); $search = $manager->createSearch(); $search->setConditions( $search->compare( '==', 'stock.productcode', $code ) ); return $manager->searchItems( $search ); }
[ "protected", "function", "getStockItems", "(", "$", "code", ")", "{", "$", "manager", "=", "\\", "Aimeos", "\\", "MShop", "::", "create", "(", "$", "this", "->", "getContext", "(", ")", ",", "'stock'", ")", ";", "$", "search", "=", "$", "manager", "-...
Returns the stock items for the given product code @param string $code Unique product code @return \Aimeos\MShop\Stock\Item\Iface[] Associative list of stock items
[ "Returns", "the", "stock", "items", "for", "the", "given", "product", "code" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/common/src/Controller/Common/Product/Import/Csv/Processor/Stock/Standard.php#L122-L130
27,057
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php
CKFinder.CreateHtml
public function CreateHtml() { $className = $this->ClassName ; if ( !empty( $className ) ) $className = ' class="' . $className . '"' ; $id = $this->Id ; if ( !empty( $id ) ) $id = ' id="' . $id . '"' ; return '<iframe src="' . $this->_BuildUrl() . '" width="' . $this->Width . '" ' . 'height="' . ...
php
public function CreateHtml() { $className = $this->ClassName ; if ( !empty( $className ) ) $className = ' class="' . $className . '"' ; $id = $this->Id ; if ( !empty( $id ) ) $id = ' id="' . $id . '"' ; return '<iframe src="' . $this->_BuildUrl() . '" width="' . $this->Width . '" ' . 'height="' . ...
[ "public", "function", "CreateHtml", "(", ")", "{", "$", "className", "=", "$", "this", "->", "ClassName", ";", "if", "(", "!", "empty", "(", "$", "className", ")", ")", "$", "className", "=", "' class=\"'", ".", "$", "className", ".", "'\"'", ";", "$...
Gets the HTML needed to create a CKFinder instance.
[ "Gets", "the", "HTML", "needed", "to", "create", "a", "CKFinder", "instance", "." ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php#L50-L62
27,058
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php
CKFinder.CreateStatic
public static function CreateStatic( $basePath = CKFINDER_DEFAULT_BASEPATH, $width = '100%', $height = 400, $selectFunction = null ) { $finder = new CKFinder( $basePath, $width, $height, $selectFunction ) ; $finder->Create() ; }
php
public static function CreateStatic( $basePath = CKFINDER_DEFAULT_BASEPATH, $width = '100%', $height = 400, $selectFunction = null ) { $finder = new CKFinder( $basePath, $width, $height, $selectFunction ) ; $finder->Create() ; }
[ "public", "static", "function", "CreateStatic", "(", "$", "basePath", "=", "CKFINDER_DEFAULT_BASEPATH", ",", "$", "width", "=", "'100%'", ",", "$", "height", "=", "400", ",", "$", "selectFunction", "=", "null", ")", "{", "$", "finder", "=", "new", "CKFinde...
Static "Create".
[ "Static", "Create", "." ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php#L132-L136
27,059
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php
CKFinder.SetupFCKeditor
public static function SetupFCKeditor( &$editorObj, $basePath = CKFINDER_DEFAULT_BASEPATH, $imageType = null, $flashType = null ) { if ( empty( $basePath ) ) $basePath = CKFINDER_DEFAULT_BASEPATH ; $ckfinder = new CKFinder( $basePath ) ; $ckfinder->SetupFCKeditorObject( $editorObj, $imageType, $flashType ); ...
php
public static function SetupFCKeditor( &$editorObj, $basePath = CKFINDER_DEFAULT_BASEPATH, $imageType = null, $flashType = null ) { if ( empty( $basePath ) ) $basePath = CKFINDER_DEFAULT_BASEPATH ; $ckfinder = new CKFinder( $basePath ) ; $ckfinder->SetupFCKeditorObject( $editorObj, $imageType, $flashType ); ...
[ "public", "static", "function", "SetupFCKeditor", "(", "&", "$", "editorObj", ",", "$", "basePath", "=", "CKFINDER_DEFAULT_BASEPATH", ",", "$", "imageType", "=", "null", ",", "$", "flashType", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "basePath"...
Static "SetupFCKeditor".
[ "Static", "SetupFCKeditor", "." ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php#L139-L146
27,060
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php
CKFinder.SetupFCKeditorObject
public function SetupFCKeditorObject( &$editorObj, $imageType = null, $flashType = null ) { $url = $this->BasePath ; // If it is a path relative to the current page. if ( isset($url[0]) && $url[0] != '/' && strpos($url, "://") === false ) { $url = substr( $_SERVER[ 'REQUEST_URI' ], 0, strrpos( $_SERVER[ 'R...
php
public function SetupFCKeditorObject( &$editorObj, $imageType = null, $flashType = null ) { $url = $this->BasePath ; // If it is a path relative to the current page. if ( isset($url[0]) && $url[0] != '/' && strpos($url, "://") === false ) { $url = substr( $_SERVER[ 'REQUEST_URI' ], 0, strrpos( $_SERVER[ 'R...
[ "public", "function", "SetupFCKeditorObject", "(", "&", "$", "editorObj", ",", "$", "imageType", "=", "null", ",", "$", "flashType", "=", "null", ")", "{", "$", "url", "=", "$", "this", "->", "BasePath", ";", "// If it is a path relative to the current page.", ...
Non-static method of attaching CKFinder to FCKeditor
[ "Non", "-", "static", "method", "of", "attaching", "CKFinder", "to", "FCKeditor" ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php#L149-L185
27,061
pr-of-it/t4
framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php
CKFinder.SetupCKEditor
public static function SetupCKEditor( &$editorObj, $basePath = CKFINDER_DEFAULT_BASEPATH, $imageType = null, $flashType = null ) { if ( empty( $basePath ) ) $basePath = CKFINDER_DEFAULT_BASEPATH ; $ckfinder = new CKFinder( $basePath ) ; $ckfinder->SetupCKEditorObject( $editorObj, $imageType, $flashType ); }
php
public static function SetupCKEditor( &$editorObj, $basePath = CKFINDER_DEFAULT_BASEPATH, $imageType = null, $flashType = null ) { if ( empty( $basePath ) ) $basePath = CKFINDER_DEFAULT_BASEPATH ; $ckfinder = new CKFinder( $basePath ) ; $ckfinder->SetupCKEditorObject( $editorObj, $imageType, $flashType ); }
[ "public", "static", "function", "SetupCKEditor", "(", "&", "$", "editorObj", ",", "$", "basePath", "=", "CKFINDER_DEFAULT_BASEPATH", ",", "$", "imageType", "=", "null", ",", "$", "flashType", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "basePath",...
Static "SetupCKEditor".
[ "Static", "SetupCKEditor", "." ]
8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada
https://github.com/pr-of-it/t4/blob/8a8133e0b3abca9d7718fbdcf65b70c2d85b5ada/framework/Mvc/Extensions/Ckfinder/lib/core/ckfinder_php5.php#L188-L195
27,062
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Import/Csv/Standard.php
Standard.getCodePosition
protected function getCodePosition( array $mapping ) { foreach( $mapping as $pos => $key ) { if( $key === 'product.code' ) { return $pos; } } throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'No "product.code" column in CSV mapping found' ) ); }
php
protected function getCodePosition( array $mapping ) { foreach( $mapping as $pos => $key ) { if( $key === 'product.code' ) { return $pos; } } throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'No "product.code" column in CSV mapping found' ) ); }
[ "protected", "function", "getCodePosition", "(", "array", "$", "mapping", ")", "{", "foreach", "(", "$", "mapping", "as", "$", "pos", "=>", "$", "key", ")", "{", "if", "(", "$", "key", "===", "'product.code'", ")", "{", "return", "$", "pos", ";", "}"...
Returns the position of the "product.code" column from the product item mapping @param array $mapping Mapping of the "item" columns with position as key and code as value @return integer Position of the "product.code" column @throws \Aimeos\Controller\Jobs\Exception If no mapping for "product.code" is found
[ "Returns", "the", "position", "of", "the", "product", ".", "code", "column", "from", "the", "product", "item", "mapping" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Import/Csv/Standard.php#L393-L403
27,063
aimeos/ai-controller-jobs
controller/jobs/src/Controller/Jobs/Product/Import/Csv/Standard.php
Standard.import
protected function import( array $products, array $data, array $mapping, array $types, \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor, $strict ) { $items = []; $errors = 0; $context = $this->getContext(); $manager = \Aimeos\MShop::create( $context, 'product' ); $indexManager = \Aim...
php
protected function import( array $products, array $data, array $mapping, array $types, \Aimeos\Controller\Common\Product\Import\Csv\Processor\Iface $processor, $strict ) { $items = []; $errors = 0; $context = $this->getContext(); $manager = \Aimeos\MShop::create( $context, 'product' ); $indexManager = \Aim...
[ "protected", "function", "import", "(", "array", "$", "products", ",", "array", "$", "data", ",", "array", "$", "mapping", ",", "array", "$", "types", ",", "\\", "Aimeos", "\\", "Controller", "\\", "Common", "\\", "Product", "\\", "Import", "\\", "Csv", ...
Imports the CSV data and creates new products or updates existing ones @param array $products List of products items implementing \Aimeos\MShop\Product\Item\Iface @param array $data Associative list of import data as index/value pairs @param array $mapping Associative list of positions and domain item keys @param arra...
[ "Imports", "the", "CSV", "data", "and", "creates", "new", "products", "or", "updates", "existing", "ones" ]
e4a2fc47850f72907afff68858a2be5865fa4664
https://github.com/aimeos/ai-controller-jobs/blob/e4a2fc47850f72907afff68858a2be5865fa4664/controller/jobs/src/Controller/Jobs/Product/Import/Csv/Standard.php#L523-L587
27,064
Yoast/yoastcs
Yoast/Sniffs/Yoast/AlternativeFunctionsSniff.php
AlternativeFunctionsSniff.process_matched_token
public function process_matched_token( $stackPtr, $group_name, $matched_content ) { $replacement = ''; if ( isset( $this->groups[ $group_name ]['replacement'] ) ) { $replacement = $this->groups[ $group_name ]['replacement']; } $fixable = true; $message = $this->groups[ $group_name ]['message']; $...
php
public function process_matched_token( $stackPtr, $group_name, $matched_content ) { $replacement = ''; if ( isset( $this->groups[ $group_name ]['replacement'] ) ) { $replacement = $this->groups[ $group_name ]['replacement']; } $fixable = true; $message = $this->groups[ $group_name ]['message']; $...
[ "public", "function", "process_matched_token", "(", "$", "stackPtr", ",", "$", "group_name", ",", "$", "matched_content", ")", "{", "$", "replacement", "=", "''", ";", "if", "(", "isset", "(", "$", "this", "->", "groups", "[", "$", "group_name", "]", "["...
Process a matched token. @param int $stackPtr The position of the current token in the stack. @param string $group_name The name of the group which was matched. @param string $matched_content The token content (function name) which was matched. @return int|void Integer stack pointer to skip forward or ...
[ "Process", "a", "matched", "token", "." ]
44d4f28bbcf5f83d1111fafe67a17215b28c87d1
https://github.com/Yoast/yoastcs/blob/44d4f28bbcf5f83d1111fafe67a17215b28c87d1/Yoast/Sniffs/Yoast/AlternativeFunctionsSniff.php#L46-L96
27,065
Yoast/yoastcs
Yoast/Sniffs/Files/FileNameSniff.php
FileNameSniff.is_file_excluded
protected function is_file_excluded( File $phpcsFile, $path_to_file ) { $exclude = $this->clean_custom_array_property( $this->exclude, true, true ); if ( ! empty( $exclude ) ) { $exclude = array_map( array( $this, 'normalize_directory_separators' ), $exclude ); $path_to_file = $this->normalize_directory...
php
protected function is_file_excluded( File $phpcsFile, $path_to_file ) { $exclude = $this->clean_custom_array_property( $this->exclude, true, true ); if ( ! empty( $exclude ) ) { $exclude = array_map( array( $this, 'normalize_directory_separators' ), $exclude ); $path_to_file = $this->normalize_directory...
[ "protected", "function", "is_file_excluded", "(", "File", "$", "phpcsFile", ",", "$", "path_to_file", ")", "{", "$", "exclude", "=", "$", "this", "->", "clean_custom_array_property", "(", "$", "this", "->", "exclude", ",", "true", ",", "true", ")", ";", "i...
Check if the file is on the exclude list. @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. @param string $path_to_file The full path to the file currently being examined. @return bool
[ "Check", "if", "the", "file", "is", "on", "the", "exclude", "list", "." ]
44d4f28bbcf5f83d1111fafe67a17215b28c87d1
https://github.com/Yoast/yoastcs/blob/44d4f28bbcf5f83d1111fafe67a17215b28c87d1/Yoast/Sniffs/Files/FileNameSniff.php#L206-L235
27,066
Yoast/yoastcs
Yoast/Sniffs/Files/FileNameSniff.php
FileNameSniff.clean_custom_array_property
protected function clean_custom_array_property( $property, $flip = false, $to_lower = false ) { if ( is_bool( $property ) ) { // Allow for resetting in the unit tests. return array(); } if ( is_string( $property ) ) { $property = explode( ',', $property ); } $property = array_filter( array_map( 'tr...
php
protected function clean_custom_array_property( $property, $flip = false, $to_lower = false ) { if ( is_bool( $property ) ) { // Allow for resetting in the unit tests. return array(); } if ( is_string( $property ) ) { $property = explode( ',', $property ); } $property = array_filter( array_map( 'tr...
[ "protected", "function", "clean_custom_array_property", "(", "$", "property", ",", "$", "flip", "=", "false", ",", "$", "to_lower", "=", "false", ")", "{", "if", "(", "is_bool", "(", "$", "property", ")", ")", "{", "// Allow for resetting in the unit tests.", ...
Clean a custom array property received from a ruleset. Deals with incorrectly passed custom array properties. - If the property was passed as a string, change it to an array. - Remove whitespace surrounding values. - Remove empty array entries. Optionally flips the array to allow for using `isset` instead of `in_arra...
[ "Clean", "a", "custom", "array", "property", "received", "from", "a", "ruleset", "." ]
44d4f28bbcf5f83d1111fafe67a17215b28c87d1
https://github.com/Yoast/yoastcs/blob/44d4f28bbcf5f83d1111fafe67a17215b28c87d1/Yoast/Sniffs/Files/FileNameSniff.php#L253-L274
27,067
Radvance/Radvance
src/Framework/BaseConsoleApplication.php
BaseConsoleApplication.configurePdo
protected function configurePdo() { if (!isset($this['parameters']['pdo'])) { return; } $connector = new Connector(); $this->pdo = $connector->getPdo( $connector->getConfig($this['parameters']['pdo']) ); $this->pdo->setAttribute(PDO::ATTR_ERR...
php
protected function configurePdo() { if (!isset($this['parameters']['pdo'])) { return; } $connector = new Connector(); $this->pdo = $connector->getPdo( $connector->getConfig($this['parameters']['pdo']) ); $this->pdo->setAttribute(PDO::ATTR_ERR...
[ "protected", "function", "configurePdo", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "[", "'parameters'", "]", "[", "'pdo'", "]", ")", ")", "{", "return", ";", "}", "$", "connector", "=", "new", "Connector", "(", ")", ";", "$", "this"...
Configure PDO.
[ "Configure", "PDO", "." ]
980034dd02da75882089210a25da6d5d74229b2b
https://github.com/Radvance/Radvance/blob/980034dd02da75882089210a25da6d5d74229b2b/src/Framework/BaseConsoleApplication.php#L223-L236
27,068
Radvance/Radvance
src/Framework/BaseConsoleApplication.php
BaseConsoleApplication.configureCache
protected function configureCache() { if (!isset($this['cache'])) { $this['cache'] = [ 'type' => 'array' ]; } if (!isset($this['cache']['type'])) { throw new RuntimeException("cache type not configured correctly"); } switch ...
php
protected function configureCache() { if (!isset($this['cache'])) { $this['cache'] = [ 'type' => 'array' ]; } if (!isset($this['cache']['type'])) { throw new RuntimeException("cache type not configured correctly"); } switch ...
[ "protected", "function", "configureCache", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "[", "'cache'", "]", ")", ")", "{", "$", "this", "[", "'cache'", "]", "=", "[", "'type'", "=>", "'array'", "]", ";", "}", "if", "(", "!", "isset"...
Configure cache.
[ "Configure", "cache", "." ]
980034dd02da75882089210a25da6d5d74229b2b
https://github.com/Radvance/Radvance/blob/980034dd02da75882089210a25da6d5d74229b2b/src/Framework/BaseConsoleApplication.php#L241-L270
27,069
Radvance/Radvance
src/Framework/BaseConsoleApplication.php
BaseConsoleApplication.configureService
protected function configureService() { // Translations $this['locale_fallbacks'] = array('en_US'); $this->register(new TranslationServiceProvider()); $translator = $this['translator']; $translator->addLoader('yaml', new RecursiveYamlFileMessageLoader()); $files = g...
php
protected function configureService() { // Translations $this['locale_fallbacks'] = array('en_US'); $this->register(new TranslationServiceProvider()); $translator = $this['translator']; $translator->addLoader('yaml', new RecursiveYamlFileMessageLoader()); $files = g...
[ "protected", "function", "configureService", "(", ")", "{", "// Translations", "$", "this", "[", "'locale_fallbacks'", "]", "=", "array", "(", "'en_US'", ")", ";", "$", "this", "->", "register", "(", "new", "TranslationServiceProvider", "(", ")", ")", ";", "...
Configure services.
[ "Configure", "services", "." ]
980034dd02da75882089210a25da6d5d74229b2b
https://github.com/Radvance/Radvance/blob/980034dd02da75882089210a25da6d5d74229b2b/src/Framework/BaseConsoleApplication.php#L275-L289
27,070
AliyunOpenAPI/php-aliyun-open-api-mns
src/Client.php
Client.createQueue
public function createQueue(CreateQueueRequest $request) { $response = new CreateQueueResponse($request->getQueueName()); return $this->client->sendRequest($request, $response); }
php
public function createQueue(CreateQueueRequest $request) { $response = new CreateQueueResponse($request->getQueueName()); return $this->client->sendRequest($request, $response); }
[ "public", "function", "createQueue", "(", "CreateQueueRequest", "$", "request", ")", "{", "$", "response", "=", "new", "CreateQueueResponse", "(", "$", "request", "->", "getQueueName", "(", ")", ")", ";", "return", "$", "this", "->", "client", "->", "sendReq...
Create Queue and Returns the Queue reference @param CreateQueueRequest $request : the QueueName and QueueAttributes @return CreateQueueResponse $response: the CreateQueueResponse @throws QueueAlreadyExistException if queue already exists @throws InvalidArgumentException if any argument value is invalid @throws MnsE...
[ "Create", "Queue", "and", "Returns", "the", "Queue", "reference" ]
bceb8e02f99cac84f71aad69c8189803333a5f8b
https://github.com/AliyunOpenAPI/php-aliyun-open-api-mns/blob/bceb8e02f99cac84f71aad69c8189803333a5f8b/src/Client.php#L72-L77
27,071
AliyunOpenAPI/php-aliyun-open-api-mns
src/Client.php
Client.listQueue
public function listQueue(ListQueueRequest $request) { $response = new ListQueueResponse(); return $this->client->sendRequest($request, $response); }
php
public function listQueue(ListQueueRequest $request) { $response = new ListQueueResponse(); return $this->client->sendRequest($request, $response); }
[ "public", "function", "listQueue", "(", "ListQueueRequest", "$", "request", ")", "{", "$", "response", "=", "new", "ListQueueResponse", "(", ")", ";", "return", "$", "this", "->", "client", "->", "sendRequest", "(", "$", "request", ",", "$", "response", ")...
Query the queues created by current account @param ListQueueRequest $request : define filters for quering queues @return ListQueueResponse: the response containing queueNames
[ "Query", "the", "queues", "created", "by", "current", "account" ]
bceb8e02f99cac84f71aad69c8189803333a5f8b
https://github.com/AliyunOpenAPI/php-aliyun-open-api-mns/blob/bceb8e02f99cac84f71aad69c8189803333a5f8b/src/Client.php#L106-L111
27,072
AliyunOpenAPI/php-aliyun-open-api-mns
src/Client.php
Client.deleteQueue
public function deleteQueue($queueName) { $request = new DeleteQueueRequest($queueName); $response = new DeleteQueueResponse(); return $this->client->sendRequest($request, $response); }
php
public function deleteQueue($queueName) { $request = new DeleteQueueRequest($queueName); $response = new DeleteQueueResponse(); return $this->client->sendRequest($request, $response); }
[ "public", "function", "deleteQueue", "(", "$", "queueName", ")", "{", "$", "request", "=", "new", "DeleteQueueRequest", "(", "$", "queueName", ")", ";", "$", "response", "=", "new", "DeleteQueueResponse", "(", ")", ";", "return", "$", "this", "->", "client...
Delete the specified queue the request will succeed even when the queue does not exist @param $queueName : the queueName @return DeleteQueueResponse
[ "Delete", "the", "specified", "queue", "the", "request", "will", "succeed", "even", "when", "the", "queue", "does", "not", "exist" ]
bceb8e02f99cac84f71aad69c8189803333a5f8b
https://github.com/AliyunOpenAPI/php-aliyun-open-api-mns/blob/bceb8e02f99cac84f71aad69c8189803333a5f8b/src/Client.php#L130-L136
27,073
AliyunOpenAPI/php-aliyun-open-api-mns
src/Client.php
Client.createTopic
public function createTopic(CreateTopicRequest $request) { $response = new CreateTopicResponse($request->getTopicName()); return $this->client->sendRequest($request, $response); }
php
public function createTopic(CreateTopicRequest $request) { $response = new CreateTopicResponse($request->getTopicName()); return $this->client->sendRequest($request, $response); }
[ "public", "function", "createTopic", "(", "CreateTopicRequest", "$", "request", ")", "{", "$", "response", "=", "new", "CreateTopicResponse", "(", "$", "request", "->", "getTopicName", "(", ")", ")", ";", "return", "$", "this", "->", "client", "->", "sendReq...
Create Topic and Returns the Topic reference @param CreateTopicRequest $request : the TopicName and TopicAttributes @return CreateTopicResponse $response: the CreateTopicResponse @throws TopicAlreadyExistException if topic already exists @throws InvalidArgumentException if any argument value is invalid @throws MnsE...
[ "Create", "Topic", "and", "Returns", "the", "Topic", "reference" ]
bceb8e02f99cac84f71aad69c8189803333a5f8b
https://github.com/AliyunOpenAPI/php-aliyun-open-api-mns/blob/bceb8e02f99cac84f71aad69c8189803333a5f8b/src/Client.php#L173-L178
27,074
AliyunOpenAPI/php-aliyun-open-api-mns
src/Client.php
Client.deleteTopic
public function deleteTopic($topicName) { $request = new DeleteTopicRequest($topicName); $response = new DeleteTopicResponse(); return $this->client->sendRequest($request, $response); }
php
public function deleteTopic($topicName) { $request = new DeleteTopicRequest($topicName); $response = new DeleteTopicResponse(); return $this->client->sendRequest($request, $response); }
[ "public", "function", "deleteTopic", "(", "$", "topicName", ")", "{", "$", "request", "=", "new", "DeleteTopicRequest", "(", "$", "topicName", ")", ";", "$", "response", "=", "new", "DeleteTopicResponse", "(", ")", ";", "return", "$", "this", "->", "client...
Delete the specified topic the request will succeed even when the topic does not exist @param $topicName : the topicName @return DeleteTopicResponse
[ "Delete", "the", "specified", "topic", "the", "request", "will", "succeed", "even", "when", "the", "topic", "does", "not", "exist" ]
bceb8e02f99cac84f71aad69c8189803333a5f8b
https://github.com/AliyunOpenAPI/php-aliyun-open-api-mns/blob/bceb8e02f99cac84f71aad69c8189803333a5f8b/src/Client.php#L189-L195
27,075
AliyunOpenAPI/php-aliyun-open-api-mns
src/Client.php
Client.listTopic
public function listTopic(ListTopicRequest $request) { $response = new ListTopicResponse(); return $this->client->sendRequest($request, $response); }
php
public function listTopic(ListTopicRequest $request) { $response = new ListTopicResponse(); return $this->client->sendRequest($request, $response); }
[ "public", "function", "listTopic", "(", "ListTopicRequest", "$", "request", ")", "{", "$", "response", "=", "new", "ListTopicResponse", "(", ")", ";", "return", "$", "this", "->", "client", "->", "sendRequest", "(", "$", "request", ",", "$", "response", ")...
Query the topics created by current account @param ListTopicRequest $request : define filters for quering topics @return ListTopicResponse: the response containing topicNames
[ "Query", "the", "topics", "created", "by", "current", "account" ]
bceb8e02f99cac84f71aad69c8189803333a5f8b
https://github.com/AliyunOpenAPI/php-aliyun-open-api-mns/blob/bceb8e02f99cac84f71aad69c8189803333a5f8b/src/Client.php#L205-L210
27,076
AliyunOpenAPI/php-aliyun-open-api-mns
src/Common/XMLParser.php
XMLParser.parseNormalError
static function parseNormalError(\XMLReader $xmlReader) { $result = array( 'Code' => null, 'Message' => null, 'RequestId' => null, 'HostId' => null ); while ($xmlReader->Read()) { if ($xmlReader->nodeType == \XMLReader::ELEMENT) { switch ($xmlReader->name) { ...
php
static function parseNormalError(\XMLReader $xmlReader) { $result = array( 'Code' => null, 'Message' => null, 'RequestId' => null, 'HostId' => null ); while ($xmlReader->Read()) { if ($xmlReader->nodeType == \XMLReader::ELEMENT) { switch ($xmlReader->name) { ...
[ "static", "function", "parseNormalError", "(", "\\", "XMLReader", "$", "xmlReader", ")", "{", "$", "result", "=", "array", "(", "'Code'", "=>", "null", ",", "'Message'", "=>", "null", ",", "'RequestId'", "=>", "null", ",", "'HostId'", "=>", "null", ")", ...
Most of the error responses are in same format.
[ "Most", "of", "the", "error", "responses", "are", "in", "same", "format", "." ]
bceb8e02f99cac84f71aad69c8189803333a5f8b
https://github.com/AliyunOpenAPI/php-aliyun-open-api-mns/blob/bceb8e02f99cac84f71aad69c8189803333a5f8b/src/Common/XMLParser.php#L11-L46
27,077
vanilla/garden-container
src/Container.php
Container.arrayClone
private function arrayClone(array $array) { return array_map(function ($element) { return ((is_array($element)) ? $this->arrayClone($element) : ((is_object($element)) ? clone $element : $element ) ); ...
php
private function arrayClone(array $array) { return array_map(function ($element) { return ((is_array($element)) ? $this->arrayClone($element) : ((is_object($element)) ? clone $element : $element ) ); ...
[ "private", "function", "arrayClone", "(", "array", "$", "array", ")", "{", "return", "array_map", "(", "function", "(", "$", "element", ")", "{", "return", "(", "(", "is_array", "(", "$", "element", ")", ")", "?", "$", "this", "->", "arrayClone", "(", ...
Deep clone an array. @param array $array The array to clone. @return array Returns the cloned array. @see http://stackoverflow.com/a/17729234
[ "Deep", "clone", "an", "array", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L56-L66
27,078
vanilla/garden-container
src/Container.php
Container.rule
public function rule($id) { $id = $this->normalizeID($id); if (!isset($this->rules[$id])) { $this->rules[$id] = []; } $this->currentRuleName = $id; $this->currentRule = &$this->rules[$id]; return $this; }
php
public function rule($id) { $id = $this->normalizeID($id); if (!isset($this->rules[$id])) { $this->rules[$id] = []; } $this->currentRuleName = $id; $this->currentRule = &$this->rules[$id]; return $this; }
[ "public", "function", "rule", "(", "$", "id", ")", "{", "$", "id", "=", "$", "this", "->", "normalizeID", "(", "$", "id", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "rules", "[", "$", "id", "]", ")", ")", "{", "$", "this", "...
Set the current rule. @param string $id The ID of the rule. @return $this
[ "Set", "the", "current", "rule", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L93-L103
27,079
vanilla/garden-container
src/Container.php
Container.setAliasOf
public function setAliasOf($alias) { $alias = $this->normalizeID($alias); if ($alias === $this->currentRuleName) { trigger_error("You cannot set alias '$alias' to itself.", E_USER_NOTICE); } else { $this->currentRule['aliasOf'] = $alias; } return $this; ...
php
public function setAliasOf($alias) { $alias = $this->normalizeID($alias); if ($alias === $this->currentRuleName) { trigger_error("You cannot set alias '$alias' to itself.", E_USER_NOTICE); } else { $this->currentRule['aliasOf'] = $alias; } return $this; ...
[ "public", "function", "setAliasOf", "(", "$", "alias", ")", "{", "$", "alias", "=", "$", "this", "->", "normalizeID", "(", "$", "alias", ")", ";", "if", "(", "$", "alias", "===", "$", "this", "->", "currentRuleName", ")", "{", "trigger_error", "(", "...
Set the rule that the current rule is an alias of. @param string $alias The name of an entry in the container to point to. @return $this
[ "Set", "the", "rule", "that", "the", "current", "rule", "is", "an", "alias", "of", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L140-L149
27,080
vanilla/garden-container
src/Container.php
Container.addAlias
public function addAlias(...$alias) { foreach ($alias as $name) { $name = $this->normalizeID($name); if ($name === $this->currentRuleName) { trigger_error("Tried to set alias '$name' to self.", E_USER_NOTICE); } else { $this->rules[$name]['ali...
php
public function addAlias(...$alias) { foreach ($alias as $name) { $name = $this->normalizeID($name); if ($name === $this->currentRuleName) { trigger_error("Tried to set alias '$name' to self.", E_USER_NOTICE); } else { $this->rules[$name]['ali...
[ "public", "function", "addAlias", "(", "...", "$", "alias", ")", "{", "foreach", "(", "$", "alias", "as", "$", "name", ")", "{", "$", "name", "=", "$", "this", "->", "normalizeID", "(", "$", "name", ")", ";", "if", "(", "$", "name", "===", "$", ...
Add an alias of the current rule. Setting an alias to the current rule means that getting an item with the alias' name will be like getting the item with the current rule. If the current rule is shared then the same shared instance will be returned. You can add multiple aliases by passing additional arguments to this ...
[ "Add", "an", "alias", "of", "the", "current", "rule", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L165-L176
27,081
vanilla/garden-container
src/Container.php
Container.removeAlias
public function removeAlias($alias) { $alias = $this->normalizeID($alias); if (!empty($this->rules[$alias]['aliasOf']) && $this->rules[$alias]['aliasOf'] !== $this->currentRuleName) { trigger_error("Alias '$alias' does not point to the current rule.", E_USER_NOTICE); } unse...
php
public function removeAlias($alias) { $alias = $this->normalizeID($alias); if (!empty($this->rules[$alias]['aliasOf']) && $this->rules[$alias]['aliasOf'] !== $this->currentRuleName) { trigger_error("Alias '$alias' does not point to the current rule.", E_USER_NOTICE); } unse...
[ "public", "function", "removeAlias", "(", "$", "alias", ")", "{", "$", "alias", "=", "$", "this", "->", "normalizeID", "(", "$", "alias", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "rules", "[", "$", "alias", "]", "[", "'aliasOf'", ...
Remove an alias of the current rule. If {@link Container::removeAlias()} is called with an alias that references a different rule then an **E_USER_NOTICE** level error is raised, but the alias is still removed. @param string $alias The alias to remove. @return $this
[ "Remove", "an", "alias", "of", "the", "current", "rule", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L187-L196
27,082
vanilla/garden-container
src/Container.php
Container.getAliases
public function getAliases() { $result = []; foreach ($this->rules as $name => $rule) { if (!empty($rule['aliasOf']) && $rule['aliasOf'] === $this->currentRuleName) { $result[] = $name; } } return $result; }
php
public function getAliases() { $result = []; foreach ($this->rules as $name => $rule) { if (!empty($rule['aliasOf']) && $rule['aliasOf'] === $this->currentRuleName) { $result[] = $name; } } return $result; }
[ "public", "function", "getAliases", "(", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "rules", "as", "$", "name", "=>", "$", "rule", ")", "{", "if", "(", "!", "empty", "(", "$", "rule", "[", "'aliasOf'", "]", ...
Get all of the aliases of the current rule. This method is intended to aid in debugging and should not be used in production as it walks the entire rule array. @return array Returns an array of strings representing aliases.
[ "Get", "all", "of", "the", "aliases", "of", "the", "current", "rule", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L205-L215
27,083
vanilla/garden-container
src/Container.php
Container.setInstance
public function setInstance($name, $instance) { $this->instances[$this->normalizeID($name)] = $instance; return $this; }
php
public function setInstance($name, $instance) { $this->instances[$this->normalizeID($name)] = $instance; return $this; }
[ "public", "function", "setInstance", "(", "$", "name", ",", "$", "instance", ")", "{", "$", "this", "->", "instances", "[", "$", "this", "->", "normalizeID", "(", "$", "name", ")", "]", "=", "$", "instance", ";", "return", "$", "this", ";", "}" ]
Set a specific shared instance into the container. When you set an instance into the container then it will always be returned by subsequent retrievals, even if a rule is configured that says that instances should not be shared. @param string $name The name of the container entry. @param mixed $instance This instance...
[ "Set", "a", "specific", "shared", "instance", "into", "the", "container", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L307-L310
27,084
vanilla/garden-container
src/Container.php
Container.makeRule
private function makeRule($nid) { $rule = isset($this->rules[$nid]) ? $this->rules[$nid] : []; if (class_exists($nid)) { for ($class = get_parent_class($nid); !empty($class); $class = get_parent_class($class)) { // Don't add the rule if it doesn't say to inherit. ...
php
private function makeRule($nid) { $rule = isset($this->rules[$nid]) ? $this->rules[$nid] : []; if (class_exists($nid)) { for ($class = get_parent_class($nid); !empty($class); $class = get_parent_class($class)) { // Don't add the rule if it doesn't say to inherit. ...
[ "private", "function", "makeRule", "(", "$", "nid", ")", "{", "$", "rule", "=", "isset", "(", "$", "this", "->", "rules", "[", "$", "nid", "]", ")", "?", "$", "this", "->", "rules", "[", "$", "nid", "]", ":", "[", "]", ";", "if", "(", "class_...
Make a rule based on an ID. @param string $nid A normalized ID. @return array Returns an array representing a rule.
[ "Make", "a", "rule", "based", "on", "an", "ID", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L365-L414
27,085
vanilla/garden-container
src/Container.php
Container.makeFactory
private function makeFactory($nid, array $rule) { $className = empty($rule['class']) ? $nid : $rule['class']; if (!empty($rule['factory'])) { // The instance is created with a user-supplied factory function. $callback = $rule['factory']; $function = $this->reflectCal...
php
private function makeFactory($nid, array $rule) { $className = empty($rule['class']) ? $nid : $rule['class']; if (!empty($rule['factory'])) { // The instance is created with a user-supplied factory function. $callback = $rule['factory']; $function = $this->reflectCal...
[ "private", "function", "makeFactory", "(", "$", "nid", ",", "array", "$", "rule", ")", "{", "$", "className", "=", "empty", "(", "$", "rule", "[", "'class'", "]", ")", "?", "$", "nid", ":", "$", "rule", "[", "'class'", "]", ";", "if", "(", "!", ...
Make a function that creates objects from a rule. @param string $nid The normalized ID of the container item. @param array $rule The resolved rule for the ID. @return \Closure Returns a function that when called will create a new instance of the class. @throws NotFoundException No entry was found for this identifier.
[ "Make", "a", "function", "that", "creates", "objects", "from", "a", "rule", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L424-L493
27,086
vanilla/garden-container
src/Container.php
Container.createSharedInstance
private function createSharedInstance($nid, array $rule, array $args) { if (!empty($rule['factory'])) { // The instance is created with a user-supplied factory function. $callback = $rule['factory']; $function = $this->reflectCallback($callback); if ($function->g...
php
private function createSharedInstance($nid, array $rule, array $args) { if (!empty($rule['factory'])) { // The instance is created with a user-supplied factory function. $callback = $rule['factory']; $function = $this->reflectCallback($callback); if ($function->g...
[ "private", "function", "createSharedInstance", "(", "$", "nid", ",", "array", "$", "rule", ",", "array", "$", "args", ")", "{", "if", "(", "!", "empty", "(", "$", "rule", "[", "'factory'", "]", ")", ")", "{", "// The instance is created with a user-supplied ...
Create a shared instance of a class from a rule. This method has the side effect of adding the new instance to the internal instances array of this object. @param string $nid The normalized ID of the container item. @param array $rule The resolved rule for the ID. @param array $args Additional arguments passed during...
[ "Create", "a", "shared", "instance", "of", "a", "class", "from", "a", "rule", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L506-L567
27,087
vanilla/garden-container
src/Container.php
Container.findRuleClass
private function findRuleClass($nid) { if (!isset($this->rules[$nid])) { return null; } elseif (!empty($this->rules[$nid]['aliasOf'])) { return $this->findRuleClass($this->rules[$nid]['aliasOf']); } elseif (!empty($this->rules[$nid]['class'])) { return $this->...
php
private function findRuleClass($nid) { if (!isset($this->rules[$nid])) { return null; } elseif (!empty($this->rules[$nid]['aliasOf'])) { return $this->findRuleClass($this->rules[$nid]['aliasOf']); } elseif (!empty($this->rules[$nid]['class'])) { return $this->...
[ "private", "function", "findRuleClass", "(", "$", "nid", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "rules", "[", "$", "nid", "]", ")", ")", "{", "return", "null", ";", "}", "elseif", "(", "!", "empty", "(", "$", "this", "->", "...
Find the class implemented by an ID. This tries to see if a rule exists for a normalized ID and what class it evaluates to. @param string $nid The normalized ID to look up. @return string|null Returns the name of the class associated with the rule or **null** if one could not be found.
[ "Find", "the", "class", "implemented", "by", "an", "ID", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L578-L588
27,088
vanilla/garden-container
src/Container.php
Container.makeDefaultArgs
private function makeDefaultArgs(\ReflectionFunctionAbstract $function, array $ruleArgs) { $ruleArgs = array_change_key_case($ruleArgs); $result = []; $pos = 0; foreach ($function->getParameters() as $i => $param) { $name = strtolower($param->name); $reflectedCl...
php
private function makeDefaultArgs(\ReflectionFunctionAbstract $function, array $ruleArgs) { $ruleArgs = array_change_key_case($ruleArgs); $result = []; $pos = 0; foreach ($function->getParameters() as $i => $param) { $name = strtolower($param->name); $reflectedCl...
[ "private", "function", "makeDefaultArgs", "(", "\\", "ReflectionFunctionAbstract", "$", "function", ",", "array", "$", "ruleArgs", ")", "{", "$", "ruleArgs", "=", "array_change_key_case", "(", "$", "ruleArgs", ")", ";", "$", "result", "=", "[", "]", ";", "$"...
Make an array of default arguments for a given function. @param \ReflectionFunctionAbstract $function The function to make the arguments for. @param array $ruleArgs An array of default arguments specifically for the function. @return array Returns an array in the form `name => defaultValue`. @throws NotFoundException ...
[ "Make", "an", "array", "of", "default", "arguments", "for", "a", "given", "function", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L598-L650
27,089
vanilla/garden-container
src/Container.php
Container.resolveArgs
private function resolveArgs(array $defaultArgs, array $args, $instance = null) { // First resolve all passed arguments so their types are known. $args = array_map( function ($arg) use ($instance) { return $arg instanceof ReferenceInterface ? $arg->resolve($this, $instance) :...
php
private function resolveArgs(array $defaultArgs, array $args, $instance = null) { // First resolve all passed arguments so their types are known. $args = array_map( function ($arg) use ($instance) { return $arg instanceof ReferenceInterface ? $arg->resolve($this, $instance) :...
[ "private", "function", "resolveArgs", "(", "array", "$", "defaultArgs", ",", "array", "$", "args", ",", "$", "instance", "=", "null", ")", "{", "// First resolve all passed arguments so their types are known.", "$", "args", "=", "array_map", "(", "function", "(", ...
Replace an array of default args with called args. @param array $defaultArgs The default arguments from {@link Container::makeDefaultArgs()}. @param array $args The arguments passed into a creation. @param mixed $instance An object instance if the arguments are being resolved on an already constructed object. @return ...
[ "Replace", "an", "array", "of", "default", "args", "with", "called", "args", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L661-L692
27,090
vanilla/garden-container
src/Container.php
Container.createInstance
private function createInstance($nid, array $args) { $rule = $this->makeRule($nid); // Cache the instance or its factory for future use. if (empty($rule['shared'])) { $factory = $this->makeFactory($nid, $rule); $instance = $factory($args); $this->factories[$n...
php
private function createInstance($nid, array $args) { $rule = $this->makeRule($nid); // Cache the instance or its factory for future use. if (empty($rule['shared'])) { $factory = $this->makeFactory($nid, $rule); $instance = $factory($args); $this->factories[$n...
[ "private", "function", "createInstance", "(", "$", "nid", ",", "array", "$", "args", ")", "{", "$", "rule", "=", "$", "this", "->", "makeRule", "(", "$", "nid", ")", ";", "// Cache the instance or its factory for future use.", "if", "(", "empty", "(", "$", ...
Create an instance of a container item. This method either creates a new instance or returns an already created shared instance. @param string $nid The normalized ID of the container item. @param array $args Additional arguments to pass to the constructor. @return object Returns an object instance.
[ "Create", "an", "instance", "of", "a", "container", "item", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L703-L715
27,091
vanilla/garden-container
src/Container.php
Container.call
public function call(callable $callback, array $args = []) { $instance = null; if (is_array($callback)) { $function = new \ReflectionMethod($callback[0], $callback[1]); if (is_object($callback[0])) { $instance = $callback[0]; } } else { ...
php
public function call(callable $callback, array $args = []) { $instance = null; if (is_array($callback)) { $function = new \ReflectionMethod($callback[0], $callback[1]); if (is_object($callback[0])) { $instance = $callback[0]; } } else { ...
[ "public", "function", "call", "(", "callable", "$", "callback", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "instance", "=", "null", ";", "if", "(", "is_array", "(", "$", "callback", ")", ")", "{", "$", "function", "=", "new", "\\", ...
Call a callback with argument injection. @param callable $callback The callback to call. @param array $args Additional arguments to pass to the callback. @return mixed Returns the result of the callback. @throws ContainerException Throws an exception if the callback cannot be understood.
[ "Call", "a", "callback", "with", "argument", "injection", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L725-L741
27,092
vanilla/garden-container
src/Container.php
Container.hasRule
public function hasRule($id) { $id = $this->normalizeID($id); return !empty($this->rules[$id]); }
php
public function hasRule($id) { $id = $this->normalizeID($id); return !empty($this->rules[$id]); }
[ "public", "function", "hasRule", "(", "$", "id", ")", "{", "$", "id", "=", "$", "this", "->", "normalizeID", "(", "$", "id", ")", ";", "return", "!", "empty", "(", "$", "this", "->", "rules", "[", "$", "id", "]", ")", ";", "}" ]
Determines whether a rule has been defined at a given ID. @param string $id Identifier of the entry to look for. @return bool Returns **true** if a rule has been defined or **false** otherwise.
[ "Determines", "whether", "a", "rule", "has", "been", "defined", "at", "a", "given", "ID", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L762-L765
27,093
vanilla/garden-container
src/Container.php
Container.hasInstance
public function hasInstance($id) { $id = $this->normalizeID($id); return isset($this->instances[$id]); }
php
public function hasInstance($id) { $id = $this->normalizeID($id); return isset($this->instances[$id]); }
[ "public", "function", "hasInstance", "(", "$", "id", ")", "{", "$", "id", "=", "$", "this", "->", "normalizeID", "(", "$", "id", ")", ";", "return", "isset", "(", "$", "this", "->", "instances", "[", "$", "id", "]", ")", ";", "}" ]
Returns true if the container already has an instance for the given identifier. Returns false otherwise. @param string $id Identifier of the entry to look for. @return bool
[ "Returns", "true", "if", "the", "container", "already", "has", "an", "instance", "for", "the", "given", "identifier", ".", "Returns", "false", "otherwise", "." ]
aa467fdd050808a65a27a032d4d62d1b0e293ba6
https://github.com/vanilla/garden-container/blob/aa467fdd050808a65a27a032d4d62d1b0e293ba6/src/Container.php#L774-L778
27,094
ThaDafinser/UserAgentParser
src/Model/Version.php
Version.setComplete
public function setComplete($complete) { // check if the version has only 0 -> so no real result // maybe move this out to the Providers itself? $left = preg_replace('/[0._]/', '', $complete); if ($left === '') { $complete = null; } $this->hydrateFromComp...
php
public function setComplete($complete) { // check if the version has only 0 -> so no real result // maybe move this out to the Providers itself? $left = preg_replace('/[0._]/', '', $complete); if ($left === '') { $complete = null; } $this->hydrateFromComp...
[ "public", "function", "setComplete", "(", "$", "complete", ")", "{", "// check if the version has only 0 -> so no real result", "// maybe move this out to the Providers itself?", "$", "left", "=", "preg_replace", "(", "'/[0._]/'", ",", "''", ",", "$", "complete", ")", ";"...
Set from the complete version string. @param string $complete
[ "Set", "from", "the", "complete", "version", "string", "." ]
199cc8286e593e8e00b99e8df8144981ed948246
https://github.com/ThaDafinser/UserAgentParser/blob/199cc8286e593e8e00b99e8df8144981ed948246/src/Model/Version.php#L151-L163
27,095
drupal/core-utility
Rectangle.php
Rectangle.rotate
public function rotate($angle) { // PHP 5.5 GD bug: https://bugs.php.net/bug.php?id=65148: To prevent buggy // behavior on negative multiples of 30 degrees we convert any negative // angle to a positive one between 0 and 360 degrees. $angle -= floor($angle / 360) * 360; // For some rotations that a...
php
public function rotate($angle) { // PHP 5.5 GD bug: https://bugs.php.net/bug.php?id=65148: To prevent buggy // behavior on negative multiples of 30 degrees we convert any negative // angle to a positive one between 0 and 360 degrees. $angle -= floor($angle / 360) * 360; // For some rotations that a...
[ "public", "function", "rotate", "(", "$", "angle", ")", "{", "// PHP 5.5 GD bug: https://bugs.php.net/bug.php?id=65148: To prevent buggy", "// behavior on negative multiples of 30 degrees we convert any negative", "// angle to a positive one between 0 and 360 degrees.", "$", "angle", "-=",...
Rotates the rectangle. @param float $angle Rotation angle. @return $this
[ "Rotates", "the", "rectangle", "." ]
fb1c262da83fb691bcdf1680c3a69791a1d1a01a
https://github.com/drupal/core-utility/blob/fb1c262da83fb691bcdf1680c3a69791a1d1a01a/Rectangle.php#L83-L124
27,096
drupal/core-utility
Rectangle.php
Rectangle.fixImprecision
protected function fixImprecision($input, $imprecision) { if ($this->delta($input) < abs($imprecision)) { return $input + $imprecision; } return $input; }
php
protected function fixImprecision($input, $imprecision) { if ($this->delta($input) < abs($imprecision)) { return $input + $imprecision; } return $input; }
[ "protected", "function", "fixImprecision", "(", "$", "input", ",", "$", "imprecision", ")", "{", "if", "(", "$", "this", "->", "delta", "(", "$", "input", ")", "<", "abs", "(", "$", "imprecision", ")", ")", "{", "return", "$", "input", "+", "$", "i...
Performs an imprecision check on the input value and fixes it if needed. GD that uses C floats internally, whereas we at PHP level use C doubles. In some cases, we need to compensate imprecision. @param float $input The input value. @param float $imprecision The imprecision factor. @return float A value, where impre...
[ "Performs", "an", "imprecision", "check", "on", "the", "input", "value", "and", "fixes", "it", "if", "needed", "." ]
fb1c262da83fb691bcdf1680c3a69791a1d1a01a
https://github.com/drupal/core-utility/blob/fb1c262da83fb691bcdf1680c3a69791a1d1a01a/Rectangle.php#L141-L146
27,097
drupal/core-utility
UrlHelper.php
UrlHelper.buildQuery
public static function buildQuery(array $query, $parent = '') { $params = []; foreach ($query as $key => $value) { $key = ($parent ? $parent . rawurlencode('[' . $key . ']') : rawurlencode($key)); // Recurse into children. if (is_array($value)) { $params[] = static::buildQuery($value...
php
public static function buildQuery(array $query, $parent = '') { $params = []; foreach ($query as $key => $value) { $key = ($parent ? $parent . rawurlencode('[' . $key . ']') : rawurlencode($key)); // Recurse into children. if (is_array($value)) { $params[] = static::buildQuery($value...
[ "public", "static", "function", "buildQuery", "(", "array", "$", "query", ",", "$", "parent", "=", "''", ")", "{", "$", "params", "=", "[", "]", ";", "foreach", "(", "$", "query", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "key", "=", ...
Parses an array into a valid, rawurlencoded query string. rawurlencode() is RFC3986 compliant, and as a consequence RFC3987 compliant. The latter defines the required format of "URLs" in HTML5. urlencode() is almost the same as rawurlencode(), except that it encodes spaces as "+" instead of "%20". This makes its resul...
[ "Parses", "an", "array", "into", "a", "valid", "rawurlencoded", "query", "string", "." ]
fb1c262da83fb691bcdf1680c3a69791a1d1a01a
https://github.com/drupal/core-utility/blob/fb1c262da83fb691bcdf1680c3a69791a1d1a01a/UrlHelper.php#L45-L66
27,098
drupal/core-utility
Random.php
Random.image
public function image($destination, $min_resolution, $max_resolution) { $extension = pathinfo($destination, PATHINFO_EXTENSION); $min = explode('x', $min_resolution); $max = explode('x', $max_resolution); $width = rand((int) $min[0], (int) $max[0]); $height = rand((int) $min[1], (int) $max[1]); ...
php
public function image($destination, $min_resolution, $max_resolution) { $extension = pathinfo($destination, PATHINFO_EXTENSION); $min = explode('x', $min_resolution); $max = explode('x', $max_resolution); $width = rand((int) $min[0], (int) $max[0]); $height = rand((int) $min[1], (int) $max[1]); ...
[ "public", "function", "image", "(", "$", "destination", ",", "$", "min_resolution", ",", "$", "max_resolution", ")", "{", "$", "extension", "=", "pathinfo", "(", "$", "destination", ",", "PATHINFO_EXTENSION", ")", ";", "$", "min", "=", "explode", "(", "'x'...
Create a placeholder image. @param string $destination The absolute file path where the image should be stored. @param int $min_resolution @param int $max_resolution @return string Path to image file.
[ "Create", "a", "placeholder", "image", "." ]
fb1c262da83fb691bcdf1680c3a69791a1d1a01a
https://github.com/drupal/core-utility/blob/fb1c262da83fb691bcdf1680c3a69791a1d1a01a/Random.php#L271-L296
27,099
drupal/core-utility
Unicode.php
Unicode.setStatus
public static function setStatus($status) { if (!in_array($status, [static::STATUS_SINGLEBYTE, static::STATUS_MULTIBYTE, static::STATUS_ERROR])) { throw new \InvalidArgumentException('Invalid status value for unicode support.'); } static::$status = $status; }
php
public static function setStatus($status) { if (!in_array($status, [static::STATUS_SINGLEBYTE, static::STATUS_MULTIBYTE, static::STATUS_ERROR])) { throw new \InvalidArgumentException('Invalid status value for unicode support.'); } static::$status = $status; }
[ "public", "static", "function", "setStatus", "(", "$", "status", ")", "{", "if", "(", "!", "in_array", "(", "$", "status", ",", "[", "static", "::", "STATUS_SINGLEBYTE", ",", "static", "::", "STATUS_MULTIBYTE", ",", "static", "::", "STATUS_ERROR", "]", ")"...
Sets the value for multibyte support status for the current environment. The following status keys are supported: - \Drupal\Component\Utility\Unicode::STATUS_MULTIBYTE Full unicode support using an extension. - \Drupal\Component\Utility\Unicode::STATUS_SINGLEBYTE Standard PHP (emulated) unicode support. - \Drupal\Comp...
[ "Sets", "the", "value", "for", "multibyte", "support", "status", "for", "the", "current", "environment", "." ]
fb1c262da83fb691bcdf1680c3a69791a1d1a01a
https://github.com/drupal/core-utility/blob/fb1c262da83fb691bcdf1680c3a69791a1d1a01a/Unicode.php#L127-L132