query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Increment current value of limit.
public function increment() { $this->current++; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function increment() {\n\t\t$this->amount++;\n\t}", "public function setLimit(?int $limit): void\n {\n $this->limit['value'] = $limit;\n }", "public function increase()\n {\n $reservedIds = [];\n if ($this->reserved !== null) {\n $reservedIds = explode(',', $this...
[ "0.7011745", "0.6590399", "0.65638113", "0.63739675", "0.63739675", "0.6327827", "0.62269455", "0.61876273", "0.6168899", "0.61627287", "0.6152954", "0.6102154", "0.6097574", "0.606614", "0.60343075", "0.60295266", "0.6014802", "0.6012263", "0.5968037", "0.596547", "0.5940704...
0.57874405
58
Validates whether a filePath meets our requirements format and structure and existence!
private function validateFilename($filePath) { if (!file_exists($filePath)) { throw new \InvalidArgumentException("File Path specified did not exist"); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }", "public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_...
[ "0.7575557", "0.7127265", "0.69352615", "0.69352615", "0.6767904", "0.6696189", "0.6690996", "0.66783845", "0.66282964", "0.65880644", "0.6585017", "0.6567576", "0.6559778", "0.64983726", "0.6414801", "0.63917", "0.6376757", "0.6370089", "0.634845", "0.6341636", "0.63335735",...
0.6988501
2
Execute the query and return the result
function execSql($query) { if ($result = mysql_query($query, $this->linkDatabaseSrc)) { return $result; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\n }", "public function execute()\n {\n \tif ( $this->cur_query != \"\" )\n \t{\n \t\t$res = $this->query( $this->cur_query );\n \t}\n \t\n \t$this->cur_query \t= \"\";\n \t$...
[ "0.8269502", "0.80444396", "0.7901628", "0.77636635", "0.7699635", "0.76198876", "0.75933397", "0.75763005", "0.7562325", "0.7505001", "0.74533737", "0.74245507", "0.7413114", "0.7413114", "0.73607415", "0.73559034", "0.7348902", "0.73341733", "0.72783697", "0.72475666", "0.7...
0.0
-1
Execute the query and return the new record Id
function execSqlId($query) { if ($result = mysql_query($query, $this->linkDatabaseSrc)) { $result=mysql_insert_id(); return $result; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newId(){ // get array of rows objects\r\t\treturn sqlite_last_insert_rowid ($this->handle);\r\t}", "function _createAndReturnId($sql, $updateParent) {\n $inserted = $this->update($sql);\n if ($inserted) {\n $dar = $this->retrieve(\"SELECT LAST_INSERT_ID() AS id\");\n ...
[ "0.6733775", "0.63934386", "0.63576955", "0.6353123", "0.6348524", "0.62796247", "0.6228253", "0.61323714", "0.60735536", "0.6032153", "0.6013569", "0.60049915", "0.5988195", "0.59806126", "0.59749764", "0.5974645", "0.59710234", "0.59710234", "0.59710234", "0.59642285", "0.5...
0.63673633
2
Push a new message onto the queue.
public function push($data, string $info, array $metadata = [], ?int $delay = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function push($message);", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public static function push($message) : void\n {\n array_push(static::$stack, (string)$message);\n \n }", "public function publish($messag...
[ "0.7529793", "0.7492054", "0.65593463", "0.64346075", "0.64081234", "0.63674283", "0.6342405", "0.6342405", "0.62738174", "0.62682295", "0.62682295", "0.6265121", "0.62147284", "0.616485", "0.61595803", "0.6120865", "0.6085709", "0.6081197", "0.60782033", "0.6027835", "0.6022...
0.0
-1
function to create roster query
function select_query( $tablepre = "euconnect_" ) { $select_sql = " " ; $sort_sql = " ORDER BY fullname ASC" ; $sql = "SELECT euid , RTRIM( CONCAT( lastname,\", \", firstname) ) AS fullname , username FROM " . $tablepre . "members WHERE active = 1 " ; return $sql . $select_sql . $sort_sql ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createQuery() ;", "function query() {}", "abstract public function query();", "public static function query();", "public abstract function get_query();", "public function query();", "public function query();", "public function query();", "function query() {\n $this->ensure_my_table();\n...
[ "0.7163919", "0.6680572", "0.6638963", "0.6510258", "0.64301246", "0.63620377", "0.63620377", "0.63620377", "0.62516844", "0.62365407", "0.62266964", "0.61458224", "0.60961795", "0.6093552", "0.6093552", "0.6093552", "0.60923076", "0.60224354", "0.6021416", "0.6007539", "0.60...
0.0
-1
Runs the deploy process
public function deploy(){ // load all configuration, payload, etc $this->load(); // setup directories $this->setup_dirs(); // initialise local git repositories $this->init_repo(); // run the deployment $this->_deploy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rdeploy() {\n\t\techo BR, TAB, TAB, '### checkOnce', BR;\n\t\t$this->checkOnce();\n\n\t\techo BR, TAB, TAB, '### pushAll', BR;\n\t\t$this->pushAll();\n\t\ttry {\n\t\t\t$exists = $this->rexists();\n\t\t} catch (\\SystemCommandException $e) {\n\t\t\t$exists = false;\n\t\t}\n\n\t\techo 'The destination folde...
[ "0.7791337", "0.75530183", "0.7403991", "0.7403991", "0.71118796", "0.6850574", "0.6759336", "0.64493597", "0.64446783", "0.64348465", "0.6363942", "0.630397", "0.63000774", "0.6112146", "0.60748327", "0.6056126", "0.6055078", "0.60430974", "0.60372525", "0.60299265", "0.6026...
0.8422718
0
Loads the payload and maps the schema
public function load() { // load the payload $payload = new \Yapapaya\DevOps\WPD\Payload( $this->config ); $this->payload = $payload->setup(); // map the payload with the configuration $map = new \Yapapaya\DevOps\WPD\Map(); $map->init( $this->config, $this->payload ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function load()\n\t{\n\n $data = simplexml_load_string(file_get_contents($this->_origin));\n\n\n\n $data = json_decode(json_encode((array)$data), TRUE);\n\n //$this\n\n $this->_data = [];\n\n\n $firstKey = array_keys($data)[0];\n\n //print_r($data[$firstKey]);\n ...
[ "0.59054846", "0.58964443", "0.585824", "0.579825", "0.5780709", "0.5693666", "0.5605477", "0.5605477", "0.5605477", "0.5605477", "0.5605247", "0.56037325", "0.56037325", "0.55887395", "0.5529489", "0.53794897", "0.5363", "0.52989876", "0.52818346", "0.52818346", "0.52818346"...
0.61661655
0
Tests commands needed for deployment
public function test_commands() { // test git if ( ! $this->test_cmd( 'git' ) ) { error( '501 Not Implemented', '<code>git</code> is not installed' ); } // if we're running a slim deploy but the remote deosn't support `git archive`, // we need svn to run `svn export` if ( SLIM && ($this->config->schema[ 'git_archive' ] === false) && ! $this->test_cmd( "svn" ) ) { error( '501 Not Implemented', '<code>svn</code> is not installed' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeploy()\n {\n }", "public function beforeStartingDeploy()\n {\n // $this->runLocal('./vendor/bin/simple-phpunit');\n }", "public function testNameAndArguments()\n {\n $this->assertEquals('contao:install-web-dir', $this->command->getName());\n $this->asse...
[ "0.7459329", "0.7122933", "0.63586414", "0.6288866", "0.62183785", "0.6218028", "0.61845714", "0.61533713", "0.6142157", "0.6081859", "0.60757345", "0.60705394", "0.6056716", "0.6052736", "0.60347545", "0.5993077", "0.5987081", "0.5967315", "0.5966268", "0.596555", "0.5935672...
0.7939011
0
Initialises local git repos
public function init_repo() { // we don't need to maintain local repos for slim deploys if ( SLIM ) { return; } // if the repo is already initialised, we don't need to if ( is_dir( "wpd-repos/{$this->config->repo[ 'name' ]}/.git" ) ) { return; } // store the directory we're in right now, so we can come back $original_dir = getcwd(); // switch the repo's directory chdir( "wpd-repos/{$this->config->repo[ 'name' ]}" ); // initialise git exec( 'git init' ); // add the remote repo as a remote called origin exec( "git remote add origin " . $this->config->repo[ 'git_url' ] ); // switch back to the original directory chdir( $original_dir ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getReposito...
[ "0.7279545", "0.6670897", "0.6670897", "0.654073", "0.64604723", "0.6432269", "0.63350374", "0.63283527", "0.63090694", "0.62556434", "0.62288153", "0.615954", "0.6146635", "0.6120152", "0.5970345", "0.59287566", "0.59048176", "0.5866624", "0.5812064", "0.5783141", "0.5760324...
0.7953516
0
Run the database seeds.
public function run() { factory(App\Entity::class, 20)->create()->each( function($Entity) { factory(App\Details::class)->create(['PersonalNumber' => $Entity->PersonalNumber]); factory(App\Balance::class)->create(['PersonalNumber' => $Entity->PersonalNumber]); factory(App\Contract::class)->create(['PersonalNumber' => $Entity->PersonalNumber]); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Run the database seeds.
public function run() { DB::table('camiseta_categorias')->truncate(); $faker = Faker::create(); foreach(range(1,8) as $i){ CamisetaCategoria::create([ 'nome' => $faker->firstName(), 'descricao' => $faker->sentence() ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Adds a path to the inclusion path
function addPath($path, $pre = true) { if($path) { if($pre) set_include_path($path . PATH_SEPARATOR . get_include_path()); else set_include_path(get_include_path() . PATH_SEPARATOR . $path); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addPath($path);", "public function addPath($path);", "public static function add(&$path) {\n $path = preg_replace('/((?:^|\\\\/)[^\\\\/\\\\.]+?)$/isD', '$1/', $path);\n }", "public function addPath($path)\n {\n if (!in_array($path, $this->_paths)) {\n $this->_paths[] ...
[ "0.74964696", "0.74964696", "0.693024", "0.69279706", "0.6847316", "0.67615354", "0.65598166", "0.64676046", "0.64571995", "0.64346045", "0.6324656", "0.6312328", "0.6308964", "0.62577605", "0.62532866", "0.6245961", "0.6182269", "0.6158436", "0.6115531", "0.6113915", "0.6084...
0.6469571
7
retrieve the current subdomain
function getSubdomain() { global $CONFIG; if(!$CONFIG->Subdomains->Top_domain) return false; $matches = array(); preg_match('#^(www\.)?([^\.]+)\.'.str_replace('.', '\.', $CONFIG->Subdomains->Top_domain).'#', $_SERVER['HTTP_HOST'], $matches); if(count($matches)>0) { return $matches[2]; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSubdomain()\n {\n return $this->subdomain;\n }", "public function subDomain(): DomainName;", "function get_cur_domain()\n{\n}", "public function get_shop_subdomain( )\r\n\t {\r\n\t\t //use defined in index.php, if not available extract ot ourselves\r\n\t \t return ( defined('...
[ "0.8060156", "0.8002409", "0.78359175", "0.7654268", "0.74567926", "0.74526894", "0.7223552", "0.71472293", "0.71439236", "0.709944", "0.7040451", "0.703854", "0.69610935", "0.69498837", "0.6947203", "0.6905553", "0.6895081", "0.6882151", "0.6850362", "0.68237495", "0.6820262...
0.79776525
2
Associate the current subdomain with it's set association
function associateSubdomain($sd=false) { if(!$sd) $sd = SUBDOMAIN; if($sd) { global $DB; return $DB->subdomains->getCell(array('subdomain' => $sd), 'assoc'); } else { return 'frontpage'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function register_subdomain() {\n\t$host = $_SERVER['HTTP_HOST'];\n\tif ($this->config->base_domain) $this->subdomain = preg_replace('/\\.'.$this->config->base_domain.'$/i', '', $host);\n\telse {\n\t\t$parts = explode('.', $host);\n\t\t// we're going to assume a single level tld, like .com, rather than a m...
[ "0.65115553", "0.6146808", "0.59660184", "0.5785171", "0.57528764", "0.5716687", "0.56461585", "0.5638809", "0.5620155", "0.5549493", "0.55481905", "0.55077696", "0.5505932", "0.54905224", "0.5456437", "0.5420965", "0.53574", "0.53569096", "0.5341232", "0.53346074", "0.531813...
0.72454435
0
Generate a highly randomized salt
function generateSalt() { return str_shuffle(sha1(uniqid(mt_rand(), true)).md5(uniqid(mt_rand(), true))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function genSalt() {\r\n $random = 0;\r\n $rand64 = \"\";\r\n $salt = \"\";\r\n $random = rand(); // Seeded via initialize()\r\n // Crypt(3) can only handle A-Z a-z ./\r\n $rand64 = \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n $...
[ "0.84429735", "0.842341", "0.8390845", "0.8289176", "0.8282504", "0.8245752", "0.8193425", "0.8188384", "0.8121574", "0.81215334", "0.8121143", "0.80835575", "0.8077228", "0.8066766", "0.8022221", "0.80158865", "0.79945695", "0.79945695", "0.798139", "0.79697496", "0.79601127...
0.8257622
5
Arrange and flatten the incoming elements
function flatten($args){ $res = array(); foreach($args as $a) { if(is_array($a)) $res = array_merge($res, flatten($a)); else $res[] = $a; } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function flatten();", "public function flatten();", "public function flatten();", "public function flatten() {}", "public function flatten() {}", "protected function _preFlatten() {}", "public function flattenLeft();", "public function flatten(){\n\t\t$this->content=$this->flatten_array_build(...
[ "0.6572553", "0.6572553", "0.6572553", "0.64294535", "0.64294535", "0.59844095", "0.5684955", "0.54920286", "0.5478715", "0.5473233", "0.5406621", "0.5406174", "0.5354307", "0.5233504", "0.5209105", "0.51845086", "0.5109105", "0.50831956", "0.50742114", "0.49617583", "0.49402...
0.5336411
13
Generate an URL from the arguments passed and existing request variables. If a string is passed as first argument, it is checked to begin with http:// and returned.
function url($array = false, $keep=false, $validate = true, $SiteUrlOnEmptyParamSet = false, $getAliases = true) { if(is_string($array) && !is_numeric($array) && strtolower(substr($array, 0, 4)) == 'www.') return 'http://'.$array; $pass = array(); if($array == false) $array = array(); if(!is_array($array)) $array = array('id' => $array); if($keep === true) { $keep = $_GET->keys(); } elseif($keep !== false && !is_array($keep)) $keep = array($keep); if(!is_array($keep)) $keep = array(); foreach($_REQUEST as $g => $v) { if(!in_array($g, $keep)) continue; elseif(is_array($v)) { foreach($v as $a => $b) { if(!empty($b)) $pass[$g][$a] = $b; } } else $pass[$g] = $v; } $parts = array_merge($pass,$array); $validParts = array(); foreach($parts as $key => $val) { if($key == '#') continue; if(!$validate || ($_REQUEST->validate($key, $val) || $_GET->validate($key, $val))) { $validParts[$key] = $val; } } $url = ''; //FIXME: Config // Short-URL if(true && isset($validParts['id'])) { global $Controller; if(is_numeric($validParts['id']) && $getAliases) { if($obj = $Controller->get($validParts['id'], OVERRIDE)) if($alias = $obj->alias) $validParts['id'] = $alias; } elseif(is_object($validParts['id'])) { if($alias = $validParts['id']->alias) $validParts['id'] = $alias; else $validParts['id'] = $validParts['id']->ID; } $url = '/'.($validParts['id'] != 'frontpage'?$validParts['id']:''); unset($validParts['id']); } $query = http_build_query($validParts,'','&amp;'); if(!empty($query)) $url .= '?'.$query; if(isset($array['#'])) $url.='#'.$array['#']; if((!empty($url) || $SiteUrlOnEmptyParamSet) && $SiteUrlOnEmptyParamSet != -1) { global $SITE; $url = $SITE->URL.$url; } return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elgg_http_build_url(array $parts) {\n\t// build only what's given to us.\n\t$scheme = isset($parts['scheme']) ? \"{$parts['scheme']}://\" : '';\n\t$host = isset($parts['host']) ? \"{$parts['host']}\" : '';\n\t$port = isset($parts['port']) ? \":{$parts['port']}\" : '';\n\t$path = isset($parts['path']) ? \"...
[ "0.6982559", "0.68406594", "0.68116254", "0.6790138", "0.67184424", "0.67011166", "0.660767", "0.65569025", "0.64706534", "0.64035326", "0.63996", "0.63281244", "0.63225913", "0.625492", "0.62462914", "0.6189361", "0.61574244", "0.61487675", "0.6126028", "0.6120405", "0.60628...
0.63471115
11
Generate an icon from the 3rdParty library
function icon($which, $alt='', $url=false, $print_alt = false, $class=false) { return new Icon($which, $alt, $url, $print_alt, $class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getFactoryIconUseIt() {\n }", "public function getIconForResourceWithPngFileReturnsIcon() {}", "public function getIcon() {}", "public function getIcon();", "public function getIcon();", "public function getIcon()\n {\n return 'voyager-external';\n }", "public sta...
[ "0.7659396", "0.70003176", "0.69893146", "0.69601524", "0.69601524", "0.668919", "0.6686453", "0.6686453", "0.6681213", "0.6650669", "0.65942883", "0.65238494", "0.6516916", "0.64796305", "0.64605814", "0.64358175", "0.641956", "0.6383943", "0.637005", "0.636505", "0.63643295...
0.6479054
14
Modified version of serialize()
function serial ( $var = array(), $recur = FALSE ) { if ( $recur ) { foreach ( $var as $k => $v ) { if ( is_array($v) ) { $var[$k] = serial($v, 1); } else { $var[$k] = base64_encode($v); } } return $var; } else { return serialize(serial($var, 1)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function serialize();", "abstract public function serialize();", "abstract public function serialize();", "public function serialize();", "public function serialize();", "public function serialize();", "public function serialize() {}", "public function serialize() {}", "public funct...
[ "0.86772126", "0.8636097", "0.8636097", "0.8630311", "0.8630311", "0.8630311", "0.85191697", "0.85191697", "0.85175747", "0.85175747", "0.85175747", "0.85175747", "0.85175747", "0.85175747", "0.79947424", "0.79048115", "0.79048115", "0.78721684", "0.78607464", "0.785966", "0....
0.0
-1
A modified version of unserialize().
function unserial ( $var = FALSE, $recur = FALSE ) { if ( $recur ) { foreach ( $var as $k => $v ) { if ( is_array($v) ) { $var[$k] = unserial($v, 1); } else { $var[$k] = base64_decode($v); } } return $var; } else { return unserial(unserialize($var), 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function unserialize($data) {}", "abstract public function unserialize($serialized);", "public function unserialize($serialized);", "public function unserialize($serialized);", "function unserialize ( $data ) {\n return unserialize( $data );\n }", "public function unserialize($serialized...
[ "0.8129617", "0.80395675", "0.78924954", "0.78924954", "0.75985193", "0.7517173", "0.7493589", "0.74214745", "0.7259641", "0.7096745", "0.70808", "0.7023273", "0.6845647", "0.6835847", "0.67794293", "0.6767033", "0.6749228", "0.6725225", "0.669678", "0.66625977", "0.6661857",...
0.0
-1
Halts execution and recirect the browser to a new location
function redirect($where=-2, $delay=false){ if(is_object($where)) $where = array('id' => $where->ID); elseif(is_numeric($where)){ if($where <= 0) { $where = url(@$_SESSION['TRACE'][-$where]['_GET'], false, false, false, true); } else { $where = array('id' => $where); } } if(is_array($where)) $where = url($where); $where = str_replace('&amp;', '&', $where); if(!$where) die(); while(ob_get_level()) @ob_end_clean(); if($delay) { JS::raw('setTimeout("window.location.href=\''.$where.'\'",'. $delay*1000 .');'); } elseif(headers_sent()) { echo "<script type=\"text/javascript\"> <!-- window.location='$where'; --> </script>"; } else { header('Location: '.$where); } die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refresh() {\n\t\t$this->redirect( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/' );\n\t}", "private function redirectAndDie() {\n header('Location: ' . $_SERVER['PHP_SELF']);\n die;\n }", "function stopsimulate() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $th...
[ "0.61204904", "0.6079349", "0.59285057", "0.5921937", "0.5804471", "0.5761907", "0.5722347", "0.5703351", "0.5698374", "0.56767017", "0.5660051", "0.56397134", "0.5630851", "0.56251687", "0.5608542", "0.5595598", "0.5593944", "0.55799645", "0.5573666", "0.55660266", "0.556019...
0.0
-1
Returns the multidimensional representation of the database storage of objects with parents and children.
function inflate($list){ $r = array(); $flat = array(); foreach($list as $val) { $flat[$val['id']] = $val; } foreach($list as $val) { if(!isset($flat[$val['parent']])) { $r[$val['id']] = &$flat[$val['id']]; } else { if(!isset($flat[$val['parent']]['children'])) $flat[$val['parent']]['children'] = array(); $flat[$val['parent']]['children'][] = &$flat[$val['id']]; } } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BuildTree($items)\r\n\t{\r\n\t\tif (!empty($items))\r\n\t\t{\r\n\t\t\t# Columns\r\n\t\t\t# * Gather all columns required for display and relation.\r\n\t\t\t# Children\r\n\t\t\t# * Map child names to child index.\r\n\r\n\t\t\t$cols[$this->ds->table] = array($this->ds->id => 1);\r\n\t\t\tif (!empty($this->d...
[ "0.6228381", "0.5983081", "0.58849543", "0.58352065", "0.5795033", "0.5790007", "0.5746432", "0.57169074", "0.57147914", "0.5678513", "0.56691617", "0.5636866", "0.5624245", "0.55865407", "0.5571356", "0.55472654", "0.5540894", "0.5512102", "0.5487325", "0.54838413", "0.54770...
0.0
-1
Creates a HTMLlist of an array
function listify($array, $class='list', $vary=true, $textfield = false, $childfield = false){ if(!$array) return; static $i = -1; static $recursion = 0; ++$recursion; if($vary === true) $vary = array('odd', 'even'); $vlen = count($vary); $result = ''; $result = '<ul'.($class?' class="'.$class.'"':'').'>'; foreach($array as $key => $li) { $result .= '<li'.($vary?' class="'.$vary[++$i%$vlen].'"':'').'>' .($textfield ? @$li[$textfield] : (is_array($li) ? $key : $li)) .(is_array($li) ? ($childfield ? (isset($li[$childfield]) ? listify($li[$childfield], false, $vary, $textfield, $childfield) : '' ) : listify($li, false, $vary, $textfield, $childfield) ) : ''); } $result .= '</ul>'; --$recursion; if(!$recursion) $i = 0; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_list(array $array)\n {\n echo \"<ul>\";\n \n foreach($array as $numb)\n {\n make_tag(\"li\", $numb);\n }\n\n echo \"</ul>\";\n }", "function alist ($array) { //This function prints a text array as an html list.\n $alist = \"<ul>\";\n for...
[ "0.7500389", "0.715308", "0.71175104", "0.6650967", "0.66327083", "0.66014284", "0.6499199", "0.64739186", "0.6441253", "0.64227986", "0.6311433", "0.62623745", "0.62575954", "0.62351745", "0.62351745", "0.6235105", "0.62095606", "0.60593534", "0.60392326", "0.60172385", "0.5...
0.56599444
49
Searches a string for any of supplied vaules. Returns false if no match is found, else the position of the match (may be 0!)
function strapos($haystack,$needles,$offset=0) { $results = array(); foreach($needles as $n) { $results[] = strpos($haystack, $n); } $results = array_filter($results); sort($results); if(isset($results[$offset])) return $results[$offset]; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function match($string);", "function searchForAny($source,$search)(\n if(strpos($source,$search) !== FALSE){\n return true;\n }", "function strposa($haystack, $needles){\n foreach($needles as $needle) {\n if(($r = strpos($haystack, $needle)) !== false) return $r;\n }\n return false;...
[ "0.6563205", "0.6126327", "0.60307026", "0.58493006", "0.5844992", "0.57749265", "0.5769015", "0.57614195", "0.5737539", "0.5735456", "0.572124", "0.57211405", "0.56689596", "0.5666697", "0.56098974", "0.5593548", "0.55871266", "0.55219424", "0.55202246", "0.5518569", "0.5518...
0.0
-1
This filter is run as the last thing before the output buffer is sent to the browser. It inserts the string registered with Head::add() does some output compression if possible.
function outputBufferFilter($buffer, $mode) { //FIXME: Uncomment? //$buffer = trim($buffer); /** * Mail replace */ $buffer = SafeEmails::replace($buffer); $headadd = Head::finalize(); if(is_array($headadd)) { $buffer = preg_replace('#</head>#i', $headadd[0]."\r\n</head>", $buffer, 1); $buffer = preg_replace('#</body>#i', $headadd[1]."\r\n</body>", $buffer, 1); } return $buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function basecss_insert_head($flux){\n\tif (!test_plugin_actif('Zcore')){\n\t\t$flux .= \"<\".\"?php header(\\\"X-Spip-Filtre: basecss_pied_de_biche\\\"); ?\".\">\";\n\t}\n\treturn $flux;\n}", "public static function outputBuffering() {\r\n switch (substr_count(HTTP_ENCODING, 'gzip')) :\r\n cas...
[ "0.57570046", "0.5669767", "0.56418204", "0.5625916", "0.56044686", "0.553121", "0.552853", "0.5479302", "0.5459078", "0.5446818", "0.5443063", "0.5413446", "0.54054296", "0.54051965", "0.53671", "0.5327081", "0.53120655", "0.52963555", "0.5290654", "0.5282507", "0.5272285", ...
0.5309021
17
OBfunction to add a content size header
function contentSize($buffer, $mode){ global $PREVENT_CSIZE_HEADER; if(!$PREVENT_CSIZE_HEADER) header('Content-Length: ' . ob_get_length()); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function headersize() {\n return $this->info['header_size'];\n }", "function getSize() ;", "function addContentWidth() {\n\t\t\tglobal $content_width;\n\t\t\tif ( isset( $content_width ) ) {\n\t\t\t\t$content_width = 628;\n\t\t\t}\n\n\t\t}", "private function setFileSize(){\r\n $heade...
[ "0.6198996", "0.6051771", "0.5973838", "0.5971433", "0.591266", "0.58370745", "0.58291686", "0.58273745", "0.58155274", "0.5807821", "0.5763734", "0.57024497", "0.56541526", "0.56343025", "0.56117815", "0.5598047", "0.5597354", "0.55912876", "0.55691904", "0.5564022", "0.5560...
0.58349574
6
Convert string to UTF8
function utf8($str) { if(mb_detect_encoding($str) == "UTF-8" && mb_check_encoding($str,"UTF-8")) return $str; else return utf8_encode($str); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_to_utf8(string $str): string\n {\n return preg_replace_callback(\n '/\\\\\\\\u([0-9a-fA-F]{4})/',\n static function (array $match): string {\n return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');\n },\n $str\n ...
[ "0.8108258", "0.7865543", "0.7786369", "0.7757923", "0.7725076", "0.7700508", "0.7393194", "0.7335603", "0.7299328", "0.7259334", "0.7142656", "0.71225315", "0.7105485", "0.7081672", "0.7066251", "0.7064412", "0.70404214", "0.69924545", "0.6959634", "0.6844386", "0.68212575",...
0.7344126
7
Convert string from UTF8
function deutf8($str) { if(mb_detect_encoding($str) == "UTF-8" && mb_check_encoding($str,"UTF-8")) return utf8_decode($str); else return $str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_to_utf8(string $str): string\n {\n return preg_replace_callback(\n '/\\\\\\\\u([0-9a-fA-F]{4})/',\n static function (array $match): string {\n return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');\n },\n $str\n ...
[ "0.7494896", "0.7246661", "0.72079855", "0.70398", "0.69872063", "0.6983387", "0.69428813", "0.6836229", "0.6804759", "0.6803888", "0.67719656", "0.6766043", "0.67646486", "0.67558694", "0.67498446", "0.6738298", "0.67244214", "0.67189837", "0.671496", "0.664555", "0.66224414...
0.7214691
2
Get the real path to a file or folder. Returns false on failure, else the path to the file/folder
function getPath($file, $sub="", $must_be_file = true, $d=false) { if($file == false || empty($file)) return false; $path = realpath('.').DIRECTORY_SEPARATOR.$sub.DIRECTORY_SEPARATOR.$file; if($d) var_dump( $file, $sub, $path ); if($path != false && strpos($path, realpath('.').DIRECTORY_SEPARATOR.$sub) !== false) { if($must_be_file && !is_file($path)) return false; return $path; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFullPath()\r\n\t{\r\n\t\t$path = $this->getValue(\"name\");\r\n\r\n\t\t// We are at the real root\r\n\t\tif (!$this->getValue(\"parent_id\") && $path == '/')\r\n\t\t\treturn $path;\r\n\r\n\t\t// This condition should never happen, but just in case\r\n\t\tif (!$this->getValue(\"parent_id\"))\r\n\...
[ "0.7077999", "0.690316", "0.6666453", "0.66299057", "0.6480304", "0.6462359", "0.6390644", "0.63531834", "0.63197935", "0.62910694", "0.62910694", "0.6218685", "0.6216907", "0.6214255", "0.61736244", "0.6173524", "0.61425614", "0.6136511", "0.6134452", "0.6127476", "0.6112267...
0.68468136
2
This function takes an error code and redirects it to an errorpage
function errorPage($error){ switch($error){ case 401: header('HTTP/1.1 401 Unauthorized'); break; case 403: header('HTTP/1.1 403 Forbidden');; break; case 404: header('HTTP/1.1 404 Not Found'); break; } global $Controller; if($p = $Controller->alias('error_'.$error)) { internalRedirect($p); } else { //@ob_end_clean(); print($error); } die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirect_error($code, $url = null) {\n\n global $CFG;\n\n // Set the redirect URL if it wasn't specified as a parameter\n if (!$url) {\n $url = $CFG->wwwroot;\n }\n\n // URL encode parameters to error page\n $code = urlencode($code);\n $url = urlencode($url);\n\n // Redirect...
[ "0.7973909", "0.7315906", "0.7278016", "0.72668135", "0.72423583", "0.7224111", "0.7188935", "0.7155267", "0.71461207", "0.7076318", "0.7050263", "0.7047342", "0.7018382", "0.7002094", "0.69734836", "0.69505495", "0.69312435", "0.6897051", "0.6889859", "0.6879199", "0.6874412...
0.7574105
1
Returns wether one or more keys mathes any of a number of given elements in an array. This function is recursive, so the haystack menu may be multidimensional
function somewhereInArray($needles, $haystack, $CASE_INSENSITIVE = false){ if(!is_array($needles)) $needles = array($needles); if(is_array($haystack)) { foreach($haystack as $straw) { if(somewhereInArray($needles, $straw, $CASE_INSENSITIVE)) return true; } return false; } else { foreach($needles as $needle) { if($CASE_INSENSITIVE) { if(stripos($haystack, $needle) !== false) return true; } else { if(strpos($haystack, $needle) !== false) return true; } } return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function in_array_multi_key($needle, $haystack)\r\n{\r\n // only matches the key, values don't count.\r\n if ( array_key_exists($needle, $haystack) )\r\n {\r\n return TRUE;\r\n }\r\n\r\n foreach ( $haystack as $key => $value )\r\n {\r\n if ( is_array($value) )\r\n {\r\n $wor...
[ "0.66424185", "0.651373", "0.61682063", "0.6096198", "0.60635495", "0.6056374", "0.5932806", "0.57352626", "0.57248545", "0.5639123", "0.5610643", "0.56032485", "0.5599272", "0.5584945", "0.55653316", "0.5555792", "0.55551237", "0.55530375", "0.55352956", "0.5533125", "0.5468...
0.0
-1
Regenerate the session id for increased security
function regenerateSession($reload = false) { if(!isset($_SESSION['fingerprint']) || $reload) { $_SESSION['fingerprint'] = sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh') .md5($_SERVER['HTTP_USER_AGENT'].'afke')); } /** * Create new session and destroy the old one */ session_regenerate_id(true); global $CONFIG; if($CONFIG->Subdomains->Top_domain) { setcookie(session_name(), session_id(), 0, "/", ".".$CONFIG->Subdomains->Top_domain, true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function regenerateSessionid();", "private function sessionRegenerateId()\n {\n // even if the session were hijacked, it will be expired very soon, so doing this way we reduce chance of users's (or admin's) account penetration\n // again, it's not 100% way to do secure accounts, bu...
[ "0.9127247", "0.8984063", "0.88593847", "0.87534565", "0.87534565", "0.86497074", "0.8573799", "0.852764", "0.8477711", "0.8449003", "0.8280777", "0.8136426", "0.80479693", "0.80328923", "0.7853125", "0.78444946", "0.7800391", "0.76621187", "0.7533291", "0.74762005", "0.74727...
0.7170564
31
Make sure the session hasn't been hijacked
function checkSession() { if(sha1(md5($_SERVER['REMOTE_ADDR'].'ahsh').md5($_SERVER['HTTP_USER_AGENT'].'afke')) != @$_SESSION['fingerprint']) { Flash::create('Session check failed'); return false; } if(mt_rand(1, 20) == 1) { regenerateSession(); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function avoidSessionHijacking()\n\t{\n\t\t// TODO\n\t}", "protected function checkSessionLifetime() {}", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "private function preventSessionHijack() {\n if ...
[ "0.76990324", "0.694571", "0.6875226", "0.6831351", "0.64395833", "0.64395833", "0.64384556", "0.64028853", "0.63157743", "0.63140017", "0.62612724", "0.6227901", "0.62146455", "0.61941904", "0.617731", "0.61110145", "0.6099619", "0.6076875", "0.6075893", "0.6065462", "0.6054...
0.6597443
4
Checks if the given path is a file, and if it's extension is a known imageextension
function isImage($path) { global $CONFIG; return (is_file($path) && in_array(strtolower(pathinfo($path, PATHINFO_EXTENSION)), $CONFIG->extensions->images)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isImage(string $path): bool\n{\n $ext = getExtension($path);\n return ($ext === \"jpg\" || $ext === \"jpeg\" || $ext === \"png\");\n}", "function isPhoto($path) \n {\n $exploded = explode('.', $path);\n $ext = strtolower(end($exploded));\n // Define the photos extensions\n ...
[ "0.7891073", "0.76301455", "0.757281", "0.74448603", "0.7400308", "0.7331621", "0.72882354", "0.72719467", "0.72670346", "0.72578436", "0.7213137", "0.71207684", "0.7076717", "0.7015753", "0.7009175", "0.7009175", "0.6962504", "0.6929038", "0.69110715", "0.68848616", "0.68692...
0.78463125
1
Checks the validity of an email by regex
function isEmail($email) { return (bool)preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function email_is_valid($email) {\r\n return preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i',$email);\r\n }", "function check_email ($email) {\n\t\n if (preg_match ('/^[-!#$%&\\'*+\\\\.\\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\\.)+' . '([0-9A-Z]){2,4}$/i', trim ($email))) {\n ...
[ "0.78545606", "0.7781056", "0.77509636", "0.7744848", "0.7735422", "0.7688499", "0.76484436", "0.76139176", "0.7604381", "0.7590295", "0.7571184", "0.7563633", "0.7554553", "0.75328153", "0.7516172", "0.748608", "0.7461819", "0.7446184", "0.744234", "0.74380785", "0.74354017"...
0.0
-1
Stristr's younger cousin. Replacement for functionality appearing in 5.3.0
function stristrr($haystack, $needle, $before_needle=false) { if(!$before_needle) return stristr($haystack, $needle); $pos = stripos($haystack, $needle); if($pos === false) return false; return substr($haystack, 0, $pos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNoun();", "function truc(string $arg):string{\n return $arg . ' yo <br/>';\n }", "function GetProperUSN($usn){\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$formattedusn = strtolower($formattedusn);\r\n\treturn $formattedusn;\r\n}", "function bbloomer_translate_may_also_li...
[ "0.59633195", "0.5924705", "0.579403", "0.5791206", "0.5744561", "0.5733617", "0.56111676", "0.56046295", "0.5585521", "0.5564192", "0.55260676", "0.5522481", "0.5521707", "0.55105126", "0.5494261", "0.54846656", "0.54749453", "0.54657966", "0.54640394", "0.54277354", "0.5405...
0.0
-1
Checks if any of the strings in an array contains the needle and returns the position Note: May return 0!
function strposa($haystack, $needles){ foreach($needles as $needle) { if(($r = strpos($haystack, $needle)) !== false) return $r; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function strpos_array(string $haystack, array $needles) {\r\n\tif(is_array($needles)) {\r\n\t\tif(count($needles) == 0)\r\n\t\t\treturn false;\r\n\t\tforeach ($needles as $str) {\r\n\t\t\tif ( is_array($str) ) {\r\n\t\t\t\t$pos = strpos_array($haystack, $str);\r\n\t\t\t} else {\r\n\t\t\t\t$pos = strpos($haystack, ...
[ "0.7423898", "0.73755586", "0.7250515", "0.72290146", "0.7042857", "0.6991533", "0.6944882", "0.6781506", "0.67505515", "0.66723144", "0.66486204", "0.65338093", "0.649167", "0.6441136", "0.6435071", "0.6426001", "0.6421056", "0.64011306", "0.63889045", "0.6369563", "0.636121...
0.68500245
7
Removes an element with a given value from an array
function arrayRemove($array, $values, $reorder=false) { $values = (array)$values; foreach($values as $value) { while(false !== ($loc = array_search($value, $array))) unset($array[$loc]); } return ($reorder ? array_values($array) : $array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_remove($element, $array) {\n $index = array_search($element, $array);\n array_splice($array, $index, 1);\n return $array;\n }", "static public function arrRmByVal($arr,$value=''){\n $arr = is_array($arr)?$arr:array();\n foreach ($arr as $k=>$v)\n {\n if ($...
[ "0.777078", "0.7639707", "0.7627001", "0.74275595", "0.736401", "0.73548603", "0.72905743", "0.72849894", "0.71455365", "0.71308476", "0.7125155", "0.70004857", "0.6966838", "0.69521517", "0.685813", "0.6844499", "0.6753223", "0.66649544", "0.6629375", "0.66047686", "0.649241...
0.6488062
22
Reset the main variables and restart the page generation in order to make an internal redirect.
function internalRedirect($to){ global $ID, $PAGE, $CURRENT, $Controller, $OLD; if(!is_object($to)) $to = $Controller->{(string)$to}; if($PAGE) $OLD = $PAGE->ID; else $OLD = false; $PAGE = $CURRENT = $to; $_REQUEST['id'] = $to->ID; if(!@method_exists($CURRENT, 'run')) errorPage('Controller unknown'); /** * Execute the requested object */ $CURRENT->run(); /** * Send output to browser */ while (ob_get_level() > 0) { ob_end_flush(); } exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->env = array();\n $this->object_handlers = array();\n $this->pagetitle = '';\n }", "static function RedirToDefault()\n\t{\n\t\theader(\"Location: \" . $GLOBALS['host'] . self::$subDir . \"/\" . self::$defPage);\n\t}", "public function reload() {\n ...
[ "0.64845276", "0.6483424", "0.64246833", "0.6315738", "0.60927916", "0.60681033", "0.6041967", "0.6027496", "0.60190004", "0.5991417", "0.5990712", "0.5990466", "0.59772646", "0.59317714", "0.5872228", "0.58643085", "0.5861632", "0.58525276", "0.584724", "0.5845523", "0.58087...
0.0
-1
A safer version of PHP's gettext short version _
function __($str){ if(!empty($str)) return _($str); else return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static private function ___translate___()\n {\n _('RECORD\\Farthest %1$s from Sagittarius A*');\n }", "function _gettext($msgid)\r\n\t{\r\n\t\t$l10n = _get_reader();\r\n\t\treturn _encode($l10n->translate($msgid));\r\n\t}", "function __ngettext(...$args)\n {\n }", "function yourls__( $text...
[ "0.72410583", "0.7181865", "0.6913392", "0.6895244", "0.68586034", "0.6835791", "0.68301386", "0.67661107", "0.67253363", "0.6609394", "0.65802777", "0.65289336", "0.65047526", "0.6451118", "0.64398694", "0.6407258", "0.63952994", "0.63765043", "0.6365491", "0.6327929", "0.63...
0.5851726
55
runkit_function_redefine('_', '$str', 'return (!empty($str) ? gettext($str) : "";'); Uses the pear Text_Diff library to generate a diff between two files. The only HTMLtags allowed are and , all other will be stripped.
function diff($text1, $text2) { __autoload('TextDiff'); include_once 'Text/Diff.php'; include_once 'Text/Diff/Renderer.php'; include_once 'Text/Diff/Renderer/unified.php'; $vtext1 = chunk_split(strip_tags($text1, '<p><div>'), 1, "\n"); $vtext2 = chunk_split(strip_tags($text2, '<p><div>'), 1, "\n"); $vlines1 = str_split($vtext1, 2); $vlines2 = str_split($vtext2, 2); $text1 = str_replace("\n"," \n",$text1); $text2 = str_replace("\n"," \n",$text2); $vlines1 = explode(" ", $text1); $vlines2 = explode(" ", $text2); $diff = new Text_Diff($vlines1, $vlines2); $renderer = new Text_Diff_Renderer_inline(); $html = html_entity_decode($renderer->render($diff)); return preg_replace(array('#(<ins>|<del>)(<[^\>]+>)#i', '#(</[^\>]+>)(</ins>|</del>)#i'), '$2$1', $html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function text_diff( $left_string, $right_string, $args = null ) {\n\t\t$defaults = array(\n\t\t\t'title' => '',\n\t\t\t'title_left' => '',\n\t\t\t'title_right' => '',\n\t\t\t'leading_context_lines' => 1,\n\t\t\t'trailing_context_lines' => 1,\n\t\t);\n\n\t\t$args = wp_parse_args( $args, $defaults );\n...
[ "0.6367125", "0.62404084", "0.6216445", "0.618392", "0.59367263", "0.588464", "0.58702266", "0.5829656", "0.580066", "0.5792969", "0.57221717", "0.5652708", "0.5611527", "0.5563281", "0.55473584", "0.55318266", "0.5486468", "0.5446819", "0.5445218", "0.5443194", "0.5425905", ...
0.7464799
0
Dumps the variable to the browser
function dump() { $args = func_get_args(); echo '<div style="background-color: pink; margin: 3px;">'; foreach($args as $arg) { echo "<p><pre>"; var_dump($arg); echo "</pre></p>"; } echo '</div>'; return @$args[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dump($variable) {}", "public static function dump($var) {\n self::$dumped .= print_r($var, TRUE) . \"<br><br>\";\n self::$dumped = htmlspecialchars(self::$dumped);\n }", "public function dump() {}", "public function dump();", "public function dump();", "function dumpvar($...
[ "0.7090261", "0.6716475", "0.668011", "0.666669", "0.666669", "0.6663723", "0.66503096", "0.6649351", "0.6583311", "0.65790534", "0.657556", "0.6574167", "0.65683305", "0.65674955", "0.6550476", "0.6538085", "0.6430693", "0.6428361", "0.6428315", "0.63983965", "0.6387397", ...
0.0
-1
Shows the trace from the calling function and back
function trace(){ $r = array_map(create_function('$a', 'return (isset($a["class"])?$a["class"].$a["type"]:"").$a["function"]."(".@join(",",$a["args"]).");, Row: ".@$a["line"];'), debug_backtrace(false)); array_shift($r); return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function trace()\n\t{\n\t\tob_start();\n\t\tdebug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t$trace = ob_get_clean();\n\t\t$trace = str_replace('#','<br/><div><b><u>',$trace);\n\t\t$trace = str_replace('called at [','called at : </u></b><ul><li>File : ',$trace);\n\t\t$trace = preg_replace('/:...
[ "0.79818815", "0.7443046", "0.72203946", "0.717282", "0.71159023", "0.71159023", "0.7082609", "0.701203", "0.6825635", "0.6698397", "0.66838485", "0.6657495", "0.6636394", "0.6627789", "0.6615685", "0.65642595", "0.65520394", "0.65518606", "0.6511707", "0.6486994", "0.6473203...
0.693635
8
Turns the given name to a browseracceptable, reproducable, id
function idfy($name=false){ if(!$name) $name = uniqid(false, true); return 'id'.substr(md5($name),20); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertNameToID($name) {\n $name = str_replace(\" \",\"-\",$name);\n $name = strtolower($name);\n return $name;\n}", "static function html_id($name)\r\n\t{\r\n\t\tglobal $smcFunc;\r\n\t\t\r\n\t\t$name = str_replace(array('%3A', '+', '%'), array(':', '_', '.'), urlencode(un_htmlspecialchars($nam...
[ "0.6725434", "0.6492614", "0.6453848", "0.6393702", "0.62235", "0.6136572", "0.6087936", "0.6077966", "0.6068069", "0.6023464", "0.5899262", "0.57705253", "0.5760526", "0.57525164", "0.57272863", "0.56939757", "0.56386423", "0.562566", "0.55987513", "0.55984575", "0.55876255"...
0.58625585
11
Returns the specified keys from an array, in specified order
function arrayKeySort(&$array, $keys) { $res = array(); foreach($keys as $key) { if(isset($array[$key])) { $res[$key] = $array[$key]; } } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function only( array $array, array $keys ): array {\n\t\t\treturn array_intersect_key( $array, array_flip( $keys ) );\n\t\t}", "function array_only($array, $keys)\n\t{\n\t\treturn array_intersect_key($array, array_flip((array) $keys));\n\t}", "public static function only(array $array, array|strin...
[ "0.7109185", "0.7075719", "0.70121205", "0.69714093", "0.69009256", "0.689315", "0.689315", "0.689315", "0.68882734", "0.68279815", "0.67956793", "0.67950904", "0.67312336", "0.67093384", "0.6631453", "0.66226065", "0.6617316", "0.6579641", "0.6481516", "0.64007425", "0.63972...
0.6937677
4
Prepend an array with a value and return the new array
function arrayPrepend($array, $value) { array_unshift($array, $value); return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function prepend($array, $value, $key = null)\n {\n if (is_null($key)) {\n array_unshift($array, $value);\n } else {\n $array = [$key => $value] + $array;\n }\n\n return $array;\n }", "function array_prepend($array, $value, $key = null)\n {...
[ "0.824486", "0.8198338", "0.80102855", "0.75249577", "0.7500424", "0.7308498", "0.7224125", "0.7217231", "0.7143761", "0.7122985", "0.6857518", "0.682815", "0.67646223", "0.66396856", "0.6598507", "0.64426047", "0.64299524", "0.63584507", "0.6327717", "0.6308613", "0.62941426...
0.86719376
0
Extracts data from an array. The array can be a multidimensional array or an array of objects, and the property may thus be an array index, property name or even, with the function parameter set, a class method to call for result
function arrayExtract($array, $property, $keep_keys = false, $function=false) { $r = array(); foreach($array as $key => $a) { if(is_object($a)) { if($keep_keys) { if($function && method_exists($a, $property)) { $r[$key] = $a->$property(); } else { $r[$key] = @$a->$property; } } else { if($function && method_exists($a, $property)) { $r[] = $a->$property(); } else { $r[] = @$a->$property; } } } elseif(isset($a[$property])) { if($keep_keys) { $r[$key] = $a[$property]; } else { $r[] = $a[$property]; } } } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function extractInArray(array $array);", "protected static function getPropertyFromArray(array $dataArray, string $property, array $subProperties = [])\n {\n\n if (isset($dataArray[$property])) {\n\n if (is_array($dataArray[$property])) {\n\n self::getPropertiesFromArra...
[ "0.6166735", "0.6165866", "0.6084929", "0.6055655", "0.581391", "0.5744903", "0.56974685", "0.56848854", "0.56456816", "0.56347746", "0.5617737", "0.5583763", "0.55718195", "0.55344975", "0.5528535", "0.5523481", "0.5517173", "0.54748124", "0.54574895", "0.5422146", "0.542083...
0.7064305
0
Sort an array of objects according to a given property
function propsort(&$array, $property) { uasort($array, create_function('$a,$b','return strcmp($a->'.$property.', $b->'.$property.');')); return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ObjectSorter(&$array, $props){\n if(!is_array($props)) $props = array($props => true); \n\t\t$function = '$props=unserialize(\\''.trim(serialize($props)).'\\');\n\t\t\t\tforeach($props as $prop => $ascending) { \n\t\t\t\t\tif($a->$prop != $b->$prop) { \n\t\t\t\t\t\tif($ascending==\"ASC\") return ($a->$...
[ "0.74469507", "0.70988613", "0.69171304", "0.6845156", "0.6765783", "0.64983946", "0.64234835", "0.6415525", "0.6328104", "0.63248456", "0.6224221", "0.61687917", "0.61304015", "0.6087654", "0.602138", "0.5955248", "0.594134", "0.59401274", "0.5938257", "0.5914599", "0.589934...
0.7859561
0
Trim a sentence after a given number of chars and at the end of a word
function lineTrim($line, $length, $trim_suffix = "...", &$clipping_occured = false) { $tmpstr = wordwrap ( trim($line), $length , '%%%%!#!%%%%'); $lines = explode("%%%%!#!%%%%", $tmpstr, 2); $ret = $lines[0]; if ($clipping_occured = (count($lines) > 1)) { $ret .= $trim_suffix; } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flawless_word_trim( $string, $count, $ellipsis = false ) {\r\n\r\n if ( strlen( $string ) < $count ) {\r\n return $string;\r\n }\r\n\r\n $truncated = preg_replace( '/\\s+?( \\S+ )?$/', '', substr( $string, 0, $ellipsis ? $count + 3 : $count ) );\r\n\r\n if ( strlen( $string ) > strlen( $t...
[ "0.76281977", "0.6988167", "0.69878924", "0.6839568", "0.68173647", "0.6811791", "0.6723626", "0.6712341", "0.6709216", "0.6694157", "0.6660344", "0.66569823", "0.66453695", "0.6638536", "0.65900403", "0.65855104", "0.6535671", "0.6533304", "0.65297174", "0.6521033", "0.64821...
0.62456036
37
Returns a textual representation of a file's permissions
function perms($file) { $perms = fileperms($file); if (($perms & 0xC000) == 0xC000) { // Socket $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { // Symbolic Link $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { // Regular $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { // Block special $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { // Directory $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { // Character special $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { // FIFO pipe $info = 'p'; } else { // Unknown $info = 'u'; } // Owner $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // Group $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // World $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPermissionsString()\n {\n $out = \"\";\n\n $perm = octdec( $this->getPermissions() );\n\n for ( $i = 6; $i >= 0; $i -= 3 )\n {\n $part = ( $perm >> $i );\n\n if ( $part & 4 )\n {\n $out .= \"r\";\n }\n ...
[ "0.78617036", "0.73725283", "0.7061262", "0.69968665", "0.6829209", "0.6757898", "0.67504823", "0.6725017", "0.6688132", "0.6658698", "0.66433716", "0.6613313", "0.6451855", "0.63654983", "0.63201606", "0.63073707", "0.62060446", "0.6136084", "0.61195016", "0.60521096", "0.60...
0.6939743
4
Convert a number to text Works for numbers up to 20
function numberToText($num) { if(!is_numeric($num)){ $num = intval($num); if(!is_numeric($num)) return 'NaN'; } $numbers = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty'); return $numbers[$num]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getNumberToText(int $number): string {\n\t\tswitch($number) {\n\t\t\tcase 0:\n\t\t\t\treturn Language::out()->get0Name();\n\t\t\tcase 1:\n\t\t\t\treturn Language::out()->get1Name();\n\t\t\tcase 2:\n\t\t\t\treturn Language::out()->get2Name();\n\t\t\tcase 3:\n\t\t\t\treturn Language::out()->get3Name...
[ "0.71019256", "0.6986452", "0.69324136", "0.6810607", "0.67665786", "0.67665786", "0.67591923", "0.66238016", "0.6580977", "0.6480469", "0.64412045", "0.6434796", "0.64276403", "0.6380777", "0.6353703", "0.63449705", "0.6322046", "0.6321694", "0.63196915", "0.63056606", "0.62...
0.7535265
0
Calculates the relative path between $path and $rel
function relativePath($path, $rel=false) { $relpath = ''; if(!$rel) $rel = getcwd(); $apath = explode(DIRECTORY_SEPARATOR, realpath($path)); $arel = explode(DIRECTORY_SEPARATOR, realpath($rel)); while(isset($apath[0]) && isset($arel[0]) && $apath[0] == $arel[0]) { array_shift($apath); array_shift($arel); } return str_repeat('..'.DIRECTORY_SEPARATOR, count($arel)).join(DIRECTORY_SEPARATOR, $apath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function rel2abs_url( $path )\n {\n if( substr( $path, 0, 1 ) == \"/\" ) return $path;\n $dir = @getcwd();\n\n if( !isset( $_SERVER[ 'DOCUMENT_ROOT' ] ) || ( $dir === false ) )\n return false;\n\n $dir = self::normalize( $dir );\n ...
[ "0.6867227", "0.67079884", "0.6542726", "0.63866204", "0.63704085", "0.63596874", "0.6331498", "0.6303299", "0.6271455", "0.6261987", "0.62147766", "0.6199806", "0.6171473", "0.61463815", "0.61432534", "0.6100414", "0.6095798", "0.6082337", "0.60546166", "0.6047338", "0.60050...
0.7656842
0
Find all directories with files that match a given pattern
function findDirectoriesWithFiles($path, $pattern = '*') { $res = array(); if(substr($path, -1) != '/') $path = $path.'/'; foreach(glob($path.$pattern, GLOB_BRACE) as $file) { $res[] = dirname($file); } foreach(glob($path.'*', GLOB_ONLYDIR|GLOB_BRACE) as $file) { $res = array_merge($res, findDirectoriesWithFiles($file, $pattern)); } return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find($dir, $pattern){\n // escape any character in a string that might be used to trick\n // a shell command into executing arbitrary commands\n $dir = escapeshellcmd($dir);\n // get a list of all matching files in the current directory\n $files = glob(\"$dir/$pattern\");\n // find a lis...
[ "0.7741564", "0.6880518", "0.68499774", "0.6830415", "0.67901915", "0.675162", "0.67503697", "0.67409074", "0.6733775", "0.6703066", "0.6621217", "0.6567973", "0.65216756", "0.6448307", "0.6437987", "0.64120555", "0.6358692", "0.62945175", "0.62757033", "0.6273639", "0.625826...
0.72798556
1
Load the view file of create event form
public function event(){ return view('event.event'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create() {\r\n require $this->views_folder . 'create.php';\r\n }", "function create () {\n\tinclude 'request-create-view.php';\n}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n\t{\n\t\treturn View::make('administra...
[ "0.7039229", "0.68578696", "0.6806025", "0.6794354", "0.67866427", "0.67857367", "0.67330474", "0.6691202", "0.6680667", "0.6658292", "0.6592093", "0.658587", "0.658415", "0.6580745", "0.6571578", "0.65678555", "0.6562596", "0.65598625", "0.65598625", "0.65546125", "0.6542898...
0.0
-1
Load the view file event request data table to admin
public function eventrequest(){ $data=Event::all(); // print_r($data);die(); return view('event.event_request')->with('event',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mainEvent(&$req, &$t) {\n\t\t$d = dir(BASE_DIR.'var/search_cache/');\n\t\t$data = array();\n\n\n\t\t$list = new Cgn_Mvc_TableModel();\n\t\t$list->data = array(\n\t\t\t0=> array('link 1','foobar.php'),\n\t\t\t1=> array('link 2','foobar.php'),\n\t\t\t2=> array('link 3','foobar.php')\n\t\t);\n\n\t\twhile ($e...
[ "0.6082621", "0.5878252", "0.58594924", "0.574541", "0.5736615", "0.57126313", "0.564642", "0.561661", "0.56162804", "0.55458677", "0.5539601", "0.5529937", "0.55135375", "0.5512782", "0.55125177", "0.5510399", "0.5476503", "0.5472491", "0.5462427", "0.5448134", "0.5446046", ...
0.53010297
34
Load the view file event details data table to employee
public function eventdetails(){ $user=Auth::user(); $data=Event::where('event_request',$user['name'])->paginate(10); // print_r($data);die(); return view('event.event_details')->with('data',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read_event_record()\n\t{\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$event_id = $this->input->get('event_id');\n\t\t$result = $this->Events_model->read_event_information($event_id);\n\t\t\n\t\t$data = array(\n\t\t\t\t'event_id' => $result[0]->event_id,\n\t\t\t\t'employee_id' => $res...
[ "0.6414132", "0.5859225", "0.55921197", "0.55882", "0.5575673", "0.5529933", "0.55041534", "0.54908735", "0.5459578", "0.54352945", "0.5390715", "0.53727823", "0.5371271", "0.5362239", "0.53467613", "0.53274226", "0.52940595", "0.5273841", "0.52738124", "0.5262604", "0.525645...
0.5036023
60
Store the event details in event collection
public function createEvent(){ $data=$this->request->all(); // print_r($data['event_discription']);die(); $tag=$data['event_discription']; $events=strip_tags($tag); // print_r($events);die(); $validator=Validator::make($data,[ 'event_Name' => 'required', 'event_date' => 'required', 'event_discription' => 'required|min:10', ]); if(!$validator->fails()){ $event=Event::create($data); if ($event) { return "Success"; } else{ return "fail"; } } else{ return redirect('event')->withErrors($validator); } // print_r($data);die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n ...
[ "0.7255112", "0.65032166", "0.64895916", "0.645839", "0.64115316", "0.63357854", "0.6317351", "0.62929034", "0.62361926", "0.62203574", "0.618393", "0.6140477", "0.6125478", "0.61224216", "0.606334", "0.601659", "0.60131776", "0.60064095", "0.6004535", "0.5999824", "0.5947993...
0.0
-1
Updating the status of event
public function approveEvent(){ $data=$this->request->all(); // print_r($data['value']);die(); $status=$data['value']; $state['status']=$status; $event=Event::where('_id',$data['id'])->update($state); if($event){ return "Success"; } // print_r($event);die(); // return view(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_status();", "function update_event_status($event_id,$event_status)\n {\n if($event_status==0)\n {\n $new_stat=\"1\";\n }\n elseif($event_status==1)\n {\n $new_stat=\"0\";\n }\n $query = $this->db->query(\"UPDATE tbl_...
[ "0.7146201", "0.67448777", "0.6676829", "0.6531916", "0.64404905", "0.6437973", "0.6331336", "0.62437505", "0.62183684", "0.6192995", "0.61667514", "0.6163606", "0.6142747", "0.61407894", "0.61401004", "0.61283123", "0.610224", "0.60982877", "0.60603774", "0.6055809", "0.6010...
0.63087773
7
time() + 3600 = one hour from now. =============================== END OF CRON SETUP FOR MOOSE ========================================= Below is a fictional example of adding a successful order to a third party order fulfillment system.
function membership_payment_processing($entry, $feed, $transaction_id, $amount) { $message = ''; $message .= '<h1> THE $entry DETAILS </h1>'; $message .= '<table>'; foreach ( $entry as $key => $value ) { $message .= '<tr>'; $message .= '<th>Key: </th>' . '<td>' . $key . '</td> <th>Value: </th>' . '<td>' . $value . '</td>'; $message .= '</tr>'; } $message .= '</table>'; $message .= '<h1> THE $feed DETAILS </h1>'; $message .= '<table>'; foreach ( $feed as $key => $value ) { $message .= '<tr>'; $message .= '<th>Key: </th>' . '<td>' . $key . '</td> <th>Value: </th>' . '<td>' . $value . '</td>'; $message .= '</tr>'; } $message .= '</table>'; //add filter to enable HTML messages add_filter('wp_mail_content_type','set_email_to_html'); //send yourself an email (replace the email address below with yours) wp_mail('moose@cyberizegroup.com','Gravity PayPal Information', $message); //remove filter (to set back to plain text email) remove_filter( 'wp_mail_content_type', 'set_email_to_html' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fulfillOrder($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nUPDATE orders SET arrival_date = NOW() WHERE orders.order_id = :order_id;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n}", "function createOrder($order,$requester,$numberId){\n $sql='';\...
[ "0.58771074", "0.5737268", "0.57242256", "0.565008", "0.56435347", "0.56278294", "0.5579717", "0.55200565", "0.55064744", "0.54953647", "0.54893667", "0.546783", "0.54670984", "0.5466625", "0.54522735", "0.5446396", "0.54303014", "0.54077095", "0.53769165", "0.53680074", "0.5...
0.0
-1
sets the email content type to HTML
function set_email_to_html(){ return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_html_content_type() {\n\t\treturn 'text/html';\n\t}", "public function set_html_content_type() {\n\n\t\treturn 'text/html';\n\n\t}", "function my_email_content_type() \n{\n\treturn \"text/html\";\n}", "static public function sc_wpfmp_wp_mail_content_type()\n {\n return \...
[ "0.8192363", "0.8154191", "0.79322875", "0.79306173", "0.7742468", "0.76622224", "0.7546051", "0.7319537", "0.72763056", "0.7211348", "0.7134699", "0.6922389", "0.6914255", "0.6902276", "0.68219656", "0.670772", "0.66436446", "0.6631612", "0.66147417", "0.64529926", "0.636166...
0.70466334
11
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-...
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.687...
0.0
-1
Get file for data with series.
public function getDataFile(Request $request) { return $this->getFile($request, 'data_file'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataFile() \n\t{\n\t\treturn $this->_dataFile;\n\t}", "public function dataFile()\n {\n return new DataFile(data_path().'/'.$this->getHashedId());\n }", "public function loadFiles(){\n\n $files = array();\n\n if($this->id == -1 || empty($this->databasePath))\n ...
[ "0.61168736", "0.5966397", "0.59651023", "0.5855465", "0.5700173", "0.5700173", "0.5676011", "0.5633102", "0.5625633", "0.5625633", "0.5625633", "0.5625633", "0.56067044", "0.5606426", "0.55759615", "0.55074984", "0.5488539", "0.5488539", "0.5488539", "0.5486523", "0.5464225"...
0.5826198
4
Get interpretation file for series.
public function getInterpretationFile(Request $request) { return $this->getFile($request, 'interpretation_file'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSeries(): string\n {\n return $this->series;\n }", "public function getSeries()\n {\n if (array_key_exists(\"series\", $this->_propDict)) {\n return $this->_propDict[\"series\"];\n } else {\n return null;\n }\n }", "public static f...
[ "0.55894786", "0.5207566", "0.5125928", "0.51002795", "0.5036593", "0.49800143", "0.49663585", "0.49584654", "0.4946748", "0.4939712", "0.49375862", "0.4934424", "0.49146008", "0.490761", "0.49002475", "0.48767743", "0.4868337", "0.48490208", "0.4836496", "0.48261166", "0.480...
0.61089665
0
Get marker file file for series.
public function getMarkerFile(Request $request) { $fType = 'marker_file'; $oUser = Auth::user(); $oUserMarker = UserMarker::where('id', $request->user_marker_id) ->first(); if ($oUserMarker->user_id == $oUser->id || $oUser->admin == 1) { if ($oUserMarker->data_file) { $file = File::get($fType.'s/'.$oUserMarker->data_file); $response = Response::make($file, 200); if ($oUserMarker->data_file_mime) { $response->header('Content-Type', $oUserMarker->data_file_mime); } return $response; } } return view('errors/notaccess', ['oUser' => $oUser, 'active' => 'profile_link']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extract_from_markers($filename, $marker)\n {\n }", "public function getFilename() {}", "public function getFilename() {\n return $this->getData('file');\n }", "function getMarker() {\n\t\treturn $this->marker;\n\t}", "public function getMarker()\n {\n\t\treturn $this...
[ "0.5679174", "0.5571645", "0.5531117", "0.5529805", "0.5504475", "0.5473008", "0.5402511", "0.5402511", "0.5354025", "0.5350626", "0.5301255", "0.5292419", "0.52840686", "0.5271036", "0.5264536", "0.5264536", "0.5264536", "0.5264536", "0.5256773", "0.5224175", "0.52063566", ...
0.58900684
0
Run the database seeds.
public function run() { foreach ($this->array_data() as $arr) { $data = [ 'shop_id' => NULL, 'name' => $arr['name'], 'type' => $arr['type'], 'default_platform' => 1 ]; if (ShopGrid::where('name', '=', $arr['name'])->where('type', '=', $arr['type'])->count()) { $grid = ShopGrid::where('name', '=', $arr['name'])->where('type', '=', $arr['type'])->first(); $grid->update($data); } else { ShopGrid::create($data); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Geeft terug de aanwezigheid met id=$id uit de tabel aanwezigheid
function get($id) { $this->db->where('id', $id); $query = $this->db->get('aanwezigheid'); return $query->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function traerPorVehiculo($id)\n {\n }", "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this-...
[ "0.72076106", "0.71496433", "0.70932883", "0.70932883", "0.70932883", "0.70517683", "0.70459807", "0.7007732", "0.6888495", "0.6708368", "0.6704097", "0.669576", "0.66858524", "0.6617069", "0.65676785", "0.656367", "0.6533534", "0.65216494", "0.6521068", "0.6505614", "0.64986...
0.0
-1
Geeft een true terug als iemand zich ingeschreven heeft voor een sessie, een false voor niet ingeschreven personen
function isEnrolled($columnId, $userId) { $this->db->where('planningKolomId', $columnId); $this->db->where('gebruikerId', $userId); $result = $this->db->get('aanwezigheid')->row(); return (isset($result) ? true : false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "private function sesion_iniciada()\n\t{\n\t\t$this->load->library(\"session\");\n\t\tif($this->session->userdata(\"isess\")){\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function EstoyLogueado()\n\...
[ "0.73094", "0.6850497", "0.68228626", "0.67080283", "0.6695858", "0.6688963", "0.66674346", "0.6645469", "0.66219664", "0.66040516", "0.65987355", "0.6590944", "0.6552787", "0.65414006", "0.6538014", "0.65355134", "0.6524765", "0.6507516", "0.65048313", "0.6487875", "0.648569...
0.0
-1
Schrijft een student in bij een bepaalde sessie en gaat na of de gebruiker een surveillant is of niet.
function enroll($columnId, $userId, $isSurveillant=false) { $data = array( 'id'=>null, 'gebruikerId'=>$userId, 'planningKolomId'=>$columnId, 'surveillant'=>$isSurveillant, 'geselecteerd'=>0 ); $this->db->insert('aanwezigheid', $data); //$this->db }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "function pobierz_studentow() {\n\t\t$baza = polacz_z_baza();\n\n\t\t$zapytanie = 'select * from studenci';\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tzakoncz_polaczenie($baza);\n\n\t\treturn $wynik;\n\...
[ "0.644337", "0.6333015", "0.63011754", "0.6133227", "0.59824663", "0.5963286", "0.59162855", "0.588919", "0.5813782", "0.57919705", "0.5790793", "0.57885396", "0.57884574", "0.57684255", "0.5744531", "0.5668037", "0.56544995", "0.563653", "0.56260055", "0.56183183", "0.560744...
0.0
-1
Schrijft een gebruiker uit voor een sessie.
function withdraw($columnId, $userId) { $this->db->where('gebruikerId', $userId); $this->db->where('planningKolomId', $columnId); $this->db->delete('aanwezigheid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_esca...
[ "0.6507433", "0.628743", "0.62239695", "0.61260754", "0.6108343", "0.61006963", "0.6087638", "0.60121", "0.6002228", "0.59949", "0.5981162", "0.59788394", "0.5972895", "0.5970328", "0.59609646", "0.5934197", "0.58947444", "0.5884006", "0.58814174", "0.5847478", "0.582641", ...
0.0
-1
Haalt enkel het aantal studenten op
function getColumnCount($columnId) { $this->db->where('planningKolomId', $columnId); $this->db->where('surveillant', 0); return $this->db->count_all_results('aanwezigheid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pobierz_studentow() {\n\t\t$baza = polacz_z_baza();\n\n\t\t$zapytanie = 'select * from studenci';\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tzakoncz_polaczenie($baza);\n\n\t\treturn $wynik;\n\t}", "public function accoutingByStudent($student_id){\n }", "private function getStudent(){\n\t...
[ "0.6708018", "0.6383867", "0.63766533", "0.6299165", "0.6172249", "0.615714", "0.61459464", "0.6139071", "0.6112886", "0.60840887", "0.6074119", "0.6066228", "0.6044893", "0.6042174", "0.60297847", "0.60128653", "0.60054636", "0.60029644", "0.5996473", "0.5993884", "0.5971006...
0.0
-1
Haalt de status op van een gebruiker en kijkt na of de gebruiker is ingeschreven
function getEnrolledStatus($columnId, $userId) { $this->db->where('planningKolomId', $columnId); $this->db->where('gebruikerId', $userId); return $this->db->get('aanwezigheid')->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatus() \n {\n if ($this->status) \n {\n \techo 'user status : присутствует<br><br><br>';\n }\n else\n {\n \techo 'user status : отсутствует<br><br><br>';\t\n }\n }", "function status()\n{\n\t$username = $this->Session->read('user'...
[ "0.6851235", "0.636786", "0.6335701", "0.62981445", "0.62500733", "0.6213114", "0.61601245", "0.6138695", "0.61195654", "0.6113712", "0.6083331", "0.6041383", "0.602066", "0.59886897", "0.5970986", "0.5951805", "0.5941764", "0.5938046", "0.59319365", "0.5927163", "0.59167403"...
0.0
-1
Haalt het aantal studenten op die ingeschreven zijn voor een sessie
function getEnrolledStudents($columnId) { $this->db->where('planningKolomId', $columnId); $list = array(); foreach($this->db->get('aanwezigheid')->result() as $aanwezigheid) { $list[] = (int)$aanwezigheid->gebruikerId; } return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_student() {\n return $this->session->get(\"niveau_acces\") >= 0;\n }", "public function get_session_wise_student() {\n\t\t$checker = array(\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\treturn $this->db->get_where('enrols', $checker);\...
[ "0.6609084", "0.64148754", "0.6241234", "0.6176332", "0.6052633", "0.6036743", "0.60316", "0.60267615", "0.6004428", "0.5968749", "0.5895585", "0.58819693", "0.5857283", "0.5826675", "0.58158356", "0.58107597", "0.57889634", "0.5769572", "0.575625", "0.5739057", "0.5724292", ...
0.0
-1
Beheerder kan hier de desbetreffende kolom verwijderen waarbij $columnId = id van de kolom
function deleteByColumnId($columnId) { $this->db->where('planningKolomId', $columnId); $this->db->delete('aanwezigheid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function withdraw($columnId, $userId)\n {\n $this->db->where('gebruikerId', $userId);\n $this->db->where('planningKolomId', $columnId);\n $this->db->delete('aanwezigheid');\n }", "private function DeleteColumn(string $Column){\n return $this->Connection->exec('ALTER TABLE '.$this->...
[ "0.6653683", "0.59138584", "0.57321835", "0.57287085", "0.56800467", "0.5679142", "0.5659805", "0.5614969", "0.554716", "0.55308163", "0.5526045", "0.550642", "0.54734826", "0.5453377", "0.5448131", "0.5414671", "0.5398385", "0.539816", "0.5395479", "0.53720653", "0.53634214"...
0.71187615
0
Beheerder kan een aanwezigheid toevoegen
function insert($presence) { $this->db->insert('aanwezigheid', $presence); return $this->db->insert_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargar_registro_venta_id($id) {\n return true;\n }", "public function afmelden()\n {\n return true;\n }", "public function actionAdd($id)//wyświetlanie\n {\n $query = Dish::find()->where(['id_dania' => $id])->one();\n //nie ma takiego\n if(!$query)\n ...
[ "0.57115054", "0.5678979", "0.565852", "0.5616732", "0.56057906", "0.5602937", "0.5575824", "0.556212", "0.55381584", "0.5536021", "0.55273545", "0.5526215", "0.549859", "0.5472078", "0.5458182", "0.5400868", "0.53980863", "0.5370055", "0.53479534", "0.5340875", "0.53268486",...
0.0
-1
TODO: ADD Exception if config is not configured TODO: Add check for auth with json file GenerateClientTask constructor.
public function __construct(Google_Client $client) { $this->client = $client; $this->apiKey = [ 'application' => Config::get("youtube-api.project_id"), 'redirectUri' => Config::get("youtube-api.redirect_uri"), 'client-id' => Config::get("youtube-api.client_id"), 'client-secret' => Config::get("youtube-api.client_secret") ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct()\n {\n parent::__construct();\n\n// if(!authCheck($this->post('auth'))){\n// returnFailedResponse();\n// exit();\n// }\n\n $this->check_auth_client = $this->tasks->check_auth_client();\n\n }", "public function __construct(){\n\t\t$thi...
[ "0.60770005", "0.5795458", "0.57781726", "0.57111067", "0.57108206", "0.56542313", "0.5643452", "0.56252635", "0.55494595", "0.5546128", "0.5526174", "0.55086046", "0.54727286", "0.5461324", "0.5457526", "0.54519063", "0.54351854", "0.5407149", "0.5366783", "0.53442013", "0.5...
0.0
-1
Genera il link per l'autenticazione Oauth2
public function run() : Google_Client { $this->client->setApplicationName($this->apiKey['application']); $this->client->setScopes([ 'https://www.googleapis.com/auth/youtube.upload', ]); $this->client->setRedirectUri(url('/youtube/callback')); try { $this->client->setClientId($this->apiKey['client-id']); $this->client->setClientSecret($this->apiKey['client-secret']); } catch (Google_Exception $e) { echo "Authentication failed <br>"; echo $e->getMessage(); } $this->client->setAccessType('offline'); return $this->client; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' =...
[ "0.76015323", "0.69996893", "0.69429135", "0.68821865", "0.6844132", "0.6834876", "0.68315786", "0.68288404", "0.6823005", "0.6812642", "0.6802078", "0.66871303", "0.66503346", "0.66302204", "0.6553575", "0.65297335", "0.65232617", "0.6508004", "0.64975715", "0.6474936", "0.6...
0.0
-1
Register the service provider.
public function register() { Connection::resolverFor('sqlsrv', function ($connection, $database, $prefix, $config) { $db = new SqlServerConnection($connection, $database, $prefix, $config); if (! empty($config['skip_session_vars'])) { return $db; } return $db; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->a...
[ "0.71774215", "0.7054453", "0.6968271", "0.69677705", "0.6952019", "0.6931252", "0.6926226", "0.6918423", "0.6899592", "0.6895726", "0.6894278", "0.68906504", "0.68906504", "0.6883112", "0.6872877", "0.6865099", "0.68640506", "0.68627584", "0.68624485", "0.68491566", "0.68236...
0.0
-1
Get the services provided by the provider.
public function provides() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function getServices()\n {\n if (is_null($this->serviceProviders)) {\n $this->serviceProviders = $this->getServiceProviders();\n }\n\n return $this->serviceProviders;\n }", "protected function getServices()\n {\n return $this->services;\n }", "pro...
[ "0.79039633", "0.7667588", "0.76229626", "0.75573224", "0.7470691", "0.7423859", "0.7423859", "0.7423859", "0.7409516", "0.736475", "0.736475", "0.7363987", "0.7322196", "0.71889", "0.7162814", "0.71509963", "0.7137116", "0.70622355", "0.7047945", "0.70362085", "0.70213807", ...
0.0
-1
Convert fragment to single message of Mirai message chain.
public function toMessage(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pasar_fragmento(){\n\t\treturn $this -> fragmento;\n\t}", "public function getFragment(): string\n {\n return (string) $this->fragment;\n }", "function DecodeMessage($mid) {\n\n\t\t//Select Message to Decode\n $msgq = \"SELECT Message FROM Messages WHERE mid = $mid\";\n ...
[ "0.4930297", "0.47959396", "0.47086436", "0.46212184", "0.46087193", "0.46082482", "0.45660743", "0.4527378", "0.45169502", "0.44993305", "0.44682652", "0.44578356", "0.44525564", "0.4433574", "0.44219303", "0.4421766", "0.44168875", "0.4413747", "0.44094023", "0.4407176", "0...
0.46167615
4
Retorna as propriedades dessa classe em array
public function toArray(): array { return [ 'success' => $this->success, 'status' => $this->status, 'data' => $this->data ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get(){\n $array = array();\n foreach($this as $atributo => $valor){\n $array[$atributo] = $valor;\n }\n return $array;\n }", "public function getProperties(): array;", "public function getProperties(): array;", "public function getProperties() : array;", "...
[ "0.719854", "0.7169997", "0.7169997", "0.7083177", "0.69528675", "0.69208497", "0.6843223", "0.67288196", "0.6718211", "0.6682005", "0.6656729", "0.6626244", "0.6569207", "0.65538913", "0.65359896", "0.6521179", "0.6508747", "0.64953655", "0.64943534", "0.64943534", "0.647901...
0.0
-1
Guarda un objeto Proveedor en la base de datos.
public function insert($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$authuser = Auth::user();\n\t\t$rules = array(\n\t\t\t'proveedor_tipo' => 'not_in:NA',\n\t\t\t'nombre_usuario' => 'required',\n\t\t\t'nombre' => 'required',\n\t\t\t//'direccion' => 'required',\n\t\t\t//'telefono' => 'required',\n\t\t\t//'facebook' => 'required',\n\t\t\t...
[ "0.658083", "0.65154624", "0.64936125", "0.64691424", "0.642821", "0.63903636", "0.6331015", "0.6322302", "0.63174355", "0.62954617", "0.6276084", "0.6269909", "0.6252022", "0.62214845", "0.6216492", "0.62156814", "0.6195148", "0.6162741", "0.6112412", "0.61071867", "0.609514...
0.7514581
0
Elimina un objeto Proveedor en la base de datos.
public function delete($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Proveedor $proveedor)\n {\n //\n }", "public function destroy(ProveedoresModel $proveedor)\n {\n //\n }", "public function EliminarProveedores()\n\t\t{\n\t\t\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t\t\t$sql = \" select codproveedor from compras w...
[ "0.7843265", "0.76307636", "0.6959245", "0.6580722", "0.64543563", "0.64077103", "0.6384368", "0.63628274", "0.6306772", "0.63024527", "0.6301882", "0.62959117", "0.62944233", "0.6255204", "0.6248938", "0.6215888", "0.61923736", "0.6191895", "0.6170335", "0.6134639", "0.61122...
0.8131264
0
Busca un objeto Proveedor en la base de datos.
public function select($proveedor);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_proveedor($idProveedor,$idEmpresa){\n if($idProveedor != '' || $idEmpresa != ''){\n\n $this->_query =\n \"\n select \n idproveedor,\n idempresa,\n nombre_proveedor,\n descripcion_...
[ "0.7329527", "0.72033685", "0.7023036", "0.6996642", "0.68944323", "0.6864452", "0.6864452", "0.6837825", "0.6765021", "0.6744742", "0.6634423", "0.6591746", "0.6589306", "0.6555631", "0.6538108", "0.65228534", "0.65064824", "0.64948326", "0.6491467", "0.64854574", "0.6459801...
0.7667254
0
Returns the rendered view.
public function render(array $piVars = array()) { $documents = tx_oelib_MapperRegistry ::get('tx_realty_Mapper_RealtyObject')->find($piVars['showUid']) ->getDocuments(); if ($documents->isEmpty()) { return ''; } $result = ''; foreach ($documents as $document) { $link = $this->cObj->typoLink( htmlspecialchars($document->getTitle()), array( 'parameter' => tx_realty_Model_Document::UPLOAD_FOLDER . $document->getFileName(), ) ); $this->setMarker('document_file', $link); $result .= $this->getSubpart('DOCUMENT_ITEM'); } $this->setSubpart('DOCUMENT_ITEM', $result); return $this->getSubpart('FIELD_WRAPPER_DOCUMENTS'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render()\n\t{\n\t\treturn $this->viewFactory->make($this->view)\n\t\t\t->with( 'presenter', $this )\n\t\t\t->render();\n\t}", "public function render(): mixed\n {\n return $this->view;\n }", "public function getView() {\n return $this->setView();\n }", "public function render...
[ "0.8058752", "0.7948138", "0.7797124", "0.77137196", "0.7698595", "0.76982427", "0.76766634", "0.76019067", "0.7598051", "0.7591253", "0.7591253", "0.75898576", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0.75869364", "0....
0.0
-1
This function calls the parent data and returns the template to werde_deletecache_admin.tpl
public function render() { parent::render(); return "werde_deletecache_admin.tpl"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call_admin_template($data = null){\n\t \t\n\t \t$this->load->view('template/admin_template_v', $data);\n\t }", "function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n ...
[ "0.62337923", "0.6058721", "0.5875817", "0.5849738", "0.5784982", "0.56534415", "0.5653009", "0.5653009", "0.56236994", "0.56135225", "0.55350953", "0.5499438", "0.54934025", "0.5467574", "0.53767633", "0.53647125", "0.53628564", "0.53628564", "0.5360391", "0.52873087", "0.52...
0.76216197
0
public $permission = 'list'; We do a special check of permissions because our objects is not an instances of modAccessibleObject
public function beforeQuery() { if (!$this->checkPermissions()) { return $this->modx->lexicon('access_denied'); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObjectPermissions(): array;", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "function list()\n {\n if($this->checkAccess('permission.list') == 1)\n ...
[ "0.73302984", "0.71466494", "0.71466494", "0.71466494", "0.71466494", "0.71466494", "0.69460094", "0.6912734", "0.67629665", "0.6662247", "0.6662247", "0.664815", "0.6578824", "0.65046036", "0.6490238", "0.6451869", "0.6414268", "0.6409576", "0.63986313", "0.63986313", "0.639...
0.0
-1
Display a product of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Product $product)\r\n {\r\n //\r\n }", "public function show(Product $product)\n {\n \n }", "public function show(Product $product)\n {\n \n }", "public function show(Product $product)\n {\n \n }", "public function show(Product $produ...
[ "0.80111605", "0.7928877", "0.7928877", "0.7928877", "0.7915743", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", "0.7906438", ...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { if(array_key_exists('product_image_id', $_REQUEST)){ $id = $_REQUEST['product_image_id']; } // delete image from folder $product_image = ProductImage::find($id); Storage::disk('public_products')->delete($product_image->location); return $this->productImageService->delete($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Sanitize and enpoint URL by trimming it from spacelike characters on both sides and also stripping (possible multiple) last directory separator on URL (for endpoint string match)
public function sanitizeURL($endpointURL = ""){ $endpointURL = trim($endpointURL); $endpointURL = rtrim($endpointURL, "/"); return $endpointURL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize($url) {\n\t\t//$result = preg_replace('%(?<!:/|[^/])/|(?<=&)&|&$|%', '', $url);\n\t\t$result=str_replace(array('://','//',':::'),array(':::','/','://'),$url);\n\t\treturn $result;\n\t}", "protected function normalize($url) {\n $matches = array();\n \n $url = str_replace(\"\\\\\", '/',...
[ "0.7579714", "0.72950906", "0.7272067", "0.7174074", "0.7110038", "0.7044902", "0.6993038", "0.6835503", "0.6826167", "0.6705912", "0.6696348", "0.66363245", "0.6635605", "0.66131085", "0.66097474", "0.6605475", "0.6601433", "0.65768194", "0.65764415", "0.65260416", "0.652363...
0.7124804
4
Proccess current endpoint and return its result
public function proccess(){ #Get endpoint params $endpointParams = $this->getEndpointParams(); #Check if endpoint was read if($endpointParams == []) return ["success" => 0, "msg" => "The requested endpoint ({$this->endpointURL}) didn't match any expected command. Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints."]; #Get current command (the first part of endpoint) and also removes it from the arguments array $currentCommand = array_shift($endpointParams); #Execute command and return output switch ($currentCommand) { #List upcoming movies case 'upcoming': return $this->retrieveUpcomingMovies($endpointParams); #Get movie info case 'movie': return $this->retrieveMovie($endpointParams); #Search for movies using terms case 'search': return $this->retrieveSearch($endpointParams); #Fallback default: return ["success" => 0, "msg" => "The command '{$currentCommand}' is unknown! Please give a check on <a href='index.php'>index.php</a> for a list of available endpoints."]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n ...
[ "0.65639985", "0.6370146", "0.63532645", "0.62960577", "0.6245972", "0.6227877", "0.6180581", "0.6141454", "0.6103078", "0.6103078", "0.6103078", "0.6083849", "0.60564953", "0.6042563", "0.60238236", "0.60162574", "0.6006249", "0.59838337", "0.59783524", "0.59680635", "0.5966...
0.6790981
0
Gets current endpoint parameters.
public function getEndpointParams(){ #Explode current endpoint into parts $currentEndpointParts = explode("/", $this->endpointURL); #Iterate foreach ($this->availableEndpoints as $endpointItem) { #Explode the possible endpoint match $itemParts = explode("/", $endpointItem); #Check if count parts match, skip otherwise if(count($currentEndpointParts) != count($itemParts)) continue; #Prepare parts match flag $partsMatched = true; #Prepare resulting associative array $returnArray = []; #Check for each part foreach ($itemParts as $partIDX => $partTag) { #Flag to check if part is argument $partIsArg = preg_match("/^{[a-zA-Z0-9_-]+}$/", $partTag); #Update flag $partsMatched = $partsMatched && ($partIsArg ? 1 : ($partTag == $currentEndpointParts[$partIDX])); #Skip next checks if didn't matched if(!$partsMatched) break; #Insert into result $returnArray[str_replace(["{","}"], "", $partTag)] = $currentEndpointParts[$partIDX]; } #If matched return item data (an associative array with the named endpoint parts being the keys and the requested endpoint parts being the values) if($partsMatched) return $returnArray; } #Fallback return empty return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getParams()\n {\n return self::$params;\n }", "public function getParams()\n {\n return $this->getEvent()->getRouteMatch()->getParams();\n }", "public function getParams()\n {\n return $this->getAttribute('params', false, null);\n }", "public func...
[ "0.71558005", "0.71092534", "0.7070225", "0.70625347", "0.7059125", "0.7059125", "0.7059125", "0.7059125", "0.70320123", "0.7030083", "0.7011904", "0.6996613", "0.6970557", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69671917", "0.69...
0.0
-1
Retrieves upcoming movies from TMDb. A future improvement could consist on error checking from a valid TMDb response, for better handling in frontend. Another future improvement could consist on page number validation, based on "total_pages" result key. A language selection based on user data could also be done.
public function retrieveUpcomingMovies($args=[]){ #Page argument: if not set, fallback to 1 (default) $page = $args["page"] ?? 1; #Define the URL based on api documentation (https://developers.themoviedb.org/3/movies/get-upcoming) $url = "https://api.themoviedb.org/3/movie/upcoming?api_key={$this->apiKey}&language={$this->requestLang}&page={$page}"; #Instantiate a new HTTP handler class $HttpHandler = new HttpHandler(); #Retrieve raw output from the HTTP handler over the URL $outputRaw = $HttpHandler->execGET($url); #Bypass the consumed output return $this->consumeRawOutput($outputRaw); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpcomingMovies (){\n $response = Http::get('https://api.themoviedb.org/3/movie/upcoming?',\n ['api_key' => $this->apiKey]);\n\n return $response;\n }", "function get_movies(){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n ...
[ "0.71259886", "0.64386976", "0.64118624", "0.6395521", "0.6288417", "0.615633", "0.6142483", "0.59465796", "0.59405535", "0.5924368", "0.58825713", "0.58669883", "0.58641714", "0.5845794", "0.5831325", "0.5796509", "0.5751942", "0.5732884", "0.56883186", "0.56798923", "0.5678...
0.67324364
1
Retrieves information from a given movie ID from TMDb. A future improvement could consist on error checking from a valid TMDb response, for better handling in frontend. A language selection based on user data could also be done.
public function retrieveMovie($args=[]){ #ID argument: if not set, fallback to 0 $id = $args["id"] ?? 0; #If no ID given, return error if(!$id) return ["success" => 0, "msg" => "Empty response from TMDb"]; #Define the URL based on api documentation (https://developers.themoviedb.org/3/movies/get-movie-details) $url = "https://api.themoviedb.org/3/movie/{$id}?api_key={$this->apiKey}&language={$this->requestLang}"; #Instantiate a new HTTP handler class $HttpHandler = new HttpHandler(); #Retrieve raw output from the HTTP handler over the URL $outputRaw = $HttpHandler->execGET($url); #Bypass the consumed output return $this->consumeRawOutput($outputRaw); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_movie($movie_id) {\n\t\t\n\t\t$tmpl_args = array (\n\t\t\t\"movie-id\" => $movie_id\n\t\t);\n\t\t\n\t\t$json = $this->request(self::API_URL_TMPL_MOVIE, $tmpl_args);\n\t\t\t\t\n\t\tif(isset($json->id) and !empty($json->id)) {\n\t\t\treturn new rt_movie($json, $this);\n\t\t} else {\n\t\t\treturn ...
[ "0.67438483", "0.66179496", "0.64987767", "0.64970744", "0.64764637", "0.64659", "0.6397904", "0.63852274", "0.62844557", "0.62835896", "0.6255243", "0.6211115", "0.61972845", "0.6171528", "0.61424303", "0.6119006", "0.60897785", "0.60830015", "0.6071513", "0.6030394", "0.601...
0.66470635
1
Retrieves the search results from TMDb based on a given term. A future improvement could consist on error checking from a valid TMDb response, for better handling in frontend. Another future improvement could consist on page number validation, based on "total_pages" result key. An adult filter based on user data from backend could also be done, as language selection for results.
public function retrieveSearch($args=[]){ #Page argument: if not set, fallback to 1 (default) $page = $args["page"] ?? 1; #Search terms argument: if not set, fallback to empty string $terms = $args["terms"] ?? ''; #If no term given, return error if(!$terms) return ["success" => 0, "msg" => "Empty search term"]; #Prepare terms (URI-encoded) $terms = urlencode($terms); #Define the URL based on api documentation (https://developers.themoviedb.org/3/search/search-movies) $url = "https://api.themoviedb.org/3/search/movie?api_key={$this->apiKey}&language={$this->requestLang}&page={$page}&include_adult=true&query={$terms}"; #Instantiate a new HTTP handler class $HttpHandler = new HttpHandler(); #Retrieve raw output from the HTTP handler over the URL $outputRaw = $HttpHandler->execGET($url); #Bypass the consumed output return $this->consumeRawOutput($outputRaw); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search($search_term = \"\"){\r\n\t\tif($search_term != \"\"){\r\n\t\t\t$req = $this->config->getDomain() . \"Search\";\r\n\t\t\t$req .= \"?search_term=\" . $search_term;\r\n\t\t\t$req .= \"&dataType=\" . $this->config->getDataType();\r\n\t\t\t$resp = $this->helper->curlGet($req);\r\n\t\t\t$resultsA...
[ "0.6722495", "0.6616307", "0.65830904", "0.6424559", "0.6418078", "0.6389337", "0.6376947", "0.63332725", "0.6316672", "0.6306289", "0.62978053", "0.6274504", "0.6252879", "0.62103695", "0.6150591", "0.6148551", "0.608889", "0.60886025", "0.6067412", "0.6030703", "0.5988406",...
0.5880935
25
Proccess the raw ouput from a HTTP request over TMDb into an associative array read as JSON.
public function consumeRawOutput($outputRaw=''){ #If for some unexpected reason it's an empty response, return error message (for future improvement: log the url as it can be an functional error) if(!strlen($outputRaw)) return ["success" => 0, "msg" => "Empty response from TMDb"]; #If for some unexpected reason it's not a JSON response, return error message (for future improvement: log the url and the output as it can be an functional error) if((substr($outputRaw,0,1)!='{') && (substr($outputRaw,0,1)!='[')) return ["success" => 0, "msg" => "Not a JSON response from TMDb"]; #Decode the raw JSON output into an associative array $outputData = json_decode($outputRaw,TRUE); #If there is an error on JSON parsing, return error message (for future improvement: log the url and the output as it can be an functional error) if(json_last_error() != JSON_ERROR_NONE) return ["success" => 0, "msg" => "Not a valid JSON response from TMDb (Error ".json_last_error().")"]; #Return the data return ["success" => 1, "data" => $outputData]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTTNData() {\n\n\t\t$obj = new stdClass();\n\n\t\t$obj->app_id = $this->node->getAppID();\n\t\t$obj->dev_id = $this->node->getDevID();\n\t\t$obj->hardware_serial = $this->node->getHwSerial();\n\n\t\t$obj->port = $this->port;\n\t\t$obj->counter = $this->counter;\n\t\t$obj->payload_raw = $this->pay...
[ "0.6107094", "0.57686025", "0.5755359", "0.5730025", "0.5670472", "0.55146486", "0.55010086", "0.5457634", "0.5426471", "0.5416368", "0.54128045", "0.53870744", "0.536124", "0.53555936", "0.53388274", "0.5320885", "0.5286931", "0.524619", "0.5234912", "0.5233756", "0.52230126...
0.6109502
0
Determine if the given configuration value exists.
public function has($name) { $default = microtime(true); return $this->get($name, null, $default) !== $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exists($key)\r\n {\r\n return isset($this->config[$key]);\r\n }", "public function exists($value) {\n return FALSE;\n }", "public function hasConfig(string $key): bool;", "public function hasConfig();", "public function hasConfig($key);", "public function has($key)\n {...
[ "0.7208787", "0.7110511", "0.70404226", "0.69786906", "0.6957485", "0.6914128", "0.68809235", "0.6878708", "0.6852578", "0.68425524", "0.67906773", "0.6727285", "0.67198086", "0.6713348", "0.6713348", "0.66710675", "0.66693467", "0.66596496", "0.663439", "0.66062653", "0.6488...
0.0
-1