blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 116 | path stringlengths 2 241 | src_encoding stringclasses 31
values | length_bytes int64 14 3.6M | score float64 2.52 5.13 | int_score int64 3 5 | detected_licenses listlengths 0 41 | license_type stringclasses 2
values | text stringlengths 14 3.57M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
0ef82412cd2f4045fdfff321085aed351505cb07 | PHP | janlam7/accessor-generator-plugin-lib | /src/AnnotationProcessor/PropertyInformationInterface.php | UTF-8 | 7,566 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/**
* @copyright 2014-2018 Hostnet B.V.
*/
declare(strict_types=1);
namespace Hostnet\Component\AccessorGenerator\AnnotationProcessor;
use Hostnet\Component\AccessorGenerator\Annotation\Enumerator;
/**
* Represents information about a property that is useful for generating
* accessor methods.
*
* Some of... | true |
d31149b833b0b9e79647ab924eb1743c46ab91e2 | PHP | window-li/rageframe2 | /addons/RfExample/common/models/ElasticSearchCurd.php | UTF-8 | 3,356 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace addons\RfExample\common\models;
use Yii;
use yii\elasticsearch\ActiveRecord;
/**
* Class ElasticSearchCurd
* @package addons\RfExample\common\models
*/
class ElasticSearchCurd extends ActiveRecord
{
public static $currentIndex;
/**
* @throws \yii\base\InvalidConfigException
*/
... | true |
ca32312cf73c0c11ec1ccb4588e742ae258c7ce0 | PHP | suhaibashraf/Cheffu | /User/controllers/User.php | UTF-8 | 3,472 | 2.515625 | 3 | [] | no_license | <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class User extends MX_Controller
{
function __construct() {
parent::__construct();
}
function login($role){
$data['view_file'] = "loginform";
$data['role'] = $role;
$this->load->module('Main_template');
$this->main_template->index... | true |
449a2824cf98fb6d391aa49591987f195e5bab97 | PHP | Amankhalsa/Aman_code-html-php-python | /Apna code/PHP source ode/all/All in/VariableScope1.php | UTF-8 | 469 | 3.5625 | 4 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>Local Variable</title>
</head>
<body>
<h1>Understand Local Variable Concept</h1>
<?php
// variable define out of function no scope in function
$name="Amanpreet singh";
//calling to function
print_name();
function print_name(){
//same name variable define in inner part of func... | true |
9284715189f4a238a23d9945d7e27762526c6764 | PHP | PrinceLuo/LeetCode_PHP | /resources/String/Student_Attendance_Record_I.php | UTF-8 | 218 | 2.890625 | 3 | [] | no_license | <?php
function attendence($str){
if(substr_count($str,"A")>1||substr_count($str, "LLL")>0){
return false;
}else{
return true;
}
}
// initialize a string
$str = "PLLALLLLL";
echo attendence($str)?"true":"false"; | true |
01e187a69d4eedca9ff8081e6bdb64878fbafe9b | PHP | Konst-Dz/board | /elems/func/buttonUp.php | UTF-8 | 972 | 2.703125 | 3 | [] | no_license | <?php
//Кнопка поднять
function buttonUp($connect,$id){
if(isset($_POST['up']) and $_POST['up'] == $id){
$query = "UPDATE ad SET last_up = NOW() WHERE id = '$id' ";
mysqli_query($connect, $query) or die(mysqli_error($connect));
$_SESSION['message'] = ['text' => 'Обьявление успешно поднято.... | true |
58e5cf78fa0eda43ec4636daccd6090772d3b72a | PHP | emoty88/Democratus | /p/_eski/share/class.share.php | UTF-8 | 1,168 | 2.546875 | 3 | [] | no_license | <?php
class share_plugin extends control{
public function main(){
global $model, $db;
if($model->userID<1)
return $this->notloggedin();
$title = filter_input(INPUT_POST, 'title', FILTER_SANITIZE_STRING);
$prof... | true |
b524e488b9950fed2c0413ea8986b55d0834e2fe | PHP | itsfahadmughal/PhpServices-PinNews- | /storing_news_nation.php | UTF-8 | 8,515 | 2.71875 | 3 | [] | no_license | <?php
if(file_exists("config_file.php") && is_readable("config_file.php") && include("config_file.php"))
{
// Functions Declaration
// Function # 1 (Get Number of Pages)
function getNoOfPages($url,$city)
{
// Fetching URL
$ch = curl_init();
... | true |
9759306b60ef2db75ee0e56ced4084cd461ee279 | PHP | pabloselin/cchl_wp | /inc/fields-functions.php | UTF-8 | 1,828 | 2.671875 | 3 | [] | no_license | <?php
//Funciones para campos personalizados
function cchl_sortexhibitors( ) {
global $post;
/**
* Ordena los campos personalizados en un array en el que el KEY es la letra del sector en mayúsculas A-B-C-D-E
*/
$sectores = array( 'A', 'B', 'C', 'D', 'E');
$groupexpositores = get_post_meta($post->ID, '_cchl_... | true |
d412ffa3325490b729c3e8f99af50e08aa8b616a | PHP | tianyayoucao/dbpedia | /wikiCompany/ImageExtractor.php | UTF-8 | 2,038 | 3.015625 | 3 | [] | no_license | <?php
/**
* Extracts the first image of a Wikipediapage. Constrcuts a thumbnail from it, and
* the fullsize image.
*/
class ImageExtractor implements Extractor
{
const extractorID = "http://dbpedia.org/extractors/ImageExtractor";
private $language;
private $dbConnection;
public function g... | true |
f5b6266f027c08a2088aaee1970dc0e0121e54c9 | PHP | henryfw/algo | /aziz/php/ch04/isolate-first-non-zero-bit.php | UTF-8 | 178 | 3.34375 | 3 | [] | no_license | <?php
// get first non zero bit
$x = 0b00101100;
$y = $x & ~($x - 1);
echo decbin($y) . "\n";
// replace first non zero bit with zero
$y = $x & ($x - 1);
echo decbin($y); | true |
e8af1c765a6570f2802595ab79fa74fba019e596 | PHP | gitter-badger/tigris | /src/Helpers/ArrayHelper.php | UTF-8 | 1,159 | 3 | 3 | [
"MIT"
] | permissive | <?php
/**
* @author Alexey Samoylov <alexey.samoylov@gmail.com>
*/
namespace Tigris\Helpers;
use Tigris\Types\Base\BaseArray;
use Tigris\Types\Base\BaseObject;
use Tigris\Types\Base\BaseScalar;
class ArrayHelper
{
/**
* @param $data
* @param $key
* @param mixed|null $default
* @return mixed|... | true |
735f6d18ca91c457becc1ed4d3dc1eef984b336d | PHP | spol/Spine | /code/src/Spine/Command/ExtractCommand.php | UTF-8 | 5,084 | 2.78125 | 3 | [] | no_license | <?php
namespace Spine\Command;
use Symfony\Component\Console as Console;
class ExtractCommand extends Console\Command\Command
{
public function __construct()
{
parent::__construct('extract');
$this->setDescription('Extracts an ePub to Markdown.');
$this->setHelp('Extracts an ePub to Markdown.');
$this->ad... | true |
4fdf7972c9b67e7bc96223b084fc7f61e82144b8 | PHP | Bento0397/Estudos_php | /form.php | UTF-8 | 675 | 2.65625 | 3 | [] | no_license |
<br/>
<hr>
<br/>
<div>
<form >
Nome: <input type="text" name="nome"/><br/>
Ano de Nascimento: <input type="number" name="ano"/><br/>
<fieldset><legend>Sexo</legend>
<input type="radio" name="sexo" id="masc" />
<label for="masc">Masculino</label>
<input type="radio" name="sexo" id="f... | true |
b914d844d35c1c5062225f7d7d53449d0a63e591 | PHP | aodto/eshopping | /lib/view.php | UTF-8 | 560 | 2.65625 | 3 | [] | no_license | <?php
class View extends Base
{
public function load ($viewName = null, $parameter = null)
{
if (! is_null($parameter)) {
foreach ($parameter as $key => $val) {
$this->$key = $val;
}
}
$viewPath = ROOT_PATH . DS . 'views' . DS . $viewNam... | true |
b736eb8f2a18bb9f7eb468803b00dda0df9d79ab | PHP | ptarjan/webnumbr | /numbrPlugins/format/gvis/MC/Parser/Token.php | UTF-8 | 929 | 2.90625 | 3 | [] | no_license | <?php
/**
* Parser Generator for PHP
*
* LICENSE
*
* This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
*
* @package MC_Parser
* @author Chadwick Morris <chad@mailchimp.com>
* @license http://www.opensource.org/licenses/mit-license.php
* @version... | true |
f2ffb647fa86e5391f239c73816292d5a78743ae | PHP | jon1267/bsp55 | /database/migrations/2017_09_30_203757_all_for_menu_about.php | UTF-8 | 1,603 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AllForMenuAbout extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('srvs', function (B... | true |
d8d1959cd23a270faa777137bdf9d5b296f7ef23 | PHP | dlachasse/repchill | /www/cats_and_dogs/updateAttendance.php | UTF-8 | 1,284 | 2.640625 | 3 | [] | no_license | <?php
$returnMsg='';
require_once('./../../db_connect_info.inc');
connectToFootieDb();
$player = mysql_real_escape_string($_POST['player']);
$attending = mysql_real_escape_string($_POST['attending']);
$nextGameDateUgly = mysql_real_escape_string($_POST['nextGameDateUgly']);
//if attending, add to DB!
if($attending)... | true |
b43459454e5959146d3d2de80e7256dbb8fed4a7 | PHP | dw902/laravelRbac | /app/Post.php | UTF-8 | 532 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use \App\Model;
class Post extends Model
{
//定义对应的表名为posts
protected $table = "posts";
/*
* 所有评论,一个文章有多条的评论
*/
// 隐藏json属性
// protected $hidden = ['password'];
public function comments()
{
return $this->hasMany('\App\Comment')->orderBy('created_at', 'desc');... | true |
b03b8a160ead7e229c8a526240d164c4ca16cb36 | PHP | emirq/laravel-workshop | /app/User.php | UTF-8 | 860 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Events\UserRegistered;
use App\Completable;
class User extends Authenticatable
{
use Completable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'nam... | true |
20db9b314e45b844807b4e530be455d7b4b66c7f | PHP | arkade-digital/apparel21-sdk | /src/Actions/GetProducts.php | UTF-8 | 2,644 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace Arkade\Apparel21\Actions;
use GuzzleHttp;
use Carbon\Carbon;
use Arkade\Apparel21\Parsers;
use Arkade\Apparel21\Contracts;
use Illuminate\Support\Collection;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Illuminate\Pagination\LengthAwarePaginator;
class GetProduct... | true |
e95fb90ffa03325a18df9f163340c95d3489375c | PHP | TheOctave/Trolley | /backtrolley/routeCheck.php | UTF-8 | 275 | 2.78125 | 3 | [] | no_license | <?php
/**
* Checks if chosen route is valid
* @param String $route
* @return boolean
*/
function isValidRoute($route) {
return $route == 'campus' ||
$route == 'extended' ||
$route == 'nathanBisk' ||
$route == 'downtown';
}
| true |
9260110b8b6f75304111bf33da43247396ae1a8f | PHP | nofloor/crust | /src/Installers/FrontEndInstaller.php | UTF-8 | 815 | 2.65625 | 3 | [] | no_license | <?php
namespace Crust\Installers;
use Crust\Crust;
use Crust\Helpers\Utils;
class FrontEndInstaller extends Installer implements InstallerInterface {
protected $progressBar;
protected $currentStep = 0;
public function __construct(Crust $crust, $settings = [])
{
parent::__construct($crust);
... | true |
e4dbf1b736e55d8fd3765563667e3836a370cbe7 | PHP | phansible/phansible | /src/Phansible/Renderer/VagrantfileRenderer.php | UTF-8 | 4,040 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Vagrantfile Renderer
*/
namespace App\Phansible\Renderer;
/**
* Class VagrantfileRenderer
* @package App\Phansible\Renderer
*/
class VagrantfileRenderer extends TemplateRenderer
{
/**
* @var string VM Name
*/
protected $name;
/**
* @var string Memory
*/
protected... | true |
9e9d8a0b5c58368c4a089bcb5bce50171ad6cb83 | PHP | cntorres1691/leccionPHP_final | /vista/editarbecario.php | UTF-8 | 1,267 | 2.78125 | 3 | [] | no_license | <?php
ini_set('display_errors', 1);
require("../modelo/colectorBecario.php");
$coll = new BecarioCollector();
if(isset($_GET["id"])){
$obj = $coll->getNombre($_GET["id"]);
$obj = $coll->getPrograma($_GET["id"]);
?>
<form action="editarbecario.php" method="post">
<input type="hidden" id=... | true |
c5e743b58681872ae16b80b113e9bb9a73ebb4d9 | PHP | umair-moghal/greconlivelms | /app/Http/Controllers/RoomsController.php | UTF-8 | 1,896 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Room;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Session;
class RoomsController extends Controller
{
public function index(){
$rooms = Room::all();
$user = Auth... | true |
5ca90dac66a1abd035b7b4dcfec210b914ab166e | PHP | efureev/php-support | /tests/traits/ArrayStorageConfigurableTest.php | UTF-8 | 1,503 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Php\Support\Tests;
use PHPUnit\Framework\TestCase;
/**
* Class ArrayStorageConfigurableTest
*/
final class ArrayStorageConfigurableTest extends TestCase
{
public function testConfigurableSetAndGet(): void
{
$config = ArrayStorageConfigurableClassTest::make(... | true |
f8e926cd47e9c9b746798db7e8a258abc8b0a534 | PHP | goldoraf/stato | /library/Stato/Mailer/Mime/Part.php | UTF-8 | 1,386 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace Stato\Mailer\Mime;
class Part extends Entity
{
public function __construct($content = '', $contentType = 'text/plain', $encoding = '8bit', $charset = 'UTF-8')
{
parent::__construct();
$this->content = $content;
$this->charset = $charset;
$this->setContentType($c... | true |
bcbadd4e0a7ee523423c0e5af8b75b4ad748fd79 | PHP | JerrelSogoni/My-Website | /src/assets/php/contact_me.php | UTF-8 | 1,217 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Allow-Headers: content-type");
$postdata = file_get_contents("php://input");
$request = json_decode($postdata, true);
$email = $request['email'];
$phone = $request['phone'];
$message = $request['message... | true |
9d3d3d74ee1dee5771ffa12d8e50a7d5f272b08b | PHP | vl-x/diploma | /lib/mail/index.php | UTF-8 | 621 | 2.59375 | 3 | [] | no_license | <?php
require_once "lib/class.phpmailer.php";
$mail = new PHPMailer;
$mail->setFrom('coolalexnov@gmail.com', 'От кого');
$mail->addAddress('alex_webl@rambler.ru','Кому');
$mail->isHTML(true); // Set email format to HTML
$mail->Subject... | true |
4c18dfbe25406756e9175cb45bce06f6ba6740b9 | PHP | Yusfuu/quiz-app | /inc/score.php | UTF-8 | 788 | 2.59375 | 3 | [] | no_license | <?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
require('auth_session.php');
require('config.php');
function getScore()
{
global $link, $id;
$result = mysqli_query($link, "SELECT score FROM `scores` WHERE `user_id` = $id");
$row = mysqli_fetch_assoc($result);
return... | true |
f5470f21b59a3d27acafc7cc04be16348cc58a2b | PHP | ecphp/cns-client-bundle | /src/Service/Component/NotificationAttachment.php | UTF-8 | 2,445 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @see https://github.com/ecphp
*/
declare(strict_types=1);
namespace EcPhp\CnsClientBundle\Service\Component;
use JsonSerializable;
use StdClass;
use Symfony\Component\HttpF... | true |
2aa7935cfa837808dea5da0dfd47bb5f15723cb4 | PHP | Aculats/TBBT-Projekt | /lib/Template.class.php | UTF-8 | 1,018 | 3.359375 | 3 | [] | no_license | <?php
/**
* @since 1.0.0
* @author Luca
* @licence MIT
*/
namespace lib;
class Template {
private $vars = [ ]; // Holds all the template variables
/**
* Set a template variable.
* @param $name
* @param $value
*/
public function assign( $name, $value ) {
$this->vars[$name]... | true |
aad82a7cc7fe0115c7a64d9d34adc54bc9302ec4 | PHP | ashhher3/www | /studentcx.php | UTF-8 | 4,767 | 2.5625 | 3 | [] | no_license | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="css/bg.css" />
<t... | true |
ca8a635e626fb8fcdd58a473b64b2ed9589b1433 | PHP | gaoolp/phpboot | /tests/MultiRequestTest.php | UTF-8 | 2,501 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace PhpBoot\Tests;
use PhpBoot\RPC\MultiRequest;
class MultiRequestTest extends TestCase
{
public function testMultiWithoutWait()
{
$res = MultiRequest::run(
[
function(){
return 1;
},
function(){
... | true |
3cec793a70be08d43f262cf9698780a23318ad63 | PHP | IvanButov/Example.Wath.ru | /registration.php | UTF-8 | 4,554 | 2.625 | 3 | [] | no_license | <?
session_start();
include'pole.php';
include'connection.php';
include'header.php';
$data= $_POST;
?>
<div class="content">
<?
if(isset($data['reg']))
{
$mail=trim($data['login']);
$phone=($data['phone']);
$name=trim($data['name']);
$parol=trim($data['parol']);
$parol2=trim($data['parol2']);
$pass=md5($_POST['p... | true |
ca5b0799ed5535e728ac9db11b4ec00ea6b6d7d0 | PHP | pionnertech/smpoints | /generator_string.php | UTF-8 | 265 | 2.640625 | 3 | [] | no_license | <?php
$variable = $_GET['variable'];
for($i=0; $i < $variable; $i++){
$bytes = openssl_random_pseudo_bytes(16, $cstrong);
$hex = bin2hex($bytes);
echo substr_replace($hex , "", 0 , 10);
echo " ";
//var_dump($cstrong);
}
?>
| true |
75a385529388deda5ff94f2633457d082e350656 | PHP | purotu/counter | /check_login.php | UTF-8 | 876 | 2.640625 | 3 | [] | no_license | <?php
session_start();
if (isset($_SESSION['REFERER'])) {
$location = $_SESSION['REFERER'];
} else {
$location = 'admin/';
}
if (!isset($_POST['code']) || !isset($_POST['user'])) {
header('Location: login.php?error=use_login_form');
exit();
}
if (empty($_POST['code']) || empty($_POST['user'])) {
h... | true |
bd2d18a72a7eec167c46a66160761da68ee0571a | PHP | mihajlogalicki/Professional-blog-with-CMS-laravel | /app/Http/Controllers/Backend/BlogController.php | UTF-8 | 3,380 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\Backend;
use Illuminate\Http\Request;
use App\Http\Requests;
use Intervention\Image\Facades\Image;
// import models
use App\Post;
class BlogController extends BackendController
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
... | true |
3e9ca034f0f9256c75ff5c8f18cc27d8e973257c | PHP | manuirrazabal/A_0f109f341095deb67a5ec13f4c18dd1d | /app/Models/Category.php | UTF-8 | 1,352 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
/**
* Table name
*
* @var string
*/
protected $table = "an_categories";
/**
* Table primary Kkey
*
* @var string
*/
protected $primaryKey = "cat_id";
... | true |
687e44b1158f7f6ebd8413e3686ed917ac6871f2 | PHP | ismaelcastro/trabalho_pds | /Classes/Cliente.php | UTF-8 | 1,527 | 2.71875 | 3 | [] | no_license | <?php
class Cliente{
protected $id;
protected $nome;
protected $cpf;
protected $endereco;
protected $telefone;
protected $classificacao;
public function __construct(){
}
public function getClassificacao()
{
return $this->classificacao;
}
public function setClassificacao($cl... | true |
da14afb95fd4d2d4d5b97f4c6959a15abdde9100 | PHP | eghojansu/codeigniter-bootstrap | /application/core/MY_Controller.php | UTF-8 | 7,301 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Extends core controller common functions
*/
class MY_Controller extends CI_Controller
{
const USER_ADMIN = 'ROLE_ADMIN';
const USER_MEMBER = 'ROLE_MEMBER';
const USER_GUEST = 'ROLE_GUEST';
const KEY_FLASH = 'FLASH';
protected $homePath = '/';
protected $data = [
'redirec... | true |
9e9e2297f157a3040fd02996fe992c3259dd2cf7 | PHP | ziadmk12/ManagSchool | /app/Http/Controllers/Api/Admin/TeachersController.php | UTF-8 | 1,490 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Api\Admin;
use Tymon\JWTAuth\Facades\JWTAuth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use App\Teacher;
use App\Matter;
class TeachersController extends Controller
{
public function addTeacher(Request $request)
... | true |
803f62df6e64a2c39eec94916f244f5ab2ed523a | PHP | LinuXperia/redditclone | /index.php | UTF-8 | 4,484 | 2.546875 | 3 | [] | no_license | <?php
session_start();
require 'db.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Reddit Clone</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes">
<meta name="description" content="Reddit" />
<link rel="shortcut icon" hr... | true |
9c9a91014cffd8b022622809b922782962ab9019 | PHP | robvdberge/phploversblog | /admin/edit_posts.php | UTF-8 | 3,050 | 2.90625 | 3 | [] | no_license | <?php include 'inc/header.php';?>
<?php
if ( !isset($_GET['id']) && !isset($_GET['del'])){
header('location: index.php');
exit();
} else {
$id = $_GET['id'];
}
$db = new Database;
if ( isset($_POST['submit']) ){
// validate fields
$title = mysqli_real_escap... | true |
5bee5fe31c1a8a008ff54f4cf6c533a7232c806c | PHP | eokwukwe/tedbree-assessment | /app/Http/Controllers/Auth/AuthUserController.php | UTF-8 | 384 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Http\Resources\User\UsersResource;
use Illuminate\Http\Request;
class AuthUserController extends Controller
{
/**
* Fetch currently logged in user.
*/
public function __invoke(Request $request): UsersResource
... | true |
a9873568028696ff1efce54b92d50e387ce24991 | PHP | tongzebin/php | /wenjianfuzhi/bb/php19/1/1-1.php | UTF-8 | 310 | 2.75 | 3 | [] | no_license | <?php
//定义一个可以实现转换文件大小的函数
function zh($size){
if($size/1024>=1){
if($size/1024/1024>=1){
if($size/1024/1024/1024>=1){
return round($size/1024,2).'GB';
}
return round($size/1024,2).'MB';
}
return round($size/1024,2).'k';
}
return $size.'b';
} | true |
722c3ad4ce7180ccb9926dedabe9f0d819afdc81 | PHP | PedroHiago/crud-carro | /pagina/lista.php | UTF-8 | 1,155 | 2.796875 | 3 | [] | no_license | <?php
require('dao.php');
$op = $_POST['op'];
$busca = $_POST['busca'];
$daoCarro = new daoCarro();
if($op=="ano"){
$feedback = $daoCarro->listarCarroAno($busca);
}else if($op=="modelo"){
$feedback = $daoCarro->listarCarroModelo($busca);
}else if($op=="marca"){
$fe... | true |
f2f5d039bc21f74cf592c2728c4d0b36f2e491d2 | PHP | WaseemCake/qb | /tests/intrinsic-tan.phpt | UTF-8 | 747 | 2.9375 | 3 | [] | no_license | --TEST--
Tangent test
--FILE--
<?php
/**
* A test function
*
* @engine qb
* @param float64 $[ab]
* @param float32 $[cd]
* @param int32 $i
*
* @return void
*
*/
function test_function($a, $b, $c, $d, $i) {
echo tan($a), "\n";
echo tan($b), "\n";
echo tan($c), "\n";
echo tan($d), "\n... | true |
2bd06d6f8f24d5d0693daf805635541f398fca13 | PHP | scuben/Mosquitto-PHP | /tests/Client/unsubscribe.phpt | UTF-8 | 1,619 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | --TEST--
Mosquitto\Client::unsubscribe()
--SKIPIF--
if (!extension_loaded('mosquitto')) die('skip - Mosquitto extension not available');
--FILE--
<?php
include(dirname(__DIR__) . '/setup.php');
/* No params */
try {
$client = new Mosquitto\Client;
$client->unsubscribe();
} catch (Exception $e) {
writeExcep... | true |
9cb68ecff8209ad12d592f92d67f75d3d3676af6 | PHP | krishanb4/test2 | /dialogflowtest.php | UTF-8 | 904 | 2.75 | 3 | [] | no_license | <?php
$method = filter_input(INPUT_SERVER,'REQUEST_METHOD');
//$method = $_SERVER['REQUEST_METHOD']; same code, first code is secured
if ($method == "POST"){
$requestbody = file_get_contents('php://input');
$json = json_decode($requestbody);
$text = $json ->result->parameters->text; // change ... | true |
aeaab06c1b0a0f2a7586095142ecb939305ea5cf | PHP | bdaler/db-synchronizer | /src/Service/UpdateEmployee.php | UTF-8 | 2,392 | 2.796875 | 3 | [] | no_license | <?php
/**
* author: BDaler (dalerkbtut@gmail.com)
* @date: 02.03.2020 08:45
*/
namespace DBSynchronizer\Service;
use DateTime;
use DBSynchronizer\PrimaryDB\Entity\Employee as EmployeePrimary;
use DBSynchronizer\SecondaryDB\Entity\Employee as EmployeeSecondary;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\ORME... | true |
91773ed6087cfe3bdd1711f7686dc9838db9988b | PHP | gizm0bill/SocialWebMining | /application/services/Worker.php | UTF-8 | 3,755 | 2.875 | 3 | [] | no_license | <?php
namespace App\Service;
use Zend_Config,
Zend_Config_Ini,
Zend_Config_Writer_Ini;
class Worker
{
/**
* execute php command
* @var string
*/
private $_cmd = '';
/**
* control point path
*/
private $_ctrlPointPath = '';
const STATUS_RUNNING = 'running';
const STATUS_STOPPED = 'stopped';
publ... | true |
2090d5ea2c27d3241d4ae4e3f1027346325e2142 | PHP | juksoto/ciamsa | /layout/modalReferencia.php | UTF-8 | 647 | 2.625 | 3 | [] | no_license | <?php
require '../config/conexion.php';
if( isset($_GET['referencia_id']) ) {
$reference_id = $_GET['referencia_id'];
} else {
die("Solicitud no válida.");
}
$sql = "SELECT * FROM referencia WHERE active = 1 AND id = $reference_id";
if ($result = $mysqli -> query ($sql) ) {
/* determinar el número de fila... | true |
39b1827b48db512ef8b61e7da125c22f79055215 | PHP | MrViktorikus/chatRoom | /signup.php | UTF-8 | 2,603 | 2.734375 | 3 | [] | no_license | <?php
session_start();
$_SESSION['username'] = NULL;
include "db.php";
$existingUsers = "SELECT username FROM users";
$username = filter_input(INPUT_POST, "username", FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$password = filter_input(INPUT_POST, "password", FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$email = filter_input(INPUT... | true |
247074b6ee925406ab1212222a482dcc89d900f9 | PHP | mfrdm/yii2-seo | /models/SeoMeta.php | UTF-8 | 1,222 | 2.546875 | 3 | [] | no_license | <?php
namespace linchpinstudios\seo\models;
use Yii;
use linchpinstudios\seo\models\SeoPages;
/**
* This is the model class for table "seo_meta".
*
* @property integer $id
* @property integer $page
* @property string $name
* @property string $content
* @property string $date_modified
*/
class SeoMeta extends... | true |
65a18374d3b1009b4ff9ba49428d2d5413076b5d | PHP | NovumSVB/innovation-app-util-http | /Provider/Helpers/Vhost.php | UTF-8 | 3,023 | 2.640625 | 3 | [] | no_license | <?php
namespace Provider\Helpers;
class Vhost
{
private string $sDomain;
private string $sServerAdmin;
private int $iPort;
private string $sDocumentRoot;
private string $sLogDirectory;
private string $sEnv;
private array $aParams;
private bool $bUseSsl;
function __construct(string... | true |
55040a240064d5b9b9b651c4d7e955b1adbd4466 | PHP | glennfriend/sso-manager | /app/components/bridge/CacheBrg.php | UTF-8 | 2,065 | 2.6875 | 3 | [] | no_license | <?php
/**
* bridge phalcon Cache
*/
class CacheBrg
{
/**
* cache
*/
private static $cache = array();
/**
* session init
*/
public static function init( $cachePath )
{
//self::$cache = $di->getCache();
// Frontend: 主要負責檢查KEY是否過期
// 以及 在存儲到backend之前... | true |
c53539da7cb737acbda0fc024bfd29f63b1d302c | PHP | ruminiki/followmoney | /milkManager/com/milkManager/dao/Database.php | UTF-8 | 2,534 | 2.75 | 3 | [] | no_license | <?php
/*
* Created on 01/03/2011
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
class Database{
//produ��o
//const host = 'mysql03.redehost.com.br';
//const user = 'sa_fmdb';
//const password = '5a_FmdB!';
//const da... | true |
dfbf4f3d9320db37ea279788ed9cf8995226fce6 | PHP | lukeme/socket_demo | /std/fork.for.php | UTF-8 | 1,435 | 2.78125 | 3 | [] | no_license | <?php
$child_pids = [];
for($i=0;$i<3; $i++){
$pid = pcntl_fork();
if($pid == -1){
exit("fork fail");
}elseif($pid){
$child_pids[$pid] = $pid;
$id = getmypid();
echo time()." Parent process,pid {$id}, child pid {$pid}\n";
}else{
$id = getmy... | true |
89589a504eeadb658526929a757e21e1172969a0 | PHP | bramadl/tedxapp | /app/Http/Controllers/Auth/RegisterController.php | UTF-8 | 1,211 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\DB;
class RegisterController extends Controller
{
public function register(Request $request)
{
$request->validate([
... | true |
33d0cb5fd0988ae7c716d08394343c822751fc95 | PHP | arctgx/petal | /code/lib/dao/user.php | UTF-8 | 1,376 | 2.96875 | 3 | [] | no_license | <?php
class dao_user {
protected static $table_name = 'user';
// 根据board id 获取画板信息
public static function getByUserID ($userID) {
$sql = sprintf('SELECT * FROM %s WHERE user_id=:user_id', self::$table_name);
$db = DbManager::getDB();
$stmt = $db->prepare($sql);
$stmt->bindP... | true |
ec87f6c3f7c0776933579d3da8cb94b665b46aba | PHP | 506410078/hyperf_chat | /app/Controller/WebSocketController.php | UTF-8 | 861 | 2.609375 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Controller;
use Hyperf\Contract\OnCloseInterface;
use Hyperf\Contract\OnMessageInterface;
use Hyperf\Contract\OnOpenInterface;
use Swoole\Http\Request;
use Swoole\Server;
use Swoole\Websocket\Frame;
use Swoole\WebSocket\Server as WebSocketServer;
class WebSoc... | true |
d3ab38473fc36348433784ce34d10fbf399abef7 | PHP | farhanmb02/pw2021_203040128 | /pertemuan 4/index.php | UTF-8 | 1,087 | 3.140625 | 3 | [] | no_license | <?php
/*
Farhan Mohamad Bintang Atoilah
203040128
https://github.com/farhanmb02/pw2021_203040128
pertemuan 4 == 19 february 2021
function buildin (date)
*/
// memanggil beberapa function built in php
// 1. date
// harus ada parameter
// memanggil function date
// documentasi date ada di... | true |
d88a5c3d6f0d71b13104f23801fd8a9d45f443c3 | PHP | BjornJaupllari/Blog | /register.php | UTF-8 | 4,652 | 2.8125 | 3 | [] | no_license | <head>
<?php include('config.php'); ?>
<?php
$errors = array();
if(isset($_POST['btnRegister'])) {
// Get data from FROM
$first_name = trim($_POST['first_name']);
$last_name = trim($_POST['last_name']);
$username = trim($_POST['username']);
... | true |
c5640646c6d89cd8a2ecc7d82e4229e9d3ac05ba | PHP | KellyLavio/hoc_produits | /src/produits_functions.php | UTF-8 | 553 | 3.125 | 3 | [] | no_license | <?php
/**
* Looks for a product with the specified id in the specified array
*
* @param integer $id The wanted ID
* @param array $produits The products (multi-dimensional, each product is considered as an associative array with an 'id' key)
* @return array|null The product(array), otherwise null
*/
function searc... | true |
008c4f53a91599921c65596d20382ed73b45df02 | PHP | robson-gammanet/papu | /server/admin/calltoaction/index.php | UTF-8 | 2,846 | 2.59375 | 3 | [] | no_license | <?php
use google\appengine\api\users\User;
use google\appengine\api\users\UserService;
require_once __DIR__.'/../base.php';
require_once __DIR__.'/../../rest/models/userModel.php';
$title='Call to action';
$menu='calltoaction';
include __DIR__.'/../head.php';
function call_error($txt)
{
echo '<h1 style="color:re... | true |
6ed5d7c73082e10fd5da5f94a45b9c6993b11e6e | PHP | digitaltim/BoutiqueCommerceOld | /Src/Infrastructure/Security/Authentication/AuthenticationMiddleware.php | UTF-8 | 877 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace It_All\BoutiqueCommerce\Src\Infrastructure\Security\Authentication;
use It_All\BoutiqueCommerce\Src\Infrastructure\Middleware;
class AuthenticationMiddleware extends Middleware
{
public function __invoke($request, $response, $next)
{
// check if the user is not signed in
... | true |
1c0944f0142234977417231d1a79c73b28e74c49 | PHP | Sywooch/trash | /docdoc/common/classes/docdoc/reports/DoctorConversion.php | UTF-8 | 2,131 | 2.65625 | 3 | [] | no_license | <?php
namespace dfs\docdoc\reports;
use dfs\docdoc\models\DoctorClinicModel;
use dfs\docdoc\models\DoctorModel;
class DoctorConversion extends Report
{
/**
* Параметры столбцов
*
* @var array
*/
protected $_fields = [
'doctor_name' => ['title' => 'Врач', 'width' => 30],
'clinic_name' => ['titl... | true |
7d73d5a041949f0c9bfef1a3885c8c41c48918e2 | PHP | BenDixon311/DGM-3760-Web-Languages-2 | /Unit07/signup2.php | UTF-8 | 2,558 | 2.625 | 3 | [] | no_license | <?php
require_once('variables.php');
$dbconnect = mysqli_connect(HOST, USER, PASSWORD, DB_NAME) or die("unable to connect to db");
if (isset($_POST['submit'])) {
$first = mysqli_real_escape_string($dbconnect,trim($_POST['first']));
$last = mysqli_real_escape_string($dbconnect,trim($_POST['last'])... | true |
1fae4c8a7d8c0604c0eb4f49e7808c24ee14fd6e | PHP | juvpengele/laravel-vue-spa-blog | /app/Http/Requests/PostRequest.php | UTF-8 | 1,517 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Str;
class PostRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
... | true |
021219824a7224c8e64be528adbb09138ef3e1c8 | PHP | wolfy-j/forked-php-orm-benchmark | /atlas_21/vendor/atlas/query/src/Select.php | UTF-8 | 4,290 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
/**
*
* This file is part of Atlas for PHP.
*
* @license http://opensource.org/licenses/mit-license.php MIT
*
*/
declare(strict_types=1);
namespace Atlas\Query;
use BadMethodCallException;
use Generator;
/**
* @method array fetchAll()
* @method int fetchAffected()
* @method array fetchColumn(int $colu... | true |
1a59339156e1627659a44fe480e300009ecdb8a8 | PHP | monishappusamy/PersonDetails | /delete_confirmation.php | UTF-8 | 387 | 2.53125 | 3 | [] | no_license | <?php include('header.php'); ?>
<div class ="container">
<?php
// conncetion details
require "config.php";
$person_id = $_GET["id"];
$sql = "DELETE FROM person WHERE person_id='" .$person_id. "';";
if ($conn->query($sql) === TRUE) {
echo "<h2>Record deleted successfully</h2>";
} else {
echo "Error ... | true |
1982b21f8aa4e558dacaf5e74129110d69c8c5c7 | PHP | withmorten/subresync | /php/srtHelpers.php | UTF-8 | 4,413 | 3.046875 | 3 | [] | no_license | <?php
const SRT_STATE_SUBNUMBER = 0;
const SRT_STATE_TIME = 1;
const SRT_STATE_TEXT = 2;
const SRT_STATE_BLANK = 3;
function srtToArray($srtString) {
$srtArray = array();
$state = SRT_STATE_SUBNUMBER;
$srtNum = 0;
$srtText = '';
$srtTime = '';
$srtLines = preg_split("/\r\... | true |
368c0109d2fcfa907cf51f3467d85f54305a61ff | PHP | anik69/Hotel_Management | /seats.php | UTF-8 | 1,879 | 2.65625 | 3 | [] | no_license |
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<title>Seats</title>
<link rel="stylesheet" type="text/css" title="substyle" href="style3.css">
</head>
<body>
<h1>Current Rooms Status</h1>
</body>
<?php
require 'connect.php';
//if (isset($_POST['sec']))
//{
... | true |
80a983efb44c1486bc4140f171349f64d035a8c4 | PHP | yaim/playground | /app/Http/Controllers/UpworkController.php | UTF-8 | 1,646 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use Backpack\CRUD\app\Http\Controllers\CrudController;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class UpworkController extends CrudController
{
public function setup() {
$this->crud... | true |
e5ffbdc9b226f0d73478d6ed34e447a796606e4c | PHP | farjahan/CS160_WEB | /SendMail.php | UTF-8 | 708 | 2.640625 | 3 | [] | no_license | <?php
function send_mail($to, $subject, $body) {
require "PHPMailer/class.phpmailer.php";
$from = "k.tapakorn@gmail.com";
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Host = "smtp.gmail.com";
$mail->Port = 587;
$mail->Username =... | true |
500a659d4e9dbf4b8b0479a7958161e39b1ee463 | PHP | marcrobinsone/uikit_api | /themes/custom/docs_admin/theme/button.tpl.php | UTF-8 | 503 | 2.625 | 3 | [] | no_license | <?php
/**
* @file
* Returns HTML for a button form element.
*/
$element = $variables['element'];
$element['#attributes']['type'] = 'submit';
element_set_attributes($element, array('id', 'name', 'value'));
$element['#attributes']['class'][] = 'form-' . $element['#button_type'];
if (!empty($element['#attributes']['... | true |
e93691c08a85c6b57dbc1c503558047a4077900b | PHP | iccowan/pokemon_database | /Implementation/PHP/addTrainer.php | UTF-8 | 2,184 | 3.0625 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>Pokemon League Trainers</title>
</head>
<body>
<h1>Add A New Trainer</h1>
<hr>
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//Check if POST variables are set and add them to the d... | true |
17eb534b948739a59f5ea0becf2d9582cb4186f9 | PHP | HCarlos/PS | /ms.php | UTF-8 | 68 | 2.53125 | 3 | [] | no_license | <?php
$var1 = 5;
$var2 = 3;
$text = 'var1 * var2';
echo $$text;
?> | true |
f5af7042811e8ad2e7c954c0dd08bb8562bb4c73 | PHP | ButhainaSudi/REMSW | /REMS Website docs/includes/rundb.php | UTF-8 | 379 | 2.59375 | 3 | [] | no_license | <?php
include_once 'rdbc.php';
if(isset($_POST['submit']))
{
//to run PHP script on submit
if(!empty($_POST['check_list']))
{
// Loop to store and display values of individual checked checkbox.
foreach($_POST['check_list'] as $selected)
{
echo $selected."</br>";
}
}
else
{
echo "emp... | true |
167175af6da23d48b93d2023364542258dbf55f9 | PHP | Ewertonv90/AmazonTweet | /App/Models/Usuario.php | UTF-8 | 4,415 | 2.9375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use MF\Model\Model;
class Usuario extends Model{
//atributos ========================================================================
private $id;
private $nome;
private $email;
private $senha;
// gets e sets universais ===========================================================
... | true |
f434d5fccce10b0655040fc0e40b02dfa0029d1c | PHP | deninchoo/InchooStoreReview | /Inchoo/StoreReview/Ui/Component/Listing/Column/StoreView.php | UTF-8 | 1,365 | 2.5625 | 3 | [] | no_license | <?php
namespace Inchoo\StoreReview\Ui\Component\Listing\Column;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Ui\Component\Listing\Columns\Column;
/**
* Class StoreView
*/
class StoreView extends Column
{
protected $userFacto... | true |
98c66fba27d790bf35f050bf288263f0bd345ea2 | PHP | thePHPcc/ConFoo-2015 | /tests/BranchTest.php | UTF-8 | 2,009 | 2.8125 | 3 | [] | no_license | <?php
/**
* @covers Branch
*/
class BranchTest extends PHPUnit_Framework_TestCase
{
/**
* @var Branch
*/
private $branch;
/**
* @var Lot
*/
private $lot;
protected function setUp()
{
$this->lot = $this->getMockBuilder(Lot::class)->disableOriginalConstructor()->ge... | true |
c0b29a438b68f8f910ca5b861f55bc664ede7d3d | PHP | RicardoGranja50/Redes | /AT7/exercicio.php | UTF-8 | 385 | 3.4375 | 3 | [] | no_license | <?php
$temperatura=0;
echo'<h1> A temperatura é de ' .$temperatura.'º</h1>';
if($temperatura<=3)
{
echo 'Dia gelado';
}
elseif($temperatura > 3 && $temperatura <=15){
echo 'Dia frio';
}
elseif($temperatura>15 && $temperatura <29){
echo 'Dia agradavel';
}
e... | true |
e219bd257f90a9279be4b9d566173320ef544fc2 | PHP | benbeezy/phpscraper | /users.php | UTF-8 | 8,299 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | <?php
// Defining the basic scraping function
function scrape_between($data, $start, $end){
$data = stristr($data, $start); // Stripping all data from before $start
$data = substr($data, strlen($start)); // Stripping $start
$stop = stripos($data, $end); // Getting the position of the ... | true |
7490df86e28f719e7ae98ac8522af3745f7d176f | PHP | handcraftedinthealps/goodby-csv | /src/Goodby/CSV/Import/Tests/Standard/Unit/Observer/SqlObserverTest.php | UTF-8 | 1,476 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace Goodby\CSV\Import\Tests\Standard\Unit\Observer;
use Goodby\CSV\Import\Standard\Interpreter;
use Goodby\CSV\Import\Standard\Observer\SqlObserver;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use PHPUnit\Framework\TestCase;
/**
* unit test for sql observer.
*/
class SqlObserverTest extends ... | true |
b5bf08401406100ad04e49c109d501b5c6653fdf | PHP | FatouDiouf/wari | /src/Entity/Depot.php | UTF-8 | 2,426 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ApiResource()
* @ORM\Entity(repositoryClass="App\Repository\DepotRepository")
*/
class Depot
{
/**
... | true |
d1775d5bd4595e4d5b94aeeb4f37ca5ef1454421 | PHP | tgilbers/advent-2015 | /advent14b.php | UTF-8 | 1,095 | 3.0625 | 3 | [] | no_license | <?php
$filecontents = file_get_contents('advent14_input.txt');
preg_match_all('/(\w*) can fly (\w*) km\/s for (\w*) seconds, but then must rest for (\w*) seconds/', $filecontents, $inputreindeers, PREG_SET_ORDER);
$raceTime = 2503;
$maxDistance = 0;
foreach($inputreindeers as $reindeer)
{
list($foo, $name, $speed,... | true |
c75afe5888a39dbc48a0099997ed8f191f80f616 | PHP | symbiote/silverstripe-cdncontent | /code/controllers/CDNSecureFileController.php | UTF-8 | 4,286 | 2.703125 | 3 | [] | permissive | <?php
use Symbiote\ContentServiceAssets\ContentServiceAsset;
/**
* Handles requests to access a CDN file, checking if the file can be viewed given
* it's access settings. If successful it returns an expiring url for the resource
*
* @author Stephen McMahon <stephen@symbiote.com.au>
*/
class CDNSecureFileControll... | true |
abbc4fd76e2ba77fcc1585f4bd4e61fad342e97e | PHP | lichunqiang/php-wechat | /src/Enterprise/OauthClient.php | UTF-8 | 2,451 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
// +----------------------------------------------------------------------
// | Writen By lichunqiang
// +----------------------------------------------------------------------
// | Copyright (c) 2012-2014, All rights reserved.
// +----------------------------------------------------------------------
// | Author... | true |
121ea00569ceab0a328f1b68045af9f5b9fb0cf4 | PHP | bpbp-boop/network-weathermap | /lib/Weathermap/Core/TrueTypeFont.php | UTF-8 | 2,514 | 3.03125 | 3 | [
"MIT",
"CC-BY-2.5",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Weathermap\Core;
/**
* FontTable member representing a Truetype font
*
* @package Weathermap\Core
*/
class TrueTypeFont extends Font
{
public $file;
public $size;
public $verticalOffset;
public function __construct($filename, $size, $verticalOffset = 0)
{
parent::__con... | true |
c2f7f3a1b53c38c83a7c2247030690bbe45a1a70 | PHP | miilacg/monitoriaWeb | /listaEstruturas/atividade09.php | UTF-8 | 434 | 4.25 | 4 | [] | no_license | <?php
/*Dado um número inteiro positivo n, calcular a soma dos
n primeiros números naturais.*/
function soma($n){
if($n == 0){
echo ("Soma: 0");
}else{
$resultado = 0;
for($i = 1; $i <= $n; $i++){
$resultado = $resultado + $i;
... | true |
ea55930dd1846e3b12f2462225195986e191a4b1 | PHP | com-io1210/hakobeya | /app/Http/Controllers/rws-php-sdk-1.1.0/lib/RakutenRws/HttpClient/PearHttpClient.php | UTF-8 | 2,211 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of Rakuten Web Service SDK
*
* (c) Rakuten, Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with source code.
*/
require_once 'HTTP/Client.php';
/**
* Http Client that use PEAR Http_Client
*
* @package RakutenRws
* ... | true |
3ca458c954971a5c5e64b9a6ba6362f7dc5d7c6d | PHP | Elh-Ayoub/PHP_Trainee | /Controllers/UserController.php | UTF-8 | 5,451 | 2.546875 | 3 | [] | no_license | <?php
spl_autoload_register(function ($class_name) {
include "./Models/" . $class_name . '.php';
});
// session_start();
class UserController{
public static function profile(){
if(isset($_SESSION['auth'])){
include "./profile.php";
}else{
... | true |
dd015d63bf5691db63a8edd0439a351edbdd1534 | PHP | ProjektGopher/whisky | /app/Platform.php | UTF-8 | 1,352 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace ProjektGopher\Whisky;
use Illuminate\Support\Facades\File;
class Platform
{
public static function cwd(string $path = ''): string
{
if ($path) {
return static::normalizePath(getcwd().'/'.$path);
}
return static::normalizePath(getcwd());
}
public s... | true |
96bd790a4c9a906bf85d134c0b9826e7e3309b8a | PHP | haydnba/gitnk-exercises | /exercise-10/comRPS.php | UTF-8 | 2,472 | 3.5625 | 4 | [] | no_license | <?php
function validateInput(array $terms, string $input) {
if (!array_key_exists($input, $terms)) {
echo "Sorry, please enter a valid input\n";
return;
}
return $input;
}
function generatePlay(int $num) {
return $num < 1 ? 'R' : ($num > 1 ? 'S' : 'P');
}
function getResult(array $outcomes, array $te... | true |
f526028d807f6c612580b6b958eb21afbe512599 | PHP | iismatkulov/edu-center-system | /common/models/OutlayItem.php | UTF-8 | 831 | 2.53125 | 3 | [] | no_license | <?php
namespace common\models;
use Yii;
/**
* This is the model class for table "glc_outlay_item".
*
* @property int $id
* @property int $outlay_id
* @property int $name
*/
class OutlayItem extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
... | true |
4f551333edc6b428eadd16508aba2170bb93d302 | PHP | 1up-lab/OneupUploaderBundle | /src/Uploader/Chunk/ChunkManager.php | UTF-8 | 1,387 | 2.6875 | 3 | [
"MIT",
"AGPL-3.0-only"
] | permissive | <?php
declare(strict_types=1);
namespace Oneup\UploaderBundle\Uploader\Chunk;
use Oneup\UploaderBundle\Uploader\Chunk\Storage\ChunkStorageInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
class ChunkManager implements ChunkManagerInterface
{
/**
* @var array
*/
protected $configur... | true |
727da7c4d76c7aff301cc4ace1e407cecb146c7c | PHP | ducquyen/Imagick_PHP | /Imagick/reduceNoiseImage.php | UTF-8 | 309 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | <?php
/*Imagick Object*/
$imagick = new \Imagick('https://cdncontribute.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-19.png');
/*reduceNoiseImage*/
$imagick->reduceNoiseImage(3);
/*Image header*/
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
?> | true |