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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
852561cb02346f70dd27ecc53c6eb741bedad669 | PHP | noppolp/PHPAzureMediaServices | /ajaxupload/FileUploadModel.php | UTF-8 | 534 | 2.546875 | 3 | [] | no_license | <?php
class FileUploadModel{
public $blockCount;
public $fileName;
public $fileSize;
public $startTime;
public $isUploadCompleted;
public $uploadStatusMessage;
public $container;
public $blockList;
public $assetId;
}
class UploadBlockResponse
{
public function __construct($error... | true |
b17b0325b9b134d8651c2a5d47146f68968b7a83 | PHP | chronhub/storm | /src/Serializer/ProjectorJsonSerializer.php | UTF-8 | 1,185 | 2.578125 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Chronhub\Storm\Serializer;
use Chronhub\Storm\Contracts\Serializer\JsonSerializer;
use Symfony\Component\Serializer\Encoder\JsonDecode;
use Symfony\Component\Serializer\Encoder\JsonEncode;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
final readonly class ProjectorJs... | true |
3ea1895b97b8824e9e327ffaaef44f5bd2aa0a55 | PHP | pochiwas/proyectos | /aprendiendo_php/19-Ficheros/index.php | UTF-8 | 808 | 3.28125 | 3 | [] | no_license | <?php
//abrir archivo
$Archivo = fopen("fichero_texto.txt","a+");
//leer archivo
//para recorrer todas las lineas del archivo se debe iterar en un ciclo
//para poder mostrar cada linea del fichero
while(!feof($Archivo)){
$contenido = fgets($Archivo);
echo $contenido."<br/>";
}
//escribir dentro del archivo
fwrite(... | true |
5fa69db5d50e612546cf49a9a5b3152d87f2baf7 | PHP | tolan/MTP | /Network/Server/Listener/Disconnect.php | UTF-8 | 539 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace MTP\Network\Server\Listener;
use MTP\Network\Server\Event\AEvent;
use MTP\Network\Server\Response\Quit;
/**
* This file defines class for listener of network communication on disconnect event.
*
* @author Martin Kovar <mkovar86@gmail.com>
*/
class Disconnect extends AListener {
/**
* Re... | true |
94296ce70ffcea07946b2aada466ffdbcaa17a36 | PHP | xiaohongyang/yii_site | /models/TeamModel.php | UTF-8 | 7,999 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: xiaohongyang
* Date: 2016/11/29
* Time: 20:39
*/
namespace app\models;
use app\common\components\helpers\MobileMsgHelpers;
use phpDocumentor\Reflection\Types\Boolean;
use yii\base\Exception;
use yii\base\InvalidCallException;
use yii\behaviors\TimestampBehavior;
use yii\... | true |
a4572c7708b9f1b217b35e813d596834822cda25 | PHP | MagnusBrzenk/phpImageGallery | /php_templates/captions.php | UTF-8 | 4,806 | 2.75 | 3 | [] | no_license | <?php
// Load in env vars and connect to DB
// require_once __DIR__ . '/../db.php';
$dbConnectionFile = getcwd() . '/db.php';
require_once $dbConnectionFile;
// Handle http request
$request_method = $_SERVER["REQUEST_METHOD"];
switch ($request_method) {
case 'GET':
// Retrieve captions
$caption_i... | true |
717cbd6a3754cefb9080441c98a78ba54116e278 | PHP | MikkelOlsen/classes | /index.php | UTF-8 | 3,021 | 2.703125 | 3 | [] | no_license | <?php
require_once 'config.php';
$guestbook = new Guestbook($db);
if(isset($_POST['send'])) {
$guestbook->insert($_POST['name'], $_POST['text']);
}
if(isset($_POST['opdater'])) {
$guestbook->update($_POST['editName'], $_POST['editText'], $_GET['edit']);
header('... | true |
d2708ec41992709e8b38f0dfb05a20caeac611ff | PHP | cosnics/cosnics | /src/Chamilo/Core/Repository/ContentObject/PeerAssessment/Builder/Component/AttemptUpdaterComponent.php | UTF-8 | 2,222 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Chamilo\Core\Repository\ContentObject\PeerAssessment\Builder\Component;
use Chamilo\Core\Repository\ContentObject\PeerAssessment\Builder\Manager;
use Chamilo\Core\Repository\ContentObject\PeerAssessment\Form\PeerAssessmentAttemptForm;
use Chamilo\Libraries\Architecture\Exceptions\NotAllowedException;
u... | true |
12e4c874a2315a47dd653946eb67f421708414de | PHP | t-harv/PHP-Examples | /chapter5/scope.php | UTF-8 | 403 | 3.484375 | 3 | [] | no_license | <!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Getting Started In PHP</title>
</head>
<body>
<?php
$number = 1;
echo "Global number : $number <br";
echo "huh?";
// function show_local()
// {
// echo "test";
// $number = 100;
// echo "Local number : $number<hr>";
// }
function helloW... | true |
3cfec20b41a34d19391f5b9c061b9502cc9ab7e2 | PHP | wallsfantasy/piggybank | /src/User/CommandHandler/RegisterUserHandler.php | UTF-8 | 1,116 | 2.75 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\User\CommandHandler;
use App\User\Command\RegisterUser;
use App\User\EventStore\UserEventStore;
use App\User\Exception\RegisterUserAlreadyExists;
use App\User\Model\User;
use App\User\Projection\UserReadModelRepo;
class RegisterUserHandler
{
/** @var UserEventStore */... | true |
a84cf936c86dd6eaf93578d81fdf882885667ed8 | PHP | sankam-nikolya/automapper | /src/Definition/Value.php | UTF-8 | 1,167 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types=1);
namespace Acelot\AutoMapper\Definition;
use Acelot\AutoMapper\Definition\Traits\IgnoreEmptyTrait;
use Acelot\AutoMapper\Definition\Traits\TrimValueTrait;
use Acelot\AutoMapper\DefinitionInterface;
use Acelot\AutoMapper\Exception\IgnoreFieldException;
use Acelot\AutoMapper\SourceInterfac... | true |
2ce0852515273e2cf9ec35e11a92de9947c534c1 | PHP | Mateusz-Kalwinski/Wholesale-online | /public/ajax/deleteProducts.php | UTF-8 | 913 | 2.546875 | 3 | [] | no_license | <?php
session_name('user');
session_save_path(realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../sessions'));
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', 259200);
session_set_cookie_params(259200);
session_start();
require_once dirname(dirname(__FILE__)).'... | true |
8501adae35bac8d2d87588241b7d0c3b9e1e2475 | PHP | santosvda/twitterCloneMVC | /App/Models/Tweet.php | UTF-8 | 1,642 | 3.09375 | 3 | [] | no_license | <?php
namespace App\Models; //namepsace é definido atraves do diretorio onde a classe se encontra
use MF\Model\Model;
class Tweet extends Model {
private $id;
private $id_usuario;
private $tweet;
private $data;
public function __get($atributo){
return $this->$atributo;
}
public function __set($atributo, $... | true |
6597827636adfa680e4b3ea9a590079b2b6cb787 | PHP | at69/beta-OwlEyes | /controller/fancybox/renameElement.php | UTF-8 | 2,394 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
header('Content-Type: text/html; charset=utf-8');
$projectRoot = $_SERVER['DOCUMENT_ROOT'].'/Nestbox';
require_once $projectRoot.'/required.php';
/**
* Created by PhpStorm.
* User: Harry
* Date: 05/06/14
* Time: 12:36
*/
/** - Renomme un fichier ou un dossier
* @author Harry Bellod
* @param $name | nom du... | true |
76c2d92a1bed2861e599db3b91a6d5cf5e51310a | PHP | rzepedam/controlqtime | /app/Core/Entities/FamilyRelationship.php | UTF-8 | 913 | 2.515625 | 3 | [] | no_license | <?php
namespace Controlqtime\Core\Entities;
use Illuminate\Database\Eloquent\Model as Eloquent;
class FamilyRelationship extends Eloquent
{
/**
* @var array
*/
protected $fillable = [
'relationship_id', 'employee_family_id',
];
/**
* @var array
*/
protected $dates = [... | true |
f40694c63c34fd4c3bfec5954d46470684b70416 | PHP | yudistirachma/SanbercodeBootcamp | /php-3 Challenge/cari_mean.php | UTF-8 | 347 | 3.59375 | 4 | [] | no_license | <?php
function cari_mean($arr)
{
$mean = array_sum($arr) / count($arr);
$mean = round($mean);
return "{$mean}<br>";
}
// TEST CASE
echo cari_mean([1, 2, 3, 4, 5]); // 3
echo cari_mean([3, 5, 7, 5, 3]); // 5
echo cari_mean([6, 5, 4, 7, 3]); // 5
echo cari_mean([1, 3, 3]); // 2
echo cari_me... | true |
172916a0a408c74184564c3444dfe2e714791f4f | PHP | irvindmoreno/twins | /Ejemplos de Tutoriales/Practicas/php/variosPokemones.php | UTF-8 | 1,320 | 3.671875 | 4 | [] | no_license | <?php
class Pokemon
{
public $nombre;
public $tipo;
public $ataque;
public $vida;
public $estado="libre";
public function __construct($nombre,$tipo,$ataque,$vida)
{
$this->nombre=$nombre;
$this->tipo=$tipo;
$this->ataque=$ataque;
$this->vida=$vida;
}
public function atacar($pokemonRiv... | true |
1b387aac8dc1f43ae5cdb53ea2071206ba2e31bd | PHP | aabizri/g3c | /website/Passerelle/FrameCouranteRequeteCODEC.php | UTF-8 | 982 | 2.84375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: aabizri
* Date: 1/3/18
* Time: 1:29 AM
*/
namespace Passerelle;
class FrameCouranteRequeteCODEC implements CODEC
{
/**
* @param Frame $frame
* @param $stream
* @throws \Exception
*/
public function decode(Frame $frame, $stream): void
{
... | true |
97a46b267c043eace2d245dfb874fe28cf8df811 | PHP | xPand4B/MiPa-Pool | /app/Console/Commands/MakeComponentCommand.php | UTF-8 | 6,143 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands;
use App\Components\Common\MiPaPo;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
class MakeComponentCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'make:co... | true |
3cb3e352df9d660800065d0bbadad43aea0992f7 | PHP | codextips/adroit | /protected/controllers/SiteController.php | UTF-8 | 7,213 | 2.53125 | 3 | [] | no_license | <?php
class SiteController extends Controller {
public $layout = '//layouts/column2';
/**
* Declares class-based actions.
*/
public function actions() {
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha' => array(
... | true |
e912df47d390a58451ed15dc9dfd6836e132df98 | PHP | Amir-Shamsi/simple-php-website | /signup&login/login.php | UTF-8 | 1,652 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
session_start();
function checkUser(){
$servername = "localhost";
$user = "test";
$pass = "";
$error = "";
try { // articles
$connection = new PDO ("mysql:host=$servername;dbname=mydb", $user, $pass);
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
... | true |
80810dc20c0c5fd1fa3d96835b2914278e8d7016 | PHP | singlag888/X1 | /sscadmin/model/cards.class.php | UTF-8 | 35,150 | 2.671875 | 3 | [] | no_license | <?php
if (!defined('IN_LIGHT')) {
die('KCAH');
}
/**
* 暂只实现业务分组
*/
class cards
{
const ORDER_BY_BANK_ID = 1;
const ORDER_BY_BANK_ID_AND_SORT = 2;
const ORDER_BY_SORT = 3;
static public function getItem($id, $type = NULL, $status = NULL)
{
$sql = 'SELECT * FROM cards WHERE 1';
i... | true |
720349e737cfa4d87c60da7f64275dc7c92206e0 | PHP | krydomza/scada | /laczniki.php | UTF-8 | 13,759 | 2.609375 | 3 | [] | no_license | <?php
require_once('wczytywanie.php');
$limity = parse_ini_file("konfiguracje.ini", true);
// ====================WARUNKI - KOLORY ŁĄCZNIKÓW zależnie od stanu==============================
//funkcja dla łącznika IN oraz OUT
function kolor($x,$kolor_lacznik_normal,$kolor_lacznik_anomalia)
{
if($x==1) // stan zamkn... | true |
7969a017069ee713ddbe1899b3403252eb0ccd07 | PHP | mons-reys/InFLames_the_global_online_marktetplace_E_commerce_website | /config/select_all_users.php | UTF-8 | 277 | 2.65625 | 3 | [] | no_license | <?php
//create a query
$sql = "SELECT * FROM user WHERE id=' $seller' ";
//make the query and get result
$result = mysqli_query($conn,$sql);
//fetch results (row => array)
$user= mysqli_fetch_assoc($result);
//checking of the information
$count = mysqli_num_rows($result);
?> | true |
b077fa9c27f8fb894ede65341e85b6437001e252 | PHP | StephenAlanBuckley/Informery | /blog.php | UTF-8 | 1,575 | 3.109375 | 3 | [] | no_license | <?php
$css_paths = "/css/blog.css";
$js_paths = "/js/blog.js";
require_once 'header.php';
require_once '../utilities/db_class.php';
$start = !empty($_GET['start']) ? $_GET['start'] : 1;
$range= !empty($_GET['end']) ? $_GET['end'] : 5;
$story_set = get_stories($start, $range);
$story_html = make_stories_html($story_se... | true |
61bf81b5cb01155120d12b2c98ee7c88633b54c6 | PHP | wearesho-team/yii-tokens | /tests/Mocks/TokenRepositoryConfigMock.php | UTF-8 | 1,095 | 2.625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Wearesho\Yii\Tests\Mocks;
use Carbon\CarbonInterval;
use Wearesho\Yii\Interfaces\TokenRepositoryConfigInterface;
class TokenRepositoryConfigMock implements TokenRepositoryConfigInterface
{
protected CarbonInterval $expirePeriod;
protected int $verifyLimit = 3;
... | true |
63c338618ef2570921522c5a87da0326e29213d7 | PHP | xiongchiamiov/wwmqt-svn | /moodle/question/type/webwork/lib/questionfactory.php | UTF-8 | 7,759 | 2.96875 | 3 | [] | no_license | <?php
/**
* The WebworkQuestionFactory Class.
*
* @copyright © 2008 Matthew Leventi
* @author mleventi@gmail.com
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package webwork_qtype
**/
/**
* @desc Factory that creates WebworkQuestion objects in different ways.
*/
class WebworkQuesti... | true |
15160cf963067d8750b415a60f22981b85d1b541 | PHP | Analshikha07/FSWD_Practicals | /Mid Term Practicals/CSE_B/10_B_2013260_Anshika/add.php | UTF-8 | 1,616 | 2.8125 | 3 | [] | no_license | <?php
include('conn.php');
?>
<?php
if(isset($_POST['submit'])){
$username= $_POST['username'];
$email=$_POST['email'];
$email=$_POST['contact'];
$gender=$_POST['gender'];
$city=$_POST['city'];
$sql="INSERT INTO `users` ( `username`, `email`,`contact`, `gender`, `city`) VALUES ( '$username', '$em... | true |
373395cfbf061d755c423c7e848c62930fdc3589 | PHP | frost-nzcr4/task-KinopoiskParser | /src/KinopoiskParser/Downloader.php | UTF-8 | 3,590 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
namespace KinopoiskParser;
class Downloader
{
const MOVIE_URL = 'http://www.kinopoisk.ru/film/%s/';
const CAST_URL = 'http://www.kinopoisk.ru/film/%s/cast/';
public function __construct(array $values = array())
{
}
/**
* Prepare context for stream.
*
* @return resource.
... | true |
a2c1ddb08825df73bb02646e2d6cfa15fcf7b3a9 | PHP | a-beudin/mes_travaux | /bookmarks_php_sql/modeles/Bookmark/Bookmark_Form.php | UTF-8 | 2,263 | 3.09375 | 3 | [] | no_license | <?php
class Bookmark_Form {
/* Données membres de la classe */
protected $bookmark;
protected $erreurs; // tableau contenant les erreurs du formulaire
/* Fonctions membres de la classe */
/* Constructeur */
public function __construct($bookmark) {
/* initialisation du tableau des erreurs */
$this-... | true |
fbe98e3c1dfdfcd964cffe19ae648a88221e8a99 | PHP | Renat-Bedritsky/PHP_8 | /functions.php | UTF-8 | 6,554 | 3.171875 | 3 | [] | no_license | <div class="title">
<h1>Products</h1>
</div>
<?php
$dir = $_GET['id'] ?? '.\\'; // Если 'dir' существует, то принимает 'dir', иначе \
// $dir = realpath($dir); // Абсолютный путь к файлу
// chdir($dir); // Изменяет текущий каталог на указанный
// echo $dir;
// echo $_SERVER['DOCUM... | true |
0c1a6de510803ee929852208bf8cbc12a830b815 | PHP | brandon-kp/GitSig | /gitsig.class.php | UTF-8 | 2,755 | 2.734375 | 3 | [] | no_license | <?php
class Github_signature {
var $username;
var $image = 'res/sigtemp.png'; //template image
var $font = 'res/HelveticaLTStd-Bold.otf'; //font file
var $uri_segment = 4; //This depends on how many sub-folders the script is in
function get_username()
{
$username = explode('/',$_... | true |
ecc69f8023e2e5b44c51676aee8224a9da28054e | PHP | ipf/substaff | /Classes/Domain/Model/Mitarbeiter.php | UTF-8 | 3,110 | 2.59375 | 3 | [] | no_license | <?php
/* * *************************************************************
* Copyright notice
*
* (c) 2012 Ingo Pfennigstorf <pfennigstorf@sub-goettingen.de>
* Goettingen State Library
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can... | true |
193cc6be3c8b35632f610312fa70e55b850f373b | PHP | kuzuha/Phunk | /src/Phunk/Collaborator/RebuildHeaders.php | UTF-8 | 1,549 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
namespace Phunk\Collaborator;
class RebuildHeaders implements \Phunk\Collaborator
{
/**
* @static
* @param callable $app
* @param array $options
* @return callable
*/
static function collaborate(callable $app, array $options = array())
{
return function(array $env) u... | true |
4a2015c26a2da05fd8f05cec57eaeb12ec041f30 | PHP | lourenzo/mala-direta | /old-cake/app/views/messages/index.ctp | UTF-8 | 1,209 | 2.734375 | 3 | [] | no_license | <?php $html->addCrumb('Messages'); ?>
<h2>Messages</h2>
<?php echo $html->link(_('Add'),"/messages/add");?>
<table>
<tr>
<th>Id</th>
<th>Name</th>
<th>Subject</th>
<th>html</th>
<th>text</th>
<th>actions</th>
</tr>
<!-- Here's where we loop through our $post... | true |
78170423675805ff8bff208e0bb27ec6788e4c45 | PHP | nylonthanh/top20movies | /App/View.php | UTF-8 | 938 | 2.84375 | 3 | [] | no_license | <?php
namespace App;
if(!defined('ALLOW_ACCESS')) {
die('Direct access not permitted');
}
class View
{
public $loader;
public $twig;
public $template;
public function __construct($template = 'index.html')
{
$this->loader = new \Twig_Loader_Filesystem(__DIR__ . '/../templates');
... | true |
ce702ad50e1b62d66717bef9e8755701e01d9f13 | PHP | vladanJovic/databasestructure | /src/Builder/TypesBuilder.php | UTF-8 | 1,965 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the Active Collab DatabaseStructure project.
*
* (c) A51 doo <info@activecollab.com>. All rights reserved.
*/
namespace ActiveCollab\DatabaseStructure\Builder;
use Doctrine\Common\Inflector\Inflector;
/**
* @package ActiveCollab\DatabaseStructure\Builder
*/
class TypesBuilder e... | true |
2be5b047fa4f00d81aff4cd42385dd1887883f75 | PHP | flywheel2/other | /misc/ConstUtility.php | UTF-8 | 5,101 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
/** ______ _ _ _ ___
* | ____| | | | | |__ \
* | |__ | |_ ___ __| |__ ___ ___| | ) |
* | __| | | | | \ \ /\ / /| '_ \ / _ \/ _ \ | / /
* | | | | |_| |\ V V / | | | | __/ __/ |/ /_
* |_| |_|\__, | \_/\_/ |_| |_|\___|\___|_|_... | true |
847553eb58fadf3ee70a7c14e2b99d9a50e8a85f | PHP | diSumma/iSete | /Sito/phps/Stats/prova.php | UTF-8 | 2,387 | 2.625 | 3 | [] | no_license | <?php
include "..\connection.php";
sess("db")->start();
$queryUsoCapsule = "select ca_tipo, sum(pre_quantita) as 'numero' from prende group by ca_tipo";
$queryRimanenti = "select ca_tipo, ca_quantitaRimanente from capsula group by ca_tipo";
$tmpUsoCapsule = sess("db")->query($queryUsoCapsule);
$tmpRimanenti = se... | true |
7b81926f98cfd638416da6c8276ad98b4141c27b | PHP | karannakra/onlineNotes | /storeresetpass.php | UTF-8 | 3,141 | 2.8125 | 3 | [] | no_license | <!--this file recieves:user_id generated key to reset password password1 and password2 -->
<!--this file then reset the password if all the checks are correct-->
<?php
session_start();
include "connection.php";
if(!isset($_POST["user_id"])||!isset($_POST["key"])) {
echo "<div class='alert alert-danger'>Your passw... | true |
b78bd9761df130e6220cd5d4b6225463b5c62fdf | PHP | ngocthoai-dev/Tiny-Anime-Database | /account.php | UTF-8 | 3,552 | 3.078125 | 3 | [] | no_license | <?php
class user
{
private $query = "SELECT * FROM USER";
private $res;
public function __construct()
{
$this->res = mysqli_query($GLOBALS['conn'], $this->query) or die("Cant select from db!");
}
public function checkUserName($username)
{
$pattern = "#^[a-zA-Z0-9_\.\s]{4,31}$#"; // str = a-z || 0-... | true |
43a90ffc6036664f56228f0f676d8de49d3538bc | PHP | WouwLite/4DKManager | /database/migrations/2017_07_05_033446_create_wake_times_table.php | UTF-8 | 1,258 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateWakeTimesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('wake_times', ... | true |
1d87a7d2db2f281baa6deb8d905fed68fc6e10d3 | PHP | ant-hill/searcher | /src/Searcher/Events/FieldEvent.php | UTF-8 | 479 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace Searcher\Events;
use Symfony\Component\EventDispatcher\Event;
class FieldEvent extends Event
{
/**
* @deprecated
* @see EventNames::FIELD_EVENT
*/
const EVENT_NAME = EventNames::FIELD_EVENT;
/**
* @var
*/
private $field;
public function __construct($fie... | true |
e2c578e76d63ebb8a28abddace6a433f92b2d7aa | PHP | Floy-rep/Shop | /src/Service/Admin/UsersService.php | UTF-8 | 1,155 | 2.703125 | 3 | [] | no_license | <?php
namespace App\Service\Admin;
use App\Entity\User;
use App\Repository\UserRepository;
use App\Service\Admin\Users\UsersInterface;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Security\Core\Security;
class UsersService
{
private EntityManagerInterface $manager;
private Security $secur... | true |
66d12bb0507bcf143fd1369dbe6012d25c50b629 | PHP | jonatan-flores-forks/clean-arch-pokemon | /src/Player/Adapters/Repository/PlayerRepository.php | UTF-8 | 2,085 | 2.9375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\Player\Adapters\Repository;
use App\Player\Domain\Exceptions\PlayerNotFoundException;
use App\Player\Domain\Factory\PlayerFactory;
use App\Player\Domain\Player;
use App\Player\UseCases\Contracts\PlayerRepository as PlayerRepositoryInterface;
use App\Shared\Adapters\Contra... | true |
f60ac50ae0c324d13ff841c2710bb58656a16a40 | PHP | Hunkjf2/sistema_info_biblioteca | /backend/database/migrations/2021_01_09_205053_insert_livro_table.php | UTF-8 | 1,312 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
use Carbon\Carbon;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
class InsertLivroTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public functio... | true |
6571d086e10c7fd1783772341053939142500087 | PHP | matthewslouismarie/auth-abstractor | /src/LM/AuthAbstractor/Challenge/IChallenge.php | UTF-8 | 1,959 | 2.8125 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace LM\AuthAbstractor\Challenge;
use LM\AuthAbstractor\Model\IAuthenticationProcess;
use LM\AuthAbstractor\Model\IChallengeResponse;
use Psr\Http\Message\ServerRequestInterface;
/**
* Classes implementing this interface are challenges.
*
* Challenges represent steps of the au... | true |
68fed1840cd8a8991452a7acacab9ac3128d78d6 | PHP | strata-mvc/strata | /src/Router/RouteParser/Callback/CallbackRouter.php | UTF-8 | 1,125 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace Strata\Router\RouteParser\Callback;
use Strata\Router\Router;
/**
* Maps Wordpress actions, filters and callbacks to Strata classes
*/
class CallbackRouter extends Router
{
/**
* Returns an instance of the router instantiated
* with the optional $routes.
* @param array $routes ... | true |
44e87d53e7dab12f101c656a5b718e3cbeca94b4 | PHP | mjb0899/efriendApp | /insertUser.php | UTF-8 | 2,267 | 2.640625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: ADMIN
* Date: 03/04/2017
* Time: 13:10
*/
if($_POST['username']==null){
header("location:pageNotFound.html");
exit();
}
include ("dbConnect.php");
$uusername=$_POST["username"];
$ufname=$_POST["fname"];
$ulname=$_POST["lname"];
$email=$_POST["email"];
$sex=$_POST... | true |
6e2da0bfbc972485f7049128015dbfc1cbfdd099 | PHP | LoutreT/Siteweb-PINTEREST | /controller/database.php | UTF-8 | 812 | 2.8125 | 3 | [] | no_license | <?php
class Database{
public $db_name;
public $db_user;
public $db_pass;
public $db_host;
public $pdo;
public function __construct(){
// $this->db_name = $db_name;
// $this->db_user = $db_user;
// $this->db_pass = $db_pass;
// $this->db_host = $db_host;
$this->pdo = new PDO('pgsql:host=e... | true |
7e4fd46f096ab0b45ba211c59eafbc5eac5df92a | PHP | meilisa21/HitsPizza-ECOM | /application/modules/login/models/m_login.php | UTF-8 | 775 | 2.640625 | 3 | [] | no_license | <?php
class M_login extends CI_Model{
public function get($username){
$this->db->where('username', $username); // Untuk menambahkan Where Clause : username='$username'
$result = $this->db->get('user')->row(); // Untuk mengeksekusi dan mengambil data hasil query
return $result;
}
... | true |
db94d6655af5f69590a69316863ae402d8d93064 | PHP | grimskin/cardmaster | /src/Service/Set/Collector/RandomFacts.php | UTF-8 | 2,255 | 2.796875 | 3 | [] | no_license | <?php
namespace App\Service\Set\Collector;
use App\Model\CardDefinition;
use JetBrains\PhpStorm\Pure;
class RandomFacts
{
private ?CreatureStats $creatureStats;
private ?InstantsVsSorceries $instantsVsSorceries;
private ?SpecialsCount $specialsCount;
private array $longestNames = [];
private i... | true |
4316bb2adb5176da3f8ad8d09e91127dd576dac1 | PHP | SevkiBekir/NobetSis | /apps/sharedApp/models/dbModelCreator/dbRefArray.php | UTF-8 | 3,934 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
/**
* That model builds database array with column referance data
*
* Output of that array scheme is
*
* $refArr[tableName][columnName] = ['ref_table_name' => referanceTableName, 'ref_column_name' => referanceColumnName]
*
*/
class dbRefArray extends CI_Model... | true |
08a27e6877dc8bdecd71ec39e11ee70ff4af54da | PHP | aleksandarsimonovic/zend-cart-module | /application/models/CacheHandler.php | UTF-8 | 1,334 | 2.9375 | 3 | [] | no_license | <?php
/**
* Cache Handler
*
* @author Aleksandar Simonovic
*/
class Application_Model_CacheHandler
{
/**
* @var Zend_Cache
*/
protected $cache;
public function __construct()
{
$this->cache = Zend_Cache::factory(
'Output',
'File',
array(),
array()
);
}
/**
* Save serialized data... | true |
00562ee25fa4ad33fc52d204a5659c1b8e1205ba | PHP | puwenhan/RedisTools | /lib/RedisTools/Db/Field/UniqueIdentifier.php | UTF-8 | 2,951 | 2.75 | 3 | [] | no_license | <?php
/**
* UniqueIdentifier
*
* Copyright (c) 2011 Thomas Profelt
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* t... | true |
a81a155163efa34b3453283ef4098193ff632c67 | PHP | arfifa/Jawaban-Tes-Arfifa-Rahman | /SoalNo3.php | UTF-8 | 552 | 2.9375 | 3 | [] | no_license | <?php
function count_handshake($jumlahOrang)
{
$jumlahTangan = 1;
$jumlahJabatTangan = 1;
if ($jumlahOrang >= 2) {
for ($jumlahMinOrang = 2; $jumlahMinOrang < $jumlahOrang; $jumlahMinOrang++) {
if ($jumlahOrang == 2) {
$jumlahJabatTangan;
} else {
... | true |
d44c14d39f377358e64b8148cdf167adc83cda08 | PHP | Bladrak/SyliusSalesBundle | /Model/ItemInterface.php | UTF-8 | 985 | 2.53125 | 3 | [] | no_license | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\SalesBundle\Model;
/**
* Interface for order line item model.
*
* @author ... | true |
0d8592e1f8e03ab8e12fa9b3907e93f6188f69b3 | PHP | yoyoren/power_station | /model/generated/class/mysql/PowerStationWarningMySqlDAO.class.php | UTF-8 | 7,519 | 3.0625 | 3 | [] | no_license | <?php
/**
* Class that operate on table 'power_station_warning'. Database Mysql.
*
* @author: http://phpdao.com
* @date: 2015-06-29 10:45
*/
class PowerStationWarningMySqlDAO implements PowerStationWarningDAO{
/**
* Get Domain object by primry key
*
* @param String $id primary key
* @return ... | true |
ab59b77f18e58a952a0eb6e6236631301d01600a | PHP | bayedamediop/bayedamefilerouges_back | /src/DataFixtures/ProfileFixtures.php | UTF-8 | 574 | 2.546875 | 3 | [] | no_license | <?php
namespace App\DataFixtures;
use App\Entity\Profile;
use Doctrine\Persistence\ObjectManager;
use Doctrine\Bundle\FixturesBundle\Fixture;
class ProfileFixtures extends Fixture
{
public function load(ObjectManager $manager)
{$profils =["ADMIN" ,"FORMATEUR" ,"APPRENANT" ,"CM"];
for ($i=0; $i < 4; ... | true |
d097711bc1d15c5404800d4139e5392661a20ac5 | PHP | AndyDune/Zend1Alib | /Alib/View/Helper/ArrayExtractValuesWithPrefix.php | UTF-8 | 1,006 | 2.5625 | 3 | [] | no_license | <?php
/**
* Created by JetBrains PhpStorm.
* User: Dune
* Date: 14.12.12
* Time: 15:41
*
*
*
*/
namespace Alib\View\Helper;
use Alib;
class ArrayExtractValuesWithPrefix extends \Alib\View\HelperAbstract
{
protected $_data = [];
public function direct($prefix = null, $array = [], $params... | true |
104634d8afc12b488547d863282dbebac9b531ef | PHP | julacha/HackerRank | /tests/algorithms/warmup/SimpleArraySumTest.php | UTF-8 | 414 | 2.984375 | 3 | [] | no_license | <?php
declare(strict_types=1);
require 'vendor/autoload.php';
require_once 'algorithms/warmup/SimpleArraySum.php';
use PHPUnit\Framework\TestCase;
final class SimpleArraySumTest extends TestCase
{
/**
* @testWith [[1, 2, 3, 4, 10, 11],31]
*
*/
public function test_SimpleArraySum(array $ar, ... | true |
1d43afe438ed405f3b2dadefe5472922dc7010cf | PHP | srijib/Talentoon2 | /talentoon/app/Http/Controllers/WizIQClass/AuthBase.php | UTF-8 | 2,296 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\WizIQClass;
class AuthBase
{
private $secretAcessKey="";
private $access_key="";
public function __construct($secretAcessKey,$access_key)
{
$this->secretAcessKey=$secretAcessKey;
$this->access_key=$access_key;
}
function GenerateTimeStamp()
{
return time();
}
function... | true |
e1d73eeeb29e8afaf68579fefa24d29472771b7c | PHP | petrakid/lscms | /ld/db.inc.php | UTF-8 | 610 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
// Database connection settings (you can change these to meet your needs)
$db_host = 'localhost';
$db_db = 'stpaulsl_db1';
$db_user = 'stpaulsl_conn1';
$db_pass = '9-n=Mgal@a*{';
$_SESSION['prefix'] = "tbl";
$dsn = "mysql:host=$db_host;dbname=$db_db;charset=utf8mb4";
try {
// create a PDO connection w... | true |
9f55635a0fb9cc77ee5ef4db76f7eb051980921f | PHP | NuNuNOGriesbach/EasyWay | /Db/Table/TableAbstract.php | UTF-8 | 10,431 | 2.6875 | 3 | [] | no_license | <?php
namespace Ew\Db\Table;
class NotFoundException extends \Ew\Exception{}
class NotValidException extends \Ew\Exception{}
/**
* Description of Abstract
*
* @author nununo
*/
class TableAbstract {
//Handler de conexão padrão obtido de \Ew\Registry
protected $_registeredHandler = 'db';
protected $_re... | true |
675d90ae9e6dac8a9ac0a85269414928366a1904 | PHP | ajunlonglive/php-ext-msgpacki | /tests/namespace/serialize/023.phpt | UTF-8 | 385 | 2.515625 | 3 | [
"PHP-3.01"
] | permissive | --TEST--
Serialize / Unserialize misbehaviour under OS with different bit numbers
--FILE--
<?php
namespace MessagePacki;
if (!extension_loaded('msgpacki')) {
dl('msgpacki.' . PHP_SHLIB_SUFFIX);
}
if (PHP_INT_SIZE == 4) {
$ser = 'cb41f2a05f20000000';
} else {
$ser = 'cf000000012a05f200';
}
var_dump(unseri... | true |
72bf730f1482358eabaa82b0e6bed96f6d500d43 | PHP | YeaminRaat/oop_blog | /app/classes/Database.php | UTF-8 | 327 | 2.6875 | 3 | [] | no_license | <?php
namespace App\classes;
class Database
{
public static function dbConn(){
$host = "localhost";
$user = "root";
$pass = "";
$db = "oop_blog";
$conn = mysqli_connect($host, $user, $pass, $db);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
return $conn;
}
... | true |
4ba99d1dc6f3a1379473482046359cfec75b2c55 | PHP | atillakurtulussimsek/php | /OOP/namespace/uygulama/helper/bildirimler.php | UTF-8 | 495 | 2.828125 | 3 | [] | no_license | <?php
//namespace tanımı
namespace Uygulama\Helper;
//burada aslında bir isim-klasör eşleşmesi yok anlaşılır olsun diye bu formatta isimlendiriyoruz
//bu Bildirimler sınıfını kullanmak için bu namespace'i kullanmam gerekecek
//bu namespace Uygulama klasörünün altındaki Helper klasörünün altındaki Bildirimler sınıfı... | true |
25475b96ff1b505b80145ad731a853ae49ed50d0 | PHP | monkeyWzr/CtCI-6th-Edition-php-solutions | /src/Chapter10/SortedMatrixSearch.php | UTF-8 | 1,523 | 3.515625 | 4 | [] | no_license | <?php
class SortedMatrixSearch
{
public static function search($x, $matrix)
{
if (!is_array($matrix))
throw new InvalidArgumentException("The matrix should not be an array.");
$m = count($matrix);
if ($m == 0)
return false;
$n = count($matrix[0]);
... | true |
dbfe43d730d5734c978aec662b6538b89d226696 | PHP | supertowers/queue-bundle | /ContainerAware.php | UTF-8 | 1,034 | 2.6875 | 3 | [] | no_license | <?php
namespace SuperTowers\QueueBundle;
use \Symfony\Component\DependencyInjection\ContainerAwareInterface;
use \Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Simple implementation of ContainerAwareInterface with an assertion.
*
* @category QueueBundle
* @package Core
* @author Pablo Lope... | true |
c6198e4ece4bad80b9695cb18de1b3603dc49180 | PHP | Rini-1349/blog_cakephp | /src/Controller/Admin/UsersController.php | UTF-8 | 3,925 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Controller\Admin;
use App\Controller\Admin\AppControllerAdmin;
/**
* Users Controller
*
* @property \App\Model\Table\UsersTable $Users
*
* @method \App\Model\Entity\User[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
*/
class UsersController extends AppC... | true |
497e238d2c38a07b34dd8d6a6a8c90a0fa2b002e | PHP | khanhk99/emotel | /app/Http/Controllers/Admin/CategoryController.php | UTF-8 | 1,003 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Admin;
use App\Categories;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class CategoryController extends Controller
{
public function getindex(){
$categories = Categories::paginate(10);
return view('admin.categories.index',[
'c... | true |
49e9e8c20e8cfad25e2d0602f310ac9e2952c898 | PHP | zhang082666/oop | /2.6/demo14.php | UTF-8 | 546 | 3.15625 | 3 | [] | no_license | <?php
header("Content-Type:text/html;charset=utf-8");
/**
* $this 应用
* 一个类是不是灵活一些,可扩展性
* @author zhangxiaochen <2966761062@qq.com>
*/
class Car{
//成员属性
public $name = "奔驰";
public $age = "30";
//成员方法
public function pao(){
$this -> name = "宝马";
return $this -> name."正在跑... | true |
48539862c4bc3aa9a5c411a37a59a5a0108f7ffa | PHP | wojciech-kowalik/drupal-modules | /visualnet_utility/src/Utility/LanguageUtility.php | UTF-8 | 401 | 2.546875 | 3 | [] | no_license | <?php
namespace Drupal\visualnet_utility\Utility;
/**
* Class LanguageUtility
*
* @package Drupal\visualnet_utility\Utility
*/
class LanguageUtility
{
/**
* @return array
*/
public static function getCurrentLangCode()
{
$currentLanguage =
\Drupal::languageManager()->getCurren... | true |
e611d95a258aae8f9c8e89ceb92fcb94a772beab | PHP | dejanu/php | /createHTML.php | UTF-8 | 215 | 3.21875 | 3 | [] | no_license | <?php
$var='PHP tutorial';
//diff print and echo
print '</title>' . $var . "</title>";
echo "<h2>" . $var ."</h2>";
//diff between concatention with . and ,
echo '<a href = "http://www.nba.com">' . $var . '</a>'
?> | true |
54d8d525134e7f30f061faa970c50345ff53e1c7 | PHP | getjump/sanitizer | /tests/Unit/JsonObjectTest.php | UTF-8 | 3,135 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace getjump\Sanitizer\Tests\Unit;
use getjump\Sanitizer\Formatters\IntegerFormatter;
use getjump\Sanitizer\Formatters\JsonObject;
use getjump\Sanitizer\Formatters\ObjectFormatter;
use getjump\Sanitizer\Formatters\RussianFederalNumberFormatter;
use getjump\Sanitizer\Formatters\StringFormatter;
use PHPUnit\... | true |
641d6ebc1025feaa9d3d4ef9a9b23cde4bdb7caf | PHP | criexe/base | /system/lib/net.class.php | UTF-8 | 2,381 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | <?php
class net
{
public function connect($params = [])
{
sys::specify_params($params, ['url', 'referer', 'cookie_file']);
if($params['url'] == null) return false;
$default_user_agent = _config('net.user_agent');
sys::array_key_default_value($params, 'user_agent', $default_... | true |
249bf8ea2096de50bdfb373462cc87aa837af7f9 | PHP | deiusoft/whois | /application/libraries/whois/servers/country/tgtld.php | UTF-8 | 1,876 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-dco-1.1"
] | permissive | <?php namespace Whois\Servers\Country;
class Tgtld extends \Whois\Server
{
protected $host = 'www.nic.tg';
protected $connection_type = 'curl';
protected $curl_post = true;
protected $allow = array('tg');
public function __construct($domain)
{
$this->domain = $this->get_domain($domain);
if (!isset($this->q... | true |
c612ef2cf5c4df934dd047b422700a20f0192a4a | PHP | informaticaeducativa/moocucc | /app/models/Evaluacion.php | UTF-8 | 3,247 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class Evaluacion extends Eloquent implements UserInterface, RemindableInterface
{
use UserTrait, RemindableTrait;
public $errors;
protected... | true |
968767e051ab6504031c3bc19387d73a020fc689 | PHP | KiritoXD01/moviemax | /app/Repositories/Eloquent/EloquentMovieRepository.php | UTF-8 | 1,543 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Repositories\Eloquent;
use App\Repositories\Contracts\MovieRepository;
use App\Models\Movie;
use App\Models\User;
class EloquentMovieRepository implements MovieRepository
{
protected $movie;
public function __construct(Movie $movie)
{
$this->movie = $movie;
}
public ... | true |
dcdaffac8ba3de5e407146c3eec0df0d4c41898c | PHP | MyLittleParis/Campaign-Commander | /tests/Service/CcmdDynamicContentBlockLinkServiceTest.php | UTF-8 | 21,500 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace MyLittle\CampaignCommander\Tests\Service;
use MyLittle\CampaignCommander\Tests\AbstractTestCase;
use MyLittle\CampaignCommander\Service\CcmdDynamicContentBlockLinkService;
/**
* CcmdDynamicContentBlockLinkServiceTest
*
* @author mylittleparis
*/
class CcmdDynamicContentBlockLinkServiceTest extend... | true |
4e2bc6715f0c76d122350972b898882eab5e5c77 | PHP | nestesitio/mvc-nsitio | /model/models/UserBase.php | UTF-8 | 4,940 | 2.515625 | 3 | [] | no_license | <?php
namespace model\models;
use \lib\mysql\Mysql;
/**
* Description of UserBase
*
* @author Luís Pinto / luis.nestesitio@gmail.com
* Created @2016-11-15 17:02
* Updated @2016-11-15 17:02
*/
class UserBase extends \lib\model\Model
{
const FIELD_ID = 'user_base.id';
const FIELD_USER_GROUP_ID = 'user_... | true |
fb9605b5df3f2c3e20eb3c4b8d264d8d6e672f32 | PHP | Cdkushni/restaurant-template-cms | /cms/manage_orders.php | UTF-8 | 11,612 | 2.515625 | 3 | [] | no_license | <?php
if ($section==''){
$result = mysql_query("SELECT * FROM orders");
echo "<td><p>Total Orders</p></td>";
echo "<td><p>".number_format(mysql_num_rows($result),0)."</p></td>";
}
if ($section=='View Orders'){
if ($_POST['filter_order_id']!=''){
//check to see if it exists
$result = mysql_query("SELEC... | true |
bdace17191101b106e670fa879b60bb6c7c87b79 | PHP | JoanaNasc/examefinal | /vendor/csrf_toke_functions.php | UTF-8 | 1,725 | 2.953125 | 3 | [] | no_license | <?php
//deve se chamar o antes de carregar esta página
//session_start();->esta a ser carregada no boot
//Gerar um token para usar com CSRF protection
//nao deve guardar o token
function csrf_token(){
return md5(uniqid(rand(),TRUE));
}
//gerar e guardar o token CSRF no user session
//exige que a sessão ... | true |
78f8716a1b9bab8f2295a2e57b6325fcc10c8c7d | PHP | fyxemmmm/pv_service | /common/models/GoodsModel.php | UTF-8 | 2,800 | 2.546875 | 3 | [] | no_license | <?php
namespace common\models;
use Yii;
/**
* This is the model class for table "goods".
*
* @property int $id
* @property string $name 商品名称
* @property int $goods_type_id 类型id
* @property string $image 商品图片
* @property string $specification_desc 规格描述
* @property string $service 提供什么服务
* @property string $g... | true |
7fde5bd22da7fdf3d2724227f83b4b0374c4d130 | PHP | ghostwriter/json | /src/Json.php | UTF-8 | 1,911 | 2.890625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace Ghostwriter\Json;
use Throwable;
use UnexpectedValueException;
use const JSON_ERROR_NONE;
use const JSON_INVALID_UTF8_IGNORE;
use function json_decode;
use function json_last_error;
/** @psalm-immutable */
final readonly class Json implements JsonInterface
{
/** @var i... | true |
6349d175bd18f6e146e097930df1ec882dde25a2 | PHP | Nymphadelle/Phyllali | /ajax/trocConfirme.php | UTF-8 | 576 | 2.515625 | 3 | [] | no_license | <?php
require_once("../Classes/Troc.php");
require_once("../Classes/Utilisateur.php");
$user = new Utilisateur();
session_start();
if (isset($_POST['idtroc']) && isset($_POST['pdt']) && isset($_POST['livr'])){
$idTroc=$_POST['idtroc'];
$idProduit=$_POST['pdt'];
$idLivr=$_POST['livr'];
$troc = new Troc();
$troc... | true |
d78c6d9e94945aab5187190935d6ba7978476087 | PHP | Mubyana/GameZone | /databasefiles/connect_to_mysql.php | UTF-8 | 555 | 2.734375 | 3 | [] | no_license | <?php
/*
1: "die()" will exit the script and show an error statement if something goes wrong with the "connect" or "select" functions.
2: A "mysql_connect()" error usually means your username/password are wrong
3: A "mysql_select_db()" error usually means the database does not exist.
*/
$db_host = "localhost"... | true |
c9f7ef09235216c5158b0f91046ea785f4c6da6c | PHP | hanunjunior/ListService | /module/LSBase/src/LSBase/Controller/CrudController.php | UTF-8 | 5,421 | 2.515625 | 3 | [] | no_license | <?php
namespace LSBase\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use \Zend\View\Model\ViewModel;
use Zend\Paginator\Paginator,
Zend\Paginator\Adapter\ArrayAdapter;
use Zend\Authentication\AuthenticationService,
Zend\Authentication\Storage\Session as SessionStorage;
/**
* CrudController
... | true |
5f389a032af5de53db4792ba85763f78f38b1c62 | PHP | sagautam5/Permission | /app/Permission/Repositories/Repository.php | UTF-8 | 2,372 | 3 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Permission\Repositories;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Foundation\Application;
/**
* Class Repository
* @package App\Payroll\Repositories
*/
abstract class Repository implements RepositoryInterface
{
/**
* @var Model
*/
protected $model;
/**... | true |
0fe91654fcee7e9cba71ac5f353c9d66bd22e4b1 | PHP | sumit2222/login | /obj1.php | UTF-8 | 639 | 3.09375 | 3 | [] | no_license | <?php
session_start();
/*$conn=new mysqli('localhost','root','');
if($conn->connect_error){
die("Connection Failed : ".$conn->connect_error);
}
//echo "connected successfully";
//$conn->close();//to close the connection
$sql="CREATE DATABASE myDBnew1";
if($conn->query($sql)===TRUE){
echo "DATABASE SUCCESSFULLY CRE... | true |
c834ea6d5682305e267e8b84a01e48570900bee4 | PHP | RustiSub/Cdb | /lib/CultureFeed/Cdb/Item/Event.php | UTF-8 | 17,500 | 2.875 | 3 | [] | no_license | <?php
/**
* @class
* Representation of an event on the culturefeed.
*/
class CultureFeed_Cdb_Item_Event extends CultureFeed_Cdb_Item_Base implements CultureFeed_Cdb_IElement {
/**
* @var string
*/
protected $availableFrom;
/**
* @var string
*/
protected $availableTo;
/**
* @var string
... | true |
46b9206231c304fb80a81ebb59a455c039a05caa | PHP | mirfu034618/YaoChuFa | /ycfTest8_19/regularClass/RegularClass.php | UTF-8 | 1,083 | 3.03125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: fufangjie
* Date: 2016/8/22
* Time: 11:51
*/
namespace Ycf\Lession\RegularClass;
class RegularClass
{
/**
* 以字母开始,以数字结束,并且没有空格的单元
*/
public function regularArray($regular, $values)
{
$grep = preg_grep($regular, $values);
return $grep;... | true |
b259feceeb50429d8708d436a311243039b1421a | PHP | OnSouleveDesMeres/symfonyHandsOn | /src/Entity/Category.php | UTF-8 | 1,263 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\CategoryRepository")
*/
class Category
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(t... | true |
1209a114c3ad1494199e09373c46a2e83df8ee95 | PHP | wudan3551/CurrentLeakageWebServer | /ipc/temp.php | UTF-8 | 523 | 3.046875 | 3 | [] | no_license | <?php
// Create a temporary file and return its path
$tmp = "./dan";
// Get the file token key
$key = ftok($tmp, 'a');//the second argument can be any number between 1 and 255
// Attach the SHM resource, notice the cast afterwards
//$id = shm_attach($key);
//if ($id === false) {
// die('Unable to create the shar... | true |
7739c3d8eb7a8ee5e09a9a5627c2c61ff9132f1f | PHP | cyrsis/PHPDesignPatterns | /SwitchLight/Switchable.php | UTF-8 | 77 | 2.515625 | 3 | [] | no_license | <?php
interface Switchable {
function turnOn();
function turnOff();
}
?>
| true |
d5069fd54ff471f5cb66fa0dace62fb04224f6cc | PHP | khairul18/zf3-apigilty-oauth2 | /module/Aqilix/src/ORM/Mapper/AbstractMapperFactory.php | UTF-8 | 2,322 | 2.609375 | 3 | [] | no_license | <?php
namespace Aqilix\ORM\Mapper;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
/**
* Abstract Mapper Factory
*
* @author Dolly Aswin <dolly.aswin@gmail.com>
*/
class AbstractMapperFactory implements AbstractFactoryInt... | true |
415f0a743aa753daceabc558a6fee92ba37ebe1e | PHP | 233sec/laravel-oauth-server | /database/seeds/Access/PermissionTableSeeder.php | UTF-8 | 2,671 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
/**
* Class PermissionTableSeeder
*/
class PermissionTableSeeder extends Seeder
{
public function run()
{
if (DB::connection()->getDriverName() == 'mysql') {
DB::statement('SET FOREIGN_KEY_CHECKS=... | true |
975c40ced758375d88b638af64f17c463d510264 | PHP | agusdom/Laboratorio4-PHP | /TRABAJO-PRACTICO-INTEGRADOR/TP/DAO/iDaoArtist.php | UTF-8 | 361 | 2.84375 | 3 | [] | no_license | <?php
namespace Dao;
use Model\Artist as Artist;
interface IDaoArtist
{
public function AddArtist(Artist $artist);
public function GetAll();
public function GetByArtistId($artistId);
public function GetByArtisticName($artisticName);
public function DeleteArtist($artistId);
public function Mod... | true |
daf09e2d6b7588be73ffdb173fca868926ccaf76 | PHP | Warmbellycat/sqlbuilder | /src/Sql/Clause/DeleteClause.php | UTF-8 | 610 | 2.625 | 3 | [] | no_license | <?php
namespace AlephTools\SqlBuilder\Sql\Clause;
use AlephTools\SqlBuilder\Sql\Expression\FromExpression;
trait DeleteClause
{
/**
* @var FromExpression
*/
protected $from;
/**
* @param mixed $table
* @param mixed $alias
* @return static
*/
public function from($table,... | true |
11682d28ba9688a5ac9b103ab7aacc93ce43e9c0 | PHP | licenced/keamananV1 | /application/views/visitor/form.php | UTF-8 | 1,790 | 2.53125 | 3 | [
"MIT"
] | permissive | <!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<link rel="stylesheet" href="<?php echo base_url();?>/assets/css/cssform.css">
<meta charset="utf-8">
<title>SecureOne|Pemesanan</title>
</head>
<form>
<div id="semua">
<h1> <br> <center> Daftar Alat Keamanan </center> </h1>
<img src = "<?php echo bas... | true |