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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c32c1526c05e8dc225ef529c7f1b84bc6cf56a22 | PHP | y2kwill2000/hoyacmlphp | /src/Cml/Lock/Memcache.php | UTF-8 | 2,727 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | <?php
/* * *********************************************************
* [cmlphp] (C)2012 - 3000 http://cmlphp.com
* @Author linhecheng<linhechengbush@live.com>
* @Date: 15-1-25 下午3:07
* @version @see \Cml\Cml::VERSION
* cmlphp框架 鎖機制Memcache驅動
* *********************************************************** */
name... | true |
2771893d5a2c29dcca72587f70f992ee8d23b7bc | PHP | ilicmarko/linkcutter | /app/Http/Requests/LinkShorteningRequest.php | UTF-8 | 992 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class LinkShorteningRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
*... | true |
610843c544cb2dc1f4c377c8463824cd9f280b1b | PHP | Course-Link/laravel-database-notification-templates | /src/Interfaces/NotificationTemplateInterface.php | UTF-8 | 240 | 2.609375 | 3 | [] | no_license | <?php
namespace CourseLink\NotificationTemplates\Interfaces;
interface NotificationTemplateInterface
{
public function getNotification(): string;
public function getSubject(): string;
public function getTemplate(): string;
} | true |
d086a89bfb9ce9fd14fdaea4ca6138bd0f2896e1 | PHP | Dlayer/dlayer | /library/Dlayer/View/StylingHtml.php | UTF-8 | 1,864 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Styling view helper for the HTML, calls child view helpers for each styling group
*
* @author Dean Blackborough <dean@g3d-development.com>
* @copyright G3D Development Limited
* @license https://github.com/Dlayer/dlayer/blob/master/LICENSE
*/
class Dlayer_View_StylingHtml extends Zend_View_Helper_Abs... | true |
3cd04f82f64f46e884e0231fee5e96a5ba6bc900 | PHP | curiousways/visual-verse | /partials/vendor/gridset/mod-gridset-loop-counter.php | UTF-8 | 554 | 3.109375 | 3 | [] | no_license | <?php
// Gridset Loop Counter - define
// -----------------------------
$gridcount = 0; ?>
<?php // WHILE { ?>
<?php // Grisdet Loop Counter - determine classes
// ----------------------------------------------
$gridcount++;
if($gridcount == 1) {
$cols = "l1-l3 m1-m3";
}
elseif($gridcount == 2) {
$cols =... | true |
5e5b71f55ddb6fb2808acbcca394abfe69a2c5bd | PHP | scriptPilot/backup-to-google-drive | /lib/Google/Auth.php | UTF-8 | 1,594 | 2.671875 | 3 | [] | no_license | <?php
/**
* Purpose: Simplify Google OAuth2 process
*/
namespace Google;
class Auth {
/**
* Private properties
*/
private $clientId;
private $redirectUri;
private $scope;
private $credentials;
/**
* Private methods
*/
private function restoreCredentials... | true |
74813db8de3e5be4bd7052f3d59a39f310ad8c42 | PHP | luisgonzalez/webcore | /samples/samples.web.php | UTF-8 | 612 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
require_once '../webcore.php';
HttpContext::initialize();
if (HttpContext::getRequest()->getRequestVars()->keyExists('clear'))
{
HttpContext::getSession()->clear();
echo "Session cleared";
exit();
}
$ixCol = new IndexedCollection();
$cotizacion = new StdClass();
HttpContext::getSession()->regi... | true |
f5704e925377e4964fe21a6d7b1a95518f268514 | PHP | christuchez/Burnizer | /classes/MonteCarlo.php | UTF-8 | 7,034 | 3.3125 | 3 | [] | no_license | <?php
class MonteCarlo{
private $totalBurn; //int
private $firstDegBurnArea; //int
private $secondDegBurnArea; //int
private $thirdDegBurnArea; //int
private $imagefile; //image
private $pointOfNormalSkin; //point
private $pointOfFirstDegBurn; //point
private $pointOfSecondDegBurn; //point
... | true |
b3877ac8c51ec5b73cd892c86cc8351a73080d80 | PHP | i-den/Courses | /Software_University/04_PHP_Web_Development_Basics/08_FUNCTIONAL_PROGRAMMING_Exercises/8_Multiply_or_Divide.php | UTF-8 | 2,566 | 3.21875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
$input = array(
['sum', 12, 156],
['subtract', 5, 6],
['subtract', 1, 2],
['sum', 12, 13],
['subtract', 3, 3],
['sum', 1, 2],
['divide', 100, 0],
['divide', 100, 'PP'],
['sum', 'P123', 123]
);
$opSum = function (float $a, float $b): float {
retur... | true |
6eec20a7c0838336afa27ef52fa9f39074b8a6e2 | PHP | mveron007/Centro-Deportivo | /classes/Usuario.php | UTF-8 | 1,371 | 3.390625 | 3 | [] | no_license | <?php
class Usuario {
private $id;
private $name;
private $lastName;
private $password;
private $email;
public function __construct(string $userName, string $userLastName, string $userPassword, string $userEmail)
{
$this->name= $userName;
... | true |
0aa3e55942fe84185753db3a23ac61e324686a71 | PHP | gmlrsts/basic_inventory | /app/Http/Controllers/ProductController.php | UTF-8 | 2,691 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Product;
use DB;
class ProductController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$list = Product::all();
... | true |
6beaa95737279a3d6af1fdb0fefd4ef418a8fe9b | PHP | tungnd2302/proj_mvc | /backend/models/bill.php | UTF-8 | 1,564 | 2.6875 | 3 | [] | no_license | <?php
require_once('models/model.php');
class bill extends model{
public function getAll(){
$con = $this->connection();
$querySelect = "SELECT bill.*,name FROM bill
LEFT JOIN customers ON bill.customer_ID = customers.ID";
$result = mysqli_query($con,$querySelect);
$bill = [];
if(mysqli_nu... | true |
abfeaf3c668c054c9892f8a8e18340bd8ab14ad3 | PHP | maheshwaghmare/gutenberg | /lib/blocks.php | UTF-8 | 3,700 | 2.71875 | 3 | [] | no_license | <?php
/**
* Functions related to editor blocks for the Gutenberg editor plugin.
*
* @package gutenberg
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'Silence is golden.' );
}
$wp_registered_blocks = array();
/**
* Registers a block.
*
* @param string $name Block name including namespace.
* @param array $settin... | true |
8632da04c98aab81a786a6b6a7ef32738c22e752 | PHP | k4mui/wheel | /includes/validation.php | UTF-8 | 5,949 | 2.75 | 3 | [] | no_license | <?php
require_once(__DIR__.'/pre_processing.php');
function check_password($pwd, & $errors) {
if (strlen($pwd) < 8) {
$errors[] = "Password too short! Must be at least 8 characters long.";
}
if (!preg_match("#[0-9]+#", $pwd)) {
$errors[] = "Password must include at least one number (0-9).";
}
if... | true |
0641b0ae15b3b7192354fe1bbf4486c4c8f150d8 | PHP | Nomilol/php-exercise | /fonctions/exercice5.php | UTF-8 | 92 | 3.234375 | 3 | [] | no_license | <?php
function masse($kilos, $unit){
return $kilos . $unit ;
};
echo masse('70', 'kilos'); | true |
c66e1ed89fa0bab5bed455471335e81549bea3aa | PHP | AlecBach/121site | /app/Http/Controllers/contact.php | UTF-8 | 1,050 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Mail;
class contact extends Controller
{
/**
* The URI to redirect to if validation fails.
*
* @var app('url')->previous(). '#contact'
*/
public function send(Request $request)
{
$this->validate(request... | true |
45ae3e1d036c8fb04dacf605b2ad79e84ee5f7f0 | PHP | sysvyz/hurl | /src/Object.php | UTF-8 | 248 | 2.875 | 3 | [] | no_license | <?php namespace Hurl;
/**
* Class Object
* @package Hurl
*/
class Object
{
public function getHashValue()
{
return spl_object_hash($this);
}
public function equals($other)
{
return $this === $other;
}
} | true |
1d385497611a5024db11675e97d545995d3bd0bf | PHP | Iandresa/sales-management-system-POS- | /gastro_old/classes/boleta.php | UTF-8 | 1,093 | 2.875 | 3 | [] | no_license | <?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of boleta
*
* @author Watanuki
*/
class boleta {
protected $db;
public function __construct()
{
$this->db = new mysql();
}
function nuevaBoleta($id,$impuesto,$... | true |
dfcd27c998f8754315b91d9b3b0b4b156f61d953 | PHP | nicohnavarro/Programacion_III | /01_basico/clase_04/index.php | UTF-8 | 1,819 | 2.53125 | 3 | [] | no_license | <?php
//REMEMBER BEFORE TRYING composer require slim/slim "^3.0"
//TO load folder vendor
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
require 'vendor/autoload.php';
require_once "./entities/archivos.php";
require_once "./entities/vehiculoApi.php"; ... | true |
8697992b708b8e10ce22b89e25311727721a8594 | PHP | Judahh/PHPME | /Website/View/CascadingStyleSheets/Basic/DeclarationSpecifics/DeclarationOutlineSpecifics/OutlineValue.php | UTF-8 | 1,893 | 3.09375 | 3 | [] | no_license | <?php
/**
* OutlineValue [TIPO]
* Descrição
* @copyright (c) year, Tarciso Torres Blue Lion
*/
class OutlineValue {
private $arrayOutlineValue;
private function __construct() {
}
public static function
OutlineValueWithstringOutlineColorWithStringOutlineStyleWithStringOutlineWidth
... | true |
a092208681f3d463e148c0629b1257227d9a4fe6 | PHP | BenDev78/E-Commerce-PHP | /panier.php | UTF-8 | 7,359 | 2.640625 | 3 | [] | no_license | <?php
require_once 'includes/init.inc.php';
if(isset($_POST['ajout_panier']))
{
$req = $bdd->prepare("SELECT * FROM boutique.produit WHERE id_produit = :id_produit");
$req->bindValue(':id_produit', $_POST['id_produit'], PDO::PARAM_INT);
$req->execute();
$produit = $req->fetch(PDO::FETCH_ASSOC... | true |
ac69aa74443244d9adfc44d1d2345df0986c167b | PHP | koera/mamaison.mg | /src/Mamaison/AnnonceBundle/Entity/Gallery.php | UTF-8 | 3,683 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Mamaison\AnnonceBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Gallery
*
* @ORM\Table(name="gallery")
* @ORM\Entity(repositoryClass... | true |
def9ffcd08df2722475f51802f5935733aaec191 | PHP | james090500/Pi-Display | /src/Controllers/AccountController.php | UTF-8 | 1,703 | 2.71875 | 3 | [] | no_license | <?php
Namespace PiDisplay\Controllers;
use PiDisplay\Controllers\Controller;
use PiDisplay\System\Database as DB;
class AccountController extends Controller {
/**
* Shows the home page
* @param Request $request The request
* @param Response $response The response
* @param Array ... | true |
753196e6d6bce8b45291d40564963c1c3711954f | PHP | mcbraga72/agradecaaqui | /app/Http/Requests/UserRequest.php | UTF-8 | 2,040 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UserRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the v... | true |
eba850b17cf4b5d3124bdf04a5e670114764e260 | PHP | KalasseDE/pungent | /notes/index.php | UTF-8 | 1,016 | 2.703125 | 3 | [] | no_license | <?php
require '../lib/util.php';
$GLOBALS['db'] = dbconnect();
function update_notes() {
$db = $GLOBALS['db'];
$uid = hash_valid($db, $_COOKIE['user']);
if($uid !== "invalid" && $uid !== "error") {
$stm = $db->prepare("UPDATE userz SET notes = :notes WHERE uid = :uid");
$res = $stm->execute(array(':no... | true |
d4e42c817b5c1899f802a0b193e4222a102d7243 | PHP | jurispetrovs/resume-maker | /app/Repositories/CountryRepository.php | UTF-8 | 312 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Repositories;
use PragmaRX\Countries\Package\Countries;
class CountryRepository
{
public function getAll(): array
{
$world = new Countries();
$countries = $world->all()->pluck('name.common')->toArray();
sort($countries);
return $countries;
}
} | true |
88a499000534616e51af81a04295b2bbd14fd695 | PHP | anteknik/helpdesk | /includes/classes/classMysql.php | UTF-8 | 5,752 | 2.734375 | 3 | [] | no_license | <?php
class MySQLDB
{
var $functions = array(
'connect' => 'mysql_connect',
'pconnect' => 'mysql_pconnect',
'select_db' => 'mysql_select_db',
'query' => 'mysql_query',
'result' => 'mysql_result',
'query_unbuffered' => 'mysql_unbuffered_query',
'fe... | true |
0f6dfe41b304790d76aa925f896534eef1f71644 | PHP | dougmartin/Tierra-Templates | /src/TierraTemplateStackFrame.php | UTF-8 | 3,691 | 2.71875 | 3 | [] | no_license | <?php
/*
* Tierra Templates - %VERSION%
*
* http://tierratemplates.com/
*
* Copyright (c) 2009 Tierra Innovation (http://tierra-innovation.com)
*
* This project is available for use in all personal or commercial projects under both MIT and GPL2 licenses.
* This means that you can choose the licens... | true |
6b751ec33d78556ac97e9ddc17aebe5515818be1 | PHP | hackbeex/hblog | /database/seeds/ArticlesTableSeeder.php | UTF-8 | 556 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
use App\Tag;
use App\Article;
use Faker\Generator;
use Illuminate\Database\Seeder;
class ArticlesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = app(Generator::class);
$tags = Tag::pluck('id')->toArr... | true |
2e15c17d693a24666145d1b02890d48d7eab004d | PHP | blakekidney/moodle-mod_melem | /settingslib.php | UTF-8 | 1,212 | 2.796875 | 3 | [] | no_license | <?php
/**
* Extends admin settings.
*
* @package mod_melem
* @copyright 2014 Blake Kidney
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
/**
* Creates an administration setting that allows for displaying a block of html
*
* @license http://w... | true |
f7182bf09811a01abc9b54c80f17b6b86517dfde | PHP | AntoineJack/SemaineIntensive_API_Films | /controllers/home.php | UTF-8 | 1,790 | 2.703125 | 3 | [] | no_license | <?php
$title = 'Moovy';
$class = 'home';
$api_key = "c22f2fd9062b5e5c6815c9d14c46f6f2";
if(isset($_GET['id'])){
$index_movie = $_GET['id'];
}
$ch = curl_init();
//curl_setopt($ch, CURLOPT_URL, "http://api.themoviedb.org/3/movie/$index_movie?api_key=$api_key&language=fr");
curl_setopt($ch, CURLOPT_RETURNTRAN... | true |
8797296da4d8080345799b0415882af9f45387b0 | PHP | leominov/league | /src/Controller/PlayersController.php | UTF-8 | 2,889 | 2.53125 | 3 | [] | no_license | <?php
namespace Controller;
use Silex\Application as SilexApplication;
use Symfony\Component\HttpFoundation\Request;
class PlayersController
{
public function player(SilexApplication $app, Request $request)
{
$player = $app['db']->players->findOne(
array(
'_id' => $request... | true |
d195b72e66757330b5fc63a9f65921748bc135e1 | PHP | kohr/HRSymfony2 | /vendor/bundles/Liip/ContainerWrapperBundle/DependencyInjection/ContainerWrapper.php | UTF-8 | 5,526 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace Liip\ContainerWrapperBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ScopeInterface;
/**
* This is a wrapper around a Container instance to provide instances ... | true |
a72b3bac00cbb6ea253853ec49c56139ba9a37f8 | PHP | jiangtian83/yii2cms | /common/models/LiveAudience.php | UTF-8 | 2,160 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace common\models;
use Yii;
use common\behaviors\GuidBehavior;
/**
* This is the model class for table "{{%live_audience}}".
*
* @property string $guid 全局唯一id
* @property string $liveId 直播id
* @property int $audienceId 观众id
* @property int $status 状态,0进入房间,1退出房间,2连麦中
* @property array $userData 用户... | true |
b3cd9e32988d78507c55f8fd1f63f19fa84572b7 | PHP | jrotolo/Fantasy-Football-Buddy | /Fantasy-Football-Buddy-v2.0/application/models/player_model.php | UTF-8 | 600 | 2.625 | 3 | [] | no_license | <?php
class Player_model extends CI_Model {
public function __construct()
{
$this->load->database();
}
public function get_players($slug = FALSE)
{
if ($slug === FALSE)
{
$query = $this->db->get('players');
return $query->result_array();
}
$query = $this->db->get_where('players', array('player_... | true |
db1448e02f3fb622e2a41dff75675739ca72fc03 | PHP | xp-framework/core | /src/main/php/util/Dates.class.php | UTF-8 | 4,314 | 3.390625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php namespace util;
/**
* Dates is a helper class to handle Date objects and
* calculate date- and timestamps.
*
* @test xp://net.xp_framework.unittest.util.DatesTest
* @see https://www.php.net/manual/en/datetime.formats.relative.php Relative formats
* @see https://www.php.net/manual/en/dateinterval.cons... | true |
51b1edc0ddd925d74ae3c07e08adf99b7dc5ba63 | PHP | lufuhu/huilianyi | /app/Admin/Forms/ResetPassword.php | UTF-8 | 1,174 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Admin\Forms;
use App\Models\User;
use Dcat\Admin\Traits\LazyWidget;
use Dcat\Admin\Widgets\Form;
use Dcat\Admin\Contracts\LazyRenderable;
use Illuminate\Support\Facades\Hash;
class ResetPassword extends Form implements LazyRenderable
{
use LazyWidget; // 使用异步加载功能
// 处理请求
public funct... | true |
e13844dccdbbdf84f7ef82b4c2d90e049c5cf1b0 | PHP | Tranngocanh1911/Module_2_lesson_12 | /insertion sort/index.php | UTF-8 | 367 | 3.8125 | 4 | [] | no_license | <?php
$numbers = [5,-4,3,7,2,1,0,8,9,2];
function insertionSort($arr){
for ($i = 0; $i < count($arr);$i++){
$value = $arr[$i];
$j = $i -1;
while($j >=0 && $arr[$j] > $value ){
$arr[$j + 1] = $arr[$j];
$j--;
}
$arr[$j + 1]= $value;
}
return $arr... | true |
ca8993a9d07de765e9135e2dde3245f6cad600ba | PHP | cjsampson/codeup.dev | /public/phpLecture/Flower_Test.php | UTF-8 | 769 | 2.609375 | 3 | [] | no_license | <?php
require_once 'Customer_Flower.php';
require_once 'Order.php';
require_once '/php/functions.php';
// order form has hidden orderNumber
// that submits with the form
if(inputHas('orderNumber')) {
$customer = new Customer();
$customer->name = inputGet('customerName');
$customer->orderNumber - inptGet('orderNum... | true |
e98639bb15ab8c41df2f316e9560f79e8ba538b7 | PHP | J4ckSn0w/VerinteNatural | /backend/database/seeders/CategoriesTableSeeder.php | UTF-8 | 1,631 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Seeders;
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class CategoriesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('categories')->insert([
... | true |
20580a8501808739943bb51dad69e84cf8bedc5c | PHP | vitorfhb/projeto | /admin/usuario.php | UTF-8 | 3,294 | 2.53125 | 3 | [] | no_license | <?php $menu_ativo="usuario"; $TITULO="Usuários";
include 'cabecalho.php';
include_once 'DAO/DAO.usuarios.php';
if (isset($_GET["id"])) {
$usuario = new DAOUsuario();
$reg = $usuario->Buscar($_GET["id"]);
} else{
$reg = new usuario();
}
if(isset($_POST["btnSalvar"])... | true |
c880aaf46a413dc4649ee291299e23dacdaca017 | PHP | biancachien/PHP | /test/1204-01-constants.php | UTF-8 | 143 | 2.921875 | 3 | [] | no_license | <?php
#(一)constants--自訂常數,不區分大小寫,但習慣用大寫
define('TODAY', 1204);
echo TODAY;
#換行使用
echo '<br>';
| true |
a49dbeb94ebe2e781f2be599abe4766a77e2b2bf | PHP | naghirneac/testWeb25oct | /index.php | UTF-8 | 1,188 | 2.84375 | 3 | [] | no_license | <?php
require_once 'vendor/vlucas/valitron/src/Valitron/Validator.php';
$v = new Valitron\Validator($_POST);
$v->rule('required', ['name', 'email','pass', 'confirmPass']);
$v->rule('lengthBetween', 'name', 3, 15);
$v->rule('email', 'email');
$v->rule('contains', 'phone', '+373');
$v->rule('numeric', 'age');
$v->rule('m... | true |
345700b1cc77bb80ed80ff4f4a2d3502d7130f6d | PHP | 1001Pharmacies/geolocation-bundle | /Provider/Bing/Locator.php | UTF-8 | 3,809 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the Meup GeoLocation Bundle.
*
* (c) 1001pharmacies <http://github.com/1001pharmacies/geolocation-bundle>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Meup\Bundle\GeoLocationBundle\Provider\... | true |
3cbd75deaf1617d66829fcb423153aa534077a76 | PHP | pyrsmk/StreetFight | /src/Challenger/ChallengerList.php | UTF-8 | 728 | 3.28125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace StreetFight\Challenger;
use Generator;
use function Funktions\array_to_generator;
/**
* Challenger list
*/
final class ChallengerList implements ChallengerListInterface
{
/**
* The challengers
*
* @var ChallengerInterface[]
*/
private $challenge... | true |
2f45368fca96a92e4519d74a5a0b90c75ea5ee4c | PHP | ASDAFF/hm | /local/modules/WM/lib/Parser/RiolisParser.php | UTF-8 | 1,752 | 3 | 3 | [] | no_license | <?php
namespace WM\Parser;
class RiolisParser
{
public $sections;
public $items;
private $data;
public function __construct($file)
{
$fdata = file_get_contents($file);
$arr = json_decode($fdata, true);
$this->data = $arr['goods'];
$this->getCats();
$this->getItems();
}
public function getCats()
{
... | true |
6c8b8edf74edb21767bd23f3aeb6ae9c115b6965 | PHP | deadkash/samcms | /core/classes/Install.php | UTF-8 | 1,837 | 2.921875 | 3 | [] | no_license | <?php
/**
* Прототип файла установки компонента или модуля
*
* @project SamCMS
* @package Class
* @author Kash
* @since 0.2.4
* @date 17.08.13
* @copyright Copyright (c) 2013, Kash <deadkash@gmail.com>
*/
abstract class Install {
/** @var DB класс для работы с базой данных */
protected $db;
/**... | true |
3f0c5746cb54cbfade47ade4cda35567a3a0cd18 | PHP | David83400/leprof | /Models/AssistanceModel.php | UTF-8 | 2,202 | 3.03125 | 3 | [] | no_license | <?php
namespace LeProf\Models;
use LeProf\Models\Model;
class AssistanceModel extends Model
{
protected $id;
protected $titleMessage;
protected $message;
protected $messageDate;
protected $memberId;
public function __construct()
{
$this->table = 'assistanceMessages';
}
/... | true |
04e3f021b6bf77cdb3aab08fee3c458079cda7f3 | PHP | Peter-Georgiev/PHPWeb | /OOPBasics/Exercises/04.CompanyRoster/Employee.php | UTF-8 | 1,554 | 3.84375 | 4 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/* Problem 04. Company Roster */
class Employee
{
private $name;
private $salary;
private $position;
private $department;
private $email;
private $age;
/**
* Employee constructor.
* @param string $name
* @param float $salary
* @param strin... | true |
0f4df93af610dd740cd16e80527aef707cffda0a | PHP | Exodus4341/findes | /fuel/packages/ninjauth/classes/adapter/sentry.php | UTF-8 | 1,225 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace NinjAuth;
use Sentry;
use Session;
use Str;
class Adapter_Sentry extends Adapter
{
public function is_logged_in()
{
return Sentry::check();
}
public function get_user_id()
{
return Sentry::check() ? Sentry::user()->get('id') : false;
}
public function force_login($user_id)
{
return Se... | true |
53c8e8e33c66d04a62b30d037339c5d64c803d02 | PHP | duytc/ur-api | /src/Pubvantage/Worker/JobCounterInterface.php | UTF-8 | 700 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace Pubvantage\Worker;
interface JobCounterInterface
{
/**
* @param string $key
* @return mixed
*/
public function increasePendingJob(string $key);
/**
* @param string $key
* @return int
*/
public function getPendingJobCount(string $key): int;
/**
*... | true |
b4ff237a16b6ec86a91f995d6d5a667d510fdd35 | PHP | geekwho-eth/learn-programming | /methodology/DesignPattern/AbstractFactory/AbstractFactoryPattern/IShape.php | UTF-8 | 121 | 2.78125 | 3 | [] | no_license | <?php
namespace DesignPattern\AbstractFactory\AbstractFactoryPattern;
interface IShape
{
public function draw();
}
| true |
b6ee9a31667080bff90c735dcfca728f5e4a555b | PHP | seiya0914/myWorks | /Laravel-App/Application/CarRental/database/seeds/CustomerTableSeeder.php | UTF-8 | 632 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use App\Customer;
class CustomerTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Faker\Factory::create();
for($i=0;$i<20;$i++)
{
$customers = array... | true |
0810d059e06daf21ecef34a80b5526c804237e26 | PHP | zhaoduo110/DesignPattern | /App/SimpleFactory/Vehicle/Vehicle.php | UTF-8 | 107 | 2.578125 | 3 | [] | no_license | <?php
namespace App\SimpleFactory\Vehicle;
abstract class Vehicle
{
abstract public function run();
} | true |
1deb0d41b2a1704e61c0dcdc4edecfdab27807cc | PHP | AlissonSteen/ExerciciosBasicosPHP | /List2/q10/index.php | UTF-8 | 348 | 3.5625 | 4 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>Questão 10</title>
</head>
<body>
<?php
$soma = 0;
while($soma <= 1000){
$num = rand(0,100);
$soma+=$t;
echo "Número sorteado = $num : Valor atual da soma = $soma<br>";
};
echo" Encerrado, número 1000 alcançado <br> com a soma final de ($soma) ";
... | true |
1f858bd5a0f5affc45fb9f9092f18a88f4f7726b | PHP | italoSilveira/social-book-network | /app/BookModel.php | UTF-8 | 1,146 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class BookModel extends Model
{
protected $table = "book";
protected $guarded = ['id', 'created_at', 'updated_at'];
public $timestamps = false;
public function author()
{
return $this->belongsTo('App\AuthorModel');
}
pub... | true |
35d8720a10d316e342e063320afe3d9ac717ec2e | PHP | platformbaba/pl | /dams/model/region.model.php | UTF-8 | 5,157 | 2.625 | 3 | [] | no_license | <?php
/* region management */
class region
{
protected $oMysqli;
public function __construct() {
$this->permissions = array();
global $oMysqli;
$this->oMysqli=$oMysqli;
}
// insert a new region
public function addRegion(array $a=array()) {
if($a){
$region_name=$a['regionName'... | true |
c9d2f339b52a7cbe5d16fff7c62ef6632b8502bc | PHP | caesarbonicillo/summer19-web120- | /includes/portal-config.php | UTF-8 | 1,548 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | <?php
/*
portal-config.php
Used to store all of our WEB120 configuration information
*/
//this helps us avoid PHP date errors:
date_default_timezone_set('America/Los_Angeles');
define('THIS_PAGE',basename($_SERVER['PHP_SELF']));
switch(THIS_PAGE){
case 'index.php':
$title = "David's WEB120 Title Pag... | true |
1a3f3aa63ddf7be21061b0ccdb032f57e02d9c23 | PHP | alexisRG08/Proyecto-SIGERH | /programacion/conexion/DataBase.php | UTF-8 | 795 | 2.90625 | 3 | [] | no_license | <?php
require_once ('../../programacion/conexion/conexion.php');
class Database{
public $conexion;
public function __construct()
{
$this->conexionDB();
}
private function conexionDB()
{
if(!($this->conexion = mysqli_connect(host,usuario,contrasenia)))
{
printf('Err... | true |
9a05c660c75098d3ca53da9d8615e7c08628561b | PHP | beingsane/mod_inscritos | /helper.php | UTF-8 | 1,634 | 2.59375 | 3 | [] | no_license | <?php
/**
* @package Joomla.Site
* @subpackage mod_inscritos
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Helper for mod_inscritos
*
... | true |
4ecf4a067b86757d3dbda7e8c22e5d0e4bb3c41f | PHP | mark801117/dao | /src/Updater.php | UTF-8 | 1,468 | 2.96875 | 3 | [] | no_license | <?php
namespace Dao;
use Dao\Strategy\StringStrategy;
use Dao\Tools\Params;
use Dao\Tools\Where;
class Updater extends BaseDao
{
protected $params_handler;
protected $where_handler;
public function __construct($dbh)
{
parent::__construct($dbh);
$this->params_handler = new Params();
... | true |
263eeb4d8580207424e54181fd0593f43cf38c26 | PHP | DrARoberts/Steinheader3 | /php/class/apimailer.php | UTF-8 | 7,145 | 2.8125 | 3 | [] | no_license | <?php
/**
* The new Multimailer class that will carry out the actual sending and will later replace this class.
* If you're writing new code, please use that class instead.
*/
include_once (dirname(__FILE__).'/mail/apimultimailer.php');
/**
* Class for sending mail.
*
* Changed to use the facilities of {@link ... | true |
974a46c81d957c2c5ebd3941d5812995f4446e74 | PHP | taythanzin/taythan | /app/Services/HttpClient.php | UTF-8 | 419 | 2.5625 | 3 | [] | no_license | <?php namespace App\Services;
use App;
use Common\Core\HttpClient as CommonHttpClient;
use Common\Settings\Settings;
class HttpClient extends CommonHttpClient
{
/**
* @param array $params
*/
public function __construct($params = [])
{
$params['timeout'] = 8.0;
$params['verify'] = (bool) App::make(... | true |
f3c5fd2e9c708c6cc66c4454957a0a090bf1b133 | PHP | rilindpozhegu/swisspour | /database/migrations/2017_11_19_143029_cms_page_collections.php | UTF-8 | 1,084 | 2.515625 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CmsPageCollections extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cms_pages_colle... | true |
c37e4cccbba65aef1a206a8209a30fdf67e56c3e | PHP | matcur/php-framework | /framework/Events/Subscriber.php | UTF-8 | 268 | 2.671875 | 3 | [] | no_license | <?php
namespace Framework\Events;
use Framework\App;
abstract class Subscriber
{
/**
* @var App
*/
protected $app;
public function __construct(App $app)
{
$this->app = $app;
}
public abstract function act(Event $event);
} | true |
7f93219bfe105abd73cd4da57c48bc0c4121be6d | PHP | nsbarbosa/blog | /app/Http/Requests/postRequest.php | UTF-8 | 985 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use App\Http\Requests\Request;
class postRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
//return fal... | true |
c111b4ca0add834984505aa7e9206a2f54244006 | PHP | bbroger/Mon-Blog | /modifierArticle.php | UTF-8 | 1,219 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
header('Location: article.php?id='.$article);
}
else{
extract($_GET);//Importe les variables dans la table des symboles
$id = strip_tags($id);// tente de retourner la chaîne str après avoir supprimé tous les octets nuls, toutes les balises PHP et HTML du... | true |
aeb155d3e331b921734e5d67cee3b61fb9d1cd64 | PHP | Md-Rashiduzzaman/sms | /admin/login.php | UTF-8 | 3,316 | 2.5625 | 3 | [] | no_license | <?php
require'dbcon.php';
session_start();
if(isset($_SESSION['useremail_login'])){
header('location:index.php');
//uporer if condition dara url dara login/index page a r jawa jabe na
}
if(isset($_POST['login'])){
// value dhora hosse registration.php er moto
$email = $_POST['email'];
$password = $_... | true |
6723325a189023e60629d41663c06e7b56b7d150 | PHP | croccanova/CS340 | /Final Project - Harry Potter Database/class.php | UTF-8 | 3,177 | 2.765625 | 3 | [] | no_license | <!--
Christian Roccanova
CS 340-400
Final Project
Note: PHP code is based on that found in the week 7 lecture "Live PHP Coding Recording" and it's attached files.
-->
<?php
// Turn on error reporting
ini_set('display_errors', 'On');
// Connects to the database
$mysqli = new mysqli("oniddb.cws.oregon... | true |
7f058f02bde869dccd68c5355b2d60a4da7dbe2f | PHP | kurskiypavel/albi_local | /app/classes/userClass.php | UTF-8 | 986 | 3.03125 | 3 | [] | no_license | <?php
class userClass
{
/**
* @var PDO
*/
private $conn;
public $first_name;
public $id;
public function __construct($db)
{
$this->conn = $db;
}
public function update($id,$first_name,$last_name,$gender,$birthdate,$location,$email,$phone,$about,$password){
... | true |
0733c54080017ff64d27fe7a05dd92b03804d4be | PHP | 00ZRHun/catalog | /newbook.php | UTF-8 | 3,197 | 3.03125 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Book Entry</title>
</head>
<body>
<h1>New Book Entry</h1>
<!-- A HTML form to allow user enters a new book. -->
<!-- Send the form-data to ... | true |
ded8fd438122bb6aec6bf9f688976c99251e82c7 | PHP | alesander1973/blog | /sign_up.php | UTF-8 | 6,418 | 2.65625 | 3 | [] | no_license | <?php
require_once('function/functions.php');
$err = '';
if (isset($_POST['button'])) {
header('location: index.php');
}
if (isset($_POST['submit'])) {
if (empty($_POST['fname'])) {
$err = "You must enter Fname!";
} elseif (empty($_POST['lname'])) {
$err = "You must enter Lname!";
} el... | true |
150d4292282aac678c53b4eb272f422c31aa8669 | PHP | php/pecl-database-mysql_xdevapi | /tests/orabugs/orabug_30093227.phpt | UTF-8 | 4,839 | 2.59375 | 3 | [
"PHP-3.01"
] | permissive | --TEST--
orabug #30093227: mysql_xdevapi\CollectionFind::fields() path fails when ends in number
--SKIPIF--
--FILE--
<?php
/*
bug reported by user
MYSQL JSON - how do I access nested JSON object that's indexed by numerical key?
https://bugs.php.net/bug.php?id=78331
https://stackoverflow.com/questions/57169316/mysql... | true |
18fc169b9e0ac05a12141856228bb1954952f803 | PHP | teamdown/fablab | /application/models/Visite_model.php | UTF-8 | 1,609 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
if(!defined('BASEPATH')) exit('No Direct Script access allowed');
class visite_model extends CI_Model{
private $table= 'visite';
public function __construct(){
parent:: __construct();
}
//LISTE VISITE ACTUEL
public function lister_visite_actuel(){
$this->db->select("*");
$this->db->from(... | true |
88c559eaebb54379dd18bc0b1331b60bb097c2e1 | PHP | quicotte-formations/AtelierPHP7-Console | /fonctions.php | UTF-8 | 950 | 4.25 | 4 | [] | no_license | <?php
/**
* Calcule la factorielle du paramètre $n.
* @param int $n Le nombre dont on calcule la factorielle.
* @return int La facotielle.
*/
function factorielle(int $n):int{
if( $n<=0 )
return 1;
return $n * factorielle($n-1);
}
function multiplieElemsTabPar2PassageParVal(array $tab){... | true |
82c783ea9a2014e3d25b68fe36a74ac038cce09e | PHP | olvert/advent-of-code | /php/src/Day.php | UTF-8 | 465 | 3.421875 | 3 | [] | no_license | <?php
namespace Advent;
use Exception;
abstract class Day
{
abstract protected static function solveA();
abstract protected static function solveB();
public static function factory(int|string $year, int|string $day): Day
{
$class = 'Advent\\Year' . $year . '\\Day' . $day;
if (!class... | true |
19f45a926a4e840a8e04525d28771e8f64118a4b | PHP | habip/autosolutions | /src/AppBundle/Security/Signer/Signer.php | UTF-8 | 546 | 2.921875 | 3 | [] | no_license | <?php
namespace AppBundle\Security\Signer;
class Signer
{
private $keysPath;
private $passphrase;
public function __construct($path, $passphrase)
{
$this->keysPath = $path;
$this->passphrase = $passphrase;
}
public function sign($data)
{
$prvKeyPath = sprintf('file... | true |
e15fbbdf3de01d65d4504c033aa79c17b858c513 | PHP | minhtan893/laravel_employee_management | /app/Http/Models/ScheduleModel.php | UTF-8 | 2,503 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: tannm
* Date: 09/11/2017
* Time: 13:31
*/
namespace App\Http\Models;
use Carbon\Carbon;
use Illuminate\Support\Collection;
class ScheduleModel
{
public $user_id;
public $username;
public $days_on;
public $days_limit;//gothoaqua max
public $days_max =... | true |
fdaa35b07bf2a41f9e427851b51345468b02f7ea | PHP | John2013/redflag_inernship | /7_yii2/frontend/widgets/MovieList.php | UTF-8 | 1,401 | 2.953125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: evgeny
* Date: 10.08.2018
* Time: 11:16
*
* @noinspection CssUnknownTarget
*/
namespace app\widgets;
use backend\models\Movie;
use yii\base\Widget;
use yii\helpers\Html;
/**
* Class MovieList
* @package app\widgets
*/
class MovieList extends Widget
{
/**
* @var... | true |
cbfcd1cd99fdeb76adc29cfcf060cef64fe12f37 | PHP | abelarcos/BaseLaravel | /app/Codydev/Validators/Archivos/ArchivosValidator.php | UTF-8 | 596 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace Codydev\Validators\Archivos;
use Codydev\Abstracts\AValidator;
class ArchivosValidator extends AValidator implements IArchivosValidator{
protected $messages = [
'file.image' => 'El archivo debe ser una foto',
'file.mimes' => 'El archivo debe de ser una de las siguientes extension... | true |
c90157f481aded4b399f5d86fac83326d34fe2c4 | PHP | emilssonn/1DV408 | /Project/src/form/model/ManageQuestion.php | UTF-8 | 2,212 | 3.09375 | 3 | [] | no_license | <?php
namespace form\model;
require_once("./src/form/model/TemplateFormDAL.php");
require_once("./src/form/model/Form.php");
/**
* @author Peter Emilsson
* Handles all question actions
*/
class ManageQuestion {
/**
* @var \user\model\UserCredentials
*/
private $user;
/**
* View that implements \form\mo... | true |
0c28e9aee30be749a661c3e5d65667366f10737c | PHP | NemanjaRanisavljevic/Pulse-Restaurant | /app/Http/Requests/AdminAddPica.php | UTF-8 | 917 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class AdminAddPica extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the ... | true |
cbebd8372df9dfe1900a75edc2925cc52dcbbabb | PHP | ingzepe/zend3 | /module/Usuarios/src/Form/Crear.php | UTF-8 | 2,156 | 2.578125 | 3 | [] | no_license | <?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace Usuarios\Form;
use Zend\Form\Form;
use Zend\Form\Element\Text;
use Zend\Form\Element\Hidden;
use Zend\Form\Element\E... | true |
537cdd1911d544941925fb3d85e589f742362bb0 | PHP | cgxwebs/notedly-api-demo | /src/Controller/ApiHelper.php | UTF-8 | 1,599 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Controller;
use App\Exception\ApiException;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\Validator\ValidatorInterface;
trait ApiHelper
{
protected ValidatorInterface $validator;
protected ?Request $request;... | true |
40894610750b02d326ec00b9a0a1e38be3da481e | PHP | AlexRuiz7/UGR-DS | /P3/app/proyecto/src/Action/ValoracionModifyAction.php | UTF-8 | 1,971 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Action;
use App\Domain\Valoracion\Data\ValoracionData;
use App\Domain\Valoracion\Service\ValoracionModifier;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final class ValoracionModifyAction {
/**
* Servicio
*
* @var ValoracionModifier serv... | true |
f2a61b3052f5c5ebb270468dbee0e3f18e2b20df | PHP | yapep/json-deserializer | /src/JsonDeserializer.php | UTF-8 | 3,265 | 2.6875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Yapep\JsonDeserializer;
use InvalidArgumentException;
use JsonException;
use Yapep\JsonDeserializer\Exception\DeserializerException;
use Yapep\JsonDeserializer\Rule\IUnpackable;
class JsonDeserializer
{
private ProfileRegistry $profileRegistry;
public function __cons... | true |
1dc7449995820d28bc7686c778f8d0c03548c1d3 | PHP | luigif/WsdlToPhp | /samples/cdyne-spell-checker/Check/CdyneSpellCheckerServiceCheck.php | UTF-8 | 2,451 | 2.703125 | 3 | [] | no_license | <?php
/**
* Class file for CdyneSpellCheckerServiceCheck
* @date 03/07/2012
*/
/**
* Class CdyneSpellCheckerServiceCheck
* @date 03/07/2012
*/
class CdyneSpellCheckerServiceCheck extends CdyneSpellCheckerWsdlClass
{
/**
* Method to call CheckTextBodyV2
* Meta informations :
* - documentation : This method... | true |
701e820220b0dc68d4393fa345a023f946de024f | PHP | FMerchan/Ativo | /app/Http/Controllers/CountryController.php | UTF-8 | 536 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use ResponseHelper;
use App\Country;
use Illuminate\Http\Request;
class CountryController extends Controller
{
/**
* Busca todos los entrenamientos.
**/
public function getAll()
{
try {
// Cargo los entrenamientos.
$country = Country::get();
} c... | true |
8e3ae5223d89a257511a98ad02eb7621274f6173 | PHP | boabo/sis_ventas_facturacion | /modelo/MODFormula_v2.php | UTF-8 | 3,882 | 2.515625 | 3 | [] | no_license | <?php
/**
*@package pXP
*@file gen-MODFormula.php
*@author (ivaldivia)
*@date 17-09-2019 15:28:13
*@description Clase que envia los parametros requeridos a la Base de datos para la ejecucion de las funciones, y que recibe la respuesta del resultado de la ejecucion de las mismas
*/
class MODFormula_v2 extends... | true |
b1538f4ca3cb34b56751ee7224e3a5935c032dd0 | PHP | Gazowski/opencart_tp1 | /catalog/controller/information/nouvelle.php | UTF-8 | 5,908 | 2.578125 | 3 | [] | no_license | <?php
/**
* SOLUTION WEB POUR LE COMMERCE ÉLECTRONIQUE
* TP1 - gestion de nouvelles
* controleur nouvelles
*
* A FAIRE:
* - modifier le breadcrumb
* - modifier les métatags
* - faire la vue
*
*/
class ControllerInformationNouvelle extends Controller{
public function index() {
$this->load... | true |
94fa79a4c2bc9549832fff457fd98a5888337abd | PHP | jereelton-devel/silex-player-demo | /api1/vendor/app/src/SilexPlayer/SilexPlayerRandomNumber.php | UTF-8 | 287 | 3 | 3 | [] | no_license | <?php
namespace SilexPlayer;
class SilexPlayerRandomNumber
{
private $randNumberPlayer;
public function __construct()
{
$this->randNumberPlayer = rand(1, 10);
}
public function getRandomNumber()
{
return $this->randNumberPlayer;
}
}
?>
| true |
9eb3ba1ec5be118f0a197c36cde62a20dd7f3b65 | PHP | joaoscaravonatti/trabalho-final-lpgii | /app/Http/Middleware/FinishRegister.php | UTF-8 | 780 | 2.625 | 3 | [] | no_license | <?php
namespace App\Http\Middleware;
use Closure;
class FinishRegister
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (auth()->user()... | true |
c72273f8f1670199055234b99b1696a50de278d2 | PHP | 1PilotApp/prestashop-client | /classes/Middlewares/Authentication.php | UTF-8 | 2,466 | 2.96875 | 3 | [] | no_license | <?php namespace OnePilot\Middlewares;
use OnePilot\Exceptions\OnePilotException;
class Authentication
{
private $hash;
private $stamp;
private $private_key;
public static function register()
{
return new static();
}
/**
* Authentication class
* @throws OnePilotExceptio... | true |
53d70acb499833aefb562bafa23796b158a7e33f | PHP | cborzi/htdocs | /rename/exemplo-01.php | UTF-8 | 395 | 2.78125 | 3 | [] | no_license | <?php
$dir1 = "folder01";
$dir2 = "folder02";
if(!is_dir($dir1)) mkdir($dir1);
if(!is_dir($dir2)) mkdir($dir2);
$filename1 = $dir1 . DIRECTORY_SEPARATOR . "README.txt";
if(!file_exists($filename1)) {
$file = fopen($filename1, "w+");
fwrite($file, date("Y-m-d H:i:s"));
fclose($file);
}
$filename2 = $dir2 . ... | true |
cdccfc73a91dde33f7fc8e22e04288dbb107d2e4 | PHP | mmf-amarcos/dokify-test | /web/test_4.php | UTF-8 | 2,369 | 3.046875 | 3 | [] | no_license | <?php
class Translator
{
private $default_locale;
private $catalog;
public function __construct($catalog, $default_locale) {
$this->catalog = $catalog;
$this->default_locale = $default_locale;
}
public function trans($literal, $locale = null)
{
if (is_null($locale)) {... | true |
d75dde9152e4cd6bfb56e7bc094022bae7e5e217 | PHP | imdong/Single-Mode-Demo | /app/ModeA.class.php | UTF-8 | 352 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* 模式A
*/
class ModeA
{
// 运算模式
public $mode = '+';
// 进行运算
public function run(): string
{
// 生成随机数
$int = rand(1, 10);
// 调用执行
$result = App::App('append', ['ModeA', $this->mode, $int]);
return "{$this->mode}{$int}={$result}";
}
}
| true |
54b5fd3e615a20fb1f9aff7082115abd987510b5 | PHP | Hi-Im-darkness/ClassSurvey | /app/Models/Studentcourse.php | UTF-8 | 803 | 2.578125 | 3 | [] | no_license | <?php
/**
* Created by Reliese Model.
* Date: Sat, 29 Dec 2018 17:51:22 +0000.
*/
namespace App\Models;
use Reliese\Database\Eloquent\Model as Eloquent;
/**
* Class Studentcourse
*
* @property int $id
* @property int $student_id
* @property int $course_id
*
* @property \App\Models\Student $student
* @p... | true |
d6277275bc9ea0cf0ecbcf66f303d16ecb3286ff | PHP | shudeeps/plugins | /plugin/temp.php | UTF-8 | 358 | 3.3125 | 3 | [] | no_license | Array.prototype.contains = function(v) {
for(var i = 0; i < this.length; i++) {
if(this[i] === v) return true;
}
return false;
};
Array.prototype.unique = function() {
var arr = [];
for(var i = 0; i < this.length; i++) {
if(!arr.contains(this[i])) {
arr.push(this[i]);
}
}
return arr;
}
var duplicates = [1,3,4,2,1,2,3,... | true |
0141a29ace492ce352d037e41a5a4a7aa1568757 | PHP | vincent03460/frx | /lib/symfony/response/sfResponse.class.php | UTF-8 | 4,844 | 3.015625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* sfResponse provides methods for manipu... | true |
0d5cbb6b7ddda9739edf5da1046fe76921bdfa49 | PHP | souravwebart/autharanticate-in-php | /signup.php | UTF-8 | 9,808 | 2.53125 | 3 | [] | no_license | <!DOCTYPE html>
<?php require_once("config.php"); ?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign up - Developer Sourav Gupta</title>
<!-- Boostrap css -->
... | true |