repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
wenbinye/PhalconX | src/Http/Request.php | Request.getFile | public function getFile($name)
{
if (!isset($this->files)) {
$files = $this->getUploadedFiles();
foreach ($files as $file) {
$key = $file->getKey();
if (isset($key)) {
$this->files[$key] = $file;
} else {
... | php | public function getFile($name)
{
if (!isset($this->files)) {
$files = $this->getUploadedFiles();
foreach ($files as $file) {
$key = $file->getKey();
if (isset($key)) {
$this->files[$key] = $file;
} else {
... | [
"public",
"function",
"getFile",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"files",
")",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"getUploadedFiles",
"(",
")",
";",
"foreach",
"(",
"$",
"files",
"as",
"$"... | Gets upload file object by name
@return Phalcon\Http\Request\File | [
"Gets",
"upload",
"file",
"object",
"by",
"name"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Http/Request.php#L50-L68 |
wenbinye/PhalconX | src/Http/Request.php | Request.getBody | public function getBody()
{
if (!isset($this->body)) {
if (function_exists('http_get_request_body')) {
$this->body = http_get_request_body();
} else {
$this->body = @file_get_contents('php://input');
}
}
return $this->body;
... | php | public function getBody()
{
if (!isset($this->body)) {
if (function_exists('http_get_request_body')) {
$this->body = http_get_request_body();
} else {
$this->body = @file_get_contents('php://input');
}
}
return $this->body;
... | [
"public",
"function",
"getBody",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"body",
")",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'http_get_request_body'",
")",
")",
"{",
"$",
"this",
"->",
"body",
"=",
"http_get_request_body",
... | Gets post body content
@return string | [
"Gets",
"post",
"body",
"content"
] | train | https://github.com/wenbinye/PhalconX/blob/0d2e1480e722dde56ccd23b2e8a5c8ac6ac2f8e1/src/Http/Request.php#L75-L85 |
flowcode/AmulenUserBundle | src/Flowcode/UserBundle/Entity/UserGroup.php | UserGroup.addRole | public function addRole(\Amulen\UserBundle\Entity\Role $role)
{
$this->roles[] = $role;
return $this;
} | php | public function addRole(\Amulen\UserBundle\Entity\Role $role)
{
$this->roles[] = $role;
return $this;
} | [
"public",
"function",
"addRole",
"(",
"\\",
"Amulen",
"\\",
"UserBundle",
"\\",
"Entity",
"\\",
"Role",
"$",
"role",
")",
"{",
"$",
"this",
"->",
"roles",
"[",
"]",
"=",
"$",
"role",
";",
"return",
"$",
"this",
";",
"}"
] | @param \Amulen\UserBundle\Entity\Role $role
@return \Amulen\UserBundle\Entity\UserGroup | [
"@param",
"\\",
"Amulen",
"\\",
"UserBundle",
"\\",
"Entity",
"\\",
"Role",
"$role"
] | train | https://github.com/flowcode/AmulenUserBundle/blob/00055834d9f094e63dcd8d66e2fedb822fcddee0/src/Flowcode/UserBundle/Entity/UserGroup.php#L98-L103 |
mrgarry/yii2-omj-fidavista | FidavistaTransaction.php | FidavistaTransaction.populateData | private function populateData(\DOMNode $node) {
$response = false;
foreach ($node->childNodes as $child) {
if ($child->hasChildNodes()) {
$response[$child->nodeName] = $this->populateData($child);
}
else {
if ($child->n... | php | private function populateData(\DOMNode $node) {
$response = false;
foreach ($node->childNodes as $child) {
if ($child->hasChildNodes()) {
$response[$child->nodeName] = $this->populateData($child);
}
else {
if ($child->n... | [
"private",
"function",
"populateData",
"(",
"\\",
"DOMNode",
"$",
"node",
")",
"{",
"$",
"response",
"=",
"false",
";",
"foreach",
"(",
"$",
"node",
"->",
"childNodes",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"->",
"hasChildNodes",
"(",
... | array | [
"array"
] | train | https://github.com/mrgarry/yii2-omj-fidavista/blob/ee4ecadd6648b68e891352c214ff33a72622941b/FidavistaTransaction.php#L15-L33 |
ouropencode/dachi | src/Template.php | Template.initialize | protected static function initialize() {
$loader = new \Twig_Loader_Filesystem();
foreach(Modules::getAll() as $module)
if(file_exists($module->getPath() . '/Views'))
$loader->addPath($module->getPath() . '/Views', $module->getShortName());
if(file_exists('views')) {
$loader->addPath('views', 'global'... | php | protected static function initialize() {
$loader = new \Twig_Loader_Filesystem();
foreach(Modules::getAll() as $module)
if(file_exists($module->getPath() . '/Views'))
$loader->addPath($module->getPath() . '/Views', $module->getShortName());
if(file_exists('views')) {
$loader->addPath('views', 'global'... | [
"protected",
"static",
"function",
"initialize",
"(",
")",
"{",
"$",
"loader",
"=",
"new",
"\\",
"Twig_Loader_Filesystem",
"(",
")",
";",
"foreach",
"(",
"Modules",
"::",
"getAll",
"(",
")",
"as",
"$",
"module",
")",
"if",
"(",
"file_exists",
"(",
"$",
... | Load the routing information object into memory.
@return null | [
"Load",
"the",
"routing",
"information",
"object",
"into",
"memory",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L21-L159 |
ouropencode/dachi | src/Template.php | Template.get | public static function get($template) {
if(self::$twig === null)
self::initialize();
return self::$twig->loadTemplate($template . '.twig');
} | php | public static function get($template) {
if(self::$twig === null)
self::initialize();
return self::$twig->loadTemplate($template . '.twig');
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"template",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"twig",
"===",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"self",
"::",
"$",
"twig",
"->",
"loadTemplate",
"(",
"$",
"template... | Retreive a twig template object
@param string $template The template file
@return Twig_Template | [
"Retreive",
"a",
"twig",
"template",
"object"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L166-L171 |
ouropencode/dachi | src/Template.php | Template.display | public static function display($template, $target_id) {
if(self::$twig === null)
self::initialize();
self::$render_actions[] = array(
"type" => "display_tpl",
"template" => $template,
"target_id" => $target_id
);
} | php | public static function display($template, $target_id) {
if(self::$twig === null)
self::initialize();
self::$render_actions[] = array(
"type" => "display_tpl",
"template" => $template,
"target_id" => $target_id
);
} | [
"public",
"static",
"function",
"display",
"(",
"$",
"template",
",",
"$",
"target_id",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"twig",
"===",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"self",
"::",
"$",
"render_actions",
"[",
"]",
"=",... | Append a template render action to the render queue
@param string $template The template file
@param string $target_id The dachi-ui-block to load into
@return null | [
"Append",
"a",
"template",
"render",
"action",
"to",
"the",
"render",
"queue"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L179-L188 |
ouropencode/dachi | src/Template.php | Template.render | public static function render() {
$apiMode = Request::isAPI();
if(self::$twig === null)
self::initialize();
$data = Request::getAllData();
if(!$apiMode) {
$data["siteName"] = Configuration::get("dachi.siteName", "Unnamed Dachi Installation");
$data["timezone"] = Configuration::get("dachi.timezone",... | php | public static function render() {
$apiMode = Request::isAPI();
if(self::$twig === null)
self::initialize();
$data = Request::getAllData();
if(!$apiMode) {
$data["siteName"] = Configuration::get("dachi.siteName", "Unnamed Dachi Installation");
$data["timezone"] = Configuration::get("dachi.timezone",... | [
"public",
"static",
"function",
"render",
"(",
")",
"{",
"$",
"apiMode",
"=",
"Request",
"::",
"isAPI",
"(",
")",
";",
"if",
"(",
"self",
"::",
"$",
"twig",
"===",
"null",
")",
"self",
"::",
"initialize",
"(",
")",
";",
"$",
"data",
"=",
"Request",... | Render the render queue to the browser
If the request is an ajax request, the render queue and data will be sent to the browser via JSON.
If the request is a standard request, the render queue will be rendered server-side and will be sent to the browser via HTML.
@internal
@see Router
@return null | [
"Render",
"the",
"render",
"queue",
"to",
"the",
"browser"
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L200-L255 |
ouropencode/dachi | src/Template.php | Template.redirect | public static function redirect($location, $soft = false) {
if(substr($location, 0, 4) !== "http")
$location = Configuration::get("dachi.baseURL") . $location;
self::$render_actions[] = array(
"type" => "redirect",
"location" => $location,
"soft" => $soft
);
} | php | public static function redirect($location, $soft = false) {
if(substr($location, 0, 4) !== "http")
$location = Configuration::get("dachi.baseURL") . $location;
self::$render_actions[] = array(
"type" => "redirect",
"location" => $location,
"soft" => $soft
);
} | [
"public",
"static",
"function",
"redirect",
"(",
"$",
"location",
",",
"$",
"soft",
"=",
"false",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"location",
",",
"0",
",",
"4",
")",
"!==",
"\"http\"",
")",
"$",
"location",
"=",
"Configuration",
"::",
"get"... | Append a redirect action to the render queue.
If $location does not start with "http", the dachi.baseURL configuration value will be prepended
@param string $location The location to redirect to
@return null | [
"Append",
"a",
"redirect",
"action",
"to",
"the",
"render",
"queue",
"."
] | train | https://github.com/ouropencode/dachi/blob/a0e1daf269d0345afbb859ce20ef9da6decd7efe/src/Template.php#L265-L274 |
yuncms/yii2-authentication | models/Authentication.php | Authentication.isAuthentication | public static function isAuthentication($user_id)
{
$user = static::findOne(['user_id' => $user_id]);
return $user ? $user->status == static::STATUS_AUTHENTICATED : false;
} | php | public static function isAuthentication($user_id)
{
$user = static::findOne(['user_id' => $user_id]);
return $user ? $user->status == static::STATUS_AUTHENTICATED : false;
} | [
"public",
"static",
"function",
"isAuthentication",
"(",
"$",
"user_id",
")",
"{",
"$",
"user",
"=",
"static",
"::",
"findOne",
"(",
"[",
"'user_id'",
"=>",
"$",
"user_id",
"]",
")",
";",
"return",
"$",
"user",
"?",
"$",
"user",
"->",
"status",
"==",
... | 是否实名认证
@param int $user_id
@return bool | [
"是否实名认证"
] | train | https://github.com/yuncms/yii2-authentication/blob/02b70f7d2587480edb6dcc18ce256db662f1ed0d/models/Authentication.php#L217-L221 |
yuncms/yii2-authentication | models/Authentication.php | Authentication.beforeDelete | public function beforeDelete()
{
if (parent::beforeDelete()) {
$idCardPath = $this->getIdCardPath($this->user_id);
if (file_exists($idCardPath . '_passport_cover_image.jpg')) {
@unlink($idCardPath . '_passport_cover_image.jpg');
}
if (file_exis... | php | public function beforeDelete()
{
if (parent::beforeDelete()) {
$idCardPath = $this->getIdCardPath($this->user_id);
if (file_exists($idCardPath . '_passport_cover_image.jpg')) {
@unlink($idCardPath . '_passport_cover_image.jpg');
}
if (file_exis... | [
"public",
"function",
"beforeDelete",
"(",
")",
"{",
"if",
"(",
"parent",
"::",
"beforeDelete",
"(",
")",
")",
"{",
"$",
"idCardPath",
"=",
"$",
"this",
"->",
"getIdCardPath",
"(",
"$",
"this",
"->",
"user_id",
")",
";",
"if",
"(",
"file_exists",
"(",
... | 删除前先删除附件
@return bool | [
"删除前先删除附件"
] | train | https://github.com/yuncms/yii2-authentication/blob/02b70f7d2587480edb6dcc18ce256db662f1ed0d/models/Authentication.php#L227-L244 |
Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.access | public function access($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.access') || $user->superAdmin();
} | php | public function access($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.access') || $user->superAdmin();
} | [
"public",
"function",
"access",
"(",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"findOrFail",
"(",
"$",
"user",
"->",
"id",
")",
";",
"return",
"$",
"user",
"->",
"hasPermission",
"(",
"'laralum::users.access'",
")",
"||",
"$",
"user",
"->"... | Determine if the current user can view users module.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"view",
"users",
"module",
"."
] | train | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L19-L24 |
Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.view | public function view($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.view') || $user->superAdmin();
} | php | public function view($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.view') || $user->superAdmin();
} | [
"public",
"function",
"view",
"(",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"findOrFail",
"(",
"$",
"user",
"->",
"id",
")",
";",
"return",
"$",
"user",
"->",
"hasPermission",
"(",
"'laralum::users.view'",
")",
"||",
"$",
"user",
"->",
... | Determine if the current user can view users.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"view",
"users",
"."
] | train | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L33-L38 |
Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.create | public function create($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.create') || $user->superAdmin();
} | php | public function create($user)
{
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.create') || $user->superAdmin();
} | [
"public",
"function",
"create",
"(",
"$",
"user",
")",
"{",
"$",
"user",
"=",
"User",
"::",
"findOrFail",
"(",
"$",
"user",
"->",
"id",
")",
";",
"return",
"$",
"user",
"->",
"hasPermission",
"(",
"'laralum::users.create'",
")",
"||",
"$",
"user",
"->"... | Determine if the current user can create users.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"create",
"users",
"."
] | train | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L47-L52 |
Laralum/Users | src/Policies/UserPolicy.php | UserPolicy.update | public function update($user, User $userToManage)
{
if ($userToManage->id == $user->id || $userToManage->superAdmin()) {
return false;
}
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.update') || $user->superAdmin();
} | php | public function update($user, User $userToManage)
{
if ($userToManage->id == $user->id || $userToManage->superAdmin()) {
return false;
}
$user = User::findOrFail($user->id);
return $user->hasPermission('laralum::users.update') || $user->superAdmin();
} | [
"public",
"function",
"update",
"(",
"$",
"user",
",",
"User",
"$",
"userToManage",
")",
"{",
"if",
"(",
"$",
"userToManage",
"->",
"id",
"==",
"$",
"user",
"->",
"id",
"||",
"$",
"userToManage",
"->",
"superAdmin",
"(",
")",
")",
"{",
"return",
"fal... | Determine if the current user can update users.
@param mixed $user
@return bool | [
"Determine",
"if",
"the",
"current",
"user",
"can",
"update",
"users",
"."
] | train | https://github.com/Laralum/Users/blob/788851d4cdf4bff548936faf1b12cf4697d13428/src/Policies/UserPolicy.php#L61-L70 |
jasny/controller | src/Controller/ContentNegotiation.php | ContentNegotiation.negotiate | protected function negotiate(array $priorities, $type = '')
{
$header = 'Accept';
if ($type) {
$header .= '-' . ucfirst($type);
}
$header = $this->getRequest()->getHeader($header);
$header = join(', ', $header);
$negotiator = $this->getNegotiator($type)... | php | protected function negotiate(array $priorities, $type = '')
{
$header = 'Accept';
if ($type) {
$header .= '-' . ucfirst($type);
}
$header = $this->getRequest()->getHeader($header);
$header = join(', ', $header);
$negotiator = $this->getNegotiator($type)... | [
"protected",
"function",
"negotiate",
"(",
"array",
"$",
"priorities",
",",
"$",
"type",
"=",
"''",
")",
"{",
"$",
"header",
"=",
"'Accept'",
";",
"if",
"(",
"$",
"type",
")",
"{",
"$",
"header",
".=",
"'-'",
".",
"ucfirst",
"(",
"$",
"type",
")",
... | Generalize negotiation
@param array $priorities
@param string $type Negotiator type
@return string | [
"Generalize",
"negotiation"
] | train | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/ContentNegotiation.php#L68-L83 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.isQueryAllowed | public function isQueryAllowed( ezcDbHandler $db, $query )
{
if ( strstr( $query, 'AUTO_INCREMENT' ) ) // detect AUTO_INCREMENT and return imediately. Will process later.
{
return false;
}
if ( substr( $query, 0, 10 ) == 'DROP TABLE' )
{
$tableName = ... | php | public function isQueryAllowed( ezcDbHandler $db, $query )
{
if ( strstr( $query, 'AUTO_INCREMENT' ) ) // detect AUTO_INCREMENT and return imediately. Will process later.
{
return false;
}
if ( substr( $query, 0, 10 ) == 'DROP TABLE' )
{
$tableName = ... | [
"public",
"function",
"isQueryAllowed",
"(",
"ezcDbHandler",
"$",
"db",
",",
"$",
"query",
")",
"{",
"if",
"(",
"strstr",
"(",
"$",
"query",
",",
"'AUTO_INCREMENT'",
")",
")",
"// detect AUTO_INCREMENT and return imediately. Will process later.",
"{",
"return",
"fal... | Checks if query allowed.
Perform testing if table exist for DROP TABLE query
to avoid stoping execution while try to drop not existent table.
@param ezcDbHandler $db
@param string $query
@return boolean false if query should not be executed. | [
"Checks",
"if",
"query",
"allowed",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L47-L80 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.applyDiffToDb | public function applyDiffToDb( ezcDbHandler $db, ezcDbSchemaDiff $dbSchemaDiff )
{
$db->beginTransaction();
foreach ( $this->convertDiffToDDL( $dbSchemaDiff, $db ) as $query )
{
if ( $this->isQueryAllowed( $db, $query ) )
{
$db->exec( $query );
... | php | public function applyDiffToDb( ezcDbHandler $db, ezcDbSchemaDiff $dbSchemaDiff )
{
$db->beginTransaction();
foreach ( $this->convertDiffToDDL( $dbSchemaDiff, $db ) as $query )
{
if ( $this->isQueryAllowed( $db, $query ) )
{
$db->exec( $query );
... | [
"public",
"function",
"applyDiffToDb",
"(",
"ezcDbHandler",
"$",
"db",
",",
"ezcDbSchemaDiff",
"$",
"dbSchemaDiff",
")",
"{",
"$",
"db",
"->",
"beginTransaction",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"convertDiffToDDL",
"(",
"$",
"dbSchemaDiff",
... | Applies the differences defined in $dbSchemaDiff to the database referenced by $db.
This method uses {@link convertDiffToDDL} to create SQL for the
differences and then executes the returned SQL statements on the
database handler $db.
@todo check for failed transaction
@param ezcDbHandler $db
@param ezcDbSchemaDi... | [
"Applies",
"the",
"differences",
"defined",
"in",
"$dbSchemaDiff",
"to",
"the",
"database",
"referenced",
"by",
"$db",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L106-L134 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.addAutoIncrementField | private function addAutoIncrementField( $db, $tableName, $autoIncrementFieldName, $autoIncrementFieldType )
{
// fetching field info from Oracle, getting column position of autoincrement field
// @apichange This code piece would become orphan, with the new
// implementation. We still need ... | php | private function addAutoIncrementField( $db, $tableName, $autoIncrementFieldName, $autoIncrementFieldType )
{
// fetching field info from Oracle, getting column position of autoincrement field
// @apichange This code piece would become orphan, with the new
// implementation. We still need ... | [
"private",
"function",
"addAutoIncrementField",
"(",
"$",
"db",
",",
"$",
"tableName",
",",
"$",
"autoIncrementFieldName",
",",
"$",
"autoIncrementFieldType",
")",
"{",
"// fetching field info from Oracle, getting column position of autoincrement field",
"// @apichange This code ... | Performs changing field in Oracle table.
(workaround for "ALTER TABLE table MODIFY field fieldType AUTO_INCREMENT " that not alowed in Oracle ).
@param ezcDbHandler $db
@param string $tableName
@param string $autoIncrementFieldName
@param string $autoIncrementFieldType | [
"Performs",
"changing",
"field",
"in",
"Oracle",
"table",
".",
"(",
"workaround",
"for",
"ALTER",
"TABLE",
"table",
"MODIFY",
"field",
"fieldType",
"AUTO_INCREMENT",
"that",
"not",
"alowed",
"in",
"Oracle",
")",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L145-L204 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.convertDiffToDDL | public function convertDiffToDDL( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db = null )
{
$this->diffSchema = $dbSchemaDiff;
// reset queries
$this->queries = array();
$this->context = array();
// Find sequences which require explicit drop statesments, see bug
/... | php | public function convertDiffToDDL( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db = null )
{
$this->diffSchema = $dbSchemaDiff;
// reset queries
$this->queries = array();
$this->context = array();
// Find sequences which require explicit drop statesments, see bug
/... | [
"public",
"function",
"convertDiffToDDL",
"(",
"ezcDbSchemaDiff",
"$",
"dbSchemaDiff",
",",
"ezcDbHandler",
"$",
"db",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"diffSchema",
"=",
"$",
"dbSchemaDiff",
";",
"// reset queries",
"$",
"this",
"->",
"queries",
"=",... | Returns the differences definition in $dbSchema as database specific SQL DDL queries.
@param ezcDbSchemaDiff $dbSchemaDiff
@param ezcDbHandler $db
@return array(string) | [
"Returns",
"the",
"differences",
"definition",
"in",
"$dbSchema",
"as",
"database",
"specific",
"SQL",
"DDL",
"queries",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L214-L231 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.generateAdditionalDropSequenceStatements | protected function generateAdditionalDropSequenceStatements( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db )
{
$reader = new ezcDbSchemaOracleReader();
$schema = $reader->loadFromDb( $db )->getSchema();
foreach ( $dbSchemaDiff->removedTables as $table => $true )
{
forea... | php | protected function generateAdditionalDropSequenceStatements( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db )
{
$reader = new ezcDbSchemaOracleReader();
$schema = $reader->loadFromDb( $db )->getSchema();
foreach ( $dbSchemaDiff->removedTables as $table => $true )
{
forea... | [
"protected",
"function",
"generateAdditionalDropSequenceStatements",
"(",
"ezcDbSchemaDiff",
"$",
"dbSchemaDiff",
",",
"ezcDbHandler",
"$",
"db",
")",
"{",
"$",
"reader",
"=",
"new",
"ezcDbSchemaOracleReader",
"(",
")",
";",
"$",
"schema",
"=",
"$",
"reader",
"->"... | Generate additional drop sequence statements
Some sequences might not be dropped automatically, this method generates
additional DROP SEQUENCE queries for those.
Since Oracle only allows sequence identifiers up to 30 characters
sequences for long table / column names may be shortened. In this case
the sequence name d... | [
"Generate",
"additional",
"drop",
"sequence",
"statements"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L252-L272 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.convertFromGenericType | protected function convertFromGenericType( ezcDbSchemaField $fieldDefinition )
{
$typeAddition = '';
if ( in_array( $fieldDefinition->type, array( 'decimal', 'text' ) ) )
{
if ( $fieldDefinition->length !== false && $fieldDefinition->length !== 0 )
{
$... | php | protected function convertFromGenericType( ezcDbSchemaField $fieldDefinition )
{
$typeAddition = '';
if ( in_array( $fieldDefinition->type, array( 'decimal', 'text' ) ) )
{
if ( $fieldDefinition->length !== false && $fieldDefinition->length !== 0 )
{
$... | [
"protected",
"function",
"convertFromGenericType",
"(",
"ezcDbSchemaField",
"$",
"fieldDefinition",
")",
"{",
"$",
"typeAddition",
"=",
"''",
";",
"if",
"(",
"in_array",
"(",
"$",
"fieldDefinition",
"->",
"type",
",",
"array",
"(",
"'decimal'",
",",
"'text'",
... | Converts the generic field type contained in $fieldDefinition to a database specific field definition.
@param ezcDbSchemaField $fieldDefinition
@return string | [
"Converts",
"the",
"generic",
"field",
"type",
"contained",
"in",
"$fieldDefinition",
"to",
"a",
"database",
"specific",
"field",
"definition",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L290-L320 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.generateCreateTableSql | protected function generateCreateTableSql( $tableName, ezcDbSchemaTable $tableDefinition )
{
$sql = '';
$sql .= "CREATE TABLE \"{$tableName}\" (\n";
$this->context['skip_primary'] = false;
// dump fields
$fieldsSQL = array();
$autoincrementSQL = array();
$fie... | php | protected function generateCreateTableSql( $tableName, ezcDbSchemaTable $tableDefinition )
{
$sql = '';
$sql .= "CREATE TABLE \"{$tableName}\" (\n";
$this->context['skip_primary'] = false;
// dump fields
$fieldsSQL = array();
$autoincrementSQL = array();
$fie... | [
"protected",
"function",
"generateCreateTableSql",
"(",
"$",
"tableName",
",",
"ezcDbSchemaTable",
"$",
"tableDefinition",
")",
"{",
"$",
"sql",
"=",
"''",
";",
"$",
"sql",
".=",
"\"CREATE TABLE \\\"{$tableName}\\\" (\\n\"",
";",
"$",
"this",
"->",
"context",
"[",... | Adds a "create table" query for the table $tableName with
definition $tableDefinition to the internal list of queries.
Adds additional CREATE queries for sequences and triggers
to implement autoincrement fields that not supported in Oracle directly.
@param string $tableName
@param ezcDbSchemaTable $tableDef... | [
"Adds",
"a",
"create",
"table",
"query",
"for",
"the",
"table",
"$tableName",
"with",
"definition",
"$tableDefinition",
"to",
"the",
"internal",
"list",
"of",
"queries",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L332-L379 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.generateChangeFieldSql | protected function generateChangeFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
{
if ( !$fieldDefinition->autoIncrement )
{
$this->queries[] = "ALTER TABLE \"$tableName\" MODIFY " .
$this->generateFieldSql( $fieldName, $fieldDefinitio... | php | protected function generateChangeFieldSql( $tableName, $fieldName, ezcDbSchemaField $fieldDefinition )
{
if ( !$fieldDefinition->autoIncrement )
{
$this->queries[] = "ALTER TABLE \"$tableName\" MODIFY " .
$this->generateFieldSql( $fieldName, $fieldDefinitio... | [
"protected",
"function",
"generateChangeFieldSql",
"(",
"$",
"tableName",
",",
"$",
"fieldName",
",",
"ezcDbSchemaField",
"$",
"fieldDefinition",
")",
"{",
"if",
"(",
"!",
"$",
"fieldDefinition",
"->",
"autoIncrement",
")",
"{",
"$",
"this",
"->",
"queries",
"... | Adds a "alter table" query to change the field $fieldName to $tableName with the definition $fieldDefinition.
@param string $tableName
@param string $fieldName
@param ezcDbSchemaField $fieldDefinition | [
"Adds",
"a",
"alter",
"table",
"query",
"to",
"change",
"the",
"field",
"$fieldName",
"to",
"$tableName",
"with",
"the",
"definition",
"$fieldDefinition",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L418-L431 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php | ezcDbSchemaOracleWriter.generateDropIndexSql | protected function generateDropIndexSql( $tableName, $indexName )
{
if ( $indexName == 'primary' ) // handling primary indexes
{
$constraintName = ezcDbSchemaOracleHelper::generateSuffixedIdentName( array( $tableName ), "pkey");
$this->queries[] = "ALTER TABLE \"$tableName\" ... | php | protected function generateDropIndexSql( $tableName, $indexName )
{
if ( $indexName == 'primary' ) // handling primary indexes
{
$constraintName = ezcDbSchemaOracleHelper::generateSuffixedIdentName( array( $tableName ), "pkey");
$this->queries[] = "ALTER TABLE \"$tableName\" ... | [
"protected",
"function",
"generateDropIndexSql",
"(",
"$",
"tableName",
",",
"$",
"indexName",
")",
"{",
"if",
"(",
"$",
"indexName",
"==",
"'primary'",
")",
"// handling primary indexes",
"{",
"$",
"constraintName",
"=",
"ezcDbSchemaOracleHelper",
"::",
"generateSu... | Adds a "alter table" query to remote the index $indexName from the table $tableName to the internal list of queries.
@param string $tableName
@param string $indexName | [
"Adds",
"a",
"alter",
"table",
"query",
"to",
"remote",
"the",
"index",
"$indexName",
"from",
"the",
"table",
"$tableName",
"to",
"the",
"internal",
"list",
"of",
"queries",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php#L548-L559 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveApi | public function resolveApi()
{
return !isset($this->cache[$key = 'api'])
? $this->cache[$key] = $this->parameterResolver->resolveApi()
: $this->cache[$key];
} | php | public function resolveApi()
{
return !isset($this->cache[$key = 'api'])
? $this->cache[$key] = $this->parameterResolver->resolveApi()
: $this->cache[$key];
} | [
"public",
"function",
"resolveApi",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'api'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"parameterResolver",... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L42-L47 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveCriteria | public function resolveCriteria($mandatory = false)
{
if (isset($this->cache[$key = 'criteria'])) {
$criteria = $this->cache[$key];
if (!empty($criteria) || !$mandatory) {
return $criteria;
}
}
return $this->cache[$key] = $this->parameter... | php | public function resolveCriteria($mandatory = false)
{
if (isset($this->cache[$key = 'criteria'])) {
$criteria = $this->cache[$key];
if (!empty($criteria) || !$mandatory) {
return $criteria;
}
}
return $this->cache[$key] = $this->parameter... | [
"public",
"function",
"resolveCriteria",
"(",
"$",
"mandatory",
"=",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'criteria'",
"]",
")",
")",
"{",
"$",
"criteria",
"=",
"$",
"this",
"->",
"cache",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L52-L63 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveCurrentPage | public function resolveCurrentPage()
{
return !isset($this->cache[$key = 'current_page'])
? $this->cache[$key] = $this->parameterResolver->resolveCurrentPage()
: $this->cache[$key];
} | php | public function resolveCurrentPage()
{
return !isset($this->cache[$key = 'current_page'])
? $this->cache[$key] = $this->parameterResolver->resolveCurrentPage()
: $this->cache[$key];
} | [
"public",
"function",
"resolveCurrentPage",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'current_page'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"pa... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L68-L73 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveForm | public function resolveForm(ResourceInterface $resource)
{
return !isset($this->cache[$key = 'form_'.spl_object_hash($resource)])
? $this->cache[$key] = $this->parameterResolver->resolveForm($resource)
: $this->cache[$key];
} | php | public function resolveForm(ResourceInterface $resource)
{
return !isset($this->cache[$key = 'form_'.spl_object_hash($resource)])
? $this->cache[$key] = $this->parameterResolver->resolveForm($resource)
: $this->cache[$key];
} | [
"public",
"function",
"resolveForm",
"(",
"ResourceInterface",
"$",
"resource",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'form_'",
".",
"spl_object_hash",
"(",
"$",
"resource",
")",
"]",
")",
"?",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L78-L83 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveHateoas | public function resolveHateoas()
{
return !isset($this->cache[$key = 'hateoas'])
? $this->cache[$key] = $this->parameterResolver->resolveHateoas()
: $this->cache[$key];
} | php | public function resolveHateoas()
{
return !isset($this->cache[$key = 'hateoas'])
? $this->cache[$key] = $this->parameterResolver->resolveHateoas()
: $this->cache[$key];
} | [
"public",
"function",
"resolveHateoas",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'hateoas'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"parameterRe... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L98-L103 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveLocationRoute | public function resolveLocationRoute()
{
return !isset($this->cache[$key = 'location_route'])
? $this->cache[$key] = $this->parameterResolver->resolveLocationRoute()
: $this->cache[$key];
} | php | public function resolveLocationRoute()
{
return !isset($this->cache[$key = 'location_route'])
? $this->cache[$key] = $this->parameterResolver->resolveLocationRoute()
: $this->cache[$key];
} | [
"public",
"function",
"resolveLocationRoute",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'location_route'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L108-L113 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveLocationRouteParameters | public function resolveLocationRouteParameters($object)
{
return !isset($this->cache[$key = 'location_route_parameters_'.spl_object_hash($object)])
? $this->cache[$key] = $this->parameterResolver->resolveLocationRouteParameters($object)
: $this->cache[$key];
} | php | public function resolveLocationRouteParameters($object)
{
return !isset($this->cache[$key = 'location_route_parameters_'.spl_object_hash($object)])
? $this->cache[$key] = $this->parameterResolver->resolveLocationRouteParameters($object)
: $this->cache[$key];
} | [
"public",
"function",
"resolveLocationRouteParameters",
"(",
"$",
"object",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'location_route_parameters_'",
".",
"spl_object_hash",
"(",
"$",
"object",
")",
"]",
")",
"?... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L118-L123 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveMaxPerPage | public function resolveMaxPerPage()
{
return !isset($this->cache[$key = 'max_per_page'])
? $this->cache[$key] = $this->parameterResolver->resolveMaxPerPage()
: $this->cache[$key];
} | php | public function resolveMaxPerPage()
{
return !isset($this->cache[$key = 'max_per_page'])
? $this->cache[$key] = $this->parameterResolver->resolveMaxPerPage()
: $this->cache[$key];
} | [
"public",
"function",
"resolveMaxPerPage",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'max_per_page'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"par... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L128-L133 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveRedirectRoute | public function resolveRedirectRoute()
{
return !isset($this->cache[$key = 'redirect_route'])
? $this->cache[$key] = $this->parameterResolver->resolveRedirectRoute()
: $this->cache[$key];
} | php | public function resolveRedirectRoute()
{
return !isset($this->cache[$key = 'redirect_route'])
? $this->cache[$key] = $this->parameterResolver->resolveRedirectRoute()
: $this->cache[$key];
} | [
"public",
"function",
"resolveRedirectRoute",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'redirect_route'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L138-L143 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveRedirectRouteParameters | public function resolveRedirectRouteParameters($object = null, $forwardParameters = false)
{
$key = 'redirect_route_parameters';
if ($object !== null) {
$key .= '_'.spl_object_hash($object);
}
if ($forwardParameters) {
$key .= '_forward';
}
... | php | public function resolveRedirectRouteParameters($object = null, $forwardParameters = false)
{
$key = 'redirect_route_parameters';
if ($object !== null) {
$key .= '_'.spl_object_hash($object);
}
if ($forwardParameters) {
$key .= '_forward';
}
... | [
"public",
"function",
"resolveRedirectRouteParameters",
"(",
"$",
"object",
"=",
"null",
",",
"$",
"forwardParameters",
"=",
"false",
")",
"{",
"$",
"key",
"=",
"'redirect_route_parameters'",
";",
"if",
"(",
"$",
"object",
"!==",
"null",
")",
"{",
"$",
"key"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L148-L166 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveRepositoryMethod | public function resolveRepositoryMethod($action)
{
return !isset($this->cache[$key = 'repository_method_'.$action])
? $this->cache[$key] = $this->parameterResolver->resolveRepositoryMethod($action)
: $this->cache[$key];
} | php | public function resolveRepositoryMethod($action)
{
return !isset($this->cache[$key = 'repository_method_'.$action])
? $this->cache[$key] = $this->parameterResolver->resolveRepositoryMethod($action)
: $this->cache[$key];
} | [
"public",
"function",
"resolveRepositoryMethod",
"(",
"$",
"action",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'repository_method_'",
".",
"$",
"action",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L181-L186 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveSerializerGroups | public function resolveSerializerGroups()
{
return !isset($this->cache[$key = 'serializer_groups'])
? $this->cache[$key] = $this->parameterResolver->resolveSerializerGroups()
: $this->cache[$key];
} | php | public function resolveSerializerGroups()
{
return !isset($this->cache[$key = 'serializer_groups'])
? $this->cache[$key] = $this->parameterResolver->resolveSerializerGroups()
: $this->cache[$key];
} | [
"public",
"function",
"resolveSerializerGroups",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'serializer_groups'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L191-L196 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveSerializerNull | public function resolveSerializerNull()
{
return !isset($this->cache[$key = 'serializer_null'])
? $this->cache[$key] = $this->parameterResolver->resolveSerializerNull()
: $this->cache[$key];
} | php | public function resolveSerializerNull()
{
return !isset($this->cache[$key = 'serializer_null'])
? $this->cache[$key] = $this->parameterResolver->resolveSerializerNull()
: $this->cache[$key];
} | [
"public",
"function",
"resolveSerializerNull",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'serializer_null'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L201-L206 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveSorting | public function resolveSorting()
{
return !isset($this->cache[$key = 'sorting'])
? $this->cache[$key] = $this->parameterResolver->resolveSorting()
: $this->cache[$key];
} | php | public function resolveSorting()
{
return !isset($this->cache[$key = 'sorting'])
? $this->cache[$key] = $this->parameterResolver->resolveSorting()
: $this->cache[$key];
} | [
"public",
"function",
"resolveSorting",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'sorting'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"parameterRe... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L211-L216 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveStatusCode | public function resolveStatusCode($statusCode)
{
return !isset($this->cache[$key = 'status_code_'.$statusCode])
? $this->cache[$key] = $this->parameterResolver->resolveStatusCode($statusCode)
: $this->cache[$key];
} | php | public function resolveStatusCode($statusCode)
{
return !isset($this->cache[$key = 'status_code_'.$statusCode])
? $this->cache[$key] = $this->parameterResolver->resolveStatusCode($statusCode)
: $this->cache[$key];
} | [
"public",
"function",
"resolveStatusCode",
"(",
"$",
"statusCode",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'status_code_'",
".",
"$",
"statusCode",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L221-L226 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveTemplate | public function resolveTemplate()
{
return !isset($this->cache[$key = 'template'])
? $this->cache[$key] = $this->parameterResolver->resolveTemplate()
: $this->cache[$key];
} | php | public function resolveTemplate()
{
return !isset($this->cache[$key = 'template'])
? $this->cache[$key] = $this->parameterResolver->resolveTemplate()
: $this->cache[$key];
} | [
"public",
"function",
"resolveTemplate",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'template'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"parameter... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L231-L236 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveThemes | public function resolveThemes()
{
return !isset($this->cache[$key = 'themes'])
? $this->cache[$key] = $this->parameterResolver->resolveThemes()
: $this->cache[$key];
} | php | public function resolveThemes()
{
return !isset($this->cache[$key = 'themes'])
? $this->cache[$key] = $this->parameterResolver->resolveThemes()
: $this->cache[$key];
} | [
"public",
"function",
"resolveThemes",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'themes'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"parameterReso... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L241-L246 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveTranslationDomain | public function resolveTranslationDomain()
{
return !isset($this->cache[$key = 'translation_domain'])
? $this->cache[$key] = $this->parameterResolver->resolveTranslationDomain()
: $this->cache[$key];
} | php | public function resolveTranslationDomain()
{
return !isset($this->cache[$key = 'translation_domain'])
? $this->cache[$key] = $this->parameterResolver->resolveTranslationDomain()
: $this->cache[$key];
} | [
"public",
"function",
"resolveTranslationDomain",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'translation_domain'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L251-L256 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveValidationGroups | public function resolveValidationGroups()
{
return !isset($this->cache[$key = 'validation_groups'])
? $this->cache[$key] = $this->parameterResolver->resolveValidationGroups()
: $this->cache[$key];
} | php | public function resolveValidationGroups()
{
return !isset($this->cache[$key = 'validation_groups'])
? $this->cache[$key] = $this->parameterResolver->resolveValidationGroups()
: $this->cache[$key];
} | [
"public",
"function",
"resolveValidationGroups",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'validation_groups'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L261-L266 |
php-lug/lug | src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php | CachedParameterResolver.resolveVoter | public function resolveVoter()
{
return !isset($this->cache[$key = 'voter'])
? $this->cache[$key] = $this->parameterResolver->resolveVoter()
: $this->cache[$key];
} | php | public function resolveVoter()
{
return !isset($this->cache[$key = 'voter'])
? $this->cache[$key] = $this->parameterResolver->resolveVoter()
: $this->cache[$key];
} | [
"public",
"function",
"resolveVoter",
"(",
")",
"{",
"return",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"=",
"'voter'",
"]",
")",
"?",
"$",
"this",
"->",
"cache",
"[",
"$",
"key",
"]",
"=",
"$",
"this",
"->",
"parameterResolv... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Routing/CachedParameterResolver.php#L271-L276 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.main | public function main()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'starting...');
try
{
/* Общая инициализация */
$this->checkEnvironment();
$this->createFileStructure();
/* Подключение старого ядра */
Eresus_Kernel::log(__METH... | php | public function main()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'starting...');
try
{
/* Общая инициализация */
$this->checkEnvironment();
$this->createFileStructure();
/* Подключение старого ядра */
Eresus_Kernel::log(__METH... | [
"public",
"function",
"main",
"(",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'starting...'",
")",
";",
"try",
"{",
"/* Общая инициализация */",
"$",
"this",
"->",
"checkEnvironment",
"(",
")",
";",
"$",
"this",
"->",
... | Основной метод приложения
@return int Код завершения для консольных вызовов
@see EresusApplication#main() | [
"Основной",
"метод",
"приложения"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L91-L130 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.checkEnvironment | protected function checkEnvironment()
{
$errors = array();
/* Проверяем наличие нужных файлов */
$required = array('cfg/main.php');
foreach ($required as $filename)
{
if (!file_exists($filename))
{
$errors []= array('file' => $filename... | php | protected function checkEnvironment()
{
$errors = array();
/* Проверяем наличие нужных файлов */
$required = array('cfg/main.php');
foreach ($required as $filename)
{
if (!file_exists($filename))
{
$errors []= array('file' => $filename... | [
"protected",
"function",
"checkEnvironment",
"(",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"/* Проверяем наличие нужных файлов */",
"$",
"required",
"=",
"array",
"(",
"'cfg/main.php'",
")",
";",
"foreach",
"(",
"$",
"required",
"as",
"$",
"filena... | Проверка окружения
@return void | [
"Проверка",
"окружения"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L223-L264 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.createFileStructure | protected function createFileStructure()
{
$dirs = array(
'/var/log',
'/var/cache',
'/var/cache/templates',
);
foreach ($dirs as $dir)
{
if (!file_exists($this->getFsRoot() . $dir))
{
$umask = umask(0000);
... | php | protected function createFileStructure()
{
$dirs = array(
'/var/log',
'/var/cache',
'/var/cache/templates',
);
foreach ($dirs as $dir)
{
if (!file_exists($this->getFsRoot() . $dir))
{
$umask = umask(0000);
... | [
"protected",
"function",
"createFileStructure",
"(",
")",
"{",
"$",
"dirs",
"=",
"array",
"(",
"'/var/log'",
",",
"'/var/cache'",
",",
"'/var/cache/templates'",
",",
")",
";",
"foreach",
"(",
"$",
"dirs",
"as",
"$",
"dir",
")",
"{",
"if",
"(",
"!",
"file... | Создание файловой структуры
@return void | [
"Создание",
"файловой",
"структуры"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L271-L289 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.runWeb | protected function runWeb()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()');
$request = new Eresus_CMS_Request(Eresus_HTTP_Request::createFromGlobals());
$request->setSiteRoot($this->detectWebRoot());
// TODO Удалить где-нибудь в 3.03-04
TemplateSettings::setGlobalValue('... | php | protected function runWeb()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()');
$request = new Eresus_CMS_Request(Eresus_HTTP_Request::createFromGlobals());
$request->setSiteRoot($this->detectWebRoot());
// TODO Удалить где-нибудь в 3.03-04
TemplateSettings::setGlobalValue('... | [
"protected",
"function",
"runWeb",
"(",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'()'",
")",
";",
"$",
"request",
"=",
"new",
"Eresus_CMS_Request",
"(",
"Eresus_HTTP_Request",
"::",
"createFromGlobals",
"(",
")",
")",
... | Выполнение в режиме Web | [
"Выполнение",
"в",
"режиме",
"Web"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L294-L330 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.detectWebRoot | protected function detectWebRoot()
{
$webServer = WebServer::getInstance();
$documentRoot = $webServer->getDocumentRoot();
$suffix = $this->getFsRoot();
$suffix = substr($suffix, strlen($documentRoot));
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'detected root: %s', $suffix);
... | php | protected function detectWebRoot()
{
$webServer = WebServer::getInstance();
$documentRoot = $webServer->getDocumentRoot();
$suffix = $this->getFsRoot();
$suffix = substr($suffix, strlen($documentRoot));
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'detected root: %s', $suffix);
... | [
"protected",
"function",
"detectWebRoot",
"(",
")",
"{",
"$",
"webServer",
"=",
"WebServer",
"::",
"getInstance",
"(",
")",
";",
"$",
"documentRoot",
"=",
"$",
"webServer",
"->",
"getDocumentRoot",
"(",
")",
";",
"$",
"suffix",
"=",
"$",
"this",
"->",
"g... | Определяет и возвращает корневой адрес сайта
@return string | [
"Определяет",
"и",
"возвращает",
"корневой",
"адрес",
"сайта"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L337-L345 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.initConf | protected function initConf()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()');
/*
* Переменную $Eresus приходится делать глобальной, чтобы файл конфигурации
* мог записывать в неё свои значения.
* TODO Избавиться от глобальной переменной
*/
/** @noinspe... | php | protected function initConf()
{
Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()');
/*
* Переменную $Eresus приходится делать глобальной, чтобы файл конфигурации
* мог записывать в неё свои значения.
* TODO Избавиться от глобальной переменной
*/
/** @noinspe... | [
"protected",
"function",
"initConf",
"(",
")",
"{",
"Eresus_Kernel",
"::",
"log",
"(",
"__METHOD__",
",",
"LOG_DEBUG",
",",
"'()'",
")",
";",
"/*\n * Переменную $Eresus приходится делать глобальной, чтобы файл конфигурации\n * мог записывать в неё свои значения.\n ... | Инициализация конфигурации | [
"Инициализация",
"конфигурации"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L350-L373 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.call3rdPartyExtension | protected function call3rdPartyExtension(Eresus_CMS_Request $request)
{
$extension = substr($request->getDirectory(), 9);
if (($p = strpos($extension, '/')) !== false)
{
$extension = substr($extension, 0, $p);
}
$filename = $this->getFsRoot() . '/ext-3rd/' . $ext... | php | protected function call3rdPartyExtension(Eresus_CMS_Request $request)
{
$extension = substr($request->getDirectory(), 9);
if (($p = strpos($extension, '/')) !== false)
{
$extension = substr($extension, 0, $p);
}
$filename = $this->getFsRoot() . '/ext-3rd/' . $ext... | [
"protected",
"function",
"call3rdPartyExtension",
"(",
"Eresus_CMS_Request",
"$",
"request",
")",
"{",
"$",
"extension",
"=",
"substr",
"(",
"$",
"request",
"->",
"getDirectory",
"(",
")",
",",
"9",
")",
";",
"if",
"(",
"(",
"$",
"p",
"=",
"strpos",
"(",... | Обрабатывает запрос к стороннему расширению
Вызов производится через коннектор этого расширения
@param Eresus_CMS_Request $request
@return void | [
"Обрабатывает",
"запрос",
"к",
"стороннему",
"расширению"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L384-L407 |
Eresus/EresusCMS | src/core/CMS.php | Eresus_CMS.initSite | private function initSite()
{
$this->site = new Eresus_Site($this->getLegacyKernel());
$this->site->setTitle(siteTitle);
$this->site->setDescription(siteDescription);
$this->site->setKeywords(siteKeywords);
TemplateSettings::setGlobalValue('site', $this->site);
} | php | private function initSite()
{
$this->site = new Eresus_Site($this->getLegacyKernel());
$this->site->setTitle(siteTitle);
$this->site->setDescription(siteDescription);
$this->site->setKeywords(siteKeywords);
TemplateSettings::setGlobalValue('site', $this->site);
} | [
"private",
"function",
"initSite",
"(",
")",
"{",
"$",
"this",
"->",
"site",
"=",
"new",
"Eresus_Site",
"(",
"$",
"this",
"->",
"getLegacyKernel",
"(",
")",
")",
";",
"$",
"this",
"->",
"site",
"->",
"setTitle",
"(",
"siteTitle",
")",
";",
"$",
"this... | Инициализирует сайт
@return void
@since 3.01 | [
"Инициализирует",
"сайт"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/CMS.php#L416-L423 |
novaway/open-graph | src/OpenGraphGeneratorBuilder.php | OpenGraphGeneratorBuilder.build | public function build()
{
$annotationReader = $this->annotationReader;
if (null === $annotationReader) {
$annotationReader = new AnnotationReader();
if (null !== $this->cacheDirectory) {
$cacheDirectory = sprintf('%s/annotations', $this->cacheDirectory);
... | php | public function build()
{
$annotationReader = $this->annotationReader;
if (null === $annotationReader) {
$annotationReader = new AnnotationReader();
if (null !== $this->cacheDirectory) {
$cacheDirectory = sprintf('%s/annotations', $this->cacheDirectory);
... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"annotationReader",
"=",
"$",
"this",
"->",
"annotationReader",
";",
"if",
"(",
"null",
"===",
"$",
"annotationReader",
")",
"{",
"$",
"annotationReader",
"=",
"new",
"AnnotationReader",
"(",
")",
";",
"if... | Create open graph object | [
"Create",
"open",
"graph",
"object"
] | train | https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/OpenGraphGeneratorBuilder.php#L59-L85 |
novaway/open-graph | src/OpenGraphGeneratorBuilder.php | OpenGraphGeneratorBuilder.setCacheDirectory | public function setCacheDirectory($directory)
{
if (!is_dir($directory)) {
$this->createDirectory($directory);
}
if (!is_writable($directory)) {
throw new \InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
}
$this-... | php | public function setCacheDirectory($directory)
{
if (!is_dir($directory)) {
$this->createDirectory($directory);
}
if (!is_writable($directory)) {
throw new \InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir));
}
$this-... | [
"public",
"function",
"setCacheDirectory",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"$",
"this",
"->",
"createDirectory",
"(",
"$",
"directory",
")",
";",
"}",
"if",
"(",
"!",
"is_writable",
"(",
... | Set cache directory
@param string $directory
@return OpenGraphGeneratorBuilder | [
"Set",
"cache",
"directory"
] | train | https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/OpenGraphGeneratorBuilder.php#L132-L145 |
novaway/open-graph | src/OpenGraphGeneratorBuilder.php | OpenGraphGeneratorBuilder.createDirectory | private function createDirectory($directory)
{
if (is_dir($directory)) {
return;
}
if (false === @mkdir($directory, 0777, true)) {
throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir));
}
} | php | private function createDirectory($directory)
{
if (is_dir($directory)) {
return;
}
if (false === @mkdir($directory, 0777, true)) {
throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir));
}
} | [
"private",
"function",
"createDirectory",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"false",
"===",
"@",
"mkdir",
"(",
"$",
"directory",
",",
"0777",
",",
"true",
")",
... | Create directory
@param string $directory | [
"Create",
"directory"
] | train | https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/OpenGraphGeneratorBuilder.php#L233-L242 |
mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/Type/BaseSelectorType.php | BaseSelectorType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
// Store number by default. If the extending class wants to provide
// e.g. object storage, override this method in the extending class.
$builder->addViewTransformer(new NumberToLocalizedStringTransformer(
... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
// Store number by default. If the extending class wants to provide
// e.g. object storage, override this method in the extending class.
$builder->addViewTransformer(new NumberToLocalizedStringTransformer(
... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"// Store number by default. If the extending class wants to provide",
"// e.g. object storage, override this method in the extending class.",
"$",
"builder",
"->... | {@inheritdoc} | [
"{"
] | train | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/Type/BaseSelectorType.php#L22-L31 |
spalax/msgfmt | src/Msgfmt/Generate.php | Generate.parsePoFile | protected function parsePoFile($poFile)
{
// read .po file
$fc= file_get_contents($poFile);
// normalize newlines
$fc= str_replace(array (
"\r\n",
"\r"
), array (
"\n",
"\n"
), $fc);
// results array
$ha... | php | protected function parsePoFile($poFile)
{
// read .po file
$fc= file_get_contents($poFile);
// normalize newlines
$fc= str_replace(array (
"\r\n",
"\r"
), array (
"\n",
"\n"
), $fc);
// results array
$ha... | [
"protected",
"function",
"parsePoFile",
"(",
"$",
"poFile",
")",
"{",
"// read .po file",
"$",
"fc",
"=",
"file_get_contents",
"(",
"$",
"poFile",
")",
";",
"// normalize newlines",
"$",
"fc",
"=",
"str_replace",
"(",
"array",
"(",
"\"\\r\\n\"",
",",
"\"\\r\""... | @param string $poFile
@return array|bool | [
"@param",
"string",
"$poFile"
] | train | https://github.com/spalax/msgfmt/blob/4f5e1ffc94fd86b54130a94aec6180cb8faf25e0/src/Msgfmt/Generate.php#L42-L150 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/utilities_sqlite.php | ezcDbUtilitiesSqlite.cleanup | public function cleanup()
{
$this->db->begin();
$rslt = $this->db->query( 'SELECT * FROM SQLITE_MASTER' );
$rslt->setFetchMode( PDO::FETCH_NUM );
$rows = $rslt->fetchAll();
foreach ( $rows as $row )
{
$table = $row[0];
$this->db->exec( "DROP TA... | php | public function cleanup()
{
$this->db->begin();
$rslt = $this->db->query( 'SELECT * FROM SQLITE_MASTER' );
$rslt->setFetchMode( PDO::FETCH_NUM );
$rows = $rslt->fetchAll();
foreach ( $rows as $row )
{
$table = $row[0];
$this->db->exec( "DROP TA... | [
"public",
"function",
"cleanup",
"(",
")",
"{",
"$",
"this",
"->",
"db",
"->",
"begin",
"(",
")",
";",
"$",
"rslt",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"'SELECT * FROM SQLITE_MASTER'",
")",
";",
"$",
"rslt",
"->",
"setFetchMode",
"(",
"... | Remove all tables from the database. | [
"Remove",
"all",
"tables",
"from",
"the",
"database",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/utilities_sqlite.php#L41-L53 |
mothership-ec/composer | src/Composer/Repository/Vcs/PerforceDriver.php | PerforceDriver.initialize | public function initialize()
{
$this->depot = $this->repoConfig['depot'];
$this->branch = '';
if (!empty($this->repoConfig['branch'])) {
$this->branch = $this->repoConfig['branch'];
}
$this->initPerforce($this->repoConfig);
$this->perforce->p4Login($this-... | php | public function initialize()
{
$this->depot = $this->repoConfig['depot'];
$this->branch = '';
if (!empty($this->repoConfig['branch'])) {
$this->branch = $this->repoConfig['branch'];
}
$this->initPerforce($this->repoConfig);
$this->perforce->p4Login($this-... | [
"public",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"depot",
"=",
"$",
"this",
"->",
"repoConfig",
"[",
"'depot'",
"]",
";",
"$",
"this",
"->",
"branch",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"repoConfig... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/Vcs/PerforceDriver.php#L34-L50 |
mothership-ec/composer | src/Composer/Repository/Vcs/PerforceDriver.php | PerforceDriver.getComposerInformation | public function getComposerInformation($identifier)
{
if (!empty($this->composerInfoIdentifier)) {
if (strcmp($identifier, $this->composerInfoIdentifier) === 0) {
return $this->composerInfo;
}
}
$composer_info = $this->perforce->getComposerInformation(... | php | public function getComposerInformation($identifier)
{
if (!empty($this->composerInfoIdentifier)) {
if (strcmp($identifier, $this->composerInfoIdentifier) === 0) {
return $this->composerInfo;
}
}
$composer_info = $this->perforce->getComposerInformation(... | [
"public",
"function",
"getComposerInformation",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"composerInfoIdentifier",
")",
")",
"{",
"if",
"(",
"strcmp",
"(",
"$",
"identifier",
",",
"$",
"this",
"->",
"composerInfoId... | {@inheritDoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Repository/Vcs/PerforceDriver.php#L65-L75 |
jasny/controller | src/Controller/Session.php | Session.useSession | public function useSession()
{
$this->session = $this->getRequest()->getAttribute('session');
if (!isset($this->session)) {
$this->session =& $_SESSION;
}
} | php | public function useSession()
{
$this->session = $this->getRequest()->getAttribute('session');
if (!isset($this->session)) {
$this->session =& $_SESSION;
}
} | [
"public",
"function",
"useSession",
"(",
")",
"{",
"$",
"this",
"->",
"session",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getAttribute",
"(",
"'session'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"session",
")",
")",
... | Link the session to the session property in the controller | [
"Link",
"the",
"session",
"to",
"the",
"session",
"property",
"in",
"the",
"controller"
] | train | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Session.php#L36-L43 |
jasny/controller | src/Controller/Session.php | Session.flash | public function flash($type = null, $message = null)
{
if (!isset($this->flash)) {
$this->flash = new Flash($this->session);
}
if ($type) {
$this->flash->set($type, $message);
}
return $this->flash;
} | php | public function flash($type = null, $message = null)
{
if (!isset($this->flash)) {
$this->flash = new Flash($this->session);
}
if ($type) {
$this->flash->set($type, $message);
}
return $this->flash;
} | [
"public",
"function",
"flash",
"(",
"$",
"type",
"=",
"null",
",",
"$",
"message",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"flash",
")",
")",
"{",
"$",
"this",
"->",
"flash",
"=",
"new",
"Flash",
"(",
"$",
"this"... | Get an/or set the flash message.
@param mixed $type flash type, eg. 'error', 'notice' or 'success'
@param mixed $message flash message
@return Flash | [
"Get",
"an",
"/",
"or",
"set",
"the",
"flash",
"message",
"."
] | train | https://github.com/jasny/controller/blob/28edf64343f1d8218c166c0c570128e1ee6153d8/src/Controller/Session.php#L53-L64 |
zhouyl/mellivora | Mellivora/Database/Seeder.php | Seeder.call | public function call($class)
{
$this->command->getOutput()->writeln("<info>Seeding:</info> $class");
$seeder = new $class($this->container, $this->command);
return $seeder->__invoke();
} | php | public function call($class)
{
$this->command->getOutput()->writeln("<info>Seeding:</info> $class");
$seeder = new $class($this->container, $this->command);
return $seeder->__invoke();
} | [
"public",
"function",
"call",
"(",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"command",
"->",
"getOutput",
"(",
")",
"->",
"writeln",
"(",
"\"<info>Seeding:</info> $class\"",
")",
";",
"$",
"seeder",
"=",
"new",
"$",
"class",
"(",
"$",
"this",
"->",
"... | Seed the given connection from the given path.
@param string $class
@return void | [
"Seed",
"the",
"given",
"connection",
"from",
"the",
"given",
"path",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Seeder.php#L44-L51 |
sciactive/nymph-server | src/Entity.php | Entity.factory | public static function factory() {
$className = get_called_class();
$args = func_get_args();
$reflector = new \ReflectionClass($className);
$entity = $reflector->newInstanceArgs($args);
// Use hook functionality when available.
if (class_exists('\SciActive\Hook')) {
\SciActive\Hook::hookOb... | php | public static function factory() {
$className = get_called_class();
$args = func_get_args();
$reflector = new \ReflectionClass($className);
$entity = $reflector->newInstanceArgs($args);
// Use hook functionality when available.
if (class_exists('\SciActive\Hook')) {
\SciActive\Hook::hookOb... | [
"public",
"static",
"function",
"factory",
"(",
")",
"{",
"$",
"className",
"=",
"get_called_class",
"(",
")",
";",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"reflector",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"className",
")",
";",
... | Create a new instance.
@return \Nymph\Entity The new instance. | [
"Create",
"a",
"new",
"instance",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L288-L298 |
sciactive/nymph-server | src/Entity.php | Entity.factoryReference | public static function factoryReference($reference) {
$className = $reference[2];
if (!class_exists($className)) {
throw new Exceptions\EntityClassNotFoundException(
"factoryReference called for a class that can't be found, $className."
);
}
$entity = call_user_func([$className, 'f... | php | public static function factoryReference($reference) {
$className = $reference[2];
if (!class_exists($className)) {
throw new Exceptions\EntityClassNotFoundException(
"factoryReference called for a class that can't be found, $className."
);
}
$entity = call_user_func([$className, 'f... | [
"public",
"static",
"function",
"factoryReference",
"(",
"$",
"reference",
")",
"{",
"$",
"className",
"=",
"$",
"reference",
"[",
"2",
"]",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
... | Create a new sleeping reference instance.
Sleeping references won't retrieve their data from the database until it
is actually used.
@param array $reference The Nymph Entity Reference to use to wake.
@return \Nymph\Entity The new instance. | [
"Create",
"a",
"new",
"sleeping",
"reference",
"instance",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L309-L319 |
sciactive/nymph-server | src/Entity.php | Entity.& | public function &__get($name) {
if ($name === 'guid') {
return $this->$name;
}
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return $this->$name;
}
// Unserialize.
if... | php | public function &__get($name) {
if ($name === 'guid') {
return $this->$name;
}
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return $this->$name;
}
// Unserialize.
if... | [
"public",
"function",
"&",
"__get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"'guid'",
")",
"{",
"return",
"$",
"this",
"->",
"$",
"name",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"-... | Retrieve a variable.
You do not need to explicitly call this method. It is called by PHP when
you access the variable normally.
@param string $name The name of the variable.
@return mixed The value of the variable or null if it doesn't exist. | [
"Retrieve",
"a",
"variable",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L330-L401 |
sciactive/nymph-server | src/Entity.php | Entity.__isset | public function __isset($name) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'guid'
|| $name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return isset($this->$name);
}
// Unserialize.
if (isset($this->sdata[$nam... | php | public function __isset($name) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ($name === 'guid'
|| $name === 'cdate'
|| $name === 'mdate'
|| $name === 'tags'
) {
return isset($this->$name);
}
// Unserialize.
if (isset($this->sdata[$nam... | [
"public",
"function",
"__isset",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"->",
"referenceWake",
"(",
")",
";",
"}",
"if",
"(",
"$",
"name",
"===",
"'guid'",
"||",
"$",
"name",
"===",
... | Checks whether a variable is set.
You do not need to explicitly call this method. It is called by PHP when
you access the variable normally.
@param string $name The name of the variable.
@return bool
@todo Check that a referenced entity has not been deleted. | [
"Checks",
"whether",
"a",
"variable",
"is",
"set",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L413-L430 |
sciactive/nymph-server | src/Entity.php | Entity.entityToReference | private function entityToReference(&$item, $key) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& isset($item->guid) && is_callable([$item, 'toReference'])) {
// This is an entity, so we should ... | php | private function entityToReference(&$item, $key) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& isset($item->guid) && is_callable([$item, 'toReference'])) {
// This is an entity, so we should ... | [
"private",
"function",
"entityToReference",
"(",
"&",
"$",
"item",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"->",
"referenceWake",
"(",
")",
";",
"}",
"if",
"(",
"(",
"is_a",
"(",
"$",
... | Check if an item is an entity, and if it is, convert it to a reference.
@param mixed &$item The item to check.
@param mixed $key Unused, but can't be removed because array_walk_recursive
will fail.
@access private | [
"Check",
"if",
"an",
"item",
"is",
"an",
"entity",
"and",
"if",
"it",
"is",
"convert",
"it",
"to",
"a",
"reference",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L605-L619 |
sciactive/nymph-server | src/Entity.php | Entity.getDataReference | private function getDataReference($item) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& is_callable([$item, 'toReference'])) {
// Convert entities to references.
return $item->toReferenc... | php | private function getDataReference($item) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if ((is_a($item, '\Nymph\Entity') || is_a($item, '\SciActive\HookOverride'))
&& is_callable([$item, 'toReference'])) {
// Convert entities to references.
return $item->toReferenc... | [
"private",
"function",
"getDataReference",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"->",
"referenceWake",
"(",
")",
";",
"}",
"if",
"(",
"(",
"is_a",
"(",
"$",
"item",
",",
"'\\Nymph\\Ent... | Convert entities to references and return the result.
@param mixed $item The item to convert.
@return mixed The resulting item. | [
"Convert",
"entities",
"to",
"references",
"and",
"return",
"the",
"result",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L673-L692 |
sciactive/nymph-server | src/Entity.php | Entity.referenceSleep | public function referenceSleep($reference) {
if (count($reference) !== 3
|| $reference[0] !== 'nymph_entity_reference'
|| !is_int($reference[1])
|| !is_string($reference[2])) {
throw new Exceptions\InvalidParametersException(
'referenceSleep expects parameter 1 to be a valid ... | php | public function referenceSleep($reference) {
if (count($reference) !== 3
|| $reference[0] !== 'nymph_entity_reference'
|| !is_int($reference[1])
|| !is_string($reference[2])) {
throw new Exceptions\InvalidParametersException(
'referenceSleep expects parameter 1 to be a valid ... | [
"public",
"function",
"referenceSleep",
"(",
"$",
"reference",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"reference",
")",
"!==",
"3",
"||",
"$",
"reference",
"[",
"0",
"]",
"!==",
"'nymph_entity_reference'",
"||",
"!",
"is_int",
"(",
"$",
"reference",
"["... | Set up a sleeping reference.
@param array $reference The reference to use to wake. | [
"Set",
"up",
"a",
"sleeping",
"reference",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L927-L947 |
sciactive/nymph-server | src/Entity.php | Entity.referenceToEntity | private function referenceToEntity(&$item, $key) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if (is_array($item)) {
if (isset($item[0]) && $item[0] === 'nymph_entity_reference') {
if (!isset($this->entityCache["referenceGuid__{$item[1]}"])) {
if (!class_exist... | php | private function referenceToEntity(&$item, $key) {
if ($this->isASleepingReference) {
$this->referenceWake();
}
if (is_array($item)) {
if (isset($item[0]) && $item[0] === 'nymph_entity_reference') {
if (!isset($this->entityCache["referenceGuid__{$item[1]}"])) {
if (!class_exist... | [
"private",
"function",
"referenceToEntity",
"(",
"&",
"$",
"item",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"$",
"this",
"->",
"referenceWake",
"(",
")",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"it... | Check if an item is a reference, and if it is, convert it to an entity.
This function will recurse into deeper arrays.
@param mixed &$item The item to check.
@param mixed $key Unused, but can't be removed because array_walk will
fail.
@access private | [
"Check",
"if",
"an",
"item",
"is",
"a",
"reference",
"and",
"if",
"it",
"is",
"convert",
"it",
"to",
"an",
"entity",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L959-L993 |
sciactive/nymph-server | src/Entity.php | Entity.referenceWake | private function referenceWake() {
if (!$this->isASleepingReference) {
return true;
}
if (!class_exists($this->sleepingReference[2])) {
throw new Exceptions\EntityClassNotFoundException(
"Tried to wake sleeping reference entity that refers to a class ".
"that can't be found, ... | php | private function referenceWake() {
if (!$this->isASleepingReference) {
return true;
}
if (!class_exists($this->sleepingReference[2])) {
throw new Exceptions\EntityClassNotFoundException(
"Tried to wake sleeping reference entity that refers to a class ".
"that can't be found, ... | [
"private",
"function",
"referenceWake",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isASleepingReference",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"this",
"->",
"sleepingReference",
"[",
"2",
"]",
")",
")"... | Wake from a sleeping reference.
@return bool True on success, false on failure. | [
"Wake",
"from",
"a",
"sleeping",
"reference",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Entity.php#L1000-L1025 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php | ezcMailFileParser.openFile | private function openFile( $fileName )
{
// The filename is now relative, we need to extend it with the absolute path.
// To provide uniqueness we put the file in a directory based on processID and rand.
$dirName = ezcMailParser::getTmpDir() . getmypid() . '-' . self::$counter++ . '/';
... | php | private function openFile( $fileName )
{
// The filename is now relative, we need to extend it with the absolute path.
// To provide uniqueness we put the file in a directory based on processID and rand.
$dirName = ezcMailParser::getTmpDir() . getmypid() . '-' . self::$counter++ . '/';
... | [
"private",
"function",
"openFile",
"(",
"$",
"fileName",
")",
"{",
"// The filename is now relative, we need to extend it with the absolute path.",
"// To provide uniqueness we put the file in a directory based on processID and rand.",
"$",
"dirName",
"=",
"ezcMailParser",
"::",
"getTm... | Returns the filepointer of the opened file $fileName in a unique directory..
This method will create a new unique folder in the temporary directory specified in ezcMailParser.
The fileName property of this class will be set to the location of the new file.
@throws ezcBaseFileNotFoundException
if the file could not be... | [
"Returns",
"the",
"filepointer",
"of",
"the",
"opened",
"file",
"$fileName",
"in",
"a",
"unique",
"directory",
".."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php#L140-L160 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php | ezcMailFileParser.appendStreamFilters | private function appendStreamFilters( $line )
{
// append the correct decoding filter
switch ( strtolower( $this->headers['Content-Transfer-Encoding'] ) )
{
case 'base64':
stream_filter_append( $this->fp, 'convert.base64-decode' );
break;
... | php | private function appendStreamFilters( $line )
{
// append the correct decoding filter
switch ( strtolower( $this->headers['Content-Transfer-Encoding'] ) )
{
case 'base64':
stream_filter_append( $this->fp, 'convert.base64-decode' );
break;
... | [
"private",
"function",
"appendStreamFilters",
"(",
"$",
"line",
")",
"{",
"// append the correct decoding filter",
"switch",
"(",
"strtolower",
"(",
"$",
"this",
"->",
"headers",
"[",
"'Content-Transfer-Encoding'",
"]",
")",
")",
"{",
"case",
"'base64'",
":",
"str... | Sets the correct stream filters for the attachment.
$line should contain one line of data that should be written to file.
It is used to correctly determine the type of linebreak used in the mail.
@param string $line | [
"Sets",
"the",
"correct",
"stream",
"filters",
"for",
"the",
"attachment",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php#L190-L215 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php | ezcMailFileParser.parseBody | public function parseBody( $line )
{
if ( $line !== '' )
{
if ( $this->dataWritten === false )
{
$this->appendStreamFilters( $line );
$this->dataWritten = true;
}
fwrite( $this->fp, $line );
}
} | php | public function parseBody( $line )
{
if ( $line !== '' )
{
if ( $this->dataWritten === false )
{
$this->appendStreamFilters( $line );
$this->dataWritten = true;
}
fwrite( $this->fp, $line );
}
} | [
"public",
"function",
"parseBody",
"(",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"line",
"!==",
"''",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataWritten",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"appendStreamFilters",
"(",
"$",
"line",
")",
";... | Parse the body of a message line by line.
This method is called by the parent part on a push basis. When there
are no more lines the parent part will call finish() to retrieve the
mailPart.
The file will be decoded and saved to the given temporary directory within
a directory based on the process ID and the time.
@p... | [
"Parse",
"the",
"body",
"of",
"a",
"message",
"line",
"by",
"line",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php#L230-L242 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php | ezcMailFileParser.finish | public function finish()
{
fclose( $this->fp );
$this->fp = null;
// FIXME: DIRTY PGP HACK
// When we have PGP support these lines should be removed. They are here now to hide
// PGP parts since they will show up as file attachments if not.
if ( $this->mainType == "... | php | public function finish()
{
fclose( $this->fp );
$this->fp = null;
// FIXME: DIRTY PGP HACK
// When we have PGP support these lines should be removed. They are here now to hide
// PGP parts since they will show up as file attachments if not.
if ( $this->mainType == "... | [
"public",
"function",
"finish",
"(",
")",
"{",
"fclose",
"(",
"$",
"this",
"->",
"fp",
")",
";",
"$",
"this",
"->",
"fp",
"=",
"null",
";",
"// FIXME: DIRTY PGP HACK",
"// When we have PGP support these lines should be removed. They are here now to hide",
"// PGP parts ... | Return the result of the parsed file part.
This method is called automatically by the parent part.
@return ezcMailFile | [
"Return",
"the",
"result",
"of",
"the",
"parsed",
"file",
"part",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/file_parser.php#L251-L307 |
infusephp/infuse | src/Application.php | Application.map | public function map($method, $route, $handler)
{
$this['router']->map($method, $route, $handler);
return $this;
} | php | public function map($method, $route, $handler)
{
$this['router']->map($method, $route, $handler);
return $this;
} | [
"public",
"function",
"map",
"(",
"$",
"method",
",",
"$",
"route",
",",
"$",
"handler",
")",
"{",
"$",
"this",
"[",
"'router'",
"]",
"->",
"map",
"(",
"$",
"method",
",",
"$",
"route",
",",
"$",
"handler",
")",
";",
"return",
"$",
"this",
";",
... | Adds a handler to the routing table for a given route.
@param string $method HTTP method
@param string $route path pattern
@param mixed $handler route handler
@return self | [
"Adds",
"a",
"handler",
"to",
"the",
"routing",
"table",
"for",
"a",
"given",
"route",
"."
] | train | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L232-L237 |
infusephp/infuse | src/Application.php | Application.handleRequest | public function handleRequest(Request $req)
{
// set host name from request if not already set
$config = $this['config'];
if (!$config->get('app.hostname')) {
$config->set('app.hostname', $req->host());
}
$res = new Response();
try {
// determ... | php | public function handleRequest(Request $req)
{
// set host name from request if not already set
$config = $this['config'];
if (!$config->get('app.hostname')) {
$config->set('app.hostname', $req->host());
}
$res = new Response();
try {
// determ... | [
"public",
"function",
"handleRequest",
"(",
"Request",
"$",
"req",
")",
"{",
"// set host name from request if not already set",
"$",
"config",
"=",
"$",
"this",
"[",
"'config'",
"]",
";",
"if",
"(",
"!",
"$",
"config",
"->",
"get",
"(",
"'app.hostname'",
")",... | Builds a response to an incoming request by routing
it through the application.
@param Request $req
@return Response | [
"Builds",
"a",
"response",
"to",
"an",
"incoming",
"request",
"by",
"routing",
"it",
"through",
"the",
"application",
"."
] | train | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L265-L297 |
infusephp/infuse | src/Application.php | Application.runMiddleware | public function runMiddleware(Request $req, Response $res)
{
$this->initMiddleware()->rewind();
return $this->nextMiddleware($req, $res);
} | php | public function runMiddleware(Request $req, Response $res)
{
$this->initMiddleware()->rewind();
return $this->nextMiddleware($req, $res);
} | [
"public",
"function",
"runMiddleware",
"(",
"Request",
"$",
"req",
",",
"Response",
"$",
"res",
")",
"{",
"$",
"this",
"->",
"initMiddleware",
"(",
")",
"->",
"rewind",
"(",
")",
";",
"return",
"$",
"this",
"->",
"nextMiddleware",
"(",
"$",
"req",
",",... | Runs the middleware chain.
@param Request $req
@param Response $res
@return Response $res | [
"Runs",
"the",
"middleware",
"chain",
"."
] | train | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L335-L340 |
infusephp/infuse | src/Application.php | Application.nextMiddleware | public function nextMiddleware(Request $req, Response $res)
{
$middleware = $this->middleware->current();
// base case - no middleware left
if (!$middleware) {
return $res;
}
// otherwise, call next middleware
$this->middleware->next();
return $... | php | public function nextMiddleware(Request $req, Response $res)
{
$middleware = $this->middleware->current();
// base case - no middleware left
if (!$middleware) {
return $res;
}
// otherwise, call next middleware
$this->middleware->next();
return $... | [
"public",
"function",
"nextMiddleware",
"(",
"Request",
"$",
"req",
",",
"Response",
"$",
"res",
")",
"{",
"$",
"middleware",
"=",
"$",
"this",
"->",
"middleware",
"->",
"current",
"(",
")",
";",
"// base case - no middleware left",
"if",
"(",
"!",
"$",
"m... | Calls the next middleware in the chain.
DO NOT call directly.
@param Request $req
@param Response $res
@return Response | [
"Calls",
"the",
"next",
"middleware",
"in",
"the",
"chain",
".",
"DO",
"NOT",
"call",
"directly",
"."
] | train | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L366-L379 |
infusephp/infuse | src/Application.php | Application.handle | public function handle(SymfonyRequest $request, $type = self::MASTER_REQUEST, $catch = true)
{
$bridge = new SymfonyHttpBridge();
$req = $bridge->convertSymfonyRequest($request);
return $bridge->convertInfuseResponse($this->handleRequest($req));
} | php | public function handle(SymfonyRequest $request, $type = self::MASTER_REQUEST, $catch = true)
{
$bridge = new SymfonyHttpBridge();
$req = $bridge->convertSymfonyRequest($request);
return $bridge->convertInfuseResponse($this->handleRequest($req));
} | [
"public",
"function",
"handle",
"(",
"SymfonyRequest",
"$",
"request",
",",
"$",
"type",
"=",
"self",
"::",
"MASTER_REQUEST",
",",
"$",
"catch",
"=",
"true",
")",
"{",
"$",
"bridge",
"=",
"new",
"SymfonyHttpBridge",
"(",
")",
";",
"$",
"req",
"=",
"$",... | ////////////////////// | [
"//////////////////////"
] | train | https://github.com/infusephp/infuse/blob/7520b237c69f3d8a07d95d7481b26027ced2ed83/src/Application.php#L413-L419 |
traderinteractive/filter-dates-php | src/Filter/DateTimeZone.php | DateTimeZone.filter | public static function filter($value, bool $allowNull = false)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof \DateTimeZone) {
return $value;
}
if (!is_string($value) || trim($value) == '') {
t... | php | public static function filter($value, bool $allowNull = false)
{
if (self::valueIsNullAndValid($allowNull, $value)) {
return null;
}
if ($value instanceof \DateTimeZone) {
return $value;
}
if (!is_string($value) || trim($value) == '') {
t... | [
"public",
"static",
"function",
"filter",
"(",
"$",
"value",
",",
"bool",
"$",
"allowNull",
"=",
"false",
")",
"{",
"if",
"(",
"self",
"::",
"valueIsNullAndValid",
"(",
"$",
"allowNull",
",",
"$",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"... | Filters the given value into a \DateTimeZone object.
@param mixed $value The value to be filtered.
@param boolean $allowNull True to allow nulls through, and false (default) if nulls should not be allowed.
@return \DateTimeZone|null
@throws FilterException if the value did not pass validation. | [
"Filters",
"the",
"given",
"value",
"into",
"a",
"\\",
"DateTimeZone",
"object",
"."
] | train | https://github.com/traderinteractive/filter-dates-php/blob/f9e60f139da3ebb565317c5d62a6fb0c347be4ee/src/Filter/DateTimeZone.php#L22-L41 |
lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Helper/Convert.php | Convert.logEntry | public static function logEntry($entry)
{
$parts = explode("|", $entry, 5);
$array = array();
if(count($parts) != 5)
{
$array["timestamp"] = 0;
$array["level"] = TeamSpeak3::LOGLEVEL_ERROR;
$array["channel"] = "ParamParser";
$array["server_id"] = "";
$array["msg"] ... | php | public static function logEntry($entry)
{
$parts = explode("|", $entry, 5);
$array = array();
if(count($parts) != 5)
{
$array["timestamp"] = 0;
$array["level"] = TeamSpeak3::LOGLEVEL_ERROR;
$array["channel"] = "ParamParser";
$array["server_id"] = "";
$array["msg"] ... | [
"public",
"static",
"function",
"logEntry",
"(",
"$",
"entry",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"\"|\"",
",",
"$",
"entry",
",",
"5",
")",
";",
"$",
"array",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"parts",
")",
"... | Converts a specified log entry string into an array containing the data.
@param string $entry
@return array | [
"Converts",
"a",
"specified",
"log",
"entry",
"string",
"into",
"an",
"array",
"containing",
"the",
"data",
"."
] | train | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Helper/Convert.php#L258-L285 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.startWithNode | public static function startWithNode(
string $variable = null,
array $labels = []
): self {
$path = new self;
$path->elements = $path->elements->add(
new Node($variable, $labels)
);
$path->lastOperation = Node::class;
return $path;
} | php | public static function startWithNode(
string $variable = null,
array $labels = []
): self {
$path = new self;
$path->elements = $path->elements->add(
new Node($variable, $labels)
);
$path->lastOperation = Node::class;
return $path;
} | [
"public",
"static",
"function",
"startWithNode",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"path",
"=",
"new",
"self",
";",
"$",
"path",
"->",
"elements",
"=",
"$",
"path",
... | Start the path with the given node
@param string $variable
@param array $labels
@return self | [
"Start",
"the",
"path",
"with",
"the",
"given",
"node"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L35-L46 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.linkedTo | public function linkedTo(string $variable = null, array $labels = []): self
{
$path = new self;
$path->elements = $this
->elements
->add(Relationship::both())
->add(new Node($variable, $labels));
$path->lastOperation = Node::class;
return $path;
... | php | public function linkedTo(string $variable = null, array $labels = []): self
{
$path = new self;
$path->elements = $this
->elements
->add(Relationship::both())
->add(new Node($variable, $labels));
$path->lastOperation = Node::class;
return $path;
... | [
"public",
"function",
"linkedTo",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"path",
"=",
"new",
"self",
";",
"$",
"path",
"->",
"elements",
"=",
"$",
"this",
"->",
"elements... | Create a relationship to the given node
@param string $variable
@param array $labels
@return self | [
"Create",
"a",
"relationship",
"to",
"the",
"given",
"node"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L56-L66 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.through | public function through(
string $variable = null,
string $type = null,
string $direction = 'BOTH'
): self {
if ($this->elements->size() < 3) {
throw new LogicException;
}
$direction = \strtolower($direction);
$path = new self;
$path->elem... | php | public function through(
string $variable = null,
string $type = null,
string $direction = 'BOTH'
): self {
if ($this->elements->size() < 3) {
throw new LogicException;
}
$direction = \strtolower($direction);
$path = new self;
$path->elem... | [
"public",
"function",
"through",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"null",
",",
"string",
"$",
"direction",
"=",
"'BOTH'",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"elements",
"->",
"size",
"(",... | Type the last declared relationship in the path
@param string $variable
@param string $type
@param string $direction
@throws LogicException If no relationship in the path
@return self | [
"Type",
"the",
"last",
"declared",
"relationship",
"in",
"the",
"path"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L79-L99 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withADistanceBetween | public function withADistanceBetween(int $min, int $max): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements... | php | public function withADistanceBetween(int $min, int $max): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements... | [
"public",
"function",
"withADistanceBetween",
"(",
"int",
"$",
"min",
",",
"int",
"$",
"max",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"elements",
"->",
"size",
"(",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"LogicException",
";",
"}",
"... | Define the deepness range of the relationship
@param int $min
@param int $max
@throws LogicException If no relationship in the path
@return self | [
"Define",
"the",
"deepness",
"range",
"of",
"the",
"relationship"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L138-L154 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withADistanceOfAtLeast | public function withADistanceOfAtLeast(int $distance): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements->d... | php | public function withADistanceOfAtLeast(int $distance): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements->d... | [
"public",
"function",
"withADistanceOfAtLeast",
"(",
"int",
"$",
"distance",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"elements",
"->",
"size",
"(",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"LogicException",
";",
"}",
"$",
"path",
"=",
"c... | Define the minimum deepness of the relationship
@param int $distance
@throws LogicException If no relationship in the path
@return self | [
"Define",
"the",
"minimum",
"deepness",
"of",
"the",
"relationship"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L165-L181 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withAnyDistance | public function withAnyDistance(): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements->dropEnd(1)->last()->w... | php | public function withAnyDistance(): self
{
if ($this->elements->size() < 3) {
throw new LogicException;
}
$path = clone $this;
$path->elements = $this
->elements
->dropEnd(2)
->add(
$this->elements->dropEnd(1)->last()->w... | [
"public",
"function",
"withAnyDistance",
"(",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"elements",
"->",
"size",
"(",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"LogicException",
";",
"}",
"$",
"path",
"=",
"clone",
"$",
"this",
";",
"$",... | Define any deepness of the relationship
@param int $distance
@throws LogicException If no relationship in the path
@return self | [
"Define",
"any",
"deepness",
"of",
"the",
"relationship"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L219-L235 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withParameter | public function withParameter(string $key, $value): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withParameter($key, $value);
$pa... | php | public function withParameter(string $key, $value): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withParameter($key, $value);
$pa... | [
"public",
"function",
"withParameter",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"lastOperation",
"===",
"Node",
"::",
"class",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
"elements",
"->... | Add the given parameter to the last operation
@param string $key
@param mixed $value
@return self | [
"Add",
"the",
"given",
"parameter",
"to",
"the",
"last",
"operation"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L245-L271 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.withProperty | public function withProperty(string $property, string $cypher): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withProperty($property, $cyp... | php | public function withProperty(string $property, string $cypher): self
{
if ($this->lastOperation === Node::class) {
$element = $this->elements->last();
} else {
$element = $this->elements->dropEnd(1)->last();
}
$element = $element->withProperty($property, $cyp... | [
"public",
"function",
"withProperty",
"(",
"string",
"$",
"property",
",",
"string",
"$",
"cypher",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"lastOperation",
"===",
"Node",
"::",
"class",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
... | Add the given property to the last operation
@param string $property
@param string $cypher
@return self | [
"Add",
"the",
"given",
"property",
"to",
"the",
"last",
"operation"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L281-L307 |
Innmind/neo4j-dbal | src/Clause/Expression/Path.php | Path.parameters | public function parameters(): MapInterface
{
if ($this->parameters) {
return $this->parameters;
}
return $this->parameters = $this->elements->reduce(
new Map('string', Parameter::class),
function(Map $carry, $element): Map {
return $carry-... | php | public function parameters(): MapInterface
{
if ($this->parameters) {
return $this->parameters;
}
return $this->parameters = $this->elements->reduce(
new Map('string', Parameter::class),
function(Map $carry, $element): Map {
return $carry-... | [
"public",
"function",
"parameters",
"(",
")",
":",
"MapInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"parameters",
";",
"}",
"return",
"$",
"this",
"->",
"parameters",
"=",
"$",
"this",
"->",
"eleme... | Return all the parameters of the path
@return MapInterface<string, Parameter> | [
"Return",
"all",
"the",
"parameters",
"of",
"the",
"path"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/Expression/Path.php#L314-L326 |
OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.perform | public function perform() {
$this->oktolab_media = $this->getContainer()->get('oktolab_media');
$episode = $this->oktolab_media->getEpisode($this->args['uniqID']);
$this->logbook = $this->getContainer()->get('bprs_logbook');
$this->logbook->info(
'oktolab_media.episode_start... | php | public function perform() {
$this->oktolab_media = $this->getContainer()->get('oktolab_media');
$episode = $this->oktolab_media->getEpisode($this->args['uniqID']);
$this->logbook = $this->getContainer()->get('bprs_logbook');
$this->logbook->info(
'oktolab_media.episode_start... | [
"public",
"function",
"perform",
"(",
")",
"{",
"$",
"this",
"->",
"oktolab_media",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'oktolab_media'",
")",
";",
"$",
"episode",
"=",
"$",
"this",
"->",
"oktolab_media",
"->",
"getEpisod... | {@inheritdoc} | [
"{"
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L25-L51 |
OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.executeFFmpegForMedia | private function executeFFmpegForMedia($cmd, $format, $resolution, $media) {
$ffmpeg_start = microtime(true);
$this->getContainer()->get('oktolab_media_ffmpeg')
->executeFFmpegForMedia(
$resolution['encoder'],
$cmd,
$media
)
... | php | private function executeFFmpegForMedia($cmd, $format, $resolution, $media) {
$ffmpeg_start = microtime(true);
$this->getContainer()->get('oktolab_media_ffmpeg')
->executeFFmpegForMedia(
$resolution['encoder'],
$cmd,
$media
)
... | [
"private",
"function",
"executeFFmpegForMedia",
"(",
"$",
"cmd",
",",
"$",
"format",
",",
"$",
"resolution",
",",
"$",
"media",
")",
"{",
"$",
"ffmpeg_start",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"... | creates a media object and runs the ffmpeg command for the given resolution.
the command will be tracked to update the progress from 0 - 100 in realtime.
will move the asset from the cache adapter to the adapter in the resolution if defined.
triggers the finalize episode function once for the whole job | [
"creates",
"a",
"media",
"object",
"and",
"runs",
"the",
"ffmpeg",
"command",
"for",
"the",
"given",
"resolution",
".",
"the",
"command",
"will",
"be",
"tracked",
"to",
"update",
"the",
"progress",
"from",
"0",
"-",
"100",
"in",
"realtime",
".",
"will",
... | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L251-L287 |
OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.finalizeEpisode | private function finalizeEpisode($episode) {
$event = new EncodedEpisodeEvent($episode);
$this->getContainer()->get('event_dispatcher')->dispatch(
OktolabMediaEvent::ENCODED_EPISODE,
$event
);
$this->oktolab_media->addFinalizeEpisodeJob(
$episode->get... | php | private function finalizeEpisode($episode) {
$event = new EncodedEpisodeEvent($episode);
$this->getContainer()->get('event_dispatcher')->dispatch(
OktolabMediaEvent::ENCODED_EPISODE,
$event
);
$this->oktolab_media->addFinalizeEpisodeJob(
$episode->get... | [
"private",
"function",
"finalizeEpisode",
"(",
"$",
"episode",
")",
"{",
"$",
"event",
"=",
"new",
"EncodedEpisodeEvent",
"(",
"$",
"episode",
")",
";",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'event_dispatcher'",
")",
"->",
"dispat... | adds finalize job
and dispatches encoded_episode event | [
"adds",
"finalize",
"job",
"and",
"dispatches",
"encoded_episode",
"event"
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L312-L324 |
OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.createNewCacheAssetForResolution | private function createNewCacheAssetForResolution($episode, $resolution) {
$asset = $this->getContainer()->get('bprs.asset')->createAsset();
$asset->setFilekey(
sprintf('%s.%s',$asset->getFilekey(), $resolution['container'])
);
$asset->setAdapter(
$this->getContai... | php | private function createNewCacheAssetForResolution($episode, $resolution) {
$asset = $this->getContainer()->get('bprs.asset')->createAsset();
$asset->setFilekey(
sprintf('%s.%s',$asset->getFilekey(), $resolution['container'])
);
$asset->setAdapter(
$this->getContai... | [
"private",
"function",
"createNewCacheAssetForResolution",
"(",
"$",
"episode",
",",
"$",
"resolution",
")",
"{",
"$",
"asset",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'bprs.asset'",
")",
"->",
"createAsset",
"(",
")",
";",
"$"... | returns an empty asset to be used in an encoding situation.
the filekey, mimetype and adapter are already set for ffmpeg | [
"returns",
"an",
"empty",
"asset",
"to",
"be",
"used",
"in",
"an",
"encoding",
"situation",
".",
"the",
"filekey",
"mimetype",
"and",
"adapter",
"are",
"already",
"set",
"for",
"ffmpeg"
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L330-L344 |
OKTOTV/OktolabMediaBundle | Model/EncodeEpisodeJob.php | EncodeEpisodeJob.deleteOriginalIfConfigured | private function deleteOriginalIfConfigured() {
$episode = $this->oktolab_media->getEpisode($this->args['uniqID']);
if (!$this->getContainer()->getParameter('oktolab_media.keep_original')) {
$this->logbook->info(
'oktolab_media.episode_encode_remove_old_media',
... | php | private function deleteOriginalIfConfigured() {
$episode = $this->oktolab_media->getEpisode($this->args['uniqID']);
if (!$this->getContainer()->getParameter('oktolab_media.keep_original')) {
$this->logbook->info(
'oktolab_media.episode_encode_remove_old_media',
... | [
"private",
"function",
"deleteOriginalIfConfigured",
"(",
")",
"{",
"$",
"episode",
"=",
"$",
"this",
"->",
"oktolab_media",
"->",
"getEpisode",
"(",
"$",
"this",
"->",
"args",
"[",
"'uniqID'",
"]",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getContai... | if the configuration flag keep_original is set to false and encoding
of all media was successful (100%), the uploaded original video
will be replaced with the media with the highest sortnumber
directly after encoding | [
"if",
"the",
"configuration",
"flag",
"keep_original",
"is",
"set",
"to",
"false",
"and",
"encoding",
"of",
"all",
"media",
"was",
"successful",
"(",
"100%",
")",
"the",
"uploaded",
"original",
"video",
"will",
"be",
"replaced",
"with",
"the",
"media",
"with... | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Model/EncodeEpisodeJob.php#L352-L389 |
expectation-php/expect | src/matcher/ToBeAnInstanceOf.php | ToBeAnInstanceOf.match | public function match($actual)
{
$result = false;
$this->actual = $actual;
if (is_object($this->actual)) {
$this->className = get_class($this->actual);
$result = $this->actual instanceof $this->expected;
} else {
$this->className = $actual;
... | php | public function match($actual)
{
$result = false;
$this->actual = $actual;
if (is_object($this->actual)) {
$this->className = get_class($this->actual);
$result = $this->actual instanceof $this->expected;
} else {
$this->className = $actual;
... | [
"public",
"function",
"match",
"(",
"$",
"actual",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"this",
"->",
"actual",
"=",
"$",
"actual",
";",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"actual",
")",
")",
"{",
"$",
"this",
"->",
"clas... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToBeAnInstanceOf.php#L58-L71 |
expectation-php/expect | src/matcher/ToBeAnInstanceOf.php | ToBeAnInstanceOf.reportFailed | public function reportFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendText($this->className)
->appendText(' to be an instance of ')
->appendText($this->expected)
->appendText("\n\n")
->appendText(' expected: ')
... | php | public function reportFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendText($this->className)
->appendText(' to be an instance of ')
->appendText($this->expected)
->appendText("\n\n")
->appendText(' expected: ')
... | [
"public",
"function",
"reportFailed",
"(",
"FailedMessage",
"$",
"message",
")",
"{",
"$",
"message",
"->",
"appendText",
"(",
"'Expected '",
")",
"->",
"appendText",
"(",
"$",
"this",
"->",
"className",
")",
"->",
"appendText",
"(",
"' to be an instance of '",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToBeAnInstanceOf.php#L76-L88 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.