repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.orderBy | public function orderBy( $column, $type = self::ASC )
{
$string = $this->getIdentifier( $column );
if ( $type == self::DESC )
{
$string .= ' DESC';
}
if ( $this->orderString == '' )
{
$this->orderString = "ORDER BY {$string}";
}
... | php | public function orderBy( $column, $type = self::ASC )
{
$string = $this->getIdentifier( $column );
if ( $type == self::DESC )
{
$string .= ' DESC';
}
if ( $this->orderString == '' )
{
$this->orderString = "ORDER BY {$string}";
}
... | [
"public",
"function",
"orderBy",
"(",
"$",
"column",
",",
"$",
"type",
"=",
"self",
"::",
"ASC",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"column",
")",
";",
"if",
"(",
"$",
"type",
"==",
"self",
"::",
"DESC",
"... | Returns SQL that orders the result set by a given column.
You can call orderBy multiple times. Each call will add a
column to order by.
Example:
<code>
$q->select( '*' )->from( 'table' )
->orderBy( 'id' );
</code>
@param string $column a column name in the result set
@param string $type if the column should be sorte... | [
"Returns",
"SQL",
"that",
"orders",
"the",
"result",
"set",
"by",
"a",
"given",
"column",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L723-L741 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.groupBy | public function groupBy()
{
$args = func_get_args();
$columns = self::arrayFlatten( $args );
if ( count( $columns ) < 1 )
{
throw new ezcQueryVariableParameterException( 'groupBy', count( $args ), 1 );
}
$columns = $this->getIdentifiers( $columns );
... | php | public function groupBy()
{
$args = func_get_args();
$columns = self::arrayFlatten( $args );
if ( count( $columns ) < 1 )
{
throw new ezcQueryVariableParameterException( 'groupBy', count( $args ), 1 );
}
$columns = $this->getIdentifiers( $columns );
... | [
"public",
"function",
"groupBy",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"columns",
"=",
"self",
"::",
"arrayFlatten",
"(",
"$",
"args",
")",
";",
"if",
"(",
"count",
"(",
"$",
"columns",
")",
"<",
"1",
")",
"{",
"th... | Returns SQL that groups the result set by a given column.
You can call groupBy multiple times. Each call will add a
column to group by.
Example:
<code>
$q->select( '*' )->from( 'table' )
->groupBy( 'id' );
</code>
@throws ezcQueryVariableParameterException if called with no parameters.
@param string $column a column... | [
"Returns",
"SQL",
"that",
"groups",
"the",
"result",
"set",
"by",
"a",
"given",
"column",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L759-L782 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.having | public function having()
{
// using groupBy()->having() syntax assumed, so check if last call was to groupBy()
if ( $this->lastInvokedMethod != 'group' && $this->lastInvokedMethod != 'having' )
{
throw new ezcQueryInvalidException( 'SELECT', 'Invoking having() not immediately aft... | php | public function having()
{
// using groupBy()->having() syntax assumed, so check if last call was to groupBy()
if ( $this->lastInvokedMethod != 'group' && $this->lastInvokedMethod != 'having' )
{
throw new ezcQueryInvalidException( 'SELECT', 'Invoking having() not immediately aft... | [
"public",
"function",
"having",
"(",
")",
"{",
"// using groupBy()->having() syntax assumed, so check if last call was to groupBy()",
"if",
"(",
"$",
"this",
"->",
"lastInvokedMethod",
"!=",
"'group'",
"&&",
"$",
"this",
"->",
"lastInvokedMethod",
"!=",
"'having'",
")",
... | Returns SQL that set having by a given expression.
You can call having multiple times. Each call will add an
expression with a logical and.
Example:
<code>
$q->select( '*' )->from( 'table' )->groupBy( 'id' )
->having( $q->expr->eq('id',1) );
</code>
@throws ezcQueryInvalidException
if invoked without preceding call ... | [
"Returns",
"SQL",
"that",
"set",
"having",
"by",
"a",
"given",
"expression",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L804-L833 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php | ezcQuerySelect.getQuery | public function getQuery()
{
if ( $this->selectString == null )
{
throw new ezcQueryInvalidException( "SELECT", "select() was not called before getQuery()." );
}
$query = "{$this->selectString}";
if ( $this->fromString != null )
{
$query = "{$... | php | public function getQuery()
{
if ( $this->selectString == null )
{
throw new ezcQueryInvalidException( "SELECT", "select() was not called before getQuery()." );
}
$query = "{$this->selectString}";
if ( $this->fromString != null )
{
$query = "{$... | [
"public",
"function",
"getQuery",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"selectString",
"==",
"null",
")",
"{",
"throw",
"new",
"ezcQueryInvalidException",
"(",
"\"SELECT\"",
",",
"\"select() was not called before getQuery().\"",
")",
";",
"}",
"$",
"quer... | Returns the complete select query string.
This method uses the build methods to build the
various parts of the select query.
@todo add newlines? easier for debugging
@throws ezcQueryInvalidException if it was not possible to build a valid query.
@return string | [
"Returns",
"the",
"complete",
"select",
"query",
"string",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/query_select.php#L864-L897 |
SporkCode/Spork | src/Mvc/Listener/ViewModelIdentity.php | ViewModelIdentity.injectIdentityModel | public function injectIdentityModel(MvcEvent $event)
{
$viewModel = $event->getViewModel();
if ($viewModel->getTemplate() == 'layout/layout') {
$servies = $event->getApplication()->getServiceManager();
$appConfig = $servies->get('config');
if (isset($appConfig['view_model_identity'... | php | public function injectIdentityModel(MvcEvent $event)
{
$viewModel = $event->getViewModel();
if ($viewModel->getTemplate() == 'layout/layout') {
$servies = $event->getApplication()->getServiceManager();
$appConfig = $servies->get('config');
if (isset($appConfig['view_model_identity'... | [
"public",
"function",
"injectIdentityModel",
"(",
"MvcEvent",
"$",
"event",
")",
"{",
"$",
"viewModel",
"=",
"$",
"event",
"->",
"getViewModel",
"(",
")",
";",
"if",
"(",
"$",
"viewModel",
"->",
"getTemplate",
"(",
")",
"==",
"'layout/layout'",
")",
"{",
... | Inject identity view model into layout
@param MvcEvent $event
@throws \Exception | [
"Inject",
"identity",
"view",
"model",
"into",
"layout"
] | train | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/Mvc/Listener/ViewModelIdentity.php#L60-L89 |
FriendsOfApi/phraseapp | src/Api/Key.php | Key.create | public function create(string $projectKey, string $name, array $params = [])
{
$params['name'] = $name;
$response = $this->httpPost(sprintf('/api/v2/projects/%s/keys', $projectKey), $params);
if (!$this->hydrator) {
return $response;
}
if ($response->getStatusC... | php | public function create(string $projectKey, string $name, array $params = [])
{
$params['name'] = $name;
$response = $this->httpPost(sprintf('/api/v2/projects/%s/keys', $projectKey), $params);
if (!$this->hydrator) {
return $response;
}
if ($response->getStatusC... | [
"public",
"function",
"create",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"name",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"$",
"response",
"=",
"$",
"this",
"->",
... | Create a new key.
@param string $projectKey
@param string $localeId
@param array $params
@return KeyCreated|ResponseInterface | [
"Create",
"a",
"new",
"key",
"."
] | train | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Key.php#L30-L45 |
FriendsOfApi/phraseapp | src/Api/Key.php | Key.search | public function search(string $projectKey, array $params = [])
{
$q = '';
if (isset($params['tags'])) {
$q .= 'tags:'.$params['tags'].' ';
}
if (isset($params['name'])) {
$q .= 'name:'.$params['name'].' ';
}
if (isset($params['ids'])) {
... | php | public function search(string $projectKey, array $params = [])
{
$q = '';
if (isset($params['tags'])) {
$q .= 'tags:'.$params['tags'].' ';
}
if (isset($params['name'])) {
$q .= 'name:'.$params['name'].' ';
}
if (isset($params['ids'])) {
... | [
"public",
"function",
"search",
"(",
"string",
"$",
"projectKey",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"q",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'tags'",
"]",
")",
")",
"{",
"$",
"q",
".=",
"'tags:... | Search keys.
@param string $projectKey
@param array $params
@return KeySearchResults|ResponseInterface | [
"Search",
"keys",
"."
] | train | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Key.php#L55-L86 |
FriendsOfApi/phraseapp | src/Api/Key.php | Key.delete | public function delete(string $projectKey, string $keyId)
{
$response = $this->httpDelete(sprintf('/api/v2/projects/%s/keys/%s', $projectKey, $keyId));
if (!$this->hydrator) {
return $response;
}
if ($response->getStatusCode() !== 204) {
$this->handleErrors(... | php | public function delete(string $projectKey, string $keyId)
{
$response = $this->httpDelete(sprintf('/api/v2/projects/%s/keys/%s', $projectKey, $keyId));
if (!$this->hydrator) {
return $response;
}
if ($response->getStatusCode() !== 204) {
$this->handleErrors(... | [
"public",
"function",
"delete",
"(",
"string",
"$",
"projectKey",
",",
"string",
"$",
"keyId",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"httpDelete",
"(",
"sprintf",
"(",
"'/api/v2/projects/%s/keys/%s'",
",",
"$",
"projectKey",
",",
"$",
"keyId",
... | Delete a key.
@param string $projectKey
@param string $keyId
@return bool|ResponseInterface | [
"Delete",
"a",
"key",
"."
] | train | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Api/Key.php#L96-L109 |
99designs/ergo-http | src/RequestFactory.php | RequestFactory._getUrl | private function _getUrl()
{
return new Url(sprintf(
'%s://%s:%d%s',
$this->_getScheme(),
$this->_server['SERVER_NAME'],
$this->_getPort(),
$this->_uriRelativeToHost($this->_server['REQUEST_URI'])
));
} | php | private function _getUrl()
{
return new Url(sprintf(
'%s://%s:%d%s',
$this->_getScheme(),
$this->_server['SERVER_NAME'],
$this->_getPort(),
$this->_uriRelativeToHost($this->_server['REQUEST_URI'])
));
} | [
"private",
"function",
"_getUrl",
"(",
")",
"{",
"return",
"new",
"Url",
"(",
"sprintf",
"(",
"'%s://%s:%d%s'",
",",
"$",
"this",
"->",
"_getScheme",
"(",
")",
",",
"$",
"this",
"->",
"_server",
"[",
"'SERVER_NAME'",
"]",
",",
"$",
"this",
"->",
"_getP... | ---------------------------------------- | [
"----------------------------------------"
] | train | https://github.com/99designs/ergo-http/blob/979b789f2e011a1cb70a00161e6b7bcd0d2e9c71/src/RequestFactory.php#L66-L75 |
php-lug/lug | src/Bundle/GridBundle/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
$root = $builder->root('lug_grid');
$root
->children()
->arrayNode('templates')
->prototype('scalar')->end()
->defaultValue([])
->end()
... | php | public function getConfigTreeBuilder()
{
$builder = new TreeBuilder();
$root = $builder->root('lug_grid');
$root
->children()
->arrayNode('templates')
->prototype('scalar')->end()
->defaultValue([])
->end()
... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"builder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"root",
"=",
"$",
"builder",
"->",
"root",
"(",
"'lug_grid'",
")",
";",
"$",
"root",
"->",
"children",
"(",
")",
"->",
"arrayNod... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/DependencyInjection/Configuration.php#L25-L45 |
vaibhavpandeyvpz/sandesh | src/Cookie.php | Cookie.withExpiry | public function withExpiry($expiry)
{
if (null !== $expiry) {
MessageValidations::assertCookieExpiry($expiry);
}
$clone = clone $this;
$clone->expiry = MessageValidations::normalizeCookieExpiry($expiry);
return $clone;
} | php | public function withExpiry($expiry)
{
if (null !== $expiry) {
MessageValidations::assertCookieExpiry($expiry);
}
$clone = clone $this;
$clone->expiry = MessageValidations::normalizeCookieExpiry($expiry);
return $clone;
} | [
"public",
"function",
"withExpiry",
"(",
"$",
"expiry",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"expiry",
")",
"{",
"MessageValidations",
"::",
"assertCookieExpiry",
"(",
"$",
"expiry",
")",
";",
"}",
"$",
"clone",
"=",
"clone",
"$",
"this",
";",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/Cookie.php#L148-L156 |
songshenzong/log | src/DataCollector/RequestCollector.php | RequestCollector.collect | public function collect()
{
$request = $this->request;
$response = $this->response;
$responseHeaders = $response->headers->all();
$cookies = [];
foreach ($response->headers->getCookies() as $cookie) {
$cookies[] = $this->getCookieHeader(
... | php | public function collect()
{
$request = $this->request;
$response = $this->response;
$responseHeaders = $response->headers->all();
$cookies = [];
foreach ($response->headers->getCookies() as $cookie) {
$cookies[] = $this->getCookieHeader(
... | [
"public",
"function",
"collect",
"(",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"request",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"response",
";",
"$",
"responseHeaders",
"=",
"$",
"response",
"->",
"headers",
"->",
"all",
"(",
")",
";... | Called by the DebugBar when data needs to be collected
@return array Collected data
@throws \InvalidArgumentException | [
"Called",
"by",
"the",
"DebugBar",
"when",
"data",
"needs",
"to",
"be",
"collected"
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DataCollector/RequestCollector.php#L55-L115 |
stk2k/net-driver | src/NetDriver/Curl/CurlNetDriver.php | CurlNetDriver.sendRequest | public function sendRequest(NetDriverHandleInterface $handle, HttpRequest $request)
{
$url = $request->getUrl();
try{
$ch = $handle->reset();
// set default options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
... | php | public function sendRequest(NetDriverHandleInterface $handle, HttpRequest $request)
{
$url = $request->getUrl();
try{
$ch = $handle->reset();
// set default options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
... | [
"public",
"function",
"sendRequest",
"(",
"NetDriverHandleInterface",
"$",
"handle",
",",
"HttpRequest",
"$",
"request",
")",
"{",
"$",
"url",
"=",
"$",
"request",
"->",
"getUrl",
"(",
")",
";",
"try",
"{",
"$",
"ch",
"=",
"$",
"handle",
"->",
"reset",
... | Send HTTP request
@param NetDriverHandleInterface $handle
@param HttpRequest $request
@return HttpResponse
@throws NetDriverException
@throws TimeoutException
@throws DeflateException | [
"Send",
"HTTP",
"request"
] | train | https://github.com/stk2k/net-driver/blob/75e0bc1a95ba430dd9ed9e69f6a0a5dd8f2e7b1c/src/NetDriver/Curl/CurlNetDriver.php#L43-L192 |
phpgears/dto | src/ScalarPayloadBehaviour.php | ScalarPayloadBehaviour.setPayloadParameter | private function setPayloadParameter(string $parameter, $value): void
{
$this->checkParameterType($value);
$this->defaultSetPayloadParameter($parameter, $value);
} | php | private function setPayloadParameter(string $parameter, $value): void
{
$this->checkParameterType($value);
$this->defaultSetPayloadParameter($parameter, $value);
} | [
"private",
"function",
"setPayloadParameter",
"(",
"string",
"$",
"parameter",
",",
"$",
"value",
")",
":",
"void",
"{",
"$",
"this",
"->",
"checkParameterType",
"(",
"$",
"value",
")",
";",
"$",
"this",
"->",
"defaultSetPayloadParameter",
"(",
"$",
"paramet... | Set payload parameter.
@param string $parameter
@param mixed $value | [
"Set",
"payload",
"parameter",
"."
] | train | https://github.com/phpgears/dto/blob/404b2cdea108538b55caa261c29280062dd0e3db/src/ScalarPayloadBehaviour.php#L33-L38 |
phpgears/dto | src/ScalarPayloadBehaviour.php | ScalarPayloadBehaviour.checkParameterType | final protected function checkParameterType($value): void
{
if (\is_array($value)) {
foreach ($value as $val) {
$this->checkParameterType($val);
}
} elseif ($value !== null && !\is_scalar($value)) {
throw new InvalidScalarParameterException(\sprint... | php | final protected function checkParameterType($value): void
{
if (\is_array($value)) {
foreach ($value as $val) {
$this->checkParameterType($val);
}
} elseif ($value !== null && !\is_scalar($value)) {
throw new InvalidScalarParameterException(\sprint... | [
"final",
"protected",
"function",
"checkParameterType",
"(",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"foreach",
"(",
"$",
"value",
"as",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"checkParame... | Check only scalar types allowed.
@param mixed $value
@throws InvalidScalarParameterException | [
"Check",
"only",
"scalar",
"types",
"allowed",
"."
] | train | https://github.com/phpgears/dto/blob/404b2cdea108538b55caa261c29280062dd0e3db/src/ScalarPayloadBehaviour.php#L47-L60 |
petrica/php-statsd-system | Model/Process/TopProcessParser.php | TopProcessParser.parse | public function parse()
{
$raw = $this->getRaw();
$count = count($raw);
for ($i = 7; $i < $count; $i++) {
$line = $raw[$i];
$process = new Process(
$line[11],
$line[0],
floatval($line[8]),
floatval($line... | php | public function parse()
{
$raw = $this->getRaw();
$count = count($raw);
for ($i = 7; $i < $count; $i++) {
$line = $raw[$i];
$process = new Process(
$line[11],
$line[0],
floatval($line[8]),
floatval($line... | [
"public",
"function",
"parse",
"(",
")",
"{",
"$",
"raw",
"=",
"$",
"this",
"->",
"getRaw",
"(",
")",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"raw",
")",
";",
"for",
"(",
"$",
"i",
"=",
"7",
";",
"$",
"i",
"<",
"$",
"count",
";",
"$",
... | Run the parsing process | [
"Run",
"the",
"parsing",
"process"
] | train | https://github.com/petrica/php-statsd-system/blob/c476be3514a631a605737888bb8f6eb096789c9d/Model/Process/TopProcessParser.php#L37-L53 |
nabab/bbn | src/bbn/file/system.php | system._connect_ftp | private function _connect_ftp(array $cfg): bool
{
if ( isset($cfg['host'], $cfg['user'], $cfg['pass']) ){
$args = [$cfg['host'], $cfg['port'] ?? 21, $cfg['timeout'] ?? 3];
try {
$this->stream = ftp_ssl_connect(...$args);
}
catch ( \Exception $e ){
$this->error = _('Impossib... | php | private function _connect_ftp(array $cfg): bool
{
if ( isset($cfg['host'], $cfg['user'], $cfg['pass']) ){
$args = [$cfg['host'], $cfg['port'] ?? 21, $cfg['timeout'] ?? 3];
try {
$this->stream = ftp_ssl_connect(...$args);
}
catch ( \Exception $e ){
$this->error = _('Impossib... | [
"private",
"function",
"_connect_ftp",
"(",
"array",
"$",
"cfg",
")",
":",
"bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"cfg",
"[",
"'host'",
"]",
",",
"$",
"cfg",
"[",
"'user'",
"]",
",",
"$",
"cfg",
"[",
"'pass'",
"]",
")",
")",
"{",
"$",
"args... | Connect to FTP
@param array $cfg
@return bool | [
"Connect",
"to",
"FTP"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/system.php#L56-L94 |
nabab/bbn | src/bbn/file/system.php | system._connect_ssh | private function _connect_ssh(array $cfg): bool
{
if ( isset($cfg['host']) ){
$param = [];
if ( isset($cfg['public'], $cfg['private']) ){
$param['hostkey'] = 'ssh-rsa';
}
$this->cn = @ssh2_connect($cfg['host'], $cfg['port'] ?? 22, $param, [
'debug' => function($message, $la... | php | private function _connect_ssh(array $cfg): bool
{
if ( isset($cfg['host']) ){
$param = [];
if ( isset($cfg['public'], $cfg['private']) ){
$param['hostkey'] = 'ssh-rsa';
}
$this->cn = @ssh2_connect($cfg['host'], $cfg['port'] ?? 22, $param, [
'debug' => function($message, $la... | [
"private",
"function",
"_connect_ssh",
"(",
"array",
"$",
"cfg",
")",
":",
"bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"cfg",
"[",
"'host'",
"]",
")",
")",
"{",
"$",
"param",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"cfg",
"[",
"'public... | Connects to SSH
@param array $cfg
@return bool | [
"Connects",
"to",
"SSH"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/system.php#L101-L151 |
nabab/bbn | src/bbn/file/system.php | system._get_items | private function _get_items(string $path, $type = 'both', bool $hidden = false, string $detailed = ''): array
{
$files = [];
if ( ($this->mode === 'ftp') && ($detailed || ($type !== 'both')) ){
if ( $fs = ftp_mlsd($this->stream, substr($path, strlen($this->prefix))) ){
foreach ( $fs as $f ){
... | php | private function _get_items(string $path, $type = 'both', bool $hidden = false, string $detailed = ''): array
{
$files = [];
if ( ($this->mode === 'ftp') && ($detailed || ($type !== 'both')) ){
if ( $fs = ftp_mlsd($this->stream, substr($path, strlen($this->prefix))) ){
foreach ( $fs as $f ){
... | [
"private",
"function",
"_get_items",
"(",
"string",
"$",
"path",
",",
"$",
"type",
"=",
"'both'",
",",
"bool",
"$",
"hidden",
"=",
"false",
",",
"string",
"$",
"detailed",
"=",
"''",
")",
":",
"array",
"{",
"$",
"files",
"=",
"[",
"]",
";",
"if",
... | Raw function returning the elements contained in the given directory
@param string $path
@param string|callable $type
@param bool $hidden
@param string $detailed
@return array | [
"Raw",
"function",
"returning",
"the",
"elements",
"contained",
"in",
"the",
"given",
"directory"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/file/system.php#L180-L292 |
Daursu/xero | src/Daursu/Xero/models/Collection.php | Collection.setItems | public function setItems($items = array())
{
$this->items = array();
foreach ($items as $key => $item) {
if ( ! is_numeric($key) && is_array($item)) {
// Check to see if the item contains many subitems
if (array_key_exists('1', $item)) {
$this->setItems($item);
return false;
}
else {... | php | public function setItems($items = array())
{
$this->items = array();
foreach ($items as $key => $item) {
if ( ! is_numeric($key) && is_array($item)) {
// Check to see if the item contains many subitems
if (array_key_exists('1', $item)) {
$this->setItems($item);
return false;
}
else {... | [
"public",
"function",
"setItems",
"(",
"$",
"items",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"if",
"(",
"!",
"is_num... | Set all the items at once
@param array $items | [
"Set",
"all",
"the",
"items",
"at",
"once"
] | train | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/Collection.php#L39-L61 |
Daursu/xero | src/Daursu/Xero/models/Collection.php | Collection.push | public function push($item)
{
$full_class_name = $this->getFullClassName();
if (is_array($item)) {
array_push($this->items, new $full_class_name($item));
}
elseif ($item instanceof $full_class_name) {
array_push($this->items, $item);
}
} | php | public function push($item)
{
$full_class_name = $this->getFullClassName();
if (is_array($item)) {
array_push($this->items, new $full_class_name($item));
}
elseif ($item instanceof $full_class_name) {
array_push($this->items, $item);
}
} | [
"public",
"function",
"push",
"(",
"$",
"item",
")",
"{",
"$",
"full_class_name",
"=",
"$",
"this",
"->",
"getFullClassName",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"item",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"items",
",",
... | Add a new item to the collection
@param mixed $item
@return void | [
"Add",
"a",
"new",
"item",
"to",
"the",
"collection"
] | train | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/Collection.php#L69-L79 |
Daursu/xero | src/Daursu/Xero/models/Collection.php | Collection.toArray | public function toArray()
{
$output = array();
foreach ($this->items as $key => $value) {
array_push($output, $value->toArray(true));
}
return array(
$this->getEntityName() => array(
$this->getSingularEntityName() => $output
),
);
} | php | public function toArray()
{
$output = array();
foreach ($this->items as $key => $value) {
array_push($output, $value->toArray(true));
}
return array(
$this->getEntityName() => array(
$this->getSingularEntityName() => $output
),
);
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"output",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"array_push",
"(",
"$",
"output",
",",
"$",
"value",
"->",
"to... | Convert the model to an array
@return array | [
"Convert",
"the",
"model",
"to",
"an",
"array"
] | train | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/Collection.php#L120-L133 |
Daursu/xero | src/Daursu/Xero/models/Collection.php | Collection.toXML | public function toXML($singular = false)
{
$output = new SimpleXMLElement(
sprintf("<%s></%s>", $this->getEntityName(), $this->getEntityName())
);
BaseModel::array_to_xml($this->toArray(), $output);
return $output->asXML();
} | php | public function toXML($singular = false)
{
$output = new SimpleXMLElement(
sprintf("<%s></%s>", $this->getEntityName(), $this->getEntityName())
);
BaseModel::array_to_xml($this->toArray(), $output);
return $output->asXML();
} | [
"public",
"function",
"toXML",
"(",
"$",
"singular",
"=",
"false",
")",
"{",
"$",
"output",
"=",
"new",
"SimpleXMLElement",
"(",
"sprintf",
"(",
"\"<%s></%s>\"",
",",
"$",
"this",
"->",
"getEntityName",
"(",
")",
",",
"$",
"this",
"->",
"getEntityName",
... | Converts the model to XML
@return string | [
"Converts",
"the",
"model",
"to",
"XML"
] | train | https://github.com/Daursu/xero/blob/f6ac2b0cd3123f9667fd07927bee6725d34df4a6/src/Daursu/Xero/models/Collection.php#L140-L149 |
surebert/surebert-framework | src/sb/Validate/Numbers.php | Numbers.isInt | public static function isInt($int)
{
return (is_string($int) || is_int($int) || is_float($int)) &&
ctype_digit((string)$int);
} | php | public static function isInt($int)
{
return (is_string($int) || is_int($int) || is_float($int)) &&
ctype_digit((string)$int);
} | [
"public",
"static",
"function",
"isInt",
"(",
"$",
"int",
")",
"{",
"return",
"(",
"is_string",
"(",
"$",
"int",
")",
"||",
"is_int",
"(",
"$",
"int",
")",
"||",
"is_float",
"(",
"$",
"int",
")",
")",
"&&",
"ctype_digit",
"(",
"(",
"string",
")",
... | Checks to see if str, float, or int type and represents whole number
@param mixed $int
@return boolean | [
"Checks",
"to",
"see",
"if",
"str",
"float",
"or",
"int",
"type",
"and",
"represents",
"whole",
"number"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Validate/Numbers.php#L16-L20 |
actimeo/pgproc | src/PgSchema.class.php | PgSchema.traceCall | private function traceCall($method) {
$tracepath = $this->base->trace;
if (!file_exists($tracepath)) {
mkdir($tracepath);
}
$path = $tracepath . DIRECTORY_SEPARATOR . $this->name;
if (!file_exists($path)) {
mkdir ($path);
}
$cmdpath = $path . DIRECTORY_SEPARATOR . $method;
if... | php | private function traceCall($method) {
$tracepath = $this->base->trace;
if (!file_exists($tracepath)) {
mkdir($tracepath);
}
$path = $tracepath . DIRECTORY_SEPARATOR . $this->name;
if (!file_exists($path)) {
mkdir ($path);
}
$cmdpath = $path . DIRECTORY_SEPARATOR . $method;
if... | [
"private",
"function",
"traceCall",
"(",
"$",
"method",
")",
"{",
"$",
"tracepath",
"=",
"$",
"this",
"->",
"base",
"->",
"trace",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"tracepath",
")",
")",
"{",
"mkdir",
"(",
"$",
"tracepath",
")",
";",
"... | /* PRIVATE | [
"/",
"*",
"PRIVATE"
] | train | https://github.com/actimeo/pgproc/blob/e251da8f27a560ccf82196ee946f73e0ed030108/src/PgSchema.class.php#L153-L166 |
actimeo/pgproc | src/PgSchema.class.php | PgSchema.search_pg_proc | private function search_pg_proc ($method, $args) {
$argtypenames = array ();
$argtypeschemas = array ();
$nargs = count ($args);
$query = "SELECT * FROM pgprocedures.search_function ('".$this->name."', '$method', $nargs)";
$rettypename = null;
if ($res = $this->pgproc_query ($query)) {
... | php | private function search_pg_proc ($method, $args) {
$argtypenames = array ();
$argtypeschemas = array ();
$nargs = count ($args);
$query = "SELECT * FROM pgprocedures.search_function ('".$this->name."', '$method', $nargs)";
$rettypename = null;
if ($res = $this->pgproc_query ($query)) {
... | [
"private",
"function",
"search_pg_proc",
"(",
"$",
"method",
",",
"$",
"args",
")",
"{",
"$",
"argtypenames",
"=",
"array",
"(",
")",
";",
"$",
"argtypeschemas",
"=",
"array",
"(",
")",
";",
"$",
"nargs",
"=",
"count",
"(",
"$",
"args",
")",
";",
"... | Search method by name and number of args
Returns: The types of the arguments | [
"Search",
"method",
"by",
"name",
"and",
"number",
"of",
"args",
"Returns",
":",
"The",
"types",
"of",
"the",
"arguments"
] | train | https://github.com/actimeo/pgproc/blob/e251da8f27a560ccf82196ee946f73e0ed030108/src/PgSchema.class.php#L188-L231 |
spiderling-php/spiderling | src/Html.php | Html.resolveLinks | public function resolveLinks(UriInterface $base)
{
$this->resolveLinkAttribute('href', $base);
$this->resolveLinkAttribute('src', $base);
$this->resolveLinkAttribute('action', $base);
return $this;
} | php | public function resolveLinks(UriInterface $base)
{
$this->resolveLinkAttribute('href', $base);
$this->resolveLinkAttribute('src', $base);
$this->resolveLinkAttribute('action', $base);
return $this;
} | [
"public",
"function",
"resolveLinks",
"(",
"UriInterface",
"$",
"base",
")",
"{",
"$",
"this",
"->",
"resolveLinkAttribute",
"(",
"'href'",
",",
"$",
"base",
")",
";",
"$",
"this",
"->",
"resolveLinkAttribute",
"(",
"'src'",
",",
"$",
"base",
")",
";",
"... | Add a prefix to all relative links (src, href and action)
@param UriInterface $base | [
"Add",
"a",
"prefix",
"to",
"all",
"relative",
"links",
"(",
"src",
"href",
"and",
"action",
")"
] | train | https://github.com/spiderling-php/spiderling/blob/030d70fb71c89256e3b256dda7fa4c47751d9c53/src/Html.php#L63-L70 |
weew/http | src/Weew/Http/BasicAuthParser.php | BasicAuthParser.getToken | public function getToken(IHttpHeaders $headers) {
$header = $this->getHeader($headers);
return $this->parseHeader($header);
} | php | public function getToken(IHttpHeaders $headers) {
$header = $this->getHeader($headers);
return $this->parseHeader($header);
} | [
"public",
"function",
"getToken",
"(",
"IHttpHeaders",
"$",
"headers",
")",
"{",
"$",
"header",
"=",
"$",
"this",
"->",
"getHeader",
"(",
"$",
"headers",
")",
";",
"return",
"$",
"this",
"->",
"parseHeader",
"(",
"$",
"header",
")",
";",
"}"
] | @param IHttpHeaders $headers
@return null|string | [
"@param",
"IHttpHeaders",
"$headers"
] | train | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/BasicAuthParser.php#L33-L37 |
weew/http | src/Weew/Http/BasicAuthParser.php | BasicAuthParser.getCredentials | public function getCredentials(IHttpHeaders $headers) {
$token = $this->getToken($headers);
return $this->parseToken($token);
} | php | public function getCredentials(IHttpHeaders $headers) {
$token = $this->getToken($headers);
return $this->parseToken($token);
} | [
"public",
"function",
"getCredentials",
"(",
"IHttpHeaders",
"$",
"headers",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
"$",
"headers",
")",
";",
"return",
"$",
"this",
"->",
"parseToken",
"(",
"$",
"token",
")",
";",
"}"
] | @param IHttpHeaders $headers
@return array | [
"@param",
"IHttpHeaders",
"$headers"
] | train | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/BasicAuthParser.php#L53-L57 |
weew/http | src/Weew/Http/BasicAuthParser.php | BasicAuthParser.parseToken | public function parseToken($token) {
$token = base64_decode($token);
$parts = explode(':', $token, 2);
return [array_get($parts, 0), array_get($parts, 1)];
} | php | public function parseToken($token) {
$token = base64_decode($token);
$parts = explode(':', $token, 2);
return [array_get($parts, 0), array_get($parts, 1)];
} | [
"public",
"function",
"parseToken",
"(",
"$",
"token",
")",
"{",
"$",
"token",
"=",
"base64_decode",
"(",
"$",
"token",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"':'",
",",
"$",
"token",
",",
"2",
")",
";",
"return",
"[",
"array_get",
"(",
"$",... | @param $token
@return array | [
"@param",
"$token"
] | train | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/BasicAuthParser.php#L127-L132 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.setQueryParameter | public function setQueryParameter($name, $value)
{
$this->query[(string) $name] = (string) $value;
return $this;
} | php | public function setQueryParameter($name, $value)
{
$this->query[(string) $name] = (string) $value;
return $this;
} | [
"public",
"function",
"setQueryParameter",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"query",
"[",
"(",
"string",
")",
"$",
"name",
"]",
"=",
"(",
"string",
")",
"$",
"value",
";",
"return",
"$",
"this",
";",
"}"
] | Set a query parameter.
@param string $name The name of the query parameter.
@param string $value The value of the query parameter.
@return UrlBuilder | [
"Set",
"a",
"query",
"parameter",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L325-L330 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.insertQueryParameter | public function insertQueryParameter($name, $value, $position)
{
$this->query = array_merge(
array_slice($this->query, 0, $position),
array((string) $name => (string) $value),
array_slice($this->query, $position)
);
return $this;
} | php | public function insertQueryParameter($name, $value, $position)
{
$this->query = array_merge(
array_slice($this->query, 0, $position),
array((string) $name => (string) $value),
array_slice($this->query, $position)
);
return $this;
} | [
"public",
"function",
"insertQueryParameter",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"position",
")",
"{",
"$",
"this",
"->",
"query",
"=",
"array_merge",
"(",
"array_slice",
"(",
"$",
"this",
"->",
"query",
",",
"0",
",",
"$",
"position",
")",... | Insert a query parameter at the given position.
@param string $name The name of the query parameter.
@param string $value The value of the query parameter.
@param int $position The desired position where the query parameter shall get inserted at.
@return UrlBuilder | [
"Insert",
"a",
"query",
"parameter",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L343-L352 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.insertQueryParameterBefore | public function insertQueryParameterBefore($name, $value, $before)
{
$index = array_search($before, array_keys($this->query));
if ($index !== false) {
$this->insertQueryParameter((string) $name, (string) $value, $index);
} else {
$this->setQueryParameter((string) $na... | php | public function insertQueryParameterBefore($name, $value, $before)
{
$index = array_search($before, array_keys($this->query));
if ($index !== false) {
$this->insertQueryParameter((string) $name, (string) $value, $index);
} else {
$this->setQueryParameter((string) $na... | [
"public",
"function",
"insertQueryParameterBefore",
"(",
"$",
"name",
",",
"$",
"value",
",",
"$",
"before",
")",
"{",
"$",
"index",
"=",
"array_search",
"(",
"$",
"before",
",",
"array_keys",
"(",
"$",
"this",
"->",
"query",
")",
")",
";",
"if",
"(",
... | Insert a query parameter at the given position.
@param string $name The name of the query parameter.
@param string $value The value of the query parameter.
@param string $before The name of the desired parameter where the query parameter shall get inserted before.
@return UrlBuilder | [
"Insert",
"a",
"query",
"parameter",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L365-L376 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.getQueryParameter | public function getQueryParameter($name)
{
return isset($this->query[$name]) ? $this->query[$name] : null;
} | php | public function getQueryParameter($name)
{
return isset($this->query[$name]) ? $this->query[$name] : null;
} | [
"public",
"function",
"getQueryParameter",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"query",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"query",
"[",
"$",
"name",
"]",
":",
"null",
";",
"}"
] | Retrieve the value of a query parameter.
@param string $name The name of the query parameter.
@return string|null | [
"Retrieve",
"the",
"value",
"of",
"a",
"query",
"parameter",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L411-L414 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.addQueryParameters | public function addQueryParameters($queryString)
{
$queries = preg_split('/&(amp;)?/i', $queryString);
foreach ($queries as $v) {
$explode = explode('=', $v);
$name = $explode[0];
$value = isset($explode[1]) ? $explode[1] : '';
$rpos = strrpos($nam... | php | public function addQueryParameters($queryString)
{
$queries = preg_split('/&(amp;)?/i', $queryString);
foreach ($queries as $v) {
$explode = explode('=', $v);
$name = $explode[0];
$value = isset($explode[1]) ? $explode[1] : '';
$rpos = strrpos($nam... | [
"public",
"function",
"addQueryParameters",
"(",
"$",
"queryString",
")",
"{",
"$",
"queries",
"=",
"preg_split",
"(",
"'/&(amp;)?/i'",
",",
"$",
"queryString",
")",
";",
"foreach",
"(",
"$",
"queries",
"as",
"$",
"v",
")",
"{",
"$",
"explode",
"=",
"exp... | Absorb the query parameters from a query string.
@param string $queryString The query string.
@return UrlBuilder | [
"Absorb",
"the",
"query",
"parameters",
"from",
"a",
"query",
"string",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L423-L446 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.getQueryString | public function getQueryString()
{
$query = '';
foreach ($this->query as $name => $value) {
if ($query) {
$query .= '&';
}
$query .= $name;
if ($value) {
$query .= '=' . $value;
}
}
if ('' ... | php | public function getQueryString()
{
$query = '';
foreach ($this->query as $name => $value) {
if ($query) {
$query .= '&';
}
$query .= $name;
if ($value) {
$query .= '=' . $value;
}
}
if ('' ... | [
"public",
"function",
"getQueryString",
"(",
")",
"{",
"$",
"query",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"query",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"query",
")",
"{",
"$",
"query",
".=",
"'&'",
";",
... | Retrieve the serialized query string.
@return string|null | [
"Retrieve",
"the",
"serialized",
"query",
"string",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L467-L487 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.getBaseUrl | public function getBaseUrl()
{
$url = '';
if (isset($this->scheme)) {
if ('' !== $this->scheme) {
$url .= $this->scheme . ':';
}
$url .= '//';
}
if (isset($this->user)) {
$url .= $this->user;
if (isset($thi... | php | public function getBaseUrl()
{
$url = '';
if (isset($this->scheme)) {
if ('' !== $this->scheme) {
$url .= $this->scheme . ':';
}
$url .= '//';
}
if (isset($this->user)) {
$url .= $this->user;
if (isset($thi... | [
"public",
"function",
"getBaseUrl",
"(",
")",
"{",
"$",
"url",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"scheme",
")",
")",
"{",
"if",
"(",
"''",
"!==",
"$",
"this",
"->",
"scheme",
")",
"{",
"$",
"url",
".=",
"$",
"this",
... | Retrieve the base url.
The base URL is the url without query part and fragment.
@return string|null | [
"Retrieve",
"the",
"base",
"url",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L496-L531 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.getUrl | public function getUrl()
{
$url = $this->getBaseUrl();
if ($query = $this->getQueryString()) {
if ($url) {
if (!$this->path) {
$url .= '/';
}
$url .= '?';
}
$url .= $query;
}
if... | php | public function getUrl()
{
$url = $this->getBaseUrl();
if ($query = $this->getQueryString()) {
if ($url) {
if (!$this->path) {
$url .= '/';
}
$url .= '?';
}
$url .= $query;
}
if... | [
"public",
"function",
"getUrl",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"getBaseUrl",
"(",
")",
";",
"if",
"(",
"$",
"query",
"=",
"$",
"this",
"->",
"getQueryString",
"(",
")",
")",
"{",
"if",
"(",
"$",
"url",
")",
"{",
"if",
"(",
... | Retrieve the complete generated URL.
@return string | [
"Retrieve",
"the",
"complete",
"generated",
"URL",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L538-L558 |
contao-community-alliance/url-builder | src/UrlBuilder.php | UrlBuilder.parseUrl | private function parseUrl($url)
{
$parsed = parse_url($url);
if ((count($parsed) === 1)
&& isset($parsed['path'])
&& (0 === strpos($parsed['path'], '?') || false !== strpos($parsed['path'], '&'))
) {
$parsed = array(
'query' => $parsed['pa... | php | private function parseUrl($url)
{
$parsed = parse_url($url);
if ((count($parsed) === 1)
&& isset($parsed['path'])
&& (0 === strpos($parsed['path'], '?') || false !== strpos($parsed['path'], '&'))
) {
$parsed = array(
'query' => $parsed['pa... | [
"private",
"function",
"parseUrl",
"(",
"$",
"url",
")",
"{",
"$",
"parsed",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"(",
"count",
"(",
"$",
"parsed",
")",
"===",
"1",
")",
"&&",
"isset",
"(",
"$",
"parsed",
"[",
"'path'",
"]",
... | Parse the URL and fix up if it only contains only one element to make it the query element.
@param string $url The url to parse.
@return array | [
"Parse",
"the",
"URL",
"and",
"fix",
"up",
"if",
"it",
"only",
"contains",
"only",
"one",
"element",
"to",
"make",
"it",
"the",
"query",
"element",
"."
] | train | https://github.com/contao-community-alliance/url-builder/blob/2d730649058f3d3af41175358ee92f0659de08a1/src/UrlBuilder.php#L567-L583 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.GoogleMapAPI | function GoogleMapAPI($map_id = 'map', $app_id = 'MyMapApp') {
$this->map_id = $map_id;
$this->sidebar_id = 'sidebar_' . $map_id;
$this->app_id = $app_id;
} | php | function GoogleMapAPI($map_id = 'map', $app_id = 'MyMapApp') {
$this->map_id = $map_id;
$this->sidebar_id = 'sidebar_' . $map_id;
$this->app_id = $app_id;
} | [
"function",
"GoogleMapAPI",
"(",
"$",
"map_id",
"=",
"'map'",
",",
"$",
"app_id",
"=",
"'MyMapApp'",
")",
"{",
"$",
"this",
"->",
"map_id",
"=",
"$",
"map_id",
";",
"$",
"this",
"->",
"sidebar_id",
"=",
"'sidebar_'",
".",
"$",
"map_id",
";",
"$",
"th... | class constructor
@param string $map_id the DOM element ID for the map
@param string $app_id YOUR Yahoo App ID | [
"class",
"constructor"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L644-L648 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.setWidth | function setWidth($width) {
if(!preg_match('!^(\d+)(.*)$!',$width,$_match))
return false;
$_width = $_match[1];
$_type = $_match[2];
if($_type == '%')
$this->width = $_width . '%';
else
$this->width = $_width . 'px';
return tr... | php | function setWidth($width) {
if(!preg_match('!^(\d+)(.*)$!',$width,$_match))
return false;
$_width = $_match[1];
$_type = $_match[2];
if($_type == '%')
$this->width = $_width . '%';
else
$this->width = $_width . 'px';
return tr... | [
"function",
"setWidth",
"(",
"$",
"width",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'!^(\\d+)(.*)$!'",
",",
"$",
"width",
",",
"$",
"_match",
")",
")",
"return",
"false",
";",
"$",
"_width",
"=",
"$",
"_match",
"[",
"1",
"]",
";",
"$",
"_type"... | sets the width of the map
@param string $width
@return string|false Width or false if not a valid value | [
"sets",
"the",
"width",
"of",
"the",
"map"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L679-L691 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.setHeight | function setHeight($height) {
if(!preg_match('!^(\d+)(.*)$!',$height,$_match))
return false;
$_height = $_match[1];
$_type = $_match[2];
if($_type == '%')
$this->height = $_height . '%';
else
$this->height = $_height . 'px';
r... | php | function setHeight($height) {
if(!preg_match('!^(\d+)(.*)$!',$height,$_match))
return false;
$_height = $_match[1];
$_type = $_match[2];
if($_type == '%')
$this->height = $_height . '%';
else
$this->height = $_height . 'px';
r... | [
"function",
"setHeight",
"(",
"$",
"height",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'!^(\\d+)(.*)$!'",
",",
"$",
"height",
",",
"$",
"_match",
")",
")",
"return",
"false",
";",
"$",
"_height",
"=",
"$",
"_match",
"[",
"1",
"]",
";",
"$",
"_t... | sets the height of the map
@param string $height
@return string|false Height or false if not a valid value | [
"sets",
"the",
"height",
"of",
"the",
"map"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L699-L711 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addDirections | function addDirections($start_address='',$dest_address='',$dom_id='', $add_markers=true, $elevation_samples=256, $elevation_width="", $elevation_height="", $elevation_dom_id=''){
if($elevation_dom_id=="")
$elevation_dom_id = "elevation".$dom_id;
if($start_address != '' && $dest_address != '' && $dom_id ... | php | function addDirections($start_address='',$dest_address='',$dom_id='', $add_markers=true, $elevation_samples=256, $elevation_width="", $elevation_height="", $elevation_dom_id=''){
if($elevation_dom_id=="")
$elevation_dom_id = "elevation".$dom_id;
if($start_address != '' && $dest_address != '' && $dom_id ... | [
"function",
"addDirections",
"(",
"$",
"start_address",
"=",
"''",
",",
"$",
"dest_address",
"=",
"''",
",",
"$",
"dom_id",
"=",
"''",
",",
"$",
"add_markers",
"=",
"true",
",",
"$",
"elevation_samples",
"=",
"256",
",",
"$",
"elevation_width",
"=",
"\"\... | Add directions route to the map and adds text directions container with id=$dom_id
@param string $start_address
@param string $dest_address
@param string $dom_id DOM Element ID for directions container.
@param bool $add_markers Add a marker at start and dest locations. | [
"Add",
"directions",
"route",
"to",
"the",
"map",
"and",
"adds",
"text",
"directions",
"container",
"with",
"id",
"=",
"$dom_id"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L894-L914 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.setMapType | function setMapType($type) {
switch($type) {
case 'hybrid':
$this->map_type = 'HYBRID';
break;
case 'satellite':
$this->map_type = 'SATELLITE';
break;
case 'terrain':
$this->map_type = 'TERRAIN';
... | php | function setMapType($type) {
switch($type) {
case 'hybrid':
$this->map_type = 'HYBRID';
break;
case 'satellite':
$this->map_type = 'SATELLITE';
break;
case 'terrain':
$this->map_type = 'TERRAIN';
... | [
"function",
"setMapType",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'hybrid'",
":",
"$",
"this",
"->",
"map_type",
"=",
"'HYBRID'",
";",
"break",
";",
"case",
"'satellite'",
":",
"$",
"this",
"->",
"map_type",
"=",
"'... | set default map type (map/satellite/hybrid)
@param string $type New V3 Map Types, only include ending word (HYBRID,SATELLITE,TERRAIN,ROADMAP) | [
"set",
"default",
"map",
"type",
"(",
"map",
"/",
"satellite",
"/",
"hybrid",
")"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L972-L988 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.setClusterOptions | function setClusterOptions($zoom="null", $gridsize="null", $styles="null"){
$this->marker_clusterer_options["maxZoom"]=$zoom;
$this->marker_clusterer_options["gridSize"]=$gridsize;
$this->marker_clusterer_options["styles"]=$styles;
} | php | function setClusterOptions($zoom="null", $gridsize="null", $styles="null"){
$this->marker_clusterer_options["maxZoom"]=$zoom;
$this->marker_clusterer_options["gridSize"]=$gridsize;
$this->marker_clusterer_options["styles"]=$styles;
} | [
"function",
"setClusterOptions",
"(",
"$",
"zoom",
"=",
"\"null\"",
",",
"$",
"gridsize",
"=",
"\"null\"",
",",
"$",
"styles",
"=",
"\"null\"",
")",
"{",
"$",
"this",
"->",
"marker_clusterer_options",
"[",
"\"maxZoom\"",
"]",
"=",
"$",
"zoom",
";",
"$",
... | set clustering options | [
"set",
"clustering",
"options"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1180-L1184 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addMarkerByAddress | function addMarkerByAddress($address,$title = '',$html = '',$tooltip = '', $icon_filename = '', $icon_shadow_filename='') {
if(($_geocode = $this->getGeocode($address)) === false)
return false;
return $this->addMarkerByCoords($_geocode['lon'],$_geocode['lat'],$title,$html,$tooltip, $icon_fil... | php | function addMarkerByAddress($address,$title = '',$html = '',$tooltip = '', $icon_filename = '', $icon_shadow_filename='') {
if(($_geocode = $this->getGeocode($address)) === false)
return false;
return $this->addMarkerByCoords($_geocode['lon'],$_geocode['lat'],$title,$html,$tooltip, $icon_fil... | [
"function",
"addMarkerByAddress",
"(",
"$",
"address",
",",
"$",
"title",
"=",
"''",
",",
"$",
"html",
"=",
"''",
",",
"$",
"tooltip",
"=",
"''",
",",
"$",
"icon_filename",
"=",
"''",
",",
"$",
"icon_shadow_filename",
"=",
"''",
")",
"{",
"if",
"(",
... | adds a map marker by address - DEPRECATION WARNING: Tabs are no longer supported in V3, if this changes this can be easily updated.
@param string $address the map address to mark (street/city/state/zip)
@param string $title the title display in the sidebar
@param string $html the HTML block to display in the info bubb... | [
"adds",
"a",
"map",
"marker",
"by",
"address",
"-",
"DEPRECATION",
"WARNING",
":",
"Tabs",
"are",
"no",
"longer",
"supported",
"in",
"V3",
"if",
"this",
"changes",
"this",
"can",
"be",
"easily",
"updated",
"."
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1297-L1301 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addMarkerByCoords | function addMarkerByCoords($lon,$lat,$title = '',$html = '',$tooltip = '', $icon_filename = '', $icon_shadow_filename='') {
$_marker['lon'] = $lon;
$_marker['lat'] = $lat;
$_marker['html'] = (is_array($html) || strlen($html) > 0) ? $html : $title;
$_marker['title'] = $title;
$_ma... | php | function addMarkerByCoords($lon,$lat,$title = '',$html = '',$tooltip = '', $icon_filename = '', $icon_shadow_filename='') {
$_marker['lon'] = $lon;
$_marker['lat'] = $lat;
$_marker['html'] = (is_array($html) || strlen($html) > 0) ? $html : $title;
$_marker['title'] = $title;
$_ma... | [
"function",
"addMarkerByCoords",
"(",
"$",
"lon",
",",
"$",
"lat",
",",
"$",
"title",
"=",
"''",
",",
"$",
"html",
"=",
"''",
",",
"$",
"tooltip",
"=",
"''",
",",
"$",
"icon_filename",
"=",
"''",
",",
"$",
"icon_shadow_filename",
"=",
"''",
")",
"{... | adds a map marker by lat/lng coordinates - DEPRECATION WARNING: Tabs are no longer supported in V3, if this changes this can be easily updated.
@param string $lon the map longitude (horizontal)
@param string $lat the map latitude (vertical)
@param string $title the title display in the sidebar
@param string $html the ... | [
"adds",
"a",
"map",
"marker",
"by",
"lat",
"/",
"lng",
"coordinates",
"-",
"DEPRECATION",
"WARNING",
":",
"Tabs",
"are",
"no",
"longer",
"supported",
"in",
"V3",
"if",
"this",
"changes",
"this",
"can",
"be",
"easily",
"updated",
"."
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1315-L1337 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addMarkerOpener | function addMarkerOpener($marker_id, $dom_id){
if($this->info_window === false || !isset($this->_markers[$marker_id]))
return false;
if(!isset($this->_markers[$marker_id]["openers"]))
$this->_markers[$marker_id]["openers"] = array();
$this->_markers[$marker_id]["openers"][] = $dom_id; ... | php | function addMarkerOpener($marker_id, $dom_id){
if($this->info_window === false || !isset($this->_markers[$marker_id]))
return false;
if(!isset($this->_markers[$marker_id]["openers"]))
$this->_markers[$marker_id]["openers"] = array();
$this->_markers[$marker_id]["openers"][] = $dom_id; ... | [
"function",
"addMarkerOpener",
"(",
"$",
"marker_id",
",",
"$",
"dom_id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"info_window",
"===",
"false",
"||",
"!",
"isset",
"(",
"$",
"this",
"->",
"_markers",
"[",
"$",
"marker_id",
"]",
")",
")",
"return",
"... | adds a DOM object ID to specified marker to open the marker's info window.
Does nothing if the info windows is disabled.
@param string $marker_id ID of the marker to associate to
@param string $dom_id ID of the DOM object to use to open marker info window
@return bool true/false status | [
"adds",
"a",
"DOM",
"object",
"ID",
"to",
"specified",
"marker",
"to",
"open",
"the",
"marker",
"s",
"info",
"window",
".",
"Does",
"nothing",
"if",
"the",
"info",
"windows",
"is",
"disabled",
"."
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1346-L1352 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addPolylineByCoordsArray | function addPolylineByCoordsArray($polyline_array,$id=false,$color='',$weight=0,$opacity=0){
if(!is_array($polyline_array) || sizeof($polyline_array) < 2)
return false;
$_prev_coords = "";
$_next_coords = "";
foreach($polyline_array as $_coords){
$_prev_coords = $_next_coords;
... | php | function addPolylineByCoordsArray($polyline_array,$id=false,$color='',$weight=0,$opacity=0){
if(!is_array($polyline_array) || sizeof($polyline_array) < 2)
return false;
$_prev_coords = "";
$_next_coords = "";
foreach($polyline_array as $_coords){
$_prev_coords = $_next_coords;
... | [
"function",
"addPolylineByCoordsArray",
"(",
"$",
"polyline_array",
",",
"$",
"id",
"=",
"false",
",",
"$",
"color",
"=",
"''",
",",
"$",
"weight",
"=",
"0",
",",
"$",
"opacity",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"polyline_arr... | adds polyline by passed array
if color, weight and opacity are not defined, use the google maps defaults
@param array $polyline_array array of lat/long coords
@param string $id An array id to use to append coordinates to a line
@param string $color the color of the line (format: #000000)
@param string $weight the weigh... | [
"adds",
"polyline",
"by",
"passed",
"array",
"if",
"color",
"weight",
"and",
"opacity",
"are",
"not",
"defined",
"use",
"the",
"google",
"maps",
"defaults"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1364-L1383 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addPolylineByAddressArray | function addPolylineByAddressArray($polyline_array,$id=false,$color='',$weight=0,$opacity=0){
if(!is_array($polyline_array) || sizeof($polyline_array) < 2)
return false;
$_prev_address = "";
$_next_address = "";
foreach($polyline_array as $_address){
$_pre... | php | function addPolylineByAddressArray($polyline_array,$id=false,$color='',$weight=0,$opacity=0){
if(!is_array($polyline_array) || sizeof($polyline_array) < 2)
return false;
$_prev_address = "";
$_next_address = "";
foreach($polyline_array as $_address){
$_pre... | [
"function",
"addPolylineByAddressArray",
"(",
"$",
"polyline_array",
",",
"$",
"id",
"=",
"false",
",",
"$",
"color",
"=",
"''",
",",
"$",
"weight",
"=",
"0",
",",
"$",
"opacity",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"polyline_ar... | adds polyline by passed array
if color, weight and opacity are not defined, use the google maps defaults
@param array $polyline_array array of addresses
@param string $id An array id to use to append coordinates to a line
@param string $color the color of the line (format: #000000)
@param string $weight the weight of t... | [
"adds",
"polyline",
"by",
"passed",
"array",
"if",
"color",
"weight",
"and",
"opacity",
"are",
"not",
"defined",
"use",
"the",
"google",
"maps",
"defaults"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1395-L1410 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addPolyLineByAddress | function addPolyLineByAddress($address1,$address2,$id=false,$color='',$weight=0,$opacity=0) {
if(($_geocode1 = $this->getGeocode($address1)) === false)
return false;
if(($_geocode2 = $this->getGeocode($address2)) === false)
return false;
return $this->addPolyLineByCoords(... | php | function addPolyLineByAddress($address1,$address2,$id=false,$color='',$weight=0,$opacity=0) {
if(($_geocode1 = $this->getGeocode($address1)) === false)
return false;
if(($_geocode2 = $this->getGeocode($address2)) === false)
return false;
return $this->addPolyLineByCoords(... | [
"function",
"addPolyLineByAddress",
"(",
"$",
"address1",
",",
"$",
"address2",
",",
"$",
"id",
"=",
"false",
",",
"$",
"color",
"=",
"''",
",",
"$",
"weight",
"=",
"0",
",",
"$",
"opacity",
"=",
"0",
")",
"{",
"if",
"(",
"(",
"$",
"_geocode1",
"... | adds a map polyline by address
if color, weight and opacity are not defined, use the google maps defaults
@param string $address1 the map address to draw from
@param string $address2 the map address to draw to
@param string $id An array id to use to append coordinates to a line
@param string $color the color of the li... | [
"adds",
"a",
"map",
"polyline",
"by",
"address",
"if",
"color",
"weight",
"and",
"opacity",
"are",
"not",
"defined",
"use",
"the",
"google",
"maps",
"defaults"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1424-L1430 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addPolyLineByCoords | function addPolyLineByCoords($lon1,$lat1,$lon2,$lat2,$id=false,$color='',$weight=0,$opacity=0) {
if($id !== false && isset($this->_polylines[$id]) && is_array($this->_polylines[$id])){
$_polyline = $this->_polylines[$id];
}else{
//only set color,weight,and opacity if new polyline
$_polyline = array(
"c... | php | function addPolyLineByCoords($lon1,$lat1,$lon2,$lat2,$id=false,$color='',$weight=0,$opacity=0) {
if($id !== false && isset($this->_polylines[$id]) && is_array($this->_polylines[$id])){
$_polyline = $this->_polylines[$id];
}else{
//only set color,weight,and opacity if new polyline
$_polyline = array(
"c... | [
"function",
"addPolyLineByCoords",
"(",
"$",
"lon1",
",",
"$",
"lat1",
",",
"$",
"lon2",
",",
"$",
"lat2",
",",
"$",
"id",
"=",
"false",
",",
"$",
"color",
"=",
"''",
",",
"$",
"weight",
"=",
"0",
",",
"$",
"opacity",
"=",
"0",
")",
"{",
"if",
... | adds a map polyline by map coordinates
if color, weight and opacity are not defined, use the google maps defaults
@param string $lon1 the map longitude to draw from
@param string $lat1 the map latitude to draw from
@param string $lon2 the map longitude to draw to
@param string $lat2 the map latitude to draw to
@param ... | [
"adds",
"a",
"map",
"polyline",
"by",
"map",
"coordinates",
"if",
"color",
"weight",
"and",
"opacity",
"are",
"not",
"defined",
"use",
"the",
"google",
"maps",
"defaults"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1446-L1480 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addPolylineElevation | function addPolylineElevation($polyline_id, $elevation_dom_id, $samples=256, $width="", $height="", $focus_color="#00ff00"){
if(isset($this->_polylines[$polyline_id])){
$this->_elevation_polylines[$polyline_id] = array(
"dom_id"=>$elevation_dom_id,
"samples"=>$samples,
"width"=>($width!=""?$width:str_r... | php | function addPolylineElevation($polyline_id, $elevation_dom_id, $samples=256, $width="", $height="", $focus_color="#00ff00"){
if(isset($this->_polylines[$polyline_id])){
$this->_elevation_polylines[$polyline_id] = array(
"dom_id"=>$elevation_dom_id,
"samples"=>$samples,
"width"=>($width!=""?$width:str_r... | [
"function",
"addPolylineElevation",
"(",
"$",
"polyline_id",
",",
"$",
"elevation_dom_id",
",",
"$",
"samples",
"=",
"256",
",",
"$",
"width",
"=",
"\"\"",
",",
"$",
"height",
"=",
"\"\"",
",",
"$",
"focus_color",
"=",
"\"#00ff00\"",
")",
"{",
"if",
"(",... | function to add an elevation profile for a polyline to the page | [
"function",
"to",
"add",
"an",
"elevation",
"profile",
"for",
"a",
"polyline",
"to",
"the",
"page"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1485-L1495 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addOverlay | function addOverlay($bds_lat1, $bds_lon1, $bds_lat2, $bds_lon2, $img_src, $opacity = 100){
$_overlay = array(
"bounds" => array(
"ne"=>array(
"lat"=>$bds_lat1,
"long"=>$bds_lon1
),
"sw"=>array(
"lat"=>$bds_lat2,
"long"=>$bds_lon2
)
),
"img" => $img_src,
"opacity" => $o... | php | function addOverlay($bds_lat1, $bds_lon1, $bds_lat2, $bds_lon2, $img_src, $opacity = 100){
$_overlay = array(
"bounds" => array(
"ne"=>array(
"lat"=>$bds_lat1,
"long"=>$bds_lon1
),
"sw"=>array(
"lat"=>$bds_lat2,
"long"=>$bds_lon2
)
),
"img" => $img_src,
"opacity" => $o... | [
"function",
"addOverlay",
"(",
"$",
"bds_lat1",
",",
"$",
"bds_lon1",
",",
"$",
"bds_lat2",
",",
"$",
"bds_lon2",
",",
"$",
"img_src",
",",
"$",
"opacity",
"=",
"100",
")",
"{",
"$",
"_overlay",
"=",
"array",
"(",
"\"bounds\"",
"=>",
"array",
"(",
"\... | function to add an overlay to the map. | [
"function",
"to",
"add",
"an",
"overlay",
"to",
"the",
"map",
"."
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1500-L1519 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.adjustCenterCoords | function adjustCenterCoords($lon,$lat) {
if(strlen((string)$lon) == 0 || strlen((string)$lat) == 0)
return false;
$this->_max_lon = (float) max($lon, $this->_max_lon);
$this->_min_lon = (float) min($lon, $this->_min_lon);
$this->_max_lat = (float) max($lat, $this->_max_lat);
... | php | function adjustCenterCoords($lon,$lat) {
if(strlen((string)$lon) == 0 || strlen((string)$lat) == 0)
return false;
$this->_max_lon = (float) max($lon, $this->_max_lon);
$this->_min_lon = (float) min($lon, $this->_min_lon);
$this->_max_lat = (float) max($lat, $this->_max_lat);
... | [
"function",
"adjustCenterCoords",
"(",
"$",
"lon",
",",
"$",
"lat",
")",
"{",
"if",
"(",
"strlen",
"(",
"(",
"string",
")",
"$",
"lon",
")",
"==",
"0",
"||",
"strlen",
"(",
"(",
"string",
")",
"$",
"lat",
")",
"==",
"0",
")",
"return",
"false",
... | adjust map center coordinates by the given lat/lon point
@param string $lon the map latitude (horizontal)
@param string $lat the map latitude (vertical) | [
"adjust",
"map",
"center",
"coordinates",
"by",
"the",
"given",
"lat",
"/",
"lon",
"point"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1537-L1547 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.setCenterCoords | function setCenterCoords($lon,$lat) {
$this->center_lat = (float) $lat;
$this->center_lon = (float) $lon;
} | php | function setCenterCoords($lon,$lat) {
$this->center_lat = (float) $lat;
$this->center_lon = (float) $lon;
} | [
"function",
"setCenterCoords",
"(",
"$",
"lon",
",",
"$",
"lat",
")",
"{",
"$",
"this",
"->",
"center_lat",
"=",
"(",
"float",
")",
"$",
"lat",
";",
"$",
"this",
"->",
"center_lon",
"=",
"(",
"float",
")",
"$",
"lon",
";",
"}"
] | set map center coordinates to lat/lon point
@param string $lon the map latitude (horizontal)
@param string $lat the map latitude (vertical) | [
"set",
"map",
"center",
"coordinates",
"to",
"lat",
"/",
"lon",
"point"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1555-L1558 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.createMarkerIcon | function createMarkerIcon($iconImage,$iconShadowImage = '',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x') {
$_icon_image_path = strpos($iconImage,'http') === 0 ? $iconImage : $_SERVER['DOCUMENT_ROOT'] . $iconImage;
if(!($_image_info = @getimagesize($_icon_image_... | php | function createMarkerIcon($iconImage,$iconShadowImage = '',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x') {
$_icon_image_path = strpos($iconImage,'http') === 0 ? $iconImage : $_SERVER['DOCUMENT_ROOT'] . $iconImage;
if(!($_image_info = @getimagesize($_icon_image_... | [
"function",
"createMarkerIcon",
"(",
"$",
"iconImage",
",",
"$",
"iconShadowImage",
"=",
"''",
",",
"$",
"iconAnchorX",
"=",
"'x'",
",",
"$",
"iconAnchorY",
"=",
"'x'",
",",
"$",
"infoWindowAnchorX",
"=",
"'x'",
",",
"$",
"infoWindowAnchorY",
"=",
"'x'",
"... | generate an array of params for a new marker icon image
iconShadowImage is optional
If anchor coords are not supplied, we use the center point of the image by default.
Can be called statically. For private use by addMarkerIcon() and setMarkerIcon() and addIcon()
@param string $iconImage URL to icon image
@param string... | [
"generate",
"an",
"array",
"of",
"params",
"for",
"a",
"new",
"marker",
"icon",
"image",
"iconShadowImage",
"is",
"optional",
"If",
"anchor",
"coords",
"are",
"not",
"supplied",
"we",
"use",
"the",
"center",
"point",
"of",
"the",
"image",
"by",
"default",
... | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1574-L1614 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.setMarkerIcon | function setMarkerIcon($iconImage,$iconShadowImage = '',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x') {
$this->default_icon = $iconImage;
$this->default_icon_shadow = $iconShadowImage;
return $this->setMarkerIconKey($iconImage,$iconShadowImage,$iconAnch... | php | function setMarkerIcon($iconImage,$iconShadowImage = '',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x') {
$this->default_icon = $iconImage;
$this->default_icon_shadow = $iconShadowImage;
return $this->setMarkerIconKey($iconImage,$iconShadowImage,$iconAnch... | [
"function",
"setMarkerIcon",
"(",
"$",
"iconImage",
",",
"$",
"iconShadowImage",
"=",
"''",
",",
"$",
"iconAnchorX",
"=",
"'x'",
",",
"$",
"iconAnchorY",
"=",
"'x'",
",",
"$",
"infoWindowAnchorX",
"=",
"'x'",
",",
"$",
"infoWindowAnchorY",
"=",
"'x'",
")",... | set the default marker icon for ALL markers on the map
NOTE: This MUST be set prior to adding markers in order for the defaults
to be set correctly.
@param string $iconImage URL to icon image
@param string $iconShadowImage URL to shadow image
@param string $iconAnchorX X coordinate for icon anchor point
@param string $... | [
"set",
"the",
"default",
"marker",
"icon",
"for",
"ALL",
"markers",
"on",
"the",
"map",
"NOTE",
":",
"This",
"MUST",
"be",
"set",
"prior",
"to",
"adding",
"markers",
"in",
"order",
"for",
"the",
"defaults",
"to",
"be",
"set",
"correctly",
"."
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1628-L1632 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.setMarkerIconKey | function setMarkerIconKey($iconImage,$iconShadow='',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x'){
$_iconKey = $this->getIconKey($iconImage,$iconShadow);
if(isset($this->_marker_icons[$_iconKey])){
return $_iconKey;
}else{
return $this->addIcon($icon... | php | function setMarkerIconKey($iconImage,$iconShadow='',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x'){
$_iconKey = $this->getIconKey($iconImage,$iconShadow);
if(isset($this->_marker_icons[$_iconKey])){
return $_iconKey;
}else{
return $this->addIcon($icon... | [
"function",
"setMarkerIconKey",
"(",
"$",
"iconImage",
",",
"$",
"iconShadow",
"=",
"''",
",",
"$",
"iconAnchorX",
"=",
"'x'",
",",
"$",
"iconAnchorY",
"=",
"'x'",
",",
"$",
"infoWindowAnchorX",
"=",
"'x'",
",",
"$",
"infoWindowAnchorY",
"=",
"'x'",
")",
... | function to check if icon is in class "marker_iconset", if it is,
returns the key, if not, creates a new array indice and returns the key
@param string $iconImage URL to icon image
@param string $iconShadowImage URL to shadow image
@param string $iconAnchorX X coordinate for icon anchor point
@param string $iconAnchor... | [
"function",
"to",
"check",
"if",
"icon",
"is",
"in",
"class",
"marker_iconset",
"if",
"it",
"is",
"returns",
"the",
"key",
"if",
"not",
"creates",
"a",
"new",
"array",
"indice",
"and",
"returns",
"the",
"key"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1645-L1652 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addIcon | function addIcon($iconImage,$iconShadowImage = '',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x') {
$_iconKey = $this->getIconKey($iconImage, $iconShadowImage);
$this->_marker_icons[$_iconKey] = $this->createMarkerIcon($iconImage,$iconShadowImage,$iconAnchorX,$iconA... | php | function addIcon($iconImage,$iconShadowImage = '',$iconAnchorX = 'x',$iconAnchorY = 'x',$infoWindowAnchorX = 'x',$infoWindowAnchorY = 'x') {
$_iconKey = $this->getIconKey($iconImage, $iconShadowImage);
$this->_marker_icons[$_iconKey] = $this->createMarkerIcon($iconImage,$iconShadowImage,$iconAnchorX,$iconA... | [
"function",
"addIcon",
"(",
"$",
"iconImage",
",",
"$",
"iconShadowImage",
"=",
"''",
",",
"$",
"iconAnchorX",
"=",
"'x'",
",",
"$",
"iconAnchorY",
"=",
"'x'",
",",
"$",
"infoWindowAnchorX",
"=",
"'x'",
",",
"$",
"infoWindowAnchorY",
"=",
"'x'",
")",
"{"... | add an icon to "iconset"
@param string $iconImage URL to marker icon image
@param string $iconShadow URL to marker icon shadow image
@param string $iconAnchorX X coordinate for icon anchor point
@param string $iconAnchorY Y coordinate for icon anchor point
@param string $infoWindowAnchorX X coordinate for info window a... | [
"add",
"an",
"icon",
"to",
"iconset"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1674-L1678 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.updateMarkerIconKey | function updateMarkerIconKey($markerKey, $iconKey){
if(isset($this->_markers[$markerKey])){
$this->_markers[$markerKey]['icon_key'] = $iconKey;
}
} | php | function updateMarkerIconKey($markerKey, $iconKey){
if(isset($this->_markers[$markerKey])){
$this->_markers[$markerKey]['icon_key'] = $iconKey;
}
} | [
"function",
"updateMarkerIconKey",
"(",
"$",
"markerKey",
",",
"$",
"iconKey",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_markers",
"[",
"$",
"markerKey",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_markers",
"[",
"$",
"markerKey",
"]",
"["... | updates a marker's icon key.
NOTE: To be used in lieu of addMarkerIcon, now use addIcon + updateMarkerIconKey for explicit icon association
@param string $markerKey Marker key to define which marker's icon to update
@param string $iconKey Icon key to define which icon to use. | [
"updates",
"a",
"marker",
"s",
"icon",
"key",
".",
"NOTE",
":",
"To",
"be",
"used",
"in",
"lieu",
"of",
"addMarkerIcon",
"now",
"use",
"addIcon",
"+",
"updateMarkerIconKey",
"for",
"explicit",
"icon",
"association"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1686-L1690 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getHeaderJS | function getHeaderJS() {
$_headerJS = "";
if( $this->mobile == true){
$_headerJS .= "
<meta name='viewport' content='".$this->meta_viewport."' />
";
}
if(!empty($this->_elevation_polylines)||(!empty($this->_directions)&&$this->elevation_directions)){
$_headerJS .= ... | php | function getHeaderJS() {
$_headerJS = "";
if( $this->mobile == true){
$_headerJS .= "
<meta name='viewport' content='".$this->meta_viewport."' />
";
}
if(!empty($this->_elevation_polylines)||(!empty($this->_directions)&&$this->elevation_directions)){
$_headerJS .= ... | [
"function",
"getHeaderJS",
"(",
")",
"{",
"$",
"_headerJS",
"=",
"\"\"",
";",
"if",
"(",
"$",
"this",
"->",
"mobile",
"==",
"true",
")",
"{",
"$",
"_headerJS",
".=",
"\"\n \t <meta name='viewport' content='\"",
".",
"$",
"this",
"->",
"meta_viewport"... | return map header javascript (goes between <head></head>) | [
"return",
"map",
"header",
"javascript",
"(",
"goes",
"between",
"<head",
">",
"<",
"/",
"head",
">",
")"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1704-L1731 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getMapJS | function getMapJS() {
$_script = "";
$_key = $this->map_id;
$_output = '<script type="text/javascript" charset="utf-8">' . "\n";
$_output .= '//<![CDATA[' . "\n";
$_output .= "/*************************************************\n";
$_output .= " * Created with GoogleMapAPI" . $this->_versio... | php | function getMapJS() {
$_script = "";
$_key = $this->map_id;
$_output = '<script type="text/javascript" charset="utf-8">' . "\n";
$_output .= '//<![CDATA[' . "\n";
$_output .= "/*************************************************\n";
$_output .= " * Created with GoogleMapAPI" . $this->_versio... | [
"function",
"getMapJS",
"(",
")",
"{",
"$",
"_script",
"=",
"\"\"",
";",
"$",
"_key",
"=",
"$",
"this",
"->",
"map_id",
";",
"$",
"_output",
"=",
"'<script type=\"text/javascript\" charset=\"utf-8\">'",
".",
"\"\\n\"",
";",
"$",
"_output",
".=",
"'//<![CDATA['... | return map javascript | [
"return",
"map",
"javascript"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L1776-L2130 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getAddMarkersJS | function getAddMarkersJS($map_id = "", $pano= false) {
//defaults
if($map_id == ""){
$map_id = $this->map_id;
}
if($pano==false){
$_prefix = "map";
}else{
$_prefix = "panorama".$this->street_view_dom_id;
}
$_output = '';
foreach($this->_markers as $_marker) {
$iw_html... | php | function getAddMarkersJS($map_id = "", $pano= false) {
//defaults
if($map_id == ""){
$map_id = $this->map_id;
}
if($pano==false){
$_prefix = "map";
}else{
$_prefix = "panorama".$this->street_view_dom_id;
}
$_output = '';
foreach($this->_markers as $_marker) {
$iw_html... | [
"function",
"getAddMarkersJS",
"(",
"$",
"map_id",
"=",
"\"\"",
",",
"$",
"pano",
"=",
"false",
")",
"{",
"//defaults",
"if",
"(",
"$",
"map_id",
"==",
"\"\"",
")",
"{",
"$",
"map_id",
"=",
"$",
"this",
"->",
"map_id",
";",
"}",
"if",
"(",
"$",
"... | overridable function for generating js to add markers | [
"overridable",
"function",
"for",
"generating",
"js",
"to",
"add",
"markers"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2162-L2201 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getPolylineJS | function getPolylineJS() {
$_output = '';
foreach($this->_polylines as $polyline_id =>$_polyline) {
$_coords_output = "";
foreach($_polyline["coords"] as $_coords){
if($_coords_output != ""){$_coords_output.=",";}
$_coords_output .= "
new google.maps.LatLng(... | php | function getPolylineJS() {
$_output = '';
foreach($this->_polylines as $polyline_id =>$_polyline) {
$_coords_output = "";
foreach($_polyline["coords"] as $_coords){
if($_coords_output != ""){$_coords_output.=",";}
$_coords_output .= "
new google.maps.LatLng(... | [
"function",
"getPolylineJS",
"(",
")",
"{",
"$",
"_output",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"_polylines",
"as",
"$",
"polyline_id",
"=>",
"$",
"_polyline",
")",
"{",
"$",
"_coords_output",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"_pol... | overridable function to generate polyline js - for now can only be used on a map, not a streetview | [
"overridable",
"function",
"to",
"generate",
"polyline",
"js",
"-",
"for",
"now",
"can",
"only",
"be",
"used",
"on",
"a",
"map",
"not",
"a",
"streetview"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2206-L2252 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getAddDirectionsJS | function getAddDirectionsJS(){
$_output = "";
foreach($this->_directions as $directions){
$dom_id = $directions["dom_id"];
$travelModeParams = array();
$directionsParams = "";
if($this->walking_directions==TRUE)
$directionsParams .= ", \n travelMode:google.maps.DirectionsTravelMode.... | php | function getAddDirectionsJS(){
$_output = "";
foreach($this->_directions as $directions){
$dom_id = $directions["dom_id"];
$travelModeParams = array();
$directionsParams = "";
if($this->walking_directions==TRUE)
$directionsParams .= ", \n travelMode:google.maps.DirectionsTravelMode.... | [
"function",
"getAddDirectionsJS",
"(",
")",
"{",
"$",
"_output",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"_directions",
"as",
"$",
"directions",
")",
"{",
"$",
"dom_id",
"=",
"$",
"directions",
"[",
"\"dom_id\"",
"]",
";",
"$",
"travelModePa... | function to render proper calls for directions - for now can only be used on a map, not a streetview | [
"function",
"to",
"render",
"proper",
"calls",
"for",
"directions",
"-",
"for",
"now",
"can",
"only",
"be",
"used",
"on",
"a",
"map",
"not",
"a",
"streetview"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2257-L2321 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getAddOverlayJS | function getAddOverlayJS(){
$_output = "";
foreach($this->_overlays as $_key=>$_overlay){
$_output .= "
var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(".$_overlay["bounds"]["ne"]["lat"].", ".$_overlay["bounds"]["ne"]["long"]."), new google.maps.LatLng(".$_overlay["bounds"]["sw"]["lat"]... | php | function getAddOverlayJS(){
$_output = "";
foreach($this->_overlays as $_key=>$_overlay){
$_output .= "
var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(".$_overlay["bounds"]["ne"]["lat"].", ".$_overlay["bounds"]["ne"]["long"]."), new google.maps.LatLng(".$_overlay["bounds"]["sw"]["lat"]... | [
"function",
"getAddOverlayJS",
"(",
")",
"{",
"$",
"_output",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"_overlays",
"as",
"$",
"_key",
"=>",
"$",
"_overlay",
")",
"{",
"$",
"_output",
".=",
"\"\n\t\t\t \t var bounds = new google.maps.LatLngBounds(new... | function to get overlay creation JS. | [
"function",
"to",
"get",
"overlay",
"creation",
"JS",
"."
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2326-L2336 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getCreateMarkerJS | function getCreateMarkerJS() {
$_output = "
function createMarker(map, point, title, html, icon, icon_shadow, sidebar_id, openers){
var marker_options = {
position: point,
map: map,
title: title};
if(icon!=''){marker_options.icon = icon;}
if(icon_shad... | php | function getCreateMarkerJS() {
$_output = "
function createMarker(map, point, title, html, icon, icon_shadow, sidebar_id, openers){
var marker_options = {
position: point,
map: map,
title: title};
if(icon!=''){marker_options.icon = icon;}
if(icon_shad... | [
"function",
"getCreateMarkerJS",
"(",
")",
"{",
"$",
"_output",
"=",
"\"\n \t function createMarker(map, point, title, html, icon, icon_shadow, sidebar_id, openers){\n\t\t\t var marker_options = {\n\t\t\t position: point,\n\t\t\t map: map,\n\t\t\t title: title}; \n\t\t\... | overridable function to generate the js for the js function for creating a marker. | [
"overridable",
"function",
"to",
"generate",
"the",
"js",
"for",
"the",
"js",
"function",
"for",
"creating",
"a",
"marker",
"."
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2341-L2394 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getMap | function getMap() {
$_output = '<script type="text/javascript" charset="utf-8">' . "\n" . '//<![CDATA[' . "\n";
//$_output .= 'if (GBrowserIsCompatible()) {' . "\n";
if(strlen($this->width) > 0 && strlen($this->height) > 0) {
$_output .= sprintf('document.write(\'<div id="%s" style="... | php | function getMap() {
$_output = '<script type="text/javascript" charset="utf-8">' . "\n" . '//<![CDATA[' . "\n";
//$_output .= 'if (GBrowserIsCompatible()) {' . "\n";
if(strlen($this->width) > 0 && strlen($this->height) > 0) {
$_output .= sprintf('document.write(\'<div id="%s" style="... | [
"function",
"getMap",
"(",
")",
"{",
"$",
"_output",
"=",
"'<script type=\"text/javascript\" charset=\"utf-8\">'",
".",
"\"\\n\"",
".",
"'//<![CDATA['",
".",
"\"\\n\"",
";",
"//$_output .= 'if (GBrowserIsCompatible()) {' . \"\\n\";",
"if",
"(",
"strlen",
"(",
"$",
"this",... | return map | [
"return",
"map"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2518-L2541 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getGeocode | function getGeocode($address) {
if(empty($address))
return false;
$_geocode = false;
if(($_geocode = $this->getCache($address)) === false) {
if(($_geocode = $this->geoGetCoords($address)) !== false) {
$this->putCache($address, $_geocode['lon'], $_geocode['lat'... | php | function getGeocode($address) {
if(empty($address))
return false;
$_geocode = false;
if(($_geocode = $this->getCache($address)) === false) {
if(($_geocode = $this->geoGetCoords($address)) !== false) {
$this->putCache($address, $_geocode['lon'], $_geocode['lat'... | [
"function",
"getGeocode",
"(",
"$",
"address",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"address",
")",
")",
"return",
"false",
";",
"$",
"_geocode",
"=",
"false",
";",
"if",
"(",
"(",
"$",
"_geocode",
"=",
"$",
"this",
"->",
"getCache",
"(",
"$",
... | get the geocode lat/lon points from given address
look in cache first, otherwise get from Yahoo
@param string $address
@return array GeoCode information | [
"get",
"the",
"geocode",
"lat",
"/",
"lon",
"points",
"from",
"given",
"address",
"look",
"in",
"cache",
"first",
"otherwise",
"get",
"from",
"Yahoo"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2567-L2577 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getCache | function getCache($address) {
if(!isset($this->dsn))
return false;
$_ret = array();
// PEAR DB
require_once('DB.php');
$_db =& DB::connect($this->dsn);
if (PEAR::isError($_db)) {
die($_db->getMessage());
}
... | php | function getCache($address) {
if(!isset($this->dsn))
return false;
$_ret = array();
// PEAR DB
require_once('DB.php');
$_db =& DB::connect($this->dsn);
if (PEAR::isError($_db)) {
die($_db->getMessage());
}
... | [
"function",
"getCache",
"(",
"$",
"address",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dsn",
")",
")",
"return",
"false",
";",
"$",
"_ret",
"=",
"array",
"(",
")",
";",
"// PEAR DB",
"require_once",
"(",
"'DB.php'",
")",
";",
"$",... | get the geocode lat/lon points from cache for given address
@param string $address
@return bool|array False if no cache, array of data if has cache | [
"get",
"the",
"geocode",
"lat",
"/",
"lon",
"points",
"from",
"cache",
"for",
"given",
"address"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2585-L2609 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.putCache | function putCache($address, $lon, $lat) {
if(!isset($this->dsn) || (strlen($address) == 0 || strlen($lon) == 0 || strlen($lat) == 0))
return false;
// PEAR DB
require_once('DB.php');
$_db =& DB::connect($this->dsn);
if (PEAR::isError($_db)) {
die($_db... | php | function putCache($address, $lon, $lat) {
if(!isset($this->dsn) || (strlen($address) == 0 || strlen($lon) == 0 || strlen($lat) == 0))
return false;
// PEAR DB
require_once('DB.php');
$_db =& DB::connect($this->dsn);
if (PEAR::isError($_db)) {
die($_db... | [
"function",
"putCache",
"(",
"$",
"address",
",",
"$",
"lon",
",",
"$",
"lat",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dsn",
")",
"||",
"(",
"strlen",
"(",
"$",
"address",
")",
"==",
"0",
"||",
"strlen",
"(",
"$",
"lon",
"... | put the geocode lat/lon points into cache for given address
@param string $address
@param string $lon the map latitude (horizontal)
@param string $lat the map latitude (vertical)
@return bool Status of put cache request | [
"put",
"the",
"geocode",
"lat",
"/",
"lon",
"points",
"into",
"cache",
"for",
"given",
"address"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2619-L2634 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.geoGetCoords | function geoGetCoords($address,$depth=0) {
$_coords = false;
switch($this->lookup_service) {
case 'GOOGLE':
$_url = sprintf('http://%s/maps/api/geocode/json?sensor=%s&address=%s',$this->lookup_server['GOOGLE'], $this->mobile==true?"true":"false", rawurlencode($address));
... | php | function geoGetCoords($address,$depth=0) {
$_coords = false;
switch($this->lookup_service) {
case 'GOOGLE':
$_url = sprintf('http://%s/maps/api/geocode/json?sensor=%s&address=%s',$this->lookup_server['GOOGLE'], $this->mobile==true?"true":"false", rawurlencode($address));
... | [
"function",
"geoGetCoords",
"(",
"$",
"address",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"$",
"_coords",
"=",
"false",
";",
"switch",
"(",
"$",
"this",
"->",
"lookup_service",
")",
"{",
"case",
"'GOOGLE'",
":",
"$",
"_url",
"=",
"sprintf",
"(",
"'http... | get geocode lat/lon points for given address from Google/Yahoo
@param string $address
@return bool|array false if can't be geocoded, array or geocodess if successful | [
"get",
"geocode",
"lat",
"/",
"lon",
"points",
"for",
"given",
"address",
"from",
"Google",
"/",
"Yahoo"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2642-L2667 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.geoGetCoordsFull | function geoGetCoordsFull($address,$depth=0) {
$_result = false;
switch($this->lookup_service) {
case 'GOOGLE':
$_url = sprintf('http://%s/maps/api/geocode/json?sensor=%s&address=%s',$this->lookup_server['GOOGLE'], $this->mobile==true?"true":"false", rawurlencode($address));
... | php | function geoGetCoordsFull($address,$depth=0) {
$_result = false;
switch($this->lookup_service) {
case 'GOOGLE':
$_url = sprintf('http://%s/maps/api/geocode/json?sensor=%s&address=%s',$this->lookup_server['GOOGLE'], $this->mobile==true?"true":"false", rawurlencode($address));
... | [
"function",
"geoGetCoordsFull",
"(",
"$",
"address",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"$",
"_result",
"=",
"false",
";",
"switch",
"(",
"$",
"this",
"->",
"lookup_service",
")",
"{",
"case",
"'GOOGLE'",
":",
"$",
"_url",
"=",
"sprintf",
"(",
"'... | get full geocode information for given address from Google
NOTE: This does not use the getCache function as there is
a lot of data in a full geocode response to cache.
@param string $address
@return bool|array false if can't be geocoded, array or geocdoes if successful | [
"get",
"full",
"geocode",
"information",
"for",
"given",
"address",
"from",
"Google",
"NOTE",
":",
"This",
"does",
"not",
"use",
"the",
"getCache",
"function",
"as",
"there",
"is",
"a",
"lot",
"of",
"data",
"in",
"a",
"full",
"geocode",
"response",
"to",
... | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2677-L2695 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.geoGetDistance | function geoGetDistance($lat1,$lon1,$lat2,$lon2,$unit='M') {
// calculate miles
$M = 69.09 * rad2deg(acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon1 - $lon2))));
switch(strtoupper($unit))
{
case 'K':
//... | php | function geoGetDistance($lat1,$lon1,$lat2,$lon2,$unit='M') {
// calculate miles
$M = 69.09 * rad2deg(acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon1 - $lon2))));
switch(strtoupper($unit))
{
case 'K':
//... | [
"function",
"geoGetDistance",
"(",
"$",
"lat1",
",",
"$",
"lon1",
",",
"$",
"lat2",
",",
"$",
"lon2",
",",
"$",
"unit",
"=",
"'M'",
")",
"{",
"// calculate miles",
"$",
"M",
"=",
"69.09",
"*",
"rad2deg",
"(",
"acos",
"(",
"sin",
"(",
"deg2rad",
"("... | get distance between to geocoords using great circle distance formula
@param float $lat1
@param float $lat2
@param float $lon1
@param float $lon2
@param float $unit M=miles, K=kilometers, N=nautical miles, I=inches, F=feet
@return float | [
"get",
"distance",
"between",
"to",
"geocoords",
"using",
"great",
"circle",
"distance",
"formula"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2718-L2748 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.getPolygonJS | function getPolygonJS() {
$_output = '';
foreach($this->_polygons as $polygon_id => $_polygon) {
$_coords_output = "";
foreach($_polygon["coords"] as $_coords){
if($_coords_output != ""){$_coords_output.=",";}
$_coords_output .= "
new google.maps.LatLng(".$_... | php | function getPolygonJS() {
$_output = '';
foreach($this->_polygons as $polygon_id => $_polygon) {
$_coords_output = "";
foreach($_polygon["coords"] as $_coords){
if($_coords_output != ""){$_coords_output.=",";}
$_coords_output .= "
new google.maps.LatLng(".$_... | [
"function",
"getPolygonJS",
"(",
")",
"{",
"$",
"_output",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"_polygons",
"as",
"$",
"polygon_id",
"=>",
"$",
"_polygon",
")",
"{",
"$",
"_coords_output",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"_polygon... | #)MS
overridable function to generate polyline js - for now can only be used on a map, not a streetview | [
"#",
")",
"MS",
"overridable",
"function",
"to",
"generate",
"polyline",
"js",
"-",
"for",
"now",
"can",
"only",
"be",
"used",
"on",
"a",
"map",
"not",
"a",
"streetview"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2753-L2777 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addPolygonByCoords | function addPolygonByCoords($lon1,$lat1,$lon2,$lat2,$id=false,$color='',$weight=0,$opacity=0,$fill_color='',$fill_opacity=0) {
if($id !== false && isset($this->_polygons[$id]) && is_array($this->_polygons[$id])){
$_polygon = $this->_polygons[$id];
}else{
//only set color,weight,and opacity if new polyline
... | php | function addPolygonByCoords($lon1,$lat1,$lon2,$lat2,$id=false,$color='',$weight=0,$opacity=0,$fill_color='',$fill_opacity=0) {
if($id !== false && isset($this->_polygons[$id]) && is_array($this->_polygons[$id])){
$_polygon = $this->_polygons[$id];
}else{
//only set color,weight,and opacity if new polyline
... | [
"function",
"addPolygonByCoords",
"(",
"$",
"lon1",
",",
"$",
"lat1",
",",
"$",
"lon2",
",",
"$",
"lat2",
",",
"$",
"id",
"=",
"false",
",",
"$",
"color",
"=",
"''",
",",
"$",
"weight",
"=",
"0",
",",
"$",
"opacity",
"=",
"0",
",",
"$",
"fill_c... | #)MS
adds a map polygon by map coordinates
if color, weight and opacity are not defined, use the google maps defaults
@param string $lon1 the map longitude to draw from
@param string $lat1 the map latitude to draw from
@param string $lon2 the map longitude to draw to
@param string $lat2 the map latitude to draw to
@pa... | [
"#",
")",
"MS",
"adds",
"a",
"map",
"polygon",
"by",
"map",
"coordinates",
"if",
"color",
"weight",
"and",
"opacity",
"are",
"not",
"defined",
"use",
"the",
"google",
"maps",
"defaults"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2795-L2831 |
kossmoss/yii2-google-maps-api | src/GoogleMapAPI.php | GoogleMapAPI.addPolygonByCoordsArray | function addPolygonByCoordsArray($polygon_array,$id=false,$color='',$weight=0,$opacity=0,$fill_color='',$fill_opacity=0){
if(!is_array($polygon_array) || sizeof($polygon_array) < 3)
return false;
$_prev_coords = "";
$_next_coords = "";
foreach($polygon_array as $_coords){
$_prev_... | php | function addPolygonByCoordsArray($polygon_array,$id=false,$color='',$weight=0,$opacity=0,$fill_color='',$fill_opacity=0){
if(!is_array($polygon_array) || sizeof($polygon_array) < 3)
return false;
$_prev_coords = "";
$_next_coords = "";
foreach($polygon_array as $_coords){
$_prev_... | [
"function",
"addPolygonByCoordsArray",
"(",
"$",
"polygon_array",
",",
"$",
"id",
"=",
"false",
",",
"$",
"color",
"=",
"''",
",",
"$",
"weight",
"=",
"0",
",",
"$",
"opacity",
"=",
"0",
",",
"$",
"fill_color",
"=",
"''",
",",
"$",
"fill_opacity",
"=... | #)MS
adds polyline by passed array
if color, weight and opacity are not defined, use the google maps defaults
@param array $polyline_array array of lat/long coords
@param string $id An array id to use to append coordinates to a line
@param string $color the color of the line (format: #000000)
@param string $weight the ... | [
"#",
")",
"MS",
"adds",
"polyline",
"by",
"passed",
"array",
"if",
"color",
"weight",
"and",
"opacity",
"are",
"not",
"defined",
"use",
"the",
"google",
"maps",
"defaults"
] | train | https://github.com/kossmoss/yii2-google-maps-api/blob/8a994c173031d7ece3cfedd30b971258616579d2/src/GoogleMapAPI.php#L2845-L2864 |
mothership-ec/composer | src/Composer/Downloader/HgDownloader.php | HgDownloader.doDownload | public function doDownload(PackageInterface $package, $path, $url)
{
$url = ProcessExecutor::escape($url);
$ref = ProcessExecutor::escape($package->getSourceReference());
$this->io->writeError(" Cloning ".$package->getSourceReference());
$command = sprintf('hg clone %s %s', $url, ... | php | public function doDownload(PackageInterface $package, $path, $url)
{
$url = ProcessExecutor::escape($url);
$ref = ProcessExecutor::escape($package->getSourceReference());
$this->io->writeError(" Cloning ".$package->getSourceReference());
$command = sprintf('hg clone %s %s', $url, ... | [
"public",
"function",
"doDownload",
"(",
"PackageInterface",
"$",
"package",
",",
"$",
"path",
",",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"ProcessExecutor",
"::",
"escape",
"(",
"$",
"url",
")",
";",
"$",
"ref",
"=",
"ProcessExecutor",
"::",
"escape",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Downloader/HgDownloader.php#L26-L39 |
mothership-ec/composer | src/Composer/Downloader/HgDownloader.php | HgDownloader.doUpdate | public function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url)
{
$url = ProcessExecutor::escape($url);
$ref = ProcessExecutor::escape($target->getSourceReference());
$this->io->writeError(" Updating to ".$target->getSourceReference());
if (!is_dir($pat... | php | public function doUpdate(PackageInterface $initial, PackageInterface $target, $path, $url)
{
$url = ProcessExecutor::escape($url);
$ref = ProcessExecutor::escape($target->getSourceReference());
$this->io->writeError(" Updating to ".$target->getSourceReference());
if (!is_dir($pat... | [
"public",
"function",
"doUpdate",
"(",
"PackageInterface",
"$",
"initial",
",",
"PackageInterface",
"$",
"target",
",",
"$",
"path",
",",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"ProcessExecutor",
"::",
"escape",
"(",
"$",
"url",
")",
";",
"$",
"ref",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Downloader/HgDownloader.php#L44-L58 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getHome | public function getHome($track = true)
{
$home = PublishedNode::whereHome(1)
->firstOrFail();
$this->track($track, $home);
return $home;
} | php | public function getHome($track = true)
{
$home = PublishedNode::whereHome(1)
->firstOrFail();
$this->track($track, $home);
return $home;
} | [
"public",
"function",
"getHome",
"(",
"$",
"track",
"=",
"true",
")",
"{",
"$",
"home",
"=",
"PublishedNode",
"::",
"whereHome",
"(",
"1",
")",
"->",
"firstOrFail",
"(",
")",
";",
"$",
"this",
"->",
"track",
"(",
"$",
"track",
",",
"$",
"home",
")"... | Returns the home node
@param bool $track
@return Node | [
"Returns",
"the",
"home",
"node"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L29-L37 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getNode | public function getNode($name, $track = true, $published = true)
{
if ($this->withPublishedOnly($published))
{
$node = PublishedNode::withName($name);
} else
{
$node = Node::withName($name);
}
$node = $node->firstOrFail();
$this->trac... | php | public function getNode($name, $track = true, $published = true)
{
if ($this->withPublishedOnly($published))
{
$node = PublishedNode::withName($name);
} else
{
$node = Node::withName($name);
}
$node = $node->firstOrFail();
$this->trac... | [
"public",
"function",
"getNode",
"(",
"$",
"name",
",",
"$",
"track",
"=",
"true",
",",
"$",
"published",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"withPublishedOnly",
"(",
"$",
"published",
")",
")",
"{",
"$",
"node",
"=",
"PublishedNode... | Returns a node by name
@param string $name
@param bool $track
@param bool $published
@return Node | [
"Returns",
"a",
"node",
"by",
"name"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L47-L62 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.withPublishedOnly | protected function withPublishedOnly($published)
{
if ($published === false)
{
return false;
}
if ($this->tokenManager->requestHasToken('preview_nodes'))
{
return false;
}
return true;
} | php | protected function withPublishedOnly($published)
{
if ($published === false)
{
return false;
}
if ($this->tokenManager->requestHasToken('preview_nodes'))
{
return false;
}
return true;
} | [
"protected",
"function",
"withPublishedOnly",
"(",
"$",
"published",
")",
"{",
"if",
"(",
"$",
"published",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"tokenManager",
"->",
"requestHasToken",
"(",
"'preview_nodes'",
... | Checks if the request includes unpublished nodes as well
@param bool $published
@return bool | [
"Checks",
"if",
"the",
"request",
"includes",
"unpublished",
"nodes",
"as",
"well"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L70-L83 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getNodeAndSetLocale | public function getNodeAndSetLocale($name, $track = true, $published = true)
{
$node = $this->getNode($name, $track, $published);
$locale = $node->getLocaleForNodeName($name);
set_app_locale($locale);
return $node;
} | php | public function getNodeAndSetLocale($name, $track = true, $published = true)
{
$node = $this->getNode($name, $track, $published);
$locale = $node->getLocaleForNodeName($name);
set_app_locale($locale);
return $node;
} | [
"public",
"function",
"getNodeAndSetLocale",
"(",
"$",
"name",
",",
"$",
"track",
"=",
"true",
",",
"$",
"published",
"=",
"true",
")",
"{",
"$",
"node",
"=",
"$",
"this",
"->",
"getNode",
"(",
"$",
"name",
",",
"$",
"track",
",",
"$",
"published",
... | Returns a node by name and sets the locale
@param string $name
@param bool $track
@param bool $published
@return Node | [
"Returns",
"a",
"node",
"by",
"name",
"and",
"sets",
"the",
"locale"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L93-L102 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getSearchNodeBuilder | public function getSearchNodeBuilder($keywords, $type = null, $limit = null, $locale = null)
{
// Because of the searchable trait we have to reset global scopes
$builder = PublishedNode::withoutGlobalScopes()
->published()
->typeMailing()
->translatedIn($locale)
... | php | public function getSearchNodeBuilder($keywords, $type = null, $limit = null, $locale = null)
{
// Because of the searchable trait we have to reset global scopes
$builder = PublishedNode::withoutGlobalScopes()
->published()
->typeMailing()
->translatedIn($locale)
... | [
"public",
"function",
"getSearchNodeBuilder",
"(",
"$",
"keywords",
",",
"$",
"type",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"// Because of the searchable trait we have to reset global scopes",
"$",
"builder",
"=",
... | Gets node searching builder
@param string $keywords
@param string $type
@param int $limit
@param string $locale
@return Builder | [
"Gets",
"node",
"searching",
"builder"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L113-L135 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.searchNodes | public function searchNodes($keywords, $type = null, $limit = null, $locale = null)
{
return $this->getSearchNodeBuilder($keywords, $type, $limit, $locale)->get();
} | php | public function searchNodes($keywords, $type = null, $limit = null, $locale = null)
{
return $this->getSearchNodeBuilder($keywords, $type, $limit, $locale)->get();
} | [
"public",
"function",
"searchNodes",
"(",
"$",
"keywords",
",",
"$",
"type",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getSearchNodeBuilder",
"(",
"$",
"keywords",
",",
"$",
... | Searches for nodes
@param string $keywords
@param string $type
@param int $limit
@param string $locale
@return Collection | [
"Searches",
"for",
"nodes"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L146-L149 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getSortedNodesBuilder | public function getSortedNodesBuilder($key = null, $direction = null, $type = null, $limit = null, $locale = null)
{
$builder = PublishedNode::translatedIn($locale)
->groupBy('nodes.id');
if ($type)
{
$builder->withType($type);
}
if ($limit)
... | php | public function getSortedNodesBuilder($key = null, $direction = null, $type = null, $limit = null, $locale = null)
{
$builder = PublishedNode::translatedIn($locale)
->groupBy('nodes.id');
if ($type)
{
$builder->withType($type);
}
if ($limit)
... | [
"public",
"function",
"getSortedNodesBuilder",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"direction",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"builder",
"=",
"Published... | Gets node sortable builder
@param string $key
@param string $direction
@param string $type
@param int $limit
@param string $locale
@return Builder | [
"Gets",
"node",
"sortable",
"builder"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L161-L177 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getSortedNodes | public function getSortedNodes($key = null, $direction = null, $type = null, $limit = null, $locale = null)
{
return $this->getSortedNodesBuilder($key, $direction, $type, $limit, $locale)->paginate();
} | php | public function getSortedNodes($key = null, $direction = null, $type = null, $limit = null, $locale = null)
{
return $this->getSortedNodesBuilder($key, $direction, $type, $limit, $locale)->paginate();
} | [
"public",
"function",
"getSortedNodes",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"direction",
"=",
"null",
",",
"$",
"type",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getSor... | Gets sorted nodes
@param string $key
@param string $direction
@param string $type
@param int $limit
@param string $locale
@return Collection | [
"Gets",
"sorted",
"nodes"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L189-L192 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getNodeById | public function getNodeById($id, $published)
{
return $published ? PublishedNode::find($id) : Node::find($id);
} | php | public function getNodeById($id, $published)
{
return $published ? PublishedNode::find($id) : Node::find($id);
} | [
"public",
"function",
"getNodeById",
"(",
"$",
"id",
",",
"$",
"published",
")",
"{",
"return",
"$",
"published",
"?",
"PublishedNode",
"::",
"find",
"(",
"$",
"id",
")",
":",
"Node",
"::",
"find",
"(",
"$",
"id",
")",
";",
"}"
] | Returns a node by id
@param int $id
@param bool $published
@return Node | [
"Returns",
"a",
"node",
"by",
"id"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L201-L204 |
NuclearCMS/Hierarchy | src/NodeRepository.php | NodeRepository.getNodesByIds | public function getNodesByIds($ids, $published = true)
{
if (empty($ids))
{
return null;
}
if (is_string($ids))
{
$ids = json_decode($ids, true);
}
if (is_array($ids) && ! empty($ids))
{
$placeholders = implode(','... | php | public function getNodesByIds($ids, $published = true)
{
if (empty($ids))
{
return null;
}
if (is_string($ids))
{
$ids = json_decode($ids, true);
}
if (is_array($ids) && ! empty($ids))
{
$placeholders = implode(','... | [
"public",
"function",
"getNodesByIds",
"(",
"$",
"ids",
",",
"$",
"published",
"=",
"true",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"ids",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"ids",
")",
")",
"{",
"$",
"... | Returns nodes by ids
@param array|string $ids
@param bool $published
@return Collection | [
"Returns",
"nodes",
"by",
"ids"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/NodeRepository.php#L213-L243 |
codezero-be/curl | src/Curl.php | Curl.initialize | public function initialize()
{
if ($this->isInitialized())
{
$this->close();
}
if ( ! ($this->curl = curl_init()))
{
throw new CurlException('Could not initialize a cURL resource');
}
return true;
} | php | public function initialize()
{
if ($this->isInitialized())
{
$this->close();
}
if ( ! ($this->curl = curl_init()))
{
throw new CurlException('Could not initialize a cURL resource');
}
return true;
} | [
"public",
"function",
"initialize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isInitialized",
"(",
")",
")",
"{",
"$",
"this",
"->",
"close",
"(",
")",
";",
"}",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"curl",
"=",
"curl_init",
"(",
")",
")... | Initialize a new cURL resource
@return bool
@throws CurlException | [
"Initialize",
"a",
"new",
"cURL",
"resource"
] | train | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/Curl.php#L38-L51 |
codezero-be/curl | src/Curl.php | Curl.setOption | public function setOption($option, $value)
{
$this->autoInitialize();
return curl_setopt($this->curl, $option, $value);
} | php | public function setOption($option, $value)
{
$this->autoInitialize();
return curl_setopt($this->curl, $option, $value);
} | [
"public",
"function",
"setOption",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"autoInitialize",
"(",
")",
";",
"return",
"curl_setopt",
"(",
"$",
"this",
"->",
"curl",
",",
"$",
"option",
",",
"$",
"value",
")",
";",
"}"
] | Set cURL option
@param int $option
@param mixed $value
@return bool
@throws CurlException | [
"Set",
"cURL",
"option"
] | train | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/Curl.php#L72-L77 |
codezero-be/curl | src/Curl.php | Curl.sendRequest | public function sendRequest(array $options = [])
{
$this->autoInitialize();
if ( ! empty($options))
{
if ( ! $this->setOptions($options))
{
return false;
}
}
$this->response = curl_exec($this->curl);
return $this-... | php | public function sendRequest(array $options = [])
{
$this->autoInitialize();
if ( ! empty($options))
{
if ( ! $this->setOptions($options))
{
return false;
}
}
$this->response = curl_exec($this->curl);
return $this-... | [
"public",
"function",
"sendRequest",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"autoInitialize",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"setOp... | Send the cURL request (will initialize if needed and set options if provided)
!!! Options that have already been set are not automatically reset !!!
@param array $options
@return bool|string
@throws CurlException | [
"Send",
"the",
"cURL",
"request",
"(",
"will",
"initialize",
"if",
"needed",
"and",
"set",
"options",
"if",
"provided",
")"
] | train | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/Curl.php#L104-L119 |
codezero-be/curl | src/Curl.php | Curl.getRequestInfo | public function getRequestInfo($key = null)
{
if ( ! $this->isInitialized())
{
return $key ? '' : [];
}
return $key ? curl_getinfo($this->curl, $key) : curl_getinfo($this->curl);
} | php | public function getRequestInfo($key = null)
{
if ( ! $this->isInitialized())
{
return $key ? '' : [];
}
return $key ? curl_getinfo($this->curl, $key) : curl_getinfo($this->curl);
} | [
"public",
"function",
"getRequestInfo",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isInitialized",
"(",
")",
")",
"{",
"return",
"$",
"key",
"?",
"''",
":",
"[",
"]",
";",
"}",
"return",
"$",
"key",
"?",
"curl_get... | Get additional information about the last cURL request
@param string $key
@return string|array | [
"Get",
"additional",
"information",
"about",
"the",
"last",
"cURL",
"request"
] | train | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/Curl.php#L138-L146 |
codezero-be/curl | src/Curl.php | Curl.reset | public function reset()
{
if ( ! $this->isInitialized() || ! function_exists('curl_reset'))
{
$this->initialize();
}
else
{
// PHP >= 5.5.0
curl_reset($this->curl);
$this->response = null;
}
} | php | public function reset()
{
if ( ! $this->isInitialized() || ! function_exists('curl_reset'))
{
$this->initialize();
}
else
{
// PHP >= 5.5.0
curl_reset($this->curl);
$this->response = null;
}
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isInitialized",
"(",
")",
"||",
"!",
"function_exists",
"(",
"'curl_reset'",
")",
")",
"{",
"$",
"this",
"->",
"initialize",
"(",
")",
";",
"}",
"else",
"{",
"// PHP >=... | Reset all cURL options
@return void
@throws CurlException | [
"Reset",
"all",
"cURL",
"options"
] | train | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/Curl.php#L216-L229 |
codezero-be/curl | src/Curl.php | Curl.close | public function close()
{
if ($this->isInitialized())
{
curl_close($this->curl);
$this->curl = null;
$this->response = null;
}
} | php | public function close()
{
if ($this->isInitialized())
{
curl_close($this->curl);
$this->curl = null;
$this->response = null;
}
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isInitialized",
"(",
")",
")",
"{",
"curl_close",
"(",
"$",
"this",
"->",
"curl",
")",
";",
"$",
"this",
"->",
"curl",
"=",
"null",
";",
"$",
"this",
"->",
"response",
"... | Close the cURL resource
@return void | [
"Close",
"the",
"cURL",
"resource"
] | train | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/Curl.php#L236-L245 |
codezero-be/curl | src/Curl.php | Curl.parseUrl | private function parseUrl($string, $decode)
{
$this->autoInitialize();
$function = $decode ? 'curl_unescape' : 'curl_escape';
if ( ! function_exists($function))
{
return $decode ? rawurldecode($string) : rawurlencode($string);
}
// PHP >= 5.5.0
... | php | private function parseUrl($string, $decode)
{
$this->autoInitialize();
$function = $decode ? 'curl_unescape' : 'curl_escape';
if ( ! function_exists($function))
{
return $decode ? rawurldecode($string) : rawurlencode($string);
}
// PHP >= 5.5.0
... | [
"private",
"function",
"parseUrl",
"(",
"$",
"string",
",",
"$",
"decode",
")",
"{",
"$",
"this",
"->",
"autoInitialize",
"(",
")",
";",
"$",
"function",
"=",
"$",
"decode",
"?",
"'curl_unescape'",
":",
"'curl_escape'",
";",
"if",
"(",
"!",
"function_exi... | Encode or decode a URL
@param string $string
@param bool $decode
@return bool|string | [
"Encode",
"or",
"decode",
"a",
"URL"
] | train | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/Curl.php#L286-L299 |
josegonzalez/cakephp-sanction | Model/Behavior/PermitBehavior.php | PermitBehavior.setup | public function setup(Model $Model, $settings = array()) {
if (!isset($this->settings[$Model->alias])) {
$this->settings[$Model->alias] = array(
'message' => sprintf('You do not have permission to view this %s ',
strtolower(Inflector::humanize($Model->alias))
),
'check' => false,
'value' => tr... | php | public function setup(Model $Model, $settings = array()) {
if (!isset($this->settings[$Model->alias])) {
$this->settings[$Model->alias] = array(
'message' => sprintf('You do not have permission to view this %s ',
strtolower(Inflector::humanize($Model->alias))
),
'check' => false,
'value' => tr... | [
"public",
"function",
"setup",
"(",
"Model",
"$",
"Model",
",",
"$",
"settings",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"settings",
"[",
"$",
"Model",
"->",
"alias",
"]",
")",
")",
"{",
"$",
"this",
"... | Initiate behavior for the model using specified settings.
Available settings:
- message: (string, optional) A message to display to the user when they do not
have access to the model record. DEFAULTS TO: "You do not have permission
to view this %ModelAlias%"
- check: (string, optional) optional admin override for ret... | [
"Initiate",
"behavior",
"for",
"the",
"model",
"using",
"specified",
"settings",
"."
] | train | https://github.com/josegonzalez/cakephp-sanction/blob/df2a8f0c0602c0ace802773db2c2ca6c89555c47/Model/Behavior/PermitBehavior.php#L38-L53 |
josegonzalez/cakephp-sanction | Model/Behavior/PermitBehavior.php | PermitBehavior.beforeFind | public function beforeFind(Model $Model, $query) {
$this->settings[$Model->alias] = $this->modelDefaults[$Model->alias];
// check if $this->modelDefaultsPersist has been set
if (isset($this->modelDefaultsPersist[$Model->alias])) {
// if persist equals equals true
if (!isset($this->modelDefaults[$Model->ali... | php | public function beforeFind(Model $Model, $query) {
$this->settings[$Model->alias] = $this->modelDefaults[$Model->alias];
// check if $this->modelDefaultsPersist has been set
if (isset($this->modelDefaultsPersist[$Model->alias])) {
// if persist equals equals true
if (!isset($this->modelDefaults[$Model->ali... | [
"public",
"function",
"beforeFind",
"(",
"Model",
"$",
"Model",
",",
"$",
"query",
")",
"{",
"$",
"this",
"->",
"settings",
"[",
"$",
"Model",
"->",
"alias",
"]",
"=",
"$",
"this",
"->",
"modelDefaults",
"[",
"$",
"Model",
"->",
"alias",
"]",
";",
... | beforeFind Callback
@param Model $Model Model find is being run on.
@param array $query Array of Query parameters.
@return array Modified query | [
"beforeFind",
"Callback"
] | train | https://github.com/josegonzalez/cakephp-sanction/blob/df2a8f0c0602c0ace802773db2c2ca6c89555c47/Model/Behavior/PermitBehavior.php#L62-L89 |
josegonzalez/cakephp-sanction | Model/Behavior/PermitBehavior.php | PermitBehavior.afterFind | public function afterFind(Model $Model, $results, $primary) {
if (!$primary) {
return $results;
}
$settings = $this->settings[$Model->alias];
if ($settings['skip'] === true) {
return $results;
}
// the permit behavour is a bit pointless if we're handing more than one result
if (count($results) > ... | php | public function afterFind(Model $Model, $results, $primary) {
if (!$primary) {
return $results;
}
$settings = $this->settings[$Model->alias];
if ($settings['skip'] === true) {
return $results;
}
// the permit behavour is a bit pointless if we're handing more than one result
if (count($results) > ... | [
"public",
"function",
"afterFind",
"(",
"Model",
"$",
"Model",
",",
"$",
"results",
",",
"$",
"primary",
")",
"{",
"if",
"(",
"!",
"$",
"primary",
")",
"{",
"return",
"$",
"results",
";",
"}",
"$",
"settings",
"=",
"$",
"this",
"->",
"settings",
"[... | afterFind Callback
@param Model $Model Model find was run on
@param array $results Array of model results.
@param bool $primary Did the find originate on $model.
@return array Modified results
@throws UnauthorizedException | [
"afterFind",
"Callback"
] | train | https://github.com/josegonzalez/cakephp-sanction/blob/df2a8f0c0602c0ace802773db2c2ca6c89555c47/Model/Behavior/PermitBehavior.php#L100-L133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.