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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
387f13b5e89ef75c6add7ae2cbde614e224e362b | PHP | DevelopJKong/php-package | /src/Database/Adaptor.php | UTF-8 | 629 | 2.859375 | 3 | [] | no_license | <?php
namespace Eclair\Database;
class Adaptor
{
private static $pdo;
private static $sth;
public static function setup($dsn,$username,$password)
{
self::$pdo = new \PDO($dsn, $username,$password);
}
public static function exec($query, $params = [])
{
if(self::$sth = sel... | true |
f84a9135c13a533f0eb8a82bd388778871518973 | PHP | BryanErwin/php_bracketpicker | /app/Strategies/IScoreRulesetStrategy.php | UTF-8 | 332 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace App\Strategies;
use App\Bracket;
use Illuminate\Http\Request;
/**
* Interface for how to score a ruleset
*
*/
interface IScoreRulesetStrategy
{
/**
* Create Scores for each bracket processed
*
* @param Bracket
* @return Score
*/
public function process(Bracket $... | true |
c516483236382b43b0331af92aaa25aef88ac4e7 | PHP | 14e28f87/robots-txt-parser | /tests/RobotsTxtParser/TyposDirectiveTest.php | UTF-8 | 943 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace RobotsTxtParser;
class TyposDirectiveTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider generateDataForTest
*/
public function testTyposDirective($robotsTxtContent, array $expectedDisallow)
{
$parser = new RobotsTxtParser($robotsTxtContent);
... | true |
fefd2e4cdcd8448f02879b3c1d1a2a6e24d2d95c | PHP | Amankhalsa/Aman_code-html-php-python | /Apna code/PHP source ode/all/control/ControlStructuresExercise2.php | UTF-8 | 481 | 3.34375 | 3 | [] | no_license | <!doctype html>
<html>
<head>
<title>
Control Structures
</title>
</head>
<body>
<h1>Exercise 2: Easy Table Calculator</h1>
<table border="1" cellpadding="5" cellspacing="3" align="left" >
<?php
for ($i=1; $i <=10 ; $i++) {
echo "<tr>";
for ($j=1; $j <=14 ; $... | true |
0a3ebfb24022471cd4401d7a6bd250db3eaf2cd2 | PHP | kodedara/EasyAdminBundle | /src/Configuration/CrudConfig.php | UTF-8 | 1,727 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace EasyCorp\Bundle\EasyAdminBundle\Configuration;
use EasyCorp\Bundle\EasyAdminBundle\Dto\CrudDto;
/**
* @author Javier Eguiluz <javier.eguiluz@gmail.com>
*/
class CrudConfig
{
use CommonFormatConfigTrait;
use CommonTemplateConfigTrait;
use CommonFormThemeConfigTrait;
private $entityF... | true |
da0c72a02cbddc2315220ece777966da687b8a42 | PHP | guesslara/siscoTest | /clases/clase_fecha.php | UTF-8 | 1,206 | 3.046875 | 3 | [] | no_license | <?php
class fecha {
var $fecha0; var $fecha1;
public function __construct($fecha_mysql)
{
$this->fecha0=$fecha_mysql;
}
function dame_fecha()
{
$meses=array("ENERO","FEBRERO","MARZO","ABRIL","MAYO","JUNIO","JULIO","AGOSTO","SEPTIEMBRE","OCTUBRE","NOVIMEBRE","DICIEMBRE");
$this->fecha1=intval(substr($this->... | true |
110d2fff7e786a10492f9728657ddae7556464ca | PHP | iinux/JohannCarlFriedrichGauss | /simple_tool/zip.php | UTF-8 | 3,381 | 3.125 | 3 | [] | no_license | <?php
//获取文件列表
function list_dir($dir)
{
$result = array();
if (is_dir($dir)) {
$file_dir = scandir($dir);
foreach ($file_dir as $file) {
if ($file == '.' || $file == '..') {
continue;
} elseif (is_dir($dir . $file)) {
$result = array_merge... | true |
56b18b3f675a186a6c8abd06975aa1b2763a62c6 | PHP | netgh0st/mafiaratings | /api/get/games.php | UTF-8 | 17,823 | 2.546875 | 3 | [] | no_license | <?php
require_once '../../include/api.php';
require_once '../../include/game_state.php';
define('CURRENT_VERSION', 0);
class ApiPlayer
{
public $user_id;
public $nick_name;
public $role;
public $death_round;
public $death_type;
public $warnings;
public $arranged_for_round;
public $checked_by_don;
public $ch... | true |
e082bcf5fdc07b4f41af4378c5c5c54fa072f676 | PHP | bkozhabayev/rick-and-morty | /app/Http/Requests/EpisodeStoreRequest.php | UTF-8 | 1,218 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
class EpisodeStoreRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
$season = $this->season;
$series = $th... | true |
aaea3a8b46244997310079220d846723d6a23b2e | PHP | sopheakpsp/backend | /crm/include/functions.php | UTF-8 | 1,078 | 2.921875 | 3 | [] | no_license | <?php
// ================================================
// * Autoload is automatic include the file for you.
// * For prepare when PHP cannot found any thing, cannot found the file that you using that class. it scan your directory
// ================================================
function __autoload($class){
$c... | true |
bd448ae4f1ff46f20cf53336d734829acaebddf6 | PHP | Unnbtg/client_central | /src/MsiClient/Central/Commands/Products.php | UTF-8 | 1,200 | 2.546875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Marco
* Date: 25/02/2016
* Time: 14:23
*/
namespace MsiClient\Central\Commands;
use MsiClient\Central\Commands\Properties\ProductProperties;
class Products extends Command
{
public $url = '/product';
public functi... | true |
3ca218982754547e27e7272ce3d5b31c84427c9f | PHP | RicoAchmad/laravel | /database/seeders/hero.php | UTF-8 | 918 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Seeders;
use DB;
use Illuminate\Database\Seeder;
class hero extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
$data = [
['real_name' => 'Tree', 'hero_name' => 'Groot', 'element' => 'Wood',... | true |
5cab77271d04a038f36654306e7ee0ab834d954f | PHP | ninalouw/typography-wk8 | /backend/admin.php | UTF-8 | 3,558 | 2.5625 | 3 | [] | no_license | <?php include 'back_header.php'?>
<?php
// Start the session
session_start();
?>
<body>
<div class="container admin-container">
<h3 class="text-center">Portfolio Table</h3>
<!-- //get data for table -->
<?php
include "backend_db.php";
db_connect();
i... | true |
562d1752545975c432a59b5c50b40628d513ad32 | PHP | symfony/polyfill | /tests/Intl/Icu/AbstractCollatorTest.php | UTF-8 | 1,409 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Polyfill\Tests\Intl\Icu;
use PHPUnit\Framework\TestCase;
use Sy... | true |
ff7905a6d3733c418764c3b5e0128969fe0d8aac | PHP | MrSir/finance-projections | /app/Pipes/Index/Format.php | UTF-8 | 1,046 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: mtochev
* Date: 5/23/2017
* Time: 9:57 AM
*/
namespace App\Pipes\Index;
use App\Interfaces\Passables\Index;
use App\Pipes\Pipe;
use Closure;
use Exception;
use Throwable;
/**
* Class Format
* @package App\Pipes\Index
*/
abstract class Format extends Pipe
{
/**
... | true |
a02d06c3479e9ec9aa523af3991df2e0fb3d5021 | PHP | octalmage/wib | /php-7.3.0/Zend/tests/generators/yield_from_greedy_parse.phpt | UTF-8 | 268 | 3.046875 | 3 | [
"MIT",
"Zend-2.0",
"BSD-4-Clause-UC",
"BSD-3-Clause",
"LicenseRef-scancode-other-permissive",
"TCL",
"ISC",
"Zlib",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"blessing"
] | permissive | --TEST--
yield from parses too greedily
--FILE--
<?php
function from1234($x) {
return $x;
}
function bar() {
yield 24;
}
function foo() {
yield from1234(42);
yield from(bar());
}
foreach (foo() as $value) {
var_dump($value);
}
--EXPECT--
int(42)
int(24)
| true |
134a56b2762f3c2bb3c490f213994924ff4291f4 | PHP | CraftwithCode/HRMS1 | /admin/employee-tabs/template-contacts.php | UTF-8 | 9,107 | 2.609375 | 3 | [] | no_license | <?php
// $key = $defaultKey = $allFields = '';
// if(isset($_SESSION['gid'])){
// $key = $_SESSION['gid'].'_contact';
// } else {
// $key = 'default_contact';
// }
// $defaultKey = 'default_contact';
$object = new myconn;
try {
$empdata=[];
$con = $object->connection();
if(isset($_GET['id'])){
$em... | true |
77357e621fe475623e545f92e896508720eafa9e | PHP | steam0r/kkl_ligatool | /src/Backend/TeamListTable.php | UTF-8 | 1,474 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace KKL\Ligatool\Backend;
class TeamListTable extends ListTable {
function get_table_name() {
return "teams";
}
function get_search_fields() {
return array('name', 'short_name');
}
/**
* Define the columns that are going to be used in the table
* @return array $columns, th... | true |
70f46c9ba15d5e2bbd7699a2652aa25a1c27198b | PHP | ratchi81/student_age | /index.php | UTF-8 | 788 | 3.5625 | 4 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: romain
* Date: 22/02/16
* Time: 10:13
*/
$students = [
"Emmanuel" => 42,
"Thierry" => 51,
"Pascal" => 45,
"Eric" => 48,
"Nicolas" => 19
];
$ages = [42, 51, 45, 48, 19];
$sum = 0;
for ($i=0; $i<=count($ages); $i++)
{
$sum += $ages[$i]... | true |
bd5303de1e0612e3d4f20dfa468675a64b34f309 | PHP | influxdata/influxdb-client-php | /examples/WriteExample.php | UTF-8 | 1,884 | 3.140625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Shows how to write data to InfluxDB via default API using Point structure or line protocol
*/
require __DIR__ . '/../vendor/autoload.php';
use InfluxDB2\Client;
use InfluxDB2\Point;
//
// Creating client
//
$client = new Client([
"url" => "http://localhost:8086",
"token" => "my-token",
"bu... | true |
8eec2c2a77524e2c2eb2dbca0ede5311ed723759 | PHP | vertig0ne/Organizr | /api/functions/update-functions.php | UTF-8 | 5,265 | 2.609375 | 3 | [] | no_license | <?php
// Upgrade the installation
function upgradeInstall($branch = 'v2-master', $stage)
{
ini_set('max_execution_time', 0);
set_time_limit(0);
$url = 'https://github.com/causefx/Organizr/archive/'.$branch.'.zip';
$file = "upgrade.zip";
$source = dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'upgrade'.DI... | true |
e6f0cbd450ecd31771555606066b844dd882d263 | PHP | azandrew-sidoine/php-txn-contracts | /src/TransactionalProcessorLibraryInterface.php | UTF-8 | 889 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* This file is part of the drewlabs namespace.
*
* (c) Sidoine Azandrew <azandrewdevelopper@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Drewlabs\Txn;
/**
* {@inheritDo... | true |
b58fc374753d8f3dadfe31fd056f9396f84848c3 | PHP | dv4mp1r3/pbot | /Bots/ParentBot.php | UTF-8 | 126 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
declare(strict_types=1);
namespace pbot\Bots;
interface ParentBot
{
public function setParent(IBot $pb): void;
} | true |
706b917400ac2f672ed04c9fc15807253c9b4511 | PHP | MatteoSinigaglia/MyCandies | /backend/classes/MyCandies/Entities/Transaction.php | UTF-8 | 1,545 | 3.09375 | 3 | [] | no_license | <?php
namespace MyCandies\Entities;
use DateTime;
use DB\dbh;
use DB\Exceptions\DBException;
class Transaction {
private $customer_id;
private $cart_id;
private $datetime;
private $address_id;
static public function getAllTransactions(dbh $dbh): array {
$transactionsArray = $dbh->findAll('Transactions');
... | true |
02492a021ecf266a263c6e886e6b0ce4fdc92dd8 | PHP | ogendogen/chessphp | /inc/browse.php | UTF-8 | 1,118 | 2.875 | 3 | [] | no_license | <?php
$db = new Database();
$gamelist = $db->exec("SELECT
game_id,
u1.name AS player_white,
u2.name AS player_black,
finished
FROM games
LEFT JOIN users AS u1 ON games.player_white = u1.user_id
LEFT JOIN users AS u2 ON games.player_black = u2.user_id
WHERE finished = 0 ORDER BY game_id DESC");
ec... | true |
f82bd3b960581d5de3acdc727712a9edb22e44e0 | PHP | garyselios/DAW2_2_2015_PEDIDOS | /src/Controller/UsuarioController.php | UTF-8 | 5,578 | 2.734375 | 3 | [] | no_license | <?php
class UsuarioController extends UsuarioModel {
public function inserir() {
if (isset($_POST['submit'])) {
$this->setNombre($_POST['nombre']);
$this->setApellido($_POST['apellido']);
$this->setUsername($_POST['username']);
$this->setEmail($... | true |
530be903a52f38e8c503295515eb6d6f06a98c89 | PHP | frankb01/zen-attitude | /src/Entity/Technique.php | UTF-8 | 2,469 | 2.765625 | 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\TechniqueRepository")
*/
class Technique
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Co... | true |
dcdc4ec6ab96f0a86f84107e8e72594f983cc498 | PHP | Antoine07/Gen | /src/Compiler/ReplaceString.php | UTF-8 | 560 | 2.953125 | 3 | [] | no_license | <?php namespace Gen\Compiler;
trait ReplaceString
{
/**
* Get the stored template, and insert into the given wrapper.
*
* @param string $data
* @param string $template file template
* @return mixed
*/
protected function insertInto($template, $data)
{
$content = '';
... | true |
1afd005bde10df50d575dbfdfdee5c250d9a6d78 | PHP | cheikhmak/Tracktus | /src/Tracktus/AppBundle/Entity/Label.php | UTF-8 | 959 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace Tracktus\AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Description of Label
* @ORM\Entity
* @author pierre
*/
class Label
{
/**
* Label id
* @var int
* @ORM\Id
* @ORM\generatedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
private $id;
... | true |
56653881905c62e2d10d46d51acaaf1e5bbfcf35 | PHP | hern784/itp405Code | /app/Mail/UserStats.php | UTF-8 | 870 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use App\Models\Artist;
use App\Models\Playlist;
use App\Models\Track;
class UserStats extends Mailable
{
use Queueable, SerializesModels;
p... | true |
d3a13bf20f6c8f9920cebf8abad36873ab2fffcf | PHP | lensKamdem/lFramework | /lFramework/db/Database.php | UTF-8 | 1,134 | 2.625 | 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 LFramework\Db;
/**
* Description of Database
*
* @author Lens
*/
use LFramework\Base\Component ... | true |
f3e6efee958716e1100190eec6bb12c5fca06bf5 | PHP | xiaorenwulinian/tp60_huamanyuan | /sundry/design_pattern_old/simpleFactoryPattern/simpleTest003.php | UTF-8 | 907 | 3.546875 | 4 | [
"Apache-2.0"
] | permissive | <?php
/**
* 以计算器为例
*/
class Calculator
{
public function __construct()
{
}
public function getResult($operate,$a,$b)
{
return call_user_func_array([new Operator(),$operate], [$a,$b]);
}
}
/**
* 操作符号类
*/
class Operator
{
public function __construct()
{
# code...
}
public function add($a,... | true |
f080a0f94686c8f99606630282469332fc57deaf | PHP | kingston-enterprises/icarus-framework | /Router.php | UTF-8 | 4,887 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php
/**
* @author kingston-5 <qhawe@kingston-enterprises.net>
* @package icarus
* @license For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace kingston\icarus;
use kingston\icarus\exception\NotFoundException;
/**
* Custom UR... | true |
51fd4651937f59367e8543ca3d83b4d697913150 | PHP | ypersyntelykos/CursoLaravelPlazti | /controllers/HomeController.php | UTF-8 | 398 | 2.671875 | 3 | [] | no_license | <?php
class HomeController
{
public function indexAction()
{
return new View('home' , ['titulo' => 'Clase 2']);
}
}
/* TODO ESTO SE VA A VOLVER UN OBJETO
$private="Datos Privados";
$language="PHP";
$titulo="SuperPHP";
*/
/*Llamar función PHP
view('view', ['language' => $language, 'titulo' => $titulo]);*... | true |
a085ea5280457783c754b5a7ce4b7f7e7cb9a9ea | PHP | Demerso/HTML-Editor | /login.php | UTF-8 | 1,356 | 2.75 | 3 | [] | no_license | <?php error_reporting(E_ERROR | E_PARSE);
$cipher = 'aes128';
$key = file_get_contents("/home/odemers/encryptkey");
$unlimited = time() + (10 * 365 * 24 * 60 * 60);
$username = htmlspecialchars($_POST["username"]);
$pass = openssl_encrypt($_POST["pass"], $cipher, $key);
$remember = array_key_exists("remember", $_POST... | true |
03909e0f4b2358580cd8ae2a86498b0b4bb2236a | PHP | AmerShadow/laravel_service_container | /app/Billing/CreditPaymentGateway.php | UTF-8 | 867 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Billing;
class CreditPaymentGateway implements PaymentContract{
public $currency,$discount,$fees,$amount;
public function __construct($currency) {
$this->currency = $currency;
$this->discount = 0;
}
public function makePayment()
{
$this->fees=$thi... | true |
eb00bb29117901aa1e23fcb17b9dbb019a0a89d2 | PHP | bolleboris/mymob | /BMUMigration/Wheels4AllPersonMigrator.php | UTF-8 | 9,406 | 2.625 | 3 | [] | no_license | <?php
class Wheels4AllPersonMigrator {
public function test() {
}
public function run() {
$dbConn = $this->connectDatabase();
$limit = 50;
$offset = 0;
$records = $this->getPersonRecords($dbConn, 0, $limit);
$addresses = $this->getAddresses($dbConn);
$chips = $this->getChips($dbConn);
... | true |
7752b65ebfdf14210ebf02e5536fd061b6a56be1 | PHP | juvenal007/Ganimides | /application/controllers/inventarios.php | UTF-8 | 10,850 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* 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.
*/
/**
* Description of inventario
*
* @author JuvenaL
*/
clas... | true |
26b5df560f352e5b2ba59a44a37a9077566d0b7c | PHP | jagan387/carpool | /DBUtil.php | UTF-8 | 1,225 | 3.40625 | 3 | [] | no_license | <?php
class DBUtil {
// Store the single instance of Database
private static $singletonInstance;
private $dbHost = 'localhost';
private $dbUser = 'root';
private $dbPass = 'jagan';
private $dbName = 'carpool_db';
// ... | true |
e087716d3b7ab2aadb7cc1cfaefd20f3eafbabe3 | PHP | moccalotto/valit | /src/Providers/XmlCheckProvider.php | UTF-8 | 4,657 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the Valit package.
*
* @author Kim Ravn Hansen <moccalotto@gmail.com>
* @copyright 2018
* @license MIT
*/
namespace Valit\Providers;
use SimpleXMLElement;
use BadMethodCallException;
use Valit\Result\AssertionResult as Result;
use Moccalotto\Exemel\Xml as XmlInspector;
use Vali... | true |
4f6ef2fd9d214d21066ced1929c029b8270a181e | PHP | dr-divago/spider | /DbManager.php | UTF-8 | 761 | 2.765625 | 3 | [] | no_license | <?
class DbManager {
private $nomehost = "localhost";
private $nomeuser = "root";
private $password = "pelicano";
private $attiva = false;
private $connessione;
public function __construct() {
}
public function connect() {
if ($this->attiva == false)
{
$this->connessione = mysql_connect($this->nomehost,... | true |
af8a932d25fb36510c8fbb04459c9990b94df6de | PHP | TanguyS/wp-angular | /functions/admin/custom_post_types.php | UTF-8 | 4,187 | 2.59375 | 3 | [] | no_license | <?php
// Custom Post types
// =============================================================================
// post_type_singular, plural lowercase
function register_type( $post_type_singular, $post_type_plural, $options = array() ) {
$text_domain = 'sgdf';
$labels = array(
'name' => _x( ucwords( $... | true |
32186f08753df01419eabfdb8b16fa9e6ba03436 | PHP | robrogers3/forum | /fcsv.php | UTF-8 | 340 | 3.109375 | 3 | [] | no_license | <?php
$lines = [];
$f = fopen('php://memory', 'w+');
for ($i= 0;$i < 20; $i++) {
$line = [];
for ($j = 0; $j < 4; $j++) {
$line[] = '" ' . uniqid() . ',' . uniqid() . '"';
}
$lines[] = implode('::', $line);
}
fputcsv($f, $lines);
rewind($f);
$contents = stream_get_contents($f); //=> "fooba... | true |
4be0ccb2edcd06b8b4d45125be33db14dbc144e4 | PHP | hankin-h-k/color | /app/Services/MessageService.php | UTF-8 | 2,418 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Services;
use App\Models\Message;
class MessageService
{
/*
* 检查是否合法
* 1. 正常返回false
* 2. 失败返回原因
*
* todo:
* 1. 只有最近, 旧的失效
*/
public function check($mobile, $code){
if(!$code){
return '请填写验证码';
}
//测试用万能验证码
// ... | true |
b2adc05c981c17e8622bf3054b0bbb99c6c913e9 | PHP | jcespinoza13/EF_BackEnd | /motor.php | UTF-8 | 1,678 | 2.734375 | 3 | [] | no_license | <?php
$tipoSelect = $_POST['type'];
getSelect($tipoSelect);
function getSelect($tipoSelect){
$data_file = fopen("./data/data-1.json","r");
$data_readed = fread($data_file, filesize("./data/data-1.json"));
// echo fread($data_file, filesize("./data/data-1.json"));
$data = json_decode($data_readed, true);
f... | true |
445d21cc4da1270c19641c496b7287973da0a4e3 | PHP | thedevdojo/laravel-reactions | /tests/Integration/ReactableModelTest.php | UTF-8 | 1,883 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace DevDojo\LaravelReactions\Tests\Integration;
use Illuminate\Database\Schema\Blueprint;
use DevDojo\LaravelReactions\Models\Reaction;
use DevDojo\LaravelReactions\Tests\Integration\Support\PostTestModel;
use DevDojo\LaravelReactions\Tests\Integration\Support\UserTestModel;
class ReactableModelTest exte... | true |
40dbf604d1cba59cd91840c889cad4ee2f46b174 | PHP | joey2017/laravel-jwt-api | /src/Auth/LoginActionTrait.php | UTF-8 | 3,020 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace Leezj\LaravelApi\Auth;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Leezj\LaravelApi\Jobs\SaveUserTokenJob;
use Tymon\JWTAuth\Exceptions\TokenExpiredException;
use Tymon\JWTAuth\Facades\JWTAuth;
trait LoginActionTrait
{
/**
* Ge... | true |
52cd531f60da0cefc1cad9cd3421c21c83f6e5f9 | PHP | ChenJiR/leetcode.php | /findBestValue.php | UTF-8 | 833 | 3.71875 | 4 | [] | no_license | <?php
/**
* 1300. 转变数组后最接近目标值的数组和
* Class FindBestValueSolution
* https://leetcode-cn.com/problems/sum-of-mutated-array-closest-to-target/
*/
class FindBestValueSolution
{
/**
* 排序后逐个比对 复杂度 O(nlogn + n) 比二分法复杂度高
* @param Integer[] $arr
* @param Integer $target
* @return Integer
*/
... | true |
27a8944562e3b9bceddc0a0eea5de591a7b83617 | PHP | toun0u/CaamhroApi | /app/modules/system/class_webmail_email.php | UTF-8 | 28,758 | 2.640625 | 3 | [] | no_license | <?php
require_once DIMS_APP_PATH.'include/class_dims_data_object.php';
require_once DIMS_APP_PATH.'modules/doc/class_docfile.php';
/**
* @author NETLOR CONCEPT - Simon LIEB
* @version 1.0
* @package WebMail
* @access public
* @see webmail_inbox
*/
class webmail_email extends dims_data_object
{
private $m_a... | true |
3ec6afc6fc159c5f626100f1c25a3bb01d7ef9ef | PHP | tierney12/DTSinternship | /app/Repositories/StaffRepository.php | UTF-8 | 708 | 2.796875 | 3 | [] | no_license | <?php
namespace App\Repositories;
use App\Models\Staff;
use InfyOm\Generator\Common\BaseRepository;
/**
* Class StaffRepository
* @package App\Repositories
* @version August 21, 2018, 12:41 pm BST
*
* @method Staff findWithoutFail($id, $columns = ['*'])
* @method Staff find($id, $columns = ['*'])
* @method St... | true |
caac4006ab264a0b57710bc92373411420ad4b67 | PHP | Mwangimburu/table_banking | /app/Http/Controllers/Api/BorrowerController.php | UTF-8 | 2,729 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* Borrower: kevin
* Date: 26/10/2018
* Time: 12:10
*/
namespace App\Http\Controllers\Api;
use App\Http\Requests\BorrowerRequest;
use App\Http\Resources\BorrowerResource;
use App\SmartMicro\Repositories\Contracts\BorrowerInterface;
use Illuminate\Http\Request;
class BorrowerCont... | true |
25049735c49dacb1ea9fd2ba37f931aa2b224510 | PHP | drlenux/WorkersRun | /src/IWork.php | UTF-8 | 257 | 2.515625 | 3 | [] | no_license | <?php
namespace DrLenux\WorkersRun;
/**
* Interface IWork
* @package src
*/
interface IWork
{
/**
* @param Messenger $messenger
* @return MessengerResponse|null
*/
public function run(Messenger $messenger): ?MessengerResponse;
}
| true |
7541881be13cf16eb88c809b9f7164273136e8b3 | PHP | lga37/cursophp1 | /aula3.php | WINDOWS-1252 | 645 | 3.65625 | 4 | [] | no_license | <?php
$a = 5;
$b = 4;
$c = $a+$b;
$d = $a*$b;
#echo $d;
for($i=0; $i<=20; $i++){
# echo $i .' ';
# echo $i%2==0?"par" : "impar";
# echo "<br>";
}
$a = 10;
$b = "string qq";
$c = 3;
#$c = $c + $a;
$c += $a;
#echo $c;
$a = 10;
$b = "10";
#echo $a > $b;
#echo ($a === $b)?'TRUEEE':'... | true |
b15a40d1753da661b5e4763fe774c1a0359654dd | PHP | jefhar/laravel-domain-oriented | /database/seeds/UsersTableSeeder.php | UTF-8 | 1,777 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
use App\Admin\Permissions\UserRoles;
use App\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Hash;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
/*... | true |
839e20a2b0a37f14a595da670c355654a075790b | PHP | sellerlabs/nucleus | /src/SellerLabs/Nucleus/Data/TraversableLeftFoldable.php | UTF-8 | 2,689 | 3.09375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace SellerLabs\Nucleus\Data;
use SellerLabs\Nucleus\Control\Maybe;
use SellerLabs\Nucleus\Data\Interfaces\LeftFoldableInterface;
use SellerLabs\Nucleus\Data\Interfaces\ReadMapInterface;
use SellerLabs\Nucleus\Exceptions\CoreException;
use SellerLabs\Nucleus\Foundation\BaseObject;
use SellerLabs\Nucleus\Su... | true |
74eeea907ed7793498b120315dcc300e39b5fa8f | PHP | synchrovision/catpow | /classes/inputs.php | UTF-8 | 2,722 | 2.953125 | 3 | [] | no_license | <?php
namespace Catpow;
/**
* ユーザー入力を保持するためのクラス
* data_pathまたはinput_idを用いて
* データを操作するメソッドを提供する
*/
class inputs{
public $name,$data;
public function __construct($name,$data){
$this->name=$name;
$this->data=$data;
}
public function &ref($data_path,$key='value'){
$sel=self::selector_from_path($data_path,$key)... | true |
3f70db18dd40fce97a6241fa35f21785bfb166f0 | PHP | Spameri/Elastic | /tests/SpameriTests/Elastic/Data/Entity/Person/Character.php | UTF-8 | 2,494 | 2.65625 | 3 | [] | no_license | <?php declare(strict_types = 1);
namespace SpameriTests\Elastic\Data\Entity\Person;
class Character implements \Spameri\Elastic\Entity\EntityInterface
{
/**
* @var \SpameriTests\Elastic\Data\Entity\Property\ImdbId
*/
private $id;
/**
* @var \SpameriTests\Elastic\Data\Entity\Property\ImdbId|null
*/
priva... | true |
e7ca3f148688097c3ef0209d5eed3cec8b44ac21 | PHP | Jordan-JACOBI/Booking | /model/input.php | UTF-8 | 447 | 3.296875 | 3 | [] | no_license | <?php
class Input extends FormEntry
{
private $type;
private $value;
public function __construct($name, $label, $type, $value)
{
parent::__construct($name, $label);
$this->type = $type;
$this->value = $value;
}
public function __toString()
{
return parent::__toString().
... | true |
e42b67fe59faab8e9bdc73d79ab2b3684ffe2822 | PHP | saadbruno/raspi-dashboard | /lib/view_functions.php | UTF-8 | 1,365 | 2.828125 | 3 | [] | no_license | <?php
// disk usage with progress bars
// https://getbootstrap.com/docs/4.4/components/progress/
function print_disk_usage($disks_info)
{
foreach ($disks_info as $disk_name => $disk_info) {
?>
<div class="mb-3">
<h3 class="disk_name"><?= $disk_name ?></h3>
<div class="progress">
<div... | true |
d42a360891bc0212f6bd68d120f82e60abe1093b | PHP | iamfil/netForum-xWeb-APi | /netForum/xWeb/Xml/Generated/WEBCentralizedShoppingCartMembershipOpenInvoiceAddResponse.php | UTF-8 | 1,409 | 2.546875 | 3 | [] | no_license | <?php
namespace netForum\xWeb\Xml\Generated;
class WEBCentralizedShoppingCartMembershipOpenInvoiceAddResponse
{
/**
* @var CentralizedOrderEntryType $WEBCentralizedShoppingCartMembershipOpenInvoiceAddResult
*/
protected $WEBCentralizedShoppingCartMembershipOpenInvoiceAddResult = null;
/**
... | true |
c64b313e51e6a231c7d48378d47c29d477f92f77 | PHP | vasily-kartashov/http-message | /tests/Response/status_004.phpt | UTF-8 | 279 | 2.71875 | 3 | [
"MIT"
] | permissive | --TEST--
Response::withStatus() with an unknown status code
--FILE--
<?php
$response = new HttpMessage\Response();
$newResponse = $response->withStatus(990);
var_dump($newResponse->getStatusCode());
var_dump($newResponse->getReasonPhrase());
?>
--EXPECT--
int(990)
string(0) "" | true |
301424661a0f3526d6db225752d453b843ed3bdb | PHP | vano20/udemy_oop | /class_inheritance.php | UTF-8 | 233 | 3.1875 | 3 | [] | no_license | <?php
/**Class Mobil
*
*/
class Mobil {
//properties
var $wheels = 4;
//methods
function gretting(){
return "halo";
}
}
$inova = new Mobil();
class Truk extends Mobil{
}
$dyna = new Truk();
echo $dyna->wheels;
?> | true |
227e416fd79d79b4e0dc2387a7f45c1da4731e2e | PHP | juliorojas81871/Pong-Website | /apis/fetch_profile.php | UTF-8 | 841 | 2.625 | 3 | [] | no_license | <?php
include('db.php');
session_start();
if(isset($_SESSION['logged_in']) && isset($_SESSION['username']))
{
if($_SESSION['username'] != "")
try
{
$username = $_SESSION['username'];
$profile_data = [];
$query = mysqli_query($con, "SELECT * FROM users WHERE username ='".$username."'");
i... | true |
b2b8ca87b6677b0ebe8aa7183dfff89a620d7e83 | PHP | ununik/ks | /models/Classes/HTML.class.php | UTF-8 | 1,327 | 2.984375 | 3 | [] | no_license | <?php
class HTML extends Connection
{
private $_pageTitle = 'KS Děčín';
private $_getPage = 'home';
private $_scripts = '';
private $_navigation = array();
private $_footerNavigation = array();
private $_content = '';
//GET PAGE
public function setGETPAGE($new)
{
$this->_get... | true |
b3b5bc23509c64b0347b9a73f66ce7ac34935f88 | PHP | haryasa/laravel-sample-basic-task-list | /app/Http/Controllers/TasksController.php | UTF-8 | 1,442 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Task;
class TasksController extends Controller
{
/**
* Display a listing of tasks with form for adding new task.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$tasks = Task::orderBy('crea... | true |
f42a568286574c81b8110135ad2115d34f989661 | PHP | tranchithanh/PHP26 | /D1/demo03.php | UTF-8 | 371 | 2.796875 | 3 | [] | no_license | <ul>
<?php
for ($i=1; $i < 8; $i++) {
echo "<li><a href='#'>Trang {$i}</a></li>";
}
?>
</ul>
<ul>
<?php
for ($i=1; $i < 8; $i++) {
?>
<li>
<a href="#">Trang <?php echo $i; ?></a>
</li>
<?php
}
?>
</ul>
<style type="text/css">
ul{
list-style: none;
width: 500px;
margin: 20px auto;
}
ul l... | true |
a2f457ddc119322c07873c9d6198bfb4b493d580 | PHP | MarynaMakarchuk/arrays_loops_tasks | /4.php | UTF-8 | 563 | 3.375 | 3 | [] | no_license | <?php
$arr = array('green'=>'зеленый', 'red'=>'красный','blue'=>'голубой');
foreach ($arr as $key => $color){
echo $key . "\n";
}
echo "\n";
foreach ($arr as $key => $color){
echo $color . "\n";
}
/*
* Дан массив $arr. С помощью первого цикла foreach выведите на экран столбец ключей, с
помо... | true |
74a0cfbea2ac6fb940abc4a73ece0b0ec523ac65 | PHP | abchilders/web-apps | /public_html/hw12/select_action.php | UTF-8 | 1,051 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | <?php
/* Alex Childers
Last modified: 2019/05/05
*/
/* Function: select_action
Purpose: Expects a username and password; returns nothing. Destroys the
session if the username or password is invalid. Otherwise, displays
some options for actions that the user can take.
*/
function select_action(... | true |
daf9ec5a29597931c6d285f434ba6fb4d58d723d | PHP | nomicms/NomiCMS | /system/classes/DB.php | UTF-8 | 931 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
Class DB {
public $db = NULL;
public function __construct()
{
require_once(R.'/system/db_config.php');
$this->db=new mysqli(server, user, pass, db);
if($this->db->connect_errno)
{
echo 'Connect failed: Error connecting to MySQL database';
exit();
}
$this->db->set_charset('utf8mb4');
}
... | true |
053fdf2391e529ce5a163d8cf3e0cb040d4ff838 | PHP | 1ntel/lada-garantia-rss | /update.php | UTF-8 | 9,604 | 2.78125 | 3 | [] | no_license | <?php
error_reporting( E_ALL ); // E_ERROR, 0
date_default_timezone_set( 'Europe/Moscow' );
class Cookies {
//TODO make inherit from Storage
public $path;
public $store;
private $oldCookies;
function __construct($path) {
$this->path = $path;
if (file_exists($this->path)) {
$this->sto... | true |
8d2c80cb85b70445ff08e1000abbba9256bb79c5 | PHP | breme86/evocell | /pcfb/examples/chartform.php | UTF-8 | 1,571 | 3.0625 | 3 | [] | no_license | <html>
<body>
<code>
<strong>A plot of my data </strong><br>
<?php
checkforinput(); // defined below
$filename = "data.txt";
$data = file($filename);
// $data are an array in the format 1,2,3,100 or on their own lines
// add new data with echo "100" >> ~/Sites/data.txt
//http://chart.apis.google.com/chart?cht=l... | true |
aabe745b3050c0c4e394c326c71d52217c531c2b | PHP | cultuurnet/uitpas-beheer-silex | /src/CardSystem/Specifications/InAnyOfCardSystems.php | UTF-8 | 1,080 | 2.75 | 3 | [] | no_license | <?php
namespace CultuurNet\UiTPASBeheer\CardSystem\Specifications;
use CultuurNet\UiTPASBeheer\CardSystem\BelongsToCardSystemInterface;
use CultuurNet\UiTPASBeheer\CardSystem\CardSystem;
use CultuurNet\UiTPASBeheer\CardSystem\CardSystemCollection;
class InAnyOfCardSystems
{
/**
* @var CardSystemCollection
... | true |
eb87ac7c52a843606e6910d6335a9ecb1e2b99f6 | PHP | organisatietest/phpproject1 | /h09_databanktoegang/h9opg4/overzicht.php | UTF-8 | 1,080 | 2.84375 | 3 | [] | no_license | <?php
require_once("Film.php");
require_once("Filmlijst.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset=utf-8>
<title>films</title>
</head>
<body>
<h1>alle films</h1>
<?php
$tab = $filmLijst->getLijst();
?>
<ul>
<?php
... | true |
26c4fa11b17c81c1384f86e659f785dc52436d56 | PHP | imiphp/imi | /src/Db/Query/Result/BaseChunkResult.php | UTF-8 | 354 | 2.515625 | 3 | [
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-mulanpsl-1.0-en",
"MulanPSL-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace Imi\Db\Query\Result;
abstract class BaseChunkResult implements \IteratorAggregate
{
#[\ReturnTypeWillChange]
abstract public function getIterator();
public function each(): \Generator
{
foreach ($this as $result)
{
yield from $resu... | true |
5e770ba7ae66b70f409c3cbb68cba9f8d38674d0 | PHP | thyagopacher/piracanjuba | /apps/backend/controllers/home/views/_publishBox.php | WINDOWS-1250 | 1,753 | 2.578125 | 3 | [] | no_license | <!-- PublishForm -->
<div id="boxPublish" class="box">
<h3>{Publish}</h3>
<div>
<?php
$select = new FuriousSelect($this->statusFieldName, "{Status}", $this->statuses);
$select->setFormContainer($this->container);
$sts = ($this->content->getStatus() == "8")?0:$this->content->getStatus();
$select->setVa... | true |
a009fbfa427c588fe5afb241b51c15cf956f3c8b | PHP | tpedretti/Old-Projects | /ncc/classes/session.php | UTF-8 | 905 | 3 | 3 | [] | no_license | <?php
class session {
public static function start() {
session_start();
}
public static function userLogout() {
session_start();
$_SESSION['userName'] = '';
$_SESSION['loggedin'] = FALSE;
session_destroy();
}
public static function isSessionStarted() {
... | true |
39dcce91178bbc6909d120fef1ddf2b172882367 | PHP | FaisalAli123/Project | /app/Http/Controllers/ItemsController.php | UTF-8 | 2,847 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Platform;
use App\Item;
class ItemsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
//display all items on items page
public function index()
{
... | true |
c472a4a09d91a3705787232540e8e52ea94a0385 | PHP | MattBarcroft/Total-Touchdowns | /bets/settlebets.php | UTF-8 | 1,808 | 2.78125 | 3 | [] | no_license | <?php
include("../includes/head.php");
?>
<?php
include("../includes/navbar.php");
?>
<div class=container>
<?php
$settlingbetsFactory = new settlingbetsFactory();
$rows = $settlingbetsFactory->get_unsettled_bets();
?>
<h3>Bets Updated</h3>
<table class="table">
<tr>
... | true |
43ca05e5232456c911e1cac1ab22e7ed0e4ee229 | PHP | liugene/log | /src/Log.php | UTF-8 | 1,920 | 2.765625 | 3 | [] | no_license | <?php
namespace linkphp\log;
class Log
{
//保存日志存储大小
static private $_log_size = 1048576;
static private $log_path = RUNTIME_PATH . 'log/';
//设置日志保存大小
public function setLogSize($size)
{
if(is_numeric($size)){
self::$_log_size = $size;
}
return $this;
}... | true |
2e78965c9b1a05624fde3a1480327d5d06c96a35 | PHP | MajorGrinch/CSE503M5-G | /getUserEvents.php | UTF-8 | 704 | 2.640625 | 3 | [] | no_license | <?php
ini_set("session.cookie_httponly", 1);
session_start();
require 'database.php';
if(!isset($_SESSION['user'])){
print(json_encode("login"));
exit;
}
$username = $_SESSION['user'];
$userid = (int)$_SESSION['userid'];
$stmt = $mysqli->prepare("select eve_id, title, eve_date, latitude, longitude from events where... | true |
7ea038c690a6343267a4cb3f1619b79c8076f9d8 | PHP | Dent24/shoppingCart | /MVCmod/controllers/memberController.php | UTF-8 | 1,373 | 2.734375 | 3 | [] | no_license | <?php
require_once './models/memberModel.php';
session_start();
class memberC {
public $result;
public function __construct(){
$this->result = new memberM();
}
public function showList(){
$list = $this->result->detail();
$show = "";
foreach($list as $key=>$value){
... | true |
651695eb455c06f8ee338b9052b6e73d24bd3203 | PHP | bemtorres/PDO-Reflect | /REST/ProductsController.php | UTF-8 | 202 | 2.578125 | 3 | [] | no_license | <?php
class ProductsController {
public function index() {
return '<h1>Lista de productos</h1>';
}
public function show($name) {
return '<h1>Detalles del producto: ' . $name . '</h1>';
}
}
| true |
c9f012a142ac834ff86df72edde6a24e479d6310 | PHP | sinbadxiii/phalcon-permission-example | /app/controllers/ErrorController.php | UTF-8 | 421 | 2.546875 | 3 | [] | no_license | <?php
class ErrorController extends ControllerBase
{
protected bool $authAccess = false;
public function error403Action()
{
$this->response->setStatusCode(403 , 'Forbidden');
if ($this->request->isAjax() ) {
$this->jsonResponse([ 'success' => false , 'message' => '403' ]);
... | true |
8f651ae464c23405b75c22042e152352c82d5635 | PHP | cfelbacq/piscine-php | /j01/ex02/oddeven.php | UTF-8 | 422 | 3.125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/php
<?php
while (1)
{
echo "Entrez un nombre: ";
if (($line = fgets(STDIN)) == False)
{
echo "\n";
exit(0);
}
$line = substr($line, 0, -1);
if (is_numeric($line) == true && strlen($line) > 0)
{
if ($line % 2 == 0)
echo "le chiffre ".$line." est Pair\n";
else
echo "le... | true |
aa5f9d7a37c7a407082326518af20a8413dbd838 | PHP | oxyberg/transport-app | /lib/RailTransport.php | UTF-8 | 293 | 2.8125 | 3 | [] | no_license | <?php
class RailTransport extends AbstractTransport
{
private $numberOfCarriages;
public function getNumberOfCarriages()
{
return $this->numberOfCarriages;
}
public function setNumberOfCarriages($value)
{
$this->numberOfCarriages = $value;
}
}
| true |
e037550c641f2619aefd5d643418d922e6478b82 | PHP | oilstone/logging | /src/Integrations/Laravel/Factories/CloudWatchLogger.php | UTF-8 | 569 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Oilstone\Logging\Integrations\Laravel\Factories;
use Exception;
use Monolog\Logger;
use Oilstone\Logging\Handlers\CloudWatch;
use Oilstone\Logging\Managers\Manager;
/**
* Class CloudWatchLogger
* @package Oilstone\Logging\Integrations\Laravel\Factories
*/
class CloudWatchLogger
{
/**
* Cr... | true |
4ba846f6f2302a0f4faa351779a24cb537cf9021 | PHP | dantoncancella/dms-filter | /src/DMS/Filter/Filters/EntityManagerFilter.php | UTF-8 | 386 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace DMS\Filter\Filters;
/**
* Interface EntityManagerFilter
*
* Allows filters to be access Doctrine Entity Manager.
*
* @package DMS\Filter\Filters
*/
interface EntityManagerFilter
{
/**
* Set the Doctrine Entity Manager
*
* @param \Doctrine\ORM\EntityManager $em
*/
pub... | true |
1bff90345274e90167d614900f9c688a808ea841 | PHP | BackupTheBerlios/homeslash | /homeslash/inc/actions.inc.php | UTF-8 | 1,245 | 2.671875 | 3 | [] | no_license | <?php
/*
File: actions.inc.php
Purpose: the /home actions.
*/
// id = action id, as described in main.inc.php
function action_login() // Logs user $user into system.
{
$username = $_POST['username'];
$password = $_POST['password'];
$where = "username='".$username."' AND password=PA... | true |
f4af63a5d08447bfa02022bba29db38a2238cab1 | PHP | UASPoly/epoly | /Modules/Department/Services/HasProgramme.php | UTF-8 | 3,230 | 2.71875 | 3 | [] | no_license | <?php
namespace Modules\Department\Services;
use Modules\Student\Entities\Programme;
use Modules\Department\Entities\ProgrammeType;
use Modules\Department\Entities\ProgrammeSchedule;
trait HasProgramme
{
public function addProgramme(array $data)
{
$errors = [];
if($this->programmeExist($data)){
$errors[] = '... | true |
c19c50b236b5bb0c2a5f11af7f7eb8fabdae8694 | PHP | xp-framework/xp-framework | /core/src/test/php/net/xp_framework/unittest/rdbms/DSNTest.class.php | UTF-8 | 8,041 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php namespace net\xp_framework\unittest\rdbms;
use rdbms\DSN;
/**
* Tests the DSN class
*
* @see xp://rdbms.DSN
*/
class DSNTest extends \unittest\TestCase {
#[@test]
public function stringRepresentationWithPassword() {
$this->assertEquals(
'rdbms.DSN@(sybase://sa:********@localhost:1999/CAFFEIN... | true |
0e8cdbd33091cea053bd5f321f402241bf7e2c6c | PHP | alnutile/behat_editor_core | /lib/BehatApp/BehatFeatureModel.php | UTF-8 | 6,424 | 2.59375 | 3 | [] | no_license | <?php namespace BehatApp;
use BehatApp\Exceptions\BehatAppException;
use BehatApp\BehatHelper;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Exception\IOException;
class BehatFeatureModel extends BehatAppBase implements BehatFeatureInterface {
... | true |
d171a627b859a2f2ff5e3f117c5d5f8ba0822a83 | PHP | mufkuw/mvc | /src/classes/Auth.php | UTF-8 | 415 | 2.75 | 3 | [] | no_license | <?php
namespace Mvc;
class Auth {
public static function login($referer = null, $area = null) {
Cookie::instance()->referer = $referer;
Cookie::instance()->area = $area;
header("location : /auth/login");
}
public static function logout($area = null) {
$auth = Cookie::instance()->aut... | true |
3ce44fe3bde3c5e4d5a58157b39361e937c306c1 | PHP | nbostech/idn-sdk-php | /src/Nbos/Modules/Ids/IDS.php | UTF-8 | 807 | 2.65625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: nbmac4
* Date: 7/21/16
* Time: 4:10 PM
*/
namespace Nbos\Modules\Ids;
use Nbos\Api\NetworkApi;
class IDS {
// registry of module classes
public static $registry = [];
// register of moduleApi Instance Objects
public static $apiInstanceRegistry = [];
... | true |
8680ec794f1b590a3669c854002c9d707481f025 | PHP | 1242035/firebase-php-1 | /tests/TestHelpers.php | UTF-8 | 1,842 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the firebase-php package.
*
* (c) Jérôme Gamez <jerome@kreait.com>
* (c) kreait GmbH <info@kreait.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
/**
* This file is part of the firebase-php package.
*
* ... | true |
c4d2b8655f8ad5c0c078b1153065015143789a66 | PHP | phpcfdi/finkok | /src/Services/Stamping/StampedService.php | UTF-8 | 774 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace PhpCfdi\Finkok\Services\Stamping;
use PhpCfdi\Finkok\Definitions\Services;
use PhpCfdi\Finkok\FinkokSettings;
class StampedService
{
/** @var FinkokSettings */
private $settings;
public function __construct(FinkokSettings $settings)
{
$this->settings... | true |
2a48d3345fdcee8cec0a47580979dd4d3ca47a66 | PHP | haiyyu/ums | /ums/pages/login.php | ISO-8859-3 | 1,277 | 2.890625 | 3 | [] | no_license | <?php
require_once('classes/login.php');
$user = Login::getCurrentUser();
if (isset($_POST['submitLogin']) && is_null($user))
{
if (Login::loginUser($_POST['username'], $_POST['password']))
echo 'Sie wurden erfolgreich angemeldet.';
else
echo 'Anmeldung leider nicht erfolgreich. Stellen Sie sicher, dass ... | true |
dcb5972b62fa7d61805fc42d53a30039289dcc98 | PHP | thephpleague/route | /src/RouteConditionHandlerInterface.php | UTF-8 | 563 | 2.734375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace League\Route;
interface RouteConditionHandlerInterface
{
public function getHost(): ?string;
public function getName(): ?string;
public function getPort(): ?int;
public function getScheme(): ?string;
public function setHost(string $host): RouteConditionHan... | true |
2699fdd2e400a7bb546a10b948d8b777861308a9 | PHP | mariahamaris/Databases | /search.php | UTF-8 | 6,006 | 2.78125 | 3 | [] | no_license | <?php
header('Content-Type: application/json');
$aResult = array();
if( !isset($_POST['searchTerm']) ) { $aResult['error'] = 'Please enter a search term.'; }
if( !isset($aResult['error']) ) {
//change hardcoded creds if posted online
$host = "yingqing-4750.ctheaw88fxx7.us-east-1.rds.am... | true |
be4a54cc4f9d78e76e00146ebee6bd2c22fc3703 | PHP | MashaGorbunova/email-sending | /www/connectionDB.php | UTF-8 | 1,133 | 3.109375 | 3 | [] | no_license | <?php
/**
* Connection with DataBase, different helper functions
* for creating and selection data from base.
* @author Masha G (m.gorbunova@ukr.net)
*/
class ConnectionWithDB {
/**
* establishment database connection
* @return connection with DB
*/
private function unitDB () {
//your name of host
$DB_host = 'lo... | true |
b629158b0421daa781d5566171c9f1282a4fb878 | PHP | samirdev2019/SnowTricks | /src/Controller/CommentController.php | UTF-8 | 2,169 | 2.59375 | 3 | [] | no_license | <?php
/**
* The CommentController file doc comment
*
* PHP version 7.2.10
*
* @category Class
* @package CommentController
* @author Samir <allabsamir666@gmail.com>
* @license Copyright 2019 General public license
* @link src/Controller/CommentController
*/
namespace App\Controller;
use Symfony\Bundl... | true |