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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3329ecfcdf4a876d1d463b2d84b3208bd98389ac | PHP | KaloyanAleksiev/PHP-Fundamentals-SoftUni | /Exercise8OOPAdvanced/Interfaces06BirthdayCelebrations.php | UTF-8 | 2,979 | 3.453125 | 3 | [
"MIT"
] | permissive | <?php
interface Settler {
public function getId();
}
interface liveSettler {
public function getBirthday();
}
class Citizen implements Settler, liveSettler {
private $id;
private $name;
private $age;
private $birthday;
public function __construct(string $name, int $age, string $id, Da... | true |
a022be0840ba0b113610d843d7d0dfed5416081e | PHP | neo3k/rover-ddd-laravel | /src/Domain/Shared/ValueObject/Position.php | UTF-8 | 1,242 | 3.109375 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Vera\Rover\Domain\Shared\ValueObject;
final class Position
{
private Coordinate $x;
private Coordinate $y;
public function __construct(Coordinate $x, Coordinate $y)
{
$this->x = $x;
$this->y = $y;
}
/**
* @param Coordinate $x
... | true |
6d2607a434689648da528b9c38db7b3744086e08 | PHP | Hounddog/DoctrineModule | /src/DoctrineModule/Options/Connection.php | UTF-8 | 3,030 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace DoctrineModule\Options;
use Zend\Stdlib\AbstractOptions;
class Connection extends AbstractOptions
{
/**
* Set the configuration key for the Configuration. Configuration key
* is assembled as "doctrine.configuration.{key}" and pulled from
* service locator.
*
* @var string... | true |
bf6cf2ec260b13c9ca9fda6866adb156ccf87725 | PHP | David7852/CakePHP | /src/Model/Entity/Servicio.php | UTF-8 | 1,208 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Model\Entity;
use App\Controller\ServiciosController;
use Cake\ORM\Entity;
/**
* Servicio Entity
*
* @property int $id
* @property string $nombre
* @property string $cupo
* @property int $renta_id
* @property \Cake\I18n\Time $created
* @property \Cake\I18n\Time $modified
*
* @property \A... | true |
280557b4f72b04620bc2beda4e3fbbf6cfe4c7ec | PHP | dekiakbar/lara-matrix | /src/Matrix.php | UTF-8 | 1,807 | 3.390625 | 3 | [
"MIT"
] | permissive | <?php
namespace Deki\Matrix;
class Matrix
{
/**
* Here are the logic of this package
*/
//========================== Matrix ==========================
// Transformation matrix
function Transform($kriteria)
{
$hasil = array();
for ($i=0; $i < sizeof($kriteria) ; $i++) {
for ($j=0; $j < sizeof($... | true |
7bbb4ef4af3a0d9ea8181438e8a222696d8df0be | PHP | Micky143/Php_Waha | /extends1.php | UTF-8 | 1,395 | 3.25 | 3 | [] | no_license | <?php
class student
{
var $name;
var $rollno;
var $gender;
function studentdetail($n,$r,$g)
{
$this->name=$n;
$this->rollno=$r;
$this->gender=$g;
}
function studentdisplay()
{
echo "student Name=$this->name<br>";
echo "student Roll no=$this->rollno<br>";
echo "student Gender=$this->ge... | true |
86e47b756f0cbc9dd377e587f9ef47a7a665ee89 | PHP | weareyou/codebeast | /src/Tools/Lint/Lint.php | UTF-8 | 957 | 2.5625 | 3 | [] | no_license | <?php
namespace EugeneZenko\CodeBeast\Tools\Lint;
use EugeneZenko\CodeBeast\Tools\Tools;
use EugeneZenko\CodeBeast\Tools\Base;
use EugeneZenko\CodeBeast\Console\IOUtil;
use EugeneZenko\CodeBeast\Console\IO;
/**
* Class Lint
*
* @package CodeBeast
*/
class Lint extends Base implements Tools{
const TEMPLATE_PA... | true |
5ff8c1a55d192e456e30632d7bdf9fb096c87d8b | PHP | pontocom/aulasped | /ped2012/iagenda/recuperar.php | UTF-8 | 5,108 | 2.5625 | 3 | [] | no_license | <?php
include_once("PHPMailer/class.phpmailer.php");
include_once("PHPMailer/class.smtp.php");
function gmailMessage($userid, $to, $nameTo) {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$ma... | true |
48ded7ab25695ad73b03a5923d6b76bba5d202b5 | PHP | cordoval/chamilo_phpperu | /common/libraries/php/html/menu/xml_tree_menu_renderer.class.php | UTF-8 | 1,996 | 2.5625 | 3 | [] | no_license | <?php
namespace common\libraries;
/**
* $Id: xml_tree_menu_renderer.class.php 128 2009-11-09 13:13:20Z vanpouckesven $
* @package common.html.menu
*/
use group\GroupDataManager;
use group\Group;
class XmlTreeMenuRenderer
{
private $menu;
private $include_parents;
private $include_siblings;
... | true |
e05b66fa3dce830563eca62118a0c4218c1cb96b | PHP | boxm16/georgia-elections2020 | /Model/District.php | UTF-8 | 3,506 | 2.65625 | 3 | [] | no_license | <?php
class District implements JsonSerializable {
private $districtId;
private $districtFullName;
private $message;
private $totalVotes;
private $winner;
private $districtCandidates;
private $restCandidatesPercent;
private $bottomMessage;
public function __construct(... | true |
947143c56666393905ad791894b1afe45b642806 | PHP | kairosProject/configuration | /Kairos/Config/Traits/ValidationTrait.php | UTF-8 | 2,316 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* This file is part of the chronos project.
*
* As each files provides by the CSCFA, this file is licensed
* under the MIT license.
*
* PHP version 7.2
*
* @category Configuration
* @package Configuration
* @author matthieu vallance <matthieu.vallance@cscfa.fr>
* @licens... | true |
1459d930472f5d23658c2e2c3a530af54e65d15b | PHP | junyuwang801119/Course-PHP-MySQL | /8.if else.php | UTF-8 | 522 | 3.296875 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>if else</title>
</head>
<body>
<?php /*
if (!empty($_GET['age']) and $_GET['age'] >= 18) { ?>
<p>hahaha</p>
<?php } else { ?>
<p... | true |
48e8fa6398267d62f9b055cb8934dbdff6e598ad | PHP | hjldragon/yiishop | /backend/controllers/ArticleController.php | UTF-8 | 3,858 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace backend\controllers;
use backend\components\RbacFilter;
use backend\models\Article;
use backend\models\Articlecategory;
use backend\models\Articledetail;
use yii\data\Pagination;
class ArticleController extends \yii\web\Controller
{
public function behaviors()
{
return [
'... | true |
3bb5f6fdf2d80ba18ed98b7004894c1e31c8d868 | PHP | pharaun13/maleficarum-http-client | /src/AbstractClient.php | UTF-8 | 17,174 | 2.8125 | 3 | [] | no_license | <?php
/**
* This is the basis for all HTTP client classes. All common HTTP functionality is contained here.
*/
declare(strict_types=1);
namespace Maleficarum\Client\Http;
abstract class AbstractClient {
/* ------------------------------------ Class Property START --------------------------------------- */
... | true |
8cd2986a760e46fe39e6c63cae27c6fa406f1c5b | PHP | jelte/automaton | /src/Automaton/Plugin/AbstractPluginEventSubscriber.php | UTF-8 | 361 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace Automaton\Plugin;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
abstract class AbstractPluginEventSubscriber implements EventSubscriberInterface
{
/**
* @var PluginInterface
*/
protected $plugin;
protected function __construct(PluginInterface $plugin)
{
... | true |
e13ca8154a86e14a0d6b477aefaad3b9374ada7c | PHP | igor-zhelezniak/_local_timet_admin | /app/CompanyInfo.php | UTF-8 | 676 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Validator;
class CompanyInfo extends Model
{
protected $table = 'companies';
protected $fillable = [
'name', 'code', 'url','description', 'country', 'city', 'adress', 'timezone', 'phone_number', 'companyLogo', 'nominal'
];
pro... | true |
2f90e4374db7d38d4e0f9f0cc81a35d076a8adfd | PHP | darylljann/cakephp-hipteam | /Config/bootstrap.php | UTF-8 | 1,574 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Here's the plugin's bootstrap file.
* This is just an example of which configuration can be added for the plugin.
* There are three things you should add to you own bootstrap file (app/Config/bootstrap.php).
* - HipChat API key
* - Cache feature
* - Replace the default HipChat's profile picture
*/
/... | true |
d0a9e36cee2fa6847a9b6ea60ac0e62798085d8f | PHP | josemiguel0077/nbeq | /index.php | UTF-8 | 2,799 | 2.8125 | 3 | [] | no_license | <?php
function crear_hash(){
$key = '';
$numeros = range(0, 9);
$letras = range('a', 'z');
$keys = array_merge($numeros, $letras);
for($i = 0; $i < 6; $i++){
$key .= $keys[array_rand($keys)];
}
return $key;
}
if(!empty($_POST['cantidad'])
&& !empty($_FILES['index'])){
$links = '';
$cantidad = $_POST['ca... | true |
3ef895614fbdb65d48890b99a5748605031282fb | PHP | kousukeex/linux-study-site | /file.php | UTF-8 | 3,289 | 2.671875 | 3 | [] | no_license | <?php
$fid = $_GET['fid'];
$sql = "select filepath,description,detail from Linuxfile where fid=".$fid;
$sqlinfo = "select LFI.tid,LFI.title,LFI.description from linuxfileinfo LFI,linuxfile LF where LF.fid = LFI.fid and LFI.fid=:fid and LFI.tid=:tid";
$sqltidmax = "select MAX(tid) from linuxfileinfo wher... | true |
58ed13e9f2f58a75759ad9f78f3c7a06d73cb9f8 | PHP | mitchhaley9/UNC-BACS350-2019-Fall | /public_html/bacs350/demo/24/review_views.php | UTF-8 | 3,382 | 2.71875 | 3 | [] | no_license | <?php
require_once 'views.php';
// add_review_form -- Create an HTML form to add record.
// Fields: designer, url, report, score, date
function add_review_form() {
$title = 'Add Review';
$body = '
<form action="insert.php" method="get">
<table class="table ... | true |
d226f8aaba659d29b369687b4ed0d5b3c5030ea7 | PHP | avizoproject/app12oct | /app/models/info_colour.php | UTF-8 | 1,230 | 2.75 | 3 | [] | no_license | <?php
require_once 'info_model.php';
class InfoColour extends InfoModel
{
protected $table_name = 'couleur';
protected $primary_key = "pk_couleur";
protected $pk_couleur = 0;
protected $nom_couleur = '';
function __construct()
{}
function getPk_couleur() {
return $this->pk_couleur;
}
... | true |
f02c8e463eb80e860f885d3698f9e6792e247793 | PHP | luclanet/test-sm | /php/result.php | UTF-8 | 906 | 2.5625 | 3 | [] | no_license | <?php
# Our Current Location
$location = ['51.301819','-0.337613'];
$link = mysqli_connect("localhost","root","luchi1","postboxes");
$result = $link->query("SELECT *,(((acos(sin((".$location[0]."*pi()/180)) * sin((`lat`*pi()/180))+cos((".$location[0]."*pi()/180)) * cos((`lat`*pi()/180)) * cos(((".$location[1]."- `lng... | true |
ef3905828f091cf85a270d05b9d5b64bd072b4a5 | PHP | ValentinCro/api_tournament | /src/InvitationBundle/Dto/InviteDto.php | UTF-8 | 1,331 | 2.5625 | 3 | [] | no_license | <?php
namespace InvitationBundle\Dto;
use JMS\Serializer\Annotation\Type;
use TournamentBundle\Entity\Tournament;
use TournamentBundle\TournamentBundle;
use TournamentBundle\Entity\Rule;
use UserBundle\Entity\User;
class InviteDto
{
/**
* @var string
* @Type("string")
*/
private $senderName;
... | true |
7be3b5802265d5be586d43f6115d4b3c011f9e22 | PHP | vanphen/lap_trinh_java | /test.php | UTF-8 | 801 | 3.765625 | 4 | [] | no_license | <?php
class phen{
public $name;
public function __construct($_name){
return $this->name = $_name;
}
public function setname($_name){
$this->name = $_name;
}
public function getname(){
return $this->name ;
}
public function alo(){
echo "thong bao day la ". $this->name;
}
public function alo... | true |
5c94b40ce5357ab4cbe2ad14c6c9aef27dcb1717 | PHP | AndreyRogatin/php2.dz1 | /App/Db.php | UTF-8 | 664 | 2.9375 | 3 | [] | no_license | <?php
namespace App;
class Db
{
protected $dbh;
public function __construct()
{
$dsn = 'mysql:host=localhost;dbname=php2';
$this->dbh = new \PDO($dsn, 'root', '');
}
public function query($sql, $params = [], $class = '')
{
$sth = $this->dbh->prepare($sql);
$s... | true |
8f9cb51980851014074034612e358101992b6376 | PHP | mauricemugeni/eunique | /modules/classes/Withdrawals.php | UTF-8 | 1,907 | 2.71875 | 3 | [] | no_license | <?php
require_once WPATH . "modules/classes/Settings.php";
class Withdrawals extends Database {
public function execute() {
if ($_POST['action'] == "add_withdrawal") {
return $this->addWithdrawal();
}
}
private function getNextTransactionId() {
$tr... | true |
7c79eff66df9c8686492c5b14895182fcba3cd4a | PHP | CHStudio/Raven | /src/Http/Factory/Headers.php | UTF-8 | 2,436 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace CHStudio\Raven\Http\Factory;
use ArrayIterator;
use InvalidArgumentException;
use IteratorAggregate;
use Stringable;
use Traversable;
/**
* @implements IteratorAggregate<string, array<string>>
*/
class Headers implements IteratorAggregate, Stringable
{
/**
* @var array<string, array<string... | true |
d412339be0dd6ef9a5c54692f54c393443dcb870 | PHP | spider312/mtgas | /includes/classes/ws_index_handler.php | UTF-8 | 7,506 | 2.515625 | 3 | [] | no_license | <?php
use \Devristo\Phpws\Server\UriHandler\WebSocketUriHandler ;
use \Devristo\Phpws\Protocol\WebSocketTransportInterface ;
use \Devristo\Phpws\Messaging\WebSocketMessageInterface ;
class IndexHandler extends ParentHandler {
protected $shouts = array() ;
protected $nbshouts = 50 ; // Max number of shouts to keep in ... | true |
7ea7dd9a5a4e64e1ff68105c5c4711ac7f7350c7 | PHP | juarisco/lv-laratter | /app/Console/Commands/HelloWorldCommand.php | UTF-8 | 815 | 3.0625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class HelloWorldCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'hello:world {argumento1 : Esto será devuelto por panatalla} {--algo : No tiene us... | true |
a7b37164e0b36ea434e00c4162e78081958bb323 | PHP | pacphp/pac | /src/Command/ClearCacheCommand.php | UTF-8 | 1,094 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Pac\Command;
use Pac\Console\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ClearCacheCommand extends Command
{
protected function configure()
{
$this
->setName('cache:clear'... | true |
4785bf95d08d9cc9e8ace38f99dbfa511ed02402 | PHP | anders-lassen/aDev | /node-test/index.php | UTF-8 | 1,039 | 2.65625 | 3 | [] | no_license | <?php
$cwd='/';
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "./tmp/error-output.txt", "a") );
$env = array("NODE_PATH" => "C:/Users/Heidi Tracelink/AppData/Roaming/npm/node_modules","TRACELINK_LOGIN" => "33782837" . ":" . "arl" . ":" . "81dc9bdb52d04dc... | true |
06e5278e914f92dd3b50da80f8e28e333dee2053 | PHP | Josh979/cors-php-handler | /cors.php | UTF-8 | 715 | 2.640625 | 3 | [] | no_license | <?php
// Allow Restricted CORS
if (isset($_SERVER['HTTP_ORIGIN'])) {
$allowedOrigins = [];
$http_origin = $_SERVER['HTTP_ORIGIN'];
$domains = [
'example.com',
'test-domain.com',
];
foreach ($domains as $domain){
array_push($allowedOrigins,'https://'.$domain);
array_pu... | true |
90735dadf4d65089b3c5e5033efa8fc3037f99d2 | PHP | signaturecoder/final_year_project | /login.php | UTF-8 | 3,232 | 2.578125 | 3 | [] | no_license | <?php include 'includes/header.php';
if(isset($_POST['submit'])){
$username = mysqli_real_escape_string($con,strtolower($_POST['username']));
$password = mysqli_real_escape_string($con,$_POST['password']);
$check_username_query = "SELECT * FROM users_details WHERE username ='$username'";
$check_username_run = m... | true |
83a8e55086bc44c6557084d05ed0bc1c2ce41b09 | PHP | Ouz04/base-de-donnees | /src/Entity/Tconnexion.php | UTF-8 | 1,911 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Entity;
use App\Repository\TconnexionRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TconnexionRepository::class)
*/
class Tconnexion
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @O... | true |
3692cbfb6f8415c1234ff539b6f45988b299fdb4 | PHP | wmlavrador/clonarmsg-wpp | /app/Http/Controllers/WhatsappController.php | UTF-8 | 1,581 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class WhatsappController extends Controller
{
private $instanceId;
private $token;
private $urlBase;
private $urlComputed;
public function __construct()
{
$this->instanceId = env... | true |
04242720ce5704a5180355362721bf98eee1aec1 | PHP | rescueDev/php-oop-magazzino | /index.php | UTF-8 | 3,124 | 3.21875 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Magazzino</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
background-c... | true |
713746bc8262ce9f704428cf253fa532b2aa2f08 | PHP | lukex4/wpdb-unicorn | /wpdb-unicorn/lib/exception.php | UTF-8 | 177 | 2.640625 | 3 | [] | no_license | <?php
set_exception_handler(function(Exception $e){
echo "\033[0;31m";
echo "An error occurred: \n";
echo " " . $e->getMessage();
echo "\033[0m\n";
exit(1);
}); | true |
fb041df9c232237cfc815c06b342c8aea79e2000 | PHP | DarusX/english | /database/migrations/2018_02_09_140444_create_students_table.php | UTF-8 | 1,479 | 2.609375 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('students', fun... | true |
5c2d9217f1e4f19eef8a65f9ef5a6336f8e52823 | PHP | VinayBanakar/Smart-captive-portal | /statustable.php | UTF-8 | 1,999 | 2.71875 | 3 | [] | no_license | <!Doctype html>
<table border="1" id="table">
<p> <tr><th bgcolor="#9999FF"></th><th bgcolor="#9999FF">URL</th><th bgcolor="#9999FF">status</th><th bgcolor="#9999FF">Block score</th>
<th bgcolor="#9999FF">Unblock score</th><th bgcolor="#9999FF">id</th>
</p>
</tr>
<?php
$servername = "localhost";
$... | true |
940bf68022573ca39e229c141372e270f159c7b1 | PHP | nathan-collins/Pennants | /app/database/migrations/2014_02_03_151956_create_matches_table.php | UTF-8 | 653 | 2.5625 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateMatchesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('matches', function(Blueprint $table) {
$table->increments('id');
$table->i... | true |
5db499455c31950a3a6556e0595a7483b94d2b72 | PHP | navneil-naicker/php-validation-class | /class.validation.php | UTF-8 | 5,226 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | <?php
class cx_validate{
public $request = array();
public $rules = array();
public $cluster = array();
public $messages = array();
//Cluster all the request and rules
public function cluster(){
$request = $this->request;
$rules = $this->rules;
foreach($r... | true |
4f60e172673bfdb9dc04c11eea9e91e61987fde5 | PHP | Gregwar/Formidable | /Language/Spanish.php | UTF-8 | 1,705 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace Gregwar\Formidable\Language;
class Spanish extends Language
{
protected $messages = array(
'read_only' => 'El campo %s es de sólo lectura y no debe ser cambiado',
'value_required' => 'Se debe introducir un valor para el campo %s',
'bad_format' => 'El formato del campo %s es... | true |
5f1539b7f6d8eff30b1f51cf165a0fba82042c38 | PHP | waka-ken/worksample02 | /app/Http/Controllers/UserController.php | UTF-8 | 3,192 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Recipes;
use App\Services\SocialService;
class UserController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
... | true |
e9833b11e3a08f962aa410219b487941e556e18f | PHP | DimmNet/news-portal | /app/News.php | UTF-8 | 2,189 | 2.75 | 3 | [] | no_license | <?php
namespace App;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class News extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'title', 'body', 'image',
];
/**
* Получить... | true |
362e93ad18675bacaeb8e7fec69ab591f9a38ce7 | PHP | VardanPogh/phpmvc | /app/models/User.php | UTF-8 | 1,127 | 2.921875 | 3 | [] | no_license | <?php
class User {
private $name = 'User Name';
public function __construct()
{
$this->db = new DB;
$this->table = 'users';
}
public function logout()
{
try {
unset($_SESSION["username"]);
session_destroy();
return true;
}catch... | true |
1e5ccc3adf408f67d25ae4a2e827a9751a91a4d3 | PHP | jwatkin423/projects | /tools-master/app/Models/TestPhoneApi.php | UTF-8 | 2,655 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Models;
class TestPhoneApi extends TestApiRequest {
protected $fillable = ['api_id', 'search', 'env', 'action', 'location', 'api_key', 'source', 'category'];
public function getSearchAttribute($attr) {
return $attr ? $attr : 'auto repair';
}
public function apiKey() {
... | true |
4eb6fe7bae83d1a7d5f3862393faceb78bc021bb | PHP | Chili718/dynamicSite | /php/verify.php | UTF-8 | 1,293 | 2.546875 | 3 | [] | no_license | <?php
if(isset($_GET['vkey'])){
//?vkey=852e9650ab350b95c7b5bbd2ec7c4d31
//session_start();
//connect to database
require 'dbCON.php';
if (!$con) {
$dbf = "Oh no, looks like its the internet or me.";
}else{
$stmt = $con->prepare("SELECT vkey, verified FROM userst WHERE verified = 0 AND vkey=? LI... | true |
33b5af646f61cfc3e47bb907adaea31647d1889a | PHP | glorifiedKing/bustravel | /src/ReportsRoutesTraffic.php | UTF-8 | 9,580 | 2.65625 | 3 | [] | no_license | <?php
namespace glorifiedking\BusTravel;
use Carbon\CarbonPeriod;
use glorifiedking\BusTravel\Booking;
class ReportsRoutesTraffic
{
public static $CreatedAt="created_at",$Status="status",
$RoutesDepartureTimeId='routes_departure_time_id',
$StartDayTime=' 00:00:00', $EndDayTime=' 23:59:59',
$route_type ="ro... | true |
421f2e8aed5cd79b61af6aeebba664993ed77b5c | PHP | deedy/phabricator | /src/applications/drydock/query/DrydockLogQuery.php | UTF-8 | 1,898 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | <?php
final class DrydockLogQuery extends PhabricatorOffsetPagedQuery {
const ORDER_EPOCH = 'order-epoch';
const ORDER_ID = 'order-id';
private $resourceIDs;
private $leaseIDs;
private $afterID;
private $order = self::ORDER_EPOCH;
public function withResourceIDs(array $ids) {
$this->resourc... | true |
624582919a6bb6743e58405cbebbe11ee8968f74 | PHP | funkygao/phpservlet | /main/DHttp_Cookie.php | GB18030 | 5,643 | 3.109375 | 3 | [] | no_license | <?php
/**
* php cookieݺmeta infoķװ.
*
* ֧chain method
* <code>
* $cookie = new DHttp_Cookie('_user', 'anonymouse');
* $cookie->domain('.kaixin001.com')->expire(time() + 1)->httponly(true)->secure(true);
* </code>
*
* @category http
* @package http
* @version $Id:$
* @author gaopeng <gaopeng@corp.kaixin001.c... | true |
3759ea46e29ce92f4a1a9319792c4ed51d8f972b | PHP | JoaoPauloAntunes/WEB | /_1_PHP/input-treatment.php | UTF-8 | 2,558 | 2.96875 | 3 | [] | no_license | <?php
// Input sanitize
function filterNumber($fieldName)
{
return preg_replace(
'/[^0-9]/',
'',
filter_input(INPUT_POST, $fieldName)
);
}
function filterText($fieldName)
{
return filter_var(trim(filter_input(INPUT_POST, $fieldName)), FILTER_SANITIZE_STRING);
}
function filterEmail... | true |
bfea90092abff372b2e78a105f766a1b08720f61 | PHP | winkbrace/oracle | /tests/unit/FetcherTest.php | UTF-8 | 8,704 | 2.71875 | 3 | [] | no_license | <?php
use Oracle\Connection;
use Oracle\Query\Binder;
use Oracle\Query\Fetcher;
use Oracle\Query\Statement;
class FetcherTest extends PHPUnit_Framework_TestCase
{
/** @var Statement */
protected $statement;
/** @var Fetcher */
protected $fetcher;
public function setUp()
{
$this->state... | true |
541af48a184b90dc7c690f8f3a1426c4304bea90 | PHP | StyvenSoft/initial-php-project-test | /LESSON3/OrderOperations.php | UTF-8 | 203 | 3.53125 | 4 | [] | no_license | <?php
echo 2 + 3 + 4 + 5 - 1.1; // Prints: 12.9
echo 2 * 9 / 6; // Prints: 3
echo 1 + 3 * 9; // Prints: 28
echo (1 + 3) * 9; // Prints: 36
echo 94 - 4.25 + 7 - 23.50 * 1.2 + 20 / 4; // Prints: 92.35 | true |
1c778cf88452938517df4d84d04b6c3bba621b5a | PHP | grocal-speednet/vies | /src/Vies/Validator/ValidatorES.php | UTF-8 | 3,450 | 3.296875 | 3 | [
"MIT"
] | permissive | <?php
declare (strict_types=1);
/**
* \DragonBe\Vies
*
* @author Paweł Krzaczkowski <krzaczek+github@gmail.com>
* @license MIT
*/
namespace DragonBe\Vies\Validator;
/**
* Class ValidatorES
* @package DragonBe\Vies\Validator
*
* VAT format: [C1 C2 C3 C4 C5 C6 C7 C8 C9]
*
* Range:
* C1, C9 Alphanum... | true |
314fe253c19d4da039a819f766371e2adb94be56 | PHP | nataki/yiiexample | /protected/models/users/Member.php | UTF-8 | 2,158 | 2.75 | 3 | [] | no_license | <?php
/**
* This is the model class for site member users.
*
* The followings are the available columns in table 'user':
* @property integer $id
* @property string $name
* @property string $email
* @property string $create_date
* @property integer $status_id
* @property integer $group_id
*
*/
... | true |
a25e3069f0ebc56b1779c32279cba62d274bff24 | PHP | itcreator/custom-cmf | /Module/View/src/Cmf/View/Engine/AbstractEngine.php | UTF-8 | 1,015 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* This file is part of the Custom CMF.
*
* @link https://github.com/itcreator/custom-cmf for the canonical source repository
* @copyright Copyright (c) 2011 Vital Leshchyk <vitalleshchyk@gmail.com>
* @license https://github.com/itcreator/custom-cmf/blob/master/LICENSE
*/
namespace Cmf\View\Engin... | true |
65f8a5217591a3ca9ad0b09fd266d2685567b077 | PHP | shubhamjuneja11/ecraftdb2 | /include/DB_Connect.php | UTF-8 | 230 | 2.75 | 3 | [] | no_license | <?php
class DB_Connect{
private $con;
function __construct(){
require_once 'Config.php';
$this->con=mysqli_connect(DB_SERVER,DB_USER,DB_PASSWORD,DB_DATABASE);
}
public function connect(){
return $this->con;
}
}
?> | true |
2acc7ea6298b93daac213d6754aa5f806298a2e0 | PHP | zhaiyaoyu/zyy | /test19.php | UTF-8 | 211 | 3.25 | 3 | [] | no_license | <?php
$arr = [5,8,2,4,3,6,9,10,12];
$num = 9;
function find($arr,$num)
{
$son = [];
foreach($arr as$k=>$v)
{
if($num==$v)
{
echo $k;
}
}
}
print_r(find($arr,$num));
?> | true |
a5d29ce613951c896d776ffdd6ded484bcfeccbe | PHP | Wujidadi/MyPHPLibrary | /Files/Excel.php | UTF-8 | 3,436 | 3.4375 | 3 | [] | no_license | <?php
if (!function_exists('ExcelColumnToNumber'))
{
/**
* 將 Excel A1 參照樣式中的欄位序號轉為數字(Office 2019 的最大值為 XFD = 16384)
*
* @param string $Column 欄位序號
* @return integer|boolean
*/
function ExcelColumnToNumber($Column)
{
$ColumnChar = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$Nu... | true |
2cf6c9dd252f9ecc9a94785dc0c85c3061900962 | PHP | laminas/laminas-developer-tools | /src/View/Helper/Time.php | UTF-8 | 781 | 3.0625 | 3 | [] | permissive | <?php
declare(strict_types=1);
namespace Laminas\DeveloperTools\View\Helper;
use Laminas\View\Helper\AbstractHelper;
use function sprintf;
class Time extends AbstractHelper
{
/**
* Returns the formatted time.
*
* @param integer|float $time
* @param integer $precision Will only be us... | true |
ad6507dd1693c46e81741794aba594c4f78e5f0a | PHP | jneslen/pixeltenchi_raw | /modules/kacela/vendor/Gacela/library/Gacela/Field/String.php | UTF-8 | 488 | 2.796875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
/**
* @author noah
* @date 3/19/11
* @brief
*
*/
namespace Gacela\Field;
class String extends Field {
public static function validate($meta, $value)
{
if(empty($value)) {
if(!$meta->null) {
return self::NULL_CODE;
}
return $meta->null;
}
if(strlen($value) <= $meta->length || is_null(... | true |
014d93229e3f9a1a5975608fd5a5e55351fa01dc | PHP | GAGV0289/Proyecto-German- | /save_task.php | UTF-8 | 361 | 2.59375 | 3 | [] | no_license | <?php
include("db.php");
if (isset($_POST['save_task'])) {
$firstName = $_POST['first_Name'];
$lastName = $_POST['last_Name'];
echo $firstName;
echo $lastName;
$query = "INSERT INTO empleados(lastname, firstname) VALUES ('$lastName', '$firstName')";
$result = mysqli_query($conn, $query);
if (!$result) {
die... | true |
f19224b7e5a9535c37d949159739c5abdd2cacf2 | PHP | yfix/yf_utf8_funcs | /utf8_unescape.php | UTF-8 | 1,557 | 2.859375 | 3 | [] | no_license | <?php
/**
* Функция декодирует строку в формате %uXXXX в строку формата UTF-8.
* Функция работает без использования библиотеки iconv!
*
* Функция используется для декодирования данных типа "%u0442%u0435%u0441%u0442",
* закодированных устаревшей функцией javascript://encode().
* Рекомендуется использовать функцию... | true |
bf0fc60b714cd1110ac2901dc920aa52bd07f397 | PHP | jdevcomua/demo | /database/migrations/2018_07_19_000007_create_animals_table.php | UTF-8 | 2,142 | 2.546875 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAnimalsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('animals', funct... | true |
5404314482177139827339f33c28323f569a1f20 | PHP | LubosRemplik/CakePHP-TinyAdmin-Plugin | /Controller/Component/AdminComponent.php | UTF-8 | 2,989 | 2.53125 | 3 | [] | no_license | <?php
class AdminComponent extends Component {
public $components = array(
'Session',
'Cookie',
);
public function __construct(ComponentCollection $collection, $settings = array()) {
$this->controller = $collection->getController();
$this->components['Auth'] = Configure::read('TinyAdmin.Auth');
parent::... | true |
d940d23b346dce82f6b1ef356fd63e942be2b567 | PHP | davajlama/Schemator | /Schema/src/Rules/Email.php | UTF-8 | 681 | 2.75 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Davajlama\Schemator\Schema\Rules;
use Davajlama\Schemator\Schema\Exception\PropertyIsNotStringException;
use Davajlama\Schemator\Schema\Exception\ValidationFailedException;
use Davajlama\Schemator\Schema\Validator\Message;
use function filter_var;
use function is_string;
cl... | true |
4145c0a093678978df80227279d19955b3490379 | PHP | DEXZBITZ/WavesPhpAPI | /src/Matcher.php | UTF-8 | 2,595 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Wavesnode API request wrapper for decentralized exhange (matcher)
*
* @author Vladimir Vyatkin <voldemarpro@hotmail.com>
* @copyright Copyright (c) 2017-2018 Vladimir Vyatkin
* @link https://github.com/voldemarpro/WavesPhpAPI
* @see https://github.com/wavesplatform/Waves
*/
namespa... | true |
5ed8cbe8628d5a014fb97d0c6d9a70981f9e5907 | PHP | kdyrovadd/inf232--190103436- | /routes/web.php | UTF-8 | 2,474 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
use App\Models\Student;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes... | true |
0a6e79ca2cf54efa28f4be23e381380bc6173016 | PHP | artlines/useragent | /app/Http/Middleware/StoreReferralCode.php | UTF-8 | 826 | 2.703125 | 3 | [] | no_license | <?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cookie;
class StoreReferralCode
{
/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @return mixed
*/
public function handle($request... | true |
8d4e51e2cbd93b6e3dbe7fabd7b87b726ace0923 | PHP | mrashidcit/azzuha-lms | /app/Http/Controllers/studentSubjectsController.php | UTF-8 | 2,970 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\studentSubjects;
use Illuminate\Http\Request;
use App\students;
use App\subject;
use App\User;
class studentSubjectsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public functio... | true |
795864f8844732a515f6f65eb5017dc8f513f2bd | PHP | paschaldev/eloquent-translate | /src/Commands/TranslateCommand.php | UTF-8 | 2,386 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace PaschalDev\EloquentTranslate\Commands;
class TranslateCommand extends BaseCommand {
public function __construct()
{
parent::__construct();
}
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'eloquent-trans... | true |
02131f92ad8ae62ddf453197f75b24bb88b21b69 | PHP | aniliso/employee-module | /Events/EmployeeWasDeleted.php | UTF-8 | 771 | 2.953125 | 3 | [] | no_license | <?php namespace Modules\Employee\Events;
use Modules\Media\Contracts\DeletingMedia;
class EmployeeWasDeleted implements DeletingMedia
{
private $employeeId;
private $employeeClass;
/**
* EmployeeWasDeleted constructor.
* @param $employeeId
* @param $employeeClass
*/
public functio... | true |
9539cffb20cd65dc8a73aa08a35336ff9ec056ef | PHP | andrmax/web181 | /home-work/2018-07-10/kazakov_(time_definition)/form.php | UTF-8 | 1,006 | 3.171875 | 3 | [] | no_license | <?php
require 'function.php';//подключаем файл с функциями
$array = array();//создаем массив из тысячи рандомных значений
for ($i = 0; $i <=1000; $i++) {
$array[] = rand(0, 1000);
};
//далее условие: выодим форму если $_POST['numeric'] пуст или резултат поиска (ф-ия time_definition)
if (empty($_POST)){?>
<h1>Пр... | true |
d705ac4d533a585d13331f0c5d17317605b0b123 | PHP | Magnero98/PHP_Online_Shop | /Service/ColorService.php | UTF-8 | 1,632 | 2.625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: User
* Date: 6/12/2018
* Time: 2:30 PM
*/
include_once '../Repository/ColorRepository.php';
if($_GET["request"] == "insertColor")
{
$colorName = $_GET["ColorName"];
$colorCode = $_GET["ColorCode"];
echo "insertColor(" . ColorRepository::insertColor($colorName... | true |
0481d7098a79789a797d81be98f7f05e42e2a03d | PHP | jdauie/bramble | /Core/Routing/Route.php | UTF-8 | 4,281 | 2.71875 | 3 | [] | no_license | <?php
namespace Jacere\Bramble\Core\Routing;
use Jacere\Bramble\Core\Request;
class Route {
const REGEX_KEY_NAME = '[a-zA-Z-_]++';
const REGEX_ESCAPE = '[.\+*?[^\]${}=!|]';
const R_LITERAL = '';
const R_ANYTHING = '[^/]++';
const R_UUID = '[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}';
const R_NAME... | true |
9a67bf042fa529d59df3ac8997d0c85a43a9a930 | PHP | ishunko/hubzero-cms | /core/plugins/user/domainrestriction/fields/widget.php | UTF-8 | 1,019 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
/**
* @package hubzero-cms
* @copyright Copyright 2005-2019 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Hubzero\Form\Fields;
use Hubzero\Form\Field;
use Lang;
/**
* Renders input for a widget
*/
class Widget extends Field
{
/**
* The form field type.
... | true |
d2eef47f1c34e4b5210659285c310becd7e9c308 | PHP | SitiNuriaR/TUGAS-AKHIR-WEB-DNA | /WEB/login.php | UTF-8 | 729 | 2.71875 | 3 | [] | no_license | <?php
session_start(); // Memulai Session
$error=''; // Variabel untuk menyimpan pesan error
if (isset($_POST['submit'])) {
if (empty($_POST['username']) || empty($_POST['password'])) {
$error = "Username or Password is invalid";
}
else
{
// Variabel username dan password
$username=$_POST['username'];
$password=$_POST[... | true |
95a2ea1f20293ee72edb84accaa430d3b91e2687 | PHP | vincedotnet/vr | /library/Angel/Service/Image.php | UTF-8 | 9,904 | 2.875 | 3 | [] | no_license | <?php
class Angel_Service_Image {
const POSITION_CENTER = 'center';
const POSITION_TOP_LEFT = 'top_left';
const POSITION_BOTTOM_RIGHT = 'bottom_right';
const NOT_SUPPORTED_IMAGE_TYPE = 'Angelhere only accepts JPG and PNG image';
protected $_bootstrap_options;
protected $_utilService;
pub... | true |
ba962216c6cd4b642ee6b6ac1b3858da9561496a | PHP | torresf/imac_td_php | /TD4/Cast/cast.php | UTF-8 | 1,492 | 3.359375 | 3 | [] | no_license | <?php
require_once "Cast.class.php";
require_once "../Movie/Movie.class.php";
echo '<a href="../Movie/movies.php">Retour à la liste des films</a><br/><br/>';
if (isset($_GET['id'])) {
$id = $_GET['id'];
if (isset($id) && !empty($id)) {
try {
// Instanciation d'un objet Cast
$cast = Cast::createFromId($id)... | true |
0e1c9f802c46120dd63a0404792f5bb46b8eca2c | PHP | tarkoff/ptacms | /branches/library/KIT/Catalog/DbTable/Price.php | UTF-8 | 2,467 | 2.625 | 3 | [] | no_license | <?php
/**
* Catalog Price Database Table
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
*
* @category KIT
* @package KIT_Catalog
* @copyright Copyright (c) 2009-2010 KIT Studio
* @license New BSD License
* @version ... | true |
e1bd983ed96278d7b7016dec37dc9cb9bea5bd16 | PHP | Al-aminedioubate/Let-Talk | /php/login.php | UTF-8 | 779 | 2.765625 | 3 | [] | no_license | <?php
session_start();
include_once "config.php";
$email = mysqli_real_escape_string($conn, $_POST['email']);
$password = mysqli_real_escape_string($conn, $_POST['password']);
if(!empty($email) && !empty($password)){
//Pour la connection on verifie si l'email entrer par user correspond a c... | true |
2890680041befc4b6ca86784477faa57dc4165a3 | PHP | abcd1236542000/laravel_heroku_base | /app/Services/HttpClient/CurlClientService.php | UTF-8 | 6,071 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Services\HttpClient;
//http://docs.guzzlephp.org/en/stable/
//http://guzzle-cn.readthedocs.io/zh_CN/latest/index.html
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\RequestException;
use Validator;
use Log;
class CurlClientService
{
protected $httpc... | true |
5c1aef0fb3f44b27c11b81e731e07129bf7c8744 | PHP | RosasMartin/VIvexWeb | /php/ajax/ajax_popup_suscripcionInsti.php | UTF-8 | 1,480 | 2.53125 | 3 | [] | no_license | <?php
if(isset($_POST['colegio'])):
//echo "Error: Ya existe un administrador con el mismo correo";
require "conexion.php";
$user = new vivexDB();
//variables generales
$colegio=$_POST['colegio'];
$domicilio=$_POST['domicilio'];
$caracteristica=$_POST['caracteristica'];
$financiamien... | true |
1187b0137aa6c123545a2378e4b8de034722a955 | PHP | Eylyn/Akiba_Store | /src/controller/Controller.php | UTF-8 | 1,080 | 2.578125 | 3 | [] | no_license | <?php
namespace App\src\controller;
use App\config\Request;
use App\src\model\View;
use App\src\DAO\EventDAO;
use App\src\DAO\OrderDAO;
use App\src\DAO\PackageDAO;
use App\src\DAO\ProductDAO;
use App\src\DAO\ReviewDAO;
use App\src\DAO\UserDAO;
abstract class Controller
{
protected $eventDAO;
protected $ord... | true |
54a672859ddb02486706fc59fdd64071b30e86ff | PHP | eferreyro/PHP | /hola_mundo.php | UTF-8 | 437 | 3.15625 | 3 | [] | no_license | <?php
//Esta es una nota simple
#Este es otra nota o comentario Simple en PHP
/*--------------------
Esta es una nota
De multiples lineas
--------------------*/
echo "Hola Mundo";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scal... | true |
989104aa235f87bfa9aa9eb737809f9d1f3c6e8c | PHP | iv660/yavitrina-demo | /components/behaviors/ProcessUsernameBehavior.php | UTF-8 | 848 | 3.078125 | 3 | [] | no_license | <?php
namespace app\components\behaviors;
use yii\base\Behavior;
use app\components\validators\PhoneValidator;
/**
* Behavior for user name processing.
*
* @author Ilya Vikharev
*/
class ProcessUsernameBehavior extends Behavior
{
/**
* Checks if the username field is a valid phone number.
*/
pub... | true |
303f0ca2521c1d3ecd8b78548b7dbf3c4a6f356e | PHP | tiagohenrique92/ppapp | /src/Repositories/TransactionRepository.php | UTF-8 | 1,128 | 2.9375 | 3 | [] | no_license | <?php
namespace PPApp\Repositories;
use PPApp\Models\TransactionModel;
class TransactionRepository implements RepositoryInterface
{
/**
* @var TransactionModel
*/
protected $transactionModel;
public function __construct(TransactionModel $transactionModel)
{
$this->transactionModel =... | true |
02037830ae666d5dc373b24424d2be4f604ef635 | PHP | Evanson-Developer/sup | /registration2/function.php | UTF-8 | 198 | 2.765625 | 3 | [] | no_license | <?php
function shuffle_assoc(&$array) {
$keys = array_rand($array, count($array));
foreach($keys as $key)
$new[$key] = $array[$key];
$array = $new;
return true;
}
?>
| true |
3c5162e4b49655be1f5970ad46557a69d35095f5 | PHP | jwmcpeak/TutsPlus-PHP-Design-Patterns | /factory.php | UTF-8 | 683 | 3.0625 | 3 | [] | no_license | <?php
class DatabaseConfig {
private $timeout;
public function __construct() {
$this->timeout = 20;
}
public function getTimeout() {
return $this->timeout;
}
}
class JsonConfig {
private $timeout;
public function __construct() {
$this->timeout = 20;
}
pu... | true |
e23b5a3cfe315f6bc4e92a7bfbef8ee461b7d8c3 | PHP | Matheus02/DS1 | /PHP/Semana 7/exercicio/resultado.php | ISO-8859-1 | 1,054 | 3.75 | 4 | [] | no_license | <html>
<head>
</head>
<body>
<?php
$pos=0;
$rest=0;
$par=0;
$soma=0;
$num[]=$_GET["n1"];
$num[]=$_GET["n2"];
$num[]=$_GET["n3"];
$num[]=$_GET["n4"];
$num[]=$_GET["n5"];
echo '<h1>Exerccio 1</h1>';
for($i=0;$i<=4;$i++){
$pos = $i+1;
echo "O ".$pos." nmero : ".$num[$i].'<br/>';
$num2[]=$num[$i]*2;
$so... | true |
31db0a403efe100334829fd68697306fe31bb1cc | PHP | michakpl/casper-laravel-api | /app/Services/Event/RemoveEventGuestService.php | UTF-8 | 540 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php namespace App\Services\Event;
use Auth;
use App\Repositories\Interfaces\EventInterface;
class RemoveEventGuestService
{
protected $event;
public function __construct(EventInterface $event)
{
$this->event = $event;
}
public function make($event, string $user_id)
{
$curre... | true |
030fb82916b8d91db30902462c0efa479e3d16c3 | PHP | ncuesta/ncTrackerPlugin | /lib/filter/ncTrackerEntryFormFilter.class.php | UTF-8 | 2,788 | 2.578125 | 3 | [] | no_license | <?php
/**
* ncTrackerEntry filter form.
*
* @package plugins
* @subpackage filter
* @author José Nahuel Cuesta Luengo <nahuelcuestaluengo@gmail.com>
*/
class ncTrackerEntryFormFilter extends BasencTrackerEntryFormFilter
{
private
$user_ids = null,
$module_names = null,
$action_names = nu... | true |
6bb911f0c5af8317c9193f5997d0d160027d30e0 | PHP | gtuxyco/shipping | /src/Tracking.php | UTF-8 | 1,398 | 2.953125 | 3 | [] | permissive | <?php
/**
* Created by PhpStorm.
* User: johan
* Date: 2017-03-07
* Time: 18:06
*/
declare(strict_types = 1);
namespace Vinnia\Shipping;
use DateTimeInterface;
use JsonSerializable;
class Tracking implements JsonSerializable
{
/**
* @var string
*/
public $vendor;
/**
* @var string
... | true |
d9f0cd321036b0ea18dfc9954f8017438aa7b8ca | PHP | marcochirico/paypal | /index.php | UTF-8 | 1,873 | 2.515625 | 3 | [] | no_license | <?php
ini_set('display_errors','on');
error_reporting(E_ALL);
require_once 'vendor/autoload.php';
use PayPal\Api\Amount;
use PayPal\Api\Details;
use PayPal\Api\Item;
use PayPal\Api\ItemList;
use PayPal\Api\Payer;
use PayPal\Api\Payment;
use PayPal\Api\RedirectUrls;
use PayPal\Api\Transaction;
$apiContext = new \Pa... | true |
224e7d33fef15849d05b820db81d5106d4fcfd02 | PHP | Plizi-code/plizi | /backend/database/seeds/PostsTableSeeder.php | UTF-8 | 1,134 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
use App\Models\Community;
use Illuminate\Database\Seeder;
use App\Models\Profile;
use App\Models\User;
use App\Models\Post;
class PostsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$users = User::all();
$c... | true |
f896eea15ba36ed4b7d40fc5c97c32a4ab9ea2aa | PHP | fermeturegarage/dolivel | /src/Client.php | UTF-8 | 160 | 2.609375 | 3 | [] | no_license | <?php
namespace Fermeturegarage\Dolivel;
class Client
{
public function hello(String $sName)
{
return 'Hi ' . $sName . '! How are you doing today?';
}
}
| true |
e0875af5677ba1da65aa8ffaa0f53da9e8b89362 | PHP | erencay/php_okey | /server/src/network/Server.php | UTF-8 | 880 | 2.671875 | 3 | [] | no_license | <?
class Server extends \MMOCore\MMOServer
{
public function __construct()
{
parent::__construct(new PacketHandler());
}
public function start($host, $port)
{
parent::start($host, $port);
}
protected function add_client($socket)
{
$client = new Cli... | true |
6e3aa46397463bf5d9bd1e1373957b25f3ef5d84 | PHP | Next-Tecnologia/youtube-api | /YoutubeAPI/YoutubeService.php | UTF-8 | 744 | 2.921875 | 3 | [] | no_license | <?php
// namespace
use Google_Client;
use Google_Service_YouTube;
final class YoutubeService
{
/**
* searchVideo
*
* @param mixed $query
* @return array
*/
public function searchVideo(string $query): array
{
$DEVELOPER_KEY = env('DEVELOPER_KEY');
$client = new Google_Client();
$client->setDevel... | true |
73c31083320801f9df18eb544efb081c7669737c | PHP | xputerax/aipro-web | /database/migrations/2019_01_28_163751_create_orders_table.php | UTF-8 | 1,053 | 2.546875 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('orders', functio... | true |
a0b1218bdbf48f2d6600fa90a62d2ee291b94b34 | PHP | MARX1108/Arcadian | /app/model/classes/Event.php | UTF-8 | 5,857 | 3.015625 | 3 | [] | no_license | <?php
class Event {
public $id;
public $event_type;
public $user_1_id;
public $user_2_id;
public $story_1_id;
public $story_2_id;
public $data_type;
public $data_2;
public $data_value;
const DB_TABLE = 'event';
const EVENT_TYPE = array(
'add_story' => 201,
'delete_story' => 202,
'edit... | true |