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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
62fe6b3b203221164c0bc81a3862da22e7144d07 | PHP | X-Coder264/webshop_veralux_promet | /app/Http/Controllers/HomeController.php | UTF-8 | 1,814 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\Http\Controllers;
use App\Product;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$products = Product:... | true |
99e75b6f2643880cff63c120c555f07a3250c3b2 | PHP | GreenIceTeam/greenice | /frontend/modules/member/models/SignupForm.php | UTF-8 | 4,782 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace frontend\modules\member\models;
use common\models\User;
use yii\base\Model;
/**
* Signup form
*/
class SignupForm extends Model
{
public $username;
public $etudiant;
public $statutSocial;
public $domaineEtude;
public $domaineActivite;
public $email;
public $password;
... | true |
9067a7169ef260a9a3fd1c4744dcbc90d0a64ea7 | PHP | TakNePoidet/VkApiSDK | /src/ApiTypes/Base/LinkProduct.php | UTF-8 | 415 | 2.703125 | 3 | [] | no_license | <?php
namespace VkApiSDK\ApiTypes\Base;
use VkApiSDK\BaseType;
use VkApiSDK\ApiTypes;
class LinkProduct extends BaseType {
protected static $requiredParams = [];
protected static $map = [
'price' => ApiTypes\Market\Price::class,
];
protected $price;
public function setPrice($price) {
$... | true |
b3fc4961bd70acf4f24abf0804c7d002d1f74351 | PHP | krukas/phpstanM2 | /src/Type/IntegerType.php | UTF-8 | 581 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types = 1);
namespace PHPStan\Type;
class IntegerType implements Type
{
use JustNullableTypeTrait;
public function combineWith(Type $otherType): Type
{
if ($otherType instanceof self) {
return new self();
}
return TypeCombinator::combine($this, $otherType);
}
public function des... | true |
f1ee8fb9c33b8f0046cb2b6861a49100de2337b3 | PHP | munizeverton/sistemaacademico | /app/Http/Requests/MatriculaRequest.php | UTF-8 | 817 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class MatriculaRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get ... | true |
23ed7fab462d381a142cf0a25da645b51977b066 | PHP | KNY00/dropbox-php-sdk | /tests/Models/AccessTokenTest.php | UTF-8 | 1,653 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
use PHPUnit\Framework\TestCase;
class AccessTokenTest extends TestCase
{
/** @var string $testedClass */
public static $testedClass = 'Kunnu\Dropbox\Models\AccessToken';
/**
* TODO: test and remove bearer property
*
*/
public function testConstructorCallsInternalMethods()
{
... | true |
4741f98d08940218d53a305511817f998c7c9301 | PHP | ax14m/PestsLandMolinos | /eliminarProductos.php | UTF-8 | 431 | 2.578125 | 3 | [] | no_license | <?php
include("BaseDatos.php");
//1. Recibo el id que voy a eliminar por la URL(GET)
$idEliminar=($_GET["id"]);
//2.crear el objeto de la clase Base Datos
$transaccion= new BaseDatos();
//3. Crear la consula SQL para eliminar
$consultaSQL="DELETE FROM productos WHERE idProducto='$idElim... | true |
0a41cab9bdcb53e8ff98c38b3468295bc49eb4df | PHP | niuyafei/lyb_version_2.0 | /common/models/ExpertComments.php | UTF-8 | 1,797 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace common\models;
use Yii;
/**
* This is the model class for table "collegenode_expert_comments".
*
* @property integer $comment_id
* @property integer $user_id
* @property integer $case_id
* @property integer $expert_id
* @property string $content
* @property string $video
* @property string $... | true |
af39625435ed4a839cc8dc1e3b6c79c1715e6422 | PHP | PG2000/SessionHandler | /src/SessionHandler/RedisSessionHandler.php | UTF-8 | 5,762 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
namespace PG2000\SessionHandler;
/**
* Redis based session storage with session locking support
*/
class RedisSessionHandler implements \SessionHandlerInterface
{
/**
* @var \Redis
*/
protected $redis;
/**
* @var int
*/
protected $ttl;
/**
* @var string
*/
... | true |
7eaef1de2474901425ef16291ea0b522f5da7dcb | PHP | Raskatov/PHP | /02.03 Пробельные символы.php | UTF-8 | 1,334 | 3.125 | 3 | [] | no_license | <?php
trim
string trim ( string $str [, string $character_mask = " \t\n\r\0\x0B" ] )
/*Эта функция возвращает строку str с удаленными из начала и конца строки пробелами. Если второй параметр не передан,
trim() удаляет следующие символы:
" " (ASCII 32 (0x20)), обычный пробел.
"\t" (ASCII 9 (0x09)), символ табуляции.
... | true |
29b42c825fb6679de41fb7272fe6358d964b40fd | PHP | fabianrios/rocket | /model/helpers/creditohelper.helper.php | UTF-8 | 704 | 2.71875 | 3 | [] | no_license | <?php
class CreditoHelper
{
public static function selectCreditos ( $extra = "", $extraTables = "" )
{
$connection = Connection::getInstance();
$retrieveCreditosSql = "SELECT consumo_id
FROM cons_consumos" . $extraTables . "
WHERE 1=1
" . $extra;
return $connectio... | true |
feca6f33e1e6f006e1fd383e239e736e4e4c2ffa | PHP | RomanVK/JSON-Schema-research | /tests/UserValidatorTest.php | UTF-8 | 1,949 | 2.671875 | 3 | [] | no_license | <?php
require_once(__DIR__ . '/../src/UserValidator.php');
class UserValidatorTest extends PHPUnit_Framework_TestCase
{
/**
* @var UserValidator
*/
private $user_validator;
public function setUp()
{
$this->user_validator = new UserValidator();
}
/**
* @return array
... | true |
037a98ef16e60182c00454a36fe3a8fb12387f8e | PHP | asta-kit/AstaKit.FriWahl.BallotBoxBackend | /Classes/AstaKit/FriWahl/BallotBoxBackend/Command/BallotBoxSessionCommandController.php | UTF-8 | 4,579 | 2.53125 | 3 | [] | no_license | <?php
namespace AstaKit\FriWahl\BallotBoxBackend\Command;
/* *
* This script belongs to the TYPO3 Flow package "AstaKit.FriWahl.BallotBoxBackend". *
* ... | true |
0ea8b8edaeb8a7d630a41d4c73c2b91fb5751a66 | PHP | lonadels/FlowerVK | /src/app/modules/VKChat.php | UTF-8 | 759 | 2.546875 | 3 | [] | no_license | <?php
namespace app\modules;
use app;
class VKChat
{
private $chat;
function __construct($api, $chatId, $data=null){
$params = new MethodParams();
$params->chat_ids = $chatId;
$params->fields = 'nickname, screen_name, sex, bdate, city, country, timezone, photo_50, photo_100, phot... | true |
fb7b97e4ad3bb4d1762b521f9fc96a31ecbd7f5b | PHP | Pathmila/Second-Year-Group-Project | /Hotel/php/test.php | UTF-8 | 1,348 | 2.75 | 3 | [] | no_license | <html>
<head>
<title>easytravels </title>
</head>
<body>
<?php
$servername="localhost";
$username="root";
$password="";
$dbname="easytravels";
$connection=mysqli_connect($servername,$username,$password,... | true |
65d16e568b14b83762001c9bea0acd8036929f95 | PHP | foxvlad/OkBitUDP | /modules/okbit/!!!Скрипты для отладки/cycle_udp_okbit.php | UTF-8 | 3,779 | 2.71875 | 3 | [] | no_license | <?php
/*
php udp socket сервер
*/
//функция записи в лог полученного сообщения
function log_write($s_mess, $s_ip, $s_port){
$dt = date("d-m-Y H:i:s");
$text = $dt . ' - ' . $s_ip . ', ' . $s_port . " - " . $s_mess .PHP_EOL;
$fp = fopen ("cycle_udp_log.txt", "a+"); //!!! лог файл
fwrite($fp,$text);... | true |
8d1434de4e5150c420fdb634336f8babac14fa62 | PHP | vnideal/web-api | /app/Exceptions/Handler.php | UTF-8 | 1,861 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Exceptions;
use App\Traits\ApiResponser;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\C... | true |
a58bb0ebba4b776efb0217e69131b38a3f02c09b | PHP | devchrisd/BookClub | /src/AppBundle/Form/Data/MemberData.php | UTF-8 | 1,318 | 2.859375 | 3 | [] | no_license | <?php
namespace AppBundle\Form\Data;
use AppBundle\Model\BodyType;
use AppBundle\Model\Ethnicity;
use AppBundle\Model\Category;
use AppBundle\Model\Member;
final class MemberData
{
const CLASS_NAME = __CLASS__;
public $username;
public $password;
public $city;
public $postalCode;
public $dat... | true |
bc609c49b4d564115949711888bf3db8720ac998 | PHP | genbodev/trademux-framework | /classes/database/dbtypes/dbint.class.php | UTF-8 | 167 | 2.8125 | 3 | [] | no_license | <?php
/**
* Type for integer values, do not adds '' to value
*
*/
class dbInt extends dbType
{
function __construct($value)
{
$this->stor = (int)$value;
}
}
| true |
09a10dfb08f9534ef83c90317f75351deb640c57 | PHP | valentinalarcon/webservice | /Rest/Projects/Rest/Rest/app/Http/Controllers/DemoController.php | UTF-8 | 2,709 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class DemoController extends Controller
{
public function rut(Request $request){
Log::info("Comienza Función RUT");
$gets = $request->json()->all();
... | true |
72b31b57f985f12746655a2160c06653df09067d | PHP | zanematthew/mybmx.events | /app/Console/Commands/ShovelRequestEventCommand.php | UTF-8 | 3,121 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\ShovelEvent as ShovelEvent;
use Illuminate\Support\Facades\Storage;
class ShovelRequestEventCommand extends Command
{
use \App\ShovelTrait;
/**
* The name and signature of the console command.
*
* @var string
*... | true |
70e749ae86021955d9db3fd9ee2891f38994b452 | PHP | jeyfost/argosfm | /scripts/ajaxCustomer.php | WINDOWS-1251 | 941 | 2.71875 | 3 | [] | no_license | <?php
include('connect.php');
$customerResult = $mysqli->query("SELECT * FROM users WHERE id = '".$_POST['id']."'");
$customer = $customerResult->fetch_assoc();
echo "
<center>
<span class='admLabel'> </span>
<br /><br />
</center>
";
if(!empty($customer['organisation']))
{
echo "
<span class... | true |
e9d4c1eccb04ca127f5c63d8305bf094360b6c4d | PHP | AlexSashik/todo-new | /library/Cocktail/Banana.php | UTF-8 | 407 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace Cocktail;
/**
* Class Banana расширяет базовый компонент "протеиновый коктейль"
* @package Cocktail
*/
class Banana extends Additions
{
/**
* Добавляем в коктейль банан
* @return mixed|string
*/
public function getCocktail()
{
return parent::getCocktail().' с банан... | true |
5d95a3f0ea8795ce97d2723a32e62171a508a994 | PHP | BariqDharmawan/portfolio-api | /app/Http/Requests/SkillCategoryRequest.php | UTF-8 | 1,042 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class SkillCategoryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* ... | true |
5f88508e1a9eef8f7468d64b90feb1b5d7541eee | PHP | supervisorphp/configuration | /spec/Writer/FlysystemWriterSpec.php | UTF-8 | 1,397 | 2.5625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace spec\Supervisor\Configuration\Writer;
use League\Flysystem\Filesystem;
use PhpSpec\ObjectBehavior;
use Supervisor\Configuration\Configuration;
use Supervisor\Configuration\Writer\FlysystemWriter;
use Supervisor\Configuration\Writer\WriterInterface;
use Supervisor\Configuration\Exception\WriterExceptio... | true |
2cb3dce7fcf2b20f16abb68b08eeb3e0ebca7383 | PHP | yarbsemaj/DrinkAp | /website/app/view/Ingridient_list.php | UTF-8 | 511 | 2.703125 | 3 | [] | no_license | <?php
//Links the include file, setups the site to work the DB etc.
include ("../../include.php");
//Injection protection, do this with every field
//SQL Queary
$sql="SELECT * FROM Ingredient";
mysql_set_charset('utf8');
$query = mysql_query($sql) or die(mysql_error());
//Get all results in a PHP array
$results... | true |
ee47ecc6002d773ec249eba504f2f5e5240b87a0 | PHP | spout/laravel-boilerplate | /app/Models/Favorite.php | UTF-8 | 487 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
class Favorite extends Model
{
protected $guarded = [];
protected $dates = ['created_at', 'updated_at'];
public static function verboseName()
{
return _i("favorite");
}
public static function verboseNamePlural()
{
return _i("favorites");
}
... | true |
c3006709d3279bbe01a8e6f0df63b5cec93093b1 | PHP | mm0/innobackupex | /src/Tradesy/Innobackupex/SSH/Configuration.php | UTF-8 | 3,370 | 3.046875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace Tradesy\Innobackupex\SSH;
use Tradesy\Innobackupex\Exceptions\FileNotFoundException;
use Tradesy\Innobackupex\Exceptions\FileNotReadableException;
/**
* Class Connection
* @package Tradesy\Innobackupex
* Requires: PECL libssh2
*/
class Configuration
{
/**
* @var string
*/
protec... | true |
d1cea77ec1581b7e191182f1373f73764dc1a942 | PHP | durianstudio85/edproject | /app/Http/Controllers/MycourseController.php | UTF-8 | 3,334 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Course;
use App\Lesson;
use App\User;
use App\Enroll;
use App\Complete;
use Auth;
class MycourseController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
/**
... | true |
c584aacb922439f64d76570332c10bf831cae705 | PHP | skingori/shared | /newschool/improve/calender.php | UTF-8 | 3,666 | 2.984375 | 3 | [] | no_license |
<?php
class Calendar
{
var $events;
function Calendar($date)
{
if(empty($date)) $date = time();
define('NUM_OF_DAYS', date('t',$date));
define('CURRENT_DAY', date('j',$date));
define('CURRENT_MONTH_A', date('F',$date));
define('CURRENT_MONTH_N', date('n',$date));
define('CURRENT_YEA... | true |
248b8860cbfd67bab9f600ff8859e796cffcdb5f | PHP | gopankombiyil/samplecode | /database/migrations/2016_04_15_133224_create_schools_table.php | UTF-8 | 966 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSchoolsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('schools', function (Blueprint $table) {
$t... | true |
41978434fcaf52cda683a41f7ef65c6a8699b387 | PHP | quarter64/zhuanyiwang | /classes/common.php | UTF-8 | 2,356 | 2.65625 | 3 | [] | no_license | <?php
/**
* @brief 公共方法集合
* @class Common
* @note 公开方法集合适用于整个系统
*/
class Common
{
/**
* @brief 获取语言包,主题,皮肤的方案
* @param string $type 方案类型: theme:主题; skin:皮肤; lang:语言包;
* @param string $theme 此参数只有$type为skin时才有用,获取任意theme下的skin方案;
* @return string 方案的路径
*/
public static function getSitePlan($type,$theme... | true |
10b0b8e06c5f5b4f2b76573ae629c36542befbb5 | PHP | aissam97/Introduction-au-PHP | /les functions/Les boucles/exercice5.php | UTF-8 | 95 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
$var1 = 1;
while ($var1 < 15){
echo "On y arrive presque";
$var1++;
echo "<br>";
}
?> | true |
4eb6117dddd4c8cb8bc85d469d71c478108dbb5d | PHP | czhi-heng/CTF101-Web-Security-Fall2015 | /challenges/web/lfi/grader/login.php | UTF-8 | 628 | 2.53125 | 3 | [] | no_license | <?php
$login=@$_POST['login'];
$password=@$_POST['password'];
if(@$login=="admin" && sha1(@$password)==$pwhash){
//don't bother logging in
//try something else
}else if (@$login&&@$password&&@$_GET['debug']) {
echo "Login error, login credentials has been saved to ./".htmlentities($login).".log";
$logfile = "./".$l... | true |
d3ae360eea810c795b484ef08adf40c2b66a2d7b | PHP | adrianet86/tic_tac_toe | /src/TicTacToe/Domain/Game/Game.php | UTF-8 | 5,345 | 3.09375 | 3 | [] | no_license | <?php
namespace TicTacToe\Domain\Game;
use Ramsey\Uuid\Uuid;
use TicTacToe\Domain\User\User;
class Game
{
const MAX_FIELDS = 9;
const HORIZONTAL_1 = [1, 2, 3];
const HORIZONTAL_2 = [4, 5, 6];
const HORIZONTAL_3 = [7, 8, 9];
const VERTICAL_1 = [1, 4, 7];
const VERTICAL_2 = [2, 5, 8];
co... | true |
94f0b30f811a7e5a1e8becb3bec5d63115539933 | PHP | Stolz/php-stubs | /res/php/hw/functions/hw-document-bodytag.php | UTF-8 | 229 | 2.578125 | 3 | [
"Apache-2.0",
"CC-BY-3.0"
] | permissive | <?php
/**
* Body tag of hw_document
*
* @phpstub
*
* @param int $hw_document
* @param string $prefix
*
* @return string Returns the BODY tag as a string.
*/
function hw_Document_BodyTag($hw_document, $prefix = NULL)
{
} | true |
ea4dd4fe8b66aa27a7bb3d390048f797c4cad7d2 | PHP | FirdousBhat/git_demo_rnw | /r_and_w/api/search_product.php | UTF-8 | 3,598 | 2.609375 | 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.
*/
class SearchProducts{
function process(){
$input = $_REQUEST['product_name'];
$page = $_REQUEST['page... | true |
424014068a74914856de29990037e0aa05f9ce3c | PHP | MickaelFernandes7/CV-projeto | /login.php | UTF-8 | 467 | 2.734375 | 3 | [] | no_license | <?php
//declaração de servidor, indireta.
$server = 'localhost';
$user = 'root';
$password = 'root';
$database = 'projeto2';
//Criar conexão ao banco de dados
$strcon = mysqli_connect($server, $user, $password, $database);
// Teste de Conexão - Check Connection.
#se a conexão falhou, metodo die, encerra a conexão
if... | true |
4c73e2cffb9f7e8df53067f4ba3dec934cd084b5 | PHP | GeeH/piggie | /test/PiggieTest/Application/ApplicationTest.php | UTF-8 | 1,636 | 2.625 | 3 | [] | no_license | <?php
/**
* Created by Gary Hockin.
* Date: 06/02/2015
* @GeeH
*/
use Piggie\Renderer;
class ApplicationTest extends \PHPUnit_Framework_TestCase
{
public function testAddMiddleware()
{
$name = 'miami';
$renderer = $this->getRendererMock();
$application = new Piggie\Applicat... | true |
89557ba21916268477ec93798866550f5f1226c6 | PHP | apility/forms-php | /src/Apility/Forms/Concerns/SerializesFormField.php | UTF-8 | 1,490 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace Apility\Forms\Concerns;
use Exception;
use Apility\Forms\Contracts\FormField;
use Illuminate\Support\HtmlString;
trait SerializesFormField
{
public static function bootFormFieldSerializer()
{
if (!in_array(FormField::class, class_implements(static::class))) {
throw new Ex... | true |
0a5e6372a928f25d1c2c01c127698dca8b485731 | PHP | mdelgadof/appAranBack | /fichas/cuadro.php | UTF-8 | 3,130 | 2.640625 | 3 | [] | no_license | <?php
include('../inc/inc.php');
include('../inc/funcionesImagenes.php');
function subeImagenFicha($imagen, $idFicha){
$arrayExt=explode('.', $imagen[name]);
$extension=$arrayExt[count($arrayExt)-1];
$nombre=$idFicha.'.'.$extension;
if ($extension!='jpg' && $extension!='jpeg' && $extension!='gif' && $extension!=... | true |
d2030cbe9bdf321a1e33a989732ae779d6303cda | PHP | RomanyU1662160/HealthCentre7.1 | /app/Models/Patient.php | UTF-8 | 2,377 | 2.921875 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Carbon\carbon;
use Laravel\Scout\Searchable;
class Patient extends Model
{
use Searchable;
protected $fillable = [
'fname', 'lname', 'email', 'gender','mobile','house','postcode','address','dob','avatar', 'patient_number','doctor_i... | true |
e4d22e5122395856cdad3ac46e9e817e7061d860 | PHP | rubythonode/genealogy | /app/Http/Controllers/Event/EventController.php | UTF-8 | 1,277 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Event;
use App\Event;
use App\Forms\Builders\EventForm;
use App\Http\Controllers\Controller;
use App\Http\Requests\ValidateEventRequest;
class EventController extends Controller
{
public function create(EventForm $form)
{
return ['form' => $form->create()];
}
... | true |
a16c8f1ee51d130f8a5c4449e362743df8127b60 | PHP | Symfony-Plugins/sfSearchPlugin | /symfony/lib/browser/xfSymfonyBrowserResponse.class.php | UTF-8 | 1,141 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
/**
* This file is part of the sfSymfonySearch package.
* (c) Carl Vondrick <carl.vondrick@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* A browser response that contains the data returned by xfSy... | true |
17d4ce722764afb8b8c15f2df3fe137a18ffff98 | PHP | jpmariano/snippets | /drupal/3. PHP FOR BEGINNERS/05. Connecting to MySQL in PHP/lesson.php | UTF-8 | 2,023 | 2.921875 | 3 | [] | no_license | <?php
//Syntax for Database connection
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
$pdo = new PDO('mysql:host=localhost;dbname=test', 'root', null);
$result = $pdo->query('SELECT * FROM pet');
$pets = $result->fetchAll();
//var_dump($pets);
?>
<?php
require 'lib/functions.php';
// $pets... | true |
b333ac6d832c1f0b834c41fe13abbd60d09a00bb | PHP | gbecchio/learn-poo-php | /lib/dp/injectionDeDependance/Container.php | UTF-8 | 946 | 2.953125 | 3 | [] | no_license | <?php
namespace id;
include "User.php";
include "SessionStorage.php";
/**
* @author Grégroy Becchio
* @since 20/11/2013
* @version 0.1
* classe conteneur
**/
use id\User;
use id\SessionStorage;
class Container
{
protected $parameters;
public function __construct(array $parameters)
{
$this->parameters... | true |
71facf67bfbb84482682d993c173774d9677ab80 | PHP | Anib999/CollegeRepo | /application/models/FileModel.php | UTF-8 | 1,474 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class FileModel extends CI_Model{
public function __construct(){
parent::__construct();
}
public function getAllFiles(){
$all_pics = $this->db->get('pictures');
return $all_pics->result();
}
function get_all_pics(){
$all_pic... | true |
d1023c3513a4b60ae1c913832a0d7e011fd1d4f9 | PHP | waloeh/selesai | /7-lulus.php | UTF-8 | 2,456 | 2.84375 | 3 | [] | no_license | <?php
$conn = mysqli_connect('localhost', 'root', '', 'perpustakaan');
$data = mysqli_query($conn, "SELECT kategori.nama, buku.name, buku.stock, buku.gambar, buku.description FROM buku INNER JOIN kategori ON buku.id_category = kategori.id_category");
// $rows = [];
// while ($row = mysqli_fetch_assoc($data) ) {
// $... | true |
a311096896bbffda8f71626462f91b6ddfc69629 | PHP | comfystudio/corrcheck | /_ajax-get-reg-with-companyid.php | UTF-8 | 978 | 2.875 | 3 | [] | no_license | <?php
include($_SERVER["DOCUMENT_ROOT"] . "/inc/all-includes.php");
// If form is submitted process it
if(!empty($_POST)){
$query = "
SELECT
t1.*
FROM tbl_vehicles t1
WHERE t1.company_id = :id
";
try {
// Execute the query to create the use... | true |
b43e6e64f31067e2368f12bad3ce42fa487c633d | PHP | vikramraj87/code-kata | /spec/NumberToStringSpec.php | UTF-8 | 5,555 | 2.890625 | 3 | [] | no_license | <?php
namespace spec;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class NumberToStringSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('NumberToString');
}
function it_returns_zero_for_0()
{
$this->generate(0)->shouldReturn('zero');
... | true |
998720076d22281c673ec9a919d779a2e057456a | PHP | Tisho84/conference | /app/Http/Requests/PaperRequest.php | UTF-8 | 1,418 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use App\Classes\PaperStatus;
use App\Http\Requests\Request;
class PaperRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
... | true |
88507a7e951c036e67c717164e7bd96217a5b93c | PHP | netzmensch/hurricane | /sys/classes/parsers/boldText.php | UTF-8 | 393 | 2.828125 | 3 | [] | no_license | <?php
namespace redcross\hurricane\classes\parsers;
use redcross\hurricane\classes\abstractParser;
/**
* Class boldText
* @package redcross\hurricane\classes\parsers
*/
class boldText extends abstractParser
{
/**
* @return void
*/
public function parseContent()
{
$this->replaceContent... | true |
787e157e4b3d3b551270b85140eee1b1060920b4 | PHP | jakecorn/User-Management-System | /UserManagementSystem/app/Http/Controllers/UserController.php | UTF-8 | 2,368 | 2.71875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
class UserController extends Controller
{
public function createForm(){
return view('user_registration');
}
public function create(Request $request){
$this->validaInput($request);
$user = new User;... | true |
4611d9cd4d61cdb96e56987491bb7820da024720 | PHP | neitanod/SLGTerm | /SLGTerm/TraitObservable.php | UTF-8 | 649 | 2.875 | 3 | [] | no_license | <?php
namespace SLGTerm;
require_once(__DIR__."/Bus.php");
require_once(__DIR__."/Event.php");
trait Observable {
protected $bus;
protected function init_observable() {
$this->bus = new \SLGTerm\Bus();
}
public function on(string $eventType, callable $callback) {
$this->bus->addList... | true |
4d1efe4ca2789611f325327ab55f0710ab998784 | PHP | rmrbest/PhpDeveloperTest | /StrategyDaily.php | UTF-8 | 790 | 3 | 3 | [] | no_license | <?php
include_once 'Ifaces/IStrategy.php';
include_once 'StrategyDraw.php';
class StrategyDaily extends StrategyDraw implements IStrategy {
public function getDraw(\DateTime $date, $next_or_last, $frequency) {
// Daily
if ($next_or_last == 'Last' && $date->format("H:i:s") <= $this->getDrawTime... | true |
cba91ec4f17b04e23bb58564c149d58b03ac5111 | PHP | ideum/open-exhibits-my-gallery | /collection.php | UTF-8 | 1,930 | 2.953125 | 3 | [] | no_license | <?php
if(isset($_GET['title']) && isset($_GET['total']) && isset($_GET['name']) && isset($_GET['file'])){
$title = $_GET['title'];
$name = $_GET['name'];
$total = (int) $_GET['total'];
$images = array();
$file = $_GET['file'];
//Save all the images passed in as an array of id's
for($j = 1; $j <= $total; $j++... | true |
82920ec0d716c2569f40c85f9b31eb80c5d5bb91 | PHP | c-daney/depository | /common/tools/Download.php | UTF-8 | 1,551 | 2.78125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: QSQ-YYH
* Date: 16/6/17
* Time: 下午6:50
*/
namespace common\tools;
use Yii;
class Download
{
/**
* Download Csv File
* @param string $filename
* @param ActiveDataProvider $query
* @param Array $line 该数组每项为一个两项数组,label为列名称,value为该项内容的回调函数
*
... | true |
2679d51e4324c8bc2030e2fb614784127603f139 | PHP | erickayanez/IntroPhp | /app/Models/Job.php | UTF-8 | 631 | 3 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Job extends Model{
//extends BaseElement cuando los datos estaban definidos en codigo
protected $table='jobs';
public function getDuracionString(){
//Funcion que indica cuantos años y cuantos meses
$years= floor($this->months/12);
... | true |
9cef90e81e956a971132180451268b6b94925f7e | PHP | guoyu07/stato-svn | /trunk/webservice/lib/request.php | UTF-8 | 406 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
class SWebServiceRequest
{
public $protocol = null;
public $service = null;
public $method = null;
public $params = null;
public function __construct($protocol, $service, $method, $params)
{
$this->protocol = $protocol;
$this->service = $service;
... | true |
7d658a9d78ff563c307bb0319f7d0f6f378f31c7 | PHP | andraice/mantPlan | /app/Http/Controllers/EquipmentBrandController.php | UTF-8 | 3,927 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\DataTables\EquipmentBrandDataTable;
use App\Http\Requests;
use App\Http\Requests\CreateEquipmentBrandRequest;
use App\Http\Requests\UpdateEquipmentBrandRequest;
use App\Repositories\EquipmentBrandRepository;
use Flash;
use App\Http\Controllers\AppBaseController;
use Respo... | true |
3c4cf138931754d1fbaaa45c587581f4b88ea274 | PHP | k4rtik/Campus-Radio | /code/cr/functions/basic/nlecho.php | UTF-8 | 190 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
function nlecho()
{
$args = func_get_args();
echo '<li>';
foreach ($args as $arg)
{
if (is_string($arg))
echo $arg;
else
echo var_export($arg, TRUE);
}
echo "\n";
}
?>
| true |
4e198fee54a5ad479d73b05b6fa7406fe2c9df45 | PHP | annaran/DogPal | /lib/apis/loadprofiledata.php | UTF-8 | 412 | 2.515625 | 3 | [] | no_license | <?php
require_once('db.php');
$sUserId = $_GET['id'] ?? '';
if (empty($sUserId)) {
exit;
}
try {
$stmt = $db->prepare('SELECT u.*, p.url
FROM users u
left join pictures p
on u.picture_id = p.id
where u.id = :iUserId');
$stmt->bindValue(':iUserId', intval($sUserId));
$stmt->execute();
$ro... | true |
5a8788c9fcbd50d72ab5d3955af14bd741c475e4 | PHP | akop0505/fus_school_public | /models/search/ChannelSearch.php | UTF-8 | 1,857 | 2.71875 | 3 | [] | no_license | <?php
namespace app\models\search;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Channel;
/**
* ChannelSearch represents the model behind the search form about `app\models\Channel`.
*/
class ChannelSearch extends Channel
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[[... | true |
515cf434e7c5a8c02b96bb8d9e3ddd4069bfffaf | PHP | anhtran6789/hocphp | /manage.php | UTF-8 | 1,907 | 2.59375 | 3 | [] | no_license | <?php
include('db.php');
$error="";
$id="0";
$username="";
$email="";
$password="";
if(isset($_POST['btnsave']))
{
$username=$_POST['txt_username'];
$email=$_POST['txt_email'];
$password=$_POST['txt_password'];
if(strlen($username)<6)
{
$error="User toi thieu 6 ky tu";
}
else
{
if($_POST['txtid']=="0")
{... | true |
d25a1c8cef1ce4facef43d4c343cc5b8419a0cec | PHP | anjorinjnr/dining | /server/app/Chefme/Repository/SubjectRepository.php | UTF-8 | 1,143 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace Chefme\Repository;
use Chefme\Models\Subject;
class SubjectRepository extends Repository {
public function create($data) {
$subject = $this->getSubjectByName($data['title']);
return ($subject) ? $subject : Subject::create($data);
}
public function get($id) {
$sub... | true |
5f73f0442b2307f680d522c1856a49b73a3807e5 | PHP | joekenpat/jobman | /app/Services/StateSearch.php | UTF-8 | 1,298 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
use App\Models\State;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Builder;
class StateSearch
{
public static function apply(Request $filters, $per_page = 20)
{
$query = static::applyDecoratorsFromRequest($filters, (new State)->newQue... | true |
cbaab2d8d213e2f316cd669ef6cabca906891f88 | PHP | ktzhang/City-of-Heroes | /api/populate_vol_names.php | UTF-8 | 1,505 | 3.078125 | 3 | [] | no_license | <?php
// Script that helps populate data in the city of heroes Opps'
// database table. We're looking up EID's based on names, and
// populating that information in the Opps' table.
mysql_connect("airnature.corp.yahoo.com", "root", "");
mysql_select_db("city_of_heroes");
// Pull all the volunteers
$sql = 'SELECT OID,... | true |
a7b0d446016d8b112e38a48d6e2a7c0128998d18 | PHP | sitbc/mantra-cafe | /js/email.php | UTF-8 | 953 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
$subject = $_REQUEST['subject'] . 'Üzenet a honlapon keresztül'; // Subject of your email
$to = "balazs.peter@outlook.com"; //Recipient's E-mail
$charset="UTF-8";
$ctencoding="8bit";
$email_title = "Az üzenet tartalma";
$spam = $_REQUEST['spam'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "From: " . ... | true |
cf7365c64d9ba301a7e1c4e97317848b8afe23df | PHP | DerManoMann/acache | /src/Radebatz/ACache/WincacheCache.php | UTF-8 | 2,388 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the ACache library.
*
* (c) Martin Rademacher <mano@radebatz.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Radebatz\ACache;
/**
* Wincache cache.
*
* @author Martin Rademacher <mano@r... | true |
1ef21b69f658106593be4ce912471dea89303477 | PHP | gamezxii/couponsystem | /Model/pexportData.php | UTF-8 | 3,690 | 2.546875 | 3 | [] | no_license | <?php
include 'config.php';
$conn = getDB();
## Read value
$draw = $_POST['draw'];
$row = $_POST['start'];
$rowperpage = $_POST['length']; // Rows display per page
$columnIndex = $_POST['order'][0]['column']; // Column index
$columnName = $_POST['columns'][$columnIndex]['data']; // Column name
$columnSortOrder = $_POS... | true |
4170af32faee82dbf93312b40ca42b59de7f1f1f | PHP | humane-help/api | /app/Services/ArticleService.php | UTF-8 | 7,348 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
use App\Exceptions\UnexpectedErrorException;
use App\Helpers\FileHelper;
use App\Models\Article;
use App\Models\Language;
use App\Repositories\Contracts\ArticleRepository;
use App\Services\Contracts\ArticleService as ArticleServiceInterface;
use App\Services\Traits\ServiceTranslateTable;... | true |
ac2045e695fa6f5b7281387965d51d2efb273d57 | PHP | FMTCco/php-integrations | /src/Apis/ImpactRadius/Requests/GetActions.php | UTF-8 | 3,922 | 2.53125 | 3 | [] | no_license | <?php
namespace FMTCco\Integrations\Apis\ImpactRadius\Requests;
use FMTCco\Integrations\Traits\SimpleSerializable;
class GetActions implements \JsonSerializable
{
use SimpleSerializable;
/**
*
* @var int|null
*/
protected $CampaignId;
/**
* @var string|null
*/
protect... | true |
e348259407ceb0c53f68b70a42159f48acc92098 | PHP | tuaki/fksdb | /app/model/Fyziklani/TaskCode/ClosedSubmittingException.php | UTF-8 | 657 | 2.65625 | 3 | [] | no_license | <?php
namespace FKSDB\model\Fyziklani;
use Nette\Application\BadRequestException;
use ORM\Models\Events\ModelFyziklaniTeam;
/**
* Class ClosedSubmittingException
* @package FKSDB\model\Fyziklani
*/
class ClosedSubmittingException extends BadRequestException {
/**
* ClosedSubmittingException constructor.
... | true |
a117cc2ca9c1b6ce38734cbe4afd1d7e791334d6 | PHP | ncastellano/aulav02022018 | /app/Http/Controllers/BaseController.php | UTF-8 | 621 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
class BaseController extends Controller {
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
{
if ( ! is_null($this->layout))
{
$this->layout = View::make($this->layout);
}
}
public function __construct(){
$tipo_usuario = 'alumno';
... | true |
cd22b1620428fe5e265dced3b7a590f5217557b1 | PHP | aduil/MVFRM | /lib/Registry.php | UTF-8 | 918 | 2.96875 | 3 | [] | no_license | <?php
namespace lib;
/**
* Registry
*/
class Registry
{
private static $_instance = null;
private static $datas = array();
private function __construct()
{
self::$datas = array();
}
public static function getInstance()
{
if(is_null(self::$_instance)) {
self::$_... | true |
62c79c07b0aa83e9e29c9ca90fb35a5d0ffe7f2c | PHP | akshayarunkumar/Bike-rental-system | /bkr/signup.php | UTF-8 | 2,113 | 2.640625 | 3 | [] | no_license | <?php
$dbhost = "localhost:3307";
$dbuser = "root";
$dbpass = "";
$dbname = "dreambikes";
$conn1 = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to database");
$username = $_POST['username'];
$password = $_POST['password'];
$emaid = $_POST['emailid'];
$phone = $_POST['phone... | true |
6d0fad912126936db19bfca72dd5eab73f52435e | PHP | glogi32/php1 | /PHP1 sajt/konekcija.php | UTF-8 | 489 | 2.671875 | 3 | [] | no_license | <?php
try {
$konekcija = new PDO("mysql:host=localhost;dbname=electronic_shop;charset=utf8","root","");
$konekcija->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
$konekcija->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e){
echo $e->getMessage();
}
f... | true |
55d91a5a426fbe22d47447972099581c262bac89 | PHP | john007buc/savantcafe | /src/John/UsersBundle/Entity/User.php | UTF-8 | 14,817 | 2.546875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | <?php
namespace John\UsersBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use Serializable;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueE... | true |
c94f02694ce7f460332eb32b8e4754a24098cfa1 | PHP | ysnvpr/platform | /src/Domains/Resource/Nav/NavGuard.php | UTF-8 | 1,503 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace SuperV\Platform\Domains\Resource\Nav;
use SuperV\Platform\Domains\Auth\Contracts\User;
class NavGuard
{
/**
* @var \SuperV\Platform\Domains\Resource\Nav\Nav
*/
protected $nav;
/**
* @var \SuperV\Platform\Domains\Auth\User
*/
protected $user;
public function _... | true |
fc6c6faeeeee5284a39ed85472b0f22c4ccd5d39 | PHP | fissible/php7-cli-app | /src/Exceptions/MissingArgumentException.php | UTF-8 | 367 | 2.734375 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace PhpCli\Exceptions;
use Exception;
class MissingArgumentException extends Exception
{
public function __construct(string $parameterName, Exception $previous = null)
{
$message = sprintf('Command missing required parameter "<%s>"', $parameterName);
paren... | true |
d1ae32657672e4be1c162c3f5370f0145e824208 | PHP | Gogotchuri/Powershare_V1.1 | /app/Http/Controllers/User/CommentController.php | UTF-8 | 4,255 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\User;
use App\Http\Resources\Collection\CommentsResource;
use App\Http\Resources\Entity\CommentResource;
use App\Models\References\CampaignStatus;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Val... | true |
86cfbfccba8372265eb9ba2596b36b5f6d210602 | PHP | culturesofknowledge/site-portal | /omk-wemlo/html/plugins/RecordRelations/models/Table/RecordRelationsRelation.php | UTF-8 | 7,213 | 2.625 | 3 | [
"GPL-3.0-or-later",
"GPL-3.0-only",
"MIT"
] | permissive | <?php
class Table_RecordRelationsRelation extends Omeka_Db_Table
{
protected $_targetAlias;
protected $_targetTable;
public function findOne($params)
{
$select = $this->getSelectForFindBy($params);
return $this->fetchObject($select);
}
public function applySearchFilters($selec... | true |
bd1a35502ad54b27d6acc36da24a3a5b6706b322 | PHP | corphi/wordpress-registration-date | /tests/autoloader.php | UTF-8 | 450 | 2.515625 | 3 | [] | no_license | <?php
spl_autoload_register(
/**
* Try to load a Corphi WordPress test class.
*
* @param string $name
*
* @return bool
*/
function ( $name ) {
static $prefix = 'Corphi\\WordPress\\Tests\\';
if ( 0 !== strpos( $name, $prefix ) ) {
return false;
}
$name = substr( $name, strlen( $prefix ) - 1 )... | true |
6aa177be0373d9dc04fcc00bad386f479fbd235e | PHP | SrPhilippe/learning | /php/database/teste 03/includes/verify.php | UTF-8 | 1,610 | 2.546875 | 3 | [] | no_license | <?php
session_start();
include 'connection.php';
// Recebe informação se usuário está criando conta ou se registrando
if (isset($_GET['type'])) {
$type = $_GET['type'];
if($type === 'login') {
$username = $_POST['username'];
$password = $_POST['password'];
if (empty($username) || empty($password)) {
header... | true |
627c3496cdfb4fb26d9fc520b77129d09332d3c6 | PHP | ready4god2513/Journal | /application/models/user.php | UTF-8 | 1,374 | 2.59375 | 3 | [] | no_license | <?php
class User_Model extends Auth_User_Model
{
public $has_many = array('journals');
protected $validates_presence_of = array('email', 'username');
protected $validates_uniqueness_of = array('email', 'username');
public $formo_ignores = array('logins', 'last_login');
/**
* Create a new user
* @Devel... | true |
7e4d4efac74429ad451bee136f753880693a03fa | PHP | jatin0777/jatin-github | /oops/abstract.php | UTF-8 | 307 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | <?php
abstract class base{
public function demo(){
echo "hello jatin";
}
//abstract function demo1();
}
class child extends base {
/*function demo1()
{
echo "hi sankit";
// TODO: Implement demo1() method.
}*/
}
$obj=new child();
$obj->demo();
?> | true |
544263b0fa055fbe21c58da5ddb07d97ae21ebb5 | PHP | lordsimcity/MainDendo | /main_backend/emailsSending/Emails.php | UTF-8 | 2,820 | 2.734375 | 3 | [] | no_license | <?php
namespace EmailsSending;
use Swift_Mailer;
use Swift_Message;
use Swift_SmtpTransport;
class Emails {
private $_userEmail;
private $_emailObject;
private $_emailContent;
public function __construct($userEmail,$emailObject,$emailContent) {
$this->_userEmail = $userEmail;
$this... | true |
1874295971803a208cd47ddac3654bf078fa886c | PHP | derprek/TeamBrioche | /app/Message.php | UTF-8 | 724 | 2.515625 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Message extends Model
{
protected $fillable = ['receiver_email', 'sender_email', 'title', 'content', 'conv_id', 'status'];
public function scopeGetConversationSender($query, $prac_email)
{
$query->where('sender_email', '=', $prac_em... | true |
614018fd006ba33d5a2e27510cc90865736eaef0 | PHP | wangangel/LeeDemo | /library/Config.php | UTF-8 | 2,145 | 2.859375 | 3 | [] | no_license | <?php
/**
* Config.php
*
* User: 670554666@qq.com
* Date: 2016/7/20 13:18
*/
final class Config
{
/**
* @var array|null 配置数组
*/
private $_configArray = null;
/**
* 导入配置
*
* load(ROOT . 'application/config/exceptionCode.php') / load(['asd' => 123])
*
* @param mixed $... | true |
14a5c85f59ef589f4faa2c7c2ab7dfd654d9e624 | PHP | tikired/automotora | /marca/modificar.php | UTF-8 | 2,143 | 2.859375 | 3 | [] | no_license | <?php
$bd = new PDO('mysql:host=localhost;dbname=auto', 'root', '');
$mensaje = "";
if (isset($_POST['marca']) && isset($_POST['modelo'])) {
//Se reciben datos nuevos para insertar
$sql = "UPDATE marca_vehiculos SET MARCA_VEHICULO = '{$_POST['marca']}', MODELO_VEHICULO = '{$_POST['modelo']}', PRECIO = '{$_POST['... | true |
8a1760096c37f4fc8cd247f3ebe6da17c8b11b01 | PHP | FredGut4Github/SiteLaboratoireL2G | /lib/lib_ws.php | UTF-8 | 6,014 | 2.65625 | 3 | [] | no_license | <?php require_once('../lib/JWT.php');?>
<?php
function RenewJSONWebToken($id,$profile,$delay,$livetime)
{
$tokenId = base64_encode(mcrypt_create_iv(32));
$issuedAt = time();
$notBefore = $issuedAt + $delay; //Adding 10 seconds
$expire = $notBefore + $livetime; // Adding 60 seconds
$serverName = 'http:... | true |
0749f71734be0122277f598130da4d4af56772b8 | PHP | tristanlins/merger2 | /src/Bit3/Contao/Merger2/StandardFunctions.php | UTF-8 | 5,839 | 2.625 | 3 | [] | no_license | <?php
/**
* Merger² - Module Merger for Contao Open Source CMS.
*
* @copyright 2013,2014 bit3 UG
* @author Tristan Lins <tristan.lins@bit3.de>
* @author David Molineus <david.molineus@netzmacht.de>
*
* @link http://bit3.de
*
* @license LGPL-3.0+
*/
namespace Bit3\Contao\Merger2;
/**
* Class S... | true |
50988bf3d93b5b20431409c8538a3b6423dc938d | PHP | autumnHigh/shop.eleb.com_php_Eat | /app/Models/Menu.php | UTF-8 | 860 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Menu extends Model
{
//声明要操纵的表
protected $table='menus';
//声明要操作的字段
protected $fillable=['goods_name','rating','shop_id','category_id','goods_price','description','month_sales','rating_count','tips','satisfy_count','satisfy_rat... | true |
6ecfdb92e067a3f8917d41a115e15b4a7ca44411 | PHP | Markoradonic/PHP-Oop-Mini-Cms | /classes/UserLogin.php | UTF-8 | 1,240 | 2.8125 | 3 | [] | no_license | <?php
session_start();
include_once '/../config/config.php';
class UserLogin {
public $status;
private $db;
public function __construct()
{
global $config;
$this->db = new PDO('mysql:host='.$config["db_host"].';dbname='.$config["db_name"].';charset=utf8mb4', ''.$config[... | true |
52c84b4d2e3ccf8ae3426b4b26cca2b0f2faeb19 | PHP | Davi-o/teste-contato-seguro | /api/util/Standardize.php | UTF-8 | 373 | 2.953125 | 3 | [] | no_license | <?php
namespace Util;
/**
* Trait Standardize
* @package Util
*/
trait Standardize
{
/**
* @param array $fields
* @return array
*/
public static function formatFields($fields = []): array
{
foreach ($fields as $name => &$value) {
$value = htmlspecialchars(strip_tags(... | true |
31f1c8a62a6018a2046c856512b2e5a6d45ef953 | PHP | Nairi66/messenger | /reg_log/verify.php | UTF-8 | 808 | 2.53125 | 3 | [] | no_license | <?php
if (isset($_GET['verif_key'])) {
$v_key = $_GET['verif_key'];
$conn = mysqli_connect("localhost", "root", "", "messenger");
$result = mysqli_query($conn, "SELECT status, verif_key FROM users WHERE status = 0 AND verif_key = '$v_key' LIMIT 1");
if ($result->num_rows == 1) {
$update = mysqli_... | true |
62ad1ce313efcd8149836f24ff761277b35a7bbc | PHP | rayvoelker/2015RoeschLibraryInventory | /php/inventory_barcode.php | UTF-8 | 4,205 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
function left_pad_number($number, $pad_amount) {
//returns a string value of a number padded out to the maximum length of the $pad_amount
//if the length of the number is the same or greater than the pad_amount, just return the number unpadded
if ( strlen($number) >= $pad_amount ) {
return $number;
}
... | true |
715491773dfea6969f3fc4a9efcd75acc1817cbc | PHP | Aymeric-kun/TP3-JANNOT-Aymeric | /api/index.php | UTF-8 | 499 | 2.515625 | 3 | [] | no_license | <?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
require DIR . '/vendor/autoload.php';
$app = AppFactory::create();
$app->get('/hello/{name}',
function (Request $resquest, Response $response,... | true |
3552b71789f1f43e1ca6ceb9eb99d79249606d6b | PHP | vganeshkamath/Book-Ledger | /insert.php | UTF-8 | 658 | 2.734375 | 3 | [] | no_license | <?php
$link = mysqli_connect("localhost","root","kams","books");
if(mysqli_connect_error()){
echo " Error!<br>";
}else{
echo " Connected successfully!";
}
$book_title = $_POST['title'];
$author_name = $_POST['author'];
$edition = $_POST['edition'];
$year = $_POST['year'];
$pric... | true |
43a1309fc081021e44bef2f93196e86909235cd3 | PHP | zhang0821/mirror-falling | /newFalling/controller/database.php | UTF-8 | 1,028 | 2.78125 | 3 | [] | no_license | <?php
function connect_database()
{
// $handle=mysql_connect("192.168.1.102","root","zhang");
$handle=mysql_connect("localhost","root","zhang");
mysql_query("set names 'utf8'");
mysql_select_db("bodydetect");
return $handle;
}
class Database
{
var $handle;
function __construct()
{
$this->handle=c... | true |