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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a09e6d34e3de37a3035631ac7618ed49a7a2339f | PHP | baojie/php-rif | /rif-condition-formula.php | UTF-8 | 4,856 | 2.90625 | 3 | [] | no_license | <?php
// Jie Bao 2011-01-31
// Classes for Formula
/*
FORMULA ::= IRIMETA? 'And' '(' FORMULA* ')' |
IRIMETA? 'Or' '(' FORMULA* ')' |
IRIMETA? 'Exists' Var+ '(' FORMULA ')' |
ATOMIC |
IRIMETA? Equal |
... | true |
1595d4aff71796cb265ae9555505a4d41557ecec | PHP | bladellano/nortemaquinaspara | /admin/restrito.php | ISO-8859-1 | 2,583 | 2.890625 | 3 | [] | no_license | <?php
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php include ("includes/title.php"); ?></ti... | true |
17362dcc502885ff0c70ebe485f2f0e000a66228 | PHP | Moln/MyZendLibrary | /library/My/AntiRobot/Validator/HttpHead.php | UTF-8 | 2,635 | 2.859375 | 3 | [] | no_license | <?php
namespace My\AntiRobot\Validator;
/**
* HTTP 头部验证
*
* 配置:
* <code>
* array(
* 'validMore' => array(function ($request) {}, function ($request) {}),
* );
* </code>
* @package My\AntiRobot\Validator
* @author Xiemaomao
* @version $Id: HttpHead.php 1331 2014-03-17 23:01:04Z maomao $
*/
class HttpHead e... | true |
29ef91e426091d4eb96f58ada8d81bffce85e31d | PHP | MSU-DHI-Lab/mbira-template-lib | /class/NewUsers.php | UTF-8 | 4,250 | 3.171875 | 3 | [] | no_license | <?php
class NewUsers extends Table{
/**
* Constructor
* @param $site The Site object
*/
public function __construct(Site $site) {
parent::__construct($site, "mbira_users");
}
/**
* Create a new user.
* @param $userid New user ID
* @param $name New user name
... | true |
2242512a396dd4652f9f2617422fbf46434d80b4 | PHP | Elogeek/Eval-PHP | /api/connect.php | UTF-8 | 1,164 | 2.796875 | 3 | [] | no_license | <?php
include $_SERVER['DOCUMENT_ROOT'] . "/include.php";
$data = file_get_contents('php://input');
$data = json_decode($data);
if (isset($data->email) && isset($data->password)) {
$email = DB::secureData($data->email);
$password = DB::secureData(($data->password));
// get the name of the user
$stm... | true |
81ba1a106f516026bd57455a7df863b2a8a3d5b7 | PHP | makuragi/utwitter | /include/model/main_model.php | UTF-8 | 3,439 | 3 | 3 | [] | no_license | <?php
class main_model {
/**
* ユーザプロフィール情報を取得する
* @param unknown $db
* @param unknown $user_profile_id
* @return mixed
*/
public function getMyProfile ($db, $user_profile_id) {
try {
// SQL文を作成
$sql = 'SELECT user_name, user_profile, user_profile_photo, user_profile_background, user_date
FROM u... | true |
22977753d73f0333dae45409550ac7620b8f357a | PHP | donut-org/donut | /tests/Donut/Time.create.phpt | UTF-8 | 524 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
use Tester\Assert;
use Donut\Time;
require __DIR__ . '/../bootstrap.php';
// without timezone info
Assert::same('2017-01-01 14:15:00', Time::create('2017-01-01 14:15:00')->getValue());
// with timezone info
Assert::same('2015-11-21 12:02:36', Time::create('2015-11-21T12:02:36Z')->getValue());
Assert::same('... | true |
111edbdc0ec25c86ee2daba7877410377855bcee | PHP | maff/fhkuf-infoscreen | /application/models/Filter.php | UTF-8 | 1,149 | 2.875 | 3 | [] | no_license | <?php
class InfoScreen_Model_Filter
{
protected $_key;
protected $_value;
public function __construct($key, $value)
{
$this->_key = trim($key);
$this->_value = trim($value);
}
protected function _validate()
{
if(!empty($this->_key) && !empty($this-... | true |
da8ed0b9ee2382d0e7c218d1e9db2038e5ba41e4 | PHP | Uxie-Framework/Statistics | /src/ExisitVisitor.php | UTF-8 | 421 | 2.765625 | 3 | [] | no_license | <?php
namespace Statistics;
use Model\StatisticsUniq;
class ExisitVisitor extends Visitor implements VisitorInterface
{
public function save(VisitorDataInterface $data): void
{
$this->saveHit($data);
$this->updateUniqueVisitor();
}
private function updateUniqueVisitor(): void
{
... | true |
03e118826c1d5c11c6117854b079cc5373f7099b | PHP | Lanastasi/lanastasi.github.io | /contact-form.php | UTF-8 | 877 | 2.6875 | 3 | [] | no_license | <?php
$message_sent = false;
if(isset($_POST['email']) && $_POST['email'] != '') {
if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ) {
// submit the form
$userName = $_POST['name'];
$userEmail = $_POST['email'];
$userNumber = $_POST['phone'];
$message = $_POST['message... | true |
0066454aae8d909800045a4a5e4e42a1ac7a32a2 | PHP | piotr-rozmarynowski/hotels | /agent/common/models/Reservation.php | UTF-8 | 3,559 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace common\models;
use frontend\domain\BookARoom\RoomAvailability;
use Ramsey\Uuid\UuidInterface;
use thamtech\uuid\validators\UuidValidator;
/**
* This is the model class for table "reservation".
*
* @property UuidInterface|string $id
* @property UuidInterface|string $room_id
* @property int $perso... | true |
e1ac074b50e9df4f3be4bd776b14bc4847e7a15a | PHP | as2252258/restful | /app/model/Information.php | UTF-8 | 1,698 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\model;
use yoc\db\ActiveRecord;
/**
* Class Information
* @package Inter\mysql
*
* @property $id
* @property $fid
* @property $jid
* @property $type
* @property $title
* @property $cont
* @property $status
* @property $contact
* @property $addTime
* @property $upTi... | true |
bcf7befd3416e09bd5ebe4ba310213efd1053c09 | PHP | marcomicera/marcomicera.github.io | /pweb/php/login.php | UTF-8 | 1,189 | 2.609375 | 3 | [] | no_license | <?php
require_once "./util/dbManager.php";
require_once "./util/session.php";
$username = $_POST['username'];
$password = $_POST['password'];
$errorMessage = login($username, $password);
if($errorMessage === null) echo 'Welcome '.$_POST['username'].', press ENTER to play!';
else echo $errorMessage;
funct... | true |
040f4aac00798241acbfca8a999eee26f4126c72 | PHP | Peter-Korobeynikov/Master | /app/addons/email_marketing/lib/mailchimp/Mailchimp/Reports.php | UTF-8 | 30,465 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
class Mailchimp_Reports {
public function __construct(Mailchimp $master) {
$this->master = $master;
}
/**
* Get all email addresses that complained about a given campaign
* @param string $cid
* @param associative_array $opts
* - start int optional for large data sets,... | true |
025cd3d946c9e32180677c1608f98bfac910d5ca | PHP | fredpenin/php-objet | /06-heritage/index.php | UTF-8 | 622 | 2.75 | 3 | [] | no_license | <?php
include "Vehicule.php";
include "Voiture.php";
include "Moto.php";
$chevrolet = new Voiture("Chevrolet", "Camaro", "Jaune", "Sam Witwiki");
echo "<div>Marque : ".$chevrolet->getBrand()."</div>";
echo "<div>Model : ".$chevrolet->getModel()."</div>";
echo "<div>Type : ".$chevrolet::VEHICULE_TYPE."</div>";
echo "<di... | true |
129fe86ca9359e2726da9a3a149f020408eff1d4 | PHP | jojoe77777/BlockSniper | /src/BlockHorizons/BlockSniper/revert/sync/SyncRevert.php | UTF-8 | 1,190 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace BlockHorizons\BlockSniper\revert\sync;
use BlockHorizons\BlockSniper\revert\Revert;
use pocketmine\block\Block;
abstract class SyncRevert extends Revert{
/** @var Block[] */
protected $blocks = [];
public function __construct(array $blocks, string $playerName){
parent::__construct($playerName)... | true |
6c4ff9b197a6e89a3d682f22c3acfcb23851405e | PHP | HaiNguyen412/PHP_OMT | /Basic/loop.php | UTF-8 | 1,297 | 3.328125 | 3 | [] | no_license | <?php
//vong lap
// while - lặp qua một khối mã miễn là điều kiện được chỉ định là đúng
// do...while - lặp qua một khối mã một lần và sau đó lặp lại vòng lặp miễn là điều kiện được chỉ định là đúng
// for - lặp qua một khối mã một số lần được chỉ định
// foreach - lặp qua một khối mã cho mỗi phần tử trong một mảng
... | true |
79e22d21a699e8697d7815797b77d44025d39795 | PHP | bakgat/api.np | /tests/Education/GoalTest.php | UTF-8 | 1,668 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
use App\Domain\Model\Education\Branch;
use App\Domain\Model\Education\Goal;
use App\Domain\NtUid;
/**
* Created by PhpStorm.
* User: karlvaniseghem
* Date: 5/09/16
* Time: 16:16
*/
class GoalTest extends TestCase
{
/**
* @test
* @group goal
*/
public function should_create_new()
{... | true |
06ba4fa2f844519ecba9bcc696120351c7f9d4e9 | PHP | whitneyz/mysql-php | /index.php | UTF-8 | 1,287 | 2.640625 | 3 | [] | no_license | <?php
declare(strict_types=1);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
require 'login.php';
require 'connection.php';
require 'register.php';
require 'profile.php';
require 'auth.php';
// table for the becode employee to view all the info of the becode student ... | true |
941c6cea091583474d9f5569f575b6c76623bce3 | PHP | opensalt/opensalt | /core/src/Security/Voter/CommentVoter.php | UTF-8 | 2,786 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Security\Voter;
use App\Entity\Comment\Comment;
use App\Entity\User\User;
use App\Security\Feature;
use App\Security\Permission;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
class CommentVoter extends Voter... | true |
02ea02147166b3eef78aa182b24538b560bfb27f | PHP | hcedison/DEMO | /WebServices/application/modules/Admin/controllers/Shop.php | UTF-8 | 1,659 | 2.578125 | 3 | [] | no_license | <?php
class ShopController extends BaseApiController{
private $_shop_model;
function init(){
parent::init();
$this->_shop_model = new ShopModel();
}
function listAction() {
$page = intval($_REQUEST['page']);
$name = $_REQUEST['name'];
$contact_name = $_REQUEST['contact_name'];
$phone = $_REQUEST['phon... | true |
54711efb3f7354eab1ff03f6d818161cdf51311a | PHP | generalludd/tour | /application/helpers/general_helper.php | UTF-8 | 12,337 | 3.0625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
defined('BASEPATH') or exit('No direct script access allowed');
// general_helper.php Chris Dart Dec 10, 2013 9:54:14 PM
// chrisdart@cerebratorium.com
/**
* @return string
*/
function mysql_timestamp(): string {
return date('Y-m-d H:i:s');
}
/**
* @param $name
* @param $value
*
* @return void
*/
functi... | true |
76ebd326c7a97e01737b53b2075c5abe76a0532c | PHP | laravelwebsite/websitebanhangLaravelAngularjs | /app/helpers.php | UTF-8 | 129 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
use App\Role;
function getNameRole($id)
{
$id=(int)$id;
$role=Role::find($id);
$name=$role->name;
return $name;
}
?> | true |
71807d07b2c2f7a3f1ed6c5031a30068d39d4953 | PHP | LoyolaSD/apps | /src/App/System/Supports/Apps/Traits/Bootstrap.php | UTF-8 | 937 | 2.5625 | 3 | [] | no_license | <?php namespace Loyola\Supports\Apps\Traits;
/*
*---------------------------------------------------------
* ©Colegio Loyola
* Santo Domingo República Dominicana.
*---------------------------------------------------------
*/
use Illuminate\Foundation\AliasLoader;
trait Bootstrap
{
public function loadProvider... | true |
c50734c686b52bb3e85c22054543f3ce89fffc65 | PHP | elinoretenorio/php-headless-crud-for-hospital-db | /src/Department/DepartmentDto.php | UTF-8 | 493 | 3 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Hospital\Department;
class DepartmentDto
{
public int $departmentId;
public int $workers;
public string $buildingLocation;
public function __construct(array $row = null)
{
if ($row === null) {
return;
}
$this->departm... | true |
b64e152aafe907e03ce158f8e9afd23959c84a66 | PHP | AlanJager/hbdata | /include/upload.class.php | UTF-8 | 7,734 | 2.6875 | 3 | [] | no_license | <?php
/**
* hbData
* --------------------------------------------------------------------------------------------------
* 版权所有 2016-
* 网站地址:
* --------------------------------------------------------------------------------------------------
* Author: AlanJager
* Release Date: 2016-7-4
*/
if (!defined('IN_HBDA... | true |
e32580234773024d7ab17c4dd7a4fa8592ebea54 | PHP | henyxia/banana_pi_ui | /tools/temp_sql.php | UTF-8 | 505 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
require_once("creds.php");
exec("sensors -u | grep temp1_input | cut -d ' ' -f4", $output);
$temp = number_format(floatval($output[0]), 1);
$conn = new mysqli(__MYSQL_HS__, __MYSQL_US__, __MYSQL_PS__, __MYSQL_DB__);
if ($conn->connect_error)
die("Connection failed: " . $conn->connect_error);
$sql = "INSERT I... | true |
31600c1cb0d196f6db097f48e6462e536e7fb4d1 | PHP | newbee14/SUITECRM-PHP-API | /SApiWrapper.php | UTF-8 | 1,807 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
require_once "RestCurl.php";
class SApiWrapper{
private $method=null;
private $url=null;
private $data=null;
private $response=null;
private $curl= null;
private $error= null;
function __construct($method=null){
//require __DIR__.'/../config.php';
$this->url='http://loc... | true |
1d46eda706a8548afb8e403493b43e5e92ee72d7 | PHP | jkirkby91/ApiArchitectCore | /src/Repositories/NodeRepository.php | UTF-8 | 870 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
namespace ApiArchitect\Core\Repositories;
use ApiArchitect\Core\Entities\Node;
use ApiArchitect\Core\Abstracts\Repositories\AbstractRepository;
/**
* Class NodeRepository
*
* @package ApiArchitect\Repositories\Core\Node
* @author James Kirkby <hello@jameskirkby.com>
*/
class NodeRepository extends Abstrac... | true |
0db771c4bccbefaf6df65d21adac1802b3c501ca | PHP | danhtiep/Smart_store | /config/modules.php | UTF-8 | 732 | 2.703125 | 3 | [] | no_license | <?php
$modules = getModules(app_path().'/Modules/RESTfulAPI');
$modules = array_merge($modules, getModules(app_path().'/Modules/BackEnd'));
return ['enable' => $modules];
/**
* Get list modules by path
* @param string $path
* @param string $delimiter
* @return array
*
* @author BBN-TECH
*/
fu... | true |
85d9dab7f68745da9f36caf237c2a1a8767c12d8 | PHP | joschaefer/model-creator | /IpAddressType.php | UTF-8 | 614 | 2.890625 | 3 | [] | no_license | <?php
class IpAddressType extends Type {
/**
* @return string
*/
public function getName(): string {
return 'string';
}
/**
* @return bool
*/
public function isObject(): bool {
return false;
}
/**
* @return string
*/
public function serialization(): string {
return '$this->get%s() ? inet_p... | true |
9787059551a996e7581b3e15bd2f784d9fb0dcac | PHP | mlaminebah/TheatreEtudiants | /DetailsRepresentation.php | UTF-8 | 1,330 | 2.65625 | 3 | [] | no_license | <?php
$titre="Details de Representation des spectacles";
include('entete.php');
//construction de la requete
$requete = ("SELECT nomS
FROM theatre.LesSpectacles
");
// analyse de la requete et association au curseur
$curseur = oci_parse ($lien, $requete) ;
// execution de l... | true |
25c859c43f897c1c90b7f8d3413f89e3a64d4ec3 | PHP | ebolto1/matcher | /insertclass.php | UTF-8 | 2,125 | 2.75 | 3 | [] | no_license | <?php
include_once "connect.php";
function redirect($Message)
{
header('Location: classform.php?Message='.urlencode($Message));
}
var_dump($_POST);
$text = $_POST['className1'];
$text2 = $_POST['className2'];
$text3 = $_POST['className3'];
$text4 = $_POST['className4'];
$text5 = $_POST['className5'];
$note = " "... | true |
20985877b5a7d7985f1e28af98491a8cc28071f6 | PHP | skiliks/skiliks | /protected/components/DayPlanService.php | UTF-8 | 9,441 | 2.765625 | 3 | [] | no_license | <?php
/**
* Description of DayPlanService
*/
class DayPlanService
{
/**
* @param Simulation $simulation
* @return array
*/
public static function getPlanList($simulation)
{
try {
/** @var DayPlan[] $plans */
$plans = DayPlan::model()->findAll([
... | true |
68f6ee6f2d28d60594a2ace401c8f16ae179da8e | PHP | esporaestudio/http-logger | /src/Middleware/LogRequest.php | UTF-8 | 1,200 | 2.546875 | 3 | [] | no_license | <?php
namespace Espora\HttpLogger\Middleware;
use Closure;
use Espora\HttpLogger\Models\HttpLog;
class LogRequest
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Clo... | true |
f2d8da4e16a3a66d2717c84fe8da78a253cb4e54 | PHP | chrischen86/Hudson | /framework/system/FileListCommandStrategy.php | UTF-8 | 2,427 | 2.578125 | 3 | [] | no_license | <?php
namespace framework\system;
use framework\command\ICommandStrategy;
use framework\system\SlackFileManager;
use framework\slack\ISlackApi;
use DateTime;
class FileListCommandStrategy implements ICommandStrategy
{
const Regex = '/(file) (list)/i';
private $eventData;
private $fileManager;
privat... | true |
6f5808756e8d63f0ae72f13dba7ff722b1cf187c | PHP | seriousManual/vader | /lib/Lexer.php | UTF-8 | 2,071 | 3.203125 | 3 | [] | no_license | <?php
require_once 'lib/Parseelements.php';
class LexerException extends Exception {}
abstract class Lexer {
private $symbols = Array();
public function __construct() {
$this->addSymbol( "[ \t\r\n]", "V_BLANK", "", true );
//$this->addSymbol( "\/\*(.*)\*\/", "V_CO... | true |
1c19914f6879e76a378202b3160cd9cb53a9b94b | PHP | patrikknosko/minoxi | /assets/mail/contact_me.php | UTF-8 | 946 | 2.703125 | 3 | [] | no_license | <?php
// Check for empty fields
if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
http_response_code(500);
exit();
}
$name = strip_tags(htmlspecialchars($_POST['name']));
$email = strip_tags(htmlspecialchars($_POST['email']));
$... | true |
61d82421025bda4d173bbaa50ec1082aab9430fb | PHP | RMvanderGaag/Goede-Lab---PHP | /Labs/lab-3b.php | UTF-8 | 386 | 3.875 | 4 | [] | no_license | <?php
$ar = [3, 5, 8, 12];
function Som($cijfer){
for ($i=1; $i < 11; $i++) {
echo $i . " * " . $cijfer . " = " . $cijfer * $i . "<br>";
}
}
foreach($ar as $a){
for($j=1; $j < 11; $j++){
echo $j . " * " . $a . " = " . $a * $j . "<br>";
}
echo "<br>";
}
Som(6);
?>
<html>
<head>
<meta chars... | true |
0e7f7ad1d07af141a7212997cf5c1ab880b6feda | PHP | EsHa205/php_Forum | /forum/BenutzerBearbeiten.php | UTF-8 | 5,633 | 2.859375 | 3 | [] | no_license | <html>
<head>
<link rel="stylesheet" href="BenutzerBearbeiten.css">
</head>
<body>
<?php
require_once 'header.php';
// Aufrufen des Formulars zum Auswählen eines Benutzers
if (isset($_SESSION['recht_be_bearbeiten_a']) AND isset($_SESSION['name']) AND !isset($_POST['kontrolle'])) { // Rechte prüfen
$sql... | true |
f4d0be5a5b1cd4ed11e38343f7617aa78af05f71 | PHP | ducga1998/nckh-managerstudent-laravel-reactjs | /vendor/tsawler/laravel-filemanager/src/controllers/ResizeController.php | UTF-8 | 2,456 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php namespace Tsawler\Laravelfilemanager\controllers;
use Tsawler\Laravelfilemanager\controllers\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\View;
use Intervention\Image\Facades\Image;
/**
* Class ResizeController
* @package Tsawler\Larav... | true |
d14480a45848beaf3bbe012933193c7a85980224 | PHP | nemanjaneca996/Travel-Agency | /app/Models/Rezervacija.php | UTF-8 | 1,397 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Nemanja
* Date: 3/12/2018
* Time: 9:19 PM
*/
namespace App\Models;
use Illuminate\Support\Facades\DB;
class Rezervacija
{
public $smestaj;
public $user;
public $datum;
public $tip;
public $napomena;
public $datumPolaska;
private $tabela='reze... | true |
45efff9bab4d64c0dd635c277433f27737699131 | PHP | iamlasse/ps-yii-extensions | /extensions/pogostick/base/CPSWidget.php | UTF-8 | 11,178 | 2.625 | 3 | [] | no_license | <?php
/*
* This file is part of the psYiiExtensions package.
*
* @copyright Copyright © 2009 Pogostick, LLC
* @link http://www.pogostick.com Pogostick, LLC.
* @license http://www.pogostick.com/licensing
*/
/**
* CPSWidget is the base class for all Pogostick widgets for Yii. This object
* is pretty much id... | true |
98a5308aeb656752d106b2d6b38ab38e080baba8 | PHP | phpcl/phpcl_jumpstart_php_7_4 | /new_syntax_misc.php | UTF-8 | 844 | 3.375 | 3 | [] | no_license | <?php
echo "\nNull Coalesce Operator\n";
// existing use of null coalesce op
$params['xyz'] = $params['xyz'] ?? 'EXISTING';
// null coalesce assignment op
$params['abc'] ??= 'ASSIGNED';
var_dump($params);
echo "\nArray Unpacking\n";
// array unpacking
$arr1 = [1,2,3];
$arr2 = ['A','B','C'];
$full = [...$arr1, ...$arr2... | true |
fc047ae6de4055b75274100cf53aeeb6c6597c5b | PHP | enovision/ext-bug-reporter | /build/resources/server/Report.php | UTF-8 | 1,788 | 2.703125 | 3 | [] | no_license | <?php
error_reporting( E_ALL );
$env = require dirname(__FILE__) . '/environment.php';
include( $env . '/config.inc' );
require 'dbLite.php';
/**
* Language
*/
$file = './../language/' . $config['language'] . '.json';
$languageJson = file_get_contents( $file );
$language = json_decode( $languageJson );
/**
* Pos... | true |
fac807d1ce9af170ee6fa8702ff057b3aadfbf7c | PHP | kenaszogara/umkm-webservice | /app/Customer.php | UTF-8 | 1,008 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Foundation\Auth\Customer as Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Ramsey\Uuid\Uuid;
class Customer extends Authenticatable implements JWTSubject
{
protected $primaryKey = 'uuid';
protected $guarded = ['uuid'];
... | true |
85c2d99f02b4268abd439e037dcedfd05a57224c | PHP | botiq1/tatrapay | /botiq/tatrapay/SignProvider/DESSignProvider.php | UTF-8 | 717 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace botiq\tatrapay\SignProvider;
class DESSignProvider implements ISignProvider
{
function __construct()
{
if(!function_exists('mcrypt_module_open'))
{
throw new Exception('mcrypt module required for '.__CLASS__);
}
}
function sign($key, $sigbase)
{
$hash = sha1($sigbase, ... | true |
7ebfe7feadc1597c41ece19ceea38a9d86f26161 | PHP | iteaoffice/evaluation | /src/Service/ReviewRoster/AbstractGenerator.php | UTF-8 | 3,731 | 2.6875 | 3 | [] | no_license | <?php
/**
* ITEA Office all rights reserved
*
* @author Johan van der Heide <johan.van.der.heide@itea3.org>
* @copyright Copyright (c) 2021 ITEA Office (https://itea3.org)
* @license https://itea3.org/license.txt proprietary
*/
declare(strict_types=1);
namespace Evaluation\Service\ReviewRoster;
use... | true |
7dfca41ea64e99a4fb2b663160e1b3f25d1a2076 | PHP | uploadcare/uploadcare-php | /src/Apis/ProjectApi.php | UTF-8 | 737 | 2.546875 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace Uploadcare\Apis;
use Uploadcare\Interfaces\Api\ProjectApiInterface;
use Uploadcare\Interfaces\Response\ProjectInfoInterface;
use Uploadcare\Response\ProjectInfoResponse;
final class ProjectApi extends AbstractApi implements ProjectApiInterface
{
public function getProject... | true |
e193f017410ba11ea9eced9224a2eb6a48345e47 | PHP | Dilshanmuditha/web | /ae.php | UTF-8 | 575 | 2.625 | 3 | [] | no_license | <?php
$host = "localhost";
$user = "root";
$password = "";
$db = "userlogin";
$con = mysqli_connect($host, $user, $password, $db);
if (!$con) {
echo "DB Connection is faild!!!".mysqli_connect_error();
}
else{
echo "Database connection Success<br><br>";
$table = "
CREATE TABLE details(
id INT(6) UNSIGNED AUTO_INCRE... | true |
e7e1a98886335e35c88ec58b910d89122973e5ad | PHP | MasaNom22/construction-management | /app/Http/Controllers/UsersController.php | UTF-8 | 2,517 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class UsersController extends Controller
{
public function index(Request $request)
{
//名前受け取り
$keyword = $request->input('name');
$users = User::where('role', 'member')... | true |
78dd0169a06ba41efea4d5e20288527d3c55d54a | PHP | Sayantan03/HEXABYTES | /src/tramdetails.php | UTF-8 | 1,979 | 2.546875 | 3 | [] | no_license | <?php
//Implemented by Subham Samanta
session_start();
$source = $_COOKIE["source"];
$destination = $_COOKIE["destination"];
$mysqli = new mysqli("localhost", "root", "", "tram");
if($mysqli->connect_error)
{
exit('Could not connect');
}
$resultSet = $mysql... | true |
8785c817a777a81d61c47f40d0f2310381285995 | PHP | tourist199/gio-hang-php | /models/Products.php | UTF-8 | 4,956 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
class Products{
#Begin properties
var $id;
var $name;
var $desc;
var $price;
var $description;
var $star;
var $image;
var $category;
#Construct function
function Products($id , $name , $desc, $price, $description, $star,$image,$category)
{
$this->id = $id;
... | true |
41b47faf0db914f6b39e33f28e94f486fb10054a | PHP | atk14/ApiDataFetcher | /src/cache_file_storage.php | UTF-8 | 716 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
class CacheFileStorage{
function read($key){
$TEMP = Files::GetTempDir();
$orig_key = $key;
$key = sha1($key);
$filename = $TEMP . "/cache_file_storage/" . $key;
if(file_exists($filename)){
$content = Files::GetFileContent($filename);
$ar = unserialize($content);
if($ar && ($ar["key"]==$orig... | true |
c7a05c15049b7784df766e077ad5c8810effd458 | PHP | blitzik/forum | /src/Common/Components/FlashMessages/src/NullTranslator.php | UTF-8 | 534 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types=1);
namespace Common\Components\FlashMessages;
use Nette\Localization\ITranslator;
use Nette\Localization\message;
use Nette\Localization\plural;
use Nette\SmartObject;
class NullTranslator implements ITranslator
{
use SmartObject;
/**
* Translates the given string.
... | true |
e48eece5357596a7ca6bcfa280a9640082e1b8a2 | PHP | kirya-dev/admin | /src/Traits/HasRules.php | UTF-8 | 644 | 2.671875 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace KiryaDev\Admin\Traits;
trait HasRules
{
/** @internal */
public array $creationRules = [];
/** @internal */
public array $updateRules = [];
/**
* @param string ...$rules
* @return static
*/
public function creationRules(...$rules)
{... | true |
64b9a5024b4ab988cdf3a3043473dd021f5f41cd | PHP | mblsolutions/report | /src/Support/Maps/ReportResultMap.php | UTF-8 | 1,592 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace MBLSolutions\Report\Support\Maps;
use Illuminate\Support\Collection;
use MBLSolutions\Report\Interfaces\ReportDataType;
use MBLSolutions\Report\Models\ReportSelect;
use MBLSolutions\Report\DataType\CastString;
class ReportResultMap
{
/**
* Format Report Result Data
*
* @param $att... | true |
595a83e6b1dc2ad8187d9ccf11f595dcee3fe5f4 | PHP | kgrohit/CareCappital | /CMS/searchPatient.php | UTF-8 | 3,700 | 2.78125 | 3 | [] | no_license | <?php
//grab DB
include '../init.php';
$search = json_decode($_POST['json'],true);
// SEARCH FUNCTIONS TO CHOOSE THE SQL STATMENT
// double null values = search all
if($search[first] == "" && $search[last] == "" ) {
$sql = "SELECT * FROM ClientMaster ORDER BY LastName" ;
}
//1 null 1 not = search for all with the... | true |
21a8e3865e08b80181b5bf16b4d08aa0abd76deb | PHP | raulastu/despegar-scrapper | /email.php | UTF-8 | 621 | 2.625 | 3 | [] | no_license | <?php
/**
* Created by JetBrains PhpStorm.
* User: rc
* Date: 7/31/13
* Time: 7:12 PM
* To change this template use File | Settings | File Templates.
*/
function sendEmail($email, $subject){
$message = $subject;
// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message... | true |
63267c263bb0a84a99b4be45b802d8dcaa3cf289 | PHP | robert589/klikmystore | /frontend/services/DashboardService.php | UTF-8 | 626 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace frontend\services;
use frontend\daos\NewsDao;
use common\components\RService;
/**
* DashboardService service
*
*/
class DashboardService extends RService
{
//attributes
public $user_id;
private $newsDao;
public function init() {
$this->newsDao = new NewsDao();
... | true |
c4f3f0f8e412d7ebcf788a4c287d65fd2b7b3408 | PHP | dxprog/famulus | /lib/Dal.php | UTF-8 | 7,023 | 3.109375 | 3 | [] | no_license | <?php
namespace Lib {
use Exception;
abstract class Dal {
private $_where = [];
private $_params = [];
private $_sort = [];
/**
* Constructor
*/
public function __construct($obj = null) {
if (is_numeric($obj)) {
... | true |
adb68467eb68ee2db0695fe742e2def6950d1ef5 | PHP | explorer-n11/Primer-2 | /applications/controllers/AdminController.php | UTF-8 | 2,705 | 2.59375 | 3 | [] | no_license | <?php
namespace applications\controllers;
use applications\core\Controller;
use applications\lib\Pagination;
use applications\models\Main;
class AdminController extends Controller{
public function __construct($route) {
parent::__construct($route); //Вызывает конструктор в Controller, чтобы подключить View
$thi... | true |
0ad0cc9939a06665fd18701deb28c12c766ae580 | PHP | imran031387/Drupal-8-Skeleton-Module | /src/Plugin/Block/CustomBlock.php | UTF-8 | 3,850 | 2.609375 | 3 | [] | no_license | <?php
/**
* @file
* Contains \Drupal\skeleton\Plugin\Block\CustomBlock.
* https://docs.acquia.com/articles/drupal-8-dependency-injection-and-plugins
* we need to implement ContainerFactoryPluginInterface interface for getting the services
* to CustomBlock class.
*/
namespace Drupal\skeleton\Plugin\Block;
use D... | true |
fa8f4070adcd73a16fae2bed54fa25ee1dee4894 | PHP | skylanwang/myframe | /public/tiaoxing2/index3.php | UTF-8 | 1,240 | 2.671875 | 3 | [] | no_license | <?php
$url = "www.mytest.com/index3.php";
$filename = 'curl.jpg';
getImg($url, $filename);
/*
*@通过curl方式获取制定的图片到本地
*@ 完整的图片地址
*@ 要存储的文件名
*/
function getImg($url = "", $filename = "") {
if(is_dir(basename($filename))) {
echo "The Dir was not exits";
return false;
}
//去除URL连接上面可能的引号
... | true |
64793f5246eb209ca31911464db60167eb61c442 | PHP | westudio/wordpress-bootstrap | /wp-content/themes/westudio-bootstrap/src/helpers.php | UTF-8 | 8,269 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
////////////////////////////////
// Missing functions
////////////////////////////////
if (!function_exists('get_previous_post_link')) {
function get_previous_post_link($format = '« %link', $link = '%title', $in_same_cat = false, $excluded_categories = '')
{
ob_start();
previous_p... | true |
3c46d6ee9cd2cfb35206ebb9078898830bd00367 | PHP | DeDoOozZz/brighterycms | /source/app/modules/clients/models/Clients.php | UTF-8 | 1,371 | 2.515625 | 3 | [] | no_license | <?php namespace modules\clients\models; defined('ROOT') OR exit('No direct script access allowed');
/**
* Clients Model
*
* @package Brightery CMS
* @author Marwa El-manawy <marwa.elmanawy@brightery.com>
* @version 1.0
**/
class Clients extends \Model
{
public $_table = 'clients';
public $_fields = [
... | true |
1fcbabf4ec8fb532501c9a80ee8641f4b59e833c | PHP | kofiarhin/employee_attendance | /edit_timecard.php | UTF-8 | 1,982 | 2.765625 | 3 | [] | no_license | <?php
require_once "header.php";
//regular in house keeping
if(!$user->logged_in()) {
Redirect::to("login.php");
}
$timesheet = new Timesheet;
$timesheet_id = Input::get("timesheet_id");
//generate the select option time range
$start = new DateTime();
$start->setTime(8, 0, 0);
$end = clone $start;
$e... | true |
d10dcf2f2835091131ef54195531185497978038 | PHP | bingo-soft/jabe | /src/Impl/Calendar/DueDateBusinessCalendar.php | UTF-8 | 962 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace Jabe\Impl\Calendar;
use Jabe\Impl\Util\ClockUtil;
class DueDateBusinessCalendar implements BusinessCalendarInterface
{
public const NAME = "dueDate";
public function resolveDuedate(?string $duedateDescription, $startDate = null, int $repeatOffset = 0): ?\DateTime
{
try {
... | true |
6e71fe956eeb5bbe7431731af0c2c24f1e22e0c5 | PHP | AkaiTsuki/phpmvc | /module/User.class.php | UTF-8 | 1,992 | 3 | 3 | [] | no_license | <?php
include_once 'ActiveObject.class.php';
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of User
*
* @author jiachi
*/
class User {
private $id;
private $username;
private $password;
public static function find($use... | true |
335715a2fcad4af5eaba91abecf874929aa523de | PHP | muhammedkamel/blog | /Models/Post.php | UTF-8 | 663 | 3.203125 | 3 | [] | no_license | <?php
namespace Blog\Models;
require_once __DIR__ . '/../Repositories/PostRepository.php';
use Blog\Repositories\PostRepository as PostRepo;
class Post {
private $repo;
private $data;
/**
*
* Method to get initialize new post
* @param $title string
* @param $body string
* @param $summery string
* @... | true |
069894469432af4a7f980607c4e07b1d6e0d7c72 | PHP | globalxtreme/laravel-backend-service | /app/Services/Misc/SaveActivity.php | UTF-8 | 2,652 | 2.78125 | 3 | [] | no_license | <?php
namespace App\Services\Misc;
use App\Models\v1\Activity\Activity;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class SaveActivity
{
/**
* @param Activity $activity
*/
public function __construct(public Activity $activity)
{
}
/**
* @param string $type
*
... | true |
9037e76e5d3535e6c6ee4826188545c5245a17e5 | PHP | enuraindula/SussexCompanionsMS | /models/notification.php | UTF-8 | 2,437 | 3.171875 | 3 | [] | no_license | <?php
class Notification{
private $table = "notifications";
private $conn;
public $id;
public $memberId;
public $notification;
public $status;
public $created_at;
public $updated_at;
public function __construct($db){
$this->conn = $db;
}
function readAllMember... | true |
a46ca6e7b8b8ee657d0ddc67106470e77f4e4b81 | PHP | klbayabos/PermissionSystem | /195project/database/migrations/2016_07_13_141752_approved_dates_table.php | UTF-8 | 664 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ApprovedDatesTable extends Migration
{
public function up()
{
Schema::create('approved_dates', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('approved_date_id')->u... | true |
e997f7f0d779d4b0715442df8c149f71ce109bf3 | PHP | qwmn12341234/study | /常用函数.php | UTF-8 | 9,493 | 2.703125 | 3 | [] | no_license | <?php
/**列出目录下的文件列表
* @param $dir
*/
function list_files($dir)
{
if(is_dir($dir))
{
if($handle = opendir($dir))
{
while(($file = readdir($handle)) !== false)
{
if($file != "." && $file != ".." && $file != "Thumbs.db"){
echo '<a targe... | true |
0b91093c02bf23f00ea6f5ed41f28f4bd509e897 | PHP | xtuser777/representacoes-php | /src/model/Estado.php | UTF-8 | 2,134 | 3.078125 | 3 | [] | no_license | <?php
namespace scr\model;
use mysqli;
use scr\util\Banco;
class Estado
{
private $id;
private $nome;
private $sigla;
public function __construct(int $id = 0, string $nome = "", string $sigla = "")
{
$this->id = $id;
$this->nome = $nome;
$this->sigla = $sigla;
... | true |
4b16c9027d4352bfd3ba9d2607e37a8e658b2690 | PHP | paguii/bravi-test | /BraviTest1.php | UTF-8 | 696 | 3.375 | 3 | [] | no_license | <?php
class BraviTechTest {
public function isBracketsValid($brackets){
preg_match_all('/[\[\]\(\)\{\}]/', $brackets, $matches);
$bracketsTotal = array();
foreach (array_unique($matches)[0] as $bracket) {
$bracketsTotal[$bracket] = substr_count($brackets, $bracket);
... | true |
4a5b5a4e0ca8ff38560820eaf430590aa28c70b6 | PHP | rosaamalia/fp-mbd-northwind | /generatereport.php | UTF-8 | 1,822 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
//Example FPDF script with PostgreSQL
//Ribamar FS - ribafs@dnocs.gov.br
require('fpdf.php');
$pdf=new FPDF('L','mm','A4');
$pdf->AddPage();
$pdf->SetTitle('Sales Report');
//Set font and colors
$pdf->SetFont('Times','',14);
$pdf->SetFillColor(255,255,255);
$pdf->SetTextColor(0);
$pdf->SetDrawCol... | true |
24ca5143a3793f2c51e3b7000d66e048d609c972 | PHP | mercuryphp/framework | /System/Web/Security/Security.php | UTF-8 | 1,004 | 2.703125 | 3 | [] | no_license | <?php
namespace System\Web\Security;
final class Security {
public static function hmac($type, $string, $key){
return hash_hmac($type, $string, $key);
}
public static function iv($cipher, $mode, $source, $base64 = true){
if($base64){
return base64_encode(mcryp... | true |
9be85288be1c8f392ea394e3b22cedd187fae813 | PHP | miasyth/TP-CDA | /PHP/ExosArray/Exo18.php | UTF-8 | 528 | 3.625 | 4 | [] | no_license | <?php
/*
Exercice 18 :
Ecrire un algorithme permettant d’effectuer le produit des matrices A(n,m) et B(m,p) .
n ,m et p données (par exemple n=4,m=5,p=3 ).
N.B :
Pour pouvoir faire le produit de deux matrices, il faut absolument que le nombre de colonnes
de la première soit égal au nombre de lignes de la deuxième.
*/
... | true |
9e401d966a2fba659a678bc843e94e1c054eafb0 | PHP | PatrickAbels8/php | /quiz/login.php | UTF-8 | 2,029 | 2.859375 | 3 | [] | no_license | <?php
include_once "dao.php";
session_start();
if(isset($_POST["register"])){
if($_POST["username"]!="" and $_POST["password"]!="" and $_POST["password"]==$_POST["password2"]){
$query = "SELECT * FROM " . $users_table . " WHERE username='" . $_POST["username"] . "'";
$response = mysqli_query($conn, $query... | true |
30f28f2774e474fff1a6864fe4c99f71e03196e8 | PHP | olonash/publicapi | /src/Manager/ProductManager.php | UTF-8 | 2,418 | 2.609375 | 3 | [] | no_license | <?php
namespace App\Manager;
use App\Entity\ProductTranslation;
use App\Model\Product\ProductTranslationModel;
use App\Model\Response\ApiResponse;
use App\Repository\ProductTranslationRepository;
use Psr\Container\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
/**
*
* Class ProductManager
* @pac... | true |
be533fc41811c61df2f61e9d7ec63dc216f63c66 | PHP | andrewacampbell/phplogin | /logout.php | UTF-8 | 299 | 2.65625 | 3 | [] | no_license | <?php
session_start();
if(isset($_COOKIE[session_name()])){
setcookie(session_name(), '', time() - 86400, '/');
}
// unset all session variables
session_unset();
session_destroy();
echo "You logged out! Please come again!.<br>";
echo "<p><a href='login.php'>Log back in here</a></p>";
?> | true |
8a9b08149c1eb01e0ecb793ec936549a93a348c1 | PHP | tripathiraghu/www | /ajax-learn/get2.php | UTF-8 | 558 | 2.765625 | 3 | [] | no_license | <?php
include 'connection.php';
$sql_tab = "SELECT * FROM message" ;
$dt = mysqli_query($con, $sql_tab);
$a=mysqli_num_rows($dt);
$html = "<table><tr><th>Name</th><th>Address</th><th>Phone</th><tr>";
while ($row = mysqli_fetch_array($dt, MYSQLI_ASSOC)) {
if ($row['sender'] == 1) {
$html.= "<div class=" . "chat" . "><... | true |
20d5347bc77f1a73e58471c9c4a7a1a1d3dcfafa | PHP | jakubsikora/laravel-api | /database/seeds/DatabaseSeeder.php | UTF-8 | 660 | 2.671875 | 3 | [] | no_license | <?php
use Illuminate\Database\Seeder;
use App\Document;
use App\User;
class DatabaseSeeder extends Seeder
{
private $tables = [
'users',
'documents'
];
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->cleanDatabase();
... | true |
b9445d7b7584b10288d4bb50abf1433db79b196e | PHP | luc-bertrand/fcdr | /nutrition_table2.php | UTF-8 | 1,114 | 2.53125 | 3 | [] | no_license | <?php include 'connection.php';?>
<?php
$PackageID = ($_GET['PackageID']?$_GET['PackageID']:'');
$query ="select C.Component_Name, C.Display_Order, PC.PPD,C.flag, PC.Amount, PC.Amount_Unit_Of_Measure, PC.Daily_Value from $dbname.Product_Component PC INNER JOIN $dbname.Components C ON PC.ComponentID= C.Componen... | true |
15a7bf8528f1ac9feafa7d7b762059c3725ec594 | PHP | rueduphp/octo | /lib/memorylog.php | UTF-8 | 753 | 3.0625 | 3 | [
"MIT"
] | permissive | <?php
namespace Octo;
class Memorylog
{
/**
* @var array
*/
private static $logs = [];
/**
* @param string $type
* @param array $arguments
*/
public static function __callStatic(string $type, array $arguments)
{
$message = array_shift($arguments);
static::... | true |
61603d8ede987c2ee5379ba1412d30e76ae76f6f | PHP | devamrfoley/chefaa-back | /app/Http/Controllers/Api/ProductController.php | UTF-8 | 791 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Services\ProductService;
use Illuminate\Http\Request;
class ProductController extends Controller
{
protected $productService;
public function __construct(ProductService $productService)
{
$this->productService... | true |
25127286753d3f522d98676d9e02a30aedbc0a18 | PHP | scriptotek/php-alma-client | /src/Users/User.php | UTF-8 | 5,765 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Scriptotek\Alma\Users;
use Scriptotek\Alma\Client;
use Scriptotek\Alma\Model\LazyResource;
/**
* A single User resource.
*/
class User extends LazyResource
{
/**
* The primary id or some other id that can be used to fetch user information.
*
* @var string
*/
public $id;
... | true |
f74a6394775195d3e3e68ac3367cc4e63c487d12 | PHP | zabudkin/PhpBootstrap | /tests/PhpBootstrap/Html/Form/Element/ButtonTest.php | UTF-8 | 2,885 | 2.671875 | 3 | [] | no_license | <?php
namespace PhpBootstrap\Html\Form\Element;
require "./vendor/autoload.php";
use PHPUnit_Framework_TestCase as PHPUnit;
/**
* Form Button Test
*
* @author Jaime Neto <contato@jaimeneto.com>
*/
class ButtonTest extends PHPUnit
{
protected $button;
protected function setUp()
{
$this->... | true |
a0d0f5168f3f364e9f74599b798b0a1c4481d331 | PHP | fooflighters/photoalbum | /admin.php | UTF-8 | 3,144 | 2.5625 | 3 | [] | no_license | <?php
require 'app/start.php';
$objects = $s3->getIterator('ListObjects', [
'Bucket' => $config['s3']['bucket']
]);
require_once ("app/database_settings.php");
$conn = @mysqli_connect($host,
$user,
$pwd,
$sql_db
);
if(!$conn) {
echo "<p>Database connection failure</p>";
}
?>
<!DOCTYPE html>
<h... | true |
9c7ce2a89244133e15f037b8340d0cb0b094d31c | PHP | vlytvyne/Camagru | /models/PhotoBoothModel.php | UTF-8 | 704 | 2.71875 | 3 | [] | no_license | <?php
include_once 'BaseModel.php';
class PhotoBoothModel extends BaseModel {
function savePhoto($imgBase64) {
$imgBase64 = str_replace('data:image/png;base64,', '', $imgBase64);
$imgBase64 = str_replace(' ', '+', $imgBase64);
$imgData = base64_decode($imgBase64);
$fileName = uniqid() . '.png';
$filePath ... | true |
7f774dbd237eed77234aeff7d77bacafb100f46b | PHP | luciemannechez/recipes | /src/RecipesBundle/DataFixtures/ORM/LoadUser.php | UTF-8 | 1,608 | 2.578125 | 3 | [] | no_license | <?php
// src/RecipesBundle/DataFixtures/ORM/LoadUser.php
namespace RecipesBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Doctrine\Common\DataFixtures\AbstractF... | true |
cf6e80fb358f60d87b05353b1e35311c55105058 | PHP | robwittman/php-notifications | /src/Notifier.php | UTF-8 | 2,518 | 3.109375 | 3 | [] | no_license | <?php
namespace Notifier;
use \Notifier\Client;
use \Notifier\Notification;
use \Notifier\Connection;
class Notifier {
/**
* URL of the servers to send events to
* @var string
*/
protected static $uri = 'http://localhost';
/**
* Token to use for authentication
* @var sriing
... | true |
f0bf71854b0b4711c612d1eef60b286443a62b69 | PHP | alvaritojose2712/sistema_nomina | /webmail/tdah/webmail/inc/class/class.uebimiau_mail.php | UTF-8 | 33,836 | 2.578125 | 3 | [] | no_license | <?php
class UebiMiau extends UebiMiau_core {
var $_current_folder = "";
var $_sysmap = Array(
"inbox" => "inbox",
"sent" => "sent",
"spam" => "spam",
"trash" => "trash");
var $_system_folders = Array(
"inbox",
"sent",
"spam",
"trash");
var $... | true |
4629e4104f891426fb75d547d26028c7571d6af6 | PHP | Ryoalrui/Practice | /test/HW TEST/02/handle.php | UTF-8 | 2,440 | 2.734375 | 3 | [] | no_license | <?php
/*图片处理*/
//包含文件
require_once './lib/Db.php';//数据库处理类
require_once './lib/Pic.php';//图片上传类
require_once './lib/Image.php';//图片处理类
//实例化图片上传类,在检查无误情况下,才能进行添加水印和缩略大小等操作
$Pic = new Pic($_FILES);
if ($Pic->checkError()) {
//判断用户是否添加了图片描述,否的话弹窗提示后直接跳转首页
if (strlen($_POST['info'])<=0) {
echo "<script>... | true |
02951428aded9fd1956fa23753304e16eefb0ec8 | PHP | aurbano/Wikiline | /lib/import/dayParser.php | UTF-8 | 8,532 | 3.046875 | 3 | [] | no_license | <?php
/**
* Wikipedia Parser - Scrapes day articles for dates and events
*
*
* @package Wikiline
*/
include('../session.php'); // Session management
include('../wikipedia.api.php'); // Load Wikipedia php API
class DayParser{
// Wikipedia API
private $wiki;
// Placeholder for the extracted even... | true |
44a5fdc13f40a33064c20aa8f590baea8ae3b734 | PHP | leonardorifeli/reactphp | /vendor/react/async/src/React/Async/Util.php | UTF-8 | 2,770 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace React\Async;
class Util
{
public static function series($tasks, $callback = null, $errback = null)
{
$results = array();
$taskCallback = function ($result) use (&$results, &$next) {
$results[] = $result;
$next();
};
$done = function () ... | true |
4e4b392f30af5aa42b24bb6cad23c3ab0cfb34b5 | PHP | mpeshehonov/Codeabbey | /practice/#16/index.php | UTF-8 | 358 | 3.21875 | 3 | [] | no_license | <?php
$buffer = fopen("input.txt","r+");
$count = fgets($buffer);
for ($i = 0; $i < $count; $i++) {
$result = 0;
$values = fgets($buffer);
$values = explode(" ", $values);
array_pop($values);
$length = count($values);
$result = array_sum($values)/$length;
$result = round($result, 0 ,PHP_ROUN... | true |
a0750133c882ca829161b55f5841dab6f8e1902d | PHP | sg-first/A3PhpSafe | /FileValidation.php | UTF-8 | 1,759 | 3.109375 | 3 | [] | no_license | <?
class FileValidation{
/*
处理原理:对图片类型进行简单的检测,并以原图进行重新生成(重新生成会打乱其中的恶意代码)
使用方法:用此函数替换move_uploaded_file(仅针对gif png与jpg图片)
参数:$file $_FILES['']获取的值,$path 图片生成的物理路径(包含图片名称)
返回值:上传成功 true,图片类型异常 -1,上传失败 false
*/
public static function ImageSave($file, $path)
{
if ($file["type"] == "image/gif")
{
@... | true |
1498842212074a188c1081b3c30e2c9b74175725 | PHP | smart-io/geo | /src/Geo.php | UTF-8 | 1,300 | 2.9375 | 3 | [
"MIT"
] | permissive | <?php
namespace Smart\Geo;
use Smart\Geo\Country\CountryRepository;
use Smart\Geo\Region\RegionRepository;
class Geo
{
/**
* @var Storage
*/
private static $storage;
/**
* @var CountryRepository
*/
private static $countryRepository;
/**
* @var RegionRepository
*/
... | true |