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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7fe00bb50340ef2edf7f718b6d6e8b0c8667c4ca | PHP | sheerikie/PHPractise | /first.php | UTF-8 | 2,326 | 3.171875 | 3 | [] | no_license | <html>
<head></head>
<body>
<form action="first.php" method="post">
<input type="text" name="form">
<input type="submit">
</form>
<?php
class Burnaboy{
var $age;
var $name;
var $nationality;
private $genre;//visibility modifiers, getters and setters
public function __Construct($aname,$aage,... | true |
ab5f908ce91c536f656db9c3d45594c7ca0faf3d | PHP | dravenTherion/ybank | /api/app/Http/Controllers/Transactions.php | UTF-8 | 4,161 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
class Transactions extends Controller{
protected $INSUFFICIENT_BALANCE = -1;
protected $INVALID_ACCOUNT = -2;
protected $INVALID_AMOUNT = -3;
/**
* List an account's transactions
*
... | true |
c0f9a39f2ba9ab0f6aea881fcc9abdeece958934 | PHP | SimonHFL/restock | /app/Infrastructure/Adapters/Adapter.php | UTF-8 | 1,129 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php namespace App\Infrastructure\Adapters;
use Illuminate\Support\Facades\App;
class Adapter {
function __construct()
{
$this->translator = App::make('App\Infrastructure\Transformers\Translator');
}
public function toEntityParameters(array $attributes, $method)
{
$dictionary ... | true |
65c36a8b7636dcb9baa15433ab8f76941d7cd00b | PHP | qinjiaw2019/Software-copyright | /laravelbook/app/Http/Controllers/Book/BookController.php | UTF-8 | 8,411 | 2.625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\Book;
use App\Http\Controllers\BaseController\BaseController;
use App\Http\Model\Book;
use App\Http\Utils\Common;
class BookController extends BaseController{
/**
* 查询图书信息api
* @return string
*/
public function get(){
$book = new Book();
$... | true |
57d5662e7ce42daf8c1e48faa7bb7f1444e8040c | PHP | rayful/toolkit | /src/logPlugin.php | UTF-8 | 2,390 | 3.03125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: kingmax
* Date: 16/7/13
* Time: 下午10:09
*/
namespace rayful\Tool;
trait logPlugin
{
/**
* 帐户日志
* @var array|Log[]
* @name 日志
* @ignore editor
*/
public $logs;
/**
* 最大的日志条数
* @return int
*/
abstract function maxLo... | true |
82963062a4081e24d06004b3cdd9c5418505a060 | PHP | mezvrishvili/BOGtest | /class/security.class.php | UTF-8 | 715 | 2.515625 | 3 | [] | no_license | <?php if(!defined("PROTECT")) { exit("STOP!"); }
//-- interface
interface iSecurity {
static function filter_text($text_data);
}
class Security implements iSecurity {
static function filter_text($text_data) {
$text_data = htmlspecialchars($text_data);
$text_data = trim($text_data);
$text_data ... | true |
b1f255c27cae788fe1f048b5457520642bf14a48 | PHP | arifsamisahin/student130418 | /functions/addParent.php | UTF-8 | 1,053 | 2.53125 | 3 | [] | no_license | <?php
require_once '../core/init.php';
global $connect;
$s_id = $_POST['s_id'];
$u_id = $_POST['u_id'];
$name = $_POST['name'];
$job = $_POST['job'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$relation = $_POST['relation'];
if(studentExistInUser($s_id, $u_id) === TRUE){
if(isStude... | true |
a1583ce2d0eaf0b4a1c9081a31462bb6190c22b8 | PHP | Koji1018/e-reserve | /app/Http/Controllers/UsersController.php | UTF-8 | 1,125 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User; // 追加
class UsersController extends Controller
{
// ユーザ一覧画面の表示用
public function index()
{
// ユーザ一覧をnameの昇順で取得
$users = User::orderBy('name', 'asc')->paginate(10);
// ユーザ一覧ビューでそれを表示
r... | true |
d39281d4d9bfd1bdb86b32f39d82398838dcc60f | PHP | ricoping/php-learning | /php_form/form3.php | UTF-8 | 1,343 | 2.71875 | 3 | [] | no_license | <?
session_start();
if(isset($_SESSION, $_POST) && ($_POST["token"] === $_SESSION["token"])){
$name = $_SESSION["name"];
$email = $_SESSION["email"];
$subject = $_SESSION["subject"];
$body = $_SESSION["body"];
unset($_SESSION['token']);
$dsn = 'mysql:dbname=contact_form;host=localhost;charset=utf8';
$user =... | true |
144d6f3931903504e75f5e7008147421ce3a7418 | PHP | donnysim/ethereal-laravel | /src/Bastion/Exceptions/InvalidAuthorityException.php | UTF-8 | 305 | 2.546875 | 3 | [] | no_license | <?php
namespace Ethereal\Bastion\Exceptions;
use Exception;
class InvalidAuthorityException extends Exception
{
/**
* InvalidAuthorityException constructor.
*
* @param string $message
*/
public function __construct($message)
{
$this->message = $message;
}
}
| true |
cfefe87c873b5834edb65a450578e1f00952f569 | PHP | zhouchang2017/erp | /app/Modules/Order/Enums/OrderStatus.php | UTF-8 | 2,541 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Modules\Order\Enums;
use BenSampo\Enum\Enum;
final class OrderStatus extends Enum
{
const PENDING = 0; //等待买家付款
const UNSHIPPED = 1; //买家已付款,等待卖家发货
const PARTIALLY_SHIPPED = 2; //部分发货
const SHIPPED = 3; //已发货
const CANCEL = 4; ... | true |
162ce127ab55b09f6129fce171c80ba161ab3a8a | PHP | Cindy-Clijsters/Pizza | /App/Entities/Person.php | UTF-8 | 3,008 | 3.390625 | 3 | [] | no_license | <?php
declare(strict_types = 1);
namespace App\Entities;
abstract class Person
{
private $id;
private $lastname;
private $firstname;
private $address;
private $city;
private $phone;
/**
* Constructor function
*
* @param int $id
* @param string $lastname
* @p... | true |
10eb8cb86861bbadf37df96b779e1aee817bda23 | PHP | clay0052/post | /blog/error.php | UTF-8 | 521 | 2.953125 | 3 | [] | no_license | <?php
require_once "config.php";
/**
* 1. Set the HTTP Status to 404 using the header function.
*/
header("HTTP/1.0 404 Not Found");
echo "PHP continues.\n";
die();
echo "Not after a die, however.\n";
/**
* 2. Add a title and message to the $page array to inform the user that
* the post or page could not be found.
*/... | true |
fe179b34013b71b235c5c9cfefe774369a864628 | PHP | vitaly-alexandrovich/http-client | /src/testcase/TestCase.php | UTF-8 | 1,914 | 2.921875 | 3 | [] | no_license | <?php
namespace HttpClient\testcase;
use HttpClient\Response;
use Throwable;
class TestCase implements TestCaseInterface
{
/** @var Throwable */
protected $exception = null;
protected $replaceResponse = true;
protected $response = null;
protected $options = [];
/**
... | true |
b56949238d137f39465cfd53b7187f191b2e1065 | PHP | Nanolucas/Cryptr | /src/AppBundle/Classes/Algorithm/AlgorithmInterface.php | UTF-8 | 388 | 2.921875 | 3 | [] | no_license | <?php
namespace AppBundle\Classes\Algorithm;
/**
* Interface for each encryption algorithm
*
* @package Cryptr
* @author Luke Doherty <nanolucas@gmail.com>
* @version 1.0
*/
interface AlgorithmInterface {
//set the difficulty level of the encryption
public function difficulty($level);
//encode ... | true |
9e87599fc956a23a907bcb550f225d7a7c1a025c | PHP | HeliosDX/BlogWim1 | /src/Helios/BlogBundle/Chat/FOSUserProvider.php | UTF-8 | 2,464 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace Helios\BlogBundle\Chat;
use Ratchet\ConnectionInterface;
use Ratchet\MessageComponentInterface;
use Ratchet\WebSocket\WsServerInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* This component will allow access to user d... | true |
4063bd9c000438296701ffc5ceb12452e664d9bf | PHP | estuarjosm/parcial | /tests/UsuarioTest.php | UTF-8 | 802 | 2.859375 | 3 | [] | no_license | <?php
use PHPUnit\Framework\TestCase;
use App\Usuario;
class UsuarioTest extends TestCase{
public function test_ingreso_datosUsuario(){
$uNombre = "Amanda Rodriguez";
$uCorreo = "amanda@outlook.com";
$uRol = 2;
$uContra = "12345a";
$usuario1 = new Usuario();
$usuario1->setNombreU($uNombre);
$usuario... | true |
03528e81513d3898c04fba469748f9d1e71c9522 | PHP | phpsmarter/Imprinter | /include/database.php | UTF-8 | 9,218 | 3.21875 | 3 | [
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
/**
* This database class handles all interactions (queries, connections)
* with the mySQL database. This classes is designed as a Singleton object.
*
* Originally written in 2009. Modified for Imprinter.
*
* @package imprinter
* @author rye
* @version 1.1
*/
class Database {
private $dbh;
private ... | true |
f9aeacbe80d77fb03dcbc72f6267a089ed7a3e2d | PHP | ratiw/l3-petro | /bundles/petro/libraries/grid.php | UTF-8 | 10,463 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-dco-1.1"
] | permissive | <?php
namespace Petro;
class Grid
{
protected $model = null;
protected $fields = null;
protected $summary = array();
// protected $petro_app = null;
protected $pagination = null;
protected $scopes = null;
// when not empty, must be in the following format
// array('col' => <sort-column-name>, 'dir' => <... | true |
e52e9aa1ff232088e7ec889571c854058f4e8bda | PHP | snydez/jurnal | /clasz/twittercard.class.php | UTF-8 | 999 | 2.796875 | 3 | [
"CC-BY-3.0"
] | permissive | <?php
include_once("template.class.php");
include_once("errors.class.php");
class TwitterCard {
var $strTemplateName;
var $TitleTC;
var $DescriptionTC;
var $ImageTC;
var $PermalinkTC;
var $template;
function __construct($intDebugl=0){
}
function setTemplate($fulltemplatename) {
$this->strTempla... | true |
6438023192c8415e71728da4f0bee03c19183de4 | PHP | khisby/Ayana-Tour | /beranda.php | UTF-8 | 2,754 | 2.578125 | 3 | [] | no_license | <?php
if(isset($_SESSION['anggota'])){
$anggota = $_SESSION['anggota'];
$aa = mysql_query("SELECT * from tbl_anggota where email='$anggota'");
$daa = mysql_fetch_array($aa);
}
?>
<?php
if(isset($_GET['c'])){ ?>
<h3>HASIL PENCARIAN ANDA</h3>
<?php }
?>
<div id="ccl">
<?php
if(isset($_GET['c'])){
$c =$_GET['c']... | true |
c4d081431b0f717b4ccf049ca497f465abde5cf7 | PHP | Dric/Poulpe2 | /classes/SSH/SSH.php | UTF-8 | 5,965 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Creator: Dric
* Date: 17/11/2016
* Time: 09:48
*/
namespace SSH;
use Exception;
use Logs\Alert;
/**
* Classe de connexion à une session SSH
*
* Pré-requis : Sur ubuntu, il suffit d'installer le package ssh2 pour PHP avec :
*
* sudo apt install php-ssh2
* sudo service apache2 restart
*
... | true |
a89105451d33d6208b93980261fec58af1575e19 | PHP | MuhummadJISHOHAG/logingRegister | /index.php | UTF-8 | 2,401 | 2.609375 | 3 | [] | no_license | <?php
session_start();
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login.php');
}
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: login.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
... | true |
8b63ae8769e568397afa2410fa8ff489596ed7d1 | PHP | ljphalen/jinli | /gamedev89/Source/Lib/Helper/ApkHelper.class.php | UTF-8 | 1,658 | 2.578125 | 3 | [] | no_license | <?php
/**
* 生成应用文件的存放目录,及访问链接
* 'FILE_PATH_DIR' => '/files/Data/Attachments/dev/', //应用文件存放路径,保留反斜杠 x/x/b/a.pdf
* 'FILE_PATH_URL' => 'http://1.cdn.gionee.com/dev/', //应用文件访问URL,保留反斜杠 x/x/b/a.pdf
* 'GAMEDL_PATH_URL' => 'http://gamedl.cdn.gionee.com/dev/', //apk包跟差分文件访问URL,保留反斜杠 x/x/b/a.pdf
... | true |
98d7a3c280f443e36bc94779a00bb7803e652d82 | PHP | BookUnited/http | /src/Middlewares/MiddlewareInterface.php | UTF-8 | 281 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace BookUnited\Http\Middlewares;
use Psr\Http\Message\RequestInterface;
interface MiddlewareInterface
{
/**
* @param RequestInterface $request
* @return RequestInterface
*/
public function handle(RequestInterface $request): RequestInterface;
} | true |
7c0ea3cd8e7edbcc810949ef59b58e2fcf57cc90 | PHP | Bit-Wasp/secp256k1-php | /examples/ecdsa_sign.php | UTF-8 | 589 | 2.53125 | 3 | [
"Unlicense"
] | permissive | <?php
$context = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
$msg32 = hash('sha256', 'this is a message!', true);
$privateKey = pack("H*", "88b59280e39997e49ebd47ecc9e3850faff5d7df1e2a22248c136cbdd0d60aae");
/** @var resource $signature */
$signature = null;
if (1 !== secp256k1_ecdsa... | true |
64658de9c9d107f2de4a2ab603d8fb8c863021e1 | PHP | stephanedhml/APP-Welchome | /fichiers_php/modeles.php | UTF-8 | 2,918 | 2.515625 | 3 | [] | no_license | <?php
require("config.php");
//Fonction de annonce.php
function recherche_annonce()
{
global $bdd;
$annonce = htmlspecialchars($_GET['id'] );
$recherche_id =$bdd->query("SELECT * FROM logement NATURAL JOIN Photo WHERE id=$annonce ");
$donnees = $recherche_id->fetch();
return $donnees;
}
//Fonctio... | true |
e90af0fe0e7526b48f6ea5aa3df9745f27b5e896 | PHP | google-code/51angle | /angle/models/doctorAccount.class.php | UTF-8 | 1,134 | 2.546875 | 3 | [] | no_license | <?php
require_model('base.class');
class doctorAccount extends base {
private $table = 'DoctorAccount';
private $primary = 'Id';
function __construct() {
parent::__construct($this->table,$this->primary);
}
function GetBalanceByPatientId($patientId){
return $this->get_item(ar... | true |
ca3bb436d746be556d7a1e2c648c3c3b27f3a06e | PHP | nicola72/library | /src/File/FileManager.php | UTF-8 | 11,625 | 2.984375 | 3 | [] | no_license | <?php
namespace File;
use File\Model\File;
use Utils\Utils;
use Utils\Log;
class FileManager
{
const _TABLE = 'tb_file';
/**
* @var \PDO
*/
protected $conn;
protected $message;
protected $seo_prefix = '';
protected $filePath;
protected $nomeFile;
protected $estensioneF... | true |
558cb6903d361e5df1ccc55d04acafd952c3c970 | PHP | zihanZhao1/Group7 | /DUS_user/php/register.php | UTF-8 | 7,138 | 2.671875 | 3 | [] | no_license | <?php
$msg="";
require"conn.php";
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
$msg = "";
if (isset($_POST['submit']))
{
//collect the data with $_POST
$name=$_POST["name"];
$email=$_POST["email"];
$password=$_POST["password"];
$password1=$_POST["password1"... | true |
4231c26506a0fdd5f50f27be734ed1b217902a80 | PHP | fastnorth/property-mapper | /src/FastNorth/PropertyMapper/Transformer/TransformerInterface.php | UTF-8 | 562 | 2.71875 | 3 | [] | no_license | <?php
namespace FastNorth\PropertyMapper\Transformer;
/**
* TransformerInterface
*
* Transformer for property values
*/
interface TransformerInterface
{
/**
* Transform a value
*
* @param mixed $value
* @param array|object $context the "from" side of the mapping
*/
public f... | true |
a42e0bc340d0d7fa143d75dba08a169d931d951d | PHP | Recol/gamesdb | /display.php | UTF-8 | 533 | 2.59375 | 3 | [] | no_license | <?php
require('connect.php');
?>
<!DOCTYPE html>
<head>
<title>Something</title>
</head>
<body>
<?php require('nav.php');
session_start();
?>
<h1>
Display Records
</h1>
<?php
if(isset($_SESSION['admin'])){
$stmt=$conn->prepare("SELECT * FROM users");
$stmt->execute();
while($row=... | true |
702b5788a7437a835212402e6e11e4de4102b44b | PHP | bombadile/book-manager | /task2/DataManagerDecorator.php | UTF-8 | 1,763 | 2.5625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace src\Decorator;
use App\Helastel2\ProviderInterface;
use DateTime;
use Exception;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Cache\InvalidArgumentException;
use Psr\Log\LoggerInterface;
class DataManagerDecorator implements ProviderInterface
{
public ProviderInterface ... | true |
dabfb7efd7497da8d4be445acbe6ad05eb554859 | PHP | ProfilerTeam/Profiler | /protected/components/WebApplication.php | UTF-8 | 1,293 | 2.640625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <?php
/**
* Profiler
* © 2015 Profiler
*/
/**
* WebApplication is the base WebApplication class
*
* @author Zak
* @package profiler.components
* @since 0.5
*/
class WebApplication extends CWebApplication
{
/**
* Inits the webapplication
*
* Also start interceptor to add event support
... | true |
73851f10f132ddd9d4d8229709d3c065d1c9530d | PHP | saidelghamri/advancedStore | /lib/baseDatos/compra.php | UTF-8 | 5,737 | 3.0625 | 3 | [
"CC-BY-3.0"
] | permissive | <?php
class Compra{
//atributos
private $numeroFactuaB;
private $fecha;
private $hora;
private $usuario;
private $URL;
//contructores
public function setCompra($argFecha, $argHora, $argUsuario, $argUrl){
//pasamos los parametros a los atributos
$this->fecha = $argFecha;
$this->hora = $argHor... | true |
3a7a202b42abdef883d8bf958b1208dee43b5e43 | PHP | opulencephp/Opulence | /src/Opulence/Cryptography/Tests/Encryption/EncrypterTest.php | UTF-8 | 7,502 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/*
* Opulence
*
* @link https://www.opulencephp.com
* @copyright Copyright (C) 2021 David Young
* @license https://github.com/opulencephp/Opulence/blob/1.2/LICENSE.md
*/
namespace Opulence\Cryptography\Tests\Encryption;
use Opulence\Cryptography\Encryption\Ciphers;
use Opulence\Cryptography\Encryp... | true |
62edcb9dede73bcbc54cb146ec501711c85cbe8d | PHP | vigneshbalasubramani/phpexercises | /Invoice app/api/logic/controllerNewUser.php | UTF-8 | 1,696 | 2.71875 | 3 | [] | no_license | <?php
include_once '../products/create.php';
include_once '../objects/user.php';
include_once 'controllerAuthenticateUser.php';
include_once '../products/response.php';
include_once 'login.php';
if(!isset($_SESSION)){
session_start();
}
$userName;
$userType;
$userPassword;
$jsonData;
// function initia... | true |
69e129c41a68fdce9e34ed4ffe8e1ce57593bfb6 | PHP | rifats/user-identities | /module/Identity/src/Controller/IdentityController.php | UTF-8 | 6,626 | 2.734375 | 3 | [] | no_license | <?php
namespace Identity\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Identity\Entity\Identity;
use Identity\Form\IdentityForm;
use Zend\Form\Element;
/**
* Class IdentityController
* @package Identity\Controller
*/
class IdentityController extends AbstractActio... | true |
13ae8d19a8f02247f1567740ce314e3827f16319 | PHP | XenosEleatikos/MusicBrainz | /src/Value/Property/LanguagesTrait.php | UTF-8 | 979 | 3.03125 | 3 | [
"MIT"
] | permissive | <?php
namespace MusicBrainz\Value\Property;
use MusicBrainz\Helper\ArrayAccess;
use MusicBrainz\Value\Language;
use MusicBrainz\Value\LanguageList;
/**
* Provides a getter for a list of languages.
*/
trait LanguagesTrait
{
/**
* A list of languages
*
* @var Language[]|LanguageList
*/
pr... | true |
f19bdd4093038a0e95623891e1d646b871f7f768 | PHP | farhanandri/nusantaracuisine.github.io | /adminHal.php | UTF-8 | 1,513 | 2.640625 | 3 | [] | no_license | <?php
require 'function.php';
$admin = query("SELECT * FROM admin");
$users = query("SELECT * FROM users");
?>
<!DOCTYPE html>
<html>
<head>
<title>NC Admin</title>
<link rel="stylesheet" type="text/css" href="adminStyle.css">
</head>
<body>
<header>
<a href="index.html" class="logo">Nusant... | true |
061936afbfec32a67504a167d7dc363e822245d1 | PHP | VedranBrendy/weatherapp | /inc/deleteFavorites.php | UTF-8 | 995 | 2.6875 | 3 | [] | no_license | <?php
//Init session
session_start();
// Include DB
include_once("../db.php");
$user_id = $_SESSION['id'];
/* If isset list, delete entire list from DB */
if(isset($_GET['list'])){
$list = $_GET['list'];
// Delete query
$sql = "DELETE FROM favorites WHERE user_id = :user_id";
$stmt = $pdo->prepare... | true |
1cf76552a0b0806f6e5b7aa9df5bea6c952a5b60 | PHP | flashlaser/Yaf | /application/library/Exception/Nologin.php | UTF-8 | 562 | 2.703125 | 3 | [] | no_license | <?php
/**
* 用户未登录
* 增加理由:可能需要捕获此类型的异常,然后跳转到未登陆页
*
* @package Exception
* @author baojun <baojun4545@sina.com>
*/
class Exception_Nologin extends Exception_Msg {
/**
* 构造方法
*
* @param int $code code
* @param string $message message
* @param mixed $metadata meta data
... | true |
8806e139b2364a4b5df8a10c15fb11e02b79f958 | PHP | ahad-z/pos | /app/Helpers/function.php | UTF-8 | 304 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
function generateInvoiceNumber()
{
$number = uniqid();
$varray = str_split($number);
$len = sizeof($varray);
$otp = array_slice($varray, $len-5, $len);
$otp = implode(",", $otp);
$otp = str_replace(',', '', $otp);
return $otp;
}
?> | true |
2327691b36ce7463e9599ea4e91bfd1c65b8ea0f | PHP | sanjoysohom/job_portal | /apis/application/models/Common_model.php | UTF-8 | 13,263 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/* * ******************************************************************
* Common model
---------------------------------------------------------------------
* @ Added by : Subhankar
* @ Framework : CodeIgniter
* @ Added Date : 07-01-2016
---------------------... | true |
af5ee6deb67fc02120f56f50bcdb1d6c299d0a73 | PHP | kirkorz/php_server | /controllers/api_controller.php | UTF-8 | 1,290 | 2.65625 | 3 | [] | no_license | <?php
require_once('models/question.php');
require_once('models/answer.php');
class ApiController
{
public function getQuestions(){
$category = $_GET['category'];
$skip = intval($_GET['skip']);
$limit = intval($_GET['limit']);
list($data,$n) = Question::all($category,$skip,$limit)... | true |
9566df38fc8e27807b75535184a9abba5b1075f7 | PHP | shilovAnton/Yeticave2 | /helpers.php | UTF-8 | 8,231 | 3.765625 | 4 | [] | no_license | <?php
/**
* Проверяет переданную дату на соответствие формату 'ГГГГ-ММ-ДД'
*
* Примеры использования:
* is_date_valid('2019-01-01'); // true
* is_date_valid('2016-02-29'); // true
* is_date_valid('2019-04-31'); // false
* is_date_valid('10.10.2010'); // false
* is_date_valid('10/10/2010'); // false
*
* @param... | true |
bafbc1a58d6dd9c31bf8b11416d966b49024e20d | PHP | UCI-Melee-Club/BracketMaster | /processing.php | UTF-8 | 1,933 | 2.828125 | 3 | [] | no_license | <?php
include('challonge.class.php');
date_default_timezone_set('America/Los_Angeles');
$html = file_get_contents('http://ocsmash.weebly.com/the-ladder-current.html');
$dom = new DOMDocument;
$dom->loadHTML($html);
$items = $dom->getElementsByTagName('center');
$players =array();
for ($i = 6; $i < $items->le... | true |
1dae6045a2cafc5abc8e156bf7af3812b51ec7b1 | PHP | elplaza/transactions-command | /src/Payment/Model/Transaction.php | UTF-8 | 2,954 | 2.9375 | 3 | [] | no_license | <?php
namespace Payment\Model;
class Transaction
{
/**
* @var mixed $id Identifier
*/
private $id;
/**
* @var int $customerId Related customer identifier
*/
private $customerId;
/**
* @var Customer $customer Related customer object
*/
private $customer;
/**
* @var DateTime $date Creation date
... | true |
b82d1dfc4a8774563bff3da58104b49edc71e5e7 | PHP | Dr1N/ReferralSystem | /referral_system/protected/models/User.php | UTF-8 | 9,261 | 2.609375 | 3 | [] | no_license | <?php
/**
* This is the model class for table "{{user}}".
*
* The followings are the available columns in table '{{user}}':
* @property integer $id
* @property integer $organization_id
* @property string $mail
* @property string $first_name
* @property string $last_name
* @property string $password
* @proper... | true |
723924ed1d2635a4ccbded15f74cf49af8c8f45c | PHP | institut-galilee/DataLogger | /upload.php | UTF-8 | 500 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
$target_dir = "uploads/";
foreach ($_FILES as $file) {
if ($file['type'] !== 'text/plain' && $file['type'] !== 'video/3gp') {
continue; // ignore non text or 3gp files
}
$name = $file['name'];
$error = $file['error'];
if ($error !== UPLOAD_ERR_OK) {
echo "ERR:${error}:${name}\r\n";
contin... | true |
c662ec468fc1796f3aeb88577f73666338c2e7db | PHP | YuriiPilnik/medicine | /laravel5-learning/app/Comment.php | UTF-8 | 591 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use DB;
class Comment extends Model
{
public function getArrayComments(){
return Comment::orderBy('created_at', "DESC")->get();
}
public function insertIntoTable($comment, $valuation, $login, $id_patient, $date){
DB::table('comments')->insert([
... | true |
230fb60fb2ca1df34c095fe20d7c3e230dd3ab7e | PHP | abhi62255/Online_quiz | /update_student.php | UTF-8 | 1,391 | 2.671875 | 3 | [] | no_license | <?php
include 'database.php';
include'home.php';
if($_SESSION['value']==1){
echo "Updated";
$_SESSION['value']=0;
}
if($_SESSION['value']==2){
echo "Student deleted";
$_SESSION['value']=0;
}
$r=mysql_query("select * from login_details");
echo "<table border='1'>";
echo "<tr><th>Test Id</th><th>Username... | true |
1f1d2e4fa2d782d854d5d6727596435b84d7f567 | PHP | e15007/php2 | /chap6/example-6-21.php | UTF-8 | 259 | 2.671875 | 3 | [] | no_license | <?php
$_POST['comments'] = 'I <b>love</b> sweet <div class="fancy">rice</div> & tee,';
print $_POST['comments'];
print "\n<br>\n";
// Remove HTML from comments
$comments = htmlentities($_POST['comments']);
// Now it's OK to print $comments
print $comments; | true |
2d70e4500cf795e70b3f334fad2de15af2e8dd83 | PHP | davemacaulay/magento-wysiwyg | /Model/Config/Source/Wysiwyg/Type.php | UTF-8 | 898 | 2.609375 | 3 | [] | no_license | <?php
namespace Magento\Wysiwyg\Model\Config\Source\Wysiwyg;
use Magento\Wysiwyg\Model\Types;
/**
* Class Type
*
* @package Magento\Wysiwyg\Model\Config\Source\Wysiwyg
*
* @author Dave Macaulay <dmacaulay@magento.com>
*/
class Type implements \Magento\Framework\Option\ArrayInterface
{
/**
* @var Types... | true |
39332c956b66ea1567c9bcafd09a88dd026ed230 | PHP | mgribov/php-shorefox | /src/Shorefox/Endpoint/Endpoint.php | UTF-8 | 1,699 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
namespace Shorefox\Endpoint;
/**
* Basic structure for an endpoint
*/
abstract class Endpoint implements EndpointInterface {
/**
* Main API cluster
*
* @var string
*/
protected $prefix = 'https://api.shorefox.com/';
/**
* Path after prefix, example 'destination... | true |
12c73fce809c79997b81df590566215eb2c15691 | PHP | abhinay-gh/AsseNFTs | /loginpage/vendor/atk4/ui/srcAtk4/Form/Control/Money.php | UTF-8 | 598 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Atk4\Ui\Form\Control;
/**
* Input element for a form control.
*/
class Money extends Input
{
public function getValue()
{
$v = $this->field ? $this->field->get() : ($this->content ?: null);
if ($v === null) {
return;
}
r... | true |
0732fc13541aa1b5f991d9cc86d707d57482c167 | PHP | AfifAhmad/CI3_Oprek | /application/third_party/Kit-ClassLoader-master/src/ClassLoader.php | UTF-8 | 13,370 | 2.8125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace Riimu\Kit\ClassLoader;
/**
* Class loader that supports both PSR-0 and PSR-4 autoloading standards.
*
* The purpose autoloading classes is to load the class files only as they are
* needed. This reduces the overall page overhead, as every file does not need
* to be requested on every request. It ... | true |
50176c7a87c23a3ef20479916d4df77b4a1a06f3 | PHP | rezafahrur/laravenbook | /app/Http/Traits/BukuTrait.php | UTF-8 | 2,495 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Http\Traits;
use Illuminate\Support\Facades\DB;
use App\Models\Buku;
use App\Models\Supplier;
trait BukuTrait {
public function tampilDataBukuTrait() {
$buku = Buku::orderBy('id','desc')->get();
return $buku;
}
public function tampilDataSupplierTrait(){
$supplier = Supplier::... | true |
ce1719d36c5886a3cb65c620dc4d7edb64a881f1 | PHP | philiplb/Valdi | /src/Valdi/Validator/AbstractDateTimeComparator.php | UTF-8 | 3,482 | 3.28125 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the Valdi package.
*
* (c) Philip Lehmann-Böhm <philip@philiplb.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Valdi\Validator;
use Valdi\ValidationException;
/**
* Abstract valid... | true |
7aec9f53e0d174c1bf922c63a51ba8dfc03b72b7 | PHP | kadet1090/KeyLighter | /Tests/ConsoleHelperTest.php | UTF-8 | 2,152 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* Highlighter
*
* Copyright (C) 2016, Some right reserved.
*
* @author Kacper "Kadet" Donat <kacper@kadet.net>
*
* Contact with author:
* Xmpp: me@kadet.net
* E-mail: contact@kadet.net
*
* From Kadet with love.
*/
namespace Kadet\Highlighter\Tests;
use Kadet\Highlighte... | true |
3cbd591ed5108fb3ea5ebc32ce428bc5a1521eb9 | PHP | joomag-trainings/social-network-DELTALABORATORIES | /PHP/MVC/public/NotificationCounter.php | UTF-8 | 650 | 2.578125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: death
* Date: 7/28/2017
* Time: 4:44 PM
*/
require '../config/db.config.php';
$conn = new mysqli($dbHost, $dbUser, $dbPass, $dbName);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `notifications`";
$result = $co... | true |
92f6ead9ed09393468f482328a915cfe64de406c | PHP | skitzoo/panel | /src/Service/Upload.php | UTF-8 | 480 | 2.9375 | 3 | [] | no_license | <?php
namespace App\Service;
class Upload
{
public function __construct()
{
}
public function Send($file, $directory)
{
if($file === null)
return null;
$fileName = $this->generateUniqueFileName().'.'.$file->guessExtension();
$file->move($directory,$fileName);
... | true |
b4c72501a1a0d5865f18a17843a1a4adae6b6e33 | PHP | iammati/CentauriCMS | /database/seeds/DatabaseSeeder.php | UTF-8 | 4,031 | 2.53125 | 3 | [] | no_license | <?php
use Centauri\CMS\Model\BeUser;
use Centauri\CMS\Model\Page;
use Centauri\CMS\Model\Language;
use Centauri\CMS\Model\Element;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/... | true |
1fb21db92994e2613cbc72848de30c560228edf2 | PHP | henryfw/algo | /careercup/php/string-reverse-letters-in-words.php | UTF-8 | 460 | 3.40625 | 3 | [] | no_license | <?php
// http://www.careercup.com/question?id=5106757177180160
function reverseLettersInWords($str) {
$length = strlen($str);
$index = 0;
$buffer = "";
while ($index < $length) {
if ($str{$index} == ' ') {
echo $buffer . ' ';
$buffer = "";
}
else {
... | true |
57ddf6c52cf89e48ea0db5a666bdafc42bc388d3 | PHP | Arshed-Ahmed/php-headless-crud-for-real-estate-db | /src/Properties/IPropertiesService.php | UTF-8 | 428 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace RealEstate\Properties;
interface IPropertiesService
{
public function insert(PropertiesModel $model): int;
public function update(PropertiesModel $model): int;
public function get(int $propertyId): ?PropertiesModel;
public function getAll(): array;
pub... | true |
e268c66e70e40fd5d948181624a6319e6f4529b2 | PHP | zengsuyi/phprs-restful | /lib/phprs/ezsql/rules/insert.php | UTF-8 | 1,206 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/**
* $Id: insert.php 131 2015-10-10 02:25:57Z yangmin.cao $
* @author caoym(caoyangmin@gmail.com)
*/
namespace phprs\ezsql\rules\insert;
use phprs\ezsql\rules\basic\BasicRule;
use phprs\ezsql\rules\basic\ExecRule;
use phprs\ezsql\impls\InsertImpl;
use phprs\ezsql\impls\ValuesImpl;
require_once dirname(__DIR... | true |
85c1a6ea76ebabb09b5b45b9ec1a32ee3529e6c7 | PHP | AleksandrSirotyuk/shop-mvc | /index.php | UTF-8 | 554 | 2.5625 | 3 | [] | no_license | <?php
/*$string = '26-12-1996';
$pattern = '/([0-9]{2})-([0-9]{2})-([0-9]{4})/';
$replacement = 'Day: $1 Month: $2 Year: $3';
echo preg_replace($pattern, $replacement, $string);*/
// FRONT CONTROLLER
// 1. Общие настройки
ini_set('display_errors', 1);
error_reporting(E_ALL);
session_start();
// 2. Подключение файло... | true |
532c0f761ac3819c68f9c249770c24798d9df8bf | PHP | Jimmy-Gao/linux4pkuss | /linux4pkuss/service/AreaService.class.php | UTF-8 | 344 | 2.8125 | 3 | [] | no_license | <?php
class AreaService{
private $PATH;
function __construct() {
$this->PATH=$_SERVER['DOCUMENT_ROOT'];
}
function getAreaList($city_code){
require_once $this->PATH.'/util/DBHelper.class.php';
$db=new DBHelper();
$sql="select * from area_tb where city_code='$city_code'";
$areas=$db->exec_query($sql);... | true |
3481daf2d2f6776a85cb95240fcb7eec842000d1 | PHP | sgmqs/douniu-game-server | /game-server/CallZhuangHandle.php | UTF-8 | 971 | 2.609375 | 3 | [] | no_license | <?php
namespace BGameServer\Douniu;
class CallZhuangHandle
{
const TIME_OUT = 20;
private $midConnections = [];
private $beginTime;
public function __construct($midConnections)
{
$this->midConnections = $midConnections;
$this->beginTime = time();
}
public function doResult()... | true |
b2a374b51dc4732446794dc739f72a4e438e317a | PHP | axelghio/programacion_laboratorio_III | /prog_3/Clase 1/5.php | UTF-8 | 582 | 3.296875 | 3 | [] | no_license | <?php
$a = 2;
$b = 2;
$c = 6;
if($a != $b && $b != $c && $a != $c)
{
if($a > $b && $a < $c)
{
echo "A es el del medio.";
}
else if($a < $b && $a > $c)
{
echo "A es el del medio.";
}
else if($a > $b && $b > $c)
{
echo "B es el del medio.";
}
else if($a < $... | true |
e3ae0663f4da2f91519e1d833e7492dc58bff87c | PHP | ss-bb/TODOListBundle | /Entity/Tasks.php | UTF-8 | 2,365 | 2.578125 | 3 | [] | no_license | <?php
namespace Acme\TODOListBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Tasks
*/
class Tasks
{
/**
* @var string
*/
private $title;
/**
* @var string
*/
private $notes;
/**
* @var status
*/
private $status;
/**
* @var \DateTime
*/
... | true |
189a295bfc992fb0bc7eb4ac8c7613b1c2a5e835 | PHP | calrek/psx-examples | /module/demo/api/example.php | UTF-8 | 3,274 | 2.75 | 3 | [] | no_license | <?php
namespace demo\api;
use Example\Handler;
use Example\Table;
use Exception;
use PSX\Base;
use PSX\DateTime;
use PSX\Data\Message;
use PSX\Data\WriterInterface;
use PSX\Data\WriterResult;
use PSX\Module\ApiAbstract;
use PSX\Sql;
use PSX\Urn;
/**
* This is an example howto create an REST API endpoint where you c... | true |
e06209199fa05cb792fe2f3a67c579d14d28d3be | PHP | cryptoscan-one/cryptoscan-client-php | /src/provider/ProviderInterface.php | UTF-8 | 616 | 2.640625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: itily
* Date: 04.06.2023
* Time: 18:00
*/
namespace cryptoscan\provider;
use cryptoscan\contract\AuthCredentialsInterface;
use cryptoscan\contract\InvoiceCreatedInterface;
/**
* Провайдер данных
*
* Class DataProviderInterface
* @package cryptoscan\provider
*/
inter... | true |
78511dacdc04d00796888bc8b1736182e4bc6b02 | PHP | cryptobuks/bitcoin-p2p-php | /src/Ip/Ipv4.php | UTF-8 | 964 | 3.125 | 3 | [
"Unlicense"
] | permissive | <?php
declare(strict_types=1);
namespace BitWasp\Bitcoin\Networking\Ip;
use BitWasp\Buffertools\Buffer;
use BitWasp\Buffertools\BufferInterface;
class Ipv4 implements IpInterface
{
const MAGIC = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff";
/**
* @var string
*/
private $ip;
/**
... | true |
46213a10082fd8dad8d0adc02906c7f0d1d72abe | PHP | BDE-ESIEE/FairPay | /src/Ferus/EventBundle/DQL/IfFunction.php | UTF-8 | 1,123 | 2.8125 | 3 | [] | no_license | <?php
namespace Ferus\EventBundle\DQL;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
/**
* IfFunction ::= "IF" "(" ArithmeticPrimary "," ArithmeticPrimary "," ArithmeticPrimary ")"
*/
class IfFunction extends Funct... | true |
ae66aacbe4533c2076f2dd4d41ea1f727a4df702 | PHP | TheMlandylegend/THREEWebsite | /includes/process.php | UTF-8 | 1,051 | 2.765625 | 3 | [] | no_license | <?php
if (($_SEVER['myname'])) {$myname = $_POST['myname'];}
if (($_SEVER['$yourmail'])) {$yourmail = $_POST['yourmail'];}
if (isset($_POST['mymessage'])) {
$mymessage = filter_var($_POST['mymessage'], FILTER_SANITIZE_STRING );
}
$formerrors = false;
if ($myname === '') :
$err_myname = '<div class="error">Sor... | true |
8f17c53cce21b1bbdf3662969859b2ed7e88d3cc | PHP | VladimirKrav4enko/r.md | /app/Http/Controllers/ApiController.php | UTF-8 | 902 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Models\QueryFilter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
* Class ApiController
* @property Model $model
* @property QueryFilter $filter
* @package App\Http\Controllers
*/
abstract class ApiCont... | true |
60cb24bc650fe12c28a893ea5d6929676aeb6059 | PHP | juanf/phpbloomfilter | /src/JuanF/Lib/BloomFilter.php | UTF-8 | 2,725 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* @license http://www.apache.org/licenses/LICENSE-2.0
* Copyright 2015 Juan Ferrari
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/L... | true |
29abf148af85fd98becdc24881588799b0b8b42d | PHP | ThinGoods/popka | /admin_panel/students_parlament.php | UTF-8 | 2,637 | 2.703125 | 3 | [] | no_license | <?php
require_once "../function/connectMySQL/connect_to_db.php";
global $mysqli;
connectDB();
if(isset($_POST['name'], $_POST['position'], $_FILES['image'])) {
$errors = array();
$image_name = $_FILES['image']['name'];
$image_temp = $_FILES['image']['tmp_name'];
$full_image_src = 'img/s... | true |
9cb7361ece9acde4001bb0e2ea2cf99395e83aa5 | PHP | rjw57/findsorguk | /library/Pas/Validate/ValidGridRef.php | UTF-8 | 2,717 | 3.171875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/** A validation class for checking for valid British National Grid values
* @author Daniel Pett <dpett at britishmuseum.org>
* @copyright (c) 2014 Daniel Pett
* @category Pas
* @package Pas_Validate
* @version 1
* @license
*/
class Pas_Validate_ValidGridRef extends Zend_Validate_Abstract {
/**... | true |
74c71071a4d6df902e0ec002a739a8bfe9da180f | PHP | michaelrk02/pingfest | /application/libraries/Jwt.php | UTF-8 | 1,555 | 2.75 | 3 | [] | no_license | <?php
defined('BASEPATH') OR exit;
class Jwt {
public function create($data, $age, $secret) {
if (!is_array($data)) {
$data = [];
}
if (isset($age)) {
$data['__exp'] = time() + $age;
}
$data = base64_encode(json_encode($data));
$signature = h... | true |
bf67f8b1c9870425298c6bf0f19b8f807d5de2d9 | PHP | gibonomakaka/webacula | /models/Message.php | UTF-8 | 5,366 | 3.078125 | 3 | [] | no_license | <?php
/**
* Description of getMessageList
*
* @author vega
*/
class Message {
const limit = 10;
public static function getMessageList($page = 1, $flag = false){
$db = Db::getConnection();
$limit = self::limit;
$offset = ($page - 1) * $limit;
if(!$flag){
... | true |
cc6a3fc7d39764a15f773d289576f354e344bf7c | PHP | smgladkovskiy/rolf-personnel | /library/Rp/Db/View/IntegratedPersons.php | WINDOWS-1251 | 1,058 | 2.515625 | 3 | [] | no_license | <?php
/**
* ROLF Personnel library
*
* @category Rp
* @package Rp_Db
* @subpackage Rp_Db_View
*/
/**
* .
*
* @category Rp
* @package Rp_Db
* @subpackage Rp_Db_View
*/
class Rp_Db_View_IntegratedPersons extends Rp_Db_View_Abstract
{
protected $_name = 'user_rp_persons_integra... | true |
b5d89694a3024d23d2c325000fd45da07be8e7d5 | PHP | ayrtoncravero/abmProductos | /app/Repository/ProductRepository.php | UTF-8 | 1,111 | 2.6875 | 3 | [] | no_license | <?php
namespace App\Repository;
use App\Product;
class ProductRepository
{
public function save(Product $product) {
$product->save();
}
/**
* @return Product[]
*/
public function listAllProducts() {
return Product::query()->get();
}
public function findOrFail($id):... | true |
0d14f975485003e1ab21665712d8f8d5af4c5920 | PHP | the-benchmarker/web-frameworks | /php/hamlet/src/Application/Resources/UserIDResource.php | UTF-8 | 782 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Application\Resources;
use Hamlet\Http\Entities\PlainTextEntity;
use Hamlet\Http\Requests\Request;
use Hamlet\Http\Resources\HttpResource;
use Hamlet\Http\Responses\MethodNotAllowedResponse;
use Hamlet\Http\Responses\Response;
use Hamlet\Http\Responses\SimpleOKResponse;
class UserIDResource implement... | true |
95272082148de0126ae84b477c7ddfd837b50a00 | PHP | paugay/code-dojo | /katas/KataArgs/it-1/run.php | UTF-8 | 1,144 | 3.375 | 3 | [] | no_license | <?php
/**
* run.php
*
* This script will filter the input parameters and execute the code of
* the kata.
*
* @version $Id$
* @package KataArgs
* @author Pau Gay <pau.gay@gmail.com>
*/
// include the command line parser class
require_once "CommandLineParser.php";
$parameters = $argv;
// if n... | true |
08ba0ec3496b196d5d0ddf0b76b479d958fc0d0f | PHP | topcoder-platform/forums-plugins | /SqlPlugin/controllers/api/SqlApiController.php | UTF-8 | 983 | 2.515625 | 3 | [] | no_license | <?php
use Garden\Web\Exception\ClientException;
use Garden\Schema\Schema;
use Vanilla\Utility\InstanceValidatorSchema;
use Garden\Web\Data;
use Garden\Web\Exception\NotFoundException;
use Garden\Web\Exception\ServerException;
use Vanilla\ApiUtils;
/**
* SQL API Controller for the `/sql` resource.
*/
class SqlApiCon... | true |
4063fcb4cf705b81a8b4555feb1de8e15f4837b1 | PHP | JeffDota2/Empelado | /modelo/DataBase.php | UTF-8 | 3,514 | 2.9375 | 3 | [] | no_license | <?php
class DataBase{
public function insertarEmpleado($nombre,$apellido,$cargo,$salario){
$modelo = new Conexion();
$conexion = $modelo->get_conexion();
$sql = "insert into empleado (nombre, apellido, cargo, salario) values (:nombre, :apellido, :cargo, :salario)";
... | true |
0b994e553d12fa8933b5e4991e86fae9ef418116 | PHP | ellsif/weladmin | /src/classes/service/ManagerService.php | UTF-8 | 1,804 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace ellsif\WelCMS;
/**
* 管理画面表示用コントローラ
*/
class ManagerService extends Service
{
/**
* ログイン画面を表示します。
*/
public function getLogin($params)
{
return new ServiceResult();
}
/**
* ログイン処理を行います。
*/
public function postLogin($params)
{
$result =... | true |
2e920865159af34a53b213a92cb9c509f59b8af2 | PHP | SerendipityNL/needletail-php | /src/Client.php | UTF-8 | 1,925 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace Needletail;
use Needletail\Http\Query;
class Client
{
/**
* An API key associated with all the read functionalities.
*
* @var string
*/
private $read_key;
/**
* An API key associated with all the write functionalities.
*
* @var string
*/
privat... | true |
4fbe40daae865d21b966599c81966bdcf4636670 | PHP | nstdio/jphp | /jphp-core/tests/resources/classes/bug404.phpt | UTF-8 | 322 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | --TEST--
Crash when using abstract class extending abstract class via interface
--FILE--
<?php
interface a
{
public function test();
}
abstract class b implements a
{
}
abstract class c extends b
{
}
class d extends c
{
public function test() { var_dump("ok"); }
}
(new d)->test();
?>
--EXPECT--
string(2) "o... | true |
31a7a9952952b63c0814087fac41138b02874bad | PHP | pinoyshaun1991/ItechMediaFrontEnd | /src/Service/ContentRecipeService.php | UTF-8 | 703 | 2.78125 | 3 | [] | no_license | <?php
namespace iTech\Service;
use iTech\Common\Service\APIService;
/**
* Service returning specifically recipe content
*
* Class ContentRecipeService
* @package iTech\Service
*/
class ContentRecipeService extends APIService
{
/**
* Get the contents of the API response
*
* @param $site... | true |
2ff782cbf5c863cd013199b9002efd64ae911b54 | PHP | ali-mahdavifar/library | /console/migrations/m160216_122158_event.php | UTF-8 | 541 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
use yii\db\Migration;
class m160216_122158_event extends Migration
{
public function up()
{
$this->createTable('event', [
'id' => $this->primaryKey(),
'day' => $this->date()->notNull(),
'startTime' => $this->integer()->notNull(),
'endTime' => $this... | true |
f0434fc270312954910c2cb6ae4de32c4f5906f7 | PHP | marianne17f/Yummy | /modele/Comment.class.php | UTF-8 | 1,366 | 3.421875 | 3 | [] | no_license | <?php
//----------------- CLASS CREATION----------------//
// Declaration of the Comment class with inheritance (copy / paste) from the abstract class AbstractEntity
class Comment extends AbstractEntity
{
// Declaration of attributes
private $fk_user;
private $fk_event;
private $comment;
private $horodate;
/... | true |
2ebee6c9d6438541102d260c381d56ec4fdfa02f | PHP | jonstjohn/selenium-setup-to-scale | /php/CwDailyForecastPage.php | UTF-8 | 772 | 3.078125 | 3 | [] | no_license | <?php
/**
* Climbing Weather daily forecast page helper
*/
class CwDailyForecastPage
{
/**
* Web driver browser session
* @var PHPWebDriver_WebDriver
*/
protected $session;
/**
* Day selector
* @var array
*/
private $_daySelector = array('xpath', "//table[contains(@class... | true |
43b37f91582e4a51ff1bb4ab550b42d65553c1ca | PHP | mmoharem/sms2 | /app/Repositories/DormitoryRepositoryEloquent.php | UTF-8 | 450 | 2.890625 | 3 | [] | no_license | <?php
namespace App\Repositories;
use App\Models\Dormitory;
class DormitoryRepositoryEloquent implements DormitoryRepository
{
/**
* @var Dormitory
*/
private $model;
/**
* DormitoryRepositoryEloquent constructor.
* @param Dormitory $model
*/
public function __construct(Dor... | true |
5105d86b7a2a19c0bdaf0f8cecf92f49a33dce56 | PHP | dmtrs/yii-aws-sqs | /tests/unit/AWSQueueTest.php | UTF-8 | 1,431 | 2.640625 | 3 | [] | no_license | <?php
class AWSQueueTest extends CTestCase
{
/**
* Test validation rules for creating a queue
*/
public function testNameValidation()
{
$q = new AWSQueue();
$invalidCharacterNames = array(
'Testing queue', //KO
'Testing*^quee', //KO
);
fore... | true |
ae51d29872a724b6d1dc7e8a0092c4adc7888387 | PHP | mucean/etu | /src/ORM/Sql/Select.php | UTF-8 | 946 | 2.9375 | 3 | [
"MIT"
] | permissive | <?php
namespace Etu\ORM\Sql;
use Etu\Service\Sql\Command\Select as BaseSelect;
class Select extends BaseSelect
{
protected $wrapper;
public function setWrapper(callable $wrapper)
{
$this->wrapper = $wrapper;
}
/**
* if callable wrapper is set, the array result of wrapper of each va... | true |
4d121fcf6625e1564a249db5389590878d344512 | PHP | chenminfeng/PHP | /class/Team.php | UTF-8 | 1,852 | 2.921875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: chenminfeng
* Date: 2016/7/25
* Time: 15:06
*/
Class Team{
public $pointGuard;
public $shootingGuard;
public $smallForward;
public $powerForward;
public $center;
public $coach;
/**
* @return mixed
*/
public function getPointGuard(... | true |
c4277234597d389ff74afba68de80ae5311aee03 | PHP | StydeNet/enlighten | /src/Models/Concerns/GetsStatsFromGroups.php | UTF-8 | 676 | 2.65625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Styde\Enlighten\Models\Concerns;
use Styde\Enlighten\Models\Status;
trait GetsStatsFromGroups
{
public function getPassingTestsCount(): int
{
return $this->groups->pluck('passing_tests_count')->sum();
}
public function getTestsCount(): int
{
return $this->groups->... | true |