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 |
|---|---|---|---|---|---|---|---|---|---|---|
ActiveCampaign/activecampaign-api-php | includes/Tracking.class.php | AC_Tracking.site_list | function site_list($params) {
if ($this->version == 1) {
// not supported currently.
//$request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}";
} elseif ($this->version == 2) {
$request_url = "{$this->url_base}/track/site";
}
$response = $this->curl($request_ur... | php | function site_list($params) {
if ($this->version == 1) {
// not supported currently.
//$request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}";
} elseif ($this->version == 2) {
$request_url = "{$this->url_base}/track/site";
}
$response = $this->curl($request_ur... | [
"function",
"site_list",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"version",
"==",
"1",
")",
"{",
"// not supported currently.",
"//$request_url = \"{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}\";",
"}",
"elseif",
"(",
... | /*
Returns existing whitelisted domains. | [
"/",
"*",
"Returns",
"existing",
"whitelisted",
"domains",
"."
] | train | https://github.com/ActiveCampaign/activecampaign-api-php/blob/2bf5b72ba8668de8dcb27e194948028276e748c5/includes/Tracking.class.php#L40-L49 |
ActiveCampaign/activecampaign-api-php | includes/Tracking.class.php | AC_Tracking.event_list | function event_list($params) {
if ($this->version == 1) {
// not supported currently.
//$request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}";
} elseif ($this->version == 2) {
$request_url = "{$this->url_base}/track/event";
}
$response = $this->curl($request_... | php | function event_list($params) {
if ($this->version == 1) {
// not supported currently.
//$request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}";
} elseif ($this->version == 2) {
$request_url = "{$this->url_base}/track/event";
}
$response = $this->curl($request_... | [
"function",
"event_list",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"version",
"==",
"1",
")",
"{",
"// not supported currently.",
"//$request_url = \"{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}\";",
"}",
"elseif",
"(",... | /*
Returns existing tracked events. | [
"/",
"*",
"Returns",
"existing",
"tracked",
"events",
"."
] | train | https://github.com/ActiveCampaign/activecampaign-api-php/blob/2bf5b72ba8668de8dcb27e194948028276e748c5/includes/Tracking.class.php#L54-L63 |
ActiveCampaign/activecampaign-api-php | includes/Tracking.class.php | AC_Tracking.whitelist | function whitelist($params, $post_data) {
// version 2 only.
$request_url = "{$this->url_base}/track/site";
$response = $this->curl($request_url, $post_data, "PUT", "tracking_whitelist");
return $response;
} | php | function whitelist($params, $post_data) {
// version 2 only.
$request_url = "{$this->url_base}/track/site";
$response = $this->curl($request_url, $post_data, "PUT", "tracking_whitelist");
return $response;
} | [
"function",
"whitelist",
"(",
"$",
"params",
",",
"$",
"post_data",
")",
"{",
"// version 2 only.",
"$",
"request_url",
"=",
"\"{$this->url_base}/track/site\"",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"curl",
"(",
"$",
"request_url",
",",
"$",
"post_data... | /*
Adds a domain to the site tracking whitelist. | [
"/",
"*",
"Adds",
"a",
"domain",
"to",
"the",
"site",
"tracking",
"whitelist",
"."
] | train | https://github.com/ActiveCampaign/activecampaign-api-php/blob/2bf5b72ba8668de8dcb27e194948028276e748c5/includes/Tracking.class.php#L68-L73 |
ActiveCampaign/activecampaign-api-php | includes/Tracking.class.php | AC_Tracking.whitelist_remove | function whitelist_remove($params, $post_data) {
// version 2 only.
$request_url = "{$this->url_base}/track/site";
$response = $this->curl($request_url, $post_data, "DELETE", "tracking_whitelist");
return $response;
} | php | function whitelist_remove($params, $post_data) {
// version 2 only.
$request_url = "{$this->url_base}/track/site";
$response = $this->curl($request_url, $post_data, "DELETE", "tracking_whitelist");
return $response;
} | [
"function",
"whitelist_remove",
"(",
"$",
"params",
",",
"$",
"post_data",
")",
"{",
"// version 2 only.",
"$",
"request_url",
"=",
"\"{$this->url_base}/track/site\"",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"curl",
"(",
"$",
"request_url",
",",
"$",
"po... | /*
Removes a domain from the site tracking whitelist. | [
"/",
"*",
"Removes",
"a",
"domain",
"from",
"the",
"site",
"tracking",
"whitelist",
"."
] | train | https://github.com/ActiveCampaign/activecampaign-api-php/blob/2bf5b72ba8668de8dcb27e194948028276e748c5/includes/Tracking.class.php#L78-L83 |
ActiveCampaign/activecampaign-api-php | includes/Tracking.class.php | AC_Tracking.event_remove | function event_remove($params, $post_data) {
// version 2 only.
$request_url = "{$this->url_base}/track/event";
$response = $this->curl($request_url, $post_data, "DELETE", "tracking_event_remove");
return $response;
} | php | function event_remove($params, $post_data) {
// version 2 only.
$request_url = "{$this->url_base}/track/event";
$response = $this->curl($request_url, $post_data, "DELETE", "tracking_event_remove");
return $response;
} | [
"function",
"event_remove",
"(",
"$",
"params",
",",
"$",
"post_data",
")",
"{",
"// version 2 only.",
"$",
"request_url",
"=",
"\"{$this->url_base}/track/event\"",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"curl",
"(",
"$",
"request_url",
",",
"$",
"post_... | /*
Removes an event. | [
"/",
"*",
"Removes",
"an",
"event",
"."
] | train | https://github.com/ActiveCampaign/activecampaign-api-php/blob/2bf5b72ba8668de8dcb27e194948028276e748c5/includes/Tracking.class.php#L88-L93 |
ActiveCampaign/activecampaign-api-php | includes/Tracking.class.php | AC_Tracking.log | function log($params, $post_data) {
$request_url = "https://trackcmp.net/event";
$post_data["actid"] = $this->track_actid;
$post_data["key"] = $this->track_key;
$visit_data = array();
if ($this->track_email) {
$visit_data["email"] = $this->track_email;
}
if (isset($post_data["visit"])) {
$visit_data... | php | function log($params, $post_data) {
$request_url = "https://trackcmp.net/event";
$post_data["actid"] = $this->track_actid;
$post_data["key"] = $this->track_key;
$visit_data = array();
if ($this->track_email) {
$visit_data["email"] = $this->track_email;
}
if (isset($post_data["visit"])) {
$visit_data... | [
"function",
"log",
"(",
"$",
"params",
",",
"$",
"post_data",
")",
"{",
"$",
"request_url",
"=",
"\"https://trackcmp.net/event\"",
";",
"$",
"post_data",
"[",
"\"actid\"",
"]",
"=",
"$",
"this",
"->",
"track_actid",
";",
"$",
"post_data",
"[",
"\"key\"",
"... | /*
Adds a new event. | [
"/",
"*",
"Adds",
"a",
"new",
"event",
"."
] | train | https://github.com/ActiveCampaign/activecampaign-api-php/blob/2bf5b72ba8668de8dcb27e194948028276e748c5/includes/Tracking.class.php#L98-L114 |
amranidev/scaffold-interface | src/Filesystem/Filesystem.php | Filesystem.make | public function make($file, $content)
{
if ($this->exists($file)) {
throw new FileAlreadyExists();
}
return file_put_contents($file, $content);
} | php | public function make($file, $content)
{
if ($this->exists($file)) {
throw new FileAlreadyExists();
}
return file_put_contents($file, $content);
} | [
"public",
"function",
"make",
"(",
"$",
"file",
",",
"$",
"content",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"exists",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"FileAlreadyExists",
"(",
")",
";",
"}",
"return",
"file_put_contents",
"(",
"$",
... | Make a file.
@param $file
@param $content
@throws FileAlreadyExists
@return int | [
"Make",
"a",
"file",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Filesystem/Filesystem.php#L22-L29 |
amranidev/scaffold-interface | src/Datasystem/Database/Database.php | Database.tableNames | public function tableNames()
{
return collect(DB::select($this->getQuery()))
->pluck('name')->reject(function ($name) {
return $this->skips()->contains($name);
});
} | php | public function tableNames()
{
return collect(DB::select($this->getQuery()))
->pluck('name')->reject(function ($name) {
return $this->skips()->contains($name);
});
} | [
"public",
"function",
"tableNames",
"(",
")",
"{",
"return",
"collect",
"(",
"DB",
"::",
"select",
"(",
"$",
"this",
"->",
"getQuery",
"(",
")",
")",
")",
"->",
"pluck",
"(",
"'name'",
")",
"->",
"reject",
"(",
"function",
"(",
"$",
"name",
")",
"{... | retrieve table names from database.
@return \Illuminate\Support\Collection | [
"retrieve",
"table",
"names",
"from",
"database",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Datasystem/Database/Database.php#L30-L36 |
amranidev/scaffold-interface | src/Generators/Generator.php | Generator.views | public function views()
{
$this->make($this->paths->indexPath(), $this->view->generate()->index);
$this->make($this->paths->createPath(), $this->view->generate()->create);
$this->make($this->paths->showPath(), $this->view->generate()->show);
$this->make($this->paths->editPath(), $thi... | php | public function views()
{
$this->make($this->paths->indexPath(), $this->view->generate()->index);
$this->make($this->paths->createPath(), $this->view->generate()->create);
$this->make($this->paths->showPath(), $this->view->generate()->show);
$this->make($this->paths->editPath(), $thi... | [
"public",
"function",
"views",
"(",
")",
"{",
"$",
"this",
"->",
"make",
"(",
"$",
"this",
"->",
"paths",
"->",
"indexPath",
"(",
")",
",",
"$",
"this",
"->",
"view",
"->",
"generate",
"(",
")",
"->",
"index",
")",
";",
"$",
"this",
"->",
"make",... | Generate views.
@return void | [
"Generate",
"views",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Generators/Generator.php#L76-L82 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/PermissionController.php | PermissionController.update | public function update(Request $request)
{
$permission = Permission::findOrFail($request->permission_id);
$permission->name = $request->name;
$permission->update();
return redirect('scaffold-permissions');
} | php | public function update(Request $request)
{
$permission = Permission::findOrFail($request->permission_id);
$permission->name = $request->name;
$permission->update();
return redirect('scaffold-permissions');
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"permission",
"=",
"Permission",
"::",
"findOrFail",
"(",
"$",
"request",
"->",
"permission_id",
")",
";",
"$",
"permission",
"->",
"name",
"=",
"$",
"request",
"->",
"name",
... | Update the specified resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Update",
"the",
"specified",
"resource",
"in",
"storage",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/PermissionController.php#L68-L77 |
amranidev/scaffold-interface | src/Datasystem/Datasystem.php | Datasystem.getAttributes | private function getAttributes()
{
collect($this->foreignKeys)->each(function ($key, $value) {
$Schema = collect(Schema::getColumnListing($key));
$Schema = $Schema->reject(function ($value, $key) {
return str_contains($value, 'id');
});
$this->... | php | private function getAttributes()
{
collect($this->foreignKeys)->each(function ($key, $value) {
$Schema = collect(Schema::getColumnListing($key));
$Schema = $Schema->reject(function ($value, $key) {
return str_contains($value, 'id');
});
$this->... | [
"private",
"function",
"getAttributes",
"(",
")",
"{",
"collect",
"(",
"$",
"this",
"->",
"foreignKeys",
")",
"->",
"each",
"(",
"function",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"Schema",
"=",
"collect",
"(",
"Schema",
"::",
"getColumnLis... | Deduce relational arttributes.
@return void | [
"Deduce",
"relational",
"arttributes",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Datasystem/Datasystem.php#L70-L79 |
amranidev/scaffold-interface | src/Datasystem/Datasystem.php | Datasystem.relationData | private function relationData()
{
$onData = collect($this->data)->reject(function ($value, $key) {
return !str_contains($key, 'on');
});
$foreignKeys = collect($this->data)->reject(function ($value, $key) {
return !str_contains($key, 'tbl');
});
$thi... | php | private function relationData()
{
$onData = collect($this->data)->reject(function ($value, $key) {
return !str_contains($key, 'on');
});
$foreignKeys = collect($this->data)->reject(function ($value, $key) {
return !str_contains($key, 'tbl');
});
$thi... | [
"private",
"function",
"relationData",
"(",
")",
"{",
"$",
"onData",
"=",
"collect",
"(",
"$",
"this",
"->",
"data",
")",
"->",
"reject",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"{",
"return",
"!",
"str_contains",
"(",
"$",
"key",
... | Deduce onData and foreingKeys.
@return void | [
"Deduce",
"onData",
"and",
"foreingKeys",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Datasystem/Datasystem.php#L86-L99 |
amranidev/scaffold-interface | src/Datasystem/Datasystem.php | Datasystem.dataScaffold | public function dataScaffold($spec = null)
{
$data = collect($this->data)->reject(function ($value, $key) use ($spec) {
if ($spec == 'migration') {
return !str_contains($key, 'opt');
}
return !str_contains($key, 'atr');
});
return array_v... | php | public function dataScaffold($spec = null)
{
$data = collect($this->data)->reject(function ($value, $key) use ($spec) {
if ($spec == 'migration') {
return !str_contains($key, 'opt');
}
return !str_contains($key, 'atr');
});
return array_v... | [
"public",
"function",
"dataScaffold",
"(",
"$",
"spec",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"collect",
"(",
"$",
"this",
"->",
"data",
")",
"->",
"reject",
"(",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"use",
"(",
"$",
"spec",
")... | Data for migration and views.
@param string specification
@return array | [
"Data",
"for",
"migration",
"and",
"views",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Datasystem/Datasystem.php#L108-L119 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/RoleController.php | RoleController.update | public function update(Request $request)
{
$role = Role::findOrFail($request->role_id);
$role->name = $request->name;
$role->update();
return redirect('scaffold-roles');
} | php | public function update(Request $request)
{
$role = Role::findOrFail($request->role_id);
$role->name = $request->name;
$role->update();
return redirect('scaffold-roles');
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"role",
"=",
"Role",
"::",
"findOrFail",
"(",
"$",
"request",
"->",
"role_id",
")",
";",
"$",
"role",
"->",
"name",
"=",
"$",
"request",
"->",
"name",
";",
"$",
"role",
... | Update the specified resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Update",
"the",
"specified",
"resource",
"in",
"storage",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/RoleController.php#L68-L77 |
amranidev/scaffold-interface | src/Datasystem/Database/DatabaseManager.php | DatabaseManager.make | public static function make()
{
$class = str_replace(
'DatabaseManager',
ucfirst(config('database.default')).'Database',
self::class
);
try {
return new self(new $class());
} catch (\Exception $e) {
return new self(new Mysq... | php | public static function make()
{
$class = str_replace(
'DatabaseManager',
ucfirst(config('database.default')).'Database',
self::class
);
try {
return new self(new $class());
} catch (\Exception $e) {
return new self(new Mysq... | [
"public",
"static",
"function",
"make",
"(",
")",
"{",
"$",
"class",
"=",
"str_replace",
"(",
"'DatabaseManager'",
",",
"ucfirst",
"(",
"config",
"(",
"'database.default'",
")",
")",
".",
"'Database'",
",",
"self",
"::",
"class",
")",
";",
"try",
"{",
"r... | New instance based on app's database driver.
@return self | [
"New",
"instance",
"based",
"on",
"app",
"s",
"database",
"driver",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Datasystem/Database/DatabaseManager.php#L36-L49 |
amranidev/scaffold-interface | src/Datasystem/Database/DatabaseManager.php | DatabaseManager.getTablesNames | public function getTablesNames()
{
return $this->database->tableNames()->filter(function ($name) {
return !in_array($name, $this->exclude);
});
} | php | public function getTablesNames()
{
return $this->database->tableNames()->filter(function ($name) {
return !in_array($name, $this->exclude);
});
} | [
"public",
"function",
"getTablesNames",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"database",
"->",
"tableNames",
"(",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"name",
")",
"{",
"return",
"!",
"in_array",
"(",
"$",
"name",
",",
"$",
"this",
... | Get all tables names.
@return \Illuminate\Support\Collection | [
"Get",
"all",
"tables",
"names",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Datasystem/Database/DatabaseManager.php#L66-L71 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.store | public function store(Request $request)
{
app()->make('Request')->setRequest($request->toArray());
$scaffold = app()->make('Scaffold');
$relations = app()->make('Datasystem');
$scaffold->model()->views()->controller()->migration()->route();
$paths = app()->make('Path');
... | php | public function store(Request $request)
{
app()->make('Request')->setRequest($request->toArray());
$scaffold = app()->make('Scaffold');
$relations = app()->make('Datasystem');
$scaffold->model()->views()->controller()->migration()->route();
$paths = app()->make('Path');
... | [
"public",
"function",
"store",
"(",
"Request",
"$",
"request",
")",
"{",
"app",
"(",
")",
"->",
"make",
"(",
"'Request'",
")",
"->",
"setRequest",
"(",
"$",
"request",
"->",
"toArray",
"(",
")",
")",
";",
"$",
"scaffold",
"=",
"app",
"(",
")",
"->"... | Store a newly created resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Store",
"a",
"newly",
"created",
"resource",
"in",
"storage",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L45-L76 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.destroy | public function destroy($id)
{
$scaffoldInterface = Scaffoldinterface::FindOrFail($id);
$scaffoldInterface->delete();
Session::flash('status', 'Deleted Successfully');
return URL::to('scaffold');
} | php | public function destroy($id)
{
$scaffoldInterface = Scaffoldinterface::FindOrFail($id);
$scaffoldInterface->delete();
Session::flash('status', 'Deleted Successfully');
return URL::to('scaffold');
} | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"$",
"scaffoldInterface",
"=",
"Scaffoldinterface",
"::",
"FindOrFail",
"(",
"$",
"id",
")",
";",
"$",
"scaffoldInterface",
"->",
"delete",
"(",
")",
";",
"Session",
"::",
"flash",
"(",
"'status'",... | Remove the specified resource from storage.
@param int $id
@return \Illuminate\Http\Response | [
"Remove",
"the",
"specified",
"resource",
"from",
"storage",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L85-L94 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.deleteMsg | public function deleteMsg($id)
{
$scaffold = Scaffoldinterface::FindOrFail($id);
if (Schema::hasTable($scaffold->tablename)) {
$table = $scaffold->tablename;
return view('scaffold-interface::template.DeleteMessage.delete', compact('table'))->render();
}
$msg ... | php | public function deleteMsg($id)
{
$scaffold = Scaffoldinterface::FindOrFail($id);
if (Schema::hasTable($scaffold->tablename)) {
$table = $scaffold->tablename;
return view('scaffold-interface::template.DeleteMessage.delete', compact('table'))->render();
}
$msg ... | [
"public",
"function",
"deleteMsg",
"(",
"$",
"id",
")",
"{",
"$",
"scaffold",
"=",
"Scaffoldinterface",
"::",
"FindOrFail",
"(",
"$",
"id",
")",
";",
"if",
"(",
"Schema",
"::",
"hasTable",
"(",
"$",
"scaffold",
"->",
"tablename",
")",
")",
"{",
"$",
... | Delete confirmation message by ajaxis.
@link https://github.com/amranidev/ajaxis
@return \Illuminate\Http\Response | [
"Delete",
"confirmation",
"message",
"by",
"ajaxis",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L103-L114 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.getResult | public function getResult($table, Request $request)
{
$attributes = new Attribute($table);
if ($request->ajax()) {
return response()->json($attributes->getAttributes(), 200);
}
} | php | public function getResult($table, Request $request)
{
$attributes = new Attribute($table);
if ($request->ajax()) {
return response()->json($attributes->getAttributes(), 200);
}
} | [
"public",
"function",
"getResult",
"(",
"$",
"table",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"attributes",
"=",
"new",
"Attribute",
"(",
"$",
"table",
")",
";",
"if",
"(",
"$",
"request",
"->",
"ajax",
"(",
")",
")",
"{",
"return",
"response"... | Get attributes.
@param string $table
@return \Illuminate\Http\Response | [
"Get",
"attributes",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L123-L129 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.migrate | public function migrate()
{
try {
Artisan::call('migrate', ['--path' => config('amranidev.config.database')]);
exec('cd '.base_path().' && composer dump-autoload');
} catch (\Exception $e) {
Session::flash('status', $e->getMessage());
return redirect(... | php | public function migrate()
{
try {
Artisan::call('migrate', ['--path' => config('amranidev.config.database')]);
exec('cd '.base_path().' && composer dump-autoload');
} catch (\Exception $e) {
Session::flash('status', $e->getMessage());
return redirect(... | [
"public",
"function",
"migrate",
"(",
")",
"{",
"try",
"{",
"Artisan",
"::",
"call",
"(",
"'migrate'",
",",
"[",
"'--path'",
"=>",
"config",
"(",
"'amranidev.config.database'",
")",
"]",
")",
";",
"exec",
"(",
"'cd '",
".",
"base_path",
"(",
")",
".",
... | Migrate schema.
@return \Illuminate\Http\Response | [
"Migrate",
"schema",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L136-L150 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.rollback | public function rollback()
{
if (!Scaffoldinterface::all()->count()) {
Session::flash('status', 'Nothing To Rollback');
return redirect('scaffold');
}
try {
Artisan::call('migrate:rollback');
} catch (\Exception $e) {
return $e->getMe... | php | public function rollback()
{
if (!Scaffoldinterface::all()->count()) {
Session::flash('status', 'Nothing To Rollback');
return redirect('scaffold');
}
try {
Artisan::call('migrate:rollback');
} catch (\Exception $e) {
return $e->getMe... | [
"public",
"function",
"rollback",
"(",
")",
"{",
"if",
"(",
"!",
"Scaffoldinterface",
"::",
"all",
"(",
")",
"->",
"count",
"(",
")",
")",
"{",
"Session",
"::",
"flash",
"(",
"'status'",
",",
"'Nothing To Rollback'",
")",
";",
"return",
"redirect",
"(",
... | Rollback schema.
@throws Exception
@return \Illuminate\Http\Response | [
"Rollback",
"schema",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L159-L176 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.manyToManyForm | public function manyToManyForm(Request $request)
{
$dummyData = DatabaseManager::tableNames();
$elements = Ajaxis::MtcreateFormModal([
['type' => 'select', 'name' => 'table1', 'key' => 'table1', 'value' => $dummyData],
['type' => 'select', 'name' => 'table2', 'key' => 'table2... | php | public function manyToManyForm(Request $request)
{
$dummyData = DatabaseManager::tableNames();
$elements = Ajaxis::MtcreateFormModal([
['type' => 'select', 'name' => 'table1', 'key' => 'table1', 'value' => $dummyData],
['type' => 'select', 'name' => 'table2', 'key' => 'table2... | [
"public",
"function",
"manyToManyForm",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"dummyData",
"=",
"DatabaseManager",
"::",
"tableNames",
"(",
")",
";",
"$",
"elements",
"=",
"Ajaxis",
"::",
"MtcreateFormModal",
"(",
"[",
"[",
"'type'",
"=>",
"'select'... | ManyToMany form.
@param \Illuminate\Http\Request
@return \Illuminate\Http\Response | [
"ManyToMany",
"form",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L185-L193 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.manyToMany | public function manyToMany(Request $request)
{
if ($this->check($request->toArray())) {
Session::flash('status', 'Error! could not be related');
return redirect('scaffold');
}
$table1 = DB::table('scaffoldinterfaces')->where('tablename', $request->toArray()['table1']... | php | public function manyToMany(Request $request)
{
if ($this->check($request->toArray())) {
Session::flash('status', 'Error! could not be related');
return redirect('scaffold');
}
$table1 = DB::table('scaffoldinterfaces')->where('tablename', $request->toArray()['table1']... | [
"public",
"function",
"manyToMany",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"check",
"(",
"$",
"request",
"->",
"toArray",
"(",
")",
")",
")",
"{",
"Session",
"::",
"flash",
"(",
"'status'",
",",
"'Error! could not be rela... | ManyToMany generate.
@param \Illuminate\Http\Request
@return \Illuminate\Http\Response | [
"ManyToMany",
"generate",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L202-L223 |
amranidev/scaffold-interface | src/Http/Controllers/GuiController.php | GuiController.graph | public function graph()
{
$nodes = Scaffoldinterface::all()->map(function (Scaffoldinterface $entity) {
return ['id' => $entity->id, 'label' => $entity->tablename];
})->toJson();
$edges = Relation::all()->map(function (Relation $relation) {
return ['from' => $relatio... | php | public function graph()
{
$nodes = Scaffoldinterface::all()->map(function (Scaffoldinterface $entity) {
return ['id' => $entity->id, 'label' => $entity->tablename];
})->toJson();
$edges = Relation::all()->map(function (Relation $relation) {
return ['from' => $relatio... | [
"public",
"function",
"graph",
"(",
")",
"{",
"$",
"nodes",
"=",
"Scaffoldinterface",
"::",
"all",
"(",
")",
"->",
"map",
"(",
"function",
"(",
"Scaffoldinterface",
"$",
"entity",
")",
"{",
"return",
"[",
"'id'",
"=>",
"$",
"entity",
"->",
"id",
",",
... | Transform entities into a grahp.
@return \Illuminate\Http\Response | [
"Transform",
"entities",
"into",
"a",
"grahp",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Controllers/GuiController.php#L242-L253 |
amranidev/scaffold-interface | src/ManyToMany/ManyToMany.php | ManyToMany.order | private function order()
{
$result = [];
$data = $this->request;
if ($data['table1'] > $data['table2']) {
$result['first'] = $data['table2'];
$result['second'] = $data['table1'];
} else {
$result['first'] = $data['table1'];
$result['s... | php | private function order()
{
$result = [];
$data = $this->request;
if ($data['table1'] > $data['table2']) {
$result['first'] = $data['table2'];
$result['second'] = $data['table1'];
} else {
$result['first'] = $data['table1'];
$result['s... | [
"private",
"function",
"order",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"request",
";",
"if",
"(",
"$",
"data",
"[",
"'table1'",
"]",
">",
"$",
"data",
"[",
"'table2'",
"]",
")",
"{",
"$",
"result"... | Determine which table is ordered alphabetically.
@return array $tables | [
"Determine",
"which",
"table",
"is",
"ordered",
"alphabetically",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/ManyToMany/ManyToMany.php#L44-L59 |
amranidev/scaffold-interface | src/ManyToMany/ManyToMany.php | ManyToMany.model | private function model()
{
$this->relationship(config('amranidev.config.model').DIRECTORY_SEPARATOR.ucfirst(str_singular($this->tables['first'])).'.php', $this->tables['second']);
$this->relationship(config('amranidev.config.model').DIRECTORY_SEPARATOR.ucfirst(str_singular($this->tables['second'])).... | php | private function model()
{
$this->relationship(config('amranidev.config.model').DIRECTORY_SEPARATOR.ucfirst(str_singular($this->tables['first'])).'.php', $this->tables['second']);
$this->relationship(config('amranidev.config.model').DIRECTORY_SEPARATOR.ucfirst(str_singular($this->tables['second'])).... | [
"private",
"function",
"model",
"(",
")",
"{",
"$",
"this",
"->",
"relationship",
"(",
"config",
"(",
"'amranidev.config.model'",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"ucfirst",
"(",
"str_singular",
"(",
"$",
"this",
"->",
"tables",
"[",
"'first'",
"]",
")"... | Add relationships methods to models.
@return void | [
"Add",
"relationships",
"methods",
"to",
"models",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/ManyToMany/ManyToMany.php#L66-L70 |
amranidev/scaffold-interface | src/ManyToMany/ManyToMany.php | ManyToMany.migration | private function migration()
{
$migrationContent = "<?php\n\n".view('scaffold-interface::template.ManyToMany.migration', $this->tables)->render();
$migrationFileName = date('Y').'_'.date('m').'_'.date('d').'_'.date('his').'_'.ucfirst($this->tables['first']).ucfirst($this->tables['second']).'.php';
... | php | private function migration()
{
$migrationContent = "<?php\n\n".view('scaffold-interface::template.ManyToMany.migration', $this->tables)->render();
$migrationFileName = date('Y').'_'.date('m').'_'.date('d').'_'.date('his').'_'.ucfirst($this->tables['first']).ucfirst($this->tables['second']).'.php';
... | [
"private",
"function",
"migration",
"(",
")",
"{",
"$",
"migrationContent",
"=",
"\"<?php\\n\\n\"",
".",
"view",
"(",
"'scaffold-interface::template.ManyToMany.migration'",
",",
"$",
"this",
"->",
"tables",
")",
"->",
"render",
"(",
")",
";",
"$",
"migrationFileNa... | Make migration file.
@return void | [
"Make",
"migration",
"file",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/ManyToMany/ManyToMany.php#L77-L84 |
amranidev/scaffold-interface | src/ManyToMany/ManyToMany.php | ManyToMany.relationship | private function relationship($path, $model)
{
$lines = file($path, FILE_IGNORE_NEW_LINES);
$last = count($lines) - 1;
unset($lines[$last]);
$result = implode("\n", array_values($lines));
$model = view('scaffold-interface::template.ManyToMany.model', ['model' => $model])->ren... | php | private function relationship($path, $model)
{
$lines = file($path, FILE_IGNORE_NEW_LINES);
$last = count($lines) - 1;
unset($lines[$last]);
$result = implode("\n", array_values($lines));
$model = view('scaffold-interface::template.ManyToMany.model', ['model' => $model])->ren... | [
"private",
"function",
"relationship",
"(",
"$",
"path",
",",
"$",
"model",
")",
"{",
"$",
"lines",
"=",
"file",
"(",
"$",
"path",
",",
"FILE_IGNORE_NEW_LINES",
")",
";",
"$",
"last",
"=",
"count",
"(",
"$",
"lines",
")",
"-",
"1",
";",
"unset",
"(... | Generate relationships methods.
@return bool | [
"Generate",
"relationships",
"methods",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/ManyToMany/ManyToMany.php#L91-L101 |
amranidev/scaffold-interface | src/Http/Middleware/ScaffoldMiddleware.php | ScaffoldMiddleware.handle | public function handle(Request $request, Closure $next)
{
if ($request->segment(1) == 'scaffold') {
// allowed env-s check
$allowed = collect(config('amranidev.config.env'))
->contains(config('app.env'));
if (!$allowed) {
retu... | php | public function handle(Request $request, Closure $next)
{
if ($request->segment(1) == 'scaffold') {
// allowed env-s check
$allowed = collect(config('amranidev.config.env'))
->contains(config('app.env'));
if (!$allowed) {
retu... | [
"public",
"function",
"handle",
"(",
"Request",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"if",
"(",
"$",
"request",
"->",
"segment",
"(",
"1",
")",
"==",
"'scaffold'",
")",
"{",
"// allowed env-s check",
"$",
"allowed",
"=",
"collect",
"(",... | Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Http/Middleware/ScaffoldMiddleware.php#L23-L37 |
amranidev/scaffold-interface | src/Filesystem/Path.php | Path.migrationPath | private function migrationPath()
{
$FileName = date('Y').'_'.date('m').'_'.date('d').'_'.date('his').'_'.$this->parser->plural().'.php';
return config('amranidev.config.migration').'/'.$FileName;
} | php | private function migrationPath()
{
$FileName = date('Y').'_'.date('m').'_'.date('d').'_'.date('his').'_'.$this->parser->plural().'.php';
return config('amranidev.config.migration').'/'.$FileName;
} | [
"private",
"function",
"migrationPath",
"(",
")",
"{",
"$",
"FileName",
"=",
"date",
"(",
"'Y'",
")",
".",
"'_'",
".",
"date",
"(",
"'m'",
")",
".",
"'_'",
".",
"date",
"(",
"'d'",
")",
".",
"'_'",
".",
"date",
"(",
"'his'",
")",
".",
"'_'",
".... | Get migration file path.
@return string | [
"Get",
"migration",
"file",
"path",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Filesystem/Path.php#L53-L58 |
amranidev/scaffold-interface | src/Generators/ViewGenerate.php | ViewGenerate.generateView | private function generateView($view)
{
return $this->indenter
->indent(view('scaffold-interface::template.views.'.$this->parser->getTemplate().'.'.$view,
['parser' => $this->parser, 'dataSystem' => $this->dataSystem])->render());
} | php | private function generateView($view)
{
return $this->indenter
->indent(view('scaffold-interface::template.views.'.$this->parser->getTemplate().'.'.$view,
['parser' => $this->parser, 'dataSystem' => $this->dataSystem])->render());
} | [
"private",
"function",
"generateView",
"(",
"$",
"view",
")",
"{",
"return",
"$",
"this",
"->",
"indenter",
"->",
"indent",
"(",
"view",
"(",
"'scaffold-interface::template.views.'",
".",
"$",
"this",
"->",
"parser",
"->",
"getTemplate",
"(",
")",
".",
"'.'"... | Generate View.
@param string $view
@return string | [
"Generate",
"View",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Generators/ViewGenerate.php#L62-L67 |
amranidev/scaffold-interface | src/Generators/ViewGenerate.php | ViewGenerate.generate | public function generate()
{
$views = new \StdClass();
foreach ($this->views as $view) {
$views->{$view} = $this->generateView($view);
}
return $views;
} | php | public function generate()
{
$views = new \StdClass();
foreach ($this->views as $view) {
$views->{$view} = $this->generateView($view);
}
return $views;
} | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"views",
"=",
"new",
"\\",
"StdClass",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"views",
"as",
"$",
"view",
")",
"{",
"$",
"views",
"->",
"{",
"$",
"view",
"}",
"=",
"$",
"this",
"-... | Generate Views.
@return mixed | [
"Generate",
"Views",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Generators/ViewGenerate.php#L74-L83 |
amranidev/scaffold-interface | src/Attribute.php | Attribute.getAttributes | public function getAttributes()
{
return collect(Schema::getColumnListing($this->table))->filter(function ($column) {
return !in_array($column, $this->exclude);
});
} | php | public function getAttributes()
{
return collect(Schema::getColumnListing($this->table))->filter(function ($column) {
return !in_array($column, $this->exclude);
});
} | [
"public",
"function",
"getAttributes",
"(",
")",
"{",
"return",
"collect",
"(",
"Schema",
"::",
"getColumnListing",
"(",
"$",
"this",
"->",
"table",
")",
")",
"->",
"filter",
"(",
"function",
"(",
"$",
"column",
")",
"{",
"return",
"!",
"in_array",
"(",
... | Get attributes from an existing table.
@return array | [
"Get",
"attributes",
"from",
"an",
"existing",
"table",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Attribute.php#L43-L48 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.store | public function store(Request $request)
{
$user = new \App\User();
$user->email = $request->email;
$user->name = $request->name;
$user->password = Hash::make($request->password);
$user->save();
return redirect('scaffold-users');
} | php | public function store(Request $request)
{
$user = new \App\User();
$user->email = $request->email;
$user->name = $request->name;
$user->password = Hash::make($request->password);
$user->save();
return redirect('scaffold-users');
} | [
"public",
"function",
"store",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"new",
"\\",
"App",
"\\",
"User",
"(",
")",
";",
"$",
"user",
"->",
"email",
"=",
"$",
"request",
"->",
"email",
";",
"$",
"user",
"->",
"name",
"=",
"$",
... | Store a newly created resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Store",
"a",
"newly",
"created",
"resource",
"in",
"storage",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L42-L53 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.edit | public function edit($id)
{
$user = \App\User::findOrfail($id);
$roles = Role::all()->pluck('name');
$permissions = Permission::all()->pluck('name');
$userRoles = $user->roles;
$userPermissions = $user->permissions;
return view('scaffold-interface.users.edit', compac... | php | public function edit($id)
{
$user = \App\User::findOrfail($id);
$roles = Role::all()->pluck('name');
$permissions = Permission::all()->pluck('name');
$userRoles = $user->roles;
$userPermissions = $user->permissions;
return view('scaffold-interface.users.edit', compac... | [
"public",
"function",
"edit",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"findOrfail",
"(",
"$",
"id",
")",
";",
"$",
"roles",
"=",
"Role",
"::",
"all",
"(",
")",
"->",
"pluck",
"(",
"'name'",
")",
";",
"$",
... | Show the form for editing the specified resource.
@param int $id
@return \Illuminate\Http\Response | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"specified",
"resource",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L62-L71 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.update | public function update(Request $request)
{
$user = \App\User::findOrfail($request->user_id);
$user->email = $request->email;
$user->name = $request->name;
$user->password = Hash::make($request->password);
$user->save();
return redirect('scaffold-users');
} | php | public function update(Request $request)
{
$user = \App\User::findOrfail($request->user_id);
$user->email = $request->email;
$user->name = $request->name;
$user->password = Hash::make($request->password);
$user->save();
return redirect('scaffold-users');
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"findOrfail",
"(",
"$",
"request",
"->",
"user_id",
")",
";",
"$",
"user",
"->",
"email",
"=",
"$",
"request",
"->",
"email",... | Update the specified resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\Response | [
"Update",
"the",
"specified",
"resource",
"in",
"storage",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L80-L91 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.destroy | public function destroy($id)
{
$user = \App\User::findOrfail($id);
$user->delete();
return redirect('scaffold-users');
} | php | public function destroy($id)
{
$user = \App\User::findOrfail($id);
$user->delete();
return redirect('scaffold-users');
} | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"findOrfail",
"(",
"$",
"id",
")",
";",
"$",
"user",
"->",
"delete",
"(",
")",
";",
"return",
"redirect",
"(",
"'scaffold-users'",
")",
";... | Remove the specified resource from storage.
@param int $id
@return \Illuminate\Http\Response | [
"Remove",
"the",
"specified",
"resource",
"from",
"storage",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L100-L107 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.addRole | public function addRole(Request $request)
{
$user = \App\User::findOrfail($request->user_id);
$user->assignRole($request->role_name);
return redirect('scaffold-users/edit/'.$request->user_id);
} | php | public function addRole(Request $request)
{
$user = \App\User::findOrfail($request->user_id);
$user->assignRole($request->role_name);
return redirect('scaffold-users/edit/'.$request->user_id);
} | [
"public",
"function",
"addRole",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"findOrfail",
"(",
"$",
"request",
"->",
"user_id",
")",
";",
"$",
"user",
"->",
"assignRole",
"(",
"$",
"request",
"->",
"r... | Assign Role to user.
@param \Illuminate\Http\Request
@return \Illuminate\Http\Response | [
"Assign",
"Role",
"to",
"user",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L116-L122 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.addPermission | public function addPermission(Request $request)
{
$user = \App\User::findorfail($request->user_id);
$user->givePermissionTo($request->permission_name);
return redirect('scaffold-users/edit/'.$request->user_id);
} | php | public function addPermission(Request $request)
{
$user = \App\User::findorfail($request->user_id);
$user->givePermissionTo($request->permission_name);
return redirect('scaffold-users/edit/'.$request->user_id);
} | [
"public",
"function",
"addPermission",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"findorfail",
"(",
"$",
"request",
"->",
"user_id",
")",
";",
"$",
"user",
"->",
"givePermissionTo",
"(",
"$",
"request",
... | Assign Permission to a user.
@param \Illuminate\Http\Request
@return \Illuminate\Http\Response | [
"Assign",
"Permission",
"to",
"a",
"user",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L131-L137 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.revokePermission | public function revokePermission($permission, $user_id)
{
$user = \App\User::findorfail($user_id);
$user->revokePermissionTo(str_slug($permission, ' '));
return redirect('scaffold-users/edit/'.$user_id);
} | php | public function revokePermission($permission, $user_id)
{
$user = \App\User::findorfail($user_id);
$user->revokePermissionTo(str_slug($permission, ' '));
return redirect('scaffold-users/edit/'.$user_id);
} | [
"public",
"function",
"revokePermission",
"(",
"$",
"permission",
",",
"$",
"user_id",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"findorfail",
"(",
"$",
"user_id",
")",
";",
"$",
"user",
"->",
"revokePermissionTo",
"(",
"str_slug",
"("... | revoke Permission to a user.
@param \Illuminate\Http\Request
@return \Illuminate\Http\Response | [
"revoke",
"Permission",
"to",
"a",
"user",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L146-L153 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/UserController.php | UserController.revokeRole | public function revokeRole($role, $user_id)
{
$user = \App\User::findorfail($user_id);
$user->removeRole(str_slug($role, ' '));
return redirect('scaffold-users/edit/'.$user_id);
} | php | public function revokeRole($role, $user_id)
{
$user = \App\User::findorfail($user_id);
$user->removeRole(str_slug($role, ' '));
return redirect('scaffold-users/edit/'.$user_id);
} | [
"public",
"function",
"revokeRole",
"(",
"$",
"role",
",",
"$",
"user_id",
")",
"{",
"$",
"user",
"=",
"\\",
"App",
"\\",
"User",
"::",
"findorfail",
"(",
"$",
"user_id",
")",
";",
"$",
"user",
"->",
"removeRole",
"(",
"str_slug",
"(",
"$",
"role",
... | revoke Role to a a user.
@param \Illuminate\Http\Request
@return \Illuminate\Http\Response | [
"revoke",
"Role",
"to",
"a",
"a",
"user",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/UserController.php#L162-L169 |
amranidev/scaffold-interface | src/Listeners/DeleteCrudFiles.php | DeleteCrudFiles.handle | public function handle(DeleteCrud $event)
{
unlink($event->scaffold->migration);
unlink($event->scaffold->model);
unlink($event->scaffold->controller);
unlink($event->scaffold->views.'/index.blade.php');
unlink($event->scaffold->views.'/create.blade.php');
unlink($eve... | php | public function handle(DeleteCrud $event)
{
unlink($event->scaffold->migration);
unlink($event->scaffold->model);
unlink($event->scaffold->controller);
unlink($event->scaffold->views.'/index.blade.php');
unlink($event->scaffold->views.'/create.blade.php');
unlink($eve... | [
"public",
"function",
"handle",
"(",
"DeleteCrud",
"$",
"event",
")",
"{",
"unlink",
"(",
"$",
"event",
"->",
"scaffold",
"->",
"migration",
")",
";",
"unlink",
"(",
"$",
"event",
"->",
"scaffold",
"->",
"model",
")",
";",
"unlink",
"(",
"$",
"event",
... | Handle the event.
@param object $event
@return void | [
"Handle",
"the",
"event",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Listeners/DeleteCrudFiles.php#L26-L38 |
amranidev/scaffold-interface | src/Listeners/DeleteCrudFiles.php | DeleteCrudFiles.clearRoutes | private function clearRoutes($remove)
{
$path = config('amranidev.config.routes');
$lines = file($path, FILE_IGNORE_NEW_LINES);
foreach (array_filter($lines, function ($line) use ($remove) {
return strstr($line, $remove);
}) as $key => $line) {
unset($lines[$... | php | private function clearRoutes($remove)
{
$path = config('amranidev.config.routes');
$lines = file($path, FILE_IGNORE_NEW_LINES);
foreach (array_filter($lines, function ($line) use ($remove) {
return strstr($line, $remove);
}) as $key => $line) {
unset($lines[$... | [
"private",
"function",
"clearRoutes",
"(",
"$",
"remove",
")",
"{",
"$",
"path",
"=",
"config",
"(",
"'amranidev.config.routes'",
")",
";",
"$",
"lines",
"=",
"file",
"(",
"$",
"path",
",",
"FILE_IGNORE_NEW_LINES",
")",
";",
"foreach",
"(",
"array_filter",
... | Clear routes.
@param string $remove
@return mixed | [
"Clear",
"routes",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Listeners/DeleteCrudFiles.php#L47-L59 |
amranidev/scaffold-interface | database/migrations/2015_10_31_162633_scaffoldinterfaces.php | Scaffoldinterfaces.up | public function up()
{
Schema::create('scaffoldinterfaces', function (Blueprint $table) {
$table->increments('id')->unsigned();
$table->String('package');
$table->String('migration');
$table->String('model');
$table->String('controller');
... | php | public function up()
{
Schema::create('scaffoldinterfaces', function (Blueprint $table) {
$table->increments('id')->unsigned();
$table->String('package');
$table->String('migration');
$table->String('model');
$table->String('controller');
... | [
"public",
"function",
"up",
"(",
")",
"{",
"Schema",
"::",
"create",
"(",
"'scaffoldinterfaces'",
",",
"function",
"(",
"Blueprint",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"increments",
"(",
"'id'",
")",
"->",
"unsigned",
"(",
")",
";",
"$",
"tabl... | Run the migrations.
@return void | [
"Run",
"the",
"migrations",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/database/migrations/2015_10_31_162633_scaffoldinterfaces.php#L13-L33 |
amranidev/scaffold-interface | src/ScaffoldInterfaceServiceProvider.php | ScaffoldInterfaceServiceProvider.boot | public function boot()
{
// Get namespace.
$nameSpace = $this->app->getNamespace();
// Set namespace alias for AppController.
AliasLoader::getInstance()->alias('AppController', $nameSpace.'Http\Controllers\Controller');
// Routes.
$this->app->router->group(['namespa... | php | public function boot()
{
// Get namespace.
$nameSpace = $this->app->getNamespace();
// Set namespace alias for AppController.
AliasLoader::getInstance()->alias('AppController', $nameSpace.'Http\Controllers\Controller');
// Routes.
$this->app->router->group(['namespa... | [
"public",
"function",
"boot",
"(",
")",
"{",
"// Get namespace.",
"$",
"nameSpace",
"=",
"$",
"this",
"->",
"app",
"->",
"getNamespace",
"(",
")",
";",
"// Set namespace alias for AppController.",
"AliasLoader",
"::",
"getInstance",
"(",
")",
"->",
"alias",
"(",... | Bootstrap the application events.
@return void | [
"Bootstrap",
"the",
"application",
"events",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/ScaffoldInterfaceServiceProvider.php#L28-L64 |
amranidev/scaffold-interface | src/ScaffoldInterfaceServiceProvider.php | ScaffoldInterfaceServiceProvider.register | public function register()
{
$this->app->register(ScaffoldInterfaceEventServiceProvider::class);
$this->app->singleton('laravelRequest', \Illuminate\Http\Request::class);
$this->app->singleton('Request', \Amranidev\ScaffoldInterface\Http\Request::class);
$this->app->singleton('Sca... | php | public function register()
{
$this->app->register(ScaffoldInterfaceEventServiceProvider::class);
$this->app->singleton('laravelRequest', \Illuminate\Http\Request::class);
$this->app->singleton('Request', \Amranidev\ScaffoldInterface\Http\Request::class);
$this->app->singleton('Sca... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"register",
"(",
"ScaffoldInterfaceEventServiceProvider",
"::",
"class",
")",
";",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'laravelRequest'",
",",
"\\",
"Illuminate",
... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/ScaffoldInterfaceServiceProvider.php#L71-L104 |
amranidev/scaffold-interface | src/Publishes/Controllers/ScaffoldInterface/AppController.php | AppController.dashboard | public function dashboard()
{
$users = \App\User::all()->count();
$roles = \Spatie\Permission\Models\Role::all()->count();
$permissions = \Spatie\Permission\Models\Permission::all()->count();
$entities = \Amranidev\ScaffoldInterface\Models\Scaffoldinterface::all();
return vi... | php | public function dashboard()
{
$users = \App\User::all()->count();
$roles = \Spatie\Permission\Models\Role::all()->count();
$permissions = \Spatie\Permission\Models\Permission::all()->count();
$entities = \Amranidev\ScaffoldInterface\Models\Scaffoldinterface::all();
return vi... | [
"public",
"function",
"dashboard",
"(",
")",
"{",
"$",
"users",
"=",
"\\",
"App",
"\\",
"User",
"::",
"all",
"(",
")",
"->",
"count",
"(",
")",
";",
"$",
"roles",
"=",
"\\",
"Spatie",
"\\",
"Permission",
"\\",
"Models",
"\\",
"Role",
"::",
"all",
... | Display a listing of the resource.
@return \Illuminate\Http\Response | [
"Display",
"a",
"listing",
"of",
"the",
"resource",
"."
] | train | https://github.com/amranidev/scaffold-interface/blob/eb4f0b57ec26bf1dd1078acdd34a046d95b33440/src/Publishes/Controllers/ScaffoldInterface/AppController.php#L19-L27 |
spatie/laravel-cookie-consent | src/CookieConsentMiddleware.php | CookieConsentMiddleware.addCookieConsentScriptToResponse | protected function addCookieConsentScriptToResponse(Response $response)
{
$content = $response->getContent();
$closingBodyTagPosition = $this->getLastClosingBodyTagPosition($content);
$content = ''
.substr($content, 0, $closingBodyTagPosition)
.view('cookieConsent::... | php | protected function addCookieConsentScriptToResponse(Response $response)
{
$content = $response->getContent();
$closingBodyTagPosition = $this->getLastClosingBodyTagPosition($content);
$content = ''
.substr($content, 0, $closingBodyTagPosition)
.view('cookieConsent::... | [
"protected",
"function",
"addCookieConsentScriptToResponse",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"content",
"=",
"$",
"response",
"->",
"getContent",
"(",
")",
";",
"$",
"closingBodyTagPosition",
"=",
"$",
"this",
"->",
"getLastClosingBodyTagPosition",
... | @param \Illuminate\Http\Response $response
@return $this | [
"@param",
"\\",
"Illuminate",
"\\",
"Http",
"\\",
"Response",
"$response"
] | train | https://github.com/spatie/laravel-cookie-consent/blob/5a6158b0787a5d35e9e964f2d49a8db21b0d63c7/src/CookieConsentMiddleware.php#L39-L51 |
florianv/swap | src/Service/Factory.php | Factory.setHttpClient | public function setHttpClient($httpClient): void
{
if (!$httpClient instanceof ClientInterface && !$httpClient instanceof HttpClient) {
throw new \LogicException('Client must be an instance of Http\\Client\\HttpClient or Psr\\Http\\Client\\ClientInterface');
}
$this->httpClient ... | php | public function setHttpClient($httpClient): void
{
if (!$httpClient instanceof ClientInterface && !$httpClient instanceof HttpClient) {
throw new \LogicException('Client must be an instance of Http\\Client\\HttpClient or Psr\\Http\\Client\\ClientInterface');
}
$this->httpClient ... | [
"public",
"function",
"setHttpClient",
"(",
"$",
"httpClient",
")",
":",
"void",
"{",
"if",
"(",
"!",
"$",
"httpClient",
"instanceof",
"ClientInterface",
"&&",
"!",
"$",
"httpClient",
"instanceof",
"HttpClient",
")",
"{",
"throw",
"new",
"\\",
"LogicException"... | Sets the http client.
@param HttpClient|ClientInterface $httpClient | [
"Sets",
"the",
"http",
"client",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Service/Factory.php#L76-L83 |
florianv/swap | src/Service/Factory.php | Factory.create | public function create(string $serviceName, array $args = [])
{
if (!$this->registry->has($serviceName)) {
throw new \LogicException(sprintf('The service "%s" is not registered.', $serviceName));
}
$classOrCallable = $this->registry->get($serviceName);
if (is_callable($... | php | public function create(string $serviceName, array $args = [])
{
if (!$this->registry->has($serviceName)) {
throw new \LogicException(sprintf('The service "%s" is not registered.', $serviceName));
}
$classOrCallable = $this->registry->get($serviceName);
if (is_callable($... | [
"public",
"function",
"create",
"(",
"string",
"$",
"serviceName",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"registry",
"->",
"has",
"(",
"$",
"serviceName",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicE... | Creates a new service.
@param string $serviceName
@param array $args
@return \Exchanger\Contract\ExchangeRateService | [
"Creates",
"a",
"new",
"service",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Service/Factory.php#L103-L122 |
florianv/swap | src/Builder.php | Builder.add | public function add(string $serviceName, array $options = []): self
{
$this->services[$serviceName] = $options;
return $this;
} | php | public function add(string $serviceName, array $options = []): self
{
$this->services[$serviceName] = $options;
return $this;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"serviceName",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"this",
"->",
"services",
"[",
"$",
"serviceName",
"]",
"=",
"$",
"options",
";",
"return",
"$",
"this",
";",
"... | Adds a service.
@param string $serviceName
@param array $options
@return Builder | [
"Adds",
"a",
"service",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Builder.php#L85-L90 |
florianv/swap | src/Builder.php | Builder.useHttpClient | public function useHttpClient($httpClient): self
{
if (!$httpClient instanceof ClientInterface && !$httpClient instanceof HttpClient) {
throw new \LogicException('Client must be an instance of Http\\Client\\HttpClient or Psr\\Http\\Client\\ClientInterface');
}
$this->httpClient ... | php | public function useHttpClient($httpClient): self
{
if (!$httpClient instanceof ClientInterface && !$httpClient instanceof HttpClient) {
throw new \LogicException('Client must be an instance of Http\\Client\\HttpClient or Psr\\Http\\Client\\ClientInterface');
}
$this->httpClient ... | [
"public",
"function",
"useHttpClient",
"(",
"$",
"httpClient",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"httpClient",
"instanceof",
"ClientInterface",
"&&",
"!",
"$",
"httpClient",
"instanceof",
"HttpClient",
")",
"{",
"throw",
"new",
"\\",
"LogicException"... | Uses the given http client.
@param HttpClient|ClientInterface $httpClient
@return Builder | [
"Uses",
"the",
"given",
"http",
"client",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Builder.php#L99-L108 |
florianv/swap | src/Builder.php | Builder.build | public function build(): Swap
{
$serviceFactory = new Factory($this->httpClient, $this->requestFactory);
$services = [];
foreach ($this->services as $name => $options) {
$services[] = $serviceFactory->create($name, $options);
}
$service = new Chain($services);
... | php | public function build(): Swap
{
$serviceFactory = new Factory($this->httpClient, $this->requestFactory);
$services = [];
foreach ($this->services as $name => $options) {
$services[] = $serviceFactory->create($name, $options);
}
$service = new Chain($services);
... | [
"public",
"function",
"build",
"(",
")",
":",
"Swap",
"{",
"$",
"serviceFactory",
"=",
"new",
"Factory",
"(",
"$",
"this",
"->",
"httpClient",
",",
"$",
"this",
"->",
"requestFactory",
")",
";",
"$",
"services",
"=",
"[",
"]",
";",
"foreach",
"(",
"$... | Builds Swap.
@return Swap | [
"Builds",
"Swap",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Builder.php#L143-L156 |
florianv/swap | src/Service/Registry.php | Registry.get | public function get(string $name)
{
return isset(self::$services[$name]) ? self::$services[$name] : null;
} | php | public function get(string $name)
{
return isset(self::$services[$name]) ? self::$services[$name] : null;
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"self",
"::",
"$",
"services",
"[",
"$",
"name",
"]",
")",
"?",
"self",
"::",
"$",
"services",
"[",
"$",
"name",
"]",
":",
"null",
";",
"}"
] | Gets a service.
@param string $name The service name
@return string|null | [
"Gets",
"a",
"service",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Service/Registry.php#L59-L62 |
florianv/swap | src/Service/Registry.php | Registry.registerServices | private function registerServices(): void
{
$services = ExchangerRegistry::getServices();
foreach ($services as $name => $class) {
self::register($name, $class);
}
} | php | private function registerServices(): void
{
$services = ExchangerRegistry::getServices();
foreach ($services as $name => $class) {
self::register($name, $class);
}
} | [
"private",
"function",
"registerServices",
"(",
")",
":",
"void",
"{",
"$",
"services",
"=",
"ExchangerRegistry",
"::",
"getServices",
"(",
")",
";",
"foreach",
"(",
"$",
"services",
"as",
"$",
"name",
"=>",
"$",
"class",
")",
"{",
"self",
"::",
"registe... | Registers the core services. | [
"Registers",
"the",
"core",
"services",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Service/Registry.php#L80-L87 |
florianv/swap | src/Swap.php | Swap.historical | public function historical(string $currencyPair, \DateTimeInterface $date, array $options = []): ExchangeRateContract
{
return $this->quote($currencyPair, $date, $options);
} | php | public function historical(string $currencyPair, \DateTimeInterface $date, array $options = []): ExchangeRateContract
{
return $this->quote($currencyPair, $date, $options);
} | [
"public",
"function",
"historical",
"(",
"string",
"$",
"currencyPair",
",",
"\\",
"DateTimeInterface",
"$",
"date",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"ExchangeRateContract",
"{",
"return",
"$",
"this",
"->",
"quote",
"(",
"$",
"curren... | Quotes a currency pair.
@param string $currencyPair The currency pair like "EUR/USD"
@param \DateTimeInterface $date An optional date for historical rates
@param array $options An array of query options
@return ExchangeRateContract | [
"Quotes",
"a",
"currency",
"pair",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Swap.php#L66-L69 |
florianv/swap | src/Swap.php | Swap.quote | private function quote(string $currencyPair, \DateTimeInterface $date = null, array $options = []): ExchangeRateContract
{
$exchangeQueryBuilder = new ExchangeRateQueryBuilder($currencyPair);
if (null !== $date) {
$exchangeQueryBuilder->setDate($date);
}
foreach ($optio... | php | private function quote(string $currencyPair, \DateTimeInterface $date = null, array $options = []): ExchangeRateContract
{
$exchangeQueryBuilder = new ExchangeRateQueryBuilder($currencyPair);
if (null !== $date) {
$exchangeQueryBuilder->setDate($date);
}
foreach ($optio... | [
"private",
"function",
"quote",
"(",
"string",
"$",
"currencyPair",
",",
"\\",
"DateTimeInterface",
"$",
"date",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"ExchangeRateContract",
"{",
"$",
"exchangeQueryBuilder",
"=",
"new",
"Exchan... | Quotes a currency pair.
@param string $currencyPair The currency pair like "EUR/USD"
@param \DateTimeInterface $date An optional date for historical rates
@param array $options An array of query options
@return ExchangeRateContract | [
"Quotes",
"a",
"currency",
"pair",
"."
] | train | https://github.com/florianv/swap/blob/c9828964670d586fc52980195b98f5adac079748/src/Swap.php#L80-L95 |
Austinb/GameQ | src/GameQ/Protocols/Tshock.php | Tshock.processResponse | public function processResponse()
{
if (empty($this->packets_response)) {
return [];
}
// Implode and rip out the JSON
preg_match('/\{(.*)\}/ms', implode('', $this->packets_response), $matches);
// Return should be JSON, let's validate
if (!isset... | php | public function processResponse()
{
if (empty($this->packets_response)) {
return [];
}
// Implode and rip out the JSON
preg_match('/\{(.*)\}/ms', implode('', $this->packets_response), $matches);
// Return should be JSON, let's validate
if (!isset... | [
"public",
"function",
"processResponse",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"packets_response",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"// Implode and rip out the JSON",
"preg_match",
"(",
"'/\\{(.*)\\}/ms'",
",",
"implode",
"(",
... | Process the response
@return array
@throws Exception | [
"Process",
"the",
"response"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Tshock.php#L97-L156 |
Austinb/GameQ | src/GameQ/Protocols/Starmade.php | Starmade.processResponse | public function processResponse()
{
// Implode the packets, not sure if there is any split logic for multiple packets
$buffer = new Buffer(implode('', $this->packets_response), Buffer::NUMBER_TYPE_BIGENDIAN);
// Get the passed length in the data side of the packet
$buffer->readInt3... | php | public function processResponse()
{
// Implode the packets, not sure if there is any split logic for multiple packets
$buffer = new Buffer(implode('', $this->packets_response), Buffer::NUMBER_TYPE_BIGENDIAN);
// Get the passed length in the data side of the packet
$buffer->readInt3... | [
"public",
"function",
"processResponse",
"(",
")",
"{",
"// Implode the packets, not sure if there is any split logic for multiple packets",
"$",
"buffer",
"=",
"new",
"Buffer",
"(",
"implode",
"(",
"''",
",",
"$",
"this",
"->",
"packets_response",
")",
",",
"Buffer",
... | Process the response for the StarMade server
@return array
@throws \GameQ\Exception\Protocol | [
"Process",
"the",
"response",
"for",
"the",
"StarMade",
"server"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Starmade.php#L105-L149 |
Austinb/GameQ | src/GameQ/Protocols/Starmade.php | Starmade.parseServerParameters | protected function parseServerParameters(Buffer &$buffer)
{
// Init the parsed data array
$parsed = [];
// Read the number of parameters to parse
$parameterSize = $buffer->readInt32Signed();
// Iterate over the parameter size
for ($i = 0; $i < $parameterSize; $i++)... | php | protected function parseServerParameters(Buffer &$buffer)
{
// Init the parsed data array
$parsed = [];
// Read the number of parameters to parse
$parameterSize = $buffer->readInt32Signed();
// Iterate over the parameter size
for ($i = 0; $i < $parameterSize; $i++)... | [
"protected",
"function",
"parseServerParameters",
"(",
"Buffer",
"&",
"$",
"buffer",
")",
"{",
"// Init the parsed data array",
"$",
"parsed",
"=",
"[",
"]",
";",
"// Read the number of parameters to parse",
"$",
"parameterSize",
"=",
"$",
"buffer",
"->",
"readInt32Si... | Parse the server response parameters
@SuppressWarnings(PHPMD.CyclomaticComplexity)
@param \GameQ\Buffer $buffer
@return array
@throws \GameQ\Exception\Protocol | [
"Parse",
"the",
"server",
"response",
"parameters"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Starmade.php#L161-L225 |
Austinb/GameQ | src/GameQ/Protocols/Justcause2.php | Justcause2.processDetails | protected function processDetails(Buffer &$buffer, Result &$result)
{
parent::processDetails($buffer, $result);
// Add in map
$result->add('mapname', 'Panau');
$result->add('dedicated', 'true');
} | php | protected function processDetails(Buffer &$buffer, Result &$result)
{
parent::processDetails($buffer, $result);
// Add in map
$result->add('mapname', 'Panau');
$result->add('dedicated', 'true');
} | [
"protected",
"function",
"processDetails",
"(",
"Buffer",
"&",
"$",
"buffer",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"parent",
"::",
"processDetails",
"(",
"$",
"buffer",
",",
"$",
"result",
")",
";",
"// Add in map",
"$",
"result",
"->",
"add",
"(... | Overload so we can add in some static data points
@param Buffer $buffer
@param Result $result | [
"Overload",
"so",
"we",
"can",
"add",
"in",
"some",
"static",
"data",
"points"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Justcause2.php#L101-L108 |
Austinb/GameQ | src/GameQ/Protocols/Justcause2.php | Justcause2.processPlayersAndTeams | protected function processPlayersAndTeams(Buffer &$buffer, Result &$result)
{
// Loop until we run out of data
while ($buffer->getLength()) {
$result->addPlayer('name', $buffer->readString());
$result->addPlayer('steamid', $buffer->readString());
$result->addPlaye... | php | protected function processPlayersAndTeams(Buffer &$buffer, Result &$result)
{
// Loop until we run out of data
while ($buffer->getLength()) {
$result->addPlayer('name', $buffer->readString());
$result->addPlayer('steamid', $buffer->readString());
$result->addPlaye... | [
"protected",
"function",
"processPlayersAndTeams",
"(",
"Buffer",
"&",
"$",
"buffer",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"// Loop until we run out of data",
"while",
"(",
"$",
"buffer",
"->",
"getLength",
"(",
")",
")",
"{",
"$",
"result",
"->",
"a... | Override the parent, this protocol is returned differently
@param Buffer $buffer
@param Result $result
@see Gamespy3::processPlayersAndTeams() | [
"Override",
"the",
"parent",
"this",
"protocol",
"is",
"returned",
"differently"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Justcause2.php#L118-L126 |
Austinb/GameQ | src/GameQ/Query/Native.php | Native.write | public function write($data)
{
try {
// No socket for this server, make one
if (is_null($this->socket)) {
$this->create();
}
// Send the packet
return fwrite($this->socket, $data);
} catch (\Exception $e) {
thr... | php | public function write($data)
{
try {
// No socket for this server, make one
if (is_null($this->socket)) {
$this->create();
}
// Send the packet
return fwrite($this->socket, $data);
} catch (\Exception $e) {
thr... | [
"public",
"function",
"write",
"(",
"$",
"data",
")",
"{",
"try",
"{",
"// No socket for this server, make one",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"socket",
")",
")",
"{",
"$",
"this",
"->",
"create",
"(",
")",
";",
"}",
"// Send the packet",
... | Write data to the socket
@param string $data
@return int The number of bytes written
@throws \GameQ\Exception\Query | [
"Write",
"data",
"to",
"the",
"socket"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Query/Native.php#L55-L69 |
Austinb/GameQ | src/GameQ/Query/Native.php | Native.create | protected function create()
{
// Create the remote address
$remote_addr = sprintf("%s://%s:%d", $this->transport, $this->ip, $this->port);
// Create context
$context = stream_context_create([
'socket' => [
'bindto' => '0:0', // Bind to any available IP a... | php | protected function create()
{
// Create the remote address
$remote_addr = sprintf("%s://%s:%d", $this->transport, $this->ip, $this->port);
// Create context
$context = stream_context_create([
'socket' => [
'bindto' => '0:0', // Bind to any available IP a... | [
"protected",
"function",
"create",
"(",
")",
"{",
"// Create the remote address",
"$",
"remote_addr",
"=",
"sprintf",
"(",
"\"%s://%s:%d\"",
",",
"$",
"this",
"->",
"transport",
",",
"$",
"this",
"->",
"ip",
",",
"$",
"this",
"->",
"port",
")",
";",
"// Cr... | Create a new socket for this query
@throws \GameQ\Exception\Query | [
"Create",
"a",
"new",
"socket",
"for",
"this",
"query"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Query/Native.php#L88-L125 |
Austinb/GameQ | src/GameQ/Query/Native.php | Native.getResponses | public function getResponses(array $sockets, $timeout, $stream_timeout)
{
// Set the loop to active
$loop_active = true;
// Will hold the responses read from the sockets
$responses = [];
// To store the sockets
$sockets_tmp = [];
// Loop and pull out all t... | php | public function getResponses(array $sockets, $timeout, $stream_timeout)
{
// Set the loop to active
$loop_active = true;
// Will hold the responses read from the sockets
$responses = [];
// To store the sockets
$sockets_tmp = [];
// Loop and pull out all t... | [
"public",
"function",
"getResponses",
"(",
"array",
"$",
"sockets",
",",
"$",
"timeout",
",",
"$",
"stream_timeout",
")",
"{",
"// Set the loop to active",
"$",
"loop_active",
"=",
"true",
";",
"// Will hold the responses read from the sockets",
"$",
"responses",
"=",... | Pull the responses out of the stream
@SuppressWarnings(PHPMD.CyclomaticComplexity)
@SuppressWarnings(PHPMD.NPathComplexity)
@param array $sockets
@param int $timeout
@param int $stream_timeout
@return array Raw responses | [
"Pull",
"the",
"responses",
"out",
"of",
"the",
"stream"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Query/Native.php#L139-L220 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak3.php | Teamspeak3.beforeSend | public function beforeSend(Server $server)
{
// Check to make sure we have a query_port because it is required
if (!isset($this->options[Server::SERVER_OPTIONS_QUERY_PORT])
|| empty($this->options[Server::SERVER_OPTIONS_QUERY_PORT])
) {
throw new Exception(__METHOD__... | php | public function beforeSend(Server $server)
{
// Check to make sure we have a query_port because it is required
if (!isset($this->options[Server::SERVER_OPTIONS_QUERY_PORT])
|| empty($this->options[Server::SERVER_OPTIONS_QUERY_PORT])
) {
throw new Exception(__METHOD__... | [
"public",
"function",
"beforeSend",
"(",
"Server",
"$",
"server",
")",
"{",
"// Check to make sure we have a query_port because it is required",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"Server",
"::",
"SERVER_OPTIONS_QUERY_PORT",
"]",
")",
"... | Before we send off the queries we need to update the packets
@param \GameQ\Server $server
@throws \GameQ\Exception\Protocol | [
"Before",
"we",
"send",
"off",
"the",
"queries",
"we",
"need",
"to",
"update",
"the",
"packets"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak3.php#L121-L136 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak3.php | Teamspeak3.processResponse | public function processResponse()
{
// Make a new buffer out of all of the packets
$buffer = new Buffer(implode('', $this->packets_response));
// Check the header TS3
if (($header = trim($buffer->readString("\n"))) !== 'TS3') {
throw new Exception(__METHOD__ . " Expecte... | php | public function processResponse()
{
// Make a new buffer out of all of the packets
$buffer = new Buffer(implode('', $this->packets_response));
// Check the header TS3
if (($header = trim($buffer->readString("\n"))) !== 'TS3') {
throw new Exception(__METHOD__ . " Expecte... | [
"public",
"function",
"processResponse",
"(",
")",
"{",
"// Make a new buffer out of all of the packets",
"$",
"buffer",
"=",
"new",
"Buffer",
"(",
"implode",
"(",
"''",
",",
"$",
"this",
"->",
"packets_response",
")",
")",
";",
"// Check the header TS3",
"if",
"(... | Process the response
@return array
@throws \GameQ\Exception\Protocol | [
"Process",
"the",
"response"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak3.php#L144-L204 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak3.php | Teamspeak3.processProperties | protected function processProperties($data)
{
// Will hold the properties we are sending back
$properties = [];
// All of these are split on space
$items = explode(' ', $data);
// Iterate over the items
foreach ($items as $item) {
// Explode and make su... | php | protected function processProperties($data)
{
// Will hold the properties we are sending back
$properties = [];
// All of these are split on space
$items = explode(' ', $data);
// Iterate over the items
foreach ($items as $item) {
// Explode and make su... | [
"protected",
"function",
"processProperties",
"(",
"$",
"data",
")",
"{",
"// Will hold the properties we are sending back",
"$",
"properties",
"=",
"[",
"]",
";",
"// All of these are split on space",
"$",
"items",
"=",
"explode",
"(",
"' '",
",",
"$",
"data",
")",... | Process the properties of the data.
Takes data in "key1=value1 key2=value2 ..." and processes it into a usable format
@param $data
@return array | [
"Process",
"the",
"properties",
"of",
"the",
"data",
"."
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak3.php#L219-L246 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak3.php | Teamspeak3.processDetails | protected function processDetails($data, Result &$result)
{
// Offload the parsing for these values
$properties = $this->processProperties($data);
// Always dedicated
$result->add('dedicated', 1);
// Iterate over the properties
foreach ($properties as $key => $valu... | php | protected function processDetails($data, Result &$result)
{
// Offload the parsing for these values
$properties = $this->processProperties($data);
// Always dedicated
$result->add('dedicated', 1);
// Iterate over the properties
foreach ($properties as $key => $valu... | [
"protected",
"function",
"processDetails",
"(",
"$",
"data",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"// Offload the parsing for these values",
"$",
"properties",
"=",
"$",
"this",
"->",
"processProperties",
"(",
"$",
"data",
")",
";",
"// Always dedicated",
... | Handles processing the details data into a usable format
@param string $data
@param \GameQ\Result $result | [
"Handles",
"processing",
"the",
"details",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak3.php#L254-L275 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak3.php | Teamspeak3.processChannels | protected function processChannels($data, Result &$result)
{
// We need to split the data at the pipe
$channels = explode('|', $data);
// Iterate over the channels
foreach ($channels as $channel) {
// Offload the parsing for these values
$properties = $this-... | php | protected function processChannels($data, Result &$result)
{
// We need to split the data at the pipe
$channels = explode('|', $data);
// Iterate over the channels
foreach ($channels as $channel) {
// Offload the parsing for these values
$properties = $this-... | [
"protected",
"function",
"processChannels",
"(",
"$",
"data",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"// We need to split the data at the pipe",
"$",
"channels",
"=",
"explode",
"(",
"'|'",
",",
"$",
"data",
")",
";",
"// Iterate over the channels",
"foreach... | Process the channel listing
@param string $data
@param \GameQ\Result $result | [
"Process",
"the",
"channel",
"listing"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak3.php#L283-L301 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak3.php | Teamspeak3.processPlayers | protected function processPlayers($data, Result &$result)
{
// We need to split the data at the pipe
$players = explode('|', $data);
// Iterate over the channels
foreach ($players as $player) {
// Offload the parsing for these values
$properties = $this->pro... | php | protected function processPlayers($data, Result &$result)
{
// We need to split the data at the pipe
$players = explode('|', $data);
// Iterate over the channels
foreach ($players as $player) {
// Offload the parsing for these values
$properties = $this->pro... | [
"protected",
"function",
"processPlayers",
"(",
"$",
"data",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"// We need to split the data at the pipe",
"$",
"players",
"=",
"explode",
"(",
"'|'",
",",
"$",
"data",
")",
";",
"// Iterate over the channels",
"foreach",... | Process the user listing
@param string $data
@param \GameQ\Result $result | [
"Process",
"the",
"user",
"listing"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak3.php#L309-L327 |
Austinb/GameQ | src/GameQ/Protocols/Unreal2.php | Unreal2.processDetails | protected function processDetails(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
$result->add('serverid', $buffer->readInt32()); // 0
$result->add('serverip', $buffer->readPascalString(1)); // empty
$result->add('gameport', $buffer->rea... | php | protected function processDetails(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
$result->add('serverid', $buffer->readInt32()); // 0
$result->add('serverip', $buffer->readPascalString(1)); // empty
$result->add('gameport', $buffer->rea... | [
"protected",
"function",
"processDetails",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"result",
"->",
"add",
"(",
"'serverid'",
",",
"$",
"buffer",
"->",
"readI... | Handles processing the details data into a usable format
@param \GameQ\Buffer $buffer
@return mixed
@throws \GameQ\Exception\Protocol | [
"Handles",
"processing",
"the",
"details",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Unreal2.php#L160-L180 |
Austinb/GameQ | src/GameQ/Protocols/Unreal2.php | Unreal2.processPlayers | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Parse players
while ($buffer->getLength()) {
// Player id
if (($id = $buffer->readInt32()) !== 0) {
// Add the results
... | php | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Parse players
while ($buffer->getLength()) {
// Player id
if (($id = $buffer->readInt32()) !== 0) {
// Add the results
... | [
"protected",
"function",
"processPlayers",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// Parse players",
"while",
"(",
"$",
"buffer",
"->",
"getLength",
"(",
")",
")"... | Handles processing the player data into a usable format
@param \GameQ\Buffer $buffer
@return mixed | [
"Handles",
"processing",
"the",
"player",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Unreal2.php#L189-L213 |
Austinb/GameQ | src/GameQ/Protocols/Unreal2.php | Unreal2.processRules | protected function processRules(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Named values
$inc = -1;
while ($buffer->getLength()) {
// Grab the key
$key = $buffer->readPascalString(1);
// Make s... | php | protected function processRules(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Named values
$inc = -1;
while ($buffer->getLength()) {
// Grab the key
$key = $buffer->readPascalString(1);
// Make s... | [
"protected",
"function",
"processRules",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// Named values",
"$",
"inc",
"=",
"-",
"1",
";",
"while",
"(",
"$",
"buffer",
... | Handles processing the rules data into a usable format
@param \GameQ\Buffer $buffer
@return mixed | [
"Handles",
"processing",
"the",
"rules",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Unreal2.php#L222-L245 |
Austinb/GameQ | src/GameQ/Protocols/Ship.php | Ship.processPlayers | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// We need to read the number of players because this response has other data at the end usually
$num_players = $buffer->readInt8();
// Player count
... | php | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// We need to read the number of players because this response has other data at the end usually
$num_players = $buffer->readInt8();
// Player count
... | [
"protected",
"function",
"processPlayers",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// We need to read the number of players because this response has other data at the end usually",... | Specific player parse for The Ship
Player response has unknown data after the last real player
@param \GameQ\Buffer $buffer
@return array | [
"Specific",
"player",
"parse",
"for",
"The",
"Ship"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Ship.php#L58-L94 |
Austinb/GameQ | src/GameQ/Protocols/Samp.php | Samp.beforeSend | public function beforeSend(Server $server)
{
// Build the server code
$this->server_code = implode('', array_map('chr', explode('.', $server->ip()))) .
pack("S", $server->portClient());
// Loop over the packets and update them
foreach ($this->packets as... | php | public function beforeSend(Server $server)
{
// Build the server code
$this->server_code = implode('', array_map('chr', explode('.', $server->ip()))) .
pack("S", $server->portClient());
// Loop over the packets and update them
foreach ($this->packets as... | [
"public",
"function",
"beforeSend",
"(",
"Server",
"$",
"server",
")",
"{",
"// Build the server code",
"$",
"this",
"->",
"server_code",
"=",
"implode",
"(",
"''",
",",
"array_map",
"(",
"'chr'",
",",
"explode",
"(",
"'.'",
",",
"$",
"server",
"->",
"ip",... | Handle some work before sending the packets out to the server
@param \GameQ\Server $server | [
"Handle",
"some",
"work",
"before",
"sending",
"the",
"packets",
"out",
"to",
"the",
"server"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Samp.php#L118-L130 |
Austinb/GameQ | src/GameQ/Protocols/Samp.php | Samp.processResponse | public function processResponse()
{
// Results that will be returned
$results = [ ];
// Get the length of the server code so we can figure out how much to read later
$serverCodeLength = strlen($this->server_code);
// We need to pre-sort these for split packets so we can do... | php | public function processResponse()
{
// Results that will be returned
$results = [ ];
// Get the length of the server code so we can figure out how much to read later
$serverCodeLength = strlen($this->server_code);
// We need to pre-sort these for split packets so we can do... | [
"public",
"function",
"processResponse",
"(",
")",
"{",
"// Results that will be returned",
"$",
"results",
"=",
"[",
"]",
";",
"// Get the length of the server code so we can figure out how much to read later",
"$",
"serverCodeLength",
"=",
"strlen",
"(",
"$",
"this",
"->"... | Process the response
@return array
@throws \GameQ\Exception\Protocol | [
"Process",
"the",
"response"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Samp.php#L138-L180 |
Austinb/GameQ | src/GameQ/Protocols/Samp.php | Samp.processStatus | protected function processStatus(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Always dedicated
$result->add('dedicated', 1);
// Pull out the server information
$result->add('password', $buffer->readInt8());
$result... | php | protected function processStatus(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Always dedicated
$result->add('dedicated', 1);
// Pull out the server information
$result->add('password', $buffer->readInt8());
$result... | [
"protected",
"function",
"processStatus",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// Always dedicated",
"$",
"result",
"->",
"add",
"(",
"'dedicated'",
",",
"1",
"... | Handles processing the server status data
@param \GameQ\Buffer $buffer
@return array
@throws \GameQ\Exception\Protocol | [
"Handles",
"processing",
"the",
"server",
"status",
"data"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Samp.php#L194-L216 |
Austinb/GameQ | src/GameQ/Protocols/Samp.php | Samp.processPlayers | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Number of players
$result->add('num_players', $buffer->readInt16());
// Run until we run out of buffer
while ($buffer->getLength()) {
... | php | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Number of players
$result->add('num_players', $buffer->readInt16());
// Run until we run out of buffer
while ($buffer->getLength()) {
... | [
"protected",
"function",
"processPlayers",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// Number of players",
"$",
"result",
"->",
"add",
"(",
"'num_players'",
",",
"$",... | Handles processing the player data into a usable format
@param \GameQ\Buffer $buffer
@return array | [
"Handles",
"processing",
"the",
"player",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Samp.php#L225-L245 |
Austinb/GameQ | src/GameQ/Protocols/Samp.php | Samp.processRules | protected function processRules(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Number of rules
$result->add('num_rules', $buffer->readInt16());
// Run until we run out of buffer
while ($buffer->getLength()) {
$re... | php | protected function processRules(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Number of rules
$result->add('num_rules', $buffer->readInt16());
// Run until we run out of buffer
while ($buffer->getLength()) {
$re... | [
"protected",
"function",
"processRules",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// Number of rules",
"$",
"result",
"->",
"add",
"(",
"'num_rules'",
",",
"$",
"bu... | Handles processing the rules data into a usable format
@param \GameQ\Buffer $buffer
@return array | [
"Handles",
"processing",
"the",
"rules",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Samp.php#L254-L271 |
Austinb/GameQ | src/GameQ/Server.php | Server.checkAndSetIpPort | protected function checkAndSetIpPort($ip_address)
{
// Test for IPv6
if (substr_count($ip_address, ':') > 1) {
// See if we have a port, input should be in the format [::1]:27015 or similar
if (strstr($ip_address, ']:')) {
// Explode to get port
... | php | protected function checkAndSetIpPort($ip_address)
{
// Test for IPv6
if (substr_count($ip_address, ':') > 1) {
// See if we have a port, input should be in the format [::1]:27015 or similar
if (strstr($ip_address, ']:')) {
// Explode to get port
... | [
"protected",
"function",
"checkAndSetIpPort",
"(",
"$",
"ip_address",
")",
"{",
"// Test for IPv6",
"if",
"(",
"substr_count",
"(",
"$",
"ip_address",
",",
"':'",
")",
">",
"1",
")",
"{",
"// See if we have a port, input should be in the format [::1]:27015 or similar",
... | Check and set the ip address for this server
@param $ip_address
@throws \GameQ\Exception\Server | [
"Check",
"and",
"set",
"the",
"ip",
"address",
"for",
"this",
"server"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Server.php#L162-L215 |
Austinb/GameQ | src/GameQ/Server.php | Server.checkAndSetServerOptions | protected function checkAndSetServerOptions()
{
// Specific query port defined
if (array_key_exists(self::SERVER_OPTIONS_QUERY_PORT, $this->options)) {
$this->port_query = (int)$this->options[self::SERVER_OPTIONS_QUERY_PORT];
} else {
// Do math based on the protocol... | php | protected function checkAndSetServerOptions()
{
// Specific query port defined
if (array_key_exists(self::SERVER_OPTIONS_QUERY_PORT, $this->options)) {
$this->port_query = (int)$this->options[self::SERVER_OPTIONS_QUERY_PORT];
} else {
// Do math based on the protocol... | [
"protected",
"function",
"checkAndSetServerOptions",
"(",
")",
"{",
"// Specific query port defined",
"if",
"(",
"array_key_exists",
"(",
"self",
"::",
"SERVER_OPTIONS_QUERY_PORT",
",",
"$",
"this",
"->",
"options",
")",
")",
"{",
"$",
"this",
"->",
"port_query",
... | Check and set any server specific options | [
"Check",
"and",
"set",
"any",
"server",
"specific",
"options"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Server.php#L220-L230 |
Austinb/GameQ | src/GameQ/Server.php | Server.socketGet | public function socketGet()
{
$socket = null;
if (count($this->sockets) > 0) {
$socket = array_pop($this->sockets);
}
return $socket;
} | php | public function socketGet()
{
$socket = null;
if (count($this->sockets) > 0) {
$socket = array_pop($this->sockets);
}
return $socket;
} | [
"public",
"function",
"socketGet",
"(",
")",
"{",
"$",
"socket",
"=",
"null",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"sockets",
")",
">",
"0",
")",
"{",
"$",
"socket",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"sockets",
")",
";",
"}",
... | Get a socket from the list to reuse, if any are available
@codeCoverageIgnore
@return \GameQ\Query\Core|null | [
"Get",
"a",
"socket",
"from",
"the",
"list",
"to",
"reuse",
"if",
"any",
"are",
"available"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Server.php#L351-L361 |
Austinb/GameQ | src/GameQ/Filters/Secondstohuman.php | Secondstohuman.iterate | protected function iterate(array &$result)
{
// Iterate over the results
foreach ($result as $key => $value) {
// Offload to itself if we have another array
if (is_array($value)) {
// Iterate and update the result
$result[$key] = $this->iterate... | php | protected function iterate(array &$result)
{
// Iterate over the results
foreach ($result as $key => $value) {
// Offload to itself if we have another array
if (is_array($value)) {
// Iterate and update the result
$result[$key] = $this->iterate... | [
"protected",
"function",
"iterate",
"(",
"array",
"&",
"$",
"result",
")",
"{",
"// Iterate over the results",
"foreach",
"(",
"$",
"result",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"// Offload to itself if we have another array",
"if",
"(",
"is_array",
... | Home grown iterate function. Would like to replace this with an internal PHP method(s) but could not find a way
to make the iterate classes add new keys to the response. They all seemed to be read-only.
@todo: See if there is a more internal way of handling this instead of foreach looping and recursive calling
@par... | [
"Home",
"grown",
"iterate",
"function",
".",
"Would",
"like",
"to",
"replace",
"this",
"with",
"an",
"internal",
"PHP",
"method",
"(",
"s",
")",
"but",
"could",
"not",
"find",
"a",
"way",
"to",
"make",
"the",
"iterate",
"classes",
"add",
"new",
"keys",
... | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Filters/Secondstohuman.php#L98-L120 |
Austinb/GameQ | src/GameQ/Protocols/Gtan.php | Gtan.processResponse | public function processResponse()
{
// No response, assume offline
if (empty($this->packets_response)) {
return [
'gq_address' => $this->realIp,
'gq_port_query' => $this->realPortQuery,
];
}
// Implode and rip out the JSON
... | php | public function processResponse()
{
// No response, assume offline
if (empty($this->packets_response)) {
return [
'gq_address' => $this->realIp,
'gq_port_query' => $this->realPortQuery,
];
}
// Implode and rip out the JSON
... | [
"public",
"function",
"processResponse",
"(",
")",
"{",
"// No response, assume offline",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"packets_response",
")",
")",
"{",
"return",
"[",
"'gq_address'",
"=>",
"$",
"this",
"->",
"realIp",
",",
"'gq_port_query'",
"... | Process the response
@return array
@throws Exception | [
"Process",
"the",
"response"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Gtan.php#L126-L162 |
Austinb/GameQ | src/GameQ/Protocols/Source.php | Source.processResponse | public function processResponse()
{
// Will hold the results when complete
$results = [];
// Holds sorted response packets
$packets = [];
// We need to pre-sort these for split packets so we can do extra work where needed
foreach ($this->packets_response as $respons... | php | public function processResponse()
{
// Will hold the results when complete
$results = [];
// Holds sorted response packets
$packets = [];
// We need to pre-sort these for split packets so we can do extra work where needed
foreach ($this->packets_response as $respons... | [
"public",
"function",
"processResponse",
"(",
")",
"{",
"// Will hold the results when complete",
"$",
"results",
"=",
"[",
"]",
";",
"// Holds sorted response packets",
"$",
"packets",
"=",
"[",
"]",
";",
"// We need to pre-sort these for split packets so we can do extra wor... | Process the response
@return array
@throws \GameQ\Exception\Protocol | [
"Process",
"the",
"response"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Source.php#L155-L223 |
Austinb/GameQ | src/GameQ/Protocols/Source.php | Source.processPackets | protected function processPackets($packet_id, array $packets = [])
{
// Init array so we can order
$packs = [];
// We have multiple packets so we need to get them and order them
foreach ($packets as $i => $packet) {
// Make a buffer so we can read this info
... | php | protected function processPackets($packet_id, array $packets = [])
{
// Init array so we can order
$packs = [];
// We have multiple packets so we need to get them and order them
foreach ($packets as $i => $packet) {
// Make a buffer so we can read this info
... | [
"protected",
"function",
"processPackets",
"(",
"$",
"packet_id",
",",
"array",
"$",
"packets",
"=",
"[",
"]",
")",
"{",
"// Init array so we can order",
"$",
"packs",
"=",
"[",
"]",
";",
"// We have multiple packets so we need to get them and order them",
"foreach",
... | Process the split packets and decompress if necessary
@SuppressWarnings(PHPMD.UnusedLocalVariable)
@param $packet_id
@param array $packets
@return string
@throws \GameQ\Exception\Protocol | [
"Process",
"the",
"split",
"packets",
"and",
"decompress",
"if",
"necessary"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Source.php#L240-L334 |
Austinb/GameQ | src/GameQ/Protocols/Source.php | Source.processDetails | protected function processDetails(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
$result->add('protocol', $buffer->readInt8());
$result->add('hostname', $buffer->readString());
$result->add('map', $buffer->readString());
$result... | php | protected function processDetails(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
$result->add('protocol', $buffer->readInt8());
$result->add('hostname', $buffer->readString());
$result->add('map', $buffer->readString());
$result... | [
"protected",
"function",
"processDetails",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"result",
"->",
"add",
"(",
"'protocol'",
",",
"$",
"buffer",
"->",
"readI... | Handles processing the details data into a usable format
@param \GameQ\Buffer $buffer
@return mixed
@throws \GameQ\Exception\Protocol | [
"Handles",
"processing",
"the",
"details",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Source.php#L344-L407 |
Austinb/GameQ | src/GameQ/Protocols/Source.php | Source.processDetailsGoldSource | protected function processDetailsGoldSource(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
$result->add('address', $buffer->readString());
$result->add('hostname', $buffer->readString());
$result->add('map', $buffer->readString());
... | php | protected function processDetailsGoldSource(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
$result->add('address', $buffer->readString());
$result->add('hostname', $buffer->readString());
$result->add('map', $buffer->readString());
... | [
"protected",
"function",
"processDetailsGoldSource",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"result",
"->",
"add",
"(",
"'address'",
",",
"$",
"buffer",
"->",... | Handles processing the server details from goldsource response
@param \GameQ\Buffer $buffer
@return array
@throws \GameQ\Exception\Protocol | [
"Handles",
"processing",
"the",
"server",
"details",
"from",
"goldsource",
"response"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Source.php#L417-L455 |
Austinb/GameQ | src/GameQ/Protocols/Source.php | Source.processPlayers | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Pull out the number of players
$num_players = $buffer->readInt8();
// Player count
$result->add('num_players', $num_players);
// No pl... | php | protected function processPlayers(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Pull out the number of players
$num_players = $buffer->readInt8();
// Player count
$result->add('num_players', $num_players);
// No pl... | [
"protected",
"function",
"processPlayers",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// Pull out the number of players",
"$",
"num_players",
"=",
"$",
"buffer",
"->",
"r... | Handles processing the player data into a usable format
@param \GameQ\Buffer $buffer
@return mixed | [
"Handles",
"processing",
"the",
"player",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Source.php#L464-L492 |
Austinb/GameQ | src/GameQ/Protocols/Source.php | Source.processRules | protected function processRules(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Count the number of rules
$num_rules = $buffer->readInt16Signed();
// Add the count of the number of rules this server has
$result->add('num_rule... | php | protected function processRules(Buffer $buffer)
{
// Set the result to a new result instance
$result = new Result();
// Count the number of rules
$num_rules = $buffer->readInt16Signed();
// Add the count of the number of rules this server has
$result->add('num_rule... | [
"protected",
"function",
"processRules",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"// Set the result to a new result instance",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"// Count the number of rules",
"$",
"num_rules",
"=",
"$",
"buffer",
"->",
"readInt16S... | Handles processing the rules data into a usable format
@param \GameQ\Buffer $buffer
@return mixed | [
"Handles",
"processing",
"the",
"rules",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Source.php#L501-L521 |
Austinb/GameQ | src/GameQ/Filters/Stripcolors.php | Stripcolors.apply | public function apply(array $result, Server $server)
{
// No result passed so just return
if (empty($result)) {
return $result;
}
//$data = [];
//$data['raw'][ $server->id() ] = $result;
// Switch based on the base (not game) protocol
switch ($s... | php | public function apply(array $result, Server $server)
{
// No result passed so just return
if (empty($result)) {
return $result;
}
//$data = [];
//$data['raw'][ $server->id() ] = $result;
// Switch based on the base (not game) protocol
switch ($s... | [
"public",
"function",
"apply",
"(",
"array",
"$",
"result",
",",
"Server",
"$",
"server",
")",
"{",
"// No result passed so just return",
"if",
"(",
"empty",
"(",
"$",
"result",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
"//$data = [];",
"//$data['raw... | Apply this filter
@param array $result
@param \GameQ\Server $server
@return array | [
"Apply",
"this",
"filter"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Filters/Stripcolors.php#L41-L79 |
Austinb/GameQ | src/GameQ/Protocols/Gamespy3.php | Gamespy3.challengeParseAndApply | public function challengeParseAndApply(Buffer $challenge_buffer)
{
// Pull out the challenge
$challenge = substr(preg_replace("/[^0-9\-]/si", "", $challenge_buffer->getBuffer()), 1);
// By default, no challenge result (see #197)
$challenge_result = '';
// Check for valid ch... | php | public function challengeParseAndApply(Buffer $challenge_buffer)
{
// Pull out the challenge
$challenge = substr(preg_replace("/[^0-9\-]/si", "", $challenge_buffer->getBuffer()), 1);
// By default, no challenge result (see #197)
$challenge_result = '';
// Check for valid ch... | [
"public",
"function",
"challengeParseAndApply",
"(",
"Buffer",
"$",
"challenge_buffer",
")",
"{",
"// Pull out the challenge",
"$",
"challenge",
"=",
"substr",
"(",
"preg_replace",
"(",
"\"/[^0-9\\-]/si\"",
",",
"\"\"",
",",
"$",
"challenge_buffer",
"->",
"getBuffer",... | Parse the challenge response and apply it to all the packet types
@param \GameQ\Buffer $challenge_buffer
@return bool
@throws \GameQ\Exception\Protocol | [
"Parse",
"the",
"challenge",
"response",
"and",
"apply",
"it",
"to",
"all",
"the",
"packet",
"types"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Gamespy3.php#L92-L114 |
Austinb/GameQ | src/GameQ/Protocols/Gamespy3.php | Gamespy3.processResponse | public function processResponse()
{
// Holds the processed packets
$processed = [];
// Iterate over the packets
foreach ($this->packets_response as $response) {
// Make a buffer
$buffer = new Buffer($response, Buffer::NUMBER_TYPE_BIGENDIAN);
// ... | php | public function processResponse()
{
// Holds the processed packets
$processed = [];
// Iterate over the packets
foreach ($this->packets_response as $response) {
// Make a buffer
$buffer = new Buffer($response, Buffer::NUMBER_TYPE_BIGENDIAN);
// ... | [
"public",
"function",
"processResponse",
"(",
")",
"{",
"// Holds the processed packets",
"$",
"processed",
"=",
"[",
"]",
";",
"// Iterate over the packets",
"foreach",
"(",
"$",
"this",
"->",
"packets_response",
"as",
"$",
"response",
")",
"{",
"// Make a buffer",... | Process the response
@return array | [
"Process",
"the",
"response"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Gamespy3.php#L121-L180 |
Austinb/GameQ | src/GameQ/Protocols/Gamespy3.php | Gamespy3.cleanPackets | protected function cleanPackets(array $packets = [])
{
// Get the number of packets
$packetCount = count($packets);
// Compare last var of current packet with first var of next packet
// On a partial match, remove last var from current packet,
// variable header from next p... | php | protected function cleanPackets(array $packets = [])
{
// Get the number of packets
$packetCount = count($packets);
// Compare last var of current packet with first var of next packet
// On a partial match, remove last var from current packet,
// variable header from next p... | [
"protected",
"function",
"cleanPackets",
"(",
"array",
"$",
"packets",
"=",
"[",
"]",
")",
"{",
"// Get the number of packets",
"$",
"packetCount",
"=",
"count",
"(",
"$",
"packets",
")",
";",
"// Compare last var of current packet with first var of next packet",
"// On... | Handles cleaning up packets since the responses can be a bit "dirty"
@param array $packets
@return array | [
"Handles",
"cleaning",
"up",
"packets",
"since",
"the",
"responses",
"can",
"be",
"a",
"bit",
"dirty"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Gamespy3.php#L193-L238 |
Austinb/GameQ | src/GameQ/Protocols/Gamespy3.php | Gamespy3.processDetails | protected function processDetails(Buffer &$buffer, Result &$result)
{
// We go until we hit an empty key
while ($buffer->getLength()) {
$key = $buffer->readString();
if (strlen($key) == 0) {
break;
}
$result->add($key, utf8_encode($buf... | php | protected function processDetails(Buffer &$buffer, Result &$result)
{
// We go until we hit an empty key
while ($buffer->getLength()) {
$key = $buffer->readString();
if (strlen($key) == 0) {
break;
}
$result->add($key, utf8_encode($buf... | [
"protected",
"function",
"processDetails",
"(",
"Buffer",
"&",
"$",
"buffer",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"// We go until we hit an empty key",
"while",
"(",
"$",
"buffer",
"->",
"getLength",
"(",
")",
")",
"{",
"$",
"key",
"=",
"$",
"buff... | Handles processing the details data into a usable format
@param \GameQ\Buffer $buffer
@param \GameQ\Result $result | [
"Handles",
"processing",
"the",
"details",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Gamespy3.php#L246-L257 |
Austinb/GameQ | src/GameQ/Protocols/Gamespy3.php | Gamespy3.processPlayersAndTeams | protected function processPlayersAndTeams(Buffer &$buffer, Result &$result)
{
/*
* Explode the data into groups. First is player, next is team (item_t)
* Each group should be as follows:
*
* [0] => item_
* [1] => information for item_
* ...
*/
... | php | protected function processPlayersAndTeams(Buffer &$buffer, Result &$result)
{
/*
* Explode the data into groups. First is player, next is team (item_t)
* Each group should be as follows:
*
* [0] => item_
* [1] => information for item_
* ...
*/
... | [
"protected",
"function",
"processPlayersAndTeams",
"(",
"Buffer",
"&",
"$",
"buffer",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"/*\n * Explode the data into groups. First is player, next is team (item_t)\n * Each group should be as follows:\n *\n * [... | Handles processing the player and team data into a usable format
@param \GameQ\Buffer $buffer
@param \GameQ\Result $result | [
"Handles",
"processing",
"the",
"player",
"and",
"team",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Gamespy3.php#L265-L334 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak2.php | Teamspeak2.processDetails | protected function processDetails($data, Result &$result)
{
// Create a buffer
$buffer = new Buffer($data);
// Always dedicated
$result->add('dedicated', 1);
// Let's loop until we run out of data
while ($buffer->getLength()) {
// Grab the row, which is... | php | protected function processDetails($data, Result &$result)
{
// Create a buffer
$buffer = new Buffer($data);
// Always dedicated
$result->add('dedicated', 1);
// Let's loop until we run out of data
while ($buffer->getLength()) {
// Grab the row, which is... | [
"protected",
"function",
"processDetails",
"(",
"$",
"data",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"// Create a buffer",
"$",
"buffer",
"=",
"new",
"Buffer",
"(",
"$",
"data",
")",
";",
"// Always dedicated",
"$",
"result",
"->",
"add",
"(",
"'dedic... | Handles processing the details data into a usable format
@param string $data
@param \GameQ\Result $result | [
"Handles",
"processing",
"the",
"details",
"data",
"into",
"a",
"usable",
"format"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak2.php#L203-L225 |
Austinb/GameQ | src/GameQ/Protocols/Teamspeak2.php | Teamspeak2.processChannels | protected function processChannels($data, Result &$result)
{
// Create a buffer
$buffer = new Buffer($data);
// The first line holds the column names, data returned is in column/row format
$columns = explode("\t", trim($buffer->readString("\n")), 9);
// Loop through the ro... | php | protected function processChannels($data, Result &$result)
{
// Create a buffer
$buffer = new Buffer($data);
// The first line holds the column names, data returned is in column/row format
$columns = explode("\t", trim($buffer->readString("\n")), 9);
// Loop through the ro... | [
"protected",
"function",
"processChannels",
"(",
"$",
"data",
",",
"Result",
"&",
"$",
"result",
")",
"{",
"// Create a buffer",
"$",
"buffer",
"=",
"new",
"Buffer",
"(",
"$",
"data",
")",
";",
"// The first line holds the column names, data returned is in column/row ... | Process the channel listing
@param string $data
@param \GameQ\Result $result | [
"Process",
"the",
"channel",
"listing"
] | train | https://github.com/Austinb/GameQ/blob/85dadc7726f522a31f787a7917b4d6bc74c98529/src/GameQ/Protocols/Teamspeak2.php#L233-L257 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.