id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
230,100 | milesj/admin | Controller/AclController.php | AclController.beforeFilter | public function beforeFilter() {
parent::beforeFilter();
$this->Aco = Admin::introspectModel('Admin.ControlObject');
$this->Aro = Admin::introspectModel('Admin.RequestObject');
$this->Permission = Admin::introspectModel('Admin.ObjectPermission');
$this->Permission->cacheQueries ... | php | public function beforeFilter() {
parent::beforeFilter();
$this->Aco = Admin::introspectModel('Admin.ControlObject');
$this->Aro = Admin::introspectModel('Admin.RequestObject');
$this->Permission = Admin::introspectModel('Admin.ObjectPermission');
$this->Permission->cacheQueries ... | [
"public",
"function",
"beforeFilter",
"(",
")",
"{",
"parent",
"::",
"beforeFilter",
"(",
")",
";",
"$",
"this",
"->",
"Aco",
"=",
"Admin",
"::",
"introspectModel",
"(",
"'Admin.ControlObject'",
")",
";",
"$",
"this",
"->",
"Aro",
"=",
"Admin",
"::",
"in... | Introspect ACL models and make them available. | [
"Introspect",
"ACL",
"models",
"and",
"make",
"them",
"available",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/AclController.php#L66-L73 |
230,101 | milesj/admin | Controller/AclController.php | AclController.getControllers | protected function getControllers() {
$mapParentId = array();
$acos = $this->Aco->getAll();
// Map IDs to parent IDs
foreach ($acos as $aco) {
$mapParentId[$aco['ControlObject']['id']] = $aco['ControlObject']['parent_id'];
}
// Determine the child depth
... | php | protected function getControllers() {
$mapParentId = array();
$acos = $this->Aco->getAll();
// Map IDs to parent IDs
foreach ($acos as $aco) {
$mapParentId[$aco['ControlObject']['id']] = $aco['ControlObject']['parent_id'];
}
// Determine the child depth
... | [
"protected",
"function",
"getControllers",
"(",
")",
"{",
"$",
"mapParentId",
"=",
"array",
"(",
")",
";",
"$",
"acos",
"=",
"$",
"this",
"->",
"Aco",
"->",
"getAll",
"(",
")",
";",
"// Map IDs to parent IDs",
"foreach",
"(",
"$",
"acos",
"as",
"$",
"a... | Return all the ACOs.
@return array | [
"Return",
"all",
"the",
"ACOs",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/AclController.php#L80-L104 |
230,102 | milesj/admin | Controller/AclController.php | AclController.getRequesters | protected function getRequesters() {
$mapParentId = array();
$mapAroId = array();
$aros = $this->Aro->getAll();
$permissions = $this->Permission->getAll();
// Map ACOs to AROs indexed by IDs
foreach ($permissions as $permission) {
$permission = $permission['... | php | protected function getRequesters() {
$mapParentId = array();
$mapAroId = array();
$aros = $this->Aro->getAll();
$permissions = $this->Permission->getAll();
// Map ACOs to AROs indexed by IDs
foreach ($permissions as $permission) {
$permission = $permission['... | [
"protected",
"function",
"getRequesters",
"(",
")",
"{",
"$",
"mapParentId",
"=",
"array",
"(",
")",
";",
"$",
"mapAroId",
"=",
"array",
"(",
")",
";",
"$",
"aros",
"=",
"$",
"this",
"->",
"Aro",
"->",
"getAll",
"(",
")",
";",
"$",
"permissions",
"... | Return all the AROs with their permissions mapped.
@return array | [
"Return",
"all",
"the",
"AROs",
"with",
"their",
"permissions",
"mapped",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Controller/AclController.php#L111-L181 |
230,103 | Webiny/Framework | src/Webiny/Component/ClassLoader/ClassLoader.php | ClassLoader.getClassFromCache | public function getClassFromCache($class)
{
// from cache
if (($file = $this->cache->read($class))) {
require $file;
}
// from disk
if ($file = $this->findClass($class)) {
$this->cache->save('wf.component.class_loader.' . $class, $file, 600, [
... | php | public function getClassFromCache($class)
{
// from cache
if (($file = $this->cache->read($class))) {
require $file;
}
// from disk
if ($file = $this->findClass($class)) {
$this->cache->save('wf.component.class_loader.' . $class, $file, 600, [
... | [
"public",
"function",
"getClassFromCache",
"(",
"$",
"class",
")",
"{",
"// from cache",
"if",
"(",
"(",
"$",
"file",
"=",
"$",
"this",
"->",
"cache",
"->",
"read",
"(",
"$",
"class",
")",
")",
")",
"{",
"require",
"$",
"file",
";",
"}",
"// from dis... | First tries to find the class in the cache. If the class is not found in the cache, then it tries to find it
by using the registered maps.
@param string $class Name of the class you are trying to find.
@return bool True is retuned if the class if found and loaded into memory. | [
"First",
"tries",
"to",
"find",
"the",
"class",
"in",
"the",
"cache",
".",
"If",
"the",
"class",
"is",
"not",
"found",
"in",
"the",
"cache",
"then",
"it",
"tries",
"to",
"find",
"it",
"by",
"using",
"the",
"registered",
"maps",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ClassLoader/ClassLoader.php#L167-L183 |
230,104 | Webiny/Framework | src/Webiny/Component/ClassLoader/ClassLoader.php | ClassLoader.findClass | public function findClass($class)
{
if (strrpos($class, '\\') !== false) {
$file = Loaders\Psr4::getInstance()->findClass($class);
if (!$file) {
$file = Loaders\Psr0::getInstance()->findClass($class);
}
} else {
$file = Loaders\Pear::ge... | php | public function findClass($class)
{
if (strrpos($class, '\\') !== false) {
$file = Loaders\Psr4::getInstance()->findClass($class);
if (!$file) {
$file = Loaders\Psr0::getInstance()->findClass($class);
}
} else {
$file = Loaders\Pear::ge... | [
"public",
"function",
"findClass",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"strrpos",
"(",
"$",
"class",
",",
"'\\\\'",
")",
"!==",
"false",
")",
"{",
"$",
"file",
"=",
"Loaders",
"\\",
"Psr4",
"::",
"getInstance",
"(",
")",
"->",
"findClass",
"(",
... | Tries to get the path to the class based on registered maps.
@param string $class The name of the class
@return string|bool The path, if found, or false. | [
"Tries",
"to",
"get",
"the",
"path",
"to",
"the",
"class",
"based",
"on",
"registered",
"maps",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/ClassLoader/ClassLoader.php#L192-L204 |
230,105 | ZenMagick/ZenCart | includes/modules/payment/authorizenet.php | authorizenet.InsertFP | function InsertFP ($loginid, $txnkey, $amount, $sequence, $currency = "") {
$tstamp = time ();
$fingerprint = $this->hmac ($txnkey, $loginid . "^" . $sequence . "^" . $tstamp . "^" . $amount . "^" . $currency);
$security_array = array('x_fp_sequence' => $sequence,
'x_fp_timestamp... | php | function InsertFP ($loginid, $txnkey, $amount, $sequence, $currency = "") {
$tstamp = time ();
$fingerprint = $this->hmac ($txnkey, $loginid . "^" . $sequence . "^" . $tstamp . "^" . $amount . "^" . $currency);
$security_array = array('x_fp_sequence' => $sequence,
'x_fp_timestamp... | [
"function",
"InsertFP",
"(",
"$",
"loginid",
",",
"$",
"txnkey",
",",
"$",
"amount",
",",
"$",
"sequence",
",",
"$",
"currency",
"=",
"\"\"",
")",
"{",
"$",
"tstamp",
"=",
"time",
"(",
")",
";",
"$",
"fingerprint",
"=",
"$",
"this",
"->",
"hmac",
... | Inserts the hidden variables in the HTML FORM required for SIM
Invokes hmac function to calculate fingerprint.
@param string $loginid
@param string $txnkey
@param float $amount
@param string $sequence
@param float $currency
@return string | [
"Inserts",
"the",
"hidden",
"variables",
"in",
"the",
"HTML",
"FORM",
"required",
"for",
"SIM",
"Invokes",
"hmac",
"function",
"to",
"calculate",
"fingerprint",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/authorizenet.php#L156-L163 |
230,106 | ZenMagick/ZenCart | includes/modules/payment/authorizenet.php | authorizenet.update_status | function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_ZONE . "' and zone_co... | php | function update_status() {
global $order, $db;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_ZONE . "' and zone_co... | [
"function",
"update_status",
"(",
")",
"{",
"global",
"$",
"order",
",",
"$",
"db",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"enabled",
"==",
"true",
")",
"&&",
"(",
"(",
"int",
")",
"MODULE_PAYMENT_AUTHORIZENET_ZONE",
">",
"0",
")",
")",
"{",
"$",
... | Calculate zone matches and flag settings to determine whether this module should display to customers or not | [
"Calculate",
"zone",
"matches",
"and",
"flag",
"settings",
"to",
"determine",
"whether",
"this",
"module",
"should",
"display",
"to",
"customers",
"or",
"not"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/authorizenet.php#L170-L191 |
230,107 | naneau/semver | src/Naneau/SemVer/Version/Build.php | Build.addPart | public function addPart($part)
{
// Sanity check
if (!ctype_alnum($part)) {
throw new InvalidArgumentException(
'Build part "' . $part . '" is not alpha numerical'
);
}
$this->parts[] = $part;
return $this;
} | php | public function addPart($part)
{
// Sanity check
if (!ctype_alnum($part)) {
throw new InvalidArgumentException(
'Build part "' . $part . '" is not alpha numerical'
);
}
$this->parts[] = $part;
return $this;
} | [
"public",
"function",
"addPart",
"(",
"$",
"part",
")",
"{",
"// Sanity check",
"if",
"(",
"!",
"ctype_alnum",
"(",
"$",
"part",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Build part \"'",
".",
"$",
"part",
".",
"'\" is not alpha numeric... | Add a part to the build parts stack
@param string $part
@return Build | [
"Add",
"a",
"part",
"to",
"the",
"build",
"parts",
"stack"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Version/Build.php#L101-L113 |
230,108 | clue/php-socket-react | src/Datagram/Factory.php | Factory.createServer | public function createServer($address, $context = array())
{
$that = $this;
$factory = $this->rawFactory;
return $this->resolve($address)->then(function ($address) use ($factory, $that, $context){
$scheme = 'udp';
$socket = $factory->createFromString($address, $schem... | php | public function createServer($address, $context = array())
{
$that = $this;
$factory = $this->rawFactory;
return $this->resolve($address)->then(function ($address) use ($factory, $that, $context){
$scheme = 'udp';
$socket = $factory->createFromString($address, $schem... | [
"public",
"function",
"createServer",
"(",
"$",
"address",
",",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"$",
"that",
"=",
"$",
"this",
";",
"$",
"factory",
"=",
"$",
"this",
"->",
"rawFactory",
";",
"return",
"$",
"this",
"->",
"resolve",
... | create datagram server socket waiting for incoming messages on the given local address
@param string $address
@param array $context (optional) "broadcast" context option
@return PromiseInterface to return a \Socket\React\Datagram\Datagram
@uses RawFactory::createFromString()
@uses RawSocket::setBlocking() to turn on ... | [
"create",
"datagram",
"server",
"socket",
"waiting",
"for",
"incoming",
"messages",
"on",
"the",
"given",
"local",
"address"
] | 420dcbc20e8b007a7df2a12373af94b0b70ec15e | https://github.com/clue/php-socket-react/blob/420dcbc20e8b007a7df2a12373af94b0b70ec15e/src/Datagram/Factory.php#L91-L113 |
230,109 | Webiny/Framework | src/Webiny/Component/Rest/Rest.php | Rest.initRest | public static function initRest($api, $url = '', $method = '')
{
$config = self::getConfig()->get($api, false);
if (!$config) {
throw new RestException('Configuration for "' . $api . '" not found.');
}
// check if we have the Path defined
$path = $config->get('R... | php | public static function initRest($api, $url = '', $method = '')
{
$config = self::getConfig()->get($api, false);
if (!$config) {
throw new RestException('Configuration for "' . $api . '" not found.');
}
// check if we have the Path defined
$path = $config->get('R... | [
"public",
"static",
"function",
"initRest",
"(",
"$",
"api",
",",
"$",
"url",
"=",
"''",
",",
"$",
"method",
"=",
"''",
")",
"{",
"$",
"config",
"=",
"self",
"::",
"getConfig",
"(",
")",
"->",
"get",
"(",
"$",
"api",
",",
"false",
")",
";",
"if... | Initializes the current Rest configuration, tries to match the current URL with the defined Path.
If match was successful, an instance of Rest class is returned, otherwise false.
@param string $api Api configuration Name
@param string $url Url on which the to match. Leave blank to use the current url.
@param string $m... | [
"Initializes",
"the",
"current",
"Rest",
"configuration",
"tries",
"to",
"match",
"the",
"current",
"URL",
"with",
"the",
"defined",
"Path",
".",
"If",
"match",
"was",
"successful",
"an",
"instance",
"of",
"Rest",
"class",
"is",
"returned",
"otherwise",
"false... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Rest.php#L102-L150 |
230,110 | Webiny/Framework | src/Webiny/Component/Rest/Rest.php | Rest.processRouterResponse | private static function processRouterResponse(MatchedRoute $matchedRoute, ConfigObject $config, $api)
{
// based on the matched route create the class name
$className = self::str($config->get('Router.Class'))->trimLeft('\\')->prepend('\\');
$normalize = $config->get('Router.Normalize', false... | php | private static function processRouterResponse(MatchedRoute $matchedRoute, ConfigObject $config, $api)
{
// based on the matched route create the class name
$className = self::str($config->get('Router.Class'))->trimLeft('\\')->prepend('\\');
$normalize = $config->get('Router.Normalize', false... | [
"private",
"static",
"function",
"processRouterResponse",
"(",
"MatchedRoute",
"$",
"matchedRoute",
",",
"ConfigObject",
"$",
"config",
",",
"$",
"api",
")",
"{",
"// based on the matched route create the class name",
"$",
"className",
"=",
"self",
"::",
"str",
"(",
... | Internal static method that is called when initRest method matches a URL agains the Path.
This method then processes that matched response and then creates and returns a Rest instance back to iniRest.
@param MatchedRoute $matchedRoute The matched route.
@param ConfigObject $config Current api config.
@param string ... | [
"Internal",
"static",
"method",
"that",
"is",
"called",
"when",
"initRest",
"method",
"matches",
"a",
"URL",
"agains",
"the",
"Path",
".",
"This",
"method",
"then",
"processes",
"that",
"matched",
"response",
"and",
"then",
"creates",
"and",
"returns",
"a",
... | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Rest.php#L163-L179 |
230,111 | Webiny/Framework | src/Webiny/Component/Rest/Rest.php | Rest.setEnvironment | public function setEnvironment($env = self::ENV_PRODUCTION)
{
if ($env != self::ENV_DEVELOPMENT && $env != self::ENV_PRODUCTION) {
throw new RestException('Unknown environment "' . $env . '".');
}
$this->environment = $env;
} | php | public function setEnvironment($env = self::ENV_PRODUCTION)
{
if ($env != self::ENV_DEVELOPMENT && $env != self::ENV_PRODUCTION) {
throw new RestException('Unknown environment "' . $env . '".');
}
$this->environment = $env;
} | [
"public",
"function",
"setEnvironment",
"(",
"$",
"env",
"=",
"self",
"::",
"ENV_PRODUCTION",
")",
"{",
"if",
"(",
"$",
"env",
"!=",
"self",
"::",
"ENV_DEVELOPMENT",
"&&",
"$",
"env",
"!=",
"self",
"::",
"ENV_PRODUCTION",
")",
"{",
"throw",
"new",
"RestE... | Set the component environment.
If it's development, the component will output additional information inside the debug header.
@param string $env Can either be 'development' or 'production'
@throws RestException | [
"Set",
"the",
"component",
"environment",
".",
"If",
"it",
"s",
"development",
"the",
"component",
"will",
"output",
"additional",
"information",
"inside",
"the",
"debug",
"header",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Rest.php#L214-L221 |
230,112 | Webiny/Framework | src/Webiny/Component/Rest/Rest.php | Rest.processRequest | public function processRequest()
{
try {
$router = new Router($this->api, $this->class, $this->normalize, $this->cacheInstance);
// check if url is set via the initRest method
if (!empty(self::$url)) {
$router->setUrl(self::$url);
}
... | php | public function processRequest()
{
try {
$router = new Router($this->api, $this->class, $this->normalize, $this->cacheInstance);
// check if url is set via the initRest method
if (!empty(self::$url)) {
$router->setUrl(self::$url);
}
... | [
"public",
"function",
"processRequest",
"(",
")",
"{",
"try",
"{",
"$",
"router",
"=",
"new",
"Router",
"(",
"$",
"this",
"->",
"api",
",",
"$",
"this",
"->",
"class",
",",
"$",
"this",
"->",
"normalize",
",",
"$",
"this",
"->",
"cacheInstance",
")",... | Processes the current request and returns an instance of CallbackResult.
@return bool|Response\CallbackResult
@throws RestException | [
"Processes",
"the",
"current",
"request",
"and",
"returns",
"an",
"instance",
"of",
"CallbackResult",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Rest.php#L239-L260 |
230,113 | Webiny/Framework | src/Webiny/Component/Rest/Rest.php | Rest.registerClass | private function registerClass()
{
try {
if (!$this->cacheInstance->isCacheValid($this->api, $this->class) || $this->isDevelopment()) {
$this->parseClass();
}
} catch (\Exception $e) {
$exception = new RestException('Unable to register class "' . $... | php | private function registerClass()
{
try {
if (!$this->cacheInstance->isCacheValid($this->api, $this->class) || $this->isDevelopment()) {
$this->parseClass();
}
} catch (\Exception $e) {
$exception = new RestException('Unable to register class "' . $... | [
"private",
"function",
"registerClass",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"cacheInstance",
"->",
"isCacheValid",
"(",
"$",
"this",
"->",
"api",
",",
"$",
"this",
"->",
"class",
")",
"||",
"$",
"this",
"->",
"isDevelopment",
... | Registers the class and creates a compile cache version of it.
@throws RestException | [
"Registers",
"the",
"class",
"and",
"creates",
"a",
"compile",
"cache",
"version",
"of",
"it",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Rest.php#L277-L288 |
230,114 | Webiny/Framework | src/Webiny/Component/Rest/Rest.php | Rest.parseClass | private function parseClass()
{
$parser = new Parser();
$parsedApi = $parser->parseApi($this->class, $this->normalize);
// in development we always write cache
$writer = new Compiler($this->api, $this->normalize, $this->cacheInstance);
$writer->writeCacheFiles($parsedApi);
... | php | private function parseClass()
{
$parser = new Parser();
$parsedApi = $parser->parseApi($this->class, $this->normalize);
// in development we always write cache
$writer = new Compiler($this->api, $this->normalize, $this->cacheInstance);
$writer->writeCacheFiles($parsedApi);
... | [
"private",
"function",
"parseClass",
"(",
")",
"{",
"$",
"parser",
"=",
"new",
"Parser",
"(",
")",
";",
"$",
"parsedApi",
"=",
"$",
"parser",
"->",
"parseApi",
"(",
"$",
"this",
"->",
"class",
",",
"$",
"this",
"->",
"normalize",
")",
";",
"// in dev... | Calls the Parser to parse the class and
then Compiler to create a compiled cache file of the parsed class. | [
"Calls",
"the",
"Parser",
"to",
"parse",
"the",
"class",
"and",
"then",
"Compiler",
"to",
"create",
"a",
"compiled",
"cache",
"file",
"of",
"the",
"parsed",
"class",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Rest.php#L294-L302 |
230,115 | Webiny/Framework | src/Webiny/Component/Rest/Rest.php | Rest.initializeCache | private function initializeCache()
{
// get driver
if (!($driver = $this->config->get('CompilerCacheDriver', false))) {
// default driver
if ($this->isDevelopment()) {
$driver = self::DEV_CACHE_DRIVER;
} else {
$driver = self::PROD_... | php | private function initializeCache()
{
// get driver
if (!($driver = $this->config->get('CompilerCacheDriver', false))) {
// default driver
if ($this->isDevelopment()) {
$driver = self::DEV_CACHE_DRIVER;
} else {
$driver = self::PROD_... | [
"private",
"function",
"initializeCache",
"(",
")",
"{",
"// get driver",
"if",
"(",
"!",
"(",
"$",
"driver",
"=",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'CompilerCacheDriver'",
",",
"false",
")",
")",
")",
"{",
"// default driver",
"if",
"(",
"... | Initializes the compiler cache driver.
@throws Exception
@throws \Exception | [
"Initializes",
"the",
"compiler",
"cache",
"driver",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Rest/Rest.php#L310-L329 |
230,116 | addiks/phpsql | src/Addiks/PHPSQL/Value/Database/Dsn.php | Dsn.getDriverName | public function getDriverName()
{
$value = $this->getValue();
$value = explode(":", $value);
$driver = reset($value);
return $driver;
} | php | public function getDriverName()
{
$value = $this->getValue();
$value = explode(":", $value);
$driver = reset($value);
return $driver;
} | [
"public",
"function",
"getDriverName",
"(",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
";",
"$",
"value",
"=",
"explode",
"(",
"\":\"",
",",
"$",
"value",
")",
";",
"$",
"driver",
"=",
"reset",
"(",
"$",
"value",
")",
"... | gets the driver-name.
@return string | [
"gets",
"the",
"driver",
"-",
"name",
"."
] | 28dae64ffc2123f39f801a50ab53bfe29890cbd9 | https://github.com/addiks/phpsql/blob/28dae64ffc2123f39f801a50ab53bfe29890cbd9/src/Addiks/PHPSQL/Value/Database/Dsn.php#L44-L53 |
230,117 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php | UrlObject.buildUrl | static function buildUrl($parts)
{
$parts = new ArrayObject($parts);
###################
### PARSE PARTS ###
###################
// scheme
$scheme = $parts->key('scheme', '', true);
// host
$host = $parts->key('host', '', true);
// port
... | php | static function buildUrl($parts)
{
$parts = new ArrayObject($parts);
###################
### PARSE PARTS ###
###################
// scheme
$scheme = $parts->key('scheme', '', true);
// host
$host = $parts->key('host', '', true);
// port
... | [
"static",
"function",
"buildUrl",
"(",
"$",
"parts",
")",
"{",
"$",
"parts",
"=",
"new",
"ArrayObject",
"(",
"$",
"parts",
")",
";",
"###################",
"### PARSE PARTS ###",
"###################",
"// scheme",
"$",
"scheme",
"=",
"$",
"parts",
"->",
"key"... | Build a UrlObject from array parts.
@param ArrayObject|array $parts Url parts, possible keys are: 'scheme', 'host', 'port', 'path' and 'query'
@throws UrlObjectException
@return UrlObject | [
"Build",
"a",
"UrlObject",
"from",
"array",
"parts",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php#L70-L143 |
230,118 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php | UrlObject.rebuildUrl | private function rebuildUrl()
{
$url = self::buildUrl([
'scheme' => $this->scheme,
'host' => $this->host,
'port' => $this->port,
'path' => $this->path,
'query' => $this->query
]
);
$this->val($... | php | private function rebuildUrl()
{
$url = self::buildUrl([
'scheme' => $this->scheme,
'host' => $this->host,
'port' => $this->port,
'path' => $this->path,
'query' => $this->query
]
);
$this->val($... | [
"private",
"function",
"rebuildUrl",
"(",
")",
"{",
"$",
"url",
"=",
"self",
"::",
"buildUrl",
"(",
"[",
"'scheme'",
"=>",
"$",
"this",
"->",
"scheme",
",",
"'host'",
"=>",
"$",
"this",
"->",
"host",
",",
"'port'",
"=>",
"$",
"this",
"->",
"port",
... | Builds url from current url elements.
@return $this | [
"Builds",
"url",
"from",
"current",
"url",
"elements",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php#L150-L162 |
230,119 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php | UrlObject.getDomain | public function getDomain()
{
if($this->getScheme() && $this->getHost()) {
return $this->getScheme() . '://' . $this->getHost();
}
return false;
} | php | public function getDomain()
{
if($this->getScheme() && $this->getHost()) {
return $this->getScheme() . '://' . $this->getHost();
}
return false;
} | [
"public",
"function",
"getDomain",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getScheme",
"(",
")",
"&&",
"$",
"this",
"->",
"getHost",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getScheme",
"(",
")",
".",
"'://'",
".",
"$",
"this",
"->... | Get the domain name of the current url.
@return string|bool Domain name, or false it's not set. | [
"Get",
"the",
"domain",
"name",
"of",
"the",
"current",
"url",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php#L209-L216 |
230,120 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php | UrlObject.getPath | public function getPath($asStringObject = false)
{
if($asStringObject) {
return $this->str($this->path);
}
return $this->path;
} | php | public function getPath($asStringObject = false)
{
if($asStringObject) {
return $this->str($this->path);
}
return $this->path;
} | [
"public",
"function",
"getPath",
"(",
"$",
"asStringObject",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"asStringObject",
")",
"{",
"return",
"$",
"this",
"->",
"str",
"(",
"$",
"this",
"->",
"path",
")",
";",
"}",
"return",
"$",
"this",
"->",
"path",
... | Get the path from the current url.
@param bool $asStringObject Return instance of StringObject
@return string|StringObject Path from the current instance. | [
"Get",
"the",
"path",
"from",
"the",
"current",
"url",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php#L225-L232 |
230,121 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php | UrlObject.validateUrl | private function validateUrl()
{
$urlData = parse_url($this->val());
if(!$urlData || !$this->isArray($urlData)) {
throw new UrlObjectException(UrlObjectException::MSG_INVALID_URL, [$this->val()]);
}
// extract parts
$urlData = $this->arr($urlData);
// s... | php | private function validateUrl()
{
$urlData = parse_url($this->val());
if(!$urlData || !$this->isArray($urlData)) {
throw new UrlObjectException(UrlObjectException::MSG_INVALID_URL, [$this->val()]);
}
// extract parts
$urlData = $this->arr($urlData);
// s... | [
"private",
"function",
"validateUrl",
"(",
")",
"{",
"$",
"urlData",
"=",
"parse_url",
"(",
"$",
"this",
"->",
"val",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"urlData",
"||",
"!",
"$",
"this",
"->",
"isArray",
"(",
"$",
"urlData",
")",
")",
"{",... | Validates current url and parses data like scheme, host, query, and similar from, it.
@throws UrlObjectException | [
"Validates",
"current",
"url",
"and",
"parses",
"data",
"like",
"scheme",
"host",
"query",
"and",
"similar",
"from",
"it",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php#L268-L295 |
230,122 | Webiny/Framework | src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php | UrlObject.getHeaderResponseString | private function getHeaderResponseString($headerCode)
{
switch ($headerCode) {
case 100:
$text = 'Continue';
break;
case 101:
$text = 'Switching Protocols';
break;
case 200:
$text = 'OK';
... | php | private function getHeaderResponseString($headerCode)
{
switch ($headerCode) {
case 100:
$text = 'Continue';
break;
case 101:
$text = 'Switching Protocols';
break;
case 200:
$text = 'OK';
... | [
"private",
"function",
"getHeaderResponseString",
"(",
"$",
"headerCode",
")",
"{",
"switch",
"(",
"$",
"headerCode",
")",
"{",
"case",
"100",
":",
"$",
"text",
"=",
"'Continue'",
";",
"break",
";",
"case",
"101",
":",
"$",
"text",
"=",
"'Switching Protoco... | Get a string for the given header response code.
@param integer $headerCode Header code.
@return string
@throws UrlObjectException | [
"Get",
"a",
"string",
"for",
"the",
"given",
"header",
"response",
"code",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/StdLib/StdObject/UrlObject/UrlObject.php#L305-L425 |
230,123 | milesj/admin | Lib/Admin.php | Admin.cache | public static function cache($key, Closure $callback) {
if (is_array($key)) {
$key = implode('-', $key);
}
if (isset(self::$_cache[$key])) {
return self::$_cache[$key];
}
self::$_cache[$key] = $callback();
return self::$_cache[$key];
} | php | public static function cache($key, Closure $callback) {
if (is_array($key)) {
$key = implode('-', $key);
}
if (isset(self::$_cache[$key])) {
return self::$_cache[$key];
}
self::$_cache[$key] = $callback();
return self::$_cache[$key];
} | [
"public",
"static",
"function",
"cache",
"(",
"$",
"key",
",",
"Closure",
"$",
"callback",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"$",
"key",
"=",
"implode",
"(",
"'-'",
",",
"$",
"key",
")",
";",
"}",
"if",
"(",
"isse... | Cache the result of the callback into the class.
@param string|array $key
@param callable $callback
@return mixed | [
"Cache",
"the",
"result",
"of",
"the",
"callback",
"into",
"the",
"class",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Lib/Admin.php#L24-L36 |
230,124 | milesj/admin | Lib/Admin.php | Admin.getModels | public static function getModels() {
return self::cache(__METHOD__, function() {
$plugins = array_merge(array(Configure::read('Admin.coreName')), App::objects('plugins'));
$map = array();
foreach ($plugins as $plugin) {
$data = Admin::getPlugin($plugin);
... | php | public static function getModels() {
return self::cache(__METHOD__, function() {
$plugins = array_merge(array(Configure::read('Admin.coreName')), App::objects('plugins'));
$map = array();
foreach ($plugins as $plugin) {
$data = Admin::getPlugin($plugin);
... | [
"public",
"static",
"function",
"getModels",
"(",
")",
"{",
"return",
"self",
"::",
"cache",
"(",
"__METHOD__",
",",
"function",
"(",
")",
"{",
"$",
"plugins",
"=",
"array_merge",
"(",
"array",
"(",
"Configure",
"::",
"read",
"(",
"'Admin.coreName'",
")",
... | Return a list of all models grouped by plugin.
@return array | [
"Return",
"a",
"list",
"of",
"all",
"models",
"grouped",
"by",
"plugin",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Lib/Admin.php#L43-L60 |
230,125 | milesj/admin | Lib/Admin.php | Admin.getPlugin | public static function getPlugin($plugin) {
return self::cache(array(__METHOD__, $plugin), function() use ($plugin) {
$path = null;
if ($plugin !== Configure::read('Admin.coreName')) {
if (!CakePlugin::loaded($plugin)) {
return null;
}... | php | public static function getPlugin($plugin) {
return self::cache(array(__METHOD__, $plugin), function() use ($plugin) {
$path = null;
if ($plugin !== Configure::read('Admin.coreName')) {
if (!CakePlugin::loaded($plugin)) {
return null;
}... | [
"public",
"static",
"function",
"getPlugin",
"(",
"$",
"plugin",
")",
"{",
"return",
"self",
"::",
"cache",
"(",
"array",
"(",
"__METHOD__",
",",
"$",
"plugin",
")",
",",
"function",
"(",
")",
"use",
"(",
"$",
"plugin",
")",
"{",
"$",
"path",
"=",
... | Return meta information on a plugin while also including the model list.
@param string $plugin
@return array | [
"Return",
"meta",
"information",
"on",
"a",
"plugin",
"while",
"also",
"including",
"the",
"model",
"list",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Lib/Admin.php#L68-L87 |
230,126 | milesj/admin | Lib/Admin.php | Admin.getPluginModels | public static function getPluginModels($plugin) {
return self::cache(array(__METHOD__, $plugin), function() use ($plugin) {
$search = 'Model';
$core = Configure::read('Admin.coreName') ?: 'Core';
if ($plugin !== $core) {
$search = $plugin . '.' . $search;
... | php | public static function getPluginModels($plugin) {
return self::cache(array(__METHOD__, $plugin), function() use ($plugin) {
$search = 'Model';
$core = Configure::read('Admin.coreName') ?: 'Core';
if ($plugin !== $core) {
$search = $plugin . '.' . $search;
... | [
"public",
"static",
"function",
"getPluginModels",
"(",
"$",
"plugin",
")",
"{",
"return",
"self",
"::",
"cache",
"(",
"array",
"(",
"__METHOD__",
",",
"$",
"plugin",
")",
",",
"function",
"(",
")",
"use",
"(",
"$",
"plugin",
")",
"{",
"$",
"search",
... | Return a list of all models within a plugin.
@param string $plugin
@return array | [
"Return",
"a",
"list",
"of",
"all",
"models",
"within",
"a",
"plugin",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Lib/Admin.php#L95-L139 |
230,127 | milesj/admin | Lib/Admin.php | Admin.parseName | public static function parseName($model) {
return self::cache(array(__METHOD__, $model), function() use ($model) {
list($plugin, $model) = pluginSplit($model);
$core = Configure::read('Admin.coreName');
if (!$plugin) {
$plugin = $core;
}
... | php | public static function parseName($model) {
return self::cache(array(__METHOD__, $model), function() use ($model) {
list($plugin, $model) = pluginSplit($model);
$core = Configure::read('Admin.coreName');
if (!$plugin) {
$plugin = $core;
}
... | [
"public",
"static",
"function",
"parseName",
"(",
"$",
"model",
")",
"{",
"return",
"self",
"::",
"cache",
"(",
"array",
"(",
"__METHOD__",
",",
"$",
"model",
")",
",",
"function",
"(",
")",
"use",
"(",
"$",
"model",
")",
"{",
"list",
"(",
"$",
"pl... | Parse a model name to extract the plugin and fully qualified name.
@param string $model
@return array | [
"Parse",
"a",
"model",
"name",
"to",
"extract",
"the",
"plugin",
"and",
"fully",
"qualified",
"name",
"."
] | e5e93823d1eb4415f05a3191f653eb50c296d2c6 | https://github.com/milesj/admin/blob/e5e93823d1eb4415f05a3191f653eb50c296d2c6/Lib/Admin.php#L194-L218 |
230,128 | Webiny/Framework | src/Webiny/Component/Router/Route/Route.php | Route.setPath | public function setPath($path)
{
$this->path = '';
$this->realPath = $path;
if(!empty($path)) {
$this->path .= $this->str($path)->trim()->trimLeft('/')->trimRight('/')->val();
}
return $this;
} | php | public function setPath($path)
{
$this->path = '';
$this->realPath = $path;
if(!empty($path)) {
$this->path .= $this->str($path)->trim()->trimLeft('/')->trimRight('/')->val();
}
return $this;
} | [
"public",
"function",
"setPath",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"path",
"=",
"''",
";",
"$",
"this",
"->",
"realPath",
"=",
"$",
"path",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"path",
")",
")",
"{",
"$",
"this",
"->",
"path",
... | Sets the route path.
@param string $path Route path.
@return $this | [
"Sets",
"the",
"route",
"path",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Router/Route/Route.php#L96-L106 |
230,129 | Webiny/Framework | src/Webiny/Component/Router/Route/Route.php | Route.setOptions | public function setOptions(array $options)
{
$this->options = [];
foreach ($options as $k => $v) {
$this->addOption($k, (array)$v);
}
return $this;
} | php | public function setOptions(array $options)
{
$this->options = [];
foreach ($options as $k => $v) {
$this->addOption($k, (array)$v);
}
return $this;
} | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"this",
"->",
"addOption",
"(",
"$",
"k",... | Set route options.
@param array $options An array of options. Each option must have a name and a list of attributes and their values.
Common attributes are 'prefix' and 'default'.
@return $this | [
"Set",
"route",
"options",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Router/Route/Route.php#L161-L170 |
230,130 | Webiny/Framework | src/Webiny/Component/Router/Route/Route.php | Route.addOption | public function addOption($name, array $attributes)
{
$this->options[$name] = new RouteOption($name, $attributes);
return $this;
} | php | public function addOption($name, array $attributes)
{
$this->options[$name] = new RouteOption($name, $attributes);
return $this;
} | [
"public",
"function",
"addOption",
"(",
"$",
"name",
",",
"array",
"$",
"attributes",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"$",
"name",
"]",
"=",
"new",
"RouteOption",
"(",
"$",
"name",
",",
"$",
"attributes",
")",
";",
"return",
"$",
"this",... | Adds a single route option.
@param string $name Name of the parameter to which the option should be attached.
@param array $attributes An array of options.
@return $this | [
"Adds",
"a",
"single",
"route",
"option",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Router/Route/Route.php#L180-L185 |
230,131 | Webiny/Framework | src/Webiny/Component/Router/Route/Route.php | Route.compile | public function compile()
{
if($this->isNull($this->compiledRoute)) {
$this->compiledRoute = RouteCompiler::compile($this);
}
return $this->compiledRoute;
} | php | public function compile()
{
if($this->isNull($this->compiledRoute)) {
$this->compiledRoute = RouteCompiler::compile($this);
}
return $this->compiledRoute;
} | [
"public",
"function",
"compile",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isNull",
"(",
"$",
"this",
"->",
"compiledRoute",
")",
")",
"{",
"$",
"this",
"->",
"compiledRoute",
"=",
"RouteCompiler",
"::",
"compile",
"(",
"$",
"this",
")",
";",
"}"... | Compiles the route object and returns an instance of CompiledRoute.
@return CompiledRoute | [
"Compiles",
"the",
"route",
"object",
"and",
"returns",
"an",
"instance",
"of",
"CompiledRoute",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Router/Route/Route.php#L313-L320 |
230,132 | themsaid/katana-core | src/Katana.php | Katana.registerCommands | protected function registerCommands()
{
$this->application->addCommands([
new BuildCommand($this->viewFactory, $this->filesystem),
new PostCommand($this->viewFactory, $this->filesystem)
]);
} | php | protected function registerCommands()
{
$this->application->addCommands([
new BuildCommand($this->viewFactory, $this->filesystem),
new PostCommand($this->viewFactory, $this->filesystem)
]);
} | [
"protected",
"function",
"registerCommands",
"(",
")",
"{",
"$",
"this",
"->",
"application",
"->",
"addCommands",
"(",
"[",
"new",
"BuildCommand",
"(",
"$",
"this",
"->",
"viewFactory",
",",
"$",
"this",
"->",
"filesystem",
")",
",",
"new",
"PostCommand",
... | Register application commands.
@return void | [
"Register",
"application",
"commands",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/Katana.php#L72-L78 |
230,133 | themsaid/katana-core | src/Katana.php | Katana.createViewFactory | protected function createViewFactory()
{
$resolver = new EngineResolver();
$bladeCompiler = $this->createBladeCompiler();
$resolver->register('blade', function () use ($bladeCompiler) {
return new CompilerEngine($bladeCompiler);
});
$dispatcher = new Dispatcher... | php | protected function createViewFactory()
{
$resolver = new EngineResolver();
$bladeCompiler = $this->createBladeCompiler();
$resolver->register('blade', function () use ($bladeCompiler) {
return new CompilerEngine($bladeCompiler);
});
$dispatcher = new Dispatcher... | [
"protected",
"function",
"createViewFactory",
"(",
")",
"{",
"$",
"resolver",
"=",
"new",
"EngineResolver",
"(",
")",
";",
"$",
"bladeCompiler",
"=",
"$",
"this",
"->",
"createBladeCompiler",
"(",
")",
";",
"$",
"resolver",
"->",
"register",
"(",
"'blade'",
... | Create the view factory with a Blade Compiler.
@return Factory | [
"Create",
"the",
"view",
"factory",
"with",
"a",
"Blade",
"Compiler",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/Katana.php#L85-L111 |
230,134 | themsaid/katana-core | src/Katana.php | Katana.createBladeCompiler | protected function createBladeCompiler()
{
if (! $this->filesystem->isDirectory(KATANA_CACHE_DIR)) {
$this->filesystem->makeDirectory(KATANA_CACHE_DIR);
}
$blade = new Blade(
new BladeCompiler($this->filesystem, KATANA_CACHE_DIR)
);
return $blade->ge... | php | protected function createBladeCompiler()
{
if (! $this->filesystem->isDirectory(KATANA_CACHE_DIR)) {
$this->filesystem->makeDirectory(KATANA_CACHE_DIR);
}
$blade = new Blade(
new BladeCompiler($this->filesystem, KATANA_CACHE_DIR)
);
return $blade->ge... | [
"protected",
"function",
"createBladeCompiler",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filesystem",
"->",
"isDirectory",
"(",
"KATANA_CACHE_DIR",
")",
")",
"{",
"$",
"this",
"->",
"filesystem",
"->",
"makeDirectory",
"(",
"KATANA_CACHE_DIR",
")",
... | Create the Blade Compiler instance.
@return BladeCompiler | [
"Create",
"the",
"Blade",
"Compiler",
"instance",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/Katana.php#L118-L129 |
230,135 | Webiny/Framework | src/Webiny/Component/Config/Drivers/AbstractDriver.php | AbstractDriver.getString | final public function getString()
{
$res = $this->getStringInternal();
if (!$this->isString($res) && !$this->isStringObject($res)) {
throw new ConfigException('AbstractDriver method _getString() must return string or StringObject.');
}
return StdObjectWrapper::toString($... | php | final public function getString()
{
$res = $this->getStringInternal();
if (!$this->isString($res) && !$this->isStringObject($res)) {
throw new ConfigException('AbstractDriver method _getString() must return string or StringObject.');
}
return StdObjectWrapper::toString($... | [
"final",
"public",
"function",
"getString",
"(",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"getStringInternal",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isString",
"(",
"$",
"res",
")",
"&&",
"!",
"$",
"this",
"->",
"isStringObject",
... | Get formatted config data as string
@throws ConfigException
@return string Formatted config data | [
"Get",
"formatted",
"config",
"data",
"as",
"string"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Config/Drivers/AbstractDriver.php#L98-L106 |
230,136 | Webiny/Framework | src/Webiny/Component/Config/Drivers/AbstractDriver.php | AbstractDriver.getArray | final public function getArray()
{
$res = $this->getArrayInternal();
if (!$this->isArray($res) && !$this->isArrayObject($res)) {
$errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';
$errorMessage .= ' Make sure you have provided a valid confi... | php | final public function getArray()
{
$res = $this->getArrayInternal();
if (!$this->isArray($res) && !$this->isArrayObject($res)) {
$errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';
$errorMessage .= ' Make sure you have provided a valid confi... | [
"final",
"public",
"function",
"getArray",
"(",
")",
"{",
"$",
"res",
"=",
"$",
"this",
"->",
"getArrayInternal",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isArray",
"(",
"$",
"res",
")",
"&&",
"!",
"$",
"this",
"->",
"isArrayObject",
"(",... | Get config data as array
@throws ConfigException
@return array Parsed resource data array | [
"Get",
"config",
"data",
"as",
"array"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Config/Drivers/AbstractDriver.php#L114-L124 |
230,137 | Webiny/Framework | src/Webiny/Component/Crypt/Bridge/Crypt.php | Crypt.getInstance | static function getInstance()
{
$driver = static::getLibrary();
try {
$instance = new $driver();
} catch (\Exception $e) {
throw new Exception('Unable to create an instance of ' . $driver);
}
if (!self::isInstanceOf($instance, CryptInterface::class))... | php | static function getInstance()
{
$driver = static::getLibrary();
try {
$instance = new $driver();
} catch (\Exception $e) {
throw new Exception('Unable to create an instance of ' . $driver);
}
if (!self::isInstanceOf($instance, CryptInterface::class))... | [
"static",
"function",
"getInstance",
"(",
")",
"{",
"$",
"driver",
"=",
"static",
"::",
"getLibrary",
"(",
")",
";",
"try",
"{",
"$",
"instance",
"=",
"new",
"$",
"driver",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
... | Create an instance of a crypt driver.
@throws \Webiny\Component\StdLib\Exception\Exception
@return CryptInterface | [
"Create",
"an",
"instance",
"of",
"a",
"crypt",
"driver",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Crypt/Bridge/Crypt.php#L57-L72 |
230,138 | khepin/KhepinYamlFixturesBundle | Fixture/AbstractFixture.php | AbstractFixture.hasTag | public function hasTag(Array $tags)
{
// if no tags were specified, the fixture should always be loaded
if (count($this->tags) == 0 || count(array_intersect($this->tags, $tags)) > 0) {
return true;
}
return false;
} | php | public function hasTag(Array $tags)
{
// if no tags were specified, the fixture should always be loaded
if (count($this->tags) == 0 || count(array_intersect($this->tags, $tags)) > 0) {
return true;
}
return false;
} | [
"public",
"function",
"hasTag",
"(",
"Array",
"$",
"tags",
")",
"{",
"// if no tags were specified, the fixture should always be loaded",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"tags",
")",
"==",
"0",
"||",
"count",
"(",
"array_intersect",
"(",
"$",
"this",... | Returns if the given tag is set for the current fixture
@param type $tag
@return boolean | [
"Returns",
"if",
"the",
"given",
"tag",
"is",
"set",
"for",
"the",
"current",
"fixture"
] | 4f1947b03809421057e7b8a3553ccaa93423d192 | https://github.com/khepin/KhepinYamlFixturesBundle/blob/4f1947b03809421057e7b8a3553ccaa93423d192/Fixture/AbstractFixture.php#L31-L39 |
230,139 | khepin/KhepinYamlFixturesBundle | Fixture/AbstractFixture.php | AbstractFixture.constructorArgs | public function constructorArgs($arguments)
{
$constructArguments = array();
if (is_array($arguments)) {
foreach ($arguments as $argument) {
if (is_array($argument)) {
if ($argument['type'] == 'datetime') {
$constructArguments[... | php | public function constructorArgs($arguments)
{
$constructArguments = array();
if (is_array($arguments)) {
foreach ($arguments as $argument) {
if (is_array($argument)) {
if ($argument['type'] == 'datetime') {
$constructArguments[... | [
"public",
"function",
"constructorArgs",
"(",
"$",
"arguments",
")",
"{",
"$",
"constructArguments",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"arguments",
")",
")",
"{",
"foreach",
"(",
"$",
"arguments",
"as",
"$",
"argument",
")",
... | Extract the constructor arguments
@param array $arguments
@return mixed | [
"Extract",
"the",
"constructor",
"arguments"
] | 4f1947b03809421057e7b8a3553ccaa93423d192 | https://github.com/khepin/KhepinYamlFixturesBundle/blob/4f1947b03809421057e7b8a3553ccaa93423d192/Fixture/AbstractFixture.php#L110-L133 |
230,140 | khepin/KhepinYamlFixturesBundle | Fixture/AbstractFixture.php | AbstractFixture.makeInstance | public function makeInstance($class, $data)
{
$class = new \ReflectionClass($class);
$constructArguments = [];
if (isset($data['__construct'])) {
$constructArguments = $this->constructorArgs($data['__construct']);
}
return $class->newInstanceArgs($constructArgume... | php | public function makeInstance($class, $data)
{
$class = new \ReflectionClass($class);
$constructArguments = [];
if (isset($data['__construct'])) {
$constructArguments = $this->constructorArgs($data['__construct']);
}
return $class->newInstanceArgs($constructArgume... | [
"public",
"function",
"makeInstance",
"(",
"$",
"class",
",",
"$",
"data",
")",
"{",
"$",
"class",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"constructArguments",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
... | Creates an instance with any given constructor args
@param string $class
@param array $data
@return void | [
"Creates",
"an",
"instance",
"with",
"any",
"given",
"constructor",
"args"
] | 4f1947b03809421057e7b8a3553ccaa93423d192 | https://github.com/khepin/KhepinYamlFixturesBundle/blob/4f1947b03809421057e7b8a3553ccaa93423d192/Fixture/AbstractFixture.php#L142-L151 |
230,141 | Webiny/Framework | src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php | Application.getWebPath | public function getWebPath()
{
$webPath = $this->environment->getCurrentEnvironmentConfig()->get('Domain', false);
if (!$webPath) {
$webPath = Request::getInstance()->getCurrentUrl(true)->getDomain() . '/';
}
return $webPath;
} | php | public function getWebPath()
{
$webPath = $this->environment->getCurrentEnvironmentConfig()->get('Domain', false);
if (!$webPath) {
$webPath = Request::getInstance()->getCurrentUrl(true)->getDomain() . '/';
}
return $webPath;
} | [
"public",
"function",
"getWebPath",
"(",
")",
"{",
"$",
"webPath",
"=",
"$",
"this",
"->",
"environment",
"->",
"getCurrentEnvironmentConfig",
"(",
")",
"->",
"get",
"(",
"'Domain'",
",",
"false",
")",
";",
"if",
"(",
"!",
"$",
"webPath",
")",
"{",
"$"... | Get application web path.
@return string | [
"Get",
"application",
"web",
"path",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php#L69-L77 |
230,142 | Webiny/Framework | src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php | Application.showErrors | public function showErrors()
{
$reporting = $this->getEnvironmentConfig('ErrorReporting', false);
if ($reporting && strtolower($reporting) == 'on') {
return true;
}
return false;
} | php | public function showErrors()
{
$reporting = $this->getEnvironmentConfig('ErrorReporting', false);
if ($reporting && strtolower($reporting) == 'on') {
return true;
}
return false;
} | [
"public",
"function",
"showErrors",
"(",
")",
"{",
"$",
"reporting",
"=",
"$",
"this",
"->",
"getEnvironmentConfig",
"(",
"'ErrorReporting'",
",",
"false",
")",
";",
"if",
"(",
"$",
"reporting",
"&&",
"strtolower",
"(",
"$",
"reporting",
")",
"==",
"'on'",... | Based on the current environment configuration, should system errors be shown or not.
@return bool | [
"Based",
"on",
"the",
"current",
"environment",
"configuration",
"should",
"system",
"errors",
"be",
"shown",
"or",
"not",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php#L105-L113 |
230,143 | Webiny/Framework | src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php | Application.getEnvironmentConfig | public function getEnvironmentConfig($query = '', $default = null)
{
if ($query == '') {
return $this->environment->getCurrentEnvironmentConfig();
} else {
return $this->environment->getCurrentEnvironmentConfig()->get($query, $default);
}
} | php | public function getEnvironmentConfig($query = '', $default = null)
{
if ($query == '') {
return $this->environment->getCurrentEnvironmentConfig();
} else {
return $this->environment->getCurrentEnvironmentConfig()->get($query, $default);
}
} | [
"public",
"function",
"getEnvironmentConfig",
"(",
"$",
"query",
"=",
"''",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"query",
"==",
"''",
")",
"{",
"return",
"$",
"this",
"->",
"environment",
"->",
"getCurrentEnvironmentConfig",
"(",
"... | Returns the current environment configuration.
@param string $query Query inside the environment configuration.
@param null $default Default value which should be returned if query has no matches.
@return mixed|ConfigObject | [
"Returns",
"the",
"current",
"environment",
"configuration",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php#L140-L147 |
230,144 | Webiny/Framework | src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php | Application.httpResponse | public function httpResponse()
{
// get the template
$template = $this->view()->getTemplate();
// if there is no template, then we return false
if(empty($template)) {
return false;
}
// get view data
$viewData = $this->view()->getAssignedData();
... | php | public function httpResponse()
{
// get the template
$template = $this->view()->getTemplate();
// if there is no template, then we return false
if(empty($template)) {
return false;
}
// get view data
$viewData = $this->view()->getAssignedData();
... | [
"public",
"function",
"httpResponse",
"(",
")",
"{",
"// get the template",
"$",
"template",
"=",
"$",
"this",
"->",
"view",
"(",
")",
"->",
"getTemplate",
"(",
")",
";",
"// if there is no template, then we return false",
"if",
"(",
"empty",
"(",
"$",
"template... | Send the http response to the browser.
This method is called automatically by the Dispatcher.
@return Response|bool
@throws \Exception
@throws \Webiny\Component\TemplateEngine\Bridge\TemplateEngineException | [
"Send",
"the",
"http",
"response",
"to",
"the",
"browser",
".",
"This",
"method",
"is",
"called",
"automatically",
"by",
"the",
"Dispatcher",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php#L191-L215 |
230,145 | Webiny/Framework | src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php | Application.getTemplateEngineInstance | private function getTemplateEngineInstance()
{
$teConfig = $this->getComponentConfig('TemplateEngine', 'Engines', false);
// fallback to default template engine
if (!$teConfig) {
$defaultTemplateEngineConfig = [
'Engines' => [
'Smarty' => [
... | php | private function getTemplateEngineInstance()
{
$teConfig = $this->getComponentConfig('TemplateEngine', 'Engines', false);
// fallback to default template engine
if (!$teConfig) {
$defaultTemplateEngineConfig = [
'Engines' => [
'Smarty' => [
... | [
"private",
"function",
"getTemplateEngineInstance",
"(",
")",
"{",
"$",
"teConfig",
"=",
"$",
"this",
"->",
"getComponentConfig",
"(",
"'TemplateEngine'",
",",
"'Engines'",
",",
"false",
")",
";",
"// fallback to default template engine",
"if",
"(",
"!",
"$",
"teC... | Returns template engine instance, based on current configuration.
If a template engine is not defined, a default template engine instance will be created.
@return \Webiny\Component\TemplateEngine\Bridge\TemplateEngineInterface
@throws \Exception
@throws \Webiny\Component\StdLib\Exception\Exception
@throws \Webiny\Comp... | [
"Returns",
"template",
"engine",
"instance",
"based",
"on",
"current",
"configuration",
".",
"If",
"a",
"template",
"engine",
"is",
"not",
"defined",
"a",
"default",
"template",
"engine",
"instance",
"will",
"be",
"created",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Bootstrap/ApplicationClasses/Application.php#L226-L254 |
230,146 | Webiny/Framework | src/Webiny/Component/Annotations/Bridge/Loader.php | Loader.getInstance | public static function getInstance()
{
$driver = static::getLibrary();
try {
$instance = self::factory($driver, AnnotationsInterface::class);
} catch (\Exception $e) {
throw new AnnotationsException($e->getMessage());
}
return $instance;
} | php | public static function getInstance()
{
$driver = static::getLibrary();
try {
$instance = self::factory($driver, AnnotationsInterface::class);
} catch (\Exception $e) {
throw new AnnotationsException($e->getMessage());
}
return $instance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
")",
"{",
"$",
"driver",
"=",
"static",
"::",
"getLibrary",
"(",
")",
";",
"try",
"{",
"$",
"instance",
"=",
"self",
"::",
"factory",
"(",
"$",
"driver",
",",
"AnnotationsInterface",
"::",
"class",
")",... | Create an instance of a annotations driver.
@throws AnnotationsException
@return AnnotationsInterface | [
"Create",
"an",
"instance",
"of",
"a",
"annotations",
"driver",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Annotations/Bridge/Loader.php#L57-L68 |
230,147 | ZenMagick/ZenCart | includes/modules/payment/paypaldp.php | paypaldp.update_status | function update_status() {
global $order, $db;
// $this->zcLog('update_status', 'Checking whether module should be enabled or not.');
// if store is not running in SSL, cannot offer credit card module, for PCI reasons
if (!defined('ENABLE_SSL') || ENABLE_SSL != 'true') {
$this->enabled = FALSE;
... | php | function update_status() {
global $order, $db;
// $this->zcLog('update_status', 'Checking whether module should be enabled or not.');
// if store is not running in SSL, cannot offer credit card module, for PCI reasons
if (!defined('ENABLE_SSL') || ENABLE_SSL != 'true') {
$this->enabled = FALSE;
... | [
"function",
"update_status",
"(",
")",
"{",
"global",
"$",
"order",
",",
"$",
"db",
";",
"// $this->zcLog('update_status', 'Checking whether module should be enabled or not.');",
"// if store is not running in SSL, cannot offer credit card module, for PCI reasons",
"if",
"(",
"!",... | Sets payment module status based on zone restrictions etc | [
"Sets",
"payment",
"module",
"status",
"based",
"on",
"zone",
"restrictions",
"etc"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/paypaldp.php#L195-L241 |
230,148 | ZenMagick/ZenCart | includes/modules/payment/paypaldp.php | paypaldp.confirmation | function confirmation() {
$confirmation = array('title' => '',
'fields' => array(array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_FIRSTNAME,
'field' => $_POST['paypalwpp_cc_firstname']),
... | php | function confirmation() {
$confirmation = array('title' => '',
'fields' => array(array('title' => MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_FIRSTNAME,
'field' => $_POST['paypalwpp_cc_firstname']),
... | [
"function",
"confirmation",
"(",
")",
"{",
"$",
"confirmation",
"=",
"array",
"(",
"'title'",
"=>",
"''",
",",
"'fields'",
"=>",
"array",
"(",
"array",
"(",
"'title'",
"=>",
"MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_FIRSTNAME",
",",
"'field'",
"=>",
"$",
"_POST"... | Display Credit Card Information for review on the Checkout Confirmation Page | [
"Display",
"Credit",
"Card",
"Information",
"for",
"review",
"on",
"the",
"Checkout",
"Confirmation",
"Page"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/paypaldp.php#L523-L550 |
230,149 | ZenMagick/ZenCart | includes/modules/payment/paypaldp.php | paypaldp.process_button | function process_button() {
global $order;
$_SESSION['paypal_ec_markflow'] = 1;
$process_button_string = '';
$process_button_string .= "\n" . zen_draw_hidden_field('wpp_cc_type', $_POST['paypalwpp_cc_type']) . "\n" .
zen_draw_hidden_field('wpp_cc_expdate_month', $_POST['paypalwpp_cc_expires_mont... | php | function process_button() {
global $order;
$_SESSION['paypal_ec_markflow'] = 1;
$process_button_string = '';
$process_button_string .= "\n" . zen_draw_hidden_field('wpp_cc_type', $_POST['paypalwpp_cc_type']) . "\n" .
zen_draw_hidden_field('wpp_cc_expdate_month', $_POST['paypalwpp_cc_expires_mont... | [
"function",
"process_button",
"(",
")",
"{",
"global",
"$",
"order",
";",
"$",
"_SESSION",
"[",
"'paypal_ec_markflow'",
"]",
"=",
"1",
";",
"$",
"process_button_string",
"=",
"''",
";",
"$",
"process_button_string",
".=",
"\"\\n\"",
".",
"zen_draw_hidden_field",... | Prepare the hidden fields comprising the parameters for the Submit button on the checkout confirmation page | [
"Prepare",
"the",
"hidden",
"fields",
"comprising",
"the",
"parameters",
"for",
"the",
"Submit",
"button",
"on",
"the",
"checkout",
"confirmation",
"page"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/paypaldp.php#L554-L570 |
230,150 | ZenMagick/ZenCart | includes/modules/payment/paypaldp.php | paypaldp._doVoid | function _doVoid($oID, $note = '') {
global $db, $doPayPal, $messageStack;
$new_order_status = (int)MODULE_PAYMENT_PAYPALDP_REFUNDED_STATUS_ID;
$doPayPal = $this->paypal_init();
$voidNote = strip_tags(zen_db_input($_POST['voidnote']));
$voidAuthID = trim(strip_tags(zen_db_input($_POST['voidauthid'])... | php | function _doVoid($oID, $note = '') {
global $db, $doPayPal, $messageStack;
$new_order_status = (int)MODULE_PAYMENT_PAYPALDP_REFUNDED_STATUS_ID;
$doPayPal = $this->paypal_init();
$voidNote = strip_tags(zen_db_input($_POST['voidnote']));
$voidAuthID = trim(strip_tags(zen_db_input($_POST['voidauthid'])... | [
"function",
"_doVoid",
"(",
"$",
"oID",
",",
"$",
"note",
"=",
"''",
")",
"{",
"global",
"$",
"db",
",",
"$",
"doPayPal",
",",
"$",
"messageStack",
";",
"$",
"new_order_status",
"=",
"(",
"int",
")",
"MODULE_PAYMENT_PAYPALDP_REFUNDED_STATUS_ID",
";",
"$",
... | Used to void a given previously-authorized transaction. FOR FUTURE USE. | [
"Used",
"to",
"void",
"a",
"given",
"previously",
"-",
"authorized",
"transaction",
".",
"FOR",
"FUTURE",
"USE",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/paypaldp.php#L1309-L1352 |
230,151 | ZenMagick/ZenCart | includes/modules/payment/paypaldp.php | paypaldp.clear_3DSecure_session_vars | function clear_3DSecure_session_vars($thorough = FALSE) {
if ($thorough) {
if (isset($_SESSION['3Dsecure_requires_lookup'])) unset($_SESSION['3Dsecure_requires_lookup']);
if (isset($_SESSION['3Dsecure_card_type'])) unset($_SESSION['3Dsecure_card_type']);
}
if (isset($_SESSION['3Dsecure_merchantD... | php | function clear_3DSecure_session_vars($thorough = FALSE) {
if ($thorough) {
if (isset($_SESSION['3Dsecure_requires_lookup'])) unset($_SESSION['3Dsecure_requires_lookup']);
if (isset($_SESSION['3Dsecure_card_type'])) unset($_SESSION['3Dsecure_card_type']);
}
if (isset($_SESSION['3Dsecure_merchantD... | [
"function",
"clear_3DSecure_session_vars",
"(",
"$",
"thorough",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"thorough",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"'3Dsecure_requires_lookup'",
"]",
")",
")",
"unset",
"(",
"$",
"_SESSION",
"[",
... | reset session vars related to 3D-Secure processing | [
"reset",
"session",
"vars",
"related",
"to",
"3D",
"-",
"Secure",
"processing"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/paypaldp.php#L2030-L2049 |
230,152 | ZenMagick/ZenCart | includes/modules/payment/paypaldp.php | paypaldp.getISOCurrency | function getISOCurrency($curr) {
$out = "";
if(ctype_digit($curr) || is_int($curr)) {
$numCurr = $curr + 0;
if($numCurr < 10) {
$out = "00" . $numCurr;
} else if ($numCurr < 100) {
$out = "0" . $numCurr;
} else {
//Assume 3 digits (if greater let MAPs handle error... | php | function getISOCurrency($curr) {
$out = "";
if(ctype_digit($curr) || is_int($curr)) {
$numCurr = $curr + 0;
if($numCurr < 10) {
$out = "00" . $numCurr;
} else if ($numCurr < 100) {
$out = "0" . $numCurr;
} else {
//Assume 3 digits (if greater let MAPs handle error... | [
"function",
"getISOCurrency",
"(",
"$",
"curr",
")",
"{",
"$",
"out",
"=",
"\"\"",
";",
"if",
"(",
"ctype_digit",
"(",
"$",
"curr",
")",
"||",
"is_int",
"(",
"$",
"curr",
")",
")",
"{",
"$",
"numCurr",
"=",
"$",
"curr",
"+",
"0",
";",
"if",
"("... | MAPs will return the appropriate error code. | [
"MAPs",
"will",
"return",
"the",
"appropriate",
"error",
"code",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/paypaldp.php#L2403-L2437 |
230,153 | ZenMagick/ZenCart | includes/modules/payment/paypaldp.php | paypaldp.formatRawAmount | function formatRawAmount($amount, $curr) {
$dblAmount = $amount + 0.0;
// Build Currency format table
$curFormat = Array();
$curFormat["036"]=2;
$curFormat["124"]=2;
$curFormat["203"]=2;
$curFormat["208"]=2;
$curFormat["348"]=2;
$curFormat["392"]=0;
$curFormat["554"]=2;
$cur... | php | function formatRawAmount($amount, $curr) {
$dblAmount = $amount + 0.0;
// Build Currency format table
$curFormat = Array();
$curFormat["036"]=2;
$curFormat["124"]=2;
$curFormat["203"]=2;
$curFormat["208"]=2;
$curFormat["348"]=2;
$curFormat["392"]=0;
$curFormat["554"]=2;
$cur... | [
"function",
"formatRawAmount",
"(",
"$",
"amount",
",",
"$",
"curr",
")",
"{",
"$",
"dblAmount",
"=",
"$",
"amount",
"+",
"0.0",
";",
"// Build Currency format table",
"$",
"curFormat",
"=",
"Array",
"(",
")",
";",
"$",
"curFormat",
"[",
"\"036\"",
"]",
... | curr - ISO4217 Currency code, 3char or 3digit | [
"curr",
"-",
"ISO4217",
"Currency",
"code",
"3char",
"or",
"3digit"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/modules/payment/paypaldp.php#L2444-L2490 |
230,154 | addiks/phpsql | src/Addiks/PHPSQL/Table/TableSchema.php | TableSchema.getCellPositionInPage | public function getCellPositionInPage($columnId)
{
if (count($this->columnPositionCache)<=0) {
$this->getRowPageSize();
}
if (!isset($this->columnPositionCache[$columnId])) {
throw new ErrorException("Tableschema has no column at index {$columnId}!");
}
... | php | public function getCellPositionInPage($columnId)
{
if (count($this->columnPositionCache)<=0) {
$this->getRowPageSize();
}
if (!isset($this->columnPositionCache[$columnId])) {
throw new ErrorException("Tableschema has no column at index {$columnId}!");
}
... | [
"public",
"function",
"getCellPositionInPage",
"(",
"$",
"columnId",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"columnPositionCache",
")",
"<=",
"0",
")",
"{",
"$",
"this",
"->",
"getRowPageSize",
"(",
")",
";",
"}",
"if",
"(",
"!",
"isset"... | Gets the position in a row-page-data where a cell for a given column starts.
@param string | [
"Gets",
"the",
"position",
"in",
"a",
"row",
"-",
"page",
"-",
"data",
"where",
"a",
"cell",
"for",
"a",
"given",
"column",
"starts",
"."
] | 28dae64ffc2123f39f801a50ab53bfe29890cbd9 | https://github.com/addiks/phpsql/blob/28dae64ffc2123f39f801a50ab53bfe29890cbd9/src/Addiks/PHPSQL/Table/TableSchema.php#L476-L488 |
230,155 | deanblackborough/zf3-view-helpers | src/Bootstrap3Label.php | Bootstrap3Label.setStyle | public function setStyle(string $style): Bootstrap3Label
{
if (in_array($style, $this->supported_styles) === true) {
$this->style = $style;
} else {
$this->style = 'default';
}
return $this;
} | php | public function setStyle(string $style): Bootstrap3Label
{
if (in_array($style, $this->supported_styles) === true) {
$this->style = $style;
} else {
$this->style = 'default';
}
return $this;
} | [
"public",
"function",
"setStyle",
"(",
"string",
"$",
"style",
")",
":",
"Bootstrap3Label",
"{",
"if",
"(",
"in_array",
"(",
"$",
"style",
",",
"$",
"this",
"->",
"supported_styles",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"style",
"=",
"$",
... | Set the style for the badge, one of the following, default, primary, success,
info, warning or danger. If an incorrect style is passed in we set the style to
label-default
@param string $style
@return Bootstrap3Label | [
"Set",
"the",
"style",
"for",
"the",
"badge",
"one",
"of",
"the",
"following",
"default",
"primary",
"success",
"info",
"warning",
"or",
"danger",
".",
"If",
"an",
"incorrect",
"style",
"is",
"passed",
"in",
"we",
"set",
"the",
"style",
"to",
"label",
"-... | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap3Label.php#L65-L74 |
230,156 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.sanitizeDirectoryName | protected function sanitizeDirectoryName($name, $keep_leading_slash = FALSE) {
if (!$keep_leading_slash) {
$name = ltrim($name, '/\\');
}
return rtrim($name, '/\\') . '/';
} | php | protected function sanitizeDirectoryName($name, $keep_leading_slash = FALSE) {
if (!$keep_leading_slash) {
$name = ltrim($name, '/\\');
}
return rtrim($name, '/\\') . '/';
} | [
"protected",
"function",
"sanitizeDirectoryName",
"(",
"$",
"name",
",",
"$",
"keep_leading_slash",
"=",
"FALSE",
")",
"{",
"if",
"(",
"!",
"$",
"keep_leading_slash",
")",
"{",
"$",
"name",
"=",
"ltrim",
"(",
"$",
"name",
",",
"'/\\\\'",
")",
";",
"}",
... | Cleanup paths so that they all have a trailing slash, and
optional leading slash
@param $name string
The path to sanitize
@param $keep_leading_slash bool
TRUE to keep the leading /, otherwise FALSE
@return string
The sanitized path | [
"Cleanup",
"paths",
"so",
"that",
"they",
"all",
"have",
"a",
"trailing",
"slash",
"and",
"optional",
"leading",
"slash"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L149-L155 |
230,157 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.get | public function get($file, $preset, $args = NULL) {
$this->file = $file;
if (!$this->setFilename()) {
return $this->image_element_empty();
}
if (!$this->setPreset($preset)) {
return $this->image_element_empty();
}
$this->setupArguments($args);
if (!$this->image_exists()) {
... | php | public function get($file, $preset, $args = NULL) {
$this->file = $file;
if (!$this->setFilename()) {
return $this->image_element_empty();
}
if (!$this->setPreset($preset)) {
return $this->image_element_empty();
}
$this->setupArguments($args);
if (!$this->image_exists()) {
... | [
"public",
"function",
"get",
"(",
"$",
"file",
",",
"$",
"preset",
",",
"$",
"args",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"file",
"=",
"$",
"file",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"setFilename",
"(",
")",
")",
"{",
"return",
"$",
... | Called by script to get the image information, performs all required steps
@param $file mixed
Object/array/string to check for a filename
@param $preset string
The name of the preset, must be one of the presets in config/presets.php
@return array
Containing the cached image src, img, and others | [
"Called",
"by",
"script",
"to",
"get",
"the",
"image",
"information",
"performs",
"all",
"required",
"steps"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L169-L199 |
230,158 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.get_original | public function get_original($file, $args = NULL) {
$this->file = $file;
if (!$this->setFilename()) {
return $this->image_element_empty();
}
$this->setupArguments($args);
return $this->image_element_original();
} | php | public function get_original($file, $args = NULL) {
$this->file = $file;
if (!$this->setFilename()) {
return $this->image_element_empty();
}
$this->setupArguments($args);
return $this->image_element_original();
} | [
"public",
"function",
"get_original",
"(",
"$",
"file",
",",
"$",
"args",
"=",
"NULL",
")",
"{",
"$",
"this",
"->",
"file",
"=",
"$",
"file",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"setFilename",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Get the imagecache array for an empty image
@param $file mixed
Object/array/string to check for a filename
@return array
An array containing to different image setups | [
"Get",
"the",
"imagecache",
"array",
"for",
"an",
"empty",
"image"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L210-L220 |
230,159 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.setPreset | protected function setPreset($preset) {
if (!$this->validate_preset($preset)) {
return FALSE;
}
$presets = $this->get_presets();
$this->preset = (object) $presets[$preset];
$this->preset->name = $preset;
return TRUE;
} | php | protected function setPreset($preset) {
if (!$this->validate_preset($preset)) {
return FALSE;
}
$presets = $this->get_presets();
$this->preset = (object) $presets[$preset];
$this->preset->name = $preset;
return TRUE;
} | [
"protected",
"function",
"setPreset",
"(",
"$",
"preset",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validate_preset",
"(",
"$",
"preset",
")",
")",
"{",
"return",
"FALSE",
";",
"}",
"$",
"presets",
"=",
"$",
"this",
"->",
"get_presets",
"(",
")",... | Extract preset information from config file according to that chosen by the user
@param string $preset
The preset string
@return bool | [
"Extract",
"preset",
"information",
"from",
"config",
"file",
"according",
"to",
"that",
"chosen",
"by",
"the",
"user"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L230-L240 |
230,160 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.setFilename | protected function setFilename() {
if (is_object($this->file)) {
if (!isset($this->file->{$this->filename_field})) {
return FALSE;
}
$this->file_name = $this->file->{$this->filename_field};
return TRUE;
}
if (is_array($this->file)) {
$this->file_name = $field[$this->f... | php | protected function setFilename() {
if (is_object($this->file)) {
if (!isset($this->file->{$this->filename_field})) {
return FALSE;
}
$this->file_name = $this->file->{$this->filename_field};
return TRUE;
}
if (is_array($this->file)) {
$this->file_name = $field[$this->f... | [
"protected",
"function",
"setFilename",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"file",
"->",
"{",
"$",
"this",
"->",
"filename_field",
"}",
")",
")",
... | Take the passed file and check it to retrieve a filename
@return bool
TRUE if $this->filename set, otherwise FALSE | [
"Take",
"the",
"passed",
"file",
"and",
"check",
"it",
"to",
"retrieve",
"a",
"filename"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L248-L269 |
230,161 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.setupArguments | protected function setupArguments($args) {
$this->upload_path = (isset($args['base_dir']) ? $args['base_dir'] : $this->public_path . $this->upload_uri);
$this->class = (isset($args['class']) ? $args['class'] : NULL);
$this->alt = isset($args['alt']) ? $args['alt'] : $this->parseAlt();
$this->title = iss... | php | protected function setupArguments($args) {
$this->upload_path = (isset($args['base_dir']) ? $args['base_dir'] : $this->public_path . $this->upload_uri);
$this->class = (isset($args['class']) ? $args['class'] : NULL);
$this->alt = isset($args['alt']) ? $args['alt'] : $this->parseAlt();
$this->title = iss... | [
"protected",
"function",
"setupArguments",
"(",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"upload_path",
"=",
"(",
"isset",
"(",
"$",
"args",
"[",
"'base_dir'",
"]",
")",
"?",
"$",
"args",
"[",
"'base_dir'",
"]",
":",
"$",
"this",
"->",
"public_path",
... | Parse the passed arguments and set the instance variables
@param $args array
An array of optional parameters as a key => value pair
@return void | [
"Parse",
"the",
"passed",
"arguments",
"and",
"set",
"the",
"instance",
"variables"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L279-L284 |
230,162 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.parseAlt | protected function parseAlt() {
if (is_object($this->file)) {
if (isset($this->file->alt)) {
return $this->file->alt;
}
}
if (is_array($this->file)) {
if (isset($this->file['alt'])) {
return $this->file['alt'];
}
}
return '';
} | php | protected function parseAlt() {
if (is_object($this->file)) {
if (isset($this->file->alt)) {
return $this->file->alt;
}
}
if (is_array($this->file)) {
if (isset($this->file['alt'])) {
return $this->file['alt'];
}
}
return '';
} | [
"protected",
"function",
"parseAlt",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"file",
"->",
"alt",
")",
")",
"{",
"return",
"$",
"this",
"->",
"file",
"->",
... | If the file received is an object or array, check if the 'alt' field is set
@return string | [
"If",
"the",
"file",
"received",
"is",
"an",
"object",
"or",
"array",
"check",
"if",
"the",
"alt",
"field",
"is",
"set"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L291-L305 |
230,163 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.parseTitle | protected function parseTitle() {
if (is_object($this->file)) {
if (isset($this->file->title)) {
return $this->file->title;
}
}
if (is_array($this->file)) {
if (isset($this->file['title'])) {
return $this->file['title'];
}
}
return '';
} | php | protected function parseTitle() {
if (is_object($this->file)) {
if (isset($this->file->title)) {
return $this->file->title;
}
}
if (is_array($this->file)) {
if (isset($this->file['title'])) {
return $this->file['title'];
}
}
return '';
} | [
"protected",
"function",
"parseTitle",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"file",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"file",
"->",
"title",
")",
")",
"{",
"return",
"$",
"this",
"->",
"file",
"-... | If the file received is an object or array, check if the 'title' field is set
@return string | [
"If",
"the",
"file",
"received",
"is",
"an",
"object",
"or",
"array",
"check",
"if",
"the",
"title",
"field",
"is",
"set"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L312-L326 |
230,164 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.is_svg | protected function is_svg() {
$finfo = new \finfo(FILEINFO_MIME);
$type = $finfo->file($this->upload_path . $this->file_name);
if (str_contains($type, 'image/svg+xml')) {
return TRUE;
}
return FALSE;
} | php | protected function is_svg() {
$finfo = new \finfo(FILEINFO_MIME);
$type = $finfo->file($this->upload_path . $this->file_name);
if (str_contains($type, 'image/svg+xml')) {
return TRUE;
}
return FALSE;
} | [
"protected",
"function",
"is_svg",
"(",
")",
"{",
"$",
"finfo",
"=",
"new",
"\\",
"finfo",
"(",
"FILEINFO_MIME",
")",
";",
"$",
"type",
"=",
"$",
"finfo",
"->",
"file",
"(",
"$",
"this",
"->",
"upload_path",
".",
"$",
"this",
"->",
"file_name",
")",
... | Checks if we have an SVG image.
@return
TRUE if SVG and FALSE otherwise | [
"Checks",
"if",
"we",
"have",
"an",
"SVG",
"image",
"."
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L373-L382 |
230,165 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.buildImage | protected function buildImage () {
$method = 'buildImage'. ucfirst($this->preset->method);
if (method_exists($this, $method)) {
return $this->{$method}();
}
return FALSE;
} | php | protected function buildImage () {
$method = 'buildImage'. ucfirst($this->preset->method);
if (method_exists($this, $method)) {
return $this->{$method}();
}
return FALSE;
} | [
"protected",
"function",
"buildImage",
"(",
")",
"{",
"$",
"method",
"=",
"'buildImage'",
".",
"ucfirst",
"(",
"$",
"this",
"->",
"preset",
"->",
"method",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
"re... | Generates and calls the correct method for the generation method used in preset
@return mixed
FALSE if no matching method, otherwise the Image Object | [
"Generates",
"and",
"calls",
"the",
"correct",
"method",
"for",
"the",
"generation",
"method",
"used",
"in",
"preset"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L438-L445 |
230,166 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.buildImageResize | protected function buildImageResize() {
$image = Image::make($this->upload_path . $this->file_name)->orientate();
$image->resize($this->preset->width, $this->preset->height , function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
//if background_color is not set, d... | php | protected function buildImageResize() {
$image = Image::make($this->upload_path . $this->file_name)->orientate();
$image->resize($this->preset->width, $this->preset->height , function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
//if background_color is not set, d... | [
"protected",
"function",
"buildImageResize",
"(",
")",
"{",
"$",
"image",
"=",
"Image",
"::",
"make",
"(",
"$",
"this",
"->",
"upload_path",
".",
"$",
"this",
"->",
"file_name",
")",
"->",
"orientate",
"(",
")",
";",
"$",
"image",
"->",
"resize",
"(",
... | Resize the image, contraining the aspect ratio and size
@return Image Object | [
"Resize",
"the",
"image",
"contraining",
"the",
"aspect",
"ratio",
"and",
"size"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L452-L467 |
230,167 | DevFactoryCH/imagecache | src/Imagecache.php | Imagecache.delete_image | protected function delete_image() {
$presets = $this->get_presets();
foreach ($presets as $key => $preset) {
$file_name = $this->imagecache_path . $key .'/'. $this->file_name;
if (File::exists($file_name)) {
File::delete($file_name);
}
}
} | php | protected function delete_image() {
$presets = $this->get_presets();
foreach ($presets as $key => $preset) {
$file_name = $this->imagecache_path . $key .'/'. $this->file_name;
if (File::exists($file_name)) {
File::delete($file_name);
}
}
} | [
"protected",
"function",
"delete_image",
"(",
")",
"{",
"$",
"presets",
"=",
"$",
"this",
"->",
"get_presets",
"(",
")",
";",
"foreach",
"(",
"$",
"presets",
"as",
"$",
"key",
"=>",
"$",
"preset",
")",
"{",
"$",
"file_name",
"=",
"$",
"this",
"->",
... | Delete every image preset for one image | [
"Delete",
"every",
"image",
"preset",
"for",
"one",
"image"
] | 73783d14f40d01d8bdb2385256d244521340b92b | https://github.com/DevFactoryCH/imagecache/blob/73783d14f40d01d8bdb2385256d244521340b92b/src/Imagecache.php#L639-L648 |
230,168 | naneau/semver | src/Naneau/SemVer/Compare.php | Compare.equals | public static function equals(Version $v1, Version $v2)
{
// Versionable part itself needs to be equal
if (!self::versionableEquals($v1, $v2)) {
return false;
}
// If only one has a pre-release, they're not equal
if ($v1->hasPreRelease() && !$v2->hasPreRelease())... | php | public static function equals(Version $v1, Version $v2)
{
// Versionable part itself needs to be equal
if (!self::versionableEquals($v1, $v2)) {
return false;
}
// If only one has a pre-release, they're not equal
if ($v1->hasPreRelease() && !$v2->hasPreRelease())... | [
"public",
"static",
"function",
"equals",
"(",
"Version",
"$",
"v1",
",",
"Version",
"$",
"v2",
")",
"{",
"// Versionable part itself needs to be equal",
"if",
"(",
"!",
"self",
"::",
"versionableEquals",
"(",
"$",
"v1",
",",
"$",
"v2",
")",
")",
"{",
"ret... | Are two versions equal to one another?
@param Version $v1
@param Version $v2
@return bool | [
"Are",
"two",
"versions",
"equal",
"to",
"one",
"another?"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Compare.php#L96-L132 |
230,169 | naneau/semver | src/Naneau/SemVer/Compare.php | Compare.greaterThan | public static function greaterThan(Version $v1, Version $v2)
{
// If they are equal, they can not be greater/smaller than each other
if (self::equals($v1, $v2)) {
return false;
}
// Compare on the major/minor/patch level if we can
if (!self::versionableEquals($v... | php | public static function greaterThan(Version $v1, Version $v2)
{
// If they are equal, they can not be greater/smaller than each other
if (self::equals($v1, $v2)) {
return false;
}
// Compare on the major/minor/patch level if we can
if (!self::versionableEquals($v... | [
"public",
"static",
"function",
"greaterThan",
"(",
"Version",
"$",
"v1",
",",
"Version",
"$",
"v2",
")",
"{",
"// If they are equal, they can not be greater/smaller than each other",
"if",
"(",
"self",
"::",
"equals",
"(",
"$",
"v1",
",",
"$",
"v2",
")",
")",
... | Is a Version greater than another one?
@param Version $v1
@param Version $v2
@return bool | [
"Is",
"a",
"Version",
"greater",
"than",
"another",
"one?"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Compare.php#L141-L192 |
230,170 | naneau/semver | src/Naneau/SemVer/Compare.php | Compare.smallerThan | public static function smallerThan(Version $v1, Version $v2)
{
// If it's equal it can not be smaller
if (self::equals($v1, $v2)) {
return false;
}
// If it's not equal, and not greater, it must be smaller
return !self::greaterThan($v1, $v2);
} | php | public static function smallerThan(Version $v1, Version $v2)
{
// If it's equal it can not be smaller
if (self::equals($v1, $v2)) {
return false;
}
// If it's not equal, and not greater, it must be smaller
return !self::greaterThan($v1, $v2);
} | [
"public",
"static",
"function",
"smallerThan",
"(",
"Version",
"$",
"v1",
",",
"Version",
"$",
"v2",
")",
"{",
"// If it's equal it can not be smaller",
"if",
"(",
"self",
"::",
"equals",
"(",
"$",
"v1",
",",
"$",
"v2",
")",
")",
"{",
"return",
"false",
... | Is a version smaller than another one?
@param Version $v1
@param Version $v2
@return bool | [
"Is",
"a",
"version",
"smaller",
"than",
"another",
"one?"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Compare.php#L201-L210 |
230,171 | naneau/semver | src/Naneau/SemVer/Compare.php | Compare.preReleaseEquals | private static function preReleaseEquals(PreRelease $v1, PreRelease $v2)
{
// If they don't match on the versionable level they can not match
if (!self::versionableEquals($v1, $v2)) {
return false;
}
// Both other parts need to match
if ($v1->getGreek() !== $v2->... | php | private static function preReleaseEquals(PreRelease $v1, PreRelease $v2)
{
// If they don't match on the versionable level they can not match
if (!self::versionableEquals($v1, $v2)) {
return false;
}
// Both other parts need to match
if ($v1->getGreek() !== $v2->... | [
"private",
"static",
"function",
"preReleaseEquals",
"(",
"PreRelease",
"$",
"v1",
",",
"PreRelease",
"$",
"v2",
")",
"{",
"// If they don't match on the versionable level they can not match",
"if",
"(",
"!",
"self",
"::",
"versionableEquals",
"(",
"$",
"v1",
",",
"... | Does a pre-release equal another one?
@param PreRelease $v1
@param PreRelease $v2
@return bool | [
"Does",
"a",
"pre",
"-",
"release",
"equal",
"another",
"one?"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Compare.php#L302-L318 |
230,172 | naneau/semver | src/Naneau/SemVer/Compare.php | Compare.preReleaseGreaterThan | private static function preReleaseGreaterThan(PreRelease $v1, PreRelease $v2)
{
// Pre-releases can be denoted as versionable (X.Y.Z) or greek (alpha.5)
// We let versionable take precedence
if (!self::versionableEquals($v1, $v2)) {
// If v1 is bigger on the versionable level, it... | php | private static function preReleaseGreaterThan(PreRelease $v1, PreRelease $v2)
{
// Pre-releases can be denoted as versionable (X.Y.Z) or greek (alpha.5)
// We let versionable take precedence
if (!self::versionableEquals($v1, $v2)) {
// If v1 is bigger on the versionable level, it... | [
"private",
"static",
"function",
"preReleaseGreaterThan",
"(",
"PreRelease",
"$",
"v1",
",",
"PreRelease",
"$",
"v2",
")",
"{",
"// Pre-releases can be denoted as versionable (X.Y.Z) or greek (alpha.5)",
"// We let versionable take precedence",
"if",
"(",
"!",
"self",
"::",
... | Is one pre-release version bigger than another one?
@param PreRelease $v1
@param PreRelease $v2
@return bool | [
"Is",
"one",
"pre",
"-",
"release",
"version",
"bigger",
"than",
"another",
"one?"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Compare.php#L327-L347 |
230,173 | naneau/semver | src/Naneau/SemVer/Compare.php | Compare.greekLargerThan | private static function greekLargerThan($greek1, $greek2)
{
// If they do not exist as valid precendence identifiers assume
// bigger/smaller based on that
if (!in_array($greek1, self::$greekPrecendence)) {
return true;
}
if (!in_array($greek2, self::$greekPrecend... | php | private static function greekLargerThan($greek1, $greek2)
{
// If they do not exist as valid precendence identifiers assume
// bigger/smaller based on that
if (!in_array($greek1, self::$greekPrecendence)) {
return true;
}
if (!in_array($greek2, self::$greekPrecend... | [
"private",
"static",
"function",
"greekLargerThan",
"(",
"$",
"greek1",
",",
"$",
"greek2",
")",
"{",
"// If they do not exist as valid precendence identifiers assume",
"// bigger/smaller based on that",
"if",
"(",
"!",
"in_array",
"(",
"$",
"greek1",
",",
"self",
"::",... | Compare "greek" strings
@see SemVer::$greekPrecendence
@param string $greek1
@param string $greek2
@return bool | [
"Compare",
"greek",
"strings"
] | c771ad1e6c89064c0a4fa714979639dc3649d6c8 | https://github.com/naneau/semver/blob/c771ad1e6c89064c0a4fa714979639dc3649d6c8/src/Naneau/SemVer/Compare.php#L358-L374 |
230,174 | ZenMagick/ZenCart | includes/classes/class.smtp.php | SMTP.SMTP | function SMTP() {
$this->smtp_conn = 0;
$this->error = null;
$this->helo_rply = null;
$this->do_debug = 0;
} | php | function SMTP() {
$this->smtp_conn = 0;
$this->error = null;
$this->helo_rply = null;
$this->do_debug = 0;
} | [
"function",
"SMTP",
"(",
")",
"{",
"$",
"this",
"->",
"smtp_conn",
"=",
"0",
";",
"$",
"this",
"->",
"error",
"=",
"null",
";",
"$",
"this",
"->",
"helo_rply",
"=",
"null",
";",
"$",
"this",
"->",
"do_debug",
"=",
"0",
";",
"}"
] | Initialize the class so that the data is in a known state.
@access public
@return void | [
"Initialize",
"the",
"class",
"so",
"that",
"the",
"data",
"is",
"in",
"a",
"known",
"state",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/class.smtp.php#L75-L81 |
230,175 | ZenMagick/ZenCart | includes/classes/class.smtp.php | SMTP.Hello | function Hello($host="") {
$this->error = null; # so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Hello() without being connected");
return false;
}
# if a hostname for the HELO wasn't specified determine
# a suitable one to send
i... | php | function Hello($host="") {
$this->error = null; # so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Hello() without being connected");
return false;
}
# if a hostname for the HELO wasn't specified determine
# a suitable one to send
i... | [
"function",
"Hello",
"(",
"$",
"host",
"=",
"\"\"",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"null",
";",
"# so no confusion is caused",
"if",
"(",
"!",
"$",
"this",
"->",
"connected",
"(",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"array",
... | Sends the HELO command to the smtp server.
This makes sure that we and the server are in
the same known state.
Implements from rfc 821: HELO <SP> <domain> <CRLF>
SMTP CODE SUCCESS: 250
SMTP CODE ERROR : 500, 501, 504, 421
@access public
@return bool | [
"Sends",
"the",
"HELO",
"command",
"to",
"the",
"smtp",
"server",
".",
"This",
"makes",
"sure",
"that",
"we",
"and",
"the",
"server",
"are",
"in",
"the",
"same",
"known",
"state",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/class.smtp.php#L476-L501 |
230,176 | ZenMagick/ZenCart | includes/classes/class.smtp.php | SMTP.Reset | function Reset() {
$this->error = null; # so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Reset() without being connected");
return false;
}
fputs($this->smtp_conn,"RSET" . $this->CRLF);
$rply = $this->get_lines();
$code = substr(... | php | function Reset() {
$this->error = null; # so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Reset() without being connected");
return false;
}
fputs($this->smtp_conn,"RSET" . $this->CRLF);
$rply = $this->get_lines();
$code = substr(... | [
"function",
"Reset",
"(",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"null",
";",
"# so no confusion is caused",
"if",
"(",
"!",
"$",
"this",
"->",
"connected",
"(",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"array",
"(",
"\"error\"",
"=>",
"\"... | Sends the RSET command to abort and transaction that is
currently in progress. Returns true if successful false
otherwise.
Implements rfc 821: RSET <CRLF>
SMTP CODE SUCCESS: 250
SMTP CODE ERROR : 500,501,504,421
@access public
@return bool | [
"Sends",
"the",
"RSET",
"command",
"to",
"abort",
"and",
"transaction",
"that",
"is",
"currently",
"in",
"progress",
".",
"Returns",
"true",
"if",
"successful",
"false",
"otherwise",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/class.smtp.php#L785-L816 |
230,177 | ZenMagick/ZenCart | includes/classes/class.smtp.php | SMTP.Verify | function Verify($name) {
$this->error = null; # so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Verify() without being connected");
return false;
}
fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
$rply = $this->get_lines();
... | php | function Verify($name) {
$this->error = null; # so no confusion is caused
if(!$this->connected()) {
$this->error = array(
"error" => "Called Verify() without being connected");
return false;
}
fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
$rply = $this->get_lines();
... | [
"function",
"Verify",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"null",
";",
"# so no confusion is caused",
"if",
"(",
"!",
"$",
"this",
"->",
"connected",
"(",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"array",
"(",
"\"error... | Verifies that the name is recognized by the server.
Returns false if the name could not be verified otherwise
the response from the server is returned.
Implements rfc 821: VRFY <SP> <string> <CRLF>
SMTP CODE SUCCESS: 250,251
SMTP CODE FAILURE: 550,551,553
SMTP CODE ERROR : 500,501,502,421
@access public
@return int | [
"Verifies",
"that",
"the",
"name",
"is",
"recognized",
"by",
"the",
"server",
".",
"Returns",
"false",
"if",
"the",
"name",
"could",
"not",
"be",
"verified",
"otherwise",
"the",
"response",
"from",
"the",
"server",
"is",
"returned",
"."
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/class.smtp.php#L997-L1027 |
230,178 | brysalazar12/thememanager | src/Helpers/Theme.php | Theme.set | public function set($theme, $group = null)
{
if (!is_null($group)) {
$this->currentGroup = $group;
$this->currentTheme[$group] = $theme;
}
if (is_null($this->currentGroup)) {
throw new \Exception('Current group cannot be null. Use Theme::setCurrentGroup($... | php | public function set($theme, $group = null)
{
if (!is_null($group)) {
$this->currentGroup = $group;
$this->currentTheme[$group] = $theme;
}
if (is_null($this->currentGroup)) {
throw new \Exception('Current group cannot be null. Use Theme::setCurrentGroup($... | [
"public",
"function",
"set",
"(",
"$",
"theme",
",",
"$",
"group",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"group",
")",
")",
"{",
"$",
"this",
"->",
"currentGroup",
"=",
"$",
"group",
";",
"$",
"this",
"->",
"currentTheme",
"... | Set current theme for this group.
@param string $theme Name of theme that belongs to this $group
@param string $group Group name | [
"Set",
"current",
"theme",
"for",
"this",
"group",
"."
] | 589b771ae412b5f3081bec16f5d84a62850fd9e1 | https://github.com/brysalazar12/thememanager/blob/589b771ae412b5f3081bec16f5d84a62850fd9e1/src/Helpers/Theme.php#L79-L93 |
230,179 | WadeShuler/yii2-ckeditor-cdn | widgets/CKEditor.php | CKEditor.registerPlugins | protected function registerPlugins()
{
if ( count($this->externalPlugins) )
{
foreach ( $this->externalPlugins as $plugin ) {
$this->getView()->registerJs("CKEDITOR.plugins.addExternal( '" . $plugin['name'] . "', '" . $plugin['path'] . "', '" . $plugin['file'] . "' );", V... | php | protected function registerPlugins()
{
if ( count($this->externalPlugins) )
{
foreach ( $this->externalPlugins as $plugin ) {
$this->getView()->registerJs("CKEDITOR.plugins.addExternal( '" . $plugin['name'] . "', '" . $plugin['path'] . "', '" . $plugin['file'] . "' );", V... | [
"protected",
"function",
"registerPlugins",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"externalPlugins",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"externalPlugins",
"as",
"$",
"plugin",
")",
"{",
"$",
"this",
"->",
"getView",
... | Register plugins for CKEditor | [
"Register",
"plugins",
"for",
"CKEditor"
] | 86fc388023fc8f4f2be13fcd0da7410b1375386b | https://github.com/WadeShuler/yii2-ckeditor-cdn/blob/86fc388023fc8f4f2be13fcd0da7410b1375386b/widgets/CKEditor.php#L89-L97 |
230,180 | Webiny/Framework | src/Webiny/Component/Entity/Attribute/Many2ManyAttribute.php | Many2ManyAttribute.save | public function save()
{
$collectionName = $this->intermediateCollection;
$existingIds = [];
$firstEntityId = $this->getParentEntity()->id;
foreach ($this->getValue() as $item) {
if ($item instanceof AbstractEntity && !$item->exists()) {
$item->save();
... | php | public function save()
{
$collectionName = $this->intermediateCollection;
$existingIds = [];
$firstEntityId = $this->getParentEntity()->id;
foreach ($this->getValue() as $item) {
if ($item instanceof AbstractEntity && !$item->exists()) {
$item->save();
... | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"collectionName",
"=",
"$",
"this",
"->",
"intermediateCollection",
";",
"$",
"existingIds",
"=",
"[",
"]",
";",
"$",
"firstEntityId",
"=",
"$",
"this",
"->",
"getParentEntity",
"(",
")",
"->",
"id",
";",... | Insert links into DB
@throws \Webiny\Component\Entity\EntityException
@throws \Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObjectException | [
"Insert",
"links",
"into",
"DB"
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Entity/Attribute/Many2ManyAttribute.php#L170-L218 |
230,181 | ZenMagick/ZenCart | includes/classes/http_client.php | httpClient.setProxy | function setProxy($proxyHost, $proxyPort) {
$this->useProxy = true;
$this->proxyHost = $proxyHost;
$this->proxyPort = $proxyPort;
} | php | function setProxy($proxyHost, $proxyPort) {
$this->useProxy = true;
$this->proxyHost = $proxyHost;
$this->proxyPort = $proxyPort;
} | [
"function",
"setProxy",
"(",
"$",
"proxyHost",
",",
"$",
"proxyPort",
")",
"{",
"$",
"this",
"->",
"useProxy",
"=",
"true",
";",
"$",
"this",
"->",
"proxyHost",
"=",
"$",
"proxyHost",
";",
"$",
"this",
"->",
"proxyPort",
"=",
"$",
"proxyPort",
";",
"... | turn on proxy support
@param proxyHost proxy host address eg "proxy.mycorp.com"
@param proxyPort proxy port usually 80 or 8080 | [
"turn",
"on",
"proxy",
"support"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/http_client.php#L49-L53 |
230,182 | ZenMagick/ZenCart | includes/classes/http_client.php | httpClient.setHeaders | function setHeaders($headers) {
if (is_array($headers)) {
reset($headers);
while (list($name, $value) = each($headers)) {
$this->requestHeaders[$name] = $value;
}
}
} | php | function setHeaders($headers) {
if (is_array($headers)) {
reset($headers);
while (list($name, $value) = each($headers)) {
$this->requestHeaders[$name] = $value;
}
}
} | [
"function",
"setHeaders",
"(",
"$",
"headers",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"headers",
")",
")",
"{",
"reset",
"(",
"$",
"headers",
")",
";",
"while",
"(",
"list",
"(",
"$",
"name",
",",
"$",
"value",
")",
"=",
"each",
"(",
"$",
"... | define a set of HTTP headers to be sent to the server
header names are lowercased to avoid duplicated headers
@param headers hash array containing the headers as headerName => headerValue pairs | [
"define",
"a",
"set",
"of",
"HTTP",
"headers",
"to",
"be",
"sent",
"to",
"the",
"server",
"header",
"names",
"are",
"lowercased",
"to",
"avoid",
"duplicated",
"headers"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/http_client.php#L86-L93 |
230,183 | ZenMagick/ZenCart | includes/classes/http_client.php | httpClient.Connect | function Connect($host, $port = '') {
$this->url['scheme'] = 'http';
$this->url['host'] = $host;
if (zen_not_null($port)) $this->url['port'] = $port;
return true;
} | php | function Connect($host, $port = '') {
$this->url['scheme'] = 'http';
$this->url['host'] = $host;
if (zen_not_null($port)) $this->url['port'] = $port;
return true;
} | [
"function",
"Connect",
"(",
"$",
"host",
",",
"$",
"port",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"url",
"[",
"'scheme'",
"]",
"=",
"'http'",
";",
"$",
"this",
"->",
"url",
"[",
"'host'",
"]",
"=",
"$",
"host",
";",
"if",
"(",
"zen_not_null",
... | Connect
open the connection to the server
@param host string server address (or IP)
@param port string server listening port - defaults to 80
@return boolean false is connection failed, true otherwise | [
"Connect",
"open",
"the",
"connection",
"to",
"the",
"server"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/http_client.php#L121-L127 |
230,184 | ZenMagick/ZenCart | includes/classes/http_client.php | httpClient.Head | function Head($uri) {
$this->responseHeaders = $this->responseBody = '';
$uri = $this->makeUri($uri);
if ($this->sendCommand('HEAD ' . $uri . ' HTTP/' . $this->protocolVersion)) {
$this->processReply();
}
return $this->reply;
} | php | function Head($uri) {
$this->responseHeaders = $this->responseBody = '';
$uri = $this->makeUri($uri);
if ($this->sendCommand('HEAD ' . $uri . ' HTTP/' . $this->protocolVersion)) {
$this->processReply();
}
return $this->reply;
} | [
"function",
"Head",
"(",
"$",
"uri",
")",
"{",
"$",
"this",
"->",
"responseHeaders",
"=",
"$",
"this",
"->",
"responseBody",
"=",
"''",
";",
"$",
"uri",
"=",
"$",
"this",
"->",
"makeUri",
"(",
"$",
"uri",
")",
";",
"if",
"(",
"$",
"this",
"->",
... | head
issue a HEAD request
@param uri string URI of the document
@return string response status code (200 if ok) | [
"head",
"issue",
"a",
"HEAD",
"request"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/http_client.php#L143-L153 |
230,185 | ZenMagick/ZenCart | includes/classes/http_client.php | httpClient.Get | function Get($url) {
$this->responseHeaders = $this->responseBody = '';
$uri = $this->makeUri($url);
if ($this->sendCommand('GET ' . $uri . ' HTTP/' . $this->protocolVersion)) {
$this->processReply();
}
return $this->reply;
} | php | function Get($url) {
$this->responseHeaders = $this->responseBody = '';
$uri = $this->makeUri($url);
if ($this->sendCommand('GET ' . $uri . ' HTTP/' . $this->protocolVersion)) {
$this->processReply();
}
return $this->reply;
} | [
"function",
"Get",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"responseHeaders",
"=",
"$",
"this",
"->",
"responseBody",
"=",
"''",
";",
"$",
"uri",
"=",
"$",
"this",
"->",
"makeUri",
"(",
"$",
"url",
")",
";",
"if",
"(",
"$",
"this",
"->",
... | get
issue a GET http request
@param uri URI (path on server) or full URL of the document
@return string response status code (200 if ok) | [
"get",
"issue",
"a",
"GET",
"http",
"request"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/http_client.php#L161-L171 |
230,186 | ZenMagick/ZenCart | includes/classes/http_client.php | httpClient.sendCommand | function sendCommand($command) {
$this->responseHeaders = array();
$this->responseBody = '';
// connect if necessary
if ( ($this->socket == false) || (feof($this->socket)) ) {
if ($this->useProxy) {
$host = $this->proxyHost;
$port = $this->proxyPort;
} else {
... | php | function sendCommand($command) {
$this->responseHeaders = array();
$this->responseBody = '';
// connect if necessary
if ( ($this->socket == false) || (feof($this->socket)) ) {
if ($this->useProxy) {
$host = $this->proxyHost;
$port = $this->proxyPort;
} else {
... | [
"function",
"sendCommand",
"(",
"$",
"command",
")",
"{",
"$",
"this",
"->",
"responseHeaders",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"responseBody",
"=",
"''",
";",
"// connect if necessary",
"if",
"(",
"(",
"$",
"this",
"->",
"socket",
"==",
... | send a request
data sent are in order
a) the command
b) the request headers if they are defined
c) the request body if defined
@return string the server repsonse status code | [
"send",
"a",
"request",
"data",
"sent",
"are",
"in",
"order",
"a",
")",
"the",
"command",
"b",
")",
"the",
"request",
"headers",
"if",
"they",
"are",
"defined",
"c",
")",
"the",
"request",
"body",
"if",
"defined"
] | 00438ebc0faee786489aab4a6d70fc0d0c1461c7 | https://github.com/ZenMagick/ZenCart/blob/00438ebc0faee786489aab4a6d70fc0d0c1461c7/includes/classes/http_client.php#L291-L335 |
230,187 | themsaid/katana-core | src/RSSFeedBuilder.php | RSSFeedBuilder.build | public function build()
{
if (! $view = $this->getRSSView()) {
return;
}
$pageContent = $this->viewFactory->make($view, $this->viewsData)->render();
$this->filesystem->put(
sprintf('%s/%s', KATANA_PUBLIC_DIR, 'feed.rss'),
$pageContent
);
... | php | public function build()
{
if (! $view = $this->getRSSView()) {
return;
}
$pageContent = $this->viewFactory->make($view, $this->viewsData)->render();
$this->filesystem->put(
sprintf('%s/%s', KATANA_PUBLIC_DIR, 'feed.rss'),
$pageContent
);
... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"view",
"=",
"$",
"this",
"->",
"getRSSView",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"pageContent",
"=",
"$",
"this",
"->",
"viewFactory",
"->",
"make",
"(",
"$",
"view",
",... | Build blog RSS feed file.
@return void | [
"Build",
"blog",
"RSS",
"feed",
"file",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/RSSFeedBuilder.php#L33-L45 |
230,188 | themsaid/katana-core | src/RSSFeedBuilder.php | RSSFeedBuilder.getRSSView | protected function getRSSView()
{
if (! isset($this->viewsData['rssFeedView']) || ! @$this->viewsData['rssFeedView']) {
return null;
}
if (! $this->viewFactory->exists($this->viewsData['rssFeedView'])) {
throw new \Exception(sprintf('The "%s" view is not found. Make ... | php | protected function getRSSView()
{
if (! isset($this->viewsData['rssFeedView']) || ! @$this->viewsData['rssFeedView']) {
return null;
}
if (! $this->viewFactory->exists($this->viewsData['rssFeedView'])) {
throw new \Exception(sprintf('The "%s" view is not found. Make ... | [
"protected",
"function",
"getRSSView",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"viewsData",
"[",
"'rssFeedView'",
"]",
")",
"||",
"!",
"@",
"$",
"this",
"->",
"viewsData",
"[",
"'rssFeedView'",
"]",
")",
"{",
"return",
"null",
... | Get the name of the view to be used for generating the RSS feed.
@return mixed
@throws \Exception | [
"Get",
"the",
"name",
"of",
"the",
"view",
"to",
"be",
"used",
"for",
"generating",
"the",
"RSS",
"feed",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/RSSFeedBuilder.php#L53-L64 |
230,189 | EdgedesignCZ/ares | Parser/AddressParser.php | AddressParser.parseAddress | public function parseAddress($xmlString)
{
$previousValue = libxml_use_internal_errors(true);
$xml = simplexml_load_string($xmlString);
libxml_use_internal_errors($previousValue);
if ($xml === false) {
$message = $this->getXmlErrorMessage();
throw new Invalid... | php | public function parseAddress($xmlString)
{
$previousValue = libxml_use_internal_errors(true);
$xml = simplexml_load_string($xmlString);
libxml_use_internal_errors($previousValue);
if ($xml === false) {
$message = $this->getXmlErrorMessage();
throw new Invalid... | [
"public",
"function",
"parseAddress",
"(",
"$",
"xmlString",
")",
"{",
"$",
"previousValue",
"=",
"libxml_use_internal_errors",
"(",
"true",
")",
";",
"$",
"xml",
"=",
"simplexml_load_string",
"(",
"$",
"xmlString",
")",
";",
"libxml_use_internal_errors",
"(",
"... | Parse address from given XML and return Address object.
@param string $xmlString
@throws \Edge\Ares\Exception\InvalidArgumentException
@return Address | [
"Parse",
"address",
"from",
"given",
"XML",
"and",
"return",
"Address",
"object",
"."
] | ae0f50155571875d09ba969e7b062854c823b57d | https://github.com/EdgedesignCZ/ares/blob/ae0f50155571875d09ba969e7b062854c823b57d/Parser/AddressParser.php#L24-L36 |
230,190 | EdgedesignCZ/ares | Parser/AddressParser.php | AddressParser.getXmlErrorMessage | private function getXmlErrorMessage()
{
$errors = libxml_get_errors();
if (count($errors)) {
/** @var \LibXMLError $error */
$error = array_shift($errors);
return $error->message;
}
return 'Unknown error withing SimpleXML parser occured.';
} | php | private function getXmlErrorMessage()
{
$errors = libxml_get_errors();
if (count($errors)) {
/** @var \LibXMLError $error */
$error = array_shift($errors);
return $error->message;
}
return 'Unknown error withing SimpleXML parser occured.';
} | [
"private",
"function",
"getXmlErrorMessage",
"(",
")",
"{",
"$",
"errors",
"=",
"libxml_get_errors",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"errors",
")",
")",
"{",
"/** @var \\LibXMLError $error */",
"$",
"error",
"=",
"array_shift",
"(",
"$",
"errors... | Get error message from last supplied XML string.
@return string | [
"Get",
"error",
"message",
"from",
"last",
"supplied",
"XML",
"string",
"."
] | ae0f50155571875d09ba969e7b062854c823b57d | https://github.com/EdgedesignCZ/ares/blob/ae0f50155571875d09ba969e7b062854c823b57d/Parser/AddressParser.php#L43-L53 |
230,191 | deanblackborough/zf3-view-helpers | src/Bootstrap4Button.php | Bootstrap4Button.setOutlineStyle | public function setOutlineStyle(string $style): Bootstrap4Button
{
if (in_array($style, $this->supported_bg_styles) === true &&
$style !== 'link'
) {
$this->outline_style = $style;
} else {
$this->outline_style = 'primary';
}
return $this... | php | public function setOutlineStyle(string $style): Bootstrap4Button
{
if (in_array($style, $this->supported_bg_styles) === true &&
$style !== 'link'
) {
$this->outline_style = $style;
} else {
$this->outline_style = 'primary';
}
return $this... | [
"public",
"function",
"setOutlineStyle",
"(",
"string",
"$",
"style",
")",
":",
"Bootstrap4Button",
"{",
"if",
"(",
"in_array",
"(",
"$",
"style",
",",
"$",
"this",
"->",
"supported_bg_styles",
")",
"===",
"true",
"&&",
"$",
"style",
"!==",
"'link'",
")",
... | Set the outline style for the button, one of the following, primary, secondary, success,
info, warning or danger. If an incorrect style is passed in we set the style to
btn-outline-primary
@param string $style
@return Bootstrap4Button | [
"Set",
"the",
"outline",
"style",
"for",
"the",
"button",
"one",
"of",
"the",
"following",
"primary",
"secondary",
"success",
"info",
"warning",
"or",
"danger",
".",
"If",
"an",
"incorrect",
"style",
"is",
"passed",
"in",
"we",
"set",
"the",
"style",
"to",... | db8bea4ca62709b2ac8c732aedbb2a5235223f23 | https://github.com/deanblackborough/zf3-view-helpers/blob/db8bea4ca62709b2ac8c732aedbb2a5235223f23/src/Bootstrap4Button.php#L111-L123 |
230,192 | themsaid/katana-core | src/BlogPaginationBuilder.php | BlogPaginationBuilder.build | public function build()
{
$view = $this->getPostsListView();
$postsPerPage = @$this->viewsData['postsPerPage'] ?: 5;
$this->pagesData = array_chunk($this->viewsData['blogPosts'], $postsPerPage);
foreach ($this->pagesData as $pageIndex => $posts) {
$this->buildPage($pag... | php | public function build()
{
$view = $this->getPostsListView();
$postsPerPage = @$this->viewsData['postsPerPage'] ?: 5;
$this->pagesData = array_chunk($this->viewsData['blogPosts'], $postsPerPage);
foreach ($this->pagesData as $pageIndex => $posts) {
$this->buildPage($pag... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getPostsListView",
"(",
")",
";",
"$",
"postsPerPage",
"=",
"@",
"$",
"this",
"->",
"viewsData",
"[",
"'postsPerPage'",
"]",
"?",
":",
"5",
";",
"$",
"this",
"->",
... | Build blog pagination files.
@return void | [
"Build",
"blog",
"pagination",
"files",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/BlogPaginationBuilder.php#L34-L45 |
230,193 | themsaid/katana-core | src/BlogPaginationBuilder.php | BlogPaginationBuilder.getPostsListView | protected function getPostsListView()
{
if (! isset($this->viewsData['postsListView'])) {
throw new \Exception('The postsListView config value is missing.');
}
if (! $this->viewFactory->exists($this->viewsData['postsListView'])) {
throw new \Exception(sprintf('The "%... | php | protected function getPostsListView()
{
if (! isset($this->viewsData['postsListView'])) {
throw new \Exception('The postsListView config value is missing.');
}
if (! $this->viewFactory->exists($this->viewsData['postsListView'])) {
throw new \Exception(sprintf('The "%... | [
"protected",
"function",
"getPostsListView",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"viewsData",
"[",
"'postsListView'",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'The postsListView config value is missing.'",
")",
"... | Get the name of the view to be used for pages.
@return mixed
@throws \Exception | [
"Get",
"the",
"name",
"of",
"the",
"view",
"to",
"be",
"used",
"for",
"pages",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/BlogPaginationBuilder.php#L53-L64 |
230,194 | themsaid/katana-core | src/BlogPaginationBuilder.php | BlogPaginationBuilder.buildPage | protected function buildPage($pageIndex, $view, $posts)
{
$viewData = array_merge(
$this->viewsData,
[
'paginatedBlogPosts' => $posts,
'previousPage' => $this->getPreviousPageLink($pageIndex),
'nextPage' => $this->getNextPageLink($pageI... | php | protected function buildPage($pageIndex, $view, $posts)
{
$viewData = array_merge(
$this->viewsData,
[
'paginatedBlogPosts' => $posts,
'previousPage' => $this->getPreviousPageLink($pageIndex),
'nextPage' => $this->getNextPageLink($pageI... | [
"protected",
"function",
"buildPage",
"(",
"$",
"pageIndex",
",",
"$",
"view",
",",
"$",
"posts",
")",
"{",
"$",
"viewData",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"viewsData",
",",
"[",
"'paginatedBlogPosts'",
"=>",
"$",
"posts",
",",
"'previousPage'... | Build a pagination page.
@param integer $pageIndex
@param string $view
@param array $posts
@return void | [
"Build",
"a",
"pagination",
"page",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/BlogPaginationBuilder.php#L75-L96 |
230,195 | themsaid/katana-core | src/BlogPaginationBuilder.php | BlogPaginationBuilder.getPreviousPageLink | protected function getPreviousPageLink($currentPageIndex)
{
if (! isset($this->pagesData[$currentPageIndex - 1])) {
return null;
} elseif ($currentPageIndex == 1) {
// If the current page is the second, then the first page's
// link should point to the blog's main... | php | protected function getPreviousPageLink($currentPageIndex)
{
if (! isset($this->pagesData[$currentPageIndex - 1])) {
return null;
} elseif ($currentPageIndex == 1) {
// If the current page is the second, then the first page's
// link should point to the blog's main... | [
"protected",
"function",
"getPreviousPageLink",
"(",
"$",
"currentPageIndex",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pagesData",
"[",
"$",
"currentPageIndex",
"-",
"1",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"elseif",
"(",
... | Get the link of the page before the given page.
@param integer $currentPageIndex
@return null|string | [
"Get",
"the",
"link",
"of",
"the",
"page",
"before",
"the",
"given",
"page",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/BlogPaginationBuilder.php#L105-L116 |
230,196 | themsaid/katana-core | src/BlogPaginationBuilder.php | BlogPaginationBuilder.getBlogListPagePath | protected function getBlogListPagePath()
{
$path = str_replace('.', '/', $this->viewsData['postsListView']);
if (ends_with($path, 'index')) {
return rtrim($path, '/index');
}
return $path;
} | php | protected function getBlogListPagePath()
{
$path = str_replace('.', '/', $this->viewsData['postsListView']);
if (ends_with($path, 'index')) {
return rtrim($path, '/index');
}
return $path;
} | [
"protected",
"function",
"getBlogListPagePath",
"(",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"'.'",
",",
"'/'",
",",
"$",
"this",
"->",
"viewsData",
"[",
"'postsListView'",
"]",
")",
";",
"if",
"(",
"ends_with",
"(",
"$",
"path",
",",
"'index'",
... | Get the URL path to the blog list page.
@return string | [
"Get",
"the",
"URL",
"path",
"to",
"the",
"blog",
"list",
"page",
"."
] | 897c1adb6863d5145f1f104cbc8c9200cd98c3fb | https://github.com/themsaid/katana-core/blob/897c1adb6863d5145f1f104cbc8c9200cd98c3fb/src/BlogPaginationBuilder.php#L139-L148 |
230,197 | Webiny/Framework | src/Webiny/Component/Http/Cookie.php | Cookie.get | public function get($name)
{
return $this->cookieBag->key($this->cookiePrefix . $name, false, true);
} | php | public function get($name)
{
return $this->cookieBag->key($this->cookiePrefix . $name, false, true);
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"return",
"$",
"this",
"->",
"cookieBag",
"->",
"key",
"(",
"$",
"this",
"->",
"cookiePrefix",
".",
"$",
"name",
",",
"false",
",",
"true",
")",
";",
"}"
] | Get the cookie.
@param string $name Cookie name.
@return string|bool String if cookie is found, false if cookie is not found. | [
"Get",
"the",
"cookie",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Cookie.php#L102-L105 |
230,198 | Webiny/Framework | src/Webiny/Component/Http/Cookie.php | Cookie.delete | public function delete($name)
{
try {
$result = $this->getStorage()->delete($this->cookiePrefix . $name);
$this->cookieBag->removeKey($this->cookiePrefix . $name);
} catch (\Exception $e) {
throw new CookieException($e->getMessage());
}
return $re... | php | public function delete($name)
{
try {
$result = $this->getStorage()->delete($this->cookiePrefix . $name);
$this->cookieBag->removeKey($this->cookiePrefix . $name);
} catch (\Exception $e) {
throw new CookieException($e->getMessage());
}
return $re... | [
"public",
"function",
"delete",
"(",
"$",
"name",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getStorage",
"(",
")",
"->",
"delete",
"(",
"$",
"this",
"->",
"cookiePrefix",
".",
"$",
"name",
")",
";",
"$",
"this",
"->",
"cookieBag... | Remove the given cookie.
@param string $name Cookie name.
@return bool True if cookie was deleted, or if it doesn't exist, otherwise false.
@throws \Webiny\Component\Http\Cookie\CookieException | [
"Remove",
"the",
"given",
"cookie",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Cookie.php#L115-L125 |
230,199 | Webiny/Framework | src/Webiny/Component/Http/Cookie.php | Cookie.getStorage | private function getStorage(ConfigObject $config = null)
{
if (!isset($this->storage)) {
try {
$driver = $config->get('Storage.Driver', NativeStorage::class);
$this->storage = $this->factory($driver, CookieStorageInterface::class, [$config]);
} catch (... | php | private function getStorage(ConfigObject $config = null)
{
if (!isset($this->storage)) {
try {
$driver = $config->get('Storage.Driver', NativeStorage::class);
$this->storage = $this->factory($driver, CookieStorageInterface::class, [$config]);
} catch (... | [
"private",
"function",
"getStorage",
"(",
"ConfigObject",
"$",
"config",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"storage",
")",
")",
"{",
"try",
"{",
"$",
"driver",
"=",
"$",
"config",
"->",
"get",
"(",
"'Storage.Driv... | Get cookie storage driver.
@param ConfigObject|null $config Cookie config - needed only if storage driver does not yet exist.
@return CookieStorageInterface
@throws \Webiny\Component\Http\Cookie\CookieException | [
"Get",
"cookie",
"storage",
"driver",
"."
] | 2ca7fb238999387e54a1eea8c5cb4735de9022a7 | https://github.com/Webiny/Framework/blob/2ca7fb238999387e54a1eea8c5cb4735de9022a7/src/Webiny/Component/Http/Cookie.php#L135-L147 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.